Mercurial > public > ostc4
comparison Discovery/Src/tHome.c @ 633:68d95049f11a
Added menu structure to allow ppo2 modification in simulator mode:
For development purpose (to be enabled by compile switch) the posibillity to modify ppo2 values using the T3_Sensor view quick menu access has been added.
author | Ideenmodellierer |
---|---|
date | Tue, 23 Feb 2021 21:58:18 +0100 |
parents | db2bcd2f6778 |
children | 980d7f8d5530 |
comparison
equal
deleted
inserted
replaced
632:2586f7b734f4 | 633:68d95049f11a |
---|---|
191 case CVIEW_T3_GasList: if(stateUsed->warnings.betterGas) | 191 case CVIEW_T3_GasList: if(stateUsed->warnings.betterGas) |
192 { | 192 { |
193 set_globalState(StDMGAS); | 193 set_globalState(StDMGAS); |
194 } | 194 } |
195 break; | 195 break; |
196 #ifdef ENABLE_T3_PPO_SIM | |
197 case CVIEW_sensors: if(is_stateUsedSetToSim()) | |
198 { | |
199 set_globalState(StDSIM1); | |
200 } | |
201 break; | |
202 #endif | |
196 #ifdef ENABLE_T3_PROFILE_VIEW | 203 #ifdef ENABLE_T3_PROFILE_VIEW |
197 case CVIEW_T3_Profile: set_globalState(StDMARK); | 204 case CVIEW_T3_Profile: set_globalState(StDMARK); |
198 #endif | 205 #endif |
199 break; | 206 break; |
200 default: | 207 default: |
230 set_globalState(StDMENU); | 237 set_globalState(StDMENU); |
231 break; | 238 break; |
232 | 239 |
233 case StDMENU: | 240 case StDMENU: |
234 if(is_stateUsedSetToSim()) | 241 if(is_stateUsedSetToSim()) |
235 set_globalState(StDSIM1); | 242 { |
243 if(settingsGetPointer()->design != 3) | |
244 { | |
245 set_globalState(StDSIM1); | |
246 } | |
247 else | |
248 { | |
249 #ifdef ENABLE_T3_PPO_SIM | |
250 if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x01) == 0) | |
251 { | |
252 set_globalState(StDSIM1); | |
253 } | |
254 else if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x02) == 0) | |
255 { | |
256 set_globalState(StDSIM3); | |
257 } | |
258 else if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x04) == 0) | |
259 { | |
260 set_globalState(StDSIM5); | |
261 } | |
262 else | |
263 { | |
264 set_globalState(StD); | |
265 } | |
266 #endif | |
267 } | |
268 } | |
269 | |
236 else | 270 else |
237 set_globalState(StD); | 271 set_globalState(StD); |
238 break; | 272 break; |
239 | 273 |
240 case StDSIM1: | 274 case StDSIM1: |
241 set_globalState(StDSIM2); | 275 set_globalState(StDSIM2); |
242 break; | 276 break; |
243 | 277 |
244 case StDSIM2: | 278 case StDSIM2: |
245 set_globalState(StDSIM3); | 279 if(settingsGetPointer()->design != 3) |
280 { | |
281 set_globalState(StDSIM3); | |
282 } | |
283 else | |
284 { | |
285 #ifdef ENABLE_T3_PPO_SIM | |
286 if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x02) == 0) | |
287 { | |
288 set_globalState(StDSIM3); | |
289 } | |
290 else if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x04) == 0) | |
291 { | |
292 set_globalState(StDSIM5); | |
293 } | |
294 else | |
295 { | |
296 set_globalState(StD); | |
297 } | |
298 #endif | |
299 } | |
246 break; | 300 break; |
247 | 301 |
248 case StDSIM3: | 302 case StDSIM3: |
249 set_globalState(StDSIM4); | 303 set_globalState(StDSIM4); |
250 break; | 304 break; |
251 | 305 |
252 case StDSIM4: | 306 case StDSIM4: |
307 if(settingsGetPointer()->design != 3) | |
308 { | |
253 set_globalState(StD); | 309 set_globalState(StD); |
254 break; | 310 } |
255 | 311 else |
312 { | |
313 #ifdef ENABLE_T3_PPO_SIM | |
314 if((stateUsed->diveSettings.ppo2sensors_deactivated & 0x04) == 0) | |
315 { | |
316 set_globalState(StDSIM5); | |
317 } | |
318 else | |
319 { | |
320 set_globalState(StD); | |
321 } | |
322 #endif | |
323 } | |
324 break; | |
325 #ifdef ENABLE_T3_PPO_SIM | |
326 case StDSIM5: | |
327 set_globalState(StDSIM6); | |
328 break; | |
329 | |
330 case StDSIM6: | |
331 set_globalState(StD); | |
332 break; | |
333 #endif | |
256 case StDBEAR: | 334 case StDBEAR: |
257 if(settingsGetPointer()->design == 5) | 335 if(settingsGetPointer()->design == 5) |
258 { | 336 { |
259 set_globalState(StDRAVG); | 337 set_globalState(StDRAVG); |
260 } | 338 } |
324 case StDMENU: | 402 case StDMENU: |
325 openMenu_first_page_with_OC_gas_update(); | 403 openMenu_first_page_with_OC_gas_update(); |
326 break; | 404 break; |
327 | 405 |
328 case StDSIM1: | 406 case StDSIM1: |
407 if(settingsGetPointer()->design != 3) | |
408 { | |
329 Sim_Quit(); | 409 Sim_Quit(); |
410 } | |
411 else | |
412 { | |
413 Sim_IncreasePPO(0); | |
414 } | |
330 break; | 415 break; |
331 | 416 |
332 case StDSIM2: | 417 case StDSIM2: |
333 Sim_Ascend(); | 418 if(settingsGetPointer()->design != 3) |
419 { | |
420 Sim_Ascend(); | |
421 } | |
422 else | |
423 { | |
424 Sim_DecreasePPO(0); | |
425 } | |
426 | |
334 break; | 427 break; |
335 | 428 |
336 case StDSIM3: | 429 case StDSIM3: |
430 if(settingsGetPointer()->design != 3) | |
431 { | |
337 Sim_Descend(); | 432 Sim_Descend(); |
433 } | |
434 else | |
435 { | |
436 Sim_IncreasePPO(1); | |
437 } | |
438 | |
338 break; | 439 break; |
339 | 440 |
340 case StDSIM4: | 441 case StDSIM4: |
442 if(settingsGetPointer()->design != 3) | |
443 { | |
341 Sim_Divetime(); | 444 Sim_Divetime(); |
342 break; | 445 } |
343 | 446 else |
447 { | |
448 Sim_DecreasePPO(1); | |
449 } | |
450 | |
451 break; | |
452 #ifdef ENABLE_T3_PPO_SIM | |
453 case StDSIM5: | |
454 Sim_IncreasePPO(2); | |
455 break; | |
456 case StDSIM6: | |
457 Sim_DecreasePPO(2); | |
458 break; | |
459 #endif | |
344 case StDBEAR: // t5_gauge | 460 case StDBEAR: // t5_gauge |
345 stateUsedWrite->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; | 461 stateUsedWrite->diveSettings.compassHeading = (uint16_t)stateUsed->lifeData.compass_heading; |
346 set_globalState(StD); | 462 set_globalState(StD); |
347 break; | 463 break; |
348 | 464 |