Changeset 123 in tmcsimulator for trunk/src/tmcsim
- Timestamp:
- 10/15/2017 03:59:42 PM (9 years ago)
- Location:
- trunk/src/tmcsim
- Files:
-
- 8 edited
- 4 moved
-
application.properties (modified) (1 diff)
-
cadsimulator/CADClientConnector.java (moved) (moved from trunk/src/tmcsim/cadsimulator/CADSimulatorClient.java) (4 diffs)
-
cadsimulator/CADScreenManager.java (modified) (2 diffs)
-
cadsimulator/CADServer.java (moved) (moved from trunk/src/tmcsim/cadsimulator/CADSimulator.java) (10 diffs)
-
cadsimulator/CADSimulatorSocketHandler.java (modified) (1 diff)
-
cadsimulator/Coordinator.java (modified) (40 diffs)
-
cadsimulator/managers/IncidentManager.java (modified) (3 diffs)
-
cadsimulator/managers/MediaManager.java (modified) (3 diffs)
-
cadsimulator/managers/SimulationClockManager.java (moved) (moved from trunk/src/tmcsim/cadsimulator/managers/SimulationControlManager.java) (3 diffs)
-
cadsimulator/viewer/CADConsoleViewer.java (modified) (2 diffs)
-
cadsimulator/viewer/model/CADSimulatorState.java (moved) (moved from trunk/src/tmcsim/cadsimulator/viewer/model/CADSimulatorModel.java) (2 diffs)
-
simulationmanager/actions/StartSimulationAction.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/application.properties
r120 r123 1 #S at, 14 Oct 2017 13:43:49-07001 #Sun, 15 Oct 2017 17:03:46 -0700 2 2 3 Application.revision=1 193 Application.revision=122 4 4 5 5 Application.buildnumber=52 -
trunk/src/tmcsim/cadsimulator/CADClientConnector.java
r56 r123 25 25 26 26 /** 27 * CAD SimulatorClienthandles communication between the CAD Simulator and27 * CADClientConnector handles communication between the CAD Simulator and 28 28 * remote CAD Clients. Each instance of this class communicates with 29 29 * a CAD Client through a socket. The run() method continuously checks to see … … 41 41 * @version $Date: 2006/06/14 00:12:38 $ $Revision: 1.5 $ 42 42 */ 43 public class CAD SimulatorClientextends Thread implements Observer {43 public class CADClientConnector extends Thread implements Observer { 44 44 45 45 /** Error Logger. */ … … 72 72 * from the socket. 73 73 */ 74 CAD SimulatorClient(Socket newSocket) throws IOException{75 76 screenManager = new CADScreenManager(CADS imulator.theCoordinator);77 CADS imulator.theCoordinator.addObserver(screenManager);74 CADClientConnector(Socket newSocket) throws IOException{ 75 76 screenManager = new CADScreenManager(CADServer.theCoordinator); 77 CADServer.theCoordinator.addObserver(screenManager); 78 78 screenManager.addObserver(this); 79 79 … … 132 132 133 133 screenManager.deleteObserver(this); 134 CADS imulator.theCoordinator.removeObserver(screenManager);134 CADServer.theCoordinator.removeObserver(screenManager); 135 135 //CADSimulator.theViewer.disconnectClient(); 136 136 } -
trunk/src/tmcsim/cadsimulator/CADScreenManager.java
r2 r123 139 139 screenNum = screenNum.next(); 140 140 141 CADScreenModel.theCADTime = CADS imulator.getCADTime();142 CADScreenModel.theCADDate = CADS imulator.getCADDate();141 CADScreenModel.theCADTime = CADServer.getCADTime(); 142 CADScreenModel.theCADDate = CADServer.getCADDate(); 143 143 144 144 messageMap = new TreeMap<CADRoutedMessage, Boolean>(); … … 158 158 */ 159 159 protected void updateTime() { 160 CADScreenModel.theCADTime = CADS imulator.getCADTime();160 CADScreenModel.theCADTime = CADServer.getCADTime(); 161 161 162 162 setChanged(); 163 163 notifyObservers(new ObserverMessage(ObserverMessage.messageType.TIME_UPDATE, 164 CADS imulator.getCADTime()));164 CADServer.getCADTime())); 165 165 } 166 166 -
trunk/src/tmcsim/cadsimulator/CADServer.java
r49 r123 19 19 import tmcsim.cadsimulator.managers.MediaManager; 20 20 import tmcsim.cadsimulator.managers.ParamicsSimulationManager; 21 import tmcsim.cadsimulator.managers.SimulationC ontrolManager;22 import tmcsim.cadsimulator.viewer.model.CADSimulator Model;21 import tmcsim.cadsimulator.managers.SimulationClockManager; 22 import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 23 23 import tmcsim.common.SimulationException; 24 24 import tmcsim.interfaces.CADViewer; … … 64 64 * @version $Date: 2009/04/17 16:27:46 $ $Revision: 1.5 $ 65 65 */ 66 public class CADS imulator66 public class CADServer 67 67 { 68 68 … … 78 78 * 79 79 * @author Matthew 80 * @see CADS imulator80 * @see CADServer 81 81 */ 82 82 private static enum CAD_PROPERTIES … … 132 132 } 133 133 }; 134 /** NOTE: Protected fields are accessed by Coordinator */ 134 135 /** 135 136 * CADSimulatorViewer instance. … … 138 139 //protected static CADSimulatorViewer theViewer; 139 140 //protected static CADConsoleViewer theConsole; 140 protected static CADSimulator ModeltheModel;141 protected static CADSimulatorState theModel; 141 142 /** 142 143 * Coordinator instance. … … 150 151 * SimulationControlManager instance. 151 152 */ 152 protected static SimulationC ontrolManager theSimulationCntrlMgr = null;153 protected static SimulationClockManager theSimulationCntrlMgr = null; 153 154 /** 154 155 * ParamicsSimulationManager instance. … … 183 184 * Simulator. 184 185 */ 185 public CADS imulator(String propertiesFile) throws SimulationException186 public CADServer(String propertiesFile) throws SimulationException 186 187 { 187 188 … … 224 225 throw new SimulationException(SimulationException.INITIALIZE_ERROR); 225 226 } 226 theModel = new CADSimulator Model();227 theModel = new CADSimulatorState(); 227 228 theModel.addObserver(theViewer); 228 229 … … 236 237 CAD_PROPERTIES.CAD_RMI_PORT.name).trim())); 237 238 238 theSimulationCntrlMgr = new SimulationC ontrolManager(theCoordinator);239 theSimulationCntrlMgr = new SimulationClockManager(theCoordinator); 239 240 240 241 theATMSMgr = new ATMSManager( … … 410 411 + System.getProperty("file.separator") 411 412 + CONFIG_FILE_NAME; 412 new CADS imulator(propFile);413 new CADServer(propFile); 413 414 } catch (Exception e) 414 415 { -
trunk/src/tmcsim/cadsimulator/CADSimulatorSocketHandler.java
r2 r123 66 66 clientSocket = serverSocket.accept(); 67 67 68 CAD SimulatorClient theTMClient = new CADSimulatorClient(clientSocket);68 CADClientConnector theTMClient = new CADClientConnector(clientSocket); 69 69 theTMClient.start(); 70 70 //CADSimulator.theViewer.connectClient(); -
trunk/src/tmcsim/cadsimulator/Coordinator.java
r54 r123 27 27 import tmcsim.cadsimulator.managers.MediaManager; 28 28 import tmcsim.cadsimulator.managers.ParamicsSimulationManager; 29 import tmcsim.cadsimulator.managers.SimulationC ontrolManager;30 import tmcsim.cadsimulator.viewer.model.CADSimulator Model;29 import tmcsim.cadsimulator.managers.SimulationClockManager; 30 import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 31 31 import tmcsim.client.cadclientgui.CardfileReader; 32 32 import tmcsim.client.cadclientgui.ScriptHandler; … … 80 80 * @see MediaManager 81 81 * @see ParamicsSimulationManager 82 * @see SimulationC ontrolManager82 * @see SimulationClockManager 83 83 * @author Matthew Cechini 84 84 * @version … … 103 103 * connected Manager, this object is set to null. 104 104 */ 105 private static SimulationManagerInterface managerInt= null;105 private static SimulationManagerInterface simMgr = null; 106 106 private static LinkedList<CADClientInterface> clientList; 107 107 private static CADData cadData; 108 108 private static CardfileData cardfileData; 109 private CADSimulator ModelcadModel;109 private CADSimulatorState cadModel; 110 110 111 111 /** … … 115 115 * @throws RemoteException 116 116 */ 117 public Coordinator(CADSimulator Modelmodel) throws RemoteException117 public Coordinator(CADSimulatorState model) throws RemoteException 118 118 { 119 119 super(); … … 153 153 public void registerForCallback(SimulationManagerInterface simManInt) throws RemoteException 154 154 { 155 managerInt= simManInt;155 simMgr = simManInt; 156 156 cadModel.setSimManagerStatus(true); 157 157 } … … 159 159 public void unregisterForCallback(SimulationManagerInterface simManInt) throws RemoteException 160 160 { 161 managerInt= null;161 simMgr = null; 162 162 cadModel.setSimManagerStatus(false); 163 163 } … … 166 166 { 167 167 168 if (!CADS imulator.theIncidentMgr.areIncidentsLoaded())168 if (!CADServer.theIncidentMgr.areIncidentsLoaded()) 169 169 { 170 170 throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 171 171 } 172 else if (CADS imulator.theParamicsSimMgr.isConnected())172 else if (CADServer.theParamicsSimMgr.isConnected()) 173 173 { 174 174 Runnable startRun = new Runnable() … … 184 184 * Is some process happening on the ATMS side that we need to wait for? 185 185 */ 186 long currentATMSTime = CADS imulator.theATMSMgr.getCurrentTime();186 long currentATMSTime = CADServer.theATMSMgr.getCurrentTime(); 187 187 /* Seems like it waits 0-30 seconds, depending on what the time is on 188 188 * the ATMS server. Does something happen every 30 seconds over there? … … 205 205 } finally 206 206 { 207 CADS imulator.theSimulationCntrlMgr.startSimulation();208 CADS imulator.theParamicsSimMgr.startSimulation();209 CADS imulator.theSoundPlayer.setAudioEnabled(true);207 CADServer.theSimulationCntrlMgr.startSimulation(); 208 CADServer.theParamicsSimMgr.startSimulation(); 209 CADServer.theSoundPlayer.setAudioEnabled(true); 210 210 } 211 211 } … … 217 217 else 218 218 { 219 CADS imulator.theSimulationCntrlMgr.startSimulation();220 CADS imulator.theSoundPlayer.setAudioEnabled(true);219 CADServer.theSimulationCntrlMgr.startSimulation(); 220 CADServer.theSoundPlayer.setAudioEnabled(true); 221 221 } 222 222 } … … 224 224 public void pauseSimulation() throws RemoteException 225 225 { 226 CADS imulator.theSimulationCntrlMgr.pauseSimulation();227 CADS imulator.theSoundPlayer.setAudioEnabled(false);226 CADServer.theSimulationCntrlMgr.pauseSimulation(); 227 CADServer.theSoundPlayer.setAudioEnabled(false); 228 228 } 229 229 … … 231 231 { 232 232 233 CADS imulator.theIncidentMgr.resetIncidents();233 CADServer.theIncidentMgr.resetIncidents(); 234 234 cadData.resetSimulation(); 235 235 236 CADS imulator.theSoundPlayer.setAudioEnabled(false);237 CADS imulator.theSoundPlayer.deQueueAll();236 CADServer.theSoundPlayer.setAudioEnabled(false); 237 CADServer.theSoundPlayer.deQueueAll(); 238 238 239 239 cadModel.setTime(0); … … 243 243 CMSDiversionDB.getInstance().resetDiversions(); 244 244 245 CADS imulator.theSimulationCntrlMgr.resetSimulation();246 CADS imulator.theParamicsSimMgr.resetSimulation();245 CADServer.theSimulationCntrlMgr.resetSimulation(); 246 CADServer.theParamicsSimMgr.resetSimulation(); 247 247 248 248 notifyObservers(new ObserverMessage(ObserverMessage.messageType.RESET_SIMULATION, null)); … … 253 253 { 254 254 255 boolean audioWasEnabled = CADS imulator.theSoundPlayer.getAudioEnabled();256 257 CADS imulator.theSoundPlayer.setAudioEnabled(false);255 boolean audioWasEnabled = CADServer.theSoundPlayer.getAudioEnabled(); 256 257 CADServer.theSoundPlayer.setAudioEnabled(false); 258 258 259 259 long tempTime = 0; … … 262 262 tempTime++; 263 263 264 CADS imulator.theIncidentMgr.tick(tempTime);265 } 266 CADS imulator.theSoundPlayer.setAudioEnabled(audioWasEnabled);267 268 269 CADS imulator.theSimulationCntrlMgr.gotoSimulationTime(newSimTime);264 CADServer.theIncidentMgr.tick(tempTime); 265 } 266 CADServer.theSoundPlayer.setAudioEnabled(audioWasEnabled); 267 268 269 CADServer.theSimulationCntrlMgr.gotoSimulationTime(newSimTime); 270 270 271 271 Runnable gotoRun = new Runnable() … … 275 275 cadModel.setTime(newSimTime); 276 276 277 if ( managerInt!= null)277 if (simMgr != null) 278 278 { 279 279 try 280 280 { 281 managerInt.tick(newSimTime);281 simMgr.tick(newSimTime); 282 282 } catch (RemoteException re) 283 283 { 284 284 //Simulation Manager has disappeared 285 managerInt= null;285 simMgr = null; 286 286 cadModel.setSimManagerStatus(false); 287 287 … … 312 312 cadModel.setScriptStatus(status); 313 313 314 if ( managerInt!= null)314 if (simMgr != null) 315 315 { 316 316 try 317 317 { 318 managerInt.setScriptStatus(status);318 simMgr.setScriptStatus(status); 319 319 } catch (RemoteException re) 320 320 { 321 321 //Simulation Manager has disappeared 322 managerInt= null;322 simMgr = null; 323 323 cadModel.setSimManagerStatus(false); 324 324 … … 362 362 } 363 363 364 if ( managerInt!= null)364 if (simMgr != null) 365 365 { 366 366 try 367 367 { 368 managerInt.setParamicsStatus(status);368 simMgr.setParamicsStatus(status); 369 369 } catch (RemoteException re) 370 370 { 371 371 //Simulation Manager has disappeared 372 managerInt= null;372 simMgr = null; 373 373 cadModel.setSimManagerStatus(false); 374 374 … … 387 387 public void connectToParamics() throws RemoteException 388 388 { 389 CADS imulator.theParamicsSimMgr.connectToParamics();389 CADServer.theParamicsSimMgr.connectToParamics(); 390 390 } 391 391 392 392 public void disconnectFromParamics() throws RemoteException 393 393 { 394 CADS imulator.theParamicsSimMgr.disconnectFromParamics();394 CADServer.theParamicsSimMgr.disconnectFromParamics(); 395 395 } 396 396 397 397 public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException 398 398 { 399 CADS imulator.theParamicsSimMgr.loadParamicsNetwork(networkID);399 CADServer.theParamicsSimMgr.loadParamicsNetwork(networkID); 400 400 } 401 401 402 402 public PARAMICS_STATUS getParamicsStatus() throws RemoteException 403 403 { 404 return CADS imulator.theParamicsSimMgr.getParamicsStatus();404 return CADServer.theParamicsSimMgr.getParamicsStatus(); 405 405 } 406 406 407 407 public int getParamicsNetworkLoaded() throws RemoteException 408 408 { 409 return CADS imulator.theParamicsSimMgr.getParamicsNetworkLoaded();409 return CADServer.theParamicsSimMgr.getParamicsNetworkLoaded(); 410 410 } 411 411 412 412 public long getCurrentSimulationTime() throws RemoteException 413 413 { 414 return CADS imulator.theSimulationCntrlMgr.getCurrentSimTime();414 return CADServer.theSimulationCntrlMgr.getCurrentSimTime(); 415 415 } 416 416 … … 418 418 { 419 419 420 if (!CADS imulator.theSimulationCntrlMgr.simulationStarted())420 if (!CADServer.theSimulationCntrlMgr.simulationStarted()) 421 421 { 422 422 throw new ScriptException(ScriptException.SIM_NOT_STARTED); 423 423 } 424 else if (!CADS imulator.theIncidentMgr.areIncidentsLoaded())424 else if (!CADServer.theIncidentMgr.areIncidentsLoaded()) 425 425 { 426 426 throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 427 427 } 428 428 429 CADS imulator.theIncidentMgr.triggerIncident(incidentNumber,430 CADS imulator.theSimulationCntrlMgr.getCurrentSimTime());429 CADServer.theIncidentMgr.triggerIncident(incidentNumber, 430 CADServer.theSimulationCntrlMgr.getCurrentSimTime()); 431 431 } 432 432 433 433 public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException 434 434 { 435 CADS imulator.theIncidentMgr.deleteIncident(incidentNumber);436 437 if (CADS imulator.theIncidentMgr.getIncidentList().size() == 0)435 CADServer.theIncidentMgr.deleteIncident(incidentNumber); 436 437 if (CADServer.theIncidentMgr.getIncidentList().size() == 0) 438 438 { 439 439 setScriptStatus(SCRIPT_STATUS.NO_SCRIPT); 440 440 } 441 441 442 if ( managerInt!= null)442 if (simMgr != null) 443 443 { 444 444 try 445 445 { 446 managerInt.incidentRemoved(incidentNumber);446 simMgr.incidentRemoved(incidentNumber); 447 447 } catch (RemoteException re) 448 448 { 449 449 //Simulation Manager has disappeared 450 managerInt= null;450 simMgr = null; 451 451 cadModel.setSimManagerStatus(false); 452 452 … … 461 461 { 462 462 463 if (newTime < CADS imulator.theSimulationCntrlMgr.getCurrentSimTime())463 if (newTime < CADServer.theSimulationCntrlMgr.getCurrentSimTime()) 464 464 { 465 465 throw new ScriptException(ScriptException.TIME_PASSED); 466 466 } 467 467 468 CADS imulator.theIncidentMgr.rescheduleIncident(incidentNumber, newTime);468 CADServer.theIncidentMgr.rescheduleIncident(incidentNumber, newTime); 469 469 } 470 470 … … 472 472 { 473 473 474 CADS imulator.theIncidentMgr.addIncident(newIncident);475 476 if ( managerInt!= null)474 CADServer.theIncidentMgr.addIncident(newIncident); 475 476 if (simMgr != null) 477 477 { 478 478 try 479 479 { 480 managerInt.incidentAdded(newIncident);480 simMgr.incidentAdded(newIncident); 481 481 } catch (RemoteException re) 482 482 { 483 483 //Simulation Manager has disappeared 484 managerInt= null;484 simMgr = null; 485 485 cadModel.setSimManagerStatus(false); 486 486 … … 497 497 try 498 498 { 499 CADS imulator.theIncidentMgr.clearIncidents();499 CADServer.theIncidentMgr.clearIncidents(); 500 500 cadData.clearData(); 501 501 … … 507 507 cadData.setUnitsFromXML(sh.getUnits()); 508 508 refreshClients(); 509 CADS imulator.theIncidentMgr.addIncidents(sh.getIncidents());509 CADServer.theIncidentMgr.addIncidents(sh.getIncidents()); 510 510 511 511 resetSimulation(); … … 519 519 public Vector<Incident> getIncidentList() throws RemoteException 520 520 { 521 return CADS imulator.theIncidentMgr.getIncidentList();521 return CADServer.theIncidentMgr.getIncidentList(); 522 522 } 523 523 524 524 public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException 525 525 { 526 return CADS imulator.theIncidentMgr.getTriggeredEvents();526 return CADServer.theIncidentMgr.getTriggeredEvents(); 527 527 } 528 528 529 529 public SCRIPT_STATUS getScriptStatus() throws RemoteException 530 530 { 531 if (CADS imulator.theIncidentMgr.areIncidentsLoaded())532 { 533 if (CADS imulator.theSimulationCntrlMgr.simulationStarted())531 if (CADServer.theIncidentMgr.areIncidentsLoaded()) 532 { 533 if (CADServer.theSimulationCntrlMgr.simulationStarted()) 534 534 { 535 535 return SCRIPT_STATUS.SCRIPT_RUNNING; … … 537 537 else 538 538 { 539 for (Incident inc : CADS imulator.theIncidentMgr.getIncidentList())539 for (Incident inc : CADServer.theIncidentMgr.getIncidentList()) 540 540 { 541 541 if (inc.hasOccured() == true) … … 599 599 { 600 600 CMSDiversionDB.getInstance().updateDiversions(theDiversion); 601 CADS imulator.theParamicsSimMgr.updateDiversion(theDiversion);601 CADServer.theParamicsSimMgr.updateDiversion(theDiversion); 602 602 } 603 603 … … 614 614 { 615 615 616 long currentSimTime = CADS imulator.theSimulationCntrlMgr.getCurrentSimTime();616 long currentSimTime = CADServer.theSimulationCntrlMgr.getCurrentSimTime(); 617 617 618 618 IncidentEvent triggeredEvent = new IncidentEvent(currentSimTime); 619 619 triggeredEvent.eventInfo = modelInfo; 620 620 621 triggeredEvent.finalizeEvent(currentSimTime, CADS imulator.getCADTime());622 623 CADS imulator.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent);621 triggeredEvent.finalizeEvent(currentSimTime, CADServer.getCADTime()); 622 623 CADServer.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent); 624 624 625 625 updateIncidentInGUI(modelInfo.getLogNumber(), triggeredEvent); … … 633 633 * ParamicsControlManager to send an IncidentUpdate. 634 634 * 635 * @see SimulationC ontrolManager635 * @see SimulationClockManager 636 636 * @see ParamicsControlManager 637 637 * @see IncidentManager … … 639 639 public void tick() 640 640 { 641 if (CADS imulator.theSimulationCntrlMgr.simulationStarted())642 { 643 644 final long currentSimTime = CADS imulator.theSimulationCntrlMgr.getCurrentSimTime();641 if (CADServer.theSimulationCntrlMgr.simulationStarted()) 642 { 643 644 final long currentSimTime = CADServer.theSimulationCntrlMgr.getCurrentSimTime(); 645 645 646 646 Runnable timeRun = new Runnable() … … 653 653 if (currentSimTime % 30 == 0) 654 654 { 655 CADS imulator.theParamicsSimMgr.sendIncidentUpdate(currentSimTime);655 CADServer.theParamicsSimMgr.sendIncidentUpdate(currentSimTime); 656 656 } 657 657 658 if ( managerInt!= null)658 if (simMgr != null) 659 659 { 660 660 try 661 661 { 662 managerInt.tick(currentSimTime);662 simMgr.tick(currentSimTime); 663 663 } catch (RemoteException re) 664 664 { 665 665 //Simulation Manager has disappeared 666 managerInt= null;666 simMgr = null; 667 667 cadModel.setSimManagerStatus(false); 668 668 … … 672 672 } 673 673 674 CADS imulator.theIncidentMgr.tick(currentSimTime);674 CADServer.theIncidentMgr.tick(currentSimTime); 675 675 } 676 676 }; … … 699 699 public void run() 700 700 { 701 if ( managerInt!= null)701 if (simMgr != null) 702 702 { 703 703 try 704 704 { 705 managerInt.incidentStarted(completedEvent.eventInfo.getLogNumber());705 simMgr.incidentStarted(completedEvent.eventInfo.getLogNumber()); 706 706 } catch (RemoteException re) 707 707 { 708 708 //Simulation Manager has disappeared 709 managerInt= null;709 simMgr = null; 710 710 cadModel.setSimManagerStatus(false); 711 711 … … 740 740 for (XMLIncident xmlInc : completedEvent.XMLIncidents) 741 741 { 742 CADS imulator.theParamicsSimMgr.updateIncident(xmlInc);742 CADServer.theParamicsSimMgr.updateIncident(xmlInc); 743 743 } 744 744 … … 753 753 public void run() 754 754 { 755 if ( managerInt!= null)755 if (simMgr != null) 756 756 { 757 757 try 758 758 { 759 managerInt.eventOccured(759 simMgr.eventOccured( 760 760 completedEvent.eventInfo.getLogNumber(), 761 761 completedEvent); … … 763 763 { 764 764 //Simulation Manager has disappeared 765 managerInt= null;765 simMgr = null; 766 766 cadModel.setSimManagerStatus(false); 767 767 … … 782 782 public boolean incidentExists(Integer logNumber) 783 783 { 784 return CADS imulator.theIncidentMgr.incidentExists(logNumber);784 return CADServer.theIncidentMgr.incidentExists(logNumber); 785 785 } 786 786 … … 790 790 public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() 791 791 { 792 return CADS imulator.theIncidentMgr.getIncidentBoardModelObjects();792 return CADServer.theIncidentMgr.getIncidentBoardModelObjects(); 793 793 } 794 794 … … 798 798 public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) 799 799 { 800 return CADS imulator.theIncidentMgr.getIncidentInquiryModelObjects(logNumber);800 return CADServer.theIncidentMgr.getIncidentInquiryModelObjects(logNumber); 801 801 } 802 802 … … 806 806 public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() 807 807 { 808 return CADS imulator.theIncidentMgr.getIncidentSummaryModelObjects();808 return CADServer.theIncidentMgr.getIncidentSummaryModelObjects(); 809 809 } 810 810 -
trunk/src/tmcsim/cadsimulator/managers/IncidentManager.java
r2 r123 7 7 import tmcsim.cadmodels.IncidentInquiryModel_obj; 8 8 import tmcsim.cadmodels.IncidentSummaryModel_obj; 9 import tmcsim.cadsimulator.CADS imulator;9 import tmcsim.cadsimulator.CADServer; 10 10 import tmcsim.cadsimulator.Coordinator; 11 11 import tmcsim.cadsimulator.SoundPlayer; … … 247 247 248 248 for(IncidentEvent event : inc.getCompletedEvents()) { 249 event.finalizeEvent(currentSimTime, CADS imulator.getCADTime());249 event.finalizeEvent(currentSimTime, CADServer.getCADTime()); 250 250 updateIncident(inc.getLogNumber(), event); 251 251 theCoordinator.updateIncidentInGUI(inc.getLogNumber(), event); … … 311 311 if(targetIncident == null) { 312 312 completedEvent.eventInfo.getHeader().logStatus = "A"; 313 completedEvent.eventInfo.getHeader().incidentDate = CADS imulator.getCADDate().substring(0,4);314 completedEvent.eventInfo.getHeader().incidentTime = CADS imulator.getCADTime();313 completedEvent.eventInfo.getHeader().incidentDate = CADServer.getCADDate().substring(0,4); 314 completedEvent.eventInfo.getHeader().incidentTime = CADServer.getCADTime(); 315 315 316 316 targetIncident = new IncidentInquiryModel_obj(completedEvent.eventInfo); -
trunk/src/tmcsim/cadsimulator/managers/MediaManager.java
r44 r123 19 19 import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate; 20 20 import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate; 21 import tmcsim.cadsimulator.viewer.model.CADSimulator Model;21 import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 22 22 import tmcsim.common.CCTVDirections; 23 23 import tmcsim.common.CCTVInfo; … … 74 74 75 75 /** Reference to the CADSimulatorModel. */ 76 private CADSimulator ModeltheModel;76 private CADSimulatorState theModel; 77 77 78 78 /** Properties object for the Media portion of the CAD. */ … … 90 90 */ 91 91 public MediaManager(String propertiesFile, ATMSManager theATMSManager, 92 CADSimulator Modelmodel) {92 CADSimulatorState model) { 93 93 theDVD_DB = new DVDPlayerDB(); 94 94 theImage_DB = new StillImagesDB(); -
trunk/src/tmcsim/cadsimulator/managers/SimulationClockManager.java
r2 r123 8 8 import tmcsim.common.CADEnums.SCRIPT_STATUS; 9 9 10 public class SimulationControlManager { 10 /** Manage the simulation clock, "the heartbeat of the simulation". */ 11 public class SimulationClockManager { 11 12 12 13 /** 13 * 14 * Define what happens every second. 14 15 */ 15 16 private class ClockTask extends TimerTask { … … 39 40 40 41 41 public SimulationC ontrolManager(Coordinator coor) {42 public SimulationClockManager(Coordinator coor) { 42 43 43 44 theCoordinator = coor; … … 59 60 60 61 public void startSimulation() { 61 62 /** Start the clock running */ 62 63 simTimer = new Timer(); 63 64 simTimer.scheduleAtFixedRate(new ClockTask(), 0, 1000); -
trunk/src/tmcsim/cadsimulator/viewer/CADConsoleViewer.java
r44 r123 4 4 import java.io.Writer; 5 5 import java.util.Observable; 6 import tmcsim.cadsimulator.viewer.model.CADSimulator Model;6 import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 7 7 import tmcsim.cadsimulator.viewer.model.CADSimulatorStatus; 8 8 import tmcsim.common.CADEnums.PARAMICS_STATUS; … … 30 30 * Simulation model 31 31 */ 32 private CADSimulator Modelcadstatus;32 private CADSimulatorState cadstatus; 33 33 private PrintWriter display; 34 34 -
trunk/src/tmcsim/cadsimulator/viewer/model/CADSimulatorState.java
r44 r123 15 15 */ 16 16 @SuppressWarnings("serial") 17 public class CADSimulator Model17 public class CADSimulatorState 18 18 { 19 19 … … 24 24 * Constructor. 25 25 */ 26 public CADSimulator Model()26 public CADSimulatorState() 27 27 { 28 28 simStatus = new CADSimulatorStatus(); -
trunk/src/tmcsim/simulationmanager/actions/StartSimulationAction.java
r2 r123 12 12 /** 13 13 * StartSimulationAction is an AbstractAction that is used for starting 14 * the simulation. When the action is performed, the action checks 15 * whether the a connection has been made to Paramics. If not, the user 16 * is prompted whether they want to continue without a connection to Paramics. 17 * If not, the action returns. If there is a connection, or the user wishes to 18 * continue without, the action calls the SimulationManagerModel to start the 14 * the simulation. When the action is performed, 15 * the action calls the SimulationManagerModel to start the 19 16 * simulation. 20 17 * @author Matthew Cechini … … 38 35 public void actionPerformed(ActionEvent evt) { 39 36 Runnable startRunnable = new Runnable(){ 40 public void run() { 41 if(!theSimManagerView.isConnectedToParamics()) { 42 if (JOptionPane.showConfirmDialog(null, "Connection has not been " + 43 "made to the Paramics Traffic Modeler. Do you wish " + 44 "to continue?", "Paramics Connection", 45 JOptionPane.YES_NO_OPTION, 46 JOptionPane.QUESTION_MESSAGE) == JOptionPane.NO_OPTION) { 47 return; 48 } 49 } 37 public void run() 38 { 39 // Remove this check because Paramics is no longer used as of 2017 40 // if(!theSimManagerView.isConnectedToParamics()) { 41 // if (JOptionPane.showConfirmDialog(null, "Connection has not been " + 42 // "made to the Paramics Traffic Modeler. Do you wish " + 43 // "to continue?", "Paramics Connection", 44 // JOptionPane.YES_NO_OPTION, 45 // JOptionPane.QUESTION_MESSAGE) == JOptionPane.NO_OPTION) { 46 // return; 47 // } 48 // } 50 49 51 50 try {
Note: See TracChangeset
for help on using the changeset viewer.
