Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditGasOC.c @ 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 |
| parents | b7d93ff6b3b2 |
| children | 22d5b477c903 |
comparison
equal
deleted
inserted
replaced
| 972:12426391edd9 | 973:79b522fbabe6 |
|---|---|
| 64 /* Announced function prototypes -----------------------------------------------*/ | 64 /* Announced function prototypes -----------------------------------------------*/ |
| 65 uint8_t OnAction_Mix (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 65 uint8_t OnAction_Mix (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 66 uint8_t OnAction_GasType (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 66 uint8_t OnAction_GasType (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 67 uint8_t OnAction_ChangeDepth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 67 uint8_t OnAction_ChangeDepth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 68 uint8_t OnAction_SetToMOD (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 68 uint8_t OnAction_SetToMOD (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 69 #ifdef ENABLE_DECOCALC_OPTION | |
| 69 uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 70 uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 71 #endif | |
| 70 uint8_t OnAction_BottleSize (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 72 uint8_t OnAction_BottleSize (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 71 | 73 |
| 72 uint8_t OnAction_First (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 74 uint8_t OnAction_First (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 73 uint8_t OnAction_Deco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 75 uint8_t OnAction_Deco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 74 uint8_t OnAction_Travel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 76 uint8_t OnAction_Travel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 381 | 383 |
| 382 | 384 |
| 383 /* surface mode */ | 385 /* surface mode */ |
| 384 void openEdit_Gas(uint8_t line, uint8_t ccr) | 386 void openEdit_Gas(uint8_t line, uint8_t ccr) |
| 385 { | 387 { |
| 386 uint8_t gasID, oxygen, helium, depthDeco, active, first, depthMOD, deco, travel, inactive, off, decocalc;//, bottleSizeLiter; | 388 uint8_t gasID, oxygen, helium, depthDeco, active, first, depthMOD, deco, travel, inactive, off ;//, bottleSizeLiter; |
| 389 | |
| 390 #ifdef ENABLE_DECOCALC_OPTION | |
| 391 uint8_t decocalc; | |
| 392 #endif | |
| 387 | 393 |
| 388 char text[32]; | 394 char text[32]; |
| 389 char textMOD[32]; | 395 char textMOD[32]; |
| 390 uint8_t txtptr; | 396 uint8_t txtptr; |
| 391 | 397 |
| 420 active = editGasPage.pGasLine[gasID].note.ub.active; | 426 active = editGasPage.pGasLine[gasID].note.ub.active; |
| 421 first = editGasPage.pGasLine[gasID].note.ub.first; | 427 first = editGasPage.pGasLine[gasID].note.ub.first; |
| 422 deco = editGasPage.pGasLine[gasID].note.ub.deco; | 428 deco = editGasPage.pGasLine[gasID].note.ub.deco; |
| 423 travel = editGasPage.pGasLine[gasID].note.ub.travel; | 429 travel = editGasPage.pGasLine[gasID].note.ub.travel; |
| 424 off = editGasPage.pGasLine[gasID].note.ub.off; | 430 off = editGasPage.pGasLine[gasID].note.ub.off; |
| 431 #ifdef ENABLE_DECOCALC_OPTION | |
| 425 decocalc = editGasPage.pGasLine[gasID].note.ub.decocalc; | 432 decocalc = editGasPage.pGasLine[gasID].note.ub.decocalc; |
| 433 #endif | |
| 426 //bottleSizeLiter = editGasPage.pGasLine[gasID].bottle_size_liter; | 434 //bottleSizeLiter = editGasPage.pGasLine[gasID].bottle_size_liter; |
| 427 | 435 |
| 428 if(active) | 436 if(active) |
| 429 inactive = 0; | 437 inactive = 0; |
| 430 else | 438 else |
| 506 txtptr = 0; | 514 txtptr = 0; |
| 507 text[txtptr++] = TXT_2BYTE; | 515 text[txtptr++] = TXT_2BYTE; |
| 508 text[txtptr++] = TXT2BYTE_SetToMOD; | 516 text[txtptr++] = TXT2BYTE_SetToMOD; |
| 509 text[txtptr++] = 0; | 517 text[txtptr++] = 0; |
| 510 write_field_button(StMOG_SetToMOD, 20, 710, ME_Y_LINE4, &FontT48,text); | 518 write_field_button(StMOG_SetToMOD, 20, 710, ME_Y_LINE4, &FontT48,text); |
| 511 | 519 #ifdef ENABLE_DECOCALC_OPTION |
| 512 if(deco) | 520 if(deco) |
| 513 { | 521 { |
| 514 txtptr = 0; | 522 txtptr = 0; |
| 515 text[txtptr++] = TXT_2BYTE; | 523 text[txtptr++] = TXT_2BYTE; |
| 516 text[txtptr++] = TXT2BYTE_CalculateDeco; | 524 text[txtptr++] = TXT2BYTE_CalculateDeco; |
| 517 text[txtptr++] = 0; | 525 text[txtptr++] = 0; |
| 518 | 526 |
| 519 write_field_on_off(StMOG_CalcDeco, 20, 710, ME_Y_LINE5, &FontT48, text, decocalc); | 527 write_field_on_off(StMOG_CalcDeco, 20, 710, ME_Y_LINE5, &FontT48, text, decocalc); |
| 520 } | 528 } |
| 529 #endif | |
| 521 } | 530 } |
| 522 else | 531 else |
| 523 { | 532 { |
| 524 txtptr = 0; | 533 txtptr = 0; |
| 525 text[txtptr++] = '\031'; | 534 text[txtptr++] = '\031'; |
| 567 if((deco) || (travel && ccr)) | 576 if((deco) || (travel && ccr)) |
| 568 { | 577 { |
| 569 setEvent(StMOG_ChangeDepth, (uint32_t)OnAction_ChangeDepth); | 578 setEvent(StMOG_ChangeDepth, (uint32_t)OnAction_ChangeDepth); |
| 570 setEvent(StMOG_SetToMOD, (uint32_t)OnAction_SetToMOD); | 579 setEvent(StMOG_SetToMOD, (uint32_t)OnAction_SetToMOD); |
| 571 } | 580 } |
| 581 #ifdef ENABLE_DECOCALC_OPTION | |
| 572 if(deco) | 582 if(deco) |
| 573 { | 583 { |
| 574 setEvent(StMOG_CalcDeco, (uint32_t)OnAction_CalcDeco); | 584 setEvent(StMOG_CalcDeco, (uint32_t)OnAction_CalcDeco); |
| 575 } | 585 } |
| 586 #endif | |
| 576 /* | 587 /* |
| 577 setEvent(StMOG_Bottle, (uint32_t)OnAction_BottleSize); | 588 setEvent(StMOG_Bottle, (uint32_t)OnAction_BottleSize); |
| 578 */ | 589 */ |
| 579 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | 590 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
| 580 } | 591 } |
| 1122 } | 1133 } |
| 1123 tMenuEdit_newInput(StMOG_ChangeDepth, unit_depth_integer(newChangeDepth), 0, 0, 0); | 1134 tMenuEdit_newInput(StMOG_ChangeDepth, unit_depth_integer(newChangeDepth), 0, 0, 0); |
| 1124 | 1135 |
| 1125 return UPDATE_DIVESETTINGS; | 1136 return UPDATE_DIVESETTINGS; |
| 1126 } | 1137 } |
| 1127 | 1138 #ifdef ENABLE_DECOCALC_OPTION |
| 1128 uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | 1139 uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 1129 { | 1140 { |
| 1130 if(editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc) | 1141 if(editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc) |
| 1131 { | 1142 { |
| 1132 editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc = 0; | 1143 editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc = 0; |
| 1137 } | 1148 } |
| 1138 tMenuEdit_set_on_off(editId, editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc); | 1149 tMenuEdit_set_on_off(editId, editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc); |
| 1139 | 1150 |
| 1140 return UPDATE_DIVESETTINGS; | 1151 return UPDATE_DIVESETTINGS; |
| 1141 } | 1152 } |
| 1142 | 1153 #endif |
| 1143 uint8_t OnAction_ChangeDepth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | 1154 uint8_t OnAction_ChangeDepth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 1144 { | 1155 { |
| 1145 uint8_t digitContentNew; | 1156 uint8_t digitContentNew; |
| 1146 uint32_t newDepth; | 1157 uint32_t newDepth; |
| 1147 | 1158 |
