mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-13 05:53:06 +01:00
Footer function for improved key labels, icons implemented
This commit is contained in:
@@ -37,20 +37,6 @@ extern const GFXfont DSEG7Classic_BoldItalic30pt7b;
|
||||
extern const GFXfont DSEG7Classic_BoldItalic42pt7b;
|
||||
extern const GFXfont DSEG7Classic_BoldItalic60pt7b;
|
||||
|
||||
// Icons
|
||||
#define icon_width 16
|
||||
#define icon_height 16
|
||||
|
||||
static unsigned char swipe_bits[] PROGMEM = {
|
||||
0x80, 0x03, 0xe0, 0x06, 0xb0, 0x0a, 0xa8, 0x0a, 0xa8, 0x0a, 0xa8, 0x3a,
|
||||
0x28, 0x28, 0x08, 0x28, 0x08, 0x28, 0x08, 0x26, 0x08, 0x21, 0x08, 0x10,
|
||||
0x10, 0x08, 0x10, 0x04, 0x10, 0x04, 0x00, 0x00 };
|
||||
|
||||
static unsigned char lock_bits[] PROGMEM = {
|
||||
0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08,
|
||||
0xfc, 0x3f, 0x04, 0x20, 0x04, 0x20, 0x84, 0x21, 0x84, 0x21, 0x84, 0x21,
|
||||
0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f };
|
||||
|
||||
// Global functions
|
||||
#ifdef DISPLAY_GDEW042T2
|
||||
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> & getdisplay();
|
||||
@@ -85,6 +71,7 @@ void togglePortPin(uint pin); // Toggle extension port pin
|
||||
Color colorMapping(const String &colorString); // Color mapping string to CHSV colors
|
||||
void setBacklightLED(uint brightness, const Color &color);// Set backlight LEDs
|
||||
void toggleBacklightLED(uint brightness,const Color &color);// Toggle backlight LEDs
|
||||
BacklightMode backlightMapping(const String &backlightString);// Configuration string to value
|
||||
|
||||
void setFlashLED(bool status); // Set flash LED
|
||||
void blinkingFlashLED(); // Blinking function for flash LED
|
||||
@@ -102,6 +89,7 @@ void displayTrendHigh(int16_t x, int16_t y, uint16_t size, uint16_t color);
|
||||
void displayTrendLow(int16_t x, int16_t y, uint16_t size, uint16_t color);
|
||||
|
||||
void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatValue *time, GwApi::BoatValue *hdop); // Draw display header
|
||||
void displayFooter(CommonData &commonData);
|
||||
|
||||
SunData calcSunsetSunrise(GwApi *api, double time, double date, double latitude, double longitude, double timezone); // Calulate sunset and sunrise
|
||||
|
||||
@@ -112,11 +100,68 @@ void startLedTask(GwApi *api);
|
||||
|
||||
void doImageRequest(GwApi *api, int *pageno, const PageStruct pages[MAX_PAGE_NUMBER], AsyncWebServerRequest *request);
|
||||
|
||||
#define fram_width 16
|
||||
#define fram_height 16
|
||||
// Icons
|
||||
#define icon_width 16
|
||||
#define icon_height 16
|
||||
|
||||
static unsigned char left_bits[] PROGMEM = {
|
||||
0x00, 0x00, 0xc0, 0x01, 0xe0, 0x01, 0xf0, 0x01, 0xf8, 0x01, 0xfc, 0x7f,
|
||||
0xfe, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xfe, 0x7f, 0xfc, 0x7f, 0xf8, 0x01,
|
||||
0xf0, 0x01, 0xe0, 0x01, 0xc0, 0x01, 0x00, 0x00 };
|
||||
|
||||
static unsigned char right_bits[] PROGMEM = {
|
||||
0x00, 0x00, 0x80, 0x03, 0x80, 0x07, 0x80, 0x0f, 0x80, 0x1f, 0xfe, 0x3f,
|
||||
0xfe, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0x80, 0x1f,
|
||||
0x80, 0x0f, 0x80, 0x07, 0x80, 0x03, 0x00, 0x00 };
|
||||
|
||||
static unsigned char swipe_bits[] PROGMEM = {
|
||||
0x80, 0x03, 0xe0, 0x06, 0xb0, 0x0a, 0xa8, 0x0a, 0xa8, 0x0a, 0xa8, 0x3a,
|
||||
0x28, 0x28, 0x08, 0x28, 0x08, 0x28, 0x08, 0x26, 0x08, 0x21, 0x08, 0x10,
|
||||
0x10, 0x08, 0x10, 0x04, 0x10, 0x04, 0x00, 0x00 };
|
||||
|
||||
static unsigned char lock_bits[] PROGMEM = {
|
||||
0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08,
|
||||
0xfc, 0x3f, 0x04, 0x20, 0x04, 0x20, 0x84, 0x21, 0x84, 0x21, 0x84, 0x21,
|
||||
0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f };
|
||||
|
||||
static unsigned char plus_bits[] = {
|
||||
0x00, 0x00, 0xe0, 0x01, 0x18, 0x06, 0x04, 0x08, 0xc4, 0x08, 0xc2, 0x10,
|
||||
0xf2, 0x13, 0xf2, 0x13, 0xc2, 0x10, 0xc4, 0x08, 0x04, 0x0c, 0x18, 0x1e,
|
||||
0xe0, 0x39, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0 };
|
||||
|
||||
static unsigned char minus_bits[] = {
|
||||
0x00, 0x00, 0xe0, 0x01, 0x18, 0x06, 0x04, 0x08, 0x04, 0x08, 0x02, 0x10,
|
||||
0xf2, 0x13, 0xf2, 0x13, 0x02, 0x10, 0x04, 0x08, 0x04, 0x0c, 0x18, 0x1e,
|
||||
0xe0, 0x39, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0 };
|
||||
|
||||
static unsigned char fram_bits[] = {
|
||||
0xf8, 0x1f, 0xff, 0xff, 0x9f, 0xff, 0x98, 0x1f, 0xf8, 0x1f, 0xff, 0xff,
|
||||
0xff, 0xff, 0xf8, 0x1f, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f,
|
||||
0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f };
|
||||
|
||||
static std::map<String, unsigned char *> iconmap = {
|
||||
{"LEFT", left_bits},
|
||||
{"RIGHT", right_bits},
|
||||
{"SWIPE", swipe_bits},
|
||||
{"LOCK", lock_bits},
|
||||
{"PLUS", plus_bits},
|
||||
{"MINUS", minus_bits}
|
||||
};
|
||||
|
||||
// Other symbols
|
||||
#define exclamation_width 32
|
||||
#define exclamation_height 32
|
||||
static unsigned char exclamation_bits[] = {
|
||||
0x00, 0xc0, 0x03, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0xb0, 0x0d, 0x00,
|
||||
0x00, 0xd8, 0x1b, 0x00, 0x00, 0xec, 0x37, 0x00, 0x00, 0xf6, 0x6f, 0x00,
|
||||
0x00, 0x3b, 0xdc, 0x00, 0x80, 0x3d, 0xbc, 0x01, 0xc0, 0x3e, 0x7c, 0x03,
|
||||
0x60, 0x3f, 0xfc, 0x06, 0xb0, 0x3f, 0xfc, 0x0d, 0xd8, 0x3f, 0xfc, 0x1b,
|
||||
0xec, 0x3f, 0xfc, 0x37, 0xf6, 0x3f, 0xfc, 0x6f, 0xfb, 0x3f, 0xfc, 0xdf,
|
||||
0xfd, 0x3f, 0xfc, 0xbf, 0xfd, 0x3f, 0xfc, 0xbf, 0xfb, 0x3f, 0xfc, 0xdf,
|
||||
0xf6, 0x3f, 0xfc, 0x6f, 0xec, 0x3f, 0xfc, 0x37, 0xd8, 0xff, 0xff, 0x1b,
|
||||
0xb0, 0xff, 0xff, 0x0d, 0x60, 0x3f, 0xfc, 0x06, 0xc0, 0x3e, 0x7c, 0x03,
|
||||
0x80, 0x3d, 0xbc, 0x01, 0x00, 0x3b, 0xdc, 0x00, 0x00, 0xf6, 0x6f, 0x00,
|
||||
0x00, 0xec, 0x37, 0x00, 0x00, 0xd8, 0x1b, 0x00, 0x00, 0xb0, 0x0d, 0x00,
|
||||
0x00, 0x60, 0x06, 0x00, 0x00, 0xc0, 0x03, 0x00 };
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user