Changeset 152 in tmcsimulator for trunk/src/tmcsim/client


Ignore:
Timestamp:
10/20/2017 09:18:44 AM (9 years ago)
Author:
jdalbey
Message:

Coordinator.java: new method getATMStime added for use by ATMSBatchDriver.

Location:
trunk/src/tmcsim/client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/client/ATMSBatchDriver.java

    r140 r152  
    3232import javax.swing.Timer; 
    3333import javax.swing.UIManager; 
     34import tmcsim.cadsimulator.CADServer; 
    3435import tmcsim.common.SimulationException; 
    3536import tmcsim.interfaces.CADClientInterface; 
     
    158159        theView = new ATMSBatchViewer(this, new ArrayList<String>(incidents.keySet())); 
    159160        theView.setVisible(true); 
    160         theView.update("0:00", eventQueue); 
     161        theView.update("0:00", "1:11", eventQueue); 
    161162 
    162163        // Create a timer that fetches the simulation time every second. 
     
    167168            { 
    168169                String currentClock = ""; 
     170                String currentATMStime = ""; 
    169171                Date simClock = new Date();                 
    170172                // Obtain the simulation time from the CAD server 
     
    173175                    long simtime = theCoorInt.getCurrentSimulationTime(); 
    174176                    currentClock = formatInterval(simtime); 
     177                    long ATMStime = theCoorInt.getATMStime();        
     178                    Date atmsdate = new Date(ATMStime); 
     179                    currentATMStime = formatter.format(atmsdate); 
    175180                    try { 
    176181                        simClock = formatter.parse(currentClock); 
     
    231236                        } 
    232237                    } 
    233                     theView.update(currentClock, eventQueue); 
     238                     
     239                    theView.update(currentClock, currentATMStime, eventQueue); 
    234240                } 
    235241            } 
     
    322328        } 
    323329        // Now refresh the view with the updated queue of events 
    324         theView.update("0:00", eventQueue); 
     330        theView.update("0:00", "0:00", eventQueue); 
    325331    } 
    326332     
  • trunk/src/tmcsim/client/ATMSBatchViewer.form

    r135 r152  
    5858              </Group> 
    5959              <Group type="102" alignment="0" attributes="0"> 
    60                   <EmptySpace min="-2" pref="186" max="-2" attributes="0"/> 
    61                   <Component id="txtClockTime" min="-2" pref="65" max="-2" attributes="0"/> 
     60                  <EmptySpace min="-2" pref="112" max="-2" attributes="0"/> 
     61                  <Component id="txtClockTime" min="-2" pref="225" max="-2" attributes="0"/> 
    6262                  <EmptySpace max="32767" attributes="0"/> 
    6363              </Group> 
  • trunk/src/tmcsim/client/ATMSBatchViewer.java

    r135 r152  
    1313import javax.swing.JList; 
    1414import javax.swing.JOptionPane; 
     15import tmcsim.cadsimulator.CADServer; 
    1516 
    1617/** 
     
    3940    } 
    4041 
    41     public void update(String currentTime, Queue<String> events) 
     42    public void update(String currentTime, String atmsTime, Queue<String> events) 
    4243    { 
    4344        lstEvents.setModel(new MyListModel(events)); 
    44         txtClockTime.setText(currentTime); 
     45        txtClockTime.setText(currentTime + " / " +atmsTime); 
    4546    } 
    4647    class MyListModel extends AbstractListModel<String> 
     
    9697                .addGap(59, 59, 59)) 
    9798            .addGroup(pnlEventsLayout.createSequentialGroup() 
    98                 .addGap(186, 186, 186) 
    99                 .addComponent(txtClockTime, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) 
     99                .addGap(112, 112, 112) 
     100                .addComponent(txtClockTime, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 
    100101                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 
    101102        ); 
     
    229230                ATMSBatchViewer view = new ATMSBatchViewer(null,items); 
    230231                view.setVisible(true); 
    231                 view.update("01", sample); 
     232                view.update("01", "02", sample); 
    232233                 
    233234            } 
Note: See TracChangeset for help on using the changeset viewer.