Changeset 109 in tmcsimulator for trunk/src/tmcsim/client/ATMSDriverClient.java
- Timestamp:
- 10/12/2017 12:23:11 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/tmcsim/client/ATMSDriverClient.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/client/ATMSDriverClient.java
r105 r109 1 1 package tmcsim.client; 2 2 3 import atmsdriver.ConsoleDriver; 4 import atmsdriver.model.Highways; 5 import atmsdriver.model.Station; 3 6 import java.awt.event.ActionEvent; 4 7 import java.awt.event.ActionListener; … … 94 97 private Queue<String> eventQueue; 95 98 99 /** Instance of ConsoleDriver that contains the highway model */ 100 private ConsoleDriver console; 96 101 97 102 /** … … 109 114 System.exit(0); 110 115 } 111 116 Highways highways = new Highways( 117 "config/vds_data/lds.txt", 118 "config/vds_data/loop.txt", 119 "config/vds_data/highwaysMeta.txt", 120 "localhost", 8080); 121 console = new ConsoleDriver(highways); 122 112 123 connect(cadClientProp.getProperty(PROPERTIES.CAD_SIM_HOST.name).trim(), 113 124 cadClientProp.getProperty(PROPERTIES.CAD_RMI_PORT.name).trim()); … … 146 157 { 147 158 System.out.println("LAUNCHING EVENT at " + nextEvent ); 159 // Extract fields from event and prepare them 160 Scanner lineScan = new Scanner(nextEvent); 161 lineScan.next(); // skip time field 162 int routeNumber = lineScan.nextInt(); 163 Station.DIRECTION dir = Station.DIRECTION.toDirection(lineScan.next()); 164 double postmile = lineScan.nextDouble(); 165 int range = lineScan.nextInt(); 166 ConsoleDriver.DOTCOLOR dotcolor = ConsoleDriver.DOTCOLOR.toDotColor(lineScan.next()); 167 // apply colorization to highways 168 console.applyColorToHighwayStretch(routeNumber, dir, postmile, range, dotcolor); 169 // Remove this event from the queue, we're done with it. 148 170 eventQueue.remove(); 149 171 } 150 //theView.updateTime("" + formatInterval(simtime));151 172 } 152 173 }
Note: See TracChangeset
for help on using the changeset viewer.
