comparison Discovery/Src/t7.c @ 710:8adf9b8fc7fa

Extension scrubber time: In previous version only one scrubber timer was available. After movement of scruvver timer menu menu space became available allowing to upgrade the functionality to support two scrubbers. To make it easier to identify combination ID to used scrubber the date of the last usage of the scrubber timer has been added.
author Ideenmodellierer
date Tue, 08 Nov 2022 21:16:17 +0100
parents 8c48553a0176
children 5071d554aaa5
comparison
equal deleted inserted replaced
709:c799151670d5 710:8adf9b8fc7fa
2771 float fAverageDepth, fAverageDepthAbsolute; 2771 float fAverageDepth, fAverageDepthAbsolute;
2772 const SDecoinfo * pDecoinfoStandard; 2772 const SDecoinfo * pDecoinfoStandard;
2773 const SDecoinfo * pDecoinfoFuture; 2773 const SDecoinfo * pDecoinfoFuture;
2774 float fCNS; 2774 float fCNS;
2775 float temperature; 2775 float temperature;
2776 SSettings* pSettings = settingsGetPointer();
2776 2777
2777 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) 2778 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
2778 { 2779 {
2779 pDecoinfoStandard = &stateUsed->decolistBuehlmann; 2780 pDecoinfoStandard = &stateUsed->decolistBuehlmann;
2780 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; 2781 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann;
2811 break; 2812 break;
2812 2813
2813 /* Average Depth */ 2814 /* Average Depth */
2814 case LLC_AverageDepth: 2815 case LLC_AverageDepth:
2815 headerText[2] = TXT_AvgDepth; 2816 headerText[2] = TXT_AvgDepth;
2816 if(settingsGetPointer()->nonMetricalSystem) 2817 if(pSettings->nonMetricalSystem)
2817 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(fAverageDepthAbsolute)); 2818 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(fAverageDepthAbsolute));
2818 else 2819 else
2819 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute); 2820 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute);
2820 break; 2821 break;
2821 2822
2826 break; 2827 break;
2827 2828
2828 /* Stop Uhr */ 2829 /* Stop Uhr */
2829 case LLC_Stopwatch: 2830 case LLC_Stopwatch:
2830 headerText[2] = TXT_Stopwatch; 2831 headerText[2] = TXT_Stopwatch;
2831 if(settingsGetPointer()->nonMetricalSystem) 2832 if(pSettings->nonMetricalSystem)
2832 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.0f",Stopwatch.Minutes, Stopwatch.Seconds,unit_depth_float(fAverageDepth)); 2833 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.0f",Stopwatch.Minutes, Stopwatch.Seconds,unit_depth_float(fAverageDepth));
2833 else 2834 else
2834 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth); 2835 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth);
2835 tinyHeaderFont = 1; 2836 tinyHeaderFont = 1;
2836 line = 1; 2837 line = 1;
2837 break; 2838 break;
2838 2839
2839 /* Ceiling */ 2840 /* Ceiling */
2840 case LLC_Ceiling: 2841 case LLC_Ceiling:
2841 headerText[2] = TXT_Ceiling; 2842 headerText[2] = TXT_Ceiling;
2842 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) 2843 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (pSettings->nonMetricalSystem))
2843 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); 2844 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter));
2844 else 2845 else
2845 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); 2846 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
2846 break; 2847 break;
2847 2848
2848 /* Future TTS */ 2849 /* Future TTS */
2849 case LLC_FutureTTS: 2850 case LLC_FutureTTS:
2850 headerText[2] = TXT_FutureTTS; 2851 headerText[2] = TXT_FutureTTS;
2851 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) 2852 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60)
2852 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); 2853 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",pSettings->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60);
2853 else 2854 else
2854 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%ih TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); 2855 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%ih TTS",pSettings->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600);
2855 tinyHeaderFont = 1; 2856 tinyHeaderFont = 1;
2856 line = 1; 2857 line = 1;
2857 break; 2858 break;
2858 2859
2859 /* CNS */ 2860 /* CNS */
2874 case LLC_ScrubberTime: 2875 case LLC_ScrubberTime:
2875 tinyHeaderFont = 1; 2876 tinyHeaderFont = 1;
2876 headerText[2] = TXT_ScrubTime; 2877 headerText[2] = TXT_ScrubTime;
2877 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES) 2878 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES)
2878 { 2879 {
2879 snprintf(text,TEXTSIZE,"\020%3u'",settingsGetPointer()->scrubTimerCur); 2880 snprintf(text,TEXTSIZE,"\020%3u'",pSettings->scrubberData[pSettings->scubberActiveId].TimerCur);
2880 } 2881 }
2881 else 2882 else
2882 { 2883 {
2883 snprintf(text,TEXTSIZE,"\020%u\016\016%%\017", (settingsGetPointer()->scrubTimerCur * 100 / settingsGetPointer()->scrubTimerMax)); 2884 snprintf(text,TEXTSIZE,"\020%u\016\016%%\017", (pSettings->scrubberData[pSettings->scubberActiveId].TimerCur * 100 / settingsGetPointer()->scrubberData[pSettings->scubberActiveId].TimerMax));
2884 } 2885 }
2885 break; 2886 break;
2886 #ifdef ENABLE_PSCR_MODE 2887 #ifdef ENABLE_PSCR_MODE
2887 case LCC_SimPpo2: 2888 case LCC_SimPpo2:
2888 headerText[2] = TXT_SimPpo2; 2889 headerText[2] = TXT_SimPpo2;
3520 text[textpointer++] = '\n'; 3521 text[textpointer++] = '\n';
3521 text[textpointer++] = '\r'; 3522 text[textpointer++] = '\r';
3522 text[textpointer++] = '\t'; 3523 text[textpointer++] = '\t';
3523 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES) 3524 if(settingsGetPointer()->scrubTimerMode == SCRUB_TIMER_MINUTES)
3524 { 3525 {
3525 textpointer += snprintf(&text[textpointer],10,"\020%3u'", pSettings->scrubTimerCur); 3526 textpointer += snprintf(&text[textpointer],10,"\020%3u'", pSettings->scrubberData[pSettings->scubberActiveId].TimerCur);
3526 } 3527 }
3527 else 3528 else
3528 { 3529 {
3529 textpointer += snprintf(&text[textpointer],10,"\020%u\016\016%%\017", (pSettings->scrubTimerCur * 100 / pSettings->scrubTimerMax)); 3530 textpointer += snprintf(&text[textpointer],10,"\020%u\016\016%%\017", (pSettings->scrubberData[pSettings->scubberActiveId].TimerCur * 100 / pSettings->scrubberData[pSettings->scubberActiveId].TimerMax));
3530 } 3531 }
3531 } 3532 }
3532 text[textpointer++] = 0; 3533 text[textpointer++] = 0;
3533 t7_colorscheme_mod(text); 3534 t7_colorscheme_mod(text);
3534 GFX_write_string(&FontT42, &t7cY0free, text, 1); 3535 GFX_write_string(&FontT42, &t7cY0free, text, 1);