comparison Discovery/Src/simulation.c @ 888:07af9efd7c13 Evo_2_23

Dev bugfix: Consider decogas in planner independen from calculation setting: Some time ago the selection if a deco gas is used for live deco calculation or not was introduced. The planner did not consider the option as well causing it to ingnore deco gases in the planning what is not intended. To fix this the calculation flag is set at planer simulation start for all deco gases. Beside this the cursor is now placed in the bottom line at "next" instead of the first menu item.
author Ideenmodellierer
date Tue, 03 Sep 2024 20:46:42 +0200
parents b7d93ff6b3b2
children 65772ddee88c
comparison
equal deleted inserted replaced
887:17f02ac9da67 888:07af9efd7c13
404 } 404 }
405 405
406 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2) 406 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2)
407 { 407 {
408 uint8_t ptrGasChangeList = 0; // new hw 160704 408 uint8_t ptrGasChangeList = 0; // new hw 160704
409 409 uint8_t index = 0;
410 for (int i = 0; i < 40; i++) 410 for (int i = 0; i < 40; i++)
411 gasChangeListDepthGas20x2[i] = 0; 411 gasChangeListDepthGas20x2[i] = 0;
412 412
413 SDiveState * pDiveState = &stateSim; 413 SDiveState * pDiveState = &stateSim;
414 copyDiveSettingsToSim(); 414 copyDiveSettingsToSim();
415
416 /* activate deco calculation for all deco gases */
417 for(index = 0; index < 1 + (2*NUM_GASES); index++)
418 {
419 if(pDiveState->diveSettings.gas[index].note.ub.deco)
420 {
421 pDiveState->diveSettings.gas[index].note.ub.decocalc = 1;
422 }
423 }
424
415 vpm_init(&pDiveState->vpm, pDiveState->diveSettings.vpm_conservatism, 0, 0); 425 vpm_init(&pDiveState->vpm, pDiveState->diveSettings.vpm_conservatism, 0, 0);
416 //buehlmann_init(); 426 //buehlmann_init();
417 //timer_init(); 427 //timer_init();
418 memset(&pDiveState->events,0, sizeof(SEvents)); 428 memset(&pDiveState->events,0, sizeof(SEvents));
419 pDiveState->diveSettings.internal__pressure_first_stop_ambient_bar_as_upper_limit_for_gf_low_otherwise_zero = 0; 429 pDiveState->diveSettings.internal__pressure_first_stop_ambient_bar_as_upper_limit_for_gf_low_otherwise_zero = 0;