Mercurial > public > ostc4
comparison Discovery/Src/t7.c @ 656:3ccf13af4651
Added visualization of scrubber time:
The remaining scrubber timer may be displayed in minutes or percentage of maximum time (both countdown). The value is displayed in the lower left corner, the overview custom view in T7 display as well as in the O2 Monitor view of the T3 display.
author | Ideenmodellierer |
---|---|
date | Sun, 25 Apr 2021 20:47:01 +0200 |
parents | c737cf5d9067 |
children | f4b553da620a |
comparison
equal
deleted
inserted
replaced
655:980b4aa60a0e | 656:3ccf13af4651 |
---|---|
144 static uint8_t selection_custom_field = LLC_Temperature; | 144 static uint8_t selection_custom_field = LLC_Temperature; |
145 | 145 |
146 const uint8_t *customviewsDive = customviewsDiveStandard; | 146 const uint8_t *customviewsDive = customviewsDiveStandard; |
147 const uint8_t *customviewsSurface = customviewsSurfaceStandard; | 147 const uint8_t *customviewsSurface = customviewsSurfaceStandard; |
148 | 148 |
149 #define TEXTSIZE 16 | 149 #define TEXTSIZE 30 |
150 /* offset includes line: 2 = line +1 | 150 /* offset includes line: 2 = line +1 |
151 * box (line) is 300 px | 151 * box (line) is 300 px |
152 * inside is 296 px | 152 * inside is 296 px |
153 * left of box are 249 px ( 0..248) | 153 * left of box are 249 px ( 0..248) |
154 * right of box are 249 px (551 .. 799) | 154 * right of box are 249 px (551 .. 799) |
2410 { | 2410 { |
2411 textPointer = 0; | 2411 textPointer = 0; |
2412 TextR1[textPointer++] = '\a'; | 2412 TextR1[textPointer++] = '\a'; |
2413 TextR1[textPointer++] = '\001'; | 2413 TextR1[textPointer++] = '\001'; |
2414 TextR1[textPointer++] = ' '; | 2414 TextR1[textPointer++] = ' '; |
2415 textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100); | 2415 textPointer += snprintf(&TextR1[textPointer],TEXTSIZE,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100); |
2416 TextR1[textPointer++] = '?'; | 2416 TextR1[textPointer++] = '?'; |
2417 TextR1[textPointer++] = ' '; | 2417 TextR1[textPointer++] = ' '; |
2418 TextR1[textPointer++] = 0; | 2418 TextR1[textPointer++] = 0; |
2419 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | 2419 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); |
2420 } | 2420 } |
2659 | 2659 |
2660 if((stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) && (selection_custom_field == LLC_GF)) /* no GF if in VPM mode */ | 2660 if((stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) && (selection_custom_field == LLC_GF)) /* no GF if in VPM mode */ |
2661 { | 2661 { |
2662 selection_custom_field++; | 2662 selection_custom_field++; |
2663 } | 2663 } |
2664 if((selection_custom_field == LLC_ScrubberTime) && ((settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_OFF) || (settingsGetPointer()->dive_mode != DIVEMODE_CCR))) | |
2665 { | |
2666 selection_custom_field++; | |
2667 } | |
2664 | 2668 |
2665 if(selection_custom_field >= LLC_END) | 2669 if(selection_custom_field >= LLC_END) |
2666 { | 2670 { |
2667 selection_custom_field = LLC_Empty; | 2671 selection_custom_field = LLC_Empty; |
2668 } | 2672 } |
2784 /* actual GF */ | 2788 /* actual GF */ |
2785 case LLC_GF: | 2789 case LLC_GF: |
2786 headerText[2] = TXT_ActualGradient; | 2790 headerText[2] = TXT_ActualGradient; |
2787 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation); | 2791 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",100 * pDecoinfoStandard->super_saturation); |
2788 break; | 2792 break; |
2793 | |
2794 case LLC_ScrubberTime: | |
2795 tinyHeaderFont = 1; | |
2796 headerText[2] = TXT_ScrubTime; | |
2797 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES) | |
2798 { | |
2799 snprintf(text,TEXTSIZE,"\020%3u'",settingsGetPointer()->scrubTimerCur); | |
2800 } | |
2801 else | |
2802 { | |
2803 snprintf(text,TEXTSIZE,"\020%u\016\016%%\017", (settingsGetPointer()->scrubTimerCur * 100 / settingsGetPointer()->scrubTimerMax)); | |
2804 } | |
2805 break; | |
2806 | |
2789 #ifdef ENABLE_BOTTLE_SENSOR | 2807 #ifdef ENABLE_BOTTLE_SENSOR |
2790 case LCC_BottleBar: | 2808 case LCC_BottleBar: |
2791 headerText[2] = TXT_AtemGasVorrat; | 2809 headerText[2] = TXT_AtemGasVorrat; |
2792 tinyHeaderFont = 1; | 2810 tinyHeaderFont = 1; |
2793 snprintf(text,TEXTSIZE,"%d\016\016\017", stateUsed->lifeData.bottle_bar[stateUsed->lifeData.actualGas.GasIdInSettings]); | 2811 snprintf(text,TEXTSIZE,"%d\016\016\017", stateUsed->lifeData.bottle_bar[stateUsed->lifeData.actualGas.GasIdInSettings]); |
3309 | 3327 |
3310 void t7_SummaryOfLeftCorner(void) | 3328 void t7_SummaryOfLeftCorner(void) |
3311 { | 3329 { |
3312 char text[256+60]; | 3330 char text[256+60]; |
3313 uint8_t textpointer = 0; | 3331 uint8_t textpointer = 0; |
3332 SSettings* pSettings = settingsGetPointer(); | |
3314 | 3333 |
3315 const SDecoinfo * pDecoinfoStandard; | 3334 const SDecoinfo * pDecoinfoStandard; |
3316 const SDecoinfo * pDecoinfoFuture; | 3335 const SDecoinfo * pDecoinfoFuture; |
3317 float fCNS; | 3336 float fCNS; |
3318 | 3337 |
3330 fCNS = stateUsed->lifeData .cns; | 3349 fCNS = stateUsed->lifeData .cns; |
3331 if(fCNS > 999) | 3350 if(fCNS > 999) |
3332 fCNS = 999; | 3351 fCNS = 999; |
3333 | 3352 |
3334 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | 3353 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
3335 if(settingsGetPointer()->FlipDisplay) | 3354 if(pSettings->FlipDisplay) |
3336 { | 3355 { |
3337 t7cY0free.WindowY1 = 400; | 3356 t7cY0free.WindowY1 = 400; |
3338 } | 3357 } |
3339 | 3358 |
3340 t7cY0free.WindowLineSpacing = 48; | 3359 t7cY0free.WindowLineSpacing = 48; |
3357 text[textpointer++] = '\r'; | 3376 text[textpointer++] = '\r'; |
3358 text[textpointer++] = TXT_CNS; | 3377 text[textpointer++] = TXT_CNS; |
3359 text[textpointer++] = '\n'; | 3378 text[textpointer++] = '\n'; |
3360 text[textpointer++] = '\r'; | 3379 text[textpointer++] = '\r'; |
3361 text[textpointer++] = TXT_FutureTTS; | 3380 text[textpointer++] = TXT_FutureTTS; |
3381 text[textpointer++] = '\n'; | |
3382 text[textpointer++] = '\r'; | |
3383 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (pSettings->dive_mode == DIVEMODE_CCR)) | |
3384 { | |
3385 text[textpointer++] = TXT_ScrubTime; | |
3386 | |
3387 } | |
3362 text[textpointer++] = '\017'; | 3388 text[textpointer++] = '\017'; |
3363 text[textpointer++] = 0; | 3389 text[textpointer++] = 0; |
3364 | 3390 if(!pSettings->FlipDisplay) |
3365 if(!settingsGetPointer()->FlipDisplay) | |
3366 { | 3391 { |
3367 t7cY0free.WindowX0 += 10; | 3392 t7cY0free.WindowX0 += 10; |
3368 t7cY0free.WindowY0 += 10; | 3393 t7cY0free.WindowY0 += 10; |
3369 GFX_write_string(&FontT24, &t7cY0free, text, 1); | 3394 GFX_write_string(&FontT24, &t7cY0free, text, 1); |
3370 t7cY0free.WindowX0 -= 10; | 3395 t7cY0free.WindowX0 -= 10; |
3401 text[textpointer++] = '\t'; | 3426 text[textpointer++] = '\t'; |
3402 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) | 3427 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
3403 textpointer += snprintf(&text[textpointer],10,"\020%i'", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); | 3428 textpointer += snprintf(&text[textpointer],10,"\020%i'", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); |
3404 else | 3429 else |
3405 textpointer += snprintf(&text[textpointer],10,"\020%ih", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); | 3430 textpointer += snprintf(&text[textpointer],10,"\020%ih", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); |
3431 | |
3432 if((pSettings->scrubTimerMode != SCRUB_TIMER_OFF) && (pSettings->dive_mode == DIVEMODE_CCR)) | |
3433 { | |
3434 text[textpointer++] = '\n'; | |
3435 text[textpointer++] = '\r'; | |
3436 text[textpointer++] = '\t'; | |
3437 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES) | |
3438 { | |
3439 textpointer += snprintf(&text[textpointer],10,"\020%3u'", pSettings->scrubTimerCur); | |
3440 } | |
3441 else | |
3442 { | |
3443 textpointer += snprintf(&text[textpointer],10,"\020%u\016\016%%\017", (pSettings->scrubTimerCur * 100 / pSettings->scrubTimerMax)); | |
3444 } | |
3445 } | |
3406 text[textpointer++] = 0; | 3446 text[textpointer++] = 0; |
3407 t7_colorscheme_mod(text); | 3447 t7_colorscheme_mod(text); |
3408 GFX_write_string(&FontT42, &t7cY0free, text, 1); | 3448 GFX_write_string(&FontT42, &t7cY0free, text, 1); |
3409 } | 3449 } |
3410 | 3450 |