Finishing white page (blank page)

This commit is contained in:
norbert-walter 2022-03-10 09:08:13 +01:00
parent 04287cd7f7
commit 8291631f36
3 changed files with 65 additions and 4 deletions

View File

@ -0,0 +1,59 @@
#include "Pagedata.h"
#include "OBP60ExtensionPort.h"
class PageWhite : public Page{
bool keylock = false; // Keylock
public:
PageWhite(CommonData &common){
common.logger->logDebug(GwLog::LOG,"Show PageWhite");
}
virtual void displayPage(CommonData &commonData, PageData &pageData){
GwConfigHandler *config = commonData.config;
GwLog *logger=commonData.logger;
// Get config data
String flashLED = config->getString(config->flashLED);
// Optical warning by limit violation (unused)
if(String(flashLED) == "Limit Violation"){
setBlinkingLED(false);
setPortPin(OBP_FLASH_LED, false);
}
// Logging boat values
LOG_DEBUG(GwLog::LOG,"Drawing at PageWhite");
// Draw page
//***********************************************************
// Set background color
int bgcolor = GxEPD_WHITE;
// Clear display by call in obp60task.cpp in main loop
// Update display
display.fillRect(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, bgcolor); // Draw white sreen
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, true); // Partial update (fast)
};
};
static Page* createPage(CommonData &common){
return new PageWhite(common);
}
/**
* with the code below we make this page known to the PageTask
* we give it a type (name) that can be selected in the config
* we define which function is to be called
* and we provide the number of user parameters we expect
* this will be number of BoatValue pointers in pageData.values
*/
PageDescription registerPageWhite(
"WhitePage", // Page name
createPage, // Action
0, // Number of bus values depends on selection in Web configuration
false // Show display header on/off
);

View File

@ -492,7 +492,7 @@
"type": "list", "type": "list",
"default": "Voltage", "default": "Voltage",
"description": "Type of page for page 1", "description": "Type of page for page 1",
"list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock"], "list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock","WhitePage"],
"category": "OBP60 Page 1", "category": "OBP60 Page 1",
"capabilities": { "capabilities": {
"obp60":"true" "obp60":"true"
@ -552,7 +552,7 @@
"type": "list", "type": "list",
"default": "apparantWind", "default": "apparantWind",
"description": "Type of page for page 2", "description": "Type of page for page 2",
"list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock"], "list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock","WhitePage"],
"category": "OBP60 Page 2", "category": "OBP60 Page 2",
"capabilities": { "capabilities": {
"obp60":"true" "obp60":"true"
@ -613,7 +613,7 @@
"type": "list", "type": "list",
"default": "oneValue", "default": "oneValue",
"description": "Type of page for page 3", "description": "Type of page for page 3",
"list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock"], "list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock","WhitePage"],
"category": "OBP60 Page 3", "category": "OBP60 Page 3",
"capabilities": { "capabilities": {
"obp60":"true" "obp60":"true"
@ -674,7 +674,7 @@
"type": "list", "type": "list",
"default": "oneValue", "default": "oneValue",
"description": "Type of page for page 4", "description": "Type of page for page 4",
"list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock"], "list":["oneValue","twoValues","threeValues","forValues","forValues2","apparentWind","WindRose","Voltage","DST810","Clock","WhitePage"],
"category": "OBP60 Page 4", "category": "OBP60 Page 4",
"capabilities": { "capabilities": {
"obp60":"true" "obp60":"true"

View File

@ -286,6 +286,8 @@ void registerAllPages(PageList &list){
list.add(&registerPageDST810); list.add(&registerPageDST810);
extern PageDescription registerPageClock; extern PageDescription registerPageClock;
list.add(&registerPageClock); list.add(&registerPageClock);
extern PageDescription registerPageWhite;
list.add(&registerPageWhite);
} }
// OBP60 Task // OBP60 Task