mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-09-11 19:55:14 +02:00
Enable PageDST810 for small decimals and some code cleanup
This commit is contained in:
@@ -123,20 +123,14 @@ class PageFourValues2 : public Page
|
||||
if(bvalue1->getFormat() == "formatLatitude" || bvalue1->getFormat() == "formatLongitude"){
|
||||
valueY = 90;
|
||||
DsegFontSize = 20;
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt8b);
|
||||
getdisplay().setCursor(100, 90);
|
||||
}
|
||||
else if(bvalue1->getFormat() == "formatTime" || bvalue1->getFormat() == "formatDate"){
|
||||
valueY = 80;
|
||||
DsegFontSize = 20;
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt8b);
|
||||
getdisplay().setCursor(180, 77);
|
||||
}
|
||||
else{
|
||||
valueY = 90;
|
||||
DsegFontSize = 30;
|
||||
getdisplay().setFont(&DSEG7Classic_BoldItalic30pt7b);
|
||||
getdisplay().setCursor(180, 90);
|
||||
}
|
||||
|
||||
// Show bus data
|
||||
@@ -144,7 +138,7 @@ class PageFourValues2 : public Page
|
||||
printBoatValue(svalue1, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
}
|
||||
else{
|
||||
printBoatValue(svalue1old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
printBoatValue(svalue1old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Old value as formated string
|
||||
}
|
||||
if(valid1 == true){
|
||||
svalue1old = svalue1; // Save the old value
|
||||
@@ -177,20 +171,14 @@ class PageFourValues2 : public Page
|
||||
if(bvalue2->getFormat() == "formatLatitude" || bvalue2->getFormat() == "formatLongitude"){
|
||||
valueY = 180;
|
||||
DsegFontSize = 20;
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt8b);
|
||||
getdisplay().setCursor(100, 180);
|
||||
}
|
||||
else if(bvalue2->getFormat() == "formatTime" || bvalue2->getFormat() == "formatDate"){
|
||||
valueY = 170;
|
||||
DsegFontSize = 20;
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt8b);
|
||||
getdisplay().setCursor(180, 158);
|
||||
}
|
||||
else{
|
||||
valueY = 180;
|
||||
DsegFontSize = 30;
|
||||
getdisplay().setFont(&DSEG7Classic_BoldItalic30pt7b);
|
||||
getdisplay().setCursor(180, 180);
|
||||
}
|
||||
|
||||
// Show bus data
|
||||
@@ -198,7 +186,7 @@ class PageFourValues2 : public Page
|
||||
printBoatValue(svalue2, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
}
|
||||
else{
|
||||
printBoatValue(svalue2old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
printBoatValue(svalue2old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Old value as formated string
|
||||
}
|
||||
if(valid2 == true){
|
||||
svalue2old = svalue2; // Save the old value
|
||||
@@ -232,20 +220,14 @@ class PageFourValues2 : public Page
|
||||
if(bvalue3->getFormat() == "formatLatitude" || bvalue3->getFormat() == "formatLongitude"){
|
||||
valueY = 250;
|
||||
DsegFontSize = 10;
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt8b);
|
||||
getdisplay().setCursor(50, 240);
|
||||
}
|
||||
else if(bvalue3->getFormat() == "formatTime" || bvalue3->getFormat() == "formatDate"){
|
||||
valueY = 253;
|
||||
DsegFontSize = 10;
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt8b);
|
||||
getdisplay().setCursor(100, 240);
|
||||
}
|
||||
else{
|
||||
valueY = 270;
|
||||
DsegFontSize = 20;
|
||||
getdisplay().setFont(&DSEG7Classic_BoldItalic20pt7b);
|
||||
getdisplay().setCursor(80, 270);
|
||||
}
|
||||
|
||||
// Show bus data
|
||||
@@ -253,7 +235,7 @@ class PageFourValues2 : public Page
|
||||
printBoatValue(svalue3, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
}
|
||||
else{
|
||||
printBoatValue(svalue3old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
printBoatValue(svalue3old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Old value as formated string
|
||||
}
|
||||
if(valid3 == true){
|
||||
svalue3old = svalue3; // Save the old value
|
||||
@@ -287,20 +269,14 @@ class PageFourValues2 : public Page
|
||||
if(bvalue4->getFormat() == "formatLatitude" || bvalue4->getFormat() == "formatLongitude"){
|
||||
valueY = 250;
|
||||
DsegFontSize = 10;
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt8b);
|
||||
getdisplay().setCursor(250, 240);
|
||||
}
|
||||
else if(bvalue4->getFormat() == "formatTime" || bvalue4->getFormat() == "formatDate"){
|
||||
valueY = 253;
|
||||
DsegFontSize = 10;
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt8b);
|
||||
getdisplay().setCursor(300, 240);
|
||||
}
|
||||
else{
|
||||
valueY = 270;
|
||||
DsegFontSize = 20;
|
||||
getdisplay().setFont(&DSEG7Classic_BoldItalic20pt7b);
|
||||
getdisplay().setCursor(280, 270);
|
||||
}
|
||||
|
||||
// Show bus data
|
||||
@@ -308,7 +284,7 @@ class PageFourValues2 : public Page
|
||||
printBoatValue(svalue4, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
}
|
||||
else{
|
||||
printBoatValue(svalue4old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Real value as formated string
|
||||
printBoatValue(svalue4old, valueX, valueY, RIGHT, DsegFontSize, smallDecimals); // Old value as formated string
|
||||
}
|
||||
if(valid4 == true){
|
||||
svalue4old = svalue4; // Save the old value
|
||||
|
||||
Reference in New Issue
Block a user