comparison Discovery/Src/tMenuGas.c @ 647:15f6f0b5786c

Integrated selection of bailout in the diluent selection page: To be able to introduce a new menu page for future development, the selection of bailout cases is now combined with the selection of the diluent at one page. To enable this the concept of a "shadow page" has been introduced. With that the original functionality may be reused without need to a a standalone page. The bailout /diluen page is now switched (surface mode) using the last menu line of the gas selection page
author Ideenmodellierer
date Tue, 13 Apr 2021 19:25:41 +0200
parents a9c195be907e
children 1b995079c045
comparison
equal deleted inserted replaced
646:0fc1b47d2482 647:15f6f0b5786c
35 #include "configuration.h" 35 #include "configuration.h"
36 36
37 #define OCGAS_STANDARD (0) 37 #define OCGAS_STANDARD (0)
38 #define OCGAS_BAILOUT_INACTIVE (1) 38 #define OCGAS_BAILOUT_INACTIVE (1)
39 #define OCGAS_BAILOUT_ACTIVE (2) 39 #define OCGAS_BAILOUT_ACTIVE (2)
40 #define CCGAS_STANDARD (0) 40 #define CCGAS_STANDARD (3)
41 41
42 /* Private function prototypes -----------------------------------------------*/ 42 /* Private function prototypes -----------------------------------------------*/
43 uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); 43 uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
44 void tMG_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext, uint8_t start, uint8_t gasMode); 44 void tMG_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext, uint8_t start, uint8_t gasMode);
45 45
311 } 311 }
312 } 312 }
313 } 313 }
314 314
315 /* special gas number #6 in dive mode*/ 315 /* special gas number #6 in dive mode*/
316 if(((line == 0) || (line == 6)) && (actual_menu_content != MENU_SURFACE)) 316 if(((line == 0) || (line == 6)))
317 { 317 {
318 text[textPointer++] = '\020'; 318 if(actual_menu_content != MENU_SURFACE)
319 text[textPointer++] = TXT_2BYTE; 319 {
320 if(start == NUM_OFFSET_DILUENT) 320 text[textPointer++] = '\020';
321 text[textPointer++] = TXT2BYTE_SpecialDiveGasMenuCCR; 321 text[textPointer++] = TXT_2BYTE;
322 else 322 if(start == NUM_OFFSET_DILUENT)
323 text[textPointer++] = TXT2BYTE_SpecialDiveGasMenu; 323 text[textPointer++] = TXT2BYTE_SpecialDiveGasMenuCCR;
324 text[textPointer++] = '\n'; 324 else
325 text[textPointer++] = '\r'; 325 text[textPointer++] = TXT2BYTE_SpecialDiveGasMenu;
326 text[textPointer++] = 0; 326 text[textPointer++] = '\n';
327 text[textPointer++] = '\r';
328 text[textPointer++] = 0;
329 }
330 else /* switch to bailout selection in surface mode */
331 if((settingsGetPointer()->dive_mode == DIVEMODE_CCR) || (stateUsed->diveSettings.ccrOption == 1))
332 {
333 text[textPointer++] = '\024';
334 if(gasMode == CCGAS_STANDARD)
335 {
336 textPointer += snprintf(&text[textPointer], 14,"Bailout\n");
337 }
338 else
339 {
340 textPointer += snprintf(&text[textPointer], 14,"Diluent\n");
341 }
342 }
327 } 343 }
328 } 344 }
329 345
330 346
331 /* Private functions ---------------------------------------------------------*/ 347 /* Private functions ---------------------------------------------------------*/