comparison Discovery/Src/tMenuEdit.c @ 584:830de438e0b0

Added option for 100% o2 calibration: For the implementation of the selection of the calib gas the reactivation of the menu elemen "FIELD_TOGGLE" was necessary. Within the calibration menu item it is now possible to select between air and 100% o2 calibration. The calibration itself no consideres the ambient pressure during calculation of the coeff.
author Ideenmodellierer
date Sat, 12 Dec 2020 21:05:11 +0100
parents ec76fa85009e
children fb5bb04ad914
comparison
equal deleted inserted replaced
583:3860b8fa4b29 584:830de438e0b0
204 204
205 205
206 switch(globState) 206 switch(globState)
207 { 207 {
208 case (StMHARD3_O2_Sensor1 & MaskFieldDigit): 208 case (StMHARD3_O2_Sensor1 & MaskFieldDigit):
209 case (StMHARD3_O2_Calibrate):
209 case (StMHARD3_O2_Source): refreshFct = refresh_O2Sensors; 210 case (StMHARD3_O2_Source): refreshFct = refresh_O2Sensors;
210 break; 211 break;
211 case (StMHARD2_Compass_SetCourse & MaskFieldDigit): refreshFct = refresh_CompassEdit; 212 case (StMHARD2_Compass_SetCourse & MaskFieldDigit): refreshFct = refresh_CompassEdit;
212 break; 213 break;
213 case (StMXTRA_CompassHeading & MaskFieldDigit): refreshFct = refresh_CompassHeading; 214 case (StMXTRA_CompassHeading & MaskFieldDigit): refreshFct = refresh_CompassHeading;
432 } 433 }
433 else 434 else
434 if(ident[id].maintype == FIELD_NUMBERS) 435 if(ident[id].maintype == FIELD_NUMBERS)
435 content = ident[id].newText[ident[id].begin[block] + subBlockPosition]; 436 content = ident[id].newText[ident[id].begin[block] + subBlockPosition];
436 else 437 else
437 if(ident[id].maintype == FIELD_ON_OFF) 438 if((ident[id].maintype == FIELD_ON_OFF) || (ident[id].maintype == FIELD_TOGGLE))
438 content = ident[id].input[block]; 439 content = ident[id].input[block];
439 else 440 else
440 content = 0; /* just a default for protection */ 441 content = 0; /* just a default for protection */
441 442
442 return onActionFunc(ident[id].callerID, block, subBlockPosition, content, action); 443 return onActionFunc(ident[id].callerID, block, subBlockPosition, content, action);
543 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuEditCursor); 544 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuEditCursor);
544 // old stuff? hw 150916, reactivated 150923, this shows which digit will be changed now as it marks the other grey/black 545 // old stuff? hw 150916, reactivated 150923, this shows which digit will be changed now as it marks the other grey/black
545 // now fixed for button settings with newContent <= '0'+99 condition 546 // now fixed for button settings with newContent <= '0'+99 condition
546 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldSelected); 547 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldSelected);
547 } 548 }
549 if(ident[id].maintype == FIELD_TOGGLE)
550 {
551 change_CLUT_entry(CLUT_MenuEditLineSelected, CLUT_MenuEditCursor);
552 }
553
548 554
549 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_ENTER); 555 newContent = get_newContent_of_actual_id_block_and_subBlock(ACTION_BUTTON_ENTER);
550 556
551 if (((newContent == UPDATE_DIVESETTINGS) || (newContent == UPDATE_AND_EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_MENU)) && (actual_menu_content == MENU_SURFACE)) 557 if (((newContent == UPDATE_DIVESETTINGS) || (newContent == UPDATE_AND_EXIT_TO_HOME) || (newContent == UPDATE_AND_EXIT_TO_MENU)) && (actual_menu_content == MENU_SURFACE))
552 createDiveSettings(); 558 createDiveSettings();
1411 if(!tME_stop) 1417 if(!tME_stop)
1412 idLast = id; 1418 idLast = id;
1413 id++; 1419 id++;
1414 } 1420 }
1415 } 1421 }
1422 void write_field_toggle(uint32_t editID, uint16_t XleftGimpStyle, uint16_t XrightGimpStyle, uint16_t YtopGimpStyle, const tFont *Font, const char *text, uint8_t int1, uint8_t int2)
1423 {
1424 if(id >= 9) return;
1425 ident[id].maintype = FIELD_TOGGLE;
1426 ident[id].subtype = FIELD_TOGGLE;
1427 ident[id].coord[0] = XleftGimpStyle;
1428 ident[id].coord[1] = XrightGimpStyle;
1429 ident[id].coord[2] = YtopGimpStyle;
1430 ident[id].fontUsed = (tFont *)Font;
1431 ident[id].callerID = editID;
1432 strncpy(ident[id].orgText, text, 32);
1433 strncpy(ident[id].newText, text, 32);
1434 ident[id].orgText[31] = 0;
1435 ident[id].newText[31] = 0;
1436
1437 change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1);
1438
1439 if(editID == 0) write_content_without_Id();
1440 else
1441 {
1442 write_content_of_actual_Id();
1443 if(!tME_stop) idLast = id;
1444 id++;
1445 }
1446 }
1447
1416 1448
1417 1449
1418 /* was build for field_on_off 1450 /* was build for field_on_off
1419 * to be tested for other purposes first 1451 * to be tested for other purposes first
1420 */ 1452 */