diff --git a/lib/obp60task/PageWhite.cpp b/lib/obp60task/PageWhite.cpp new file mode 100644 index 0000000..3654711 --- /dev/null +++ b/lib/obp60task/PageWhite.cpp @@ -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 +); \ No newline at end of file diff --git a/lib/obp60task/config.json b/lib/obp60task/config.json index 5c051c1..942f8c1 100644 --- a/lib/obp60task/config.json +++ b/lib/obp60task/config.json @@ -492,7 +492,7 @@ "type": "list", "default": "Voltage", "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", "capabilities": { "obp60":"true" @@ -552,7 +552,7 @@ "type": "list", "default": "apparantWind", "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", "capabilities": { "obp60":"true" @@ -613,7 +613,7 @@ "type": "list", "default": "oneValue", "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", "capabilities": { "obp60":"true" @@ -674,7 +674,7 @@ "type": "list", "default": "oneValue", "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", "capabilities": { "obp60":"true" diff --git a/lib/obp60task/obp60task.cpp b/lib/obp60task/obp60task.cpp index 4ca70ed..e6d888f 100644 --- a/lib/obp60task/obp60task.cpp +++ b/lib/obp60task/obp60task.cpp @@ -286,6 +286,8 @@ void registerAllPages(PageList &list){ list.add(®isterPageDST810); extern PageDescription registerPageClock; list.add(®isterPageClock); + extern PageDescription registerPageWhite; + list.add(®isterPageWhite); } // OBP60 Task