comparison Discovery/Src/t7.c @ 911:a2523e19f59a Evo_2_23

VPMTable deco stop visualization: The current deco stop will change from white to green to indicate that the diver is in the region where the stop time is counted down.
author Ideenmodellierer
date Tue, 15 Oct 2024 20:00:37 +0200
parents 46a21ff3f5ab
children ff318ae65dd0
comparison
equal deleted inserted replaced
910:7bd347bdaa81 911:a2523e19f59a
2182 float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime 2182 float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime
2183 SSettingsStatus SettingsStatus; 2183 SSettingsStatus SettingsStatus;
2184 SSettings* pSettings; 2184 SSettings* pSettings;
2185 pSettings = settingsGetPointer(); 2185 pSettings = settingsGetPointer();
2186 uint8_t decoPlanEntries = 6; 2186 uint8_t decoPlanEntries = 6;
2187 uint8_t color = 0;
2188 2187
2189 uint8_t local_ppo2sensors_deactivated = 0; 2188 uint8_t local_ppo2sensors_deactivated = 0;
2190 2189
2191 if(stateUsed->mode == MODE_DIVE) /* show sensors based on current dive settings */ 2190 if(stateUsed->mode == MODE_DIVE) /* show sensors based on current dive settings */
2192 { 2191 {
2637 t7cY0free.WindowX0 += 15; 2636 t7cY0free.WindowX0 += 15;
2638 } 2637 }
2639 break; 2638 break;
2640 2639
2641 case CVIEW_Decolist: 2640 case CVIEW_Decolist:
2642 snprintf(text,100,"\032\f\001 %c%c", TXT_2BYTE, TXT2BYTE_Decolist); 2641
2643 2642
2644 if(settingsGetPointer()->VPM_conservatism.ub.alternative == 0) 2643 if(settingsGetPointer()->VPM_conservatism.ub.alternative == 0)
2645 { 2644 {
2646 GFX_write_string(&FontT42,&t7cH,text,0); 2645 text[0] = '\032';
2647 } 2646 }
2648 else 2647 else
2649 { 2648 {
2650 switch(vpm_get_TableState()) 2649 switch(vpm_get_TableState())
2651 { 2650 {
2652 case VPM_TABLE_MISSED: color = CLUT_WarningRed; 2651 case VPM_TABLE_MISSED: text[0] = '\025';
2653 break; 2652 break;
2654 case VPM_TABLE_WARNING: color = CLUT_WarningYellow; 2653 case VPM_TABLE_WARNING: text[0] = '\024';
2655 break; 2654 break;
2656 case VPM_TABLE_ACTIVE: 2655 case VPM_TABLE_ACTIVE:
2657 case VPM_TABLE_INIT: 2656 case VPM_TABLE_INIT:
2658 default: color = 0; 2657 default: text[0] = '\032';
2659 break; 2658 break;
2660 } 2659 }
2661 GFX_write_string_color(&FontT42,&t7cH,text,0,color); 2660 }
2662 } 2661 snprintf(&text[1],100,"\f\001 %c%c", TXT_2BYTE, TXT2BYTE_Decolist);
2662 GFX_write_string(&FontT42,&t7cH,text,0);
2663
2663 uint8_t depthNext, depthLast, depthSecond, depthInc; 2664 uint8_t depthNext, depthLast, depthSecond, depthInc;
2664 2665
2665 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10); 2666 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10);
2666 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10); 2667 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10);
2667 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10); 2668 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10);
2697 textpointer += snprintf(&text[textpointer],20,"\031\034 %2u\016\016%c%c\017\n\r",depthNext, unit_depth_char1(), unit_depth_char2()); 2698 textpointer += snprintf(&text[textpointer],20,"\031\034 %2u\016\016%c%c\017\n\r",depthNext, unit_depth_char1(), unit_depth_char2());
2698 if(textpointer > 200) break; 2699 if(textpointer > 200) break;
2699 } 2700 }
2700 if(decoPlanEntries == 5) /* add VPM deco zone */ 2701 if(decoPlanEntries == 5) /* add VPM deco zone */
2701 { 2702 {
2702 textpointer += snprintf(&text[textpointer],20,"\031\034 Zone %2u\016\016%c%c\017\n\r",vpm_get_decozone(), unit_depth_char1(), unit_depth_char2()); 2703 textpointer += snprintf(&text[textpointer],30,"\031\034 Zone %2u\016\016%c%c\017\n\r",vpm_get_decozone(), unit_depth_char1(), unit_depth_char2());
2703 } 2704 }
2704 if(!pSettings->FlipDisplay) 2705 if(!pSettings->FlipDisplay)
2705 { 2706 {
2706 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; 2707 t7cY0free.WindowY0 = t7cC.WindowY0 - 10;
2707 } 2708 }
2876 GFX_write_string(&FontT105,&t7r1,TextR1,1); 2877 GFX_write_string(&FontT105,&t7r1,TextR1,1);
2877 2878
2878 /* next deco stop */ 2879 /* next deco stop */
2879 if(nextstopDepthMeter) 2880 if(nextstopDepthMeter)
2880 { 2881 {
2881 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop); 2882 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop);
2882 GFX_write_string(&FontT42,&t7r2,TextR2,0); 2883 GFX_write_string(&FontT42,&t7r2,TextR2,0);
2883 textlength = snprintf(TextR2,TEXTSIZE,"\020\002%u%c%c %u'" 2884
2885 if((pSettings->VPM_conservatism.ub.alternative) && (fabs(stateUsed->lifeData.depth_meter - nextstopDepthMeter)) < 1.5)
2886 {
2887 TextR2[0] = '\026';
2888 textlength = 1;
2889 }
2890 else
2891 {
2892 TextR2[0] = '\020';
2893 textlength = 1;
2894 }
2895
2896 textlength += snprintf(&TextR2[textlength],TEXTSIZE,"\002%u%c%c %u'"
2884 , unit_depth_integer(nextstopDepthMeter) 2897 , unit_depth_integer(nextstopDepthMeter)
2885 , unit_depth_char1_T105() 2898 , unit_depth_char1_T105()
2886 , unit_depth_char2_T105() 2899 , unit_depth_char2_T105()
2887 , (nextstopLengthSeconds+59)/60); 2900 , (nextstopLengthSeconds+59)/60);
2888 Gfx_colorsscheme_mod(TextR2, 0); 2901 Gfx_colorsscheme_mod(TextR2, 0);