comparison Discovery/Src/t7.c @ 564:5e0a75e2f00b

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
author Ideenmodellierer
date Sun, 15 Nov 2020 20:09:31 +0100
parents 43a2dd4ba30f
children 1c95f811967c
comparison
equal deleted inserted replaced
563:d97f0e395058 564:5e0a75e2f00b
1413 text[4] = 0; 1413 text[4] = 0;
1414 GFX_write_string(&FontT42,&t7cH,text,0); 1414 GFX_write_string(&FontT42,&t7cH,text,0);
1415 1415
1416 textpointer = 0; 1416 textpointer = 0;
1417 lineFree = 5; 1417 lineFree = 5;
1418 text[textpointer++] = '\001'; 1418
1419 if(lineFree && stateUsed->warnings.decoMissed) 1419 if(lineFree && stateUsed->warnings.decoMissed)
1420 { 1420 {
1421 text[textpointer++] = '\001';
1421 text[textpointer++] = TXT_2BYTE; 1422 text[textpointer++] = TXT_2BYTE;
1422 text[textpointer++] = TXT2BYTE_WarnDecoMissed; 1423 text[textpointer++] = TXT2BYTE_WarnDecoMissed;
1423 text[textpointer++] = '\n'; 1424 text[textpointer++] = '\n';
1424 text[textpointer++] = '\r'; 1425 text[textpointer++] = '\r';
1425 text[textpointer] = 0; 1426 text[textpointer] = 0;
1426 lineFree--; 1427 lineFree--;
1427 } 1428 }
1428 1429
1429 if(lineFree && stateUsed->warnings.fallback) 1430 if(lineFree && stateUsed->warnings.fallback)
1430 { 1431 {
1432 text[textpointer++] = '\001';
1431 text[textpointer++] = TXT_2BYTE; 1433 text[textpointer++] = TXT_2BYTE;
1432 text[textpointer++] = TXT2BYTE_WarnFallback; 1434 text[textpointer++] = TXT2BYTE_WarnFallback;
1433 text[textpointer++] = '\n'; 1435 text[textpointer++] = '\n';
1434 text[textpointer++] = '\r'; 1436 text[textpointer++] = '\r';
1435 text[textpointer] = 0; 1437 text[textpointer] = 0;
1436 lineFree--; 1438 lineFree--;
1437 } 1439 }
1438 1440
1439 if(lineFree && stateUsed->warnings.ppO2Low) 1441 if(lineFree && stateUsed->warnings.ppO2Low)
1440 { 1442 {
1443 text[textpointer++] = '\001';
1441 text[textpointer++] = TXT_2BYTE; 1444 text[textpointer++] = TXT_2BYTE;
1442 text[textpointer++] = TXT2BYTE_WarnPPO2Low; 1445 text[textpointer++] = TXT2BYTE_WarnPPO2Low;
1443 text[textpointer++] = '\n'; 1446 text[textpointer++] = '\n';
1444 text[textpointer++] = '\r'; 1447 text[textpointer++] = '\r';
1445 text[textpointer] = 0; 1448 text[textpointer] = 0;
1446 lineFree--; 1449 lineFree--;
1447 } 1450 }
1448 1451
1449 if(lineFree && stateUsed->warnings.ppO2High) 1452 if(lineFree && stateUsed->warnings.ppO2High)
1450 { 1453 {
1454 text[textpointer++] = '\001';
1451 text[textpointer++] = TXT_2BYTE; 1455 text[textpointer++] = TXT_2BYTE;
1452 text[textpointer++] = TXT2BYTE_WarnPPO2High; 1456 text[textpointer++] = TXT2BYTE_WarnPPO2High;
1453 text[textpointer++] = '\n'; 1457 text[textpointer++] = '\n';
1454 text[textpointer++] = '\r'; 1458 text[textpointer++] = '\r';
1455 text[textpointer] = 0; 1459 text[textpointer] = 0;
1456 lineFree--; 1460 lineFree--;
1457 } 1461 }
1458 1462
1459 if(lineFree && stateUsed->warnings.sensorLinkLost) 1463 if(lineFree && stateUsed->warnings.sensorLinkLost)
1460 { 1464 {
1465 text[textpointer++] = '\001';
1461 text[textpointer++] = TXT_2BYTE; 1466 text[textpointer++] = TXT_2BYTE;
1462 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; 1467 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost;
1463 text[textpointer++] = '\n'; 1468 text[textpointer++] = '\n';
1464 text[textpointer++] = '\r'; 1469 text[textpointer++] = '\r';
1465 text[textpointer] = 0; 1470 text[textpointer] = 0;
1466 lineFree--; 1471 lineFree--;
1467 } 1472 }
1468 #ifdef ENABLE_BOTTLE_SENSOR 1473 #ifdef ENABLE_BOTTLE_SENSOR
1469 if(stateUsed->warnings.newPressure) 1474 if(stateUsed->warnings.newPressure)
1470 { 1475 {
1476 text[textpointer++] = '\001';
1471 sprintf(&text[textpointer]," %u Bar\n", stateUsed->warnings.newPressure); 1477 sprintf(&text[textpointer]," %u Bar\n", stateUsed->warnings.newPressure);
1472 textpointer++; 1478 textpointer++;
1473 lineFree--; 1479 lineFree--;
1474 } 1480 }
1475 #endif 1481 #endif
1525 if(cv_changelist[i] == CVIEW_END) 1531 if(cv_changelist[i] == CVIEW_END)
1526 { 1532 {
1527 increment = 0; 1533 increment = 0;
1528 } 1534 }
1529 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && 1535 if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) &&
1530 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) 1536 ((stateUsed->diveSettings.ppo2sensors_deactivated == 0x07) || (stateUsed->diveSettings.ccrOption == 0)))
1531 { 1537 {
1532 increment = 0; 1538 increment = 0;
1533 } 1539 }
1534 1540
1535 pViews++; 1541 pViews++;
1552 } 1558 }
1553 i++; 1559 i++;
1554 } 1560 }
1555 1561
1556 if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) && 1562 if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) &&
1557 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) 1563 ((stateUsed->diveSettings.ppo2sensors_deactivated == 0x07) || (stateUsed->diveSettings.ccrOption == 0)))
1558 { 1564 {
1559 cv_disabled = 1; 1565 cv_disabled = 1;
1560 } 1566 }
1561 return cv_disabled; 1567 return cv_disabled;
1562 } 1568 }
2238 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime); 2244 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime);
2239 GFX_write_string(&FontT42,&t7r1,TextR1,0); 2245 GFX_write_string(&FontT42,&t7r1,TextR1,0);
2240 } 2246 }
2241 2247
2242 if(Divetime.Minutes < 1000) 2248 if(Divetime.Minutes < 1000)
2243 snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); 2249 snprintf(TextR1,TEXTSIZE,"\020\002\016%u:%02u",Divetime.Minutes, Divetime.Seconds);
2244 else 2250 else
2245 snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes); 2251 snprintf(TextR1,TEXTSIZE,"\020\002\016%u'",Divetime.Minutes);
2246 t7_colorscheme_mod(TextR1); 2252 t7_colorscheme_mod(TextR1);
2247 GFX_write_string(&FontT105,&t7r1,TextR1,1); 2253 GFX_write_string(&FontT105,&t7r1,TextR1,1);
2248 2254
2249 /* next deco stop */ 2255 /* next deco stop */
2250 if(nextstopDepthMeter) 2256 if(nextstopDepthMeter)
2266 } 2272 }
2267 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) 2273 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit()))
2268 { 2274 {
2269 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); 2275 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2);
2270 GFX_write_string(&FontT42,&t7r2,TextR2,0); 2276 GFX_write_string(&FontT42,&t7r2,TextR2,0);
2271 snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); 2277 snprintf(TextR2,TEXTSIZE,"\020\002\016%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds);
2272 t7_colorscheme_mod(TextR2); 2278 t7_colorscheme_mod(TextR2);
2273 GFX_write_string(&FontT105,&t7r2,TextR2,1); 2279 GFX_write_string(&FontT105,&t7r2,TextR2,1);
2274 } 2280 }
2275 2281
2276 /* tts - option 1 2282 /* tts - option 1