mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-15 23:13:07 +01:00
Footer function for improved key labels, icons implemented
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "GwApi.h"
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include "LedSpiTask.h"
|
||||
|
||||
#define MAX_PAGE_NUMBER 10 // Max number of pages for show data
|
||||
|
||||
@@ -63,12 +64,30 @@ typedef struct{
|
||||
bool sunDown = true;
|
||||
} SunData;
|
||||
|
||||
typedef struct{
|
||||
String label = "";
|
||||
bool selected = false; // for virtual keyboard function
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
uint16_t w;
|
||||
uint16_t h;
|
||||
} TouchKeyData;
|
||||
|
||||
typedef struct{
|
||||
Color color; // red, orange, yellow, green, blue, aqua, violet, white
|
||||
BacklightMode mode; // off, on, sun, bus, time, key
|
||||
uint8_t brightness; // 0% (off), user setting from 20% to 100% full power
|
||||
bool on; // fast on/off detector
|
||||
} BacklightData;
|
||||
|
||||
typedef struct{
|
||||
GwApi::Status status;
|
||||
GwLog *logger=NULL;
|
||||
GwConfigHandler *config=NULL;
|
||||
SensorData data;
|
||||
SunData sundata;
|
||||
TouchKeyData keydata[6];
|
||||
BacklightData backlight;
|
||||
GwApi::BoatValue *time=NULL;
|
||||
GwApi::BoatValue *date=NULL;
|
||||
uint16_t fgcolor;
|
||||
@@ -83,6 +102,18 @@ class Page{
|
||||
public:
|
||||
virtual void displayPage(PageData &pageData)=0;
|
||||
virtual void displayNew(PageData &pageData){}
|
||||
virtual void setupKeys() {
|
||||
commonData->keydata[0].label = "";
|
||||
commonData->keydata[1].label = "";
|
||||
commonData->keydata[2].label = "#LEFT";
|
||||
commonData->keydata[3].label = "#RIGHT";
|
||||
commonData->keydata[4].label = "";
|
||||
if (commonData->backlight.mode == KEY) {
|
||||
commonData->keydata[5].label = "ILUM";
|
||||
} else {
|
||||
commonData->keydata[5].label = "";
|
||||
}
|
||||
}
|
||||
//return -1 if handled by the page
|
||||
virtual int handleKey(int key){return key;}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user