Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1a5dab1
GUI for primitive roads
kumarawijeet Feb 24, 2016
4a2f14d
Merge branch 'master' into GUI_Graphics_Kumar_Awijeet
lexaux Feb 25, 2016
8968089
Descriptive diagram for Kumar.
lexaux Feb 27, 2016
ce6a800
Small changes to primitives
kumarawijeet Feb 27, 2016
96e3769
Primitive class can now draw a double cross road, some minor errors e…
kumarawijeet Feb 27, 2016
62f860a
Graphics problem - resolved for now
kumarawijeet Feb 27, 2016
2958c5d
The roads are now capable of being at any angles in the double cross …
kumarawijeet Feb 27, 2016
dfcdfcf
Simulation added for double cross road -doesn't work though
kumarawijeet Feb 27, 2016
fdf8e75
Normal UML changes
kumarawijeet Feb 27, 2016
85dfbca
GUI for primitive roads
kumarawijeet Mar 2, 2016
e1ec5f2
GUI for primitive roads
kumarawijeet Mar 2, 2016
cb706a2
GUI Primitives, works for a road and a car
kumarawijeet Mar 2, 2016
e6b276c
GUI Primitives, Minor design changes
kumarawijeet Mar 2, 2016
c48f7b9
Removed actual car painting code (no need for it now).
lexaux Mar 2, 2016
07aa8fc
Normal UML changes
kumarawijeet Mar 2, 2016
0e173f6
GUI Primitives - rotation
kumarawijeet Mar 2, 2016
b00e90f
Returned the actual road drwaing code to see affine transform changes.
lexaux Mar 2, 2016
770cb76
GUI Primitives - rotation
kumarawijeet Mar 2, 2016
06a7ad3
Changed the car drawing with an image. Much better now, easy to contr…
kumarawijeet Mar 3, 2016
6b09ddc
Pushing for updating new maps
kumarawijeet Mar 16, 2016
ae0f24c
One car added, hopefully no need to replicate pictures files for smoo…
kumarawijeet Mar 20, 2016
dc510e2
Small small fixes.
kumarawijeet Mar 20, 2016
26775ec
Truck added.
kumarawijeet Mar 20, 2016
13ef310
Few minor changes as commented by others in the oull request.
kumarawijeet Mar 21, 2016
34ce0d8
Minor changes only.
kumarawijeet Mar 21, 2016
57100e9
Pictures commit, hope this works.
kumarawijeet Mar 21, 2016
105b0c9
Second picture commit
kumarawijeet Mar 21, 2016
4fe82d6
Removed my function call from the SimulationImageProducer, now the fi…
kumarawijeet Mar 21, 2016
28ca852
Changed the map to initial stage, hope by adding to main it won't des…
kumarawijeet Mar 21, 2016
3de9724
Merge branch 'master' into GUI_Graphics_Kumar_Awijeet
lexaux Mar 21, 2016
2891e94
A bit of cleaned up code.
lexaux Mar 21, 2016
feabfdb
Merge remote-tracking branch 'origin/master' into GUI_Graphics_Kumar_…
lexaux Mar 22, 2016
6e248ac
The cars are now produced faster, for a 500cars with 25 fps the time …
kumarawijeet Mar 25, 2016
23c3d11
The cars are now produced faster, for a 500cars with 25 fps the time …
kumarawijeet Mar 25, 2016
ea44ac5
Few logging changes.
kumarawijeet Mar 26, 2016
11e323f
Few logging changes.
kumarawijeet Mar 26, 2016
d61c658
The IOException now sends the message directly to the logger.
kumarawijeet Mar 27, 2016
0651852
Merge branch 'master' into GUI_Graphics_Kumar_Awijeet
kumarawijeet Mar 27, 2016
552f738
Slight modifications.
kumarawijeet Mar 27, 2016
7aae3c0
Merge remote-tracking branch 'origin/GUI_Graphics_Kumar_Awijeet' into…
kumarawijeet Mar 27, 2016
5d6ef57
Cleaning up of unused code
kumarawijeet Mar 27, 2016
42b8d58
Trying to add my function call to SimulationImageProducer.
kumarawijeet Mar 27, 2016
938a882
Merge remote-tracking branch 'origin/GUI_Graphics_Kumar_Awijeet' into…
kumarawijeet Mar 28, 2016
5215075
Have been able to finally add my calling functions.
kumarawijeet Mar 28, 2016
a416480
Have been able to finally add my calling functions.
kumarawijeet Mar 28, 2016
1ae338c
No output problem remains.
kumarawijeet Mar 28, 2016
ec08426
Minor changes, nothing new.
kumarawijeet Mar 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package kcl.teamIndexZero.traffic.gui;

import kcl.teamIndexZero.traffic.log.Logger_Interface;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
* Created by kumar awijeet on 2/24/2016. thanks for Working!!
*/
public class GUI_Primitives {
protected static Logger_Interface log;
InputStream imageStream;
int j = 0, k = 0;
Image image, image1;

public void drawSmallCar(int x3, int y3, double angleToXAxis, Graphics2D g) throws IOException {
drawCar(x3, y3, angleToXAxis, "gui/src/main/resources/sprites/bmw_z_top_view_clip_art_18132.jpg", g);
}

public void drawTruck(int x3, int y3, double angleToXAxis, Graphics2D g) throws IOException {
drawCar(x3, y3, angleToXAxis, "gui/src/main/resources/sprites/8460_st0640_117.jpg", g);
}

private void drawCar(int x3, int y3, double angleToXAxis, String filename, Graphics2D g) throws IOException {
/*
Files taken from
http://all-free-download.com/free-vector/car-vector-top-view-download.html
http://hdimagelib.com/trailer+truck+top+view
*/
Graphics2D graphics = g;
AffineTransform originalTransform = graphics.getTransform();
try {
AffineTransform newTransformation = new AffineTransform();
newTransformation.rotate(angleToXAxis, x3, y3);
graphics.setTransform(newTransformation);
//InputStream imageStream;
if ((filename == "gui/src/main/resources/sprites/bmw_z_top_view_clip_art_18132.jpg") && (k == 0)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got the point!
It should be faster now.

Instead of using extra variable for the flag, you could do much easier thing: check if the image itself is null or not. I.e.:

public class Primitives {
   ...
   private Image image1 = null;
   ...
   public drawCar(..., filename ) {
      if(image1 == null && filename = "/...car.png" ) {
          ... load image and file
          image1 = ImageIO.read(...)
      } 
      graphics.draw(... image);
}

However, you will need to maintain separate variable for each of the image, and check if filename == one or another. What you could do instead, is use Map<String, Image>, such as HashMap, to use store corresponding pairs of Path --> Image object, and the code would be like:

public class Primitives {
   private Map<String, BufferedImage> imageCache = new HashMap<>();
   ...
   public void drawCar(..., filename) {
       if(!imageCache.containsKey(filename)) {
         // load image, 
         BufferedImage im = ImageIO.read(...)
         imageCache.put(filename, im);
   }
   im = imageCache.get(filename) // we are sure now that it exists, as if it would have not, we would have already loaded it
   graphics.drawImage(im);
}

Does that make sense?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  No it makes no sense!!! Lol!!The flag, well your thing is also applicable and yeah we can switch to just checking null value.There is no need to use a variable to check for file names.‎ Just say filename == "address of file". Using a hash map will not be leading to improvement in speed, at least that's what I think. Your comments are not completely understandable on phone, so maybe I am wrong, let me have a look on comp tomorrow, and get back to you.                                                                                                                                                                                                   Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: Alexander CherednichenkoSent: Friday 25 March 2016 19:59To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In gui/src/main/java/kcl/teamIndexZero/traffic/gui/GUI_Primitives.java:
  • }
  • private void drawCar(int x3, int y3, double angleToXAxis, String filename, Graphics g) {
  •    /*
    
  •    Files taken from
    
  •    http://all-free-download.com/free-vector/car-vector-top-view-download.html
    
  •    http://hdimagelib.com/trailer+truck+top+view
    
  •    */
    
  •    Graphics2D graphics = (Graphics2D) g;
    
  •    AffineTransform originalTransform = graphics.getTransform();
    
  •    try {
    
  •        AffineTransform newTransformation = new AffineTransform();
    
  •        newTransformation.rotate(angleToXAxis, x3, y3);
    
  •        graphics.setTransform(newTransformation);
    
  •        //InputStream imageStream;
    
  •        if ((filename == "gui/src/main/resources/sprites/bmw_z_top_view_clip_art_18132.jpg") && (k == 0)) {
    

You got the point!
It should be faster now.

Instead of using extra variable for the flag, you could do much easier thing: check if the image itself is null or not. I.e.:

public class Primitives {
...
private Image image1 = null;
...
public drawCar(..., filename ) {
if(image1 == null && filename = "/...car.png" ) {
... load image and file
image1 = ImageIO.read(...)
}
graphics.draw(... image);
}

However, you will need to maintain separate variable for each of the image, and check if filename == one or another. What you could do instead, is use Map<String, Image>, such as HashMap, to use store corresponding pairs of Path --> Image object, and the code would be like:

public class Primitives {
private Map<String, BufferedImage> imageCache = new HashMap<>();
...
public void drawCar(..., filename) {
if(!imageCache.containsKey(filename)) {
// load image,
BufferedImage im = ImageIO.read(...)
imageCache.put(filename, im);
}
im = imageCache.get(filename) // we are sure now that it exists, as if it would have not, we would have already loaded it
graphics.drawImage(im);
}

Does that make sense?

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  Alex tried your image == null check, and somehow it takes the time back up, so it's better to leave it with the flags. I think this system works properly with respect to time, let it be that way, let's see other components, like I wanted to check if the flags were actually working, so will create a test for them and check that. Plus we also have to add logging for other exceptions. Also finish the finally branch. So let us see those sections. ‎Moreover, it's not like this code isn't working, so my suggestion is let's wrap it up and finish the rest so that we are able to get it merged and give time to report and other miscellaneous things as well.                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: Alexander CherednichenkoSent: Friday 25 March 2016 19:59To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In gui/src/main/java/kcl/teamIndexZero/traffic/gui/GUI_Primitives.java:
  • }
  • private void drawCar(int x3, int y3, double angleToXAxis, String filename, Graphics g) {
  •    /*
    
  •    Files taken from
    
  •    http://all-free-download.com/free-vector/car-vector-top-view-download.html
    
  •    http://hdimagelib.com/trailer+truck+top+view
    
  •    */
    
  •    Graphics2D graphics = (Graphics2D) g;
    
  •    AffineTransform originalTransform = graphics.getTransform();
    
  •    try {
    
  •        AffineTransform newTransformation = new AffineTransform();
    
  •        newTransformation.rotate(angleToXAxis, x3, y3);
    
  •        graphics.setTransform(newTransformation);
    
  •        //InputStream imageStream;
    
  •        if ((filename == "gui/src/main/resources/sprites/bmw_z_top_view_clip_art_18132.jpg") && (k == 0)) {
    

You got the point!
It should be faster now.

Instead of using extra variable for the flag, you could do much easier thing: check if the image itself is null or not. I.e.:

public class Primitives {
...
private Image image1 = null;
...
public drawCar(..., filename ) {
if(image1 == null && filename = "/...car.png" ) {
... load image and file
image1 = ImageIO.read(...)
}
graphics.draw(... image);
}

However, you will need to maintain separate variable for each of the image, and check if filename == one or another. What you could do instead, is use Map<String, Image>, such as HashMap, to use store corresponding pairs of Path --> Image object, and the code would be like:

public class Primitives {
private Map<String, BufferedImage> imageCache = new HashMap<>();
...
public void drawCar(..., filename) {
if(!imageCache.containsKey(filename)) {
// load image,
BufferedImage im = ImageIO.read(...)
imageCache.put(filename, im);
}
im = imageCache.get(filename) // we are sure now that it exists, as if it would have not, we would have already loaded it
graphics.drawImage(im);
}

Does that make sense?

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

imageStream = new BufferedInputStream(getClass().getResourceAsStream(filename));
image = ImageIO.read(imageStream);
graphics.drawImage(image, x3 - 18, y3 - 18, 40, 40, null);
k++;
} else if ((filename == "gui/src/main/resources/sprites/8460_st0640_117.jpg") && (j == 0)) {
imageStream = new BufferedInputStream(getClass().getResourceAsStream(filename));
image1 = ImageIO.read(imageStream);
graphics.drawImage(image1, x3 - 18, y3 - 18, 40, 40, null);
j++;
} else {
if (filename == "gui/src/main/resources/sprites/8460_st0640_117.jpg") {
graphics.drawImage(image1, x3 - 18, y3 - 18, 40, 40, null);
} else if (filename == "gui/src/main/resources/sprites/bmw_z_top_view_clip_art_18132.jpg") {
graphics.drawImage(image, x3 - 18, y3 - 18, 40, 40, null);
}
}
} catch (Exception e) {
e.printStackTrace();
if (e instanceof IOException) {
log.log_Fatal(e.getMessage(), "GUI_Primnitives");
}
if (e instanceof IllegalArgumentException) {
log.log_Error("Check function, parameter passing error", "GUI_Primitives");
} else {
log.log_Exception(e);
}
} finally {
graphics.setTransform(originalTransform);
if (imageStream != null) {
imageStream.close();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
Expand Down Expand Up @@ -43,6 +44,7 @@ public class SimulationImageProducer {
};
private static final Stroke BASIC_STROKE = new BasicStroke(1);
protected static Logger_Interface LOG = Logger.getLoggerInstance(SimulationImageProducer.class.getSimpleName());
protected static Logger_Interface log;
private final SimulationMap map;
private final GuiModel model;
private final Primitives primitives;
Expand All @@ -51,7 +53,6 @@ public class SimulationImageProducer {
private BufferedImage image = null;
private BufferedImage roadsImage = null;
private Graphics2D graphics;

//helper variable used to cycle colors when debugging road - helpful to spot issues in distribution.
private int debugRoadsColorCounter;

Expand Down Expand Up @@ -190,12 +191,21 @@ public void drawAllDynamicObjects() {
map.getObjectsOnSurface().forEach(mapObject -> {
Vehicle v = (Vehicle) mapObject;
GeoPoint point = v.getPositionOnMap();
int x, y;
x = (int) point.xMeters;
y = (int) point.yMeters;
if (point == null) {
return;
}

GUI_Primitives cars = new GUI_Primitives();
if (model.getViewport().getPixelsInMeter() < 1) {
primitives.drawCircle(graphics, point, 2, v.getColor(), true);
try {
cars.drawSmallCar(x, y, 2, graphics);
} catch (IOException e) {
log.log_Fatal(e.getMessage(), "SimulationImageProducer");

}
//primitives.drawCircle(graphics, point, 2, v.getColor(), true);
} else {
double bearing = v.getBearing();
primitives.drawSegment(graphics,
Expand All @@ -209,16 +219,26 @@ public void drawAllDynamicObjects() {
v.getColor(),
getStrokeByWidthMeters(v.getWidthMeters())
);
primitives.drawCircle(graphics, point, (int) (Math.floor(v.getWidthMeters() * model.getViewport().getPixelsInMeter())), Color.YELLOW, true);
try {
cars.drawSmallCar(x, y, bearing, graphics);
} catch (IOException e) {
log.log_Fatal(e.getMessage(), "SimulationImageProducer");
}
//primitives.drawCircle(graphics, point, (int) (Math.floor(v.getWidthMeters() * model.getViewport().getPixelsInMeter())), Color.YELLOW, true);
}

if (v.equals(model.getSelectedMapObject())) {
int radius = (int) (model.getViewport().getPixelsInMeter()
* ((Vehicle) model.getSelectedMapObject()).getDistanceToKeepToNextObject());
primitives.drawCircle(graphics,
try {
cars.drawSmallCar(x, y, radius, graphics);
} catch (IOException e) {
log.log_Fatal(e.getMessage(), "SimulationImageProducer");
}
/*primitives.drawCircle(graphics,
point,
radius,
v.getColor());
v.getColor());*/
primitives.drawText(graphics, point, v.getNameAndRoad(), v.getColor());
primitives.drawAngleVector(graphics, point, v.getBearing(), radius, 1, v.getColor(), true, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ private void startSimulatorWindow(OsmParseResult result) {
LOG.log_Exception(e);
}
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package kcl.teamIndexZero.traffic.gui;

import org.junit.Test;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;

/**
* Created by lexaux on 21/03/2016.
*/
public class GuiPrimitivesTest {

@Test
public void testDrawingPerformance() throws IOException {
// record time
GUI_Primitives primitives = new GUI_Primitives();

long timestamp = System.currentTimeMillis();
BufferedImage image = new BufferedImage(1000, 1000, BufferedImage.TYPE_INT_RGB);
Graphics2D g = (Graphics2D) image.getGraphics();
int count = 25 * 500;
while (count-- > 0) {
if (count % 2 == 1) {
primitives.drawSmallCar(count, count, Math.random(), g);
} else {
primitives.drawTruck(count, count, Math.random(), g);
}
}

long diff = System.currentTimeMillis() - timestamp;
System.out.println(diff);

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package kcl.teamIndexZero.traffic.log;

import kcl.teamIndexZero.traffic.log.fileIO.FileInput;
import kcl.teamIndexZero.traffic.log.FileIO.FileInput;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's bad.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  All I see again is "that's bad" so really don't know what you are referring to. Will check it when online to understand what you mean.                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: Alexander CherednichenkoSent: Monday 21 March 2016 08:11To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In log/src/main/java/kcl/teamIndexZero/traffic/log/Log_Config.java:

@@ -1,6 +1,6 @@
package kcl.teamIndexZero.traffic.log;

-import kcl.teamIndexZero.traffic.log.fileIO.FileInput;
+import kcl.teamIndexZero.traffic.log.FileIO.FileInput;

that's bad.

—You are receiving this because you authored the thread.Reply to this email directly or view it on GitHub

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you referring to? The double import statements? What is more surprising is that I didn't even touch the log files so don't know how did that end up there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lexaux When I pulled a fresh version of the project on Kumar's laptop some of the packages you manually renamed to lowercase registered as the old uppercase ones. Weird behaviour.
@kumarawijeet try renaming "kcl.teamIndexZero.traffic.log.FileIO.FileInput;" to "kcl.teamIndexZero.traffic.log.fileIO.FileInput; and see if it's still ok.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  Am on it, 5 minutes, hope it works.                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: EsSent: Monday 21 March 2016 09:34To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In log/src/main/java/kcl/teamIndexZero/traffic/log/Log_Config.java:

@@ -1,6 +1,6 @@
package kcl.teamIndexZero.traffic.log;

-import kcl.teamIndexZero.traffic.log.fileIO.FileInput;
+import kcl.teamIndexZero.traffic.log.FileIO.FileInput;

@lexaux When I pulled a fresh version of the project on Kumar's laptop some of the packages you manually renamed to lowercase registered as the old uppercase ones. Weird behaviour.
@kumarawijeet try renaming "kcl.teamIndexZero.traffic.log.FileIO.FileInput;" to "kcl.teamIndexZero.traffic.log.fileIO.FileInput; and see if it's still ok.

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay okay wait a sec gentlemen - I remember that problem.
@kumarawijeet pls do nothing on this one - I will sort it out myself; it is a weird bug in IDEA or something like that - it does not recognize things are changed from capital to lowercase and that's it. I'll fix it in Kumar's branch then.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  Es did that, as soon as I change it to small, error shows up. No clue, as to why.                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: EsSent: Monday 21 March 2016 09:34To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In log/src/main/java/kcl/teamIndexZero/traffic/log/Log_Config.java:

@@ -1,6 +1,6 @@
package kcl.teamIndexZero.traffic.log;

-import kcl.teamIndexZero.traffic.log.fileIO.FileInput;
+import kcl.teamIndexZero.traffic.log.FileIO.FileInput;

@lexaux When I pulled a fresh version of the project on Kumar's laptop some of the packages you manually renamed to lowercase registered as the old uppercase ones. Weird behaviour.
@kumarawijeet try renaming "kcl.teamIndexZero.traffic.log.FileIO.FileInput;" to "kcl.teamIndexZero.traffic.log.fileIO.FileInput; and see if it's still ok.

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  Thanks a lot alex, I just implemented ‎it :D. Anyway, will revert it back, fortunately didn't push it!! :)                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: Alexander CherednichenkoSent: Monday 21 March 2016 09:36To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In log/src/main/java/kcl/teamIndexZero/traffic/log/Log_Config.java:

@@ -1,6 +1,6 @@
package kcl.teamIndexZero.traffic.log;

-import kcl.teamIndexZero.traffic.log.fileIO.FileInput;
+import kcl.teamIndexZero.traffic.log.FileIO.FileInput;

okay okay wait a sec gentlemen - I remember that problem.
@kumarawijeet pls do nothing on this one - I will sort it out myself; it is a weird bug in IDEA or something like that - it does not recognize things are changed from capital to lowercase and that's it. I'll fix it in Kumar's branch then.

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  Reverted back to originals, no errors now, thanks @An7ar35 and @lexaux                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: Alexander CherednichenkoSent: Monday 21 March 2016 09:36To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In log/src/main/java/kcl/teamIndexZero/traffic/log/Log_Config.java:

@@ -1,6 +1,6 @@
package kcl.teamIndexZero.traffic.log;

-import kcl.teamIndexZero.traffic.log.fileIO.FileInput;
+import kcl.teamIndexZero.traffic.log.FileIO.FileInput;

okay okay wait a sec gentlemen - I remember that problem.
@kumarawijeet pls do nothing on this one - I will sort it out myself; it is a weird bug in IDEA or something like that - it does not recognize things are changed from capital to lowercase and that's it. I'll fix it in Kumar's branch then.

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub

import kcl.teamIndexZero.traffic.log.fileIO.FileOutput;
import kcl.teamIndexZero.traffic.log.microLogger.MicroLogger;
import kcl.teamIndexZero.traffic.log.outputs.Output;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package kcl.teamIndexZero.traffic.log.fileIO;
package kcl.teamIndexZero.traffic.log.FileIO;

import kcl.teamIndexZero.traffic.log.fileIO.FileIO;
import kcl.teamIndexZero.traffic.log.microLogger.MicroLogger;

import java.io.BufferedReader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package kcl.teamIndexZero.traffic.log.fileIO;

import kcl.teamIndexZero.traffic.log.FileIO.FileInput;
import org.junit.After;
import org.junit.Test;

Expand All @@ -24,7 +25,7 @@ public void tearDown() throws Exception {

@Test
public void testRead() throws Exception {
FileOutput out = new FileOutput("", "testRead.test");
kcl.teamIndexZero.traffic.log.fileIO.FileOutput out = new kcl.teamIndexZero.traffic.log.fileIO.FileOutput("", "testRead.test");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and that's not needed too

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                                                  Ok, it's just "and that's not needed too" so can't really get a hold of what you are trying to say. However I never changed anything in the log files, I only changed things in the guiprimitives, simulationimageproducer, and the guiprimitivetest, nothing else. So don't know what is the problem in log, but let me see the complete history on web and get back to you on that one.                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone on the EE network.                                                                                                                                                                                                                From: Alexander CherednichenkoSent: Monday 21 March 2016 08:11To: teamIndexZero/index_zero_trafficsystemReply To: teamIndexZero/index_zero_trafficsystemCc: kumar awijeetSubject: Re: [index_zero_trafficsystem] Gui graphics kumar awijeet (#9)In log/src/test/java/kcl/teamIndexZero/traffic/log/fileIO/FileInputTest.java:

@@ -24,7 +25,7 @@ public void tearDown() throws Exception {

 @Test
 public void testRead() throws Exception {
  •    FileOutput out = new FileOutput("", "testRead.test");
    
  •    kcl.teamIndexZero.traffic.log.fileIO.FileOutput out = new kcl.teamIndexZero.traffic.log.fileIO.FileOutput("", "testRead.test");
    

and that's not needed too

—You are receiving this because you authored the thread.Reply to this email directly or view it on GitHub

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After having a look too I am unable to draw the cause of these, as I never edited the Log and other files. Let me know what can be done to make sure it is changes, won't touch it myself as of now because I might end up making it worse, so just tell me what to do in this, I will delete that specific line only.

out.appendString("String 1" + System.lineSeparator());
out.appendString("String 2" + System.lineSeparator());
out.appendString("String 3");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void testGetThisGeneratorCreationCounter() throws Exception {
when(map.getObjectsOnSurface()).thenReturn(list);
tg.linkRoad(r1);
SimulationTick tick = mock(SimulationTick.class);
for (int i = 0; i < 50; i++) {
for (int i = 0; i < 100; i++) {
tg.tick(tick);
assertTrue(tg.getThisGeneratorCreationCounter() >= 0);
}
Expand Down
Binary file modified uml_diagrams/GUI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 21 additions & 2 deletions uml_diagrams/GUI.puml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,30 @@ class GuiController {
+pause()
}

class SimulationImageProducer {
+tick()
}

class Primitives {
+drawLine(obj, pos, graphics)
+drawCurve(obj, pos, graphics)
+drawDoubleCrossRoad(obj, pos, graphics)
}

Simulator --> SimulationImageProducer: calls tick()


GuiModel <-- SimulationImageProducer:update model \nwith new\nimages
SimulationImageProducer -> Primitives


class Simulator {
+start()
+stop()
+pause()
}
GuiController --> Simulator: Thread, \ncreate,\ncommand
Simulator --> GuiController: Invoke tick() \nmethod on \nsimulation \nupdates

GuiController --> Simulator: Thread, \ncreate,\ncommand

GuiController -> GuiModel: Update model state

Expand Down