comparison Discovery/Src/t7.c @ 758:b6d8a6fbf4fd

- Colours for scrubber display when time remaining falls below a threshold value - Display negative values when time is up and diving continues; - count down remaining scrubber time only when the dive computer is not set to bailout - after all, there is not much point in counting down time if the diver is not breathing through the scrubber.
author heinrichsweikamp
date Wed, 15 Mar 2023 09:18:07 +0100
parents 6de83d8205a0
children 9825dcf50675
comparison
equal deleted inserted replaced
757:39ff186b6f98 758:b6d8a6fbf4fd
2917 break; 2917 break;
2918 2918
2919 case LLC_ScrubberTime: 2919 case LLC_ScrubberTime:
2920 tinyHeaderFont = 1; 2920 tinyHeaderFont = 1;
2921 headerText[2] = TXT_ScrubTime; 2921 headerText[2] = TXT_ScrubTime;
2922 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES) 2922
2923 { 2923 printScrubberText(text, TEXTSIZE, pSettings);
2924 snprintf(text,TEXTSIZE,"\020%3u'",pSettings->scrubberData[pSettings->scubberActiveId].TimerCur); 2924
2925 }
2926 else
2927 {
2928 snprintf(text,TEXTSIZE,"\020%u\016\016%%\017", (pSettings->scrubberData[pSettings->scubberActiveId].TimerCur * 100 / settingsGetPointer()->scrubberData[pSettings->scubberActiveId].TimerMax));
2929 }
2930 break; 2925 break;
2931 #ifdef ENABLE_PSCR_MODE 2926 #ifdef ENABLE_PSCR_MODE
2932 case LCC_SimPpo2: 2927 case LCC_SimPpo2:
2933 headerText[2] = TXT_SimPpo2; 2928 headerText[2] = TXT_SimPpo2;
2934 snprintf(text,TEXTSIZE,"\020%.2f\016\016Bar\017",stateUsed->lifeData.ppo2Simulated_bar); 2929 snprintf(text,TEXTSIZE,"\020%.2f\016\016Bar\017",stateUsed->lifeData.ppo2Simulated_bar);
3674 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (isLoopMode(pSettings->dive_mode))) 3669 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (isLoopMode(pSettings->dive_mode)))
3675 { 3670 {
3676 text[textpointer++] = '\n'; 3671 text[textpointer++] = '\n';
3677 text[textpointer++] = '\r'; 3672 text[textpointer++] = '\r';
3678 text[textpointer++] = '\t'; 3673 text[textpointer++] = '\t';
3679 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES) 3674
3680 { 3675 textpointer += printScrubberText(&text[textpointer], 10, pSettings);
3681 textpointer += snprintf(&text[textpointer],10,"\020%3u'", pSettings->scrubberData[pSettings->scubberActiveId].TimerCur);
3682 }
3683 else
3684 {
3685 textpointer += snprintf(&text[textpointer],10,"\020%u\016\016%%\017", (pSettings->scrubberData[pSettings->scubberActiveId].TimerCur * 100 / pSettings->scrubberData[pSettings->scubberActiveId].TimerMax));
3686 }
3687 } 3676 }
3688 text[textpointer++] = 0; 3677 text[textpointer++] = 0;
3689 t7_colorscheme_mod(text); 3678 t7_colorscheme_mod(text);
3690 GFX_write_string(&FontT42, &t7cY0free, text, 1); 3679 GFX_write_string(&FontT42, &t7cY0free, text, 1);
3691 } 3680 }