Changeset 35 in tmcsimulator for trunk/src/tmcsim
- Timestamp:
- 04/29/2016 03:23:31 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/tmcsim/cadsimulator/Coordinator.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/Coordinator.java
r27 r35 158 158 159 159 coorLogger.logp(Level.INFO, "Coordinator", "startSimulation", 160 " starting...");160 "entering startSimulation()"); 161 161 if (!CADSimulator.theIncidentMgr.areIncidentsLoaded()) 162 162 { … … 168 168 public void run() 169 169 { 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 // { 177 191 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 "); 191 193 CADSimulator.theSimulationCntrlMgr.startSimulation(); 192 194 CADSimulator.theParamicsSimMgr.startSimulation(); 193 195 CADSimulator.theSoundPlayer.setAudioEnabled(true); 194 coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation:run", 195 "Simulation has started."); 196 } 196 // } 197 197 } 198 198 }; … … 200 200 Thread startThread = new Thread(startRun); 201 201 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. .."); 204 206 CADSimulator.theSimulationCntrlMgr.startSimulation(); 205 207 CADSimulator.theSoundPlayer.setAudioEnabled(true); 206 208 } 209 coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation:run", 210 "Simulation has started."); 207 211 } 208 212
Note: See TracChangeset
for help on using the changeset viewer.
