Changeset 123 in tmcsimulator for trunk/src/tmcsim


Ignore:
Timestamp:
10/15/2017 03:59:42 PM (9 years ago)
Author:
jdalbey
Message:

Multiple renaming of classes to improve clarity. Remove check for Paramics running before starting sim.

Location:
trunk/src/tmcsim
Files:
8 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/application.properties

    r120 r123  
    1 #Sat, 14 Oct 2017 13:43:49 -0700 
     1#Sun, 15 Oct 2017 17:03:46 -0700 
    22 
    3 Application.revision=119 
     3Application.revision=122 
    44 
    55Application.buildnumber=52 
  • trunk/src/tmcsim/cadsimulator/CADClientConnector.java

    r56 r123  
    2525 
    2626/** 
    27  * CADSimulatorClient handles communication between the CAD Simulator and  
     27 * CADClientConnector handles communication between the CAD Simulator and  
    2828 * remote CAD Clients.  Each instance of this class communicates with  
    2929 * a CAD Client through a socket.  The run() method continuously checks to see  
     
    4141 * @version $Date: 2006/06/14 00:12:38 $ $Revision: 1.5 $ 
    4242 */ 
    43 public class CADSimulatorClient extends Thread implements Observer { 
     43public class CADClientConnector extends Thread implements Observer { 
    4444     
    4545    /** Error Logger. */ 
     
    7272     * from the socket. 
    7373     */ 
    74     CADSimulatorClient(Socket newSocket) throws IOException{ 
    75          
    76         screenManager = new CADScreenManager(CADSimulator.theCoordinator);       
    77         CADSimulator.theCoordinator.addObserver(screenManager); 
     74    CADClientConnector(Socket newSocket) throws IOException{ 
     75         
     76        screenManager = new CADScreenManager(CADServer.theCoordinator);       
     77        CADServer.theCoordinator.addObserver(screenManager); 
    7878        screenManager.addObserver(this); 
    7979         
     
    132132 
    133133        screenManager.deleteObserver(this); 
    134         CADSimulator.theCoordinator.removeObserver(screenManager); 
     134        CADServer.theCoordinator.removeObserver(screenManager); 
    135135        //CADSimulator.theViewer.disconnectClient(); 
    136136    } 
  • trunk/src/tmcsim/cadsimulator/CADScreenManager.java

    r2 r123  
    139139        screenNum = screenNum.next();        
    140140 
    141         CADScreenModel.theCADTime = CADSimulator.getCADTime(); 
    142         CADScreenModel.theCADDate = CADSimulator.getCADDate();   
     141        CADScreenModel.theCADTime = CADServer.getCADTime(); 
     142        CADScreenModel.theCADDate = CADServer.getCADDate();   
    143143             
    144144        messageMap = new TreeMap<CADRoutedMessage, Boolean>();      
     
    158158     */   
    159159    protected void updateTime() { 
    160         CADScreenModel.theCADTime = CADSimulator.getCADTime(); 
     160        CADScreenModel.theCADTime = CADServer.getCADTime(); 
    161161         
    162162        setChanged(); 
    163163        notifyObservers(new ObserverMessage(ObserverMessage.messageType.TIME_UPDATE,  
    164                 CADSimulator.getCADTime())); 
     164                CADServer.getCADTime())); 
    165165    }    
    166166  
  • trunk/src/tmcsim/cadsimulator/CADServer.java

    r49 r123  
    1919import tmcsim.cadsimulator.managers.MediaManager; 
    2020import tmcsim.cadsimulator.managers.ParamicsSimulationManager; 
    21 import tmcsim.cadsimulator.managers.SimulationControlManager; 
    22 import tmcsim.cadsimulator.viewer.model.CADSimulatorModel; 
     21import tmcsim.cadsimulator.managers.SimulationClockManager; 
     22import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 
    2323import tmcsim.common.SimulationException; 
    2424import tmcsim.interfaces.CADViewer; 
     
    6464 * @version $Date: 2009/04/17 16:27:46 $ $Revision: 1.5 $ 
    6565 */ 
    66 public class CADSimulator 
     66public class CADServer 
    6767{ 
    6868 
     
    7878     * 
    7979     * @author Matthew 
    80      * @see CADSimulator 
     80     * @see CADServer 
    8181     */ 
    8282    private static enum CAD_PROPERTIES 
     
    132132        } 
    133133    }; 
     134    /** NOTE: Protected fields are accessed by Coordinator */ 
    134135    /** 
    135136     * CADSimulatorViewer instance. 
     
    138139    //protected static CADSimulatorViewer theViewer; 
    139140    //protected static CADConsoleViewer theConsole; 
    140     protected static CADSimulatorModel theModel; 
     141    protected static CADSimulatorState theModel; 
    141142    /** 
    142143     * Coordinator instance. 
     
    150151     * SimulationControlManager instance. 
    151152     */ 
    152     protected static SimulationControlManager theSimulationCntrlMgr = null; 
     153    protected static SimulationClockManager theSimulationCntrlMgr = null; 
    153154    /** 
    154155     * ParamicsSimulationManager instance. 
     
    183184     * Simulator. 
    184185     */ 
    185     public CADSimulator(String propertiesFile) throws SimulationException 
     186    public CADServer(String propertiesFile) throws SimulationException 
    186187    { 
    187188 
     
    224225                throw new SimulationException(SimulationException.INITIALIZE_ERROR); 
    225226            } 
    226             theModel = new CADSimulatorModel(); 
     227            theModel = new CADSimulatorState(); 
    227228            theModel.addObserver(theViewer); 
    228229 
     
    236237                    CAD_PROPERTIES.CAD_RMI_PORT.name).trim())); 
    237238 
    238             theSimulationCntrlMgr = new SimulationControlManager(theCoordinator); 
     239            theSimulationCntrlMgr = new SimulationClockManager(theCoordinator); 
    239240 
    240241            theATMSMgr = new ATMSManager( 
     
    410411                    + System.getProperty("file.separator") 
    411412                    + CONFIG_FILE_NAME; 
    412             new CADSimulator(propFile); 
     413            new CADServer(propFile); 
    413414        } catch (Exception e) 
    414415        { 
  • trunk/src/tmcsim/cadsimulator/CADSimulatorSocketHandler.java

    r2 r123  
    6666                clientSocket = serverSocket.accept(); 
    6767 
    68                 CADSimulatorClient theTMClient = new CADSimulatorClient(clientSocket); 
     68                CADClientConnector theTMClient = new CADClientConnector(clientSocket); 
    6969                theTMClient.start(); 
    7070                //CADSimulator.theViewer.connectClient(); 
  • trunk/src/tmcsim/cadsimulator/Coordinator.java

    r54 r123  
    2727import tmcsim.cadsimulator.managers.MediaManager; 
    2828import tmcsim.cadsimulator.managers.ParamicsSimulationManager; 
    29 import tmcsim.cadsimulator.managers.SimulationControlManager; 
    30 import tmcsim.cadsimulator.viewer.model.CADSimulatorModel; 
     29import tmcsim.cadsimulator.managers.SimulationClockManager; 
     30import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 
    3131import tmcsim.client.cadclientgui.CardfileReader; 
    3232import tmcsim.client.cadclientgui.ScriptHandler; 
     
    8080 * @see MediaManager 
    8181 * @see ParamicsSimulationManager 
    82  * @see SimulationControlManager 
     82 * @see SimulationClockManager 
    8383 * @author Matthew Cechini 
    8484 * @version 
     
    103103     * connected Manager, this object is set to null. 
    104104     */ 
    105     private static SimulationManagerInterface managerInt = null; 
     105    private static SimulationManagerInterface simMgr = null; 
    106106    private static LinkedList<CADClientInterface> clientList; 
    107107    private static CADData cadData; 
    108108    private static CardfileData cardfileData; 
    109     private CADSimulatorModel cadModel; 
     109    private CADSimulatorState cadModel; 
    110110 
    111111    /** 
     
    115115     * @throws RemoteException 
    116116     */ 
    117     public Coordinator(CADSimulatorModel model) throws RemoteException 
     117    public Coordinator(CADSimulatorState model) throws RemoteException 
    118118    { 
    119119        super(); 
     
    153153    public void registerForCallback(SimulationManagerInterface simManInt) throws RemoteException 
    154154    { 
    155         managerInt = simManInt; 
     155        simMgr = simManInt; 
    156156        cadModel.setSimManagerStatus(true); 
    157157    } 
     
    159159    public void unregisterForCallback(SimulationManagerInterface simManInt) throws RemoteException 
    160160    { 
    161         managerInt = null; 
     161        simMgr = null; 
    162162        cadModel.setSimManagerStatus(false); 
    163163    } 
     
    166166    { 
    167167 
    168         if (!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
     168        if (!CADServer.theIncidentMgr.areIncidentsLoaded()) 
    169169        { 
    170170            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 
    171171        } 
    172         else if (CADSimulator.theParamicsSimMgr.isConnected()) 
     172        else if (CADServer.theParamicsSimMgr.isConnected()) 
    173173        { 
    174174            Runnable startRun = new Runnable() 
     
    184184                         * Is some process happening on the ATMS side that we need to wait for? 
    185185                         */ 
    186                         long currentATMSTime = CADSimulator.theATMSMgr.getCurrentTime(); 
     186                        long currentATMSTime = CADServer.theATMSMgr.getCurrentTime(); 
    187187                        /* Seems like it waits 0-30 seconds, depending on what the time is on 
    188188                         * the ATMS server.  Does something happen every 30 seconds over there? 
     
    205205                    } finally 
    206206                    { 
    207                         CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    208                         CADSimulator.theParamicsSimMgr.startSimulation(); 
    209                         CADSimulator.theSoundPlayer.setAudioEnabled(true); 
     207                        CADServer.theSimulationCntrlMgr.startSimulation(); 
     208                        CADServer.theParamicsSimMgr.startSimulation(); 
     209                        CADServer.theSoundPlayer.setAudioEnabled(true); 
    210210                    } 
    211211                } 
     
    217217        else 
    218218        { 
    219             CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    220             CADSimulator.theSoundPlayer.setAudioEnabled(true); 
     219            CADServer.theSimulationCntrlMgr.startSimulation(); 
     220            CADServer.theSoundPlayer.setAudioEnabled(true); 
    221221        } 
    222222    } 
     
    224224    public void pauseSimulation() throws RemoteException 
    225225    { 
    226         CADSimulator.theSimulationCntrlMgr.pauseSimulation(); 
    227         CADSimulator.theSoundPlayer.setAudioEnabled(false); 
     226        CADServer.theSimulationCntrlMgr.pauseSimulation(); 
     227        CADServer.theSoundPlayer.setAudioEnabled(false); 
    228228    } 
    229229 
     
    231231    { 
    232232 
    233         CADSimulator.theIncidentMgr.resetIncidents(); 
     233        CADServer.theIncidentMgr.resetIncidents(); 
    234234        cadData.resetSimulation(); 
    235235 
    236         CADSimulator.theSoundPlayer.setAudioEnabled(false); 
    237         CADSimulator.theSoundPlayer.deQueueAll(); 
     236        CADServer.theSoundPlayer.setAudioEnabled(false); 
     237        CADServer.theSoundPlayer.deQueueAll(); 
    238238 
    239239        cadModel.setTime(0); 
     
    243243        CMSDiversionDB.getInstance().resetDiversions(); 
    244244 
    245         CADSimulator.theSimulationCntrlMgr.resetSimulation(); 
    246         CADSimulator.theParamicsSimMgr.resetSimulation(); 
     245        CADServer.theSimulationCntrlMgr.resetSimulation(); 
     246        CADServer.theParamicsSimMgr.resetSimulation(); 
    247247 
    248248        notifyObservers(new ObserverMessage(ObserverMessage.messageType.RESET_SIMULATION, null)); 
     
    253253    { 
    254254 
    255         boolean audioWasEnabled = CADSimulator.theSoundPlayer.getAudioEnabled(); 
    256  
    257         CADSimulator.theSoundPlayer.setAudioEnabled(false); 
     255        boolean audioWasEnabled = CADServer.theSoundPlayer.getAudioEnabled(); 
     256 
     257        CADServer.theSoundPlayer.setAudioEnabled(false); 
    258258 
    259259        long tempTime = 0; 
     
    262262            tempTime++; 
    263263 
    264             CADSimulator.theIncidentMgr.tick(tempTime); 
    265         } 
    266         CADSimulator.theSoundPlayer.setAudioEnabled(audioWasEnabled); 
    267  
    268  
    269         CADSimulator.theSimulationCntrlMgr.gotoSimulationTime(newSimTime); 
     264            CADServer.theIncidentMgr.tick(tempTime); 
     265        } 
     266        CADServer.theSoundPlayer.setAudioEnabled(audioWasEnabled); 
     267 
     268 
     269        CADServer.theSimulationCntrlMgr.gotoSimulationTime(newSimTime); 
    270270 
    271271        Runnable gotoRun = new Runnable() 
     
    275275                cadModel.setTime(newSimTime); 
    276276 
    277                 if (managerInt != null) 
     277                if (simMgr != null) 
    278278                { 
    279279                    try 
    280280                    { 
    281                         managerInt.tick(newSimTime); 
     281                        simMgr.tick(newSimTime); 
    282282                    } catch (RemoteException re) 
    283283                    { 
    284284                        //Simulation Manager has disappeared 
    285                         managerInt = null; 
     285                        simMgr = null; 
    286286                        cadModel.setSimManagerStatus(false); 
    287287 
     
    312312                cadModel.setScriptStatus(status); 
    313313 
    314                 if (managerInt != null) 
     314                if (simMgr != null) 
    315315                { 
    316316                    try 
    317317                    { 
    318                         managerInt.setScriptStatus(status); 
     318                        simMgr.setScriptStatus(status); 
    319319                    } catch (RemoteException re) 
    320320                    { 
    321321                        //Simulation Manager has disappeared 
    322                         managerInt = null; 
     322                        simMgr = null; 
    323323                        cadModel.setSimManagerStatus(false); 
    324324 
     
    362362                } 
    363363 
    364                 if (managerInt != null) 
     364                if (simMgr != null) 
    365365                { 
    366366                    try 
    367367                    { 
    368                         managerInt.setParamicsStatus(status); 
     368                        simMgr.setParamicsStatus(status); 
    369369                    } catch (RemoteException re) 
    370370                    { 
    371371                        //Simulation Manager has disappeared 
    372                         managerInt = null; 
     372                        simMgr = null; 
    373373                        cadModel.setSimManagerStatus(false); 
    374374 
     
    387387    public void connectToParamics() throws RemoteException 
    388388    { 
    389         CADSimulator.theParamicsSimMgr.connectToParamics(); 
     389        CADServer.theParamicsSimMgr.connectToParamics(); 
    390390    } 
    391391 
    392392    public void disconnectFromParamics() throws RemoteException 
    393393    { 
    394         CADSimulator.theParamicsSimMgr.disconnectFromParamics(); 
     394        CADServer.theParamicsSimMgr.disconnectFromParamics(); 
    395395    } 
    396396 
    397397    public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException 
    398398    { 
    399         CADSimulator.theParamicsSimMgr.loadParamicsNetwork(networkID); 
     399        CADServer.theParamicsSimMgr.loadParamicsNetwork(networkID); 
    400400    } 
    401401 
    402402    public PARAMICS_STATUS getParamicsStatus() throws RemoteException 
    403403    { 
    404         return CADSimulator.theParamicsSimMgr.getParamicsStatus(); 
     404        return CADServer.theParamicsSimMgr.getParamicsStatus(); 
    405405    } 
    406406 
    407407    public int getParamicsNetworkLoaded() throws RemoteException 
    408408    { 
    409         return CADSimulator.theParamicsSimMgr.getParamicsNetworkLoaded(); 
     409        return CADServer.theParamicsSimMgr.getParamicsNetworkLoaded(); 
    410410    } 
    411411 
    412412    public long getCurrentSimulationTime() throws RemoteException 
    413413    { 
    414         return CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
     414        return CADServer.theSimulationCntrlMgr.getCurrentSimTime(); 
    415415    } 
    416416 
     
    418418    { 
    419419 
    420         if (!CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
     420        if (!CADServer.theSimulationCntrlMgr.simulationStarted()) 
    421421        { 
    422422            throw new ScriptException(ScriptException.SIM_NOT_STARTED); 
    423423        } 
    424         else if (!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
     424        else if (!CADServer.theIncidentMgr.areIncidentsLoaded()) 
    425425        { 
    426426            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED); 
    427427        } 
    428428 
    429         CADSimulator.theIncidentMgr.triggerIncident(incidentNumber, 
    430                 CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()); 
     429        CADServer.theIncidentMgr.triggerIncident(incidentNumber, 
     430                CADServer.theSimulationCntrlMgr.getCurrentSimTime()); 
    431431    } 
    432432 
    433433    public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException 
    434434    { 
    435         CADSimulator.theIncidentMgr.deleteIncident(incidentNumber); 
    436  
    437         if (CADSimulator.theIncidentMgr.getIncidentList().size() == 0) 
     435        CADServer.theIncidentMgr.deleteIncident(incidentNumber); 
     436 
     437        if (CADServer.theIncidentMgr.getIncidentList().size() == 0) 
    438438        { 
    439439            setScriptStatus(SCRIPT_STATUS.NO_SCRIPT); 
    440440        } 
    441441 
    442         if (managerInt != null) 
     442        if (simMgr != null) 
    443443        { 
    444444            try 
    445445            { 
    446                 managerInt.incidentRemoved(incidentNumber); 
     446                simMgr.incidentRemoved(incidentNumber); 
    447447            } catch (RemoteException re) 
    448448            { 
    449449                //Simulation Manager has disappeared 
    450                 managerInt = null; 
     450                simMgr = null; 
    451451                cadModel.setSimManagerStatus(false); 
    452452 
     
    461461    { 
    462462 
    463         if (newTime < CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()) 
     463        if (newTime < CADServer.theSimulationCntrlMgr.getCurrentSimTime()) 
    464464        { 
    465465            throw new ScriptException(ScriptException.TIME_PASSED); 
    466466        } 
    467467 
    468         CADSimulator.theIncidentMgr.rescheduleIncident(incidentNumber, newTime); 
     468        CADServer.theIncidentMgr.rescheduleIncident(incidentNumber, newTime); 
    469469    } 
    470470 
     
    472472    { 
    473473 
    474         CADSimulator.theIncidentMgr.addIncident(newIncident); 
    475  
    476         if (managerInt != null) 
     474        CADServer.theIncidentMgr.addIncident(newIncident); 
     475 
     476        if (simMgr != null) 
    477477        { 
    478478            try 
    479479            { 
    480                 managerInt.incidentAdded(newIncident); 
     480                simMgr.incidentAdded(newIncident); 
    481481            } catch (RemoteException re) 
    482482            { 
    483483                //Simulation Manager has disappeared 
    484                 managerInt = null; 
     484                simMgr = null; 
    485485                cadModel.setSimManagerStatus(false); 
    486486 
     
    497497        try 
    498498        { 
    499             CADSimulator.theIncidentMgr.clearIncidents(); 
     499            CADServer.theIncidentMgr.clearIncidents(); 
    500500            cadData.clearData(); 
    501501 
     
    507507            cadData.setUnitsFromXML(sh.getUnits()); 
    508508            refreshClients(); 
    509             CADSimulator.theIncidentMgr.addIncidents(sh.getIncidents()); 
     509            CADServer.theIncidentMgr.addIncidents(sh.getIncidents()); 
    510510 
    511511            resetSimulation(); 
     
    519519    public Vector<Incident> getIncidentList() throws RemoteException 
    520520    { 
    521         return CADSimulator.theIncidentMgr.getIncidentList(); 
     521        return CADServer.theIncidentMgr.getIncidentList(); 
    522522    } 
    523523 
    524524    public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException 
    525525    { 
    526         return CADSimulator.theIncidentMgr.getTriggeredEvents(); 
     526        return CADServer.theIncidentMgr.getTriggeredEvents(); 
    527527    } 
    528528 
    529529    public SCRIPT_STATUS getScriptStatus() throws RemoteException 
    530530    { 
    531         if (CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
    532         { 
    533             if (CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
     531        if (CADServer.theIncidentMgr.areIncidentsLoaded()) 
     532        { 
     533            if (CADServer.theSimulationCntrlMgr.simulationStarted()) 
    534534            { 
    535535                return SCRIPT_STATUS.SCRIPT_RUNNING; 
     
    537537            else 
    538538            { 
    539                 for (Incident inc : CADSimulator.theIncidentMgr.getIncidentList()) 
     539                for (Incident inc : CADServer.theIncidentMgr.getIncidentList()) 
    540540                { 
    541541                    if (inc.hasOccured() == true) 
     
    599599    { 
    600600        CMSDiversionDB.getInstance().updateDiversions(theDiversion); 
    601         CADSimulator.theParamicsSimMgr.updateDiversion(theDiversion); 
     601        CADServer.theParamicsSimMgr.updateDiversion(theDiversion); 
    602602    } 
    603603 
     
    614614    { 
    615615 
    616         long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
     616        long currentSimTime = CADServer.theSimulationCntrlMgr.getCurrentSimTime(); 
    617617 
    618618        IncidentEvent triggeredEvent = new IncidentEvent(currentSimTime); 
    619619        triggeredEvent.eventInfo = modelInfo; 
    620620 
    621         triggeredEvent.finalizeEvent(currentSimTime, CADSimulator.getCADTime()); 
    622  
    623         CADSimulator.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent); 
     621        triggeredEvent.finalizeEvent(currentSimTime, CADServer.getCADTime()); 
     622 
     623        CADServer.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent); 
    624624 
    625625        updateIncidentInGUI(modelInfo.getLogNumber(), triggeredEvent); 
     
    633633     * ParamicsControlManager to send an IncidentUpdate. 
    634634     * 
    635      * @see SimulationControlManager 
     635     * @see SimulationClockManager 
    636636     * @see ParamicsControlManager 
    637637     * @see IncidentManager 
     
    639639    public void tick() 
    640640    { 
    641         if (CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
    642         { 
    643  
    644             final long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime(); 
     641        if (CADServer.theSimulationCntrlMgr.simulationStarted()) 
     642        { 
     643 
     644            final long currentSimTime = CADServer.theSimulationCntrlMgr.getCurrentSimTime(); 
    645645 
    646646            Runnable timeRun = new Runnable() 
     
    653653                    if (currentSimTime % 30 == 0) 
    654654                    { 
    655                         CADSimulator.theParamicsSimMgr.sendIncidentUpdate(currentSimTime); 
     655                        CADServer.theParamicsSimMgr.sendIncidentUpdate(currentSimTime); 
    656656                    } 
    657657 
    658                     if (managerInt != null) 
     658                    if (simMgr != null) 
    659659                    { 
    660660                        try 
    661661                        { 
    662                             managerInt.tick(currentSimTime); 
     662                            simMgr.tick(currentSimTime); 
    663663                        } catch (RemoteException re) 
    664664                        { 
    665665                            //Simulation Manager has disappeared 
    666                             managerInt = null; 
     666                            simMgr = null; 
    667667                            cadModel.setSimManagerStatus(false); 
    668668 
     
    672672                    } 
    673673 
    674                     CADSimulator.theIncidentMgr.tick(currentSimTime); 
     674                    CADServer.theIncidentMgr.tick(currentSimTime); 
    675675                } 
    676676            }; 
     
    699699            public void run() 
    700700            { 
    701                 if (managerInt != null) 
     701                if (simMgr != null) 
    702702                { 
    703703                    try 
    704704                    { 
    705                         managerInt.incidentStarted(completedEvent.eventInfo.getLogNumber()); 
     705                        simMgr.incidentStarted(completedEvent.eventInfo.getLogNumber()); 
    706706                    } catch (RemoteException re) 
    707707                    { 
    708708                        //Simulation Manager has disappeared 
    709                         managerInt = null; 
     709                        simMgr = null; 
    710710                        cadModel.setSimManagerStatus(false); 
    711711 
     
    740740        for (XMLIncident xmlInc : completedEvent.XMLIncidents) 
    741741        { 
    742             CADSimulator.theParamicsSimMgr.updateIncident(xmlInc); 
     742            CADServer.theParamicsSimMgr.updateIncident(xmlInc); 
    743743        } 
    744744 
     
    753753            public void run() 
    754754            { 
    755                 if (managerInt != null) 
     755                if (simMgr != null) 
    756756                { 
    757757                    try 
    758758                    { 
    759                         managerInt.eventOccured( 
     759                        simMgr.eventOccured( 
    760760                                completedEvent.eventInfo.getLogNumber(), 
    761761                                completedEvent); 
     
    763763                    { 
    764764                        //Simulation Manager has disappeared 
    765                         managerInt = null; 
     765                        simMgr = null; 
    766766                        cadModel.setSimManagerStatus(false); 
    767767 
     
    782782    public boolean incidentExists(Integer logNumber) 
    783783    { 
    784         return CADSimulator.theIncidentMgr.incidentExists(logNumber); 
     784        return CADServer.theIncidentMgr.incidentExists(logNumber); 
    785785    } 
    786786 
     
    790790    public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() 
    791791    { 
    792         return CADSimulator.theIncidentMgr.getIncidentBoardModelObjects(); 
     792        return CADServer.theIncidentMgr.getIncidentBoardModelObjects(); 
    793793    } 
    794794 
     
    798798    public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) 
    799799    { 
    800         return CADSimulator.theIncidentMgr.getIncidentInquiryModelObjects(logNumber); 
     800        return CADServer.theIncidentMgr.getIncidentInquiryModelObjects(logNumber); 
    801801    } 
    802802 
     
    806806    public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() 
    807807    { 
    808         return CADSimulator.theIncidentMgr.getIncidentSummaryModelObjects(); 
     808        return CADServer.theIncidentMgr.getIncidentSummaryModelObjects(); 
    809809    } 
    810810 
  • trunk/src/tmcsim/cadsimulator/managers/IncidentManager.java

    r2 r123  
    77import tmcsim.cadmodels.IncidentInquiryModel_obj; 
    88import tmcsim.cadmodels.IncidentSummaryModel_obj; 
    9 import tmcsim.cadsimulator.CADSimulator; 
     9import tmcsim.cadsimulator.CADServer; 
    1010import tmcsim.cadsimulator.Coordinator; 
    1111import tmcsim.cadsimulator.SoundPlayer; 
     
    247247                 
    248248            for(IncidentEvent event : inc.getCompletedEvents()) { 
    249                 event.finalizeEvent(currentSimTime, CADSimulator.getCADTime()); 
     249                event.finalizeEvent(currentSimTime, CADServer.getCADTime()); 
    250250                updateIncident(inc.getLogNumber(), event); 
    251251                theCoordinator.updateIncidentInGUI(inc.getLogNumber(), event); 
     
    311311        if(targetIncident == null) { 
    312312            completedEvent.eventInfo.getHeader().logStatus    = "A";              
    313             completedEvent.eventInfo.getHeader().incidentDate = CADSimulator.getCADDate().substring(0,4);   
    314             completedEvent.eventInfo.getHeader().incidentTime = CADSimulator.getCADTime(); 
     313            completedEvent.eventInfo.getHeader().incidentDate = CADServer.getCADDate().substring(0,4);   
     314            completedEvent.eventInfo.getHeader().incidentTime = CADServer.getCADTime(); 
    315315             
    316316            targetIncident = new IncidentInquiryModel_obj(completedEvent.eventInfo); 
  • trunk/src/tmcsim/cadsimulator/managers/MediaManager.java

    r44 r123  
    1919import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate; 
    2020import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate; 
    21 import tmcsim.cadsimulator.viewer.model.CADSimulatorModel; 
     21import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 
    2222import tmcsim.common.CCTVDirections; 
    2323import tmcsim.common.CCTVInfo; 
     
    7474     
    7575    /** Reference to the CADSimulatorModel. */ 
    76     private CADSimulatorModel theModel; 
     76    private CADSimulatorState theModel; 
    7777 
    7878    /** Properties object for the Media portion of the CAD. */ 
     
    9090     */ 
    9191    public MediaManager(String propertiesFile, ATMSManager theATMSManager,  
    92             CADSimulatorModel model) { 
     92            CADSimulatorState model) { 
    9393        theDVD_DB   = new DVDPlayerDB();         
    9494        theImage_DB = new StillImagesDB(); 
  • trunk/src/tmcsim/cadsimulator/managers/SimulationClockManager.java

    r2 r123  
    88import tmcsim.common.CADEnums.SCRIPT_STATUS; 
    99 
    10 public class SimulationControlManager  { 
     10/** Manage the simulation clock, "the heartbeat of the simulation". */ 
     11public class SimulationClockManager  { 
    1112 
    1213    /**  
    13      *  
     14     * Define what happens every second. 
    1415     */ 
    1516    private class ClockTask extends TimerTask {      
     
    3940     
    4041     
    41     public SimulationControlManager(Coordinator coor) { 
     42    public SimulationClockManager(Coordinator coor) { 
    4243         
    4344        theCoordinator    = coor;        
     
    5960     
    6061    public void startSimulation() { 
    61              
     62        /** Start the clock running */     
    6263        simTimer = new Timer();      
    6364        simTimer.scheduleAtFixedRate(new ClockTask(), 0, 1000); 
  • trunk/src/tmcsim/cadsimulator/viewer/CADConsoleViewer.java

    r44 r123  
    44import java.io.Writer; 
    55import java.util.Observable; 
    6 import tmcsim.cadsimulator.viewer.model.CADSimulatorModel; 
     6import tmcsim.cadsimulator.viewer.model.CADSimulatorState; 
    77import tmcsim.cadsimulator.viewer.model.CADSimulatorStatus; 
    88import tmcsim.common.CADEnums.PARAMICS_STATUS; 
     
    3030     * Simulation model 
    3131     */ 
    32     private CADSimulatorModel cadstatus; 
     32    private CADSimulatorState cadstatus; 
    3333    private PrintWriter display; 
    3434 
  • trunk/src/tmcsim/cadsimulator/viewer/model/CADSimulatorState.java

    r44 r123  
    1515 */ 
    1616@SuppressWarnings("serial") 
    17 public class CADSimulatorModel 
     17public class CADSimulatorState 
    1818{ 
    1919 
     
    2424     * Constructor. 
    2525     */ 
    26     public CADSimulatorModel() 
     26    public CADSimulatorState() 
    2727    { 
    2828        simStatus = new CADSimulatorStatus(); 
  • trunk/src/tmcsim/simulationmanager/actions/StartSimulationAction.java

    r2 r123  
    1212/** 
    1313 * 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  
    1916 * simulation. 
    2017 * @author Matthew Cechini 
     
    3835    public void actionPerformed(ActionEvent evt) { 
    3936        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//                } 
    5049                 
    5150                try {  
Note: See TracChangeset for help on using the changeset viewer.