1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-03-29 03:16:35 +02:00

Calibration feature switchable as compiler option,

new page code example by page windrose
This commit is contained in:
2025-08-29 19:21:29 +02:00
parent 9a04029cb4
commit 601d56ee49
14 changed files with 191 additions and 113 deletions

View File

@@ -3,7 +3,10 @@
#include "Pagedata.h"
#include "OBP60Extensions.h"
#ifdef ENABLE_CALIBRATION
#include "BoatDataCalibration.h"
#endif
class PageRudderPosition : public Page
{
@@ -49,7 +52,9 @@ public:
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list
String name1 = bvalue1->getName().c_str(); // Value name
name1 = name1.substring(0, 6); // String length limit for value name
#ifdef ENABLE_CALIBRATION
calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
#endif
value1 = bvalue1->value; // Raw value without unit convertion
bool valid1 = bvalue1->valid; // Valid information
String svalue1 = commonData->fmt->formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@@ -67,8 +72,7 @@ public:
}
}
// Logging boat values
if (bvalue1 == NULL) return PAGE_OK; // WTF why this statement?
// Log boat values
logger->logDebug(GwLog::LOG, "Drawing at PageRudderPosition, %s:%f", name1.c_str(), value1);
// Draw page