- Timestamp:
- 10/11/2017 07:37:14 PM (9 years ago)
- File:
-
- 1 copied
-
trunk/src/tmcsim/client/ATMSDriverClient.java (copied) (copied from trunk/src/tmcsim/client/ClockClient.java) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/client/ATMSDriverClient.java
r64 r102 20 20 21 21 /** 22 * ClockClient shows the simulation clock time. It operates as a client of the 22 * Skeleton for ATMS Driver that reads a "batch" file of highway 23 * status update commands. 24 * It operates as a client of the 23 25 * CAD server, using RMI to poll the server every second for the current 24 * simulation clock time. 26 * simulation clock time. It uses the simulation clock time 27 * to fire update commands at the desired time. 28 * Note: Sim Mgr must be running before starting this application. 25 29 * 26 30 * @author jdalbey 27 31 */ 28 public class ClockClient extends UnicastRemoteObject implements32 public class ATMSDriverClient extends UnicastRemoteObject implements 29 33 CADClientInterface 30 34 { … … 65 69 */ 66 70 private CADClientSocket theClientSocket; 67 /** 68 * Instance of the ClockView. 69 */ 70 private ClockView theView; 71 71 72 /** 72 73 * Properties object for the CADClient class. … … 91 92 * file containing configuration data. 92 93 */ 93 public ClockClient(String propertiesFile) throws SimulationException,94 public ATMSDriverClient(String propertiesFile) throws SimulationException, 94 95 RemoteException 95 96 { … … 102 103 cadClientProp.getProperty(PROPERTIES.CAD_RMI_PORT.name).trim()); 103 104 104 theView = new ClockView(); 105 theView.setVisible(true); 106 105 // READ THE BATCH FILE OF COMMANDS and put in a queue 106 // Consider special cases: 1) time to fire first command 107 // has already past when application starts. 108 // 2. Two commands have same fire time specified. 109 // 3. How to "override" a command, to clear an incident. 110 107 111 // Create a timer that fetches the simulation time every second. 108 112 Timer timer = new Timer(ONE_SECOND, new ActionListener() … … 113 117 { 114 118 long simtime = theCoorInt.getCurrentSimulationTime(); 115 theView.updateTime("" + formatInterval(simtime)); 119 // Check the queue of commands to see if the first 120 // item matches the current time. IF so, 121 // issue that command and remove it from queue. 122 123 //theView.updateTime("" + formatInterval(simtime)); 116 124 } catch (RemoteException ex) 117 125 { 118 Logger.getLogger( ClockClient.class.getName()).log(Level.SEVERE, null, ex);126 Logger.getLogger(ATMSDriverClient.class.getName()).log(Level.SEVERE, null, ex); 119 127 } 120 128 } … … 245 253 { 246 254 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 247 new ClockClient(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME);255 new ATMSDriverClient(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 248 256 249 257 } catch (Exception e)
Note: See TracChangeset
for help on using the changeset viewer.
