diff --git a/lib/obp60task/PageFluid.cpp b/lib/obp60task/PageFluid.cpp index 9d4a092..c01e83b 100644 --- a/lib/obp60task/PageFluid.cpp +++ b/lib/obp60task/PageFluid.cpp @@ -59,11 +59,13 @@ static unsigned char gasoline_bits[] = { class PageFluid : public Page{ bool keylock = false; // Keylock + bool holdvalues = false; int fluidtype; public: PageFluid(CommonData &common){ common.logger->logDebug(GwLog::LOG,"Instantiate PageFluid"); + holdvalues = common.config->getBool(common.config->holdvalues); } virtual int handleKey(int key){ @@ -83,6 +85,9 @@ class PageFluid : public Page{ GwConfigHandler *config = commonData.config; GwLog *logger=commonData.logger; + // Old values for hold function + static double value1old; + // Get config data String flashLED = config->getString(config->flashLED); String backlightMode = config->getString(config->backlight); @@ -93,13 +98,14 @@ class PageFluid : public Page{ setFlashLED(false); } - // Logging boat values - LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid"); - GwApi::BoatValue *bvalue1 = pageData.values[0]; String name1 = bvalue1->getName(); - double value1 = bvalue1->value; - bool valid1 = bvalue1->valid; + if (holdvalues and bvalue1->valid) { + value1old = bvalue1->value; + } + + // Logging boat values + LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid: value=%f", bvalue1->value); // Draw page //*********************************************************** diff --git a/lib/obp60task/config.json b/lib/obp60task/config.json index 30dbb76..49ac39d 100644 --- a/lib/obp60task/config.json +++ b/lib/obp60task/config.json @@ -1012,6 +1012,9 @@ }, { "page1type": "WindRoseFlex" + }, + { + "page1type": "Fluid" } ] }, @@ -1266,7 +1269,11 @@ }, { "page2type": "WindRoseFlex" + }, + { + "page2type": "Fluid" } + ] }, { @@ -1517,6 +1524,9 @@ }, { "page3type": "WindRoseFlex" + }, + { + "page3type": "Fluid" } ] }, @@ -1765,6 +1775,9 @@ }, { "page4type": "WindRoseFlex" + }, + { + "page4type": "Fluid" } ] }, @@ -2010,6 +2023,9 @@ }, { "page5type": "WindRoseFlex" + }, + { + "page5type": "Fluid" } ] }, @@ -2252,6 +2268,9 @@ }, { "page6type": "WindRoseFlex" + }, + { + "page6type": "Fluid" } ] }, @@ -2491,6 +2510,9 @@ }, { "page7type": "WindRoseFlex" + }, + { + "page7type": "Fluid" } ] }, @@ -2727,6 +2749,9 @@ }, { "page8type": "WindRoseFlex" + }, + { + "page8type": "Fluid" } ] }, @@ -2960,6 +2985,9 @@ }, { "page9type": "WindRoseFlex" + }, + { + "page9type": "Fluid" } ] }, @@ -3190,6 +3218,9 @@ }, { "page10type": "WindRoseFlex" + }, + { + "page10type": "Fluid" } ] },