Changeset 152 in tmcsimulator
- Timestamp:
- 10/20/2017 09:18:44 AM (9 years ago)
- Location:
- trunk/src/tmcsim
- Files:
-
- 5 edited
-
cadsimulator/Coordinator.java (modified) (2 diffs)
-
client/ATMSBatchDriver.java (modified) (6 diffs)
-
client/ATMSBatchViewer.form (modified) (1 diff)
-
client/ATMSBatchViewer.java (modified) (4 diffs)
-
interfaces/CADInterface.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/Coordinator.java
r123 r152 22 22 import tmcsim.cadmodels.IncidentInquiryUnitsAssigned; 23 23 import tmcsim.cadmodels.IncidentSummaryModel_obj; 24 import static tmcsim.cadsimulator.CADServer.theATMSMgr; 24 25 import tmcsim.cadsimulator.db.CMSDiversionDB; 25 26 import tmcsim.cadsimulator.managers.ATMSManager; … … 221 222 } 222 223 } 224 /** Convenience method for clients to get ATMS time. 225 * 226 * @return current ATMS time in milliseconds. 227 * @author jdalbey 228 * @version 19 Oct 2017 229 */ 230 public long getATMStime() 231 { 232 try 233 { 234 return CADServer.theATMSMgr.getCurrentTime(); 235 } 236 catch (Exception ex) 237 { 238 Logger.getLogger(Coordinator.class.getName()).log(Level.SEVERE, null, ex); 239 System.out.println("Exception getting ATMS time, using zero."); 240 return 0; 241 } 242 } 223 243 224 244 public void pauseSimulation() throws RemoteException -
trunk/src/tmcsim/client/ATMSBatchDriver.java
r140 r152 32 32 import javax.swing.Timer; 33 33 import javax.swing.UIManager; 34 import tmcsim.cadsimulator.CADServer; 34 35 import tmcsim.common.SimulationException; 35 36 import tmcsim.interfaces.CADClientInterface; … … 158 159 theView = new ATMSBatchViewer(this, new ArrayList<String>(incidents.keySet())); 159 160 theView.setVisible(true); 160 theView.update("0:00", eventQueue);161 theView.update("0:00", "1:11", eventQueue); 161 162 162 163 // Create a timer that fetches the simulation time every second. … … 167 168 { 168 169 String currentClock = ""; 170 String currentATMStime = ""; 169 171 Date simClock = new Date(); 170 172 // Obtain the simulation time from the CAD server … … 173 175 long simtime = theCoorInt.getCurrentSimulationTime(); 174 176 currentClock = formatInterval(simtime); 177 long ATMStime = theCoorInt.getATMStime(); 178 Date atmsdate = new Date(ATMStime); 179 currentATMStime = formatter.format(atmsdate); 175 180 try { 176 181 simClock = formatter.parse(currentClock); … … 231 236 } 232 237 } 233 theView.update(currentClock, eventQueue); 238 239 theView.update(currentClock, currentATMStime, eventQueue); 234 240 } 235 241 } … … 322 328 } 323 329 // Now refresh the view with the updated queue of events 324 theView.update("0:00", eventQueue);330 theView.update("0:00", "0:00", eventQueue); 325 331 } 326 332 -
trunk/src/tmcsim/client/ATMSBatchViewer.form
r135 r152 58 58 </Group> 59 59 <Group type="102" alignment="0" attributes="0"> 60 <EmptySpace min="-2" pref="1 86" 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"/> 62 62 <EmptySpace max="32767" attributes="0"/> 63 63 </Group> -
trunk/src/tmcsim/client/ATMSBatchViewer.java
r135 r152 13 13 import javax.swing.JList; 14 14 import javax.swing.JOptionPane; 15 import tmcsim.cadsimulator.CADServer; 15 16 16 17 /** … … 39 40 } 40 41 41 public void update(String currentTime, Queue<String> events)42 public void update(String currentTime, String atmsTime, Queue<String> events) 42 43 { 43 44 lstEvents.setModel(new MyListModel(events)); 44 txtClockTime.setText(currentTime );45 txtClockTime.setText(currentTime + " / " +atmsTime); 45 46 } 46 47 class MyListModel extends AbstractListModel<String> … … 96 97 .addGap(59, 59, 59)) 97 98 .addGroup(pnlEventsLayout.createSequentialGroup() 98 .addGap(1 86, 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) 100 101 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 101 102 ); … … 229 230 ATMSBatchViewer view = new ATMSBatchViewer(null,items); 230 231 view.setVisible(true); 231 view.update("01", sample);232 view.update("01", "02", sample); 232 233 233 234 } -
trunk/src/tmcsim/interfaces/CADInterface.java
r2 r152 310 310 */ 311 311 public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException; 312 313 /** Convenience method for clients to get current ATMS time. 314 * 315 * @return current ATMS time in milliseconds. 316 */ 317 public long getATMStime() throws RemoteException; 312 318 } 313 319
Note: See TracChangeset
for help on using the changeset viewer.
