mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-03-28 18:06:37 +01:00
Finalize switch to epd pointer instead if getdisplay()
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
|
||||
|
||||
#include "Pagedata.h"
|
||||
@@ -72,46 +73,46 @@ class PageTwoValues : public Page
|
||||
//***********************************************************
|
||||
|
||||
// Set display in partial refresh mode
|
||||
getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update
|
||||
epd->setPartialWindow(0, 0, epd->width(), epd->height()); // Set partial update
|
||||
|
||||
// ############### Value 1 ################
|
||||
|
||||
// Show name
|
||||
getdisplay().setTextColor(commonData->fgcolor);
|
||||
getdisplay().setFont(&Ubuntu_Bold20pt8b);
|
||||
getdisplay().setCursor(20, 80);
|
||||
getdisplay().print(name1); // Page name
|
||||
epd->setTextColor(commonData->fgcolor);
|
||||
epd->setFont(&Ubuntu_Bold20pt8b);
|
||||
epd->setCursor(20, 80);
|
||||
epd->print(name1); // Page name
|
||||
|
||||
// Show unit
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt8b);
|
||||
getdisplay().setCursor(20, 130);
|
||||
epd->setFont(&Ubuntu_Bold12pt8b);
|
||||
epd->setCursor(20, 130);
|
||||
if(holdvalues == false){
|
||||
getdisplay().print(unit1); // Unit
|
||||
epd->print(unit1); // Unit
|
||||
}
|
||||
else{
|
||||
getdisplay().print(unit1old);
|
||||
epd->print(unit1old);
|
||||
}
|
||||
|
||||
// Switch font if format for any values
|
||||
if(bvalue1->getFormat() == "formatLatitude" || bvalue1->getFormat() == "formatLongitude"){
|
||||
getdisplay().setFont(&Ubuntu_Bold20pt8b);
|
||||
getdisplay().setCursor(50, 130);
|
||||
epd->setFont(&Ubuntu_Bold20pt8b);
|
||||
epd->setCursor(50, 130);
|
||||
}
|
||||
else if(bvalue1->getFormat() == "formatTime" || bvalue1->getFormat() == "formatDate"){
|
||||
getdisplay().setFont(&Ubuntu_Bold20pt8b);
|
||||
getdisplay().setCursor(170, 105);
|
||||
epd->setFont(&Ubuntu_Bold20pt8b);
|
||||
epd->setCursor(170, 105);
|
||||
}
|
||||
else{
|
||||
getdisplay().setFont(&DSEG7Classic_BoldItalic42pt7b);
|
||||
getdisplay().setCursor(180, 130);
|
||||
epd->setFont(&DSEG7Classic_BoldItalic42pt7b);
|
||||
epd->setCursor(180, 130);
|
||||
}
|
||||
|
||||
// Show bus data
|
||||
if(holdvalues == false){
|
||||
getdisplay().print(svalue1); // Real value as formated string
|
||||
epd->print(svalue1); // Real value as formated string
|
||||
}
|
||||
else{
|
||||
getdisplay().print(svalue1old); // Old value as formated string
|
||||
epd->print(svalue1old); // Old value as formated string
|
||||
}
|
||||
if(valid1 == true){
|
||||
svalue1old = svalue1; // Save the old value
|
||||
@@ -121,45 +122,45 @@ class PageTwoValues : public Page
|
||||
// ############### Horizontal Line ################
|
||||
|
||||
// Horizontal line 3 pix
|
||||
getdisplay().fillRect(0, 145, 400, 3, commonData->fgcolor);
|
||||
epd->fillRect(0, 145, 400, 3, commonData->fgcolor);
|
||||
|
||||
// ############### Value 2 ################
|
||||
|
||||
// Show name
|
||||
getdisplay().setFont(&Ubuntu_Bold20pt8b);
|
||||
getdisplay().setCursor(20, 190);
|
||||
getdisplay().print(name2); // Page name
|
||||
epd->setFont(&Ubuntu_Bold20pt8b);
|
||||
epd->setCursor(20, 190);
|
||||
epd->print(name2); // Page name
|
||||
|
||||
// Show unit
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt8b);
|
||||
getdisplay().setCursor(20, 240);
|
||||
epd->setFont(&Ubuntu_Bold12pt8b);
|
||||
epd->setCursor(20, 240);
|
||||
if(holdvalues == false){
|
||||
getdisplay().print(unit2); // Unit
|
||||
epd->print(unit2); // Unit
|
||||
}
|
||||
else{
|
||||
getdisplay().print(unit2old);
|
||||
epd->print(unit2old);
|
||||
}
|
||||
|
||||
// Switch font if format for any values
|
||||
if(bvalue2->getFormat() == "formatLatitude" || bvalue2->getFormat() == "formatLongitude"){
|
||||
getdisplay().setFont(&Ubuntu_Bold20pt8b);
|
||||
getdisplay().setCursor(50, 240);
|
||||
epd->setFont(&Ubuntu_Bold20pt8b);
|
||||
epd->setCursor(50, 240);
|
||||
}
|
||||
else if(bvalue2->getFormat() == "formatTime" || bvalue2->getFormat() == "formatDate"){
|
||||
getdisplay().setFont(&Ubuntu_Bold20pt8b);
|
||||
getdisplay().setCursor(170, 215);
|
||||
epd->setFont(&Ubuntu_Bold20pt8b);
|
||||
epd->setCursor(170, 215);
|
||||
}
|
||||
else{
|
||||
getdisplay().setFont(&DSEG7Classic_BoldItalic42pt7b);
|
||||
getdisplay().setCursor(180, 240);
|
||||
epd->setFont(&DSEG7Classic_BoldItalic42pt7b);
|
||||
epd->setCursor(180, 240);
|
||||
}
|
||||
|
||||
// Show bus data
|
||||
if(holdvalues == false){
|
||||
getdisplay().print(svalue2); // Real value as formated string
|
||||
epd->print(svalue2); // Real value as formated string
|
||||
}
|
||||
else{
|
||||
getdisplay().print(svalue2old); // Old value as formated string
|
||||
epd->print(svalue2old); // Old value as formated string
|
||||
}
|
||||
if(valid2 == true){
|
||||
svalue2old = svalue2; // Save the old value
|
||||
|
||||
Reference in New Issue
Block a user