comparison Discovery/Src/t3.c @ 529:0e1db77b2aca

Added skip condition in custom view selection: Decoplan may be selected even nothing was shown due to certain display conditions. These conditions have now been added to selection function to show deco plan only if data is available for visualization.
author Ideenmodellierer
date Tue, 15 Sep 2020 20:52:39 +0200
parents 962d7b2c18c6
children d784f281833a
comparison
equal deleted inserted replaced
528:a9c195be907e 529:0e1db77b2aca
50 GFX_DrawCfgWindow t3l1; 50 GFX_DrawCfgWindow t3l1;
51 GFX_DrawCfgWindow t3r1; 51 GFX_DrawCfgWindow t3r1;
52 GFX_DrawCfgWindow t3c1; 52 GFX_DrawCfgWindow t3c1;
53 GFX_DrawCfgWindow t3c2; 53 GFX_DrawCfgWindow t3c2;
54 54
55 uint8_t t3_selection_customview = 0; 55 uint8_t t3_selection_customview = CVIEW_noneOrDebug;
56 56
57 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/ 57 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/
58 58
59 /* Private types -------------------------------------------------------------*/ 59 /* Private types -------------------------------------------------------------*/
60 #define TEXTSIZE 16 60 #define TEXTSIZE 16
549 549
550 550
551 551
552 void t3_refresh_customview(float depth) 552 void t3_refresh_customview(float depth)
553 { 553 {
554 #if 0
555 if((t3_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
556 t3_change_customview();
557 #endif
558 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, stateUsedWrite->diveSettings.diveMode); 554 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, stateUsedWrite->diveSettings.diveMode);
559 } 555 }
560 556
561 557
562 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode) 558 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode)
853 case 2: lineNumber = 0; 849 case 2: lineNumber = 0;
854 case 3: text[textpointer++] = '\002'; /* display right aligned */ 850 case 3: text[textpointer++] = '\002'; /* display right aligned */
855 default: 851 default:
856 break; 852 break;
857 } 853 }
858 #if 0
859 if(gasPosIdx < 3)
860 {
861 lineNumber = 1;
862 }
863 else
864 {
865 lineNumber = 0;
866 }
867 #endif
868 gasPosIdx++; 854 gasPosIdx++;
869 855
870 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100; 856 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100;
871 if(pGasLine[gasId].note.ub.active == 0) 857 if(pGasLine[gasId].note.ub.active == 0)
872 strcpy(&text[textpointer++],"\031"); 858 strcpy(&text[textpointer++],"\031");
1454 1440
1455 if(t3_customview_disabled(tX_customviews[index])) 1441 if(t3_customview_disabled(tX_customviews[index]))
1456 { 1442 {
1457 iterate = 1; 1443 iterate = 1;
1458 } 1444 }
1459 if((tX_customviews[index] == CVIEW_T3_TTS) && !pDecoinfo->output_time_to_surface_seconds) 1445 if((tX_customviews[index] == CVIEW_T3_TTS) && !pDecoinfo->output_time_to_surface_seconds) /* Skip TTS if value is 0 */
1460 { 1446 {
1461 iterate = 1; 1447 iterate = 1;
1448 }
1449 if((tX_customviews[index] == CVIEW_T3_Decostop) && ((!pDecoinfo->output_ndl_seconds) && (!pDecoinfo->output_time_to_surface_seconds) && (timer_Safetystop_GetCountDown() == 0))) /* Skip Deco if NDL is not set */
1450 {
1451 iterate = 1;
1462 } 1452 }
1463 if((iterate) && (action == ACTION_END)) 1453 if((iterate) && (action == ACTION_END))
1464 { 1454 {
1465 action = ACTION_BUTTON_ENTER; 1455 action = ACTION_BUTTON_ENTER;
1466 } 1456 }