Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditGasOC.c @ 982:22d5b477c903 GasConsumption
Code cleanup: Remove disabled option to switch deco calc on/off
| author | Ideenmodellierer |
|---|---|
| date | Sun, 02 Mar 2025 21:42:45 +0100 |
| parents | 79b522fbabe6 |
| children |
comparison
equal
deleted
inserted
replaced
| 981:c6c781a2e85b | 982:22d5b477c903 |
|---|---|
| 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 | |
| 70 uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | |
| 71 #endif | |
| 72 uint8_t OnAction_BottleSize (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 69 uint8_t OnAction_BottleSize (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 73 | 70 |
| 74 uint8_t OnAction_First (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); | 71 uint8_t OnAction_First (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); | 72 uint8_t OnAction_Deco (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); | 73 uint8_t OnAction_Travel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); |
| 385 /* surface mode */ | 382 /* surface mode */ |
| 386 void openEdit_Gas(uint8_t line, uint8_t ccr) | 383 void openEdit_Gas(uint8_t line, uint8_t ccr) |
| 387 { | 384 { |
| 388 uint8_t gasID, oxygen, helium, depthDeco, active, first, depthMOD, deco, travel, inactive, off ;//, bottleSizeLiter; | 385 uint8_t gasID, oxygen, helium, depthDeco, active, first, depthMOD, deco, travel, inactive, off ;//, bottleSizeLiter; |
| 389 | 386 |
| 390 #ifdef ENABLE_DECOCALC_OPTION | |
| 391 uint8_t decocalc; | |
| 392 #endif | |
| 393 | |
| 394 char text[32]; | 387 char text[32]; |
| 395 char textMOD[32]; | 388 char textMOD[32]; |
| 396 uint8_t txtptr; | 389 uint8_t txtptr; |
| 397 | 390 |
| 398 if(line) | 391 if(line) |
| 426 active = editGasPage.pGasLine[gasID].note.ub.active; | 419 active = editGasPage.pGasLine[gasID].note.ub.active; |
| 427 first = editGasPage.pGasLine[gasID].note.ub.first; | 420 first = editGasPage.pGasLine[gasID].note.ub.first; |
| 428 deco = editGasPage.pGasLine[gasID].note.ub.deco; | 421 deco = editGasPage.pGasLine[gasID].note.ub.deco; |
| 429 travel = editGasPage.pGasLine[gasID].note.ub.travel; | 422 travel = editGasPage.pGasLine[gasID].note.ub.travel; |
| 430 off = editGasPage.pGasLine[gasID].note.ub.off; | 423 off = editGasPage.pGasLine[gasID].note.ub.off; |
| 431 #ifdef ENABLE_DECOCALC_OPTION | 424 |
| 432 decocalc = editGasPage.pGasLine[gasID].note.ub.decocalc; | |
| 433 #endif | |
| 434 //bottleSizeLiter = editGasPage.pGasLine[gasID].bottle_size_liter; | 425 //bottleSizeLiter = editGasPage.pGasLine[gasID].bottle_size_liter; |
| 435 | 426 |
| 436 if(active) | 427 if(active) |
| 437 inactive = 0; | 428 inactive = 0; |
| 438 else | 429 else |
| 514 txtptr = 0; | 505 txtptr = 0; |
| 515 text[txtptr++] = TXT_2BYTE; | 506 text[txtptr++] = TXT_2BYTE; |
| 516 text[txtptr++] = TXT2BYTE_SetToMOD; | 507 text[txtptr++] = TXT2BYTE_SetToMOD; |
| 517 text[txtptr++] = 0; | 508 text[txtptr++] = 0; |
| 518 write_field_button(StMOG_SetToMOD, 20, 710, ME_Y_LINE4, &FontT48,text); | 509 write_field_button(StMOG_SetToMOD, 20, 710, ME_Y_LINE4, &FontT48,text); |
| 519 #ifdef ENABLE_DECOCALC_OPTION | |
| 520 if(deco) | |
| 521 { | |
| 522 txtptr = 0; | |
| 523 text[txtptr++] = TXT_2BYTE; | |
| 524 text[txtptr++] = TXT2BYTE_CalculateDeco; | |
| 525 text[txtptr++] = 0; | |
| 526 | |
| 527 write_field_on_off(StMOG_CalcDeco, 20, 710, ME_Y_LINE5, &FontT48, text, decocalc); | |
| 528 } | |
| 529 #endif | |
| 530 } | 510 } |
| 531 else | 511 else |
| 532 { | 512 { |
| 533 txtptr = 0; | 513 txtptr = 0; |
| 534 text[txtptr++] = '\031'; | 514 text[txtptr++] = '\031'; |
| 576 if((deco) || (travel && ccr)) | 556 if((deco) || (travel && ccr)) |
| 577 { | 557 { |
| 578 setEvent(StMOG_ChangeDepth, (uint32_t)OnAction_ChangeDepth); | 558 setEvent(StMOG_ChangeDepth, (uint32_t)OnAction_ChangeDepth); |
| 579 setEvent(StMOG_SetToMOD, (uint32_t)OnAction_SetToMOD); | 559 setEvent(StMOG_SetToMOD, (uint32_t)OnAction_SetToMOD); |
| 580 } | 560 } |
| 581 #ifdef ENABLE_DECOCALC_OPTION | |
| 582 if(deco) | |
| 583 { | |
| 584 setEvent(StMOG_CalcDeco, (uint32_t)OnAction_CalcDeco); | |
| 585 } | |
| 586 #endif | |
| 587 /* | 561 /* |
| 588 setEvent(StMOG_Bottle, (uint32_t)OnAction_BottleSize); | 562 setEvent(StMOG_Bottle, (uint32_t)OnAction_BottleSize); |
| 589 */ | 563 */ |
| 590 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | 564 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
| 591 } | 565 } |
| 1133 } | 1107 } |
| 1134 tMenuEdit_newInput(StMOG_ChangeDepth, unit_depth_integer(newChangeDepth), 0, 0, 0); | 1108 tMenuEdit_newInput(StMOG_ChangeDepth, unit_depth_integer(newChangeDepth), 0, 0, 0); |
| 1135 | 1109 |
| 1136 return UPDATE_DIVESETTINGS; | 1110 return UPDATE_DIVESETTINGS; |
| 1137 } | 1111 } |
| 1138 #ifdef ENABLE_DECOCALC_OPTION | 1112 |
| 1139 uint8_t OnAction_CalcDeco (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | |
| 1140 { | |
| 1141 if(editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc) | |
| 1142 { | |
| 1143 editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc = 0; | |
| 1144 } | |
| 1145 else | |
| 1146 { | |
| 1147 editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc = 1; | |
| 1148 } | |
| 1149 tMenuEdit_set_on_off(editId, editGasPage.pGasLine[editGasPage.gasID].note.ub.decocalc); | |
| 1150 | |
| 1151 return UPDATE_DIVESETTINGS; | |
| 1152 } | |
| 1153 #endif | |
| 1154 uint8_t OnAction_ChangeDepth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | 1113 uint8_t OnAction_ChangeDepth(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
| 1155 { | 1114 { |
| 1156 uint8_t digitContentNew; | 1115 uint8_t digitContentNew; |
| 1157 uint32_t newDepth; | 1116 uint32_t newDepth; |
| 1158 | 1117 |
