comparison Discovery/Src/t3.c @ 214:51a3aeffc6b3 edit-fix

Bugfix: handle rounding of TTS and future TTS consistently There was a bug with futureTTS with an extended bottom time of 0 minutes (so same TTS and the main schedule) being not in sync with each other. This was simply caused by inconsistent rounding of seconds to minute conversions. And when fixing this, I noticed also inconsistent handling of huge 1000+ minutes TTS values. At some places, the presentation changed to hours notation, and other places not. I doubt that any OSTC4 user ever made a dive that had more than 1000 minutes of deco, but fixed this presentation as well, simply because of consistency. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Thu, 28 Mar 2019 08:26:17 +0100
parents 8b8074080d7b
children ec16fd26e280
comparison
equal deleted inserted replaced
213:d539ed9aa5b8 214:51a3aeffc6b3
853 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS); 853 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS);
854 GFX_write_string(&FontT42,tXc1,text,0); 854 GFX_write_string(&FontT42,tXc1,text,0);
855 if(pDecoinfo->output_time_to_surface_seconds) 855 if(pDecoinfo->output_time_to_surface_seconds)
856 { 856 {
857 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60) 857 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60)
858 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60); 858 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60);
859 else 859 else
860 snprintf(text,TEXTSIZE,"\020\003\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600); 860 snprintf(text,TEXTSIZE,"\020\003\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600);
861 t3_basics_colorscheme_mod(text); 861 t3_basics_colorscheme_mod(text);
862 GFX_write_string(&FontT105,tXc1,text,1); 862 GFX_write_string(&FontT105,tXc1,text,1);
863 } 863 }
864 break; 864 break;
865 865