1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-03-29 03:16:35 +02:00

Code improvements: commonData, config and logger in page class

This commit is contained in:
2025-08-12 21:35:52 +02:00
parent 15ca3614ba
commit 1ada6e5a82
32 changed files with 285 additions and 368 deletions

View File

@@ -221,9 +221,9 @@ char mode = 'N'; // page mode (N)ormal | (L)ens | e(X)ample
char source = 'A'; // data source (A)pparent | (T)rue
public:
PageWind(CommonData &common){
commonData = &common;
common.logger->logDebug(GwLog::LOG,"Instantiate PageWind");
PageWind(CommonData &common) : Page(common)
{
logger->logDebug(GwLog::LOG, "Instantiate PageWind");
if (hasFRAM) {
lp = fram.read(FRAM_WIND_SIZE);
source = fram.read(FRAM_WIND_SRC);
@@ -231,7 +231,7 @@ public:
}
}
virtual void setupKeys(){
void setupKeys(){
Page::setupKeys();
commonData->keydata[0].label = "MODE";
if (mode == 'X') {
@@ -243,7 +243,7 @@ public:
}
// Key functions
virtual int handleKey(int key){
int handleKey(int key){
if(key == 1){ // Mode switch
if(mode == 'N'){
@@ -297,10 +297,7 @@ public:
return key;
}
int displayPage(PageData &pageData)
{
GwConfigHandler *config = commonData->config;
GwLog *logger = commonData->logger;
int displayPage(PageData &pageData) {
static String svalue1old = "";
static String unit1old = "";