Changeset 35 in tmcsimulator for trunk/src/tmcsim/cadsimulator/Coordinator.java


Ignore:
Timestamp:
04/29/2016 03:23:31 PM (10 years ago)
Author:
jdalbey
Message:

Removed ATMS synchronizing from Coordinator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/cadsimulator/Coordinator.java

    r27 r35  
    158158 
    159159        coorLogger.logp(Level.INFO, "Coordinator", "startSimulation", 
    160                 "starting..."); 
     160                "entering startSimulation()"); 
    161161        if (!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 
    162162        { 
     
    168168                public void run() 
    169169                { 
    170                     try 
    171                     { 
    172                         setScriptStatus(SCRIPT_STATUS.ATMS_SYNCHRONIZATION); 
    173  
    174                         long currentATMSTime = CADSimulator.theATMSMgr.getCurrentTime(); 
    175                         long sleepTime = ((60 * 1000) - (currentATMSTime % (60 * 1000))) % (30 * 1000); 
    176  
     170//                    try 
     171//                    { 
     172//                        setScriptStatus(SCRIPT_STATUS.ATMS_SYNCHRONIZATION); 
     173// 
     174//                        long currentATMSTime = CADSimulator.theATMSMgr.getCurrentTime(); 
     175//                        long sleepTime = ((60 * 1000) - (currentATMSTime % (60 * 1000))) % (30 * 1000); 
     176// 
     177//                        coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation", 
     178//                                "Sleeping for " + sleepTime / 1000 + " seconds."); 
     179//                        Thread.sleep(sleepTime); 
     180// 
     181//                        //currentATMSTime += sleepTime; 
     182//                        //ParamicsCommunicator.getInstance().serverTime.setTimeInMillis(currentATMSTime); 
     183//                    } catch (Exception e) 
     184//                    { 
     185//                        setScriptStatus(SCRIPT_STATUS.SCRIPT_RUNNING); 
     186// 
     187//                        coorLogger.logp(Level.SEVERE, "Coordinator", "StartSimulation:run", 
     188//                                "Unable to connect to ATMS server.", e); 
     189//                    } finally 
     190//                    { 
    177191                        coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation", 
    178                                 "Sleeping for " + sleepTime / 1000 + " seconds."); 
    179                         Thread.sleep(sleepTime); 
    180  
    181                         //currentATMSTime += sleepTime; 
    182                         //ParamicsCommunicator.getInstance().serverTime.setTimeInMillis(currentATMSTime); 
    183                     } catch (Exception e) 
    184                     { 
    185                         setScriptStatus(SCRIPT_STATUS.SCRIPT_RUNNING); 
    186  
    187                         coorLogger.logp(Level.SEVERE, "Coordinator", "StartSimulation:run", 
    188                                 "Unable to connect to ATMS server.", e); 
    189                     } finally 
    190                     { 
     192                                "Starting WITH paramics connected "); 
    191193                        CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    192194                        CADSimulator.theParamicsSimMgr.startSimulation(); 
    193195                        CADSimulator.theSoundPlayer.setAudioEnabled(true); 
    194                         coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation:run", 
    195                                 "Simulation has started."); 
    196                     } 
     196//                    } 
    197197                } 
    198198            }; 
     
    200200            Thread startThread = new Thread(startRun); 
    201201            startThread.start(); 
    202         } else 
    203         { 
     202        } else // Paramics isn't connected so start without it 
     203        { 
     204            coorLogger.logp(Level.INFO, "Coordinator", "startSimulation", 
     205                "starting without paramics connection. ..");             
    204206            CADSimulator.theSimulationCntrlMgr.startSimulation(); 
    205207            CADSimulator.theSoundPlayer.setAudioEnabled(true); 
    206208        } 
     209        coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation:run", 
     210                "Simulation has started."); 
    207211    } 
    208212 
Note: See TracChangeset for help on using the changeset viewer.