Changeset 210 in tmcsimulator for trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java
- Timestamp:
- 11/02/2017 12:32:10 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java
r206 r210 76 76 */ 77 77 private Properties props = null; 78 79 /** 80 * The Coordinator object from which we obtain the simulation clock. 81 */ 82 private Coordinator theCoordinator; 83 78 84 /** 79 85 * Highways in traffic network … … 95 101 private String currentClock = ""; 96 102 97 /** 98 * GUI for this driver 99 */ 100 //private TrafficModelViewer theView; 101 103 102 104 /** 103 105 * Constructor. Loads the Properties file and initializes the 104 * ATMSCommunicator with the parsed data.106 * highway network model. 105 107 * 106 108 * @param propertiesFile Target file path of properties file. … … 118 120 props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 119 121 8080); 120 122 this.theCoordinator = theCoordinator; 123 } 124 /** 125 * Load the traffic events and start processing the event queue. 126 * Usage: addObserver must be called before calling run. 127 */ 128 public void run() 129 { 121 130 loadEvents(); 122 131 … … 378 387 } 379 388 380 /**381 * Construct the CADClient with the properties file path, either from the382 * command line arguments or default.383 *384 * @param args Command line arguments.385 */386 public static void main(String[] args) throws RemoteException387 {388 final String CONFIG_FILE_NAME = "traffic_model_config.properties";389 if (System.getProperty("CONFIG_DIR") == null)390 {391 System.setProperty("CONFIG_DIR", "config");392 }393 CADSimulatorState theModel = new CADSimulatorState();394 Coordinator theCoordinator = new Coordinator(theModel);395 try396 {397 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());398 TrafficModelManager mgr = new TrafficModelManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME,399 theCoordinator);400 TrafficModelViewer view = new TrafficModelViewer(mgr);401 view.setVisible(true);402 mgr.addObserver(view);403 }404 catch (Exception e)405 {406 logger.logp(Level.SEVERE, "SimulationManager", "Main",407 "Error initializing application.");408 409 JOptionPane.showMessageDialog(new JWindow(), e.getMessage(),410 "Error - Program Exiting", JOptionPane.ERROR_MESSAGE);411 412 System.exit(-1);413 }414 415 }416 389 class WriteToConsoleThread extends Thread 417 390 {
Note: See TracChangeset
for help on using the changeset viewer.
