mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-15 15:03:07 +01:00
first new version with new structures
This commit is contained in:
29
lib/obp60task/PageOneValue.cpp
Normal file
29
lib/obp60task/PageOneValue.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "Pagedata.h"
|
||||
|
||||
class PageOneValue : public Page{
|
||||
public:
|
||||
virtual void display(CommonData &commonData, PageData &pageData){
|
||||
GwLog *logger=commonData.logger;
|
||||
GwApi::BoatValue *value=pageData.values[0];
|
||||
if (value == NULL) return;
|
||||
LOG_DEBUG(GwLog::LOG,"drawing at PageOneValue, p=%s,v=%f",
|
||||
value->getName().c_str(),
|
||||
value->valid?value->value:-1.0
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
static Page* createPage(CommonData &common){return new PageOneValue();}
|
||||
|
||||
/**
|
||||
* 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 registerPageOneValue(
|
||||
"oneValue",
|
||||
createPage,
|
||||
1
|
||||
);
|
||||
Reference in New Issue
Block a user