Mercurial > public > ostc4
comparison Discovery/Src/simulation.c @ 233:9f0efc4df01e div-fixes-4-1
cleanup, bugfix: do not exit simulator on 5h dive time
The code cleaned up here caused me some confusion as over 5h dives
where silently aborted in the simulator. Ok, not many uses will
try to simulate 5h dives, but its a useless limitation.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Fri, 05 Apr 2019 09:12:04 +0200 |
parents | 2bb1db22b5f5 |
children | 5ca177d2df5d |
comparison
equal
deleted
inserted
replaced
232:f0069f002c55 | 233:9f0efc4df01e |
---|---|
235 *AvgDepthValue = 0; | 235 *AvgDepthValue = 0; |
236 | 236 |
237 /* Exposure Tissues | 237 /* Exposure Tissues |
238 */ | 238 */ |
239 decom_tissues_exposure(1, &pDiveState->lifeData); | 239 decom_tissues_exposure(1, &pDiveState->lifeData); |
240 /* moved to updateSetpointStateUsed() | |
241 pDiveState->lifeData.ppO2 = decom_calc_ppO2( pDiveState->lifeData.pressure_ambient_bar, &pDiveState->lifeData.actualGas); | |
242 */ | |
243 decom_oxygen_calculate_cns_exposure(1, &pDiveState->lifeData.actualGas, pDiveState->lifeData.pressure_ambient_bar, &pDiveState->lifeData.cns); | 240 decom_oxygen_calculate_cns_exposure(1, &pDiveState->lifeData.actualGas, pDiveState->lifeData.pressure_ambient_bar, &pDiveState->lifeData.cns); |
244 //if((pDiveState->lifeData.depth_meter < 0.1f) || (pDiveState->lifeData.dive_time_seconds > 1*60*60)) | 241 |
245 // if(pDiveState->lifeData.dive_time_seconds > 1*60*60) | |
246 if(pDiveState->lifeData.dive_time_seconds > 5*60*60) // test Dirk Berben | |
247 { | |
248 simulation_exit(); | |
249 } | |
250 if(stateSimGetPointer()->lifeData.counterSecondsShallowDepth) | 242 if(stateSimGetPointer()->lifeData.counterSecondsShallowDepth) |
251 { | 243 { |
252 stateSimGetPointerWrite()->lifeData.counterSecondsShallowDepth += 1; | 244 stateSimGetPointerWrite()->lifeData.counterSecondsShallowDepth += 1; |
253 if(stateSimGetPointer()->lifeData.counterSecondsShallowDepth >= settingsGetPointer()->timeoutDiveReachedZeroDepth) | 245 if(stateSimGetPointer()->lifeData.counterSecondsShallowDepth >= settingsGetPointer()->timeoutDiveReachedZeroDepth) |
254 simulation_exit(); | 246 simulation_exit(); |