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