Finishing white page (blank page)
This commit is contained in:
		
							parent
							
								
									04287cd7f7
								
							
						
					
					
						commit
						8291631f36
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
);
 | 
			
		||||
| 
						 | 
				
			
			@ -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"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue