- Timestamp:
- 11/05/2017 07:52:45 AM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
atmsdriver/TrafficEventsAnimator.java (modified) (9 diffs)
-
tmcsim/application.properties (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/TrafficEventsAnimator.java
r226 r227 20 20 21 21 /** 22 * 22 * Read and process all Traffic Events in a file and show 23 * resulting highway network. 24 * A snapshot of the highway model after each event is saved in a buffer 25 * and a graphical display allows the user to scroll through the history. 26 * This application is used by Traffic Event authors to assist 27 * in verifying the correctness of their data file. 23 28 * @author jdalbey 24 29 */ … … 28 33 * Error logger. 29 34 */ 30 private static Logger logger = Logger.getLogger("trafficmodeleventdriver");35 private final static Logger logger = Logger.getLogger("trafficmodeleventdriver"); 31 36 32 37 /** … … 38 43 * LinkedList of batch events 39 44 */ 40 private LinkedList<TrafficEvent> eventQueue;45 private final LinkedList<TrafficEvent> eventQueue; 41 46 /** 42 47 * Map of incidents to events … … 48 53 private List<String> history; 49 54 /** 50 * Creates new form HighwayDisplayPanel 51 * 52 * 53 * Read and process all Traffic Events in a file and show 54 * resulting highway network. 55 * A console display of the highway network is output 56 * for each event. 57 * This application is used by Traffic Event authors to assist 58 * in verifying the correctness of their data file. 59 * Because the output is sent immediately to the console the 60 * author doesn't have to sit through simulation time to 61 * observe dots changing on ATMS client. 62 * @author jdalbey 63 */ 64 55 * Creates the JPanel and builds the highways and events. 56 */ 65 57 public TrafficEventsAnimator() throws RemoteException, SimulationException 66 58 { … … 92 84 eventQueue = TrafficModelManager.readBatchFile(fileScanner); 93 85 } 94 public void run() 86 /** Load the traffic events into a history buffer */ 87 public void load() 95 88 { 96 89 txtDisplay.setText("Loading ..."); … … 101 94 // Get next event 102 95 TrafficEvent nextEvent = eventQueue.peek(); 103 //System.out.println("LAUNCHING EVENT: " + nextEvent.toString());96 System.out.println(nextEvent.eventTime); 104 97 // apply colorization to highways 105 98 highways.applyColorToHighwayStretch(nextEvent.routeNumber, nextEvent.dir, … … 110 103 } 111 104 scrollBar.setMaximum(history.size()); 105 // display the first item from the history 112 106 txtDisplay.setText(history.get(0)); 113 107 } … … 157 151 private void scrollbarValueChanged(java.awt.event.AdjustmentEvent evt)//GEN-FIRST:event_scrollbarValueChanged 158 152 {//GEN-HEADEREND:event_scrollbarValueChanged 159 153 // when the scroll bar is moved show the corresponding snapshot from history 160 154 txtDisplay.setText(history.get(evt.getValue()) ); 161 155 repaint(); 162 156 }//GEN-LAST:event_scrollbarValueChanged 163 157 158 /** Entry point for the application. Builds a surrounding JFrame and 159 * runs the application. 160 * @param args 161 * @throws RemoteException 162 * @throws SimulationException 163 */ 164 164 public static void main(String[] args) throws RemoteException, SimulationException 165 165 { … … 170 170 frame.add(display); 171 171 frame.setVisible(true); 172 display. run();172 display.load(); 173 173 } 174 174 -
trunk/src/tmcsim/application.properties
r226 r227 1 #Sun, 05 Nov 2017 0 8:48:54-07001 #Sun, 05 Nov 2017 09:02:37 -0700 2 2 3 Application.revision=22 53 Application.revision=226 4 4 5 5 Application.buildnumber=78
Note: See TracChangeset
for help on using the changeset viewer.
