Mercurial > public > ostc4
changeset 973:79b522fbabe6 Evo_2_23
Deactivate deco gas calculation option:
In the previous version had the option to consider a deco gas i the calculation or not. Reason for this was to have the automatic gas suggestion available while the deco calculation is still based on the current gas.
This might cause a critical situation in case the diver is not sure if the option is active or not => In the new version the TTS / deco is always calculated considering all deco gases.
author | Ideenmodellierer |
---|---|
date | Sun, 26 Jan 2025 19:31:38 +0100 (2 weeks ago) |
parents | 12426391edd9 |
children | 53900dfe335b |
files | Common/Inc/settings.h Discovery/Src/buehlmann.c Discovery/Src/settings.c Discovery/Src/simulation.c Discovery/Src/tMenuEditGasOC.c Discovery/Src/tMenuEditPlanner.c Discovery/Src/vpm.c |
diffstat | 7 files changed, 55 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/Common/Inc/settings.h Sun Jan 19 21:03:42 2025 +0100 +++ b/Common/Inc/settings.h Sun Jan 26 19:31:38 2025 +0100 @@ -120,7 +120,9 @@ uint8_t deco:1; uint8_t travel:1; uint8_t off:1; +#ifdef ENABLE_DECOCALC_OPTION uint8_t decocalc:1; +#endif uint8_t spare:2; } gasubit8_t;
--- a/Discovery/Src/buehlmann.c Sun Jan 19 21:03:42 2025 +0100 +++ b/Discovery/Src/buehlmann.c Sun Jan 26 19:31:38 2025 +0100 @@ -259,7 +259,10 @@ for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) - || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) +#ifdef ENABLE_DECOCALC_OPTION + || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0) +#endif + ) { break; } @@ -462,7 +465,10 @@ for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) - || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) +#ifdef ENABLE_DECOCALC_OPTION + || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0) +#endif + ) { break; } @@ -480,7 +486,10 @@ for(i = gGas_id + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) - || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) +#ifdef ENABLE_DECOCALC_OPTION + || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0) +#endif + ) { break; }
--- a/Discovery/Src/settings.c Sun Jan 19 21:03:42 2025 +0100 +++ b/Discovery/Src/settings.c Sun Jan 26 19:31:38 2025 +0100 @@ -587,7 +587,9 @@ pSettings->cv_config_BigScreen &= ~0x00000007; /* just to be sure: clear lower three bits */ pSettings->cv_config_BigScreen |= tmp; // no break; - case 0xFFFF0028: /* In previous version deco gases were automatically used for deco calculation */ + case 0xFFFF0028: +#ifdef ENABLE_DECOCALC_OPTION + /* In previous version deco gases were automatically used for deco calculation */ for(tmp=1; tmp<=2*NUM_GASES; tmp++) /* This is now handled by an additional parameter. Set it to true to maintain same behavior as before */ { if(Settings.gas[tmp].note.ub.deco) @@ -599,6 +601,7 @@ Settings.gas[tmp].note.ub.decocalc = 0; } } +#endif // no break; case 0xFFFF0029: Settings.cvAutofocus = 0;
--- a/Discovery/Src/simulation.c Sun Jan 19 21:03:42 2025 +0100 +++ b/Discovery/Src/simulation.c Sun Jan 26 19:31:38 2025 +0100 @@ -502,6 +502,7 @@ SDiveState * pDiveState = &stateSim; copyDiveSettingsToSim(); +#ifdef ENABLE_DECOCALC_OPTION /* activate deco calculation for all deco gases */ for(index = 0; index < 1 + (2*NUM_GASES); index++) { @@ -510,6 +511,7 @@ pDiveState->diveSettings.gas[index].note.ub.decocalc = 1; } } +#endif vpm_init(&pDiveState->vpm, pDiveState->diveSettings.vpm_conservatism, 0, 0); //buehlmann_init(); @@ -566,7 +568,10 @@ for(int i=1; i<=5;i++) { if((pDiveState->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) - || (pDiveState->diveSettings.gas[pDiveState->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) +#ifdef ENABLE_DECOCALC_OPTION + || (pDiveState->diveSettings.gas[pDiveState->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0) +#endif + ) break; gasChangeListDepthGas20x2[ptrGasChangeList++] = pDiveState->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero; gasChangeListDepthGas20x2[ptrGasChangeList++] = pDiveState->diveSettings.decogaslist[i].GasIdInSettings;
--- a/Discovery/Src/tMenuEditGasOC.c Sun Jan 19 21:03:42 2025 +0100 +++ b/Discovery/Src/tMenuEditGasOC.c Sun Jan 26 19:31:38 2025 +0100 @@ -66,7 +66,9 @@ uint8_t OnAction_GasType (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_ChangeDepth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_SetToMOD (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +#ifdef ENABLE_DECOCALC_OPTION uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +#endif uint8_t OnAction_BottleSize (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_First (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); @@ -383,7 +385,11 @@ /* surface mode */ void openEdit_Gas(uint8_t line, uint8_t ccr) { - uint8_t gasID, oxygen, helium, depthDeco, active, first, depthMOD, deco, travel, inactive, off, decocalc;//, bottleSizeLiter; + uint8_t gasID, oxygen, helium, depthDeco, active, first, depthMOD, deco, travel, inactive, off ;//, bottleSizeLiter; + +#ifdef ENABLE_DECOCALC_OPTION + uint8_t decocalc; +#endif char text[32]; char textMOD[32]; @@ -422,7 +428,9 @@ deco = editGasPage.pGasLine[gasID].note.ub.deco; travel = editGasPage.pGasLine[gasID].note.ub.travel; off = editGasPage.pGasLine[gasID].note.ub.off; +#ifdef ENABLE_DECOCALC_OPTION decocalc = editGasPage.pGasLine[gasID].note.ub.decocalc; +#endif //bottleSizeLiter = editGasPage.pGasLine[gasID].bottle_size_liter; if(active) @@ -508,7 +516,7 @@ text[txtptr++] = TXT2BYTE_SetToMOD; text[txtptr++] = 0; write_field_button(StMOG_SetToMOD, 20, 710, ME_Y_LINE4, &FontT48,text); - +#ifdef ENABLE_DECOCALC_OPTION if(deco) { txtptr = 0; @@ -518,6 +526,7 @@ write_field_on_off(StMOG_CalcDeco, 20, 710, ME_Y_LINE5, &FontT48, text, decocalc); } +#endif } else { @@ -569,10 +578,12 @@ setEvent(StMOG_ChangeDepth, (uint32_t)OnAction_ChangeDepth); setEvent(StMOG_SetToMOD, (uint32_t)OnAction_SetToMOD); } +#ifdef ENABLE_DECOCALC_OPTION if(deco) { setEvent(StMOG_CalcDeco, (uint32_t)OnAction_CalcDeco); } +#endif /* setEvent(StMOG_Bottle, (uint32_t)OnAction_BottleSize); */ @@ -1124,7 +1135,7 @@ return UPDATE_DIVESETTINGS; } - +#ifdef ENABLE_DECOCALC_OPTION uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { if(editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc) @@ -1139,7 +1150,7 @@ return UPDATE_DIVESETTINGS; } - +#endif uint8_t OnAction_ChangeDepth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { uint8_t digitContentNew;
--- a/Discovery/Src/tMenuEditPlanner.c Sun Jan 19 21:03:42 2025 +0100 +++ b/Discovery/Src/tMenuEditPlanner.c Sun Jan 26 19:31:38 2025 +0100 @@ -451,7 +451,10 @@ for(int i = 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { if((stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) - || (stateSimGetPointer()->diveSettings.gas[stateSimGetPointer()->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) +#ifdef ENABLE_DECOCALC_OPTION + || (stateSimGetPointer()->diveSettings.gas[stateSimGetPointer()->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0) +#endif + ) break; depthChange = stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero; if(depthPrev <= depthChange) @@ -467,7 +470,10 @@ for(int i = GasIdPrev + 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { if((stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) - || (stateSimGetPointer()->diveSettings.gas[stateSimGetPointer()->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) +#ifdef ENABLE_DECOCALC_OPTION + || (stateSimGetPointer()->diveSettings.gas[stateSimGetPointer()->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0) +#endif + ) break; depthChange = stateSimGetPointer()->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero; if((depthChange < depthPrev) && (depthChange >= depthNext))
--- a/Discovery/Src/vpm.c Sun Jan 19 21:03:42 2025 +0100 +++ b/Discovery/Src/vpm.c Sun Jan 26 19:31:38 2025 +0100 @@ -543,11 +543,17 @@ for (i = 1; i < BUEHLMANN_STRUCT_MAX_GASES; i++) { if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero >= depth_change[0] + 1) - && (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc)) +#ifdef ENABLE_DECOCALC_OPTION + && (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc) +#endif + ) continue; if((pDiveSettings->decogaslist[i].change_during_ascent_depth_meter_otherwise_zero <= 0) - || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) +#ifdef ENABLE_DECOCALC_OPTION + || (pDiveSettings->gas[pDiveSettings->decogaslist[i].GasIdInSettings].note.ub.decocalc == 0) +#endif + ) break; j++;