Changeset 227 in tmcsimulator for trunk


Ignore:
Timestamp:
11/05/2017 07:52:45 AM (8 years ago)
Author:
jdalbey
Message:

atmsdriver.TrafficEventsAnimator?.java: Small enhancement to console output and additional source code comments.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/TrafficEventsAnimator.java

    r226 r227  
    2020 
    2121/** 
    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. 
    2328 * @author jdalbey 
    2429 */ 
     
    2833     * Error logger. 
    2934     */ 
    30     private static Logger logger = Logger.getLogger("trafficmodeleventdriver"); 
     35    private final static Logger logger = Logger.getLogger("trafficmodeleventdriver"); 
    3136 
    3237    /** 
     
    3843     * LinkedList of batch events 
    3944     */ 
    40     private LinkedList<TrafficEvent> eventQueue; 
     45    private final LinkedList<TrafficEvent> eventQueue; 
    4146    /** 
    4247     * Map of incidents to events 
     
    4853    private List<String> history; 
    4954    /** 
    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     */ 
    6557    public TrafficEventsAnimator() throws RemoteException, SimulationException 
    6658    { 
     
    9284        eventQueue = TrafficModelManager.readBatchFile(fileScanner); 
    9385    } 
    94     public void run() 
     86    /** Load the traffic events into a history buffer */ 
     87    public void load() 
    9588    { 
    9689        txtDisplay.setText("Loading ..."); 
     
    10194            // Get next event 
    10295            TrafficEvent nextEvent = eventQueue.peek(); 
    103             //System.out.println("LAUNCHING EVENT: " + nextEvent.toString()); 
     96            System.out.println(nextEvent.eventTime); 
    10497            // apply colorization to highways 
    10598            highways.applyColorToHighwayStretch(nextEvent.routeNumber, nextEvent.dir, 
     
    110103        } 
    111104        scrollBar.setMaximum(history.size()); 
     105        // display the first item from the history 
    112106        txtDisplay.setText(history.get(0)); 
    113107    } 
     
    157151    private void scrollbarValueChanged(java.awt.event.AdjustmentEvent evt)//GEN-FIRST:event_scrollbarValueChanged 
    158152    {//GEN-HEADEREND:event_scrollbarValueChanged 
    159          
     153        // when the scroll bar is moved show the corresponding snapshot from history 
    160154        txtDisplay.setText(history.get(evt.getValue()) ); 
    161155        repaint(); 
    162156    }//GEN-LAST:event_scrollbarValueChanged 
    163157 
     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     */ 
    164164    public static void main(String[] args) throws RemoteException, SimulationException 
    165165    { 
     
    170170        frame.add(display); 
    171171        frame.setVisible(true); 
    172         display.run(); 
     172        display.load(); 
    173173    } 
    174174 
  • trunk/src/tmcsim/application.properties

    r226 r227  
    1 #Sun, 05 Nov 2017 08:48:54 -0700 
     1#Sun, 05 Nov 2017 09:02:37 -0700 
    22 
    3 Application.revision=225 
     3Application.revision=226 
    44 
    55Application.buildnumber=78 
Note: See TracChangeset for help on using the changeset viewer.