Mercurial > public > ostc4
comparison Discovery/Src/t7.c @ 216:7012a521fa95
Merged in janlmulder/ostc4/edit-fix (pull request #11)
Fix 3 presentation bugs
author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
---|---|
date | Thu, 28 Mar 2019 13:05:29 +0000 |
parents | 4a0ebade04f5 |
children | 9b4b3decd9ba |
comparison
equal
deleted
inserted
replaced
212:c878a08dcf86 | 216:7012a521fa95 |
---|---|
2170 if(pDecoinfo->output_time_to_surface_seconds) | 2170 if(pDecoinfo->output_time_to_surface_seconds) |
2171 { | 2171 { |
2172 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS); | 2172 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS); |
2173 GFX_write_string(&FontT42,&t7r3,TextR3,0); | 2173 GFX_write_string(&FontT42,&t7r3,TextR3,0); |
2174 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60) | 2174 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60) |
2175 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60); | 2175 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60); |
2176 else | 2176 else |
2177 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600); | 2177 snprintf(TextR3,TEXTSIZE,"\020\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600); |
2178 t7_colorscheme_mod(TextR3); | 2178 t7_colorscheme_mod(TextR3); |
2179 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | 2179 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) |
2180 TextR2[0] = '\021'; | 2180 TextR2[0] = '\021'; |
2181 GFX_write_string(&FontT105,&t7r3,TextR3,1); | 2181 GFX_write_string(&FontT105,&t7r3,TextR3,1); |
2182 } | 2182 } |
2562 break; | 2562 break; |
2563 | 2563 |
2564 /* Future TTS */ | 2564 /* Future TTS */ |
2565 case 6: | 2565 case 6: |
2566 headerText[2] = TXT_FutureTTS; | 2566 headerText[2] = TXT_FutureTTS; |
2567 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, pDecoinfoFuture->output_time_to_surface_seconds / 60); | 2567 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
2568 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); | |
2569 else | |
2570 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%ih TTS",settingsGetPointer()->future_TTS, (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); | |
2568 tinyHeaderFont = 1; | 2571 tinyHeaderFont = 1; |
2569 line = 1; | 2572 line = 1; |
2570 break; | 2573 break; |
2571 | 2574 |
2572 /* CNS */ | 2575 /* CNS */ |
3094 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2); | 3097 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2); |
3095 text[textpointer++] = '\n'; | 3098 text[textpointer++] = '\n'; |
3096 text[textpointer++] = '\r'; | 3099 text[textpointer++] = '\r'; |
3097 text[textpointer++] = '\t'; | 3100 text[textpointer++] = '\t'; |
3098 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) | 3101 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) |
3099 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); | 3102 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); |
3100 else | 3103 else |
3101 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter); | 3104 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); |
3102 text[textpointer++] = '\n'; | 3105 text[textpointer++] = '\n'; |
3103 text[textpointer++] = '\r'; | 3106 text[textpointer++] = '\r'; |
3104 text[textpointer++] = '\t'; | 3107 text[textpointer++] = '\t'; |
3105 textpointer += snprintf(&text[textpointer],10,"\020%.0f", 100 * pDecoinfoStandard->output_relative_gradient); | 3108 textpointer += snprintf(&text[textpointer],10,"\020%.0f", 100 * pDecoinfoStandard->output_relative_gradient); |
3106 text[textpointer++] = '\n'; | 3109 text[textpointer++] = '\n'; |
3108 text[textpointer++] = '\t'; | 3111 text[textpointer++] = '\t'; |
3109 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS); | 3112 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS); |
3110 text[textpointer++] = '\n'; | 3113 text[textpointer++] = '\n'; |
3111 text[textpointer++] = '\r'; | 3114 text[textpointer++] = '\r'; |
3112 text[textpointer++] = '\t'; | 3115 text[textpointer++] = '\t'; |
3113 textpointer += snprintf(&text[textpointer],10,"\020%i'", pDecoinfoFuture->output_time_to_surface_seconds / 60); | 3116 if (pDecoinfoFuture->output_time_to_surface_seconds < 1000 * 60) |
3117 textpointer += snprintf(&text[textpointer],10,"\020%i'", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 60); | |
3118 else | |
3119 textpointer += snprintf(&text[textpointer],10,"\020%ih", (pDecoinfoFuture->output_time_to_surface_seconds + 59) / 3600); | |
3114 text[textpointer++] = 0; | 3120 text[textpointer++] = 0; |
3115 t7_colorscheme_mod(text); | 3121 t7_colorscheme_mod(text); |
3116 GFX_write_string(&FontT42, &t7cY0free, text, 1); | 3122 GFX_write_string(&FontT42, &t7cY0free, text, 1); |
3117 } | 3123 } |
3118 | 3124 |