Merge pull request #137 from thooge/master

Fix missing data bindings for page fluid
This commit is contained in:
Norbert Walter 2025-01-12 23:56:02 +01:00 committed by GitHub
commit bbdbe47972
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 42 additions and 5 deletions

View File

@ -59,11 +59,13 @@ static unsigned char gasoline_bits[] = {
class PageFluid : public Page{ class PageFluid : public Page{
bool keylock = false; // Keylock bool keylock = false; // Keylock
bool holdvalues = false;
int fluidtype; int fluidtype;
public: public:
PageFluid(CommonData &common){ PageFluid(CommonData &common){
common.logger->logDebug(GwLog::LOG,"Instantiate PageFluid"); common.logger->logDebug(GwLog::LOG,"Instantiate PageFluid");
holdvalues = common.config->getBool(common.config->holdvalues);
} }
virtual int handleKey(int key){ virtual int handleKey(int key){
@ -83,6 +85,9 @@ class PageFluid : public Page{
GwConfigHandler *config = commonData.config; GwConfigHandler *config = commonData.config;
GwLog *logger=commonData.logger; GwLog *logger=commonData.logger;
// Old values for hold function
static double value1old;
// Get config data // Get config data
String flashLED = config->getString(config->flashLED); String flashLED = config->getString(config->flashLED);
String backlightMode = config->getString(config->backlight); String backlightMode = config->getString(config->backlight);
@ -93,13 +98,14 @@ class PageFluid : public Page{
setFlashLED(false); setFlashLED(false);
} }
// Logging boat values
LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid");
GwApi::BoatValue *bvalue1 = pageData.values[0]; GwApi::BoatValue *bvalue1 = pageData.values[0];
String name1 = bvalue1->getName(); String name1 = bvalue1->getName();
double value1 = bvalue1->value; if (holdvalues and bvalue1->valid) {
bool valid1 = bvalue1->valid; value1old = bvalue1->value;
}
// Logging boat values
LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid: value=%f", bvalue1->value);
// Draw page // Draw page
//*********************************************************** //***********************************************************

View File

@ -1012,6 +1012,9 @@
}, },
{ {
"page1type": "WindRoseFlex" "page1type": "WindRoseFlex"
},
{
"page1type": "Fluid"
} }
] ]
}, },
@ -1266,7 +1269,11 @@
}, },
{ {
"page2type": "WindRoseFlex" "page2type": "WindRoseFlex"
},
{
"page2type": "Fluid"
} }
] ]
}, },
{ {
@ -1517,6 +1524,9 @@
}, },
{ {
"page3type": "WindRoseFlex" "page3type": "WindRoseFlex"
},
{
"page3type": "Fluid"
} }
] ]
}, },
@ -1765,6 +1775,9 @@
}, },
{ {
"page4type": "WindRoseFlex" "page4type": "WindRoseFlex"
},
{
"page4type": "Fluid"
} }
] ]
}, },
@ -2010,6 +2023,9 @@
}, },
{ {
"page5type": "WindRoseFlex" "page5type": "WindRoseFlex"
},
{
"page5type": "Fluid"
} }
] ]
}, },
@ -2252,6 +2268,9 @@
}, },
{ {
"page6type": "WindRoseFlex" "page6type": "WindRoseFlex"
},
{
"page6type": "Fluid"
} }
] ]
}, },
@ -2491,6 +2510,9 @@
}, },
{ {
"page7type": "WindRoseFlex" "page7type": "WindRoseFlex"
},
{
"page7type": "Fluid"
} }
] ]
}, },
@ -2727,6 +2749,9 @@
}, },
{ {
"page8type": "WindRoseFlex" "page8type": "WindRoseFlex"
},
{
"page8type": "Fluid"
} }
] ]
}, },
@ -2960,6 +2985,9 @@
}, },
{ {
"page9type": "WindRoseFlex" "page9type": "WindRoseFlex"
},
{
"page9type": "Fluid"
} }
] ]
}, },
@ -3190,6 +3218,9 @@
}, },
{ {
"page10type": "WindRoseFlex" "page10type": "WindRoseFlex"
},
{
"page10type": "Fluid"
} }
] ]
}, },