# HG changeset patch # User Ideenmodellierer # Date 1605467371 -3600 # Node ID 5e0a75e2f00b6828592428f517258783ad4a3c1f # Parent d97f0e395058b04586c489380e298f1244d8d998 Bugfix One or more deactivated sensors hide sensor display: The sensor values were no longer displayed in case of a deactivated sensor. Root cause was the view available functionality which checked only if deactivation variable was set. Changed implementation to hide sensor views only if all sensors have been deactivated. Make sure that alignment of strings is set before dual font handling: The size (screen dimension) of a string needs the information regarding the font size to be used. If the dual font feature (using two font sizes in one string) is udes, the activation needs to happen after the definition of the alignment diff -r d97f0e395058 -r 5e0a75e2f00b Discovery/Src/t3.c --- a/Discovery/Src/t3.c Sun Nov 15 20:01:56 2020 +0100 +++ b/Discovery/Src/t3.c Sun Nov 15 20:09:31 2020 +0100 @@ -458,7 +458,7 @@ snprintf(text,TEXTSIZE,"\032\f\002%c%c", TXT_2BYTE,TXT2BYTE_ApneaSurface); GFX_write_string(&FontT42,tXr1,text,0); - snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",SurfaceBreakTime.Minutes, SurfaceBreakTime.Seconds); + snprintf(text,TEXTSIZE,"\020\003\002\016%u:%02u",SurfaceBreakTime.Minutes, SurfaceBreakTime.Seconds); } else { @@ -470,9 +470,9 @@ GFX_write_string(&FontT42,tXr1,text,0); if(Divetime.Minutes < 100) - snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); + snprintf(text,TEXTSIZE,"\020\003\002\016%u:%02u",Divetime.Minutes, Divetime.Seconds); else - snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes); + snprintf(text,TEXTSIZE,"\020\003\002\016%u'",Divetime.Minutes); } t3_basics_colorscheme_mod(text); GFX_write_string(&FontT105,tXr1,text,1); @@ -509,9 +509,9 @@ GFX_write_string(&FontT42,tXr1,text,0); if(Divetime.Minutes < 100) - snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); + snprintf(text,TEXTSIZE,"\020\003\002\016%u:%02u",Divetime.Minutes, Divetime.Seconds); else - snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes); + snprintf(text,TEXTSIZE,"\020\003\002\016%u'",Divetime.Minutes); t3_basics_colorscheme_mod(text); GFX_write_string(&FontT105,tXr1,text,1); @@ -1025,9 +1025,10 @@ textpointer = 0; text[textpointer++] = '\030'; if(i==1) - text[textpointer++] = '\001'; + text[textpointer++] = '\001'; /* center */ else if(i==2) - text[textpointer++] = '\002'; + text[textpointer++] = '\002'; /* right */ + if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<warnings.sensorOutOfBounds[i]) text[textpointer++] = '\025'; - textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.1f",stateUsed->lifeData.ppO2Sensor_bar[i]); + textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.2f",stateUsed->lifeData.ppO2Sensor_bar[i]); } - GFX_write_string(&FontT144,tXc1,text,0); + GFX_write_string(&FontT105,tXc1,text,0); } break; @@ -1133,7 +1134,7 @@ snprintf(text,TEXTSIZE,"\032\002\f%c", TXT_Stopwatch); GFX_write_string(&FontT42,tXc1,text,0); - snprintf(text,TEXTSIZE,"\030\016\002%01.1f",unit_depth_float(fAverageDepth)); + snprintf(text,TEXTSIZE,"\030\002\016%01.1f",unit_depth_float(fAverageDepth)); GFX_write_string(&FontT105,tXc1,text,0); if(!pSettings->FlipDisplay) { @@ -1197,7 +1198,7 @@ snprintf(text,TEXTSIZE,"\032\002\f%c",TXT_AvgDepth); GFX_write_string(&FontT42,tXc1,text,0); - snprintf(text,TEXTSIZE,"\020\003\016\002\%01.1f",unit_depth_float(fAverageDepthAbsolute)); + snprintf(text,TEXTSIZE,"\020\003\002\016\%01.1f",unit_depth_float(fAverageDepthAbsolute)); GFX_write_string(&FontT105,tXc1,text,0); break; } @@ -1412,7 +1413,7 @@ } if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) && - ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) + ((stateUsed->diveSettings.ppo2sensors_deactivated == 0x07) || (stateUsed->diveSettings.ccrOption == 0))) { cv_disabled = 1; } diff -r d97f0e395058 -r 5e0a75e2f00b Discovery/Src/t7.c --- a/Discovery/Src/t7.c Sun Nov 15 20:01:56 2020 +0100 +++ b/Discovery/Src/t7.c Sun Nov 15 20:09:31 2020 +0100 @@ -1415,9 +1415,10 @@ textpointer = 0; lineFree = 5; - text[textpointer++] = '\001'; + if(lineFree && stateUsed->warnings.decoMissed) { + text[textpointer++] = '\001'; text[textpointer++] = TXT_2BYTE; text[textpointer++] = TXT2BYTE_WarnDecoMissed; text[textpointer++] = '\n'; @@ -1428,6 +1429,7 @@ if(lineFree && stateUsed->warnings.fallback) { + text[textpointer++] = '\001'; text[textpointer++] = TXT_2BYTE; text[textpointer++] = TXT2BYTE_WarnFallback; text[textpointer++] = '\n'; @@ -1438,6 +1440,7 @@ if(lineFree && stateUsed->warnings.ppO2Low) { + text[textpointer++] = '\001'; text[textpointer++] = TXT_2BYTE; text[textpointer++] = TXT2BYTE_WarnPPO2Low; text[textpointer++] = '\n'; @@ -1448,6 +1451,7 @@ if(lineFree && stateUsed->warnings.ppO2High) { + text[textpointer++] = '\001'; text[textpointer++] = TXT_2BYTE; text[textpointer++] = TXT2BYTE_WarnPPO2High; text[textpointer++] = '\n'; @@ -1458,6 +1462,7 @@ if(lineFree && stateUsed->warnings.sensorLinkLost) { + text[textpointer++] = '\001'; text[textpointer++] = TXT_2BYTE; text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; text[textpointer++] = '\n'; @@ -1468,6 +1473,7 @@ #ifdef ENABLE_BOTTLE_SENSOR if(stateUsed->warnings.newPressure) { + text[textpointer++] = '\001'; sprintf(&text[textpointer]," %u Bar\n", stateUsed->warnings.newPressure); textpointer++; lineFree--; @@ -1527,7 +1533,7 @@ increment = 0; } if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && - ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) + ((stateUsed->diveSettings.ppo2sensors_deactivated == 0x07) || (stateUsed->diveSettings.ccrOption == 0))) { increment = 0; } @@ -1554,7 +1560,7 @@ } if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) && - ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) + ((stateUsed->diveSettings.ppo2sensors_deactivated == 0x07) || (stateUsed->diveSettings.ccrOption == 0))) { cv_disabled = 1; } @@ -2240,9 +2246,9 @@ } if(Divetime.Minutes < 1000) - snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); + snprintf(TextR1,TEXTSIZE,"\020\002\016%u:%02u",Divetime.Minutes, Divetime.Seconds); else - snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes); + snprintf(TextR1,TEXTSIZE,"\020\002\016%u'",Divetime.Minutes); t7_colorscheme_mod(TextR1); GFX_write_string(&FontT105,&t7r1,TextR1,1); @@ -2268,7 +2274,7 @@ { snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); GFX_write_string(&FontT42,&t7r2,TextR2,0); - snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); + snprintf(TextR2,TEXTSIZE,"\020\002\016%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); t7_colorscheme_mod(TextR2); GFX_write_string(&FontT105,&t7r2,TextR2,1); }