Changeset 248 in tmcsimulator for trunk/src/atmsdriver
- Timestamp:
- 02/09/2019 08:18:35 AM (7 years ago)
- Location:
- trunk/src/atmsdriver
- Files:
-
- 4 edited
-
ATMSDriver.java (modified) (1 diff)
-
GoogleMapAnimator.java (modified) (2 diffs)
-
model/Highways.java (modified) (3 diffs)
-
model/PostmileCoords.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/ATMSDriver.java
r190 r248 8 8 import tmcsim.common.SimulationException; 9 9 10 /** 10 /** "Super Old" 11 11 * ATMS Driver reads the current simulation traffic conditions from the 12 12 * EXCHANGE.XML file and constructs the Highway Network status info in the -
trunk/src/atmsdriver/GoogleMapAnimator.java
r245 r248 33 33 * Error logger. 34 34 */ 35 private final static Logger logger = Logger.getLogger(" trafficmodeleventdriver");35 private final static Logger logger = Logger.getLogger("mapanimator"); 36 36 37 37 /** … … 195 195 public static void main(String[] args) throws RemoteException, SimulationException 196 196 { 197 JFrame frame = new JFrame(" Traffic EventsAnimator");197 JFrame frame = new JFrame("Google Map Animator"); 198 198 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 199 199 frame.setSize(1050,450); -
trunk/src/atmsdriver/model/Highways.java
r243 r248 545 545 for (Highway hwy: highways) 546 546 { 547 // Consider each route direction 548 //for (DIRECTION dir: DIRECTION.values()) 549 // TODO: Needs fixing so proper direction is displayed 550 Station.DIRECTION dir = Station.DIRECTION.SOUTH; 551 if (hwy.routeNumber == 55) 552 dir = Station.DIRECTION.SOUTH; 553 if (hwy.routeNumber == 405) 554 dir = Station.DIRECTION.NORTH; 555 { 556 String rowLabel = ""+String.format("%3s ",hwy.routeNumber)+dir.getLetter()+' '; 547 // For json output we don't care about listing all the stations 548 // in order by direction because we are just outputting points not lines. 549 { 550 // Examine every station on this highway and direction 557 551 StringBuilder lineout = new StringBuilder(); 558 // Examine every station on this highway and direction559 552 for (Station stat: hwy.stations) 560 553 { 561 String pmID = "" + hwy.routeNumber + " " + stat.postmile; 554 String pmID = "" + hwy.routeNumber + " " 555 + stat.direction.getLetter() + " " 556 + stat.postmile; 562 557 PostmileCoords.Postmile currentPM = pmList.find(pmID); 563 558 if (currentPM != null) … … 566 561 //lineout.append(stat.getColorByDirection(dir)); 567 562 String outString = currentPM.toJson(); 563 // replace the color code with the color name 568 564 String colorName=""; 569 switch (stat.getColorByDirection( dir))565 switch (stat.getColorByDirection(stat.direction)) 570 566 { 571 567 case '@': colorName = "red";break; … … 579 575 } 580 576 } 581 // See if there were stations for this direction 582 String checkMe = lineout.toString().trim(); 583 // if any stations were colored, output the line 584 if (checkMe.length() > 1) 585 { 586 //result.append(rowLabel); 587 result.append(lineout + "\n"); 588 } 577 //result.append(rowLabel); 578 result.append(lineout + "\n"); 589 579 590 580 } -
trunk/src/atmsdriver/model/PostmileCoords.java
r244 r248 54 54 { 55 55 String[] fields = item.split(","); 56 Postmile pm = new Postmile(fields[0],fields[1],fields[2]); 56 String[] nameparts = fields[0].split(" "); 57 String statepm = nameparts[2]; 58 // some postmiles come with a prefix, which we ignore 59 if (Character.isLetter(statepm.charAt(0))) 60 { 61 statepm = statepm.substring(1); 62 } 63 String revisedpm = nameparts[0] + " " + nameparts[1] + " " + statepm; 64 Postmile pm = new Postmile(revisedpm,fields[1],fields[2]); 57 65 postmileList.add(pm); 58 66 } … … 69 77 final static class Postmile 70 78 { 71 String name; // the postmile name or id79 String name; // the postmile name (Route,Direction,State postmile) 72 80 String latitude; // the latitude coordinate for this postmile 73 81 String longitude; // the longitude coordinate for this postmile
Note: See TracChangeset
for help on using the changeset viewer.
