1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 15:03:07 +01:00

Footer function for improved key labels, icons implemented

This commit is contained in:
2025-01-15 18:08:39 +01:00
parent e7db5038fb
commit 519af68bef
28 changed files with 620 additions and 300 deletions

View File

@@ -22,6 +22,14 @@ public:
mode = fram.read(FRAM_VOLTAGE_MODE);
}
}
virtual void setupKeys(){
Page::setupKeys();
commonData->keydata[0].label = "AVG";
commonData->keydata[1].label = "MODE";
commonData->keydata[4].label = "TRD";
}
virtual int handleKey(int key){
// Change average
if(key == 1){
@@ -242,10 +250,8 @@ public:
}
}
// Trend indicator
// Show trend indicator
if(trend == true){
getdisplay().fillRect(310, 240, 40, 120, commonData->bgcolor); // Clear area
getdisplay().fillRect(315, 183, 35, 4, commonData->fgcolor); // Draw separator
if(int(raw * 10) > int(valueTrend * 10)){
displayTrendHigh(320, 174, 11, commonData->fgcolor); // Show high indicator
@@ -254,10 +260,6 @@ public:
displayTrendLow(320, 195, 11, commonData->fgcolor); // Show low indicator
}
}
// No trend indicator
else{
getdisplay().fillRect(310, 240, 40, 120, commonData->bgcolor); // Clear area
}
}
else {
@@ -360,27 +362,11 @@ public:
// FRAM indicator
if (hasFRAM) {
getdisplay().drawXBitmap(300, 240, fram_bits, fram_width, fram_height, commonData->fgcolor);
getdisplay().drawXBitmap(300, 240, fram_bits, icon_width, icon_height, commonData->fgcolor);
}
}
// Key Layout
getdisplay().setTextColor(commonData->fgcolor);
getdisplay().setFont(&Ubuntu_Bold8pt7b);
if(commonData->keylock == false){
getdisplay().setCursor(10, 290);
getdisplay().print("[AVG]");
getdisplay().setCursor(62, 290);
getdisplay().print("[MODE]");
getdisplay().setCursor(293, 290);
getdisplay().print("[TRD]");
if(String(backlightMode) == "Control by Key"){ // Key for illumination
getdisplay().setCursor(343, 290);
getdisplay().print("[ILUM]");
}
}
// Update display
getdisplay().nextPage(); // Partial update (fast)
};