comparison Discovery/Src/t3.c @ 542:6960df7ddb09

Added new t3 view showing first deco stop and tts in parallel: TTS and deco stop may already be shown individually. Now also available in one view where TTS is limited to 99minutes (switch to hours) to avoid string overlap.
author Ideenmodellierer
date Sat, 10 Oct 2020 21:02:05 +0200
parents 6fbf7cd391cb
children 43a2dd4ba30f
comparison
equal deleted inserted replaced
541:6fbf7cd391cb 542:6960df7ddb09
71 CVIEW_T3_ppO2andGas, 71 CVIEW_T3_ppO2andGas,
72 CVIEW_T3_GasList, 72 CVIEW_T3_GasList,
73 CVIEW_T3_Navigation, 73 CVIEW_T3_Navigation,
74 CVIEW_T3_DepthData, 74 CVIEW_T3_DepthData,
75 CVIEW_noneOrDebug, 75 CVIEW_noneOrDebug,
76 CVIEW_T3_DecoTTS,
76 CVIEW_T3_END 77 CVIEW_T3_END
77 }; 78 };
78 79
79 /* Private function prototypes -----------------------------------------------*/ 80 /* Private function prototypes -----------------------------------------------*/
80 void t3_refresh_divemode(void); 81 void t3_refresh_divemode(void);
926 snprintf(text,100,"\030\003%03i`",heading); 927 snprintf(text,100,"\030\003%03i`",heading);
927 GFX_write_string(&FontT105,tXc1,text,0); 928 GFX_write_string(&FontT105,tXc1,text,0);
928 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading); 929 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading);
929 break; 930 break;
930 931
932 case CVIEW_T3_DecoTTS:
931 case CVIEW_T3_Decostop: 933 case CVIEW_T3_Decostop:
932 default: 934 default:
933 // decostop 935 // decostop
934 if(pDecoinfo->output_time_to_surface_seconds) 936 if(pDecoinfo->output_time_to_surface_seconds)
935 { 937 {
950 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Decostop); 952 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Decostop);
951 GFX_write_string(&FontT42,tXc1,text,0); 953 GFX_write_string(&FontT42,tXc1,text,0);
952 954
953 textpointer = 0; 955 textpointer = 0;
954 snprintf(&text[textpointer],TEXTSIZE,"\020\003%u%c%c %u'" 956 snprintf(&text[textpointer],TEXTSIZE,"\020\003%u%c%c %u'"
955 , unit_depth_integer(nextstopDepthMeter) 957 , unit_depth_integer(nextstopDepthMeter)
956 , unit_depth_char1_T105() 958 , unit_depth_char1_T105()
957 , unit_depth_char2_T105() 959 , unit_depth_char2_T105()
958 , (nextstopLengthSeconds+59)/60); 960 , (nextstopLengthSeconds+59)/60);
959 // old without feet hw 170703 snprintf(&text[textpointer],TEXTSIZE,"\020\003%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60); 961 t3_basics_colorscheme_mod(text);
960 t3_basics_colorscheme_mod(text); 962 GFX_write_string(&FontT105,tXc1,text,0);
961 GFX_write_string(&FontT105,tXc1,text,0);
962 } 963 }
963 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) 964 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit()))
964 { 965 {
965 textpointer = 0; 966 textpointer = 0;
966 snprintf(&text[textpointer],TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); 967 snprintf(&text[textpointer],TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2);
979 snprintf(text,TEXTSIZE,"\020\003%i'",pDecoinfo->output_ndl_seconds/60); 980 snprintf(text,TEXTSIZE,"\020\003%i'",pDecoinfo->output_ndl_seconds/60);
980 else 981 else
981 snprintf(text,TEXTSIZE,"\020\003%ih",pDecoinfo->output_ndl_seconds/3600); 982 snprintf(text,TEXTSIZE,"\020\003%ih",pDecoinfo->output_ndl_seconds/3600);
982 t3_basics_colorscheme_mod(text); 983 t3_basics_colorscheme_mod(text);
983 GFX_write_string(&FontT105,tXc1,text,0); 984 GFX_write_string(&FontT105,tXc1,text,0);
985 }
986
987 if(tX_selection_customview == CVIEW_T3_DecoTTS) /* add tts data on right side of screen */
988 {
989 snprintf(text,TEXTSIZE,"\002\032\f%c",TXT_TTS);
990 GFX_write_string(&FontT42,tXc1,text,0);
991 if(pDecoinfo->output_time_to_surface_seconds)
992 {
993 if(pDecoinfo->output_time_to_surface_seconds < 100 * 60)
994 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60);
995 else
996 snprintf(text,TEXTSIZE,"\020\003\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600);
997 t3_basics_colorscheme_mod(text);
998 GFX_write_string(&FontT105,tXc1,text,0);
999 }
984 } 1000 }
985 break; 1001 break;
986 1002
987 case CVIEW_sensors: 1003 case CVIEW_sensors:
988 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_O2monitor); 1004 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_O2monitor);