changeset 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 17f02ac9da67
children cf3967fe6924
files Discovery/Src/simulation.c Discovery/Src/tMenuEditPlanner.c
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/simulation.c	Tue Sep 03 15:30:53 2024 +0200
+++ b/Discovery/Src/simulation.c	Tue Sep 03 20:46:42 2024 +0200
@@ -406,12 +406,22 @@
 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2)
 {
     uint8_t ptrGasChangeList = 0; // new hw 160704
-
+    uint8_t index = 0;
     for (int i = 0; i < 40; i++)
     	gasChangeListDepthGas20x2[i] = 0;
 
     SDiveState * pDiveState = &stateSim;
     copyDiveSettingsToSim();
+
+    /* activate deco calculation for all deco gases */
+    for(index = 0; index < 1 + (2*NUM_GASES); index++)
+    {
+    	if(pDiveState->diveSettings.gas[index].note.ub.deco)
+    	{
+    		pDiveState->diveSettings.gas[index].note.ub.decocalc = 1;
+    	}
+    }
+
     vpm_init(&pDiveState->vpm,  pDiveState->diveSettings.vpm_conservatism, 0, 0);
     //buehlmann_init();
     //timer_init();
--- a/Discovery/Src/tMenuEditPlanner.c	Tue Sep 03 15:30:53 2024 +0200
+++ b/Discovery/Src/tMenuEditPlanner.c	Tue Sep 03 20:46:42 2024 +0200
@@ -407,6 +407,7 @@
     text[2] = 0;
     write_field_button(StMPLAN5_ExitResult, 30, 800, ME_Y_LINE6,  &FontT48, text);
     setEvent(StMPLAN5_ExitResult, (uint32_t)OnAction_PlanResultExit);
+    tMenuEdit_select(StMPLAN5_ExitResult);
 }