Merge branch 'master' into master

This commit is contained in:
Norbert Walter 2025-07-03 16:37:39 +02:00 committed by GitHub
commit 8a069b9445
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 431 additions and 128 deletions

View File

@ -6,12 +6,13 @@
#include <unordered_map> #include <unordered_map>
CalibrationDataList calibrationData; CalibrationDataList calibrationData;
std::unordered_map<std::string, TypeCalibData> CalibrationDataList::calibMap; // list of calibration data instances
void CalibrationDataList::readConfig(GwConfigHandler* config, GwLog* logger) void CalibrationDataList::readConfig(GwConfigHandler* config, GwLog* logger)
// Initial load of calibration data into internal list // Initial load of calibration data into internal list
// This method is called once at init phase of <OBP60task> to read the configuration values // This method is called once at init phase of <obp60task> to read the configuration values
{ {
String instance; std::string instance;
double offset; double offset;
double slope; double slope;
double smooth; double smooth;
@ -29,21 +30,21 @@ void CalibrationDataList::readConfig(GwConfigHandler* config, GwLog* logger)
String tempFormat = config->getString(config->tempFormat); // [K|C|F] String tempFormat = config->getString(config->tempFormat); // [K|C|F]
// Read calibration settings for data instances // Read calibration settings for data instances
for (int i = 0; i < maxCalibrationData; i++) { for (int i = 0; i < MAX_CALIBRATION_DATA; i++) {
calInstance = "calInstance" + String(i + 1); calInstance = "calInstance" + String(i + 1);
calOffset = "calOffset" + String(i + 1); calOffset = "calOffset" + String(i + 1);
calSlope = "calSlope" + String(i + 1); calSlope = "calSlope" + String(i + 1);
calSmooth = "calSmooth" + String(i + 1); calSmooth = "calSmooth" + String(i + 1);
calibrationData.list[i] = { "---", 0.0f, 1.0f, 1, 0.0f, false };
instance = config->getString(calInstance, "---"); instance = std::string(config->getString(calInstance, "---").c_str());
if (instance == "---") { if (instance == "---") {
LOG_DEBUG(GwLog::LOG, "no calibration data for instance no. %d", i + 1); LOG_DEBUG(GwLog::LOG, "no calibration data for instance no. %d", i + 1);
continue; continue;
} }
calibMap[instance] = { 0.0f, 1.0f, 1.0f, 0.0f, false };
offset = (config->getString(calOffset, "")).toFloat(); offset = (config->getString(calOffset, "")).toFloat();
slope = (config->getString(calSlope, "")).toFloat(); slope = (config->getString(calSlope, "")).toFloat();
smooth = (config->getString(calSmooth, "")).toInt(); smooth = (config->getString(calSmooth, "")).toInt(); // user input is int; further math is done with double
// Convert calibration values to internal standard formats // Convert calibration values to internal standard formats
if (instance == "AWS" || instance == "TWS") { if (instance == "AWS" || instance == "TWS") {
@ -54,10 +55,10 @@ void CalibrationDataList::readConfig(GwConfigHandler* config, GwLog* logger)
} else if (windspeedFormat == "kn") { } else if (windspeedFormat == "kn") {
offset /= 1.94384; // Convert kn to m/s offset /= 1.94384; // Convert kn to m/s
} else if (windspeedFormat == "bft") { } else if (windspeedFormat == "bft") {
offset *= 0.5; // Convert Bft to m/s (approx) -> to be improved offset *= 2 + (offset / 2); // Convert Bft to m/s (approx) -> to be improved
} }
} else if (instance == "AWA" || instance == "TWA" || instance == "TWD" || instance == "HDM" || instance == "PRPOS" || instance == "RPOS") { } else if (instance == "AWA" || instance == "COG" || instance == "TWA" || instance == "TWD" || instance == "HDM" || instance == "PRPOS" || instance == "RPOS") {
offset *= M_PI / 180; // Convert deg to rad offset *= M_PI / 180; // Convert deg to rad
} else if (instance == "DBT") { } else if (instance == "DBT") {
@ -67,7 +68,7 @@ void CalibrationDataList::readConfig(GwConfigHandler* config, GwLog* logger)
offset /= 3.28084; // Convert ft to m offset /= 3.28084; // Convert ft to m
} }
} else if (instance == "STW") { } else if (instance == "SOG" || instance == "STW") {
if (speedFormat == "m/s") { if (speedFormat == "m/s") {
// No conversion needed // No conversion needed
} else if (speedFormat == "km/h") { } else if (speedFormat == "km/h") {
@ -92,112 +93,100 @@ void CalibrationDataList::readConfig(GwConfigHandler* config, GwLog* logger)
if (smooth > 10) { if (smooth > 10) {
smooth = 10; smooth = 10;
} }
// calibrationData.list[i].smooth = 1 - (smooth / 10.0); // smooth factor is between 0 and 1
smooth = 0.3 + ((smooth - 0.01) * (0.95 - 0.3) / (10 - 0.01)); smooth = 0.3 + ((smooth - 0.01) * (0.95 - 0.3) / (10 - 0.01));
} }
smooth = 1 - smooth; smooth = 1 - smooth;
calibrationData.list[i].instance = instance; calibMap[instance].offset = offset;
calibrationData.list[i].offset = offset; calibMap[instance].slope = slope;
calibrationData.list[i].slope = slope; calibMap[instance].smooth = smooth;
calibrationData.list[i].smooth = smooth; calibMap[instance].isCalibrated = false;
calibrationData.list[i].isCalibrated = false; LOG_DEBUG(GwLog::LOG, "stored calibration data: %s, offset: %f, slope: %f, smoothing: %f", instance.c_str(),
LOG_DEBUG(GwLog::LOG, "stored calibration data: %s, offset: %f, slope: %f, smoothing: %f", calibrationData.list[i].instance.c_str(), calibMap[instance].offset, calibMap[instance].slope, calibMap[instance].smooth);
calibrationData.list[i].offset, calibrationData.list[i].slope, calibrationData.list[i].smooth);
} }
LOG_DEBUG(GwLog::LOG, "all calibration data read"); LOG_DEBUG(GwLog::LOG, "all calibration data read");
} }
int CalibrationDataList::getInstanceListNo(String instance) void CalibrationDataList::calibrateInstance(GwApi::BoatValue* boatDataValue, GwLog* logger)
// Method to get the index of the requested instance in the list
{
// Check if instance is in the list
for (int i = 0; i < maxCalibrationData; i++) {
if (calibrationData.list[i].instance == instance) {
return i;
}
}
return -1; // instance not found
}
/* void CalibrationDataList::updateBoatDataValidity(String instance)
{
for (int i = 0; i < maxCalibrationData; i++) {
if (calibrationData.list[i].instance == instance) {
// test for boat data value validity - to be implemented
calibrationData.list[i].isValid = true;
return;
}
}
} */
void CalibrationDataList::calibrateInstance(String instance, GwApi::BoatValue* boatDataValue, GwLog* logger)
// Method to calibrate the boat data value // Method to calibrate the boat data value
{ {
std::string instance = boatDataValue->getName().c_str();
double offset = 0; double offset = 0;
double slope = 1.0; double slope = 1.0;
double dataValue = 0; double dataValue = 0;
std::string format = "";
int listNo = getInstanceListNo(instance); if (calibMap.find(instance) == calibMap.end()) {
if (listNo < 0) {
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s not found in calibration data list", instance.c_str()); LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s not found in calibration data list", instance.c_str());
return; return;
} else if (!boatDataValue->valid) { // no valid boat data value, so we don't want to apply calibration data
calibMap[instance].isCalibrated = false;
return;
} else { } else {
offset = calibrationData.list[listNo].offset; offset = calibMap[instance].offset;
slope = calibrationData.list[listNo].slope; slope = calibMap[instance].slope;
dataValue = boatDataValue->value;
format = boatDataValue->getFormat().c_str();
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s: value: %f, format: %s", instance.c_str(), dataValue, format.c_str());
if (!boatDataValue->valid) { // no valid boat data value, so we don't want to apply calibration data if (format == "formatWind") { // instance is of type angle
return; dataValue = (dataValue * slope) + offset;
} else { dataValue = fmod(dataValue, 2 * M_PI);
dataValue = boatDataValue->value; if (dataValue > (M_PI)) {
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s: value: %f, format: %s", boatDataValue->getName().c_str(), boatDataValue->value, boatDataValue->getFormat().c_str()); dataValue -= (2 * M_PI);
} else if (dataValue < (M_PI * -1)) {
if (boatDataValue->getFormat() == "formatWind") { // instance is of type angle dataValue += (2 * M_PI);
dataValue = (dataValue * slope) + offset;
dataValue = fmod(dataValue, 2 * M_PI);
if (dataValue > (M_PI)) {
dataValue -= (2 * M_PI);
} else if (dataValue < (M_PI * -1)) {
dataValue += (2 * M_PI);
}
} else if (boatDataValue->getFormat() == "formatCourse") { // instance is of type direction
dataValue = (dataValue * slope) + offset;
dataValue = fmod(dataValue, 2 * M_PI);
if (dataValue < 0) {
dataValue += (2 * M_PI);
}
} else if (boatDataValue->getFormat() == "kelvinToC") { // instance is of type temperature
dataValue = ((dataValue - 273.15) * slope) + offset + 273.15;
} else {
dataValue = (dataValue * slope) + offset;
} }
} else if (format == "formatCourse") { // instance is of type direction
dataValue = (dataValue * slope) + offset;
dataValue = fmod(dataValue, 2 * M_PI);
if (dataValue < 0) {
dataValue += (2 * M_PI);
}
} else if (format == "kelvinToC") { // instance is of type temperature
dataValue = ((dataValue - 273.15) * slope) + offset + 273.15;
} else {
calibrationData.smoothInstance(instance, dataValue, logger); // smooth the boat data value dataValue = (dataValue * slope) + offset;
calibrationData.list[listNo].value = dataValue;
calibrationData.list[listNo].isCalibrated = true;
boatDataValue->value = dataValue;
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s: Offset: %f, Slope: %f, Result: %f", instance.c_str(), offset, slope, boatDataValue->value);
} }
calibMap[instance].isCalibrated = true;
boatDataValue->value = dataValue;
calibrationData.smoothInstance(boatDataValue, logger); // smooth the boat data value
calibMap[instance].value = boatDataValue->value; // store the calibrated + smoothed value in the list
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s: Offset: %f, Slope: %f, Result: %f", instance.c_str(), offset, slope, calibMap[instance].value);
} }
} }
void CalibrationDataList::smoothInstance(String instance, double& dataValue, GwLog* logger) void CalibrationDataList::smoothInstance(GwApi::BoatValue* boatDataValue, GwLog* logger)
// Method to smoothen the boat data value // Method to smoothen the boat data value
{ {
// array for last values of smoothed boat data values static std::unordered_map<std::string, double> lastValue; // array for last values of smoothed boat data values
static std::unordered_map<std::string, double> lastValue;
std::string instance = boatDataValue->getName().c_str();
double oldValue = 0; double oldValue = 0;
double smoothFactor = calibrationData.list[getInstanceListNo(instance)].smooth; double dataValue = boatDataValue->value;
double smoothFactor = 0;
if (lastValue.find(instance.c_str()) != lastValue.end()) { if (!boatDataValue->valid) { // no valid boat data value, so we don't want to smoothen value
oldValue = lastValue[instance.c_str()]; return;
} else if (calibMap.find(instance) == calibMap.end()) {
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: smooth factor for %s not found in calibration data list", instance.c_str());
return;
} else {
smoothFactor = calibMap[instance].smooth;
dataValue = oldValue + (smoothFactor * (dataValue - oldValue)); // exponential smoothing algorithm if (lastValue.find(instance) != lastValue.end()) {
oldValue = lastValue[instance];
dataValue = oldValue + (smoothFactor * (dataValue - oldValue)); // exponential smoothing algorithm
}
lastValue[instance] = dataValue; // store the new value for next cycle; first time, store only the current value and return
boatDataValue->value = dataValue; // set the smoothed value to the boat data value
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s: Smoothing factor: %f, Smoothed value: %f", instance.c_str(), smoothFactor, dataValue);
} }
lastValue[instance.c_str()] = dataValue; // store the new value for next cycle; first time, store only the current value and return
LOG_DEBUG(GwLog::DEBUG, "BoatDataCalibration: %s: Smoothing factor: %f, Smoothed value: %f", instance.c_str(), smoothFactor, dataValue);
} }
#endif #endif

View File

@ -4,27 +4,26 @@
#define _BOATDATACALIBRATION_H #define _BOATDATACALIBRATION_H
#include "Pagedata.h" #include "Pagedata.h"
#include "WString.h" #include <string>
#include <unordered_map>
#define MAX_CALIBRATION_DATA 3 // maximum number of calibration data instances
typedef struct { typedef struct {
String instance; // data type/instance to be calibrated
double offset; // calibration offset double offset; // calibration offset
double slope; // calibration slope double slope; // calibration slope
double smooth; // smoothing factor double smooth; // smoothing factor
double value; // calibrated data value double value; // calibrated data value
bool isCalibrated; // is data instance value calibrated? bool isCalibrated; // is data instance value calibrated?
} CalibData; } TypeCalibData;
const int maxCalibrationData = 3; // maximum number of calibration data instances
class CalibrationDataList { class CalibrationDataList {
public: public:
CalibData list[maxCalibrationData]; // list of calibration data instances static std::unordered_map<std::string, TypeCalibData> calibMap; // list of calibration data instances
static void readConfig(GwConfigHandler* config, GwLog* logger); void readConfig(GwConfigHandler* config, GwLog* logger);
static int getInstanceListNo(String instance); void calibrateInstance(GwApi::BoatValue* boatDataValue, GwLog* logger);
static void calibrateInstance(String instance, GwApi::BoatValue* boatDataValue, GwLog* logger); void smoothInstance(GwApi::BoatValue* boatDataValue, GwLog* logger);
void smoothInstance(String instance, double &dataValue, GwLog* logger);
private: private:
}; };

View File

@ -46,9 +46,9 @@ class PageFourValues : public Page
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated
String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value
@ -56,9 +56,9 @@ class PageFourValues : public Page
GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue)
String name2 = xdrDelete(bvalue2->getName()); // Value name String name2 = xdrDelete(bvalue2->getName()); // Value name
name2 = name2.substring(0, 6); // String length limit for value name name2 = name2.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue2, logger); // Check if boat data value is to be calibrated
double value2 = bvalue2->value; // Value as double in SI unit double value2 = bvalue2->value; // Value as double in SI unit
bool valid2 = bvalue2->valid; // Valid information bool valid2 = bvalue2->valid; // Valid information
calibrationData.calibrateInstance(name2, bvalue2, logger); // Check if boat data value is to be calibrated
String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value
@ -66,9 +66,9 @@ class PageFourValues : public Page
GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue)
String name3 = xdrDelete(bvalue3->getName()); // Value name String name3 = xdrDelete(bvalue3->getName()); // Value name
name3 = name3.substring(0, 6); // String length limit for value name name3 = name3.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue3, logger); // Check if boat data value is to be calibrated
double value3 = bvalue3->value; // Value as double in SI unit double value3 = bvalue3->value; // Value as double in SI unit
bool valid3 = bvalue3->valid; // Valid information bool valid3 = bvalue3->valid; // Valid information
calibrationData.calibrateInstance(name3, bvalue3, logger); // Check if boat data value is to be calibrated
String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit3 = formatValue(bvalue3, *commonData).unit; // Unit of value String unit3 = formatValue(bvalue3, *commonData).unit; // Unit of value
@ -76,9 +76,9 @@ class PageFourValues : public Page
GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue)
String name4 = xdrDelete(bvalue4->getName()); // Value name String name4 = xdrDelete(bvalue4->getName()); // Value name
name4 = name4.substring(0, 6); // String length limit for value name name4 = name4.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue4, logger); // Check if boat data value is to be calibrated
double value4 = bvalue4->value; // Value as double in SI unit double value4 = bvalue4->value; // Value as double in SI unit
bool valid4 = bvalue4->valid; // Valid information bool valid4 = bvalue4->valid; // Valid information
calibrationData.calibrateInstance(name4, bvalue4, logger); // Check if boat data value is to be calibrated
String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit4 = formatValue(bvalue4, *commonData).unit; // Unit of value String unit4 = formatValue(bvalue4, *commonData).unit; // Unit of value

View File

@ -46,9 +46,9 @@ class PageFourValues2 : public Page
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated
String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value
@ -56,9 +56,9 @@ class PageFourValues2 : public Page
GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue)
String name2 = xdrDelete(bvalue2->getName()); // Value name String name2 = xdrDelete(bvalue2->getName()); // Value name
name2 = name2.substring(0, 6); // String length limit for value name name2 = name2.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue2, logger); // Check if boat data value is to be calibrated
double value2 = bvalue2->value; // Value as double in SI unit double value2 = bvalue2->value; // Value as double in SI unit
bool valid2 = bvalue2->valid; // Valid information bool valid2 = bvalue2->valid; // Valid information
calibrationData.calibrateInstance(name2, bvalue2, logger); // Check if boat data value is to be calibrated
String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value
@ -66,9 +66,9 @@ class PageFourValues2 : public Page
GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue)
String name3 = xdrDelete(bvalue3->getName()); // Value name String name3 = xdrDelete(bvalue3->getName()); // Value name
name3 = name3.substring(0, 6); // String length limit for value name name3 = name3.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue3, logger); // Check if boat data value is to be calibrated
double value3 = bvalue3->value; // Value as double in SI unit double value3 = bvalue3->value; // Value as double in SI unit
bool valid3 = bvalue3->valid; // Valid information bool valid3 = bvalue3->valid; // Valid information
calibrationData.calibrateInstance(name3, bvalue3, logger); // Check if boat data value is to be calibrated
String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit3 = formatValue(bvalue3, *commonData).unit; // Unit of value String unit3 = formatValue(bvalue3, *commonData).unit; // Unit of value
@ -76,9 +76,9 @@ class PageFourValues2 : public Page
GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue)
String name4 = xdrDelete(bvalue4->getName()); // Value name String name4 = xdrDelete(bvalue4->getName()); // Value name
name4 = name4.substring(0, 6); // String length limit for value name name4 = name4.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue4, logger); // Check if boat data value is to be calibrated
double value4 = bvalue4->value; // Value as double in SI unit double value4 = bvalue4->value; // Value as double in SI unit
bool valid4 = bvalue4->valid; // Valid information bool valid4 = bvalue4->valid; // Valid information
calibrationData.calibrateInstance(name4, bvalue4, logger); // Check if boat data value is to be calibrated
String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit4 = formatValue(bvalue4, *commonData).unit; // Unit of value String unit4 = formatValue(bvalue4, *commonData).unit; // Unit of value

View File

@ -40,7 +40,7 @@ class PageOneValue : public Page
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places

View File

@ -41,7 +41,7 @@ public:
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list
String name1 = bvalue1->getName().c_str(); // Value name String name1 = bvalue1->getName().c_str(); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
value1 = bvalue1->value; // Raw value without unit convertion value1 = bvalue1->value; // Raw value without unit convertion
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places

View File

@ -61,8 +61,8 @@ class PageSixValues : public Page
bvalue = pageData.values[i]; bvalue = pageData.values[i];
DataName[i] = xdrDelete(bvalue->getName()); DataName[i] = xdrDelete(bvalue->getName());
DataName[i] = DataName[i].substring(0, 6); // String length limit for value name DataName[i] = DataName[i].substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue, logger); // Check if boat data value is to be calibrated
DataValue[i] = bvalue->value; // Value as double in SI unit DataValue[i] = bvalue->value; // Value as double in SI unit
calibrationData.calibrateInstance(DataName[i], bvalue, logger); // Check if boat data value is to be calibrated
DataValid[i] = bvalue->valid; DataValid[i] = bvalue->valid;
DataText[i] = formatValue(bvalue, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places DataText[i] = formatValue(bvalue, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
DataUnits[i] = formatValue(bvalue, *commonData).unit; DataUnits[i] = formatValue(bvalue, *commonData).unit;
@ -85,9 +85,10 @@ class PageSixValues : public Page
getdisplay().setTextColor(commonData->fgcolor); getdisplay().setTextColor(commonData->fgcolor);
for (int i = 0; i < ( HowManyValues / 2 ); i++){ for (int i = 0; i < ( HowManyValues / 2 ); i++){
// Horizontal line 3 pix if (i < (HowManyValues / 2) - 1) { // Don't draw horizontal line after last line of values -> standard design
getdisplay().fillRect(0, SixValues_y1+i*SixValues_DeltaY, 400, 3, commonData->fgcolor); // Horizontal line 3 pix
getdisplay().fillRect(0, SixValues_y1+(i+1)*SixValues_DeltaY, 400, 3, commonData->fgcolor);
}
for (int j = 0; j < 2; j++){ for (int j = 0; j < 2; j++){
int ValueIndex = i * 2 + j; int ValueIndex = i * 2 + j;
int x0 = SixValues_x1 + j * SixValues_DeltaX; int x0 = SixValues_x1 + j * SixValues_DeltaX;
@ -151,7 +152,6 @@ class PageSixValues : public Page
// Vertical line 3 pix // Vertical line 3 pix
getdisplay().fillRect(SixValues_x1+SixValues_DeltaX-8, SixValues_y1+i*SixValues_DeltaY, 3, SixValues_DeltaY, commonData->fgcolor); getdisplay().fillRect(SixValues_x1+SixValues_DeltaX-8, SixValues_y1+i*SixValues_DeltaY, 3, SixValues_DeltaY, commonData->fgcolor);
} }
getdisplay().fillRect(0, SixValues_y1+3*SixValues_DeltaY, 400, 3, commonData->fgcolor);
// Update display // Update display
getdisplay().nextPage(); // Partial update (fast) getdisplay().nextPage(); // Partial update (fast)

View File

@ -44,9 +44,9 @@ class PageThreeValues : public Page
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated
String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value
@ -54,9 +54,9 @@ class PageThreeValues : public Page
GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue)
String name2 = xdrDelete(bvalue2->getName()); // Value name String name2 = xdrDelete(bvalue2->getName()); // Value name
name2 = name2.substring(0, 6); // String length limit for value name name2 = name2.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue2, logger); // Check if boat data value is to be calibrated
double value2 = bvalue2->value; // Value as double in SI unit double value2 = bvalue2->value; // Value as double in SI unit
bool valid2 = bvalue2->valid; // Valid information bool valid2 = bvalue2->valid; // Valid information
calibrationData.calibrateInstance(name2, bvalue2, logger); // Check if boat data value is to be calibrated
String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value
@ -64,9 +64,9 @@ class PageThreeValues : public Page
GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue)
String name3 = xdrDelete(bvalue3->getName()); // Value name String name3 = xdrDelete(bvalue3->getName()); // Value name
name3 = name3.substring(0, 6); // String length limit for value name name3 = name3.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue3, logger); // Check if boat data value is to be calibrated
double value3 = bvalue3->value; // Value as double in SI unit double value3 = bvalue3->value; // Value as double in SI unit
bool valid3 = bvalue3->valid; // Valid information bool valid3 = bvalue3->valid; // Valid information
calibrationData.calibrateInstance(name3, bvalue3, logger); // Check if boat data value is to be calibrated
String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit3 = formatValue(bvalue3, *commonData).unit; // Unit of value String unit3 = formatValue(bvalue3, *commonData).unit; // Unit of value

View File

@ -42,9 +42,9 @@ class PageTwoValues : public Page
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated
String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value String unit1 = formatValue(bvalue1, *commonData).unit; // Unit of value
@ -52,9 +52,9 @@ class PageTwoValues : public Page
GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue2 = pageData.values[1]; // Second element in list (only one value by PageOneValue)
String name2 = xdrDelete(bvalue2->getName()); // Value name String name2 = xdrDelete(bvalue2->getName()); // Value name
name2 = name2.substring(0, 6); // String length limit for value name name2 = name2.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(bvalue2, logger); // Check if boat data value is to be calibrated
double value2 = bvalue2->value; // Value as double in SI unit double value2 = bvalue2->value; // Value as double in SI unit
bool valid2 = bvalue2->valid; // Valid information bool valid2 = bvalue2->valid; // Valid information
calibrationData.calibrateInstance(name2, bvalue2, logger); // Check if boat data value is to be calibrated
String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value String unit2 = formatValue(bvalue2, *commonData).unit; // Unit of value

View File

@ -324,7 +324,7 @@ public:
} }
String name1 = bvalue1->getName().c_str(); // Value name String name1 = bvalue1->getName().c_str(); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
// bool valid1 = bvalue1->valid; // Valid information // bool valid1 = bvalue1->valid; // Valid information
String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue1 = formatValue(bvalue1, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -338,7 +338,7 @@ public:
} }
String name2 = bvalue2->getName().c_str(); // Value name String name2 = bvalue2->getName().c_str(); // Value name
name2 = name2.substring(0, 6); // String length limit for value name name2 = name2.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name2, bvalue2, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue2, logger); // Check if boat data value is to be calibrated
double value2 = bvalue2->value; // Value as double in SI unit double value2 = bvalue2->value; // Value as double in SI unit
// bool valid2 = bvalue2->valid; // Valid information // bool valid2 = bvalue2->valid; // Valid information
if (simulation) { if (simulation) {

View File

@ -52,7 +52,7 @@ public:
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
value1 = formatValue(bvalue1, *commonData).value;// Format only nesaccery for simulation data for pointer value1 = formatValue(bvalue1, *commonData).value;// Format only nesaccery for simulation data for pointer
@ -67,7 +67,7 @@ public:
GwApi::BoatValue *bvalue2 = pageData.values[1]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue2 = pageData.values[1]; // First element in list (only one value by PageOneValue)
String name2 = xdrDelete(bvalue2->getName()); // Value name String name2 = xdrDelete(bvalue2->getName()); // Value name
name2 = name2.substring(0, 6); // String length limit for value name name2 = name2.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name2, bvalue2, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue2, logger); // Check if boat data value is to be calibrated
double value2 = bvalue2->value; // Value as double in SI unit double value2 = bvalue2->value; // Value as double in SI unit
bool valid2 = bvalue2->valid; // Valid information bool valid2 = bvalue2->valid; // Valid information
String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -81,7 +81,7 @@ public:
GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue)
String name3 = xdrDelete(bvalue3->getName()); // Value name String name3 = xdrDelete(bvalue3->getName()); // Value name
name3 = name3.substring(0, 6); // String length limit for value name name3 = name3.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name3, bvalue3, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue3, logger); // Check if boat data value is to be calibrated
double value3 = bvalue3->value; // Value as double in SI unit double value3 = bvalue3->value; // Value as double in SI unit
bool valid3 = bvalue3->valid; // Valid information bool valid3 = bvalue3->valid; // Valid information
String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -95,7 +95,7 @@ public:
GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue)
String name4 = xdrDelete(bvalue4->getName()); // Value name String name4 = xdrDelete(bvalue4->getName()); // Value name
name4 = name4.substring(0, 6); // String length limit for value name name4 = name4.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name4, bvalue4, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue4, logger); // Check if boat data value is to be calibrated
double value4 = bvalue4->value; // Value as double in SI unit double value4 = bvalue4->value; // Value as double in SI unit
bool valid4 = bvalue4->valid; // Valid information bool valid4 = bvalue4->valid; // Valid information
String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -109,7 +109,7 @@ public:
GwApi::BoatValue *bvalue5 = pageData.values[4]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue5 = pageData.values[4]; // Second element in list (only one value by PageOneValue)
String name5 = xdrDelete(bvalue5->getName()); // Value name String name5 = xdrDelete(bvalue5->getName()); // Value name
name5 = name5.substring(0, 6); // String length limit for value name name5 = name5.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name5, bvalue5, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue5, logger); // Check if boat data value is to be calibrated
double value5 = bvalue5->value; // Value as double in SI unit double value5 = bvalue5->value; // Value as double in SI unit
bool valid5 = bvalue5->valid; // Valid information bool valid5 = bvalue5->valid; // Valid information
String svalue5 = formatValue(bvalue5, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue5 = formatValue(bvalue5, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -123,7 +123,7 @@ public:
GwApi::BoatValue *bvalue6 = pageData.values[5]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue6 = pageData.values[5]; // Second element in list (only one value by PageOneValue)
String name6 = xdrDelete(bvalue6->getName()); // Value name String name6 = xdrDelete(bvalue6->getName()); // Value name
name6 = name6.substring(0, 6); // String length limit for value name name6 = name6.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name6, bvalue6, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue6, logger); // Check if boat data value is to be calibrated
double value6 = bvalue6->value; // Value as double in SI unit double value6 = bvalue6->value; // Value as double in SI unit
bool valid6 = bvalue6->valid; // Valid information bool valid6 = bvalue6->valid; // Valid information
String svalue6 = formatValue(bvalue6, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue6 = formatValue(bvalue6, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places

View File

@ -52,7 +52,7 @@ public:
GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue1 = pageData.values[0]; // First element in list (only one value by PageOneValue)
String name1 = xdrDelete(bvalue1->getName()); // Value name String name1 = xdrDelete(bvalue1->getName()); // Value name
name1 = name1.substring(0, 6); // String length limit for value name name1 = name1.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name1, bvalue1, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue1, logger); // Check if boat data value is to be calibrated
double value1 = bvalue1->value; // Value as double in SI unit double value1 = bvalue1->value; // Value as double in SI unit
bool valid1 = bvalue1->valid; // Valid information bool valid1 = bvalue1->valid; // Valid information
value1 = formatValue(bvalue1, *commonData).value;// Format only nesaccery for simulation data for pointer value1 = formatValue(bvalue1, *commonData).value;// Format only nesaccery for simulation data for pointer
@ -67,7 +67,7 @@ public:
GwApi::BoatValue *bvalue2 = pageData.values[1]; // First element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue2 = pageData.values[1]; // First element in list (only one value by PageOneValue)
String name2 = xdrDelete(bvalue2->getName()); // Value name String name2 = xdrDelete(bvalue2->getName()); // Value name
name2 = name2.substring(0, 6); // String length limit for value name name2 = name2.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name2, bvalue2, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue2, logger); // Check if boat data value is to be calibrated
double value2 = bvalue2->value; // Value as double in SI unit double value2 = bvalue2->value; // Value as double in SI unit
bool valid2 = bvalue2->valid; // Valid information bool valid2 = bvalue2->valid; // Valid information
String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue2 = formatValue(bvalue2, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -81,7 +81,7 @@ public:
GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue3 = pageData.values[2]; // Second element in list (only one value by PageOneValue)
String name3 = xdrDelete(bvalue3->getName()); // Value name String name3 = xdrDelete(bvalue3->getName()); // Value name
name3 = name3.substring(0, 6); // String length limit for value name name3 = name3.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name3, bvalue3, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue3, logger); // Check if boat data value is to be calibrated
double value3 = bvalue3->value; // Value as double in SI unit double value3 = bvalue3->value; // Value as double in SI unit
bool valid3 = bvalue3->valid; // Valid information bool valid3 = bvalue3->valid; // Valid information
String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue3 = formatValue(bvalue3, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -95,7 +95,7 @@ public:
GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue4 = pageData.values[3]; // Second element in list (only one value by PageOneValue)
String name4 = xdrDelete(bvalue4->getName()); // Value name String name4 = xdrDelete(bvalue4->getName()); // Value name
name4 = name4.substring(0, 6); // String length limit for value name name4 = name4.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name4, bvalue4, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue4, logger); // Check if boat data value is to be calibrated
double value4 = bvalue4->value; // Value as double in SI unit double value4 = bvalue4->value; // Value as double in SI unit
bool valid4 = bvalue4->valid; // Valid information bool valid4 = bvalue4->valid; // Valid information
String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue4 = formatValue(bvalue4, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -109,7 +109,7 @@ public:
GwApi::BoatValue *bvalue5 = pageData.values[4]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue5 = pageData.values[4]; // Second element in list (only one value by PageOneValue)
String name5 = xdrDelete(bvalue5->getName()); // Value name String name5 = xdrDelete(bvalue5->getName()); // Value name
name5 = name5.substring(0, 6); // String length limit for value name name5 = name5.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name5, bvalue5, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue5, logger); // Check if boat data value is to be calibrated
double value5 = bvalue5->value; // Value as double in SI unit double value5 = bvalue5->value; // Value as double in SI unit
bool valid5 = bvalue5->valid; // Valid information bool valid5 = bvalue5->valid; // Valid information
String svalue5 = formatValue(bvalue5, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue5 = formatValue(bvalue5, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places
@ -123,7 +123,7 @@ public:
GwApi::BoatValue *bvalue6 = pageData.values[5]; // Second element in list (only one value by PageOneValue) GwApi::BoatValue *bvalue6 = pageData.values[5]; // Second element in list (only one value by PageOneValue)
String name6 = xdrDelete(bvalue6->getName()); // Value name String name6 = xdrDelete(bvalue6->getName()); // Value name
name6 = name6.substring(0, 6); // String length limit for value name name6 = name6.substring(0, 6); // String length limit for value name
calibrationData.calibrateInstance(name6, bvalue6, logger); // Check if boat data value is to be calibrated calibrationData.calibrateInstance(bvalue6, logger); // Check if boat data value is to be calibrated
double value6 = bvalue6->value; // Value as double in SI unit double value6 = bvalue6->value; // Value as double in SI unit
bool valid6 = bvalue6->valid; // Valid information bool valid6 = bvalue6->valid; // Valid information
String svalue6 = formatValue(bvalue6, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places String svalue6 = formatValue(bvalue6, *commonData).svalue; // Formatted value as string including unit conversion and switching decimal places

View File

@ -686,6 +686,321 @@
"obp60":"true" "obp60":"true"
} }
}, },
{
"name": "calInstance1",
"label": "Calibration Data Instance 1",
"type": "list",
"default": "---",
"description": "Data instance for calibration",
"list": [
"---",
"AWA",
"AWS",
"COG",
"DBT",
"HDM",
"PRPOS",
"RPOS",
"SOG",
"STW",
"TWA",
"TWS",
"TWD",
"WTemp"
],
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
}
},
{
"name": "calOffset1",
"label": "Data Instance 1 Calibration Offset",
"type": "number",
"default": "0.00",
"description": "Offset for data instance 1",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance1": "AWA" },
{ "calInstance1": "AWS" },
{ "calInstance2": "COG" },
{ "calInstance1": "DBT" },
{ "calInstance1": "HDM" },
{ "calInstance1": "PRPOS" },
{ "calInstance1": "RPOS" },
{ "calInstance1": "SOG" },
{ "calInstance1": "STW" },
{ "calInstance1": "TWA" },
{ "calInstance1": "TWS" },
{ "calInstance1": "TWD" },
{ "calInstance1": "WTemp" } ]
},
{
"name": "calSlope1",
"label": "Data Instance 1 Calibration Slope",
"type": "number",
"default": "1.00",
"description": "Slope for data instance 1",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance1": "AWA" },
{ "calInstance1": "AWS" },
{ "calInstance2": "COG" },
{ "calInstance1": "DBT" },
{ "calInstance1": "HDM" },
{ "calInstance1": "PRPOS" },
{ "calInstance1": "RPOS" },
{ "calInstance1": "SOG" },
{ "calInstance1": "STW" },
{ "calInstance1": "TWA" },
{ "calInstance1": "TWS" },
{ "calInstance1": "TWD" },
{ "calInstance1": "WTemp" } ]
},
{
"name": "calSmooth1",
"label": "Data Instance 1 Smoothing",
"type": "number",
"default": "0",
"check": "checkMinMax",
"min": 0,
"max": 10,
"description": "Smoothing factor [0..10]; 0 = no smoothing",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance1": "AWA" },
{ "calInstance1": "AWS" },
{ "calInstance2": "COG" },
{ "calInstance1": "DBT" },
{ "calInstance1": "HDM" },
{ "calInstance1": "PRPOS" },
{ "calInstance1": "RPOS" },
{ "calInstance1": "SOG" },
{ "calInstance1": "STW" },
{ "calInstance1": "TWA" },
{ "calInstance1": "TWS" },
{ "calInstance1": "TWD" },
{ "calInstance1": "WTemp" } ]
},
{
"name": "calInstance2",
"label": "Calibration Data Instance 2",
"type": "list",
"default": "---",
"description": "Data instance for calibration",
"list": [
"---",
"AWA",
"AWS",
"COG",
"DBT",
"HDM",
"PRPOS",
"RPOS",
"SOG",
"STW",
"TWA",
"TWS",
"TWD",
"WTemp"
],
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
}
},
{
"name": "calOffset2",
"label": "Data Instance 2 Calibration Offset",
"type": "number",
"default": "0.00",
"description": "Offset for data instance 2",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance2": "AWA" },
{ "calInstance2": "AWS" },
{ "calInstance2": "COG" },
{ "calInstance2": "DBT" },
{ "calInstance2": "HDM" },
{ "calInstance2": "PRPOS" },
{ "calInstance2": "RPOS" },
{ "calInstance2": "SOG" },
{ "calInstance2": "STW" },
{ "calInstance2": "TWA" },
{ "calInstance2": "TWS" },
{ "calInstance2": "TWD" },
{ "calInstance2": "WTemp" } ]
},
{
"name": "calSlope2",
"label": "Data Instance 2 Calibration Slope",
"type": "number",
"default": "1.00",
"description": "Slope for data instance 2",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance2": "AWA" },
{ "calInstance2": "AWS" },
{ "calInstance2": "COG" },
{ "calInstance2": "DBT" },
{ "calInstance2": "HDM" },
{ "calInstance2": "PRPOS" },
{ "calInstance2": "RPOS" },
{ "calInstance2": "SOG" },
{ "calInstance2": "STW" },
{ "calInstance2": "TWA" },
{ "calInstance2": "TWS" },
{ "calInstance2": "TWD" },
{ "calInstance2": "WTemp" } ]
},
{
"name": "calSmooth2",
"label": "Data Instance 2 Smoothing",
"type": "number",
"default": "0",
"check": "checkMinMax",
"min": 0,
"max": 10,
"description": "Smoothing factor [0..10]; 0 = no smoothing",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance2": "AWA" },
{ "calInstance2": "AWS" },
{ "calInstance2": "COG" },
{ "calInstance2": "DBT" },
{ "calInstance2": "HDM" },
{ "calInstance2": "PRPOS" },
{ "calInstance2": "RPOS" },
{ "calInstance2": "SOG" },
{ "calInstance2": "STW" },
{ "calInstance2": "TWA" },
{ "calInstance2": "TWS" },
{ "calInstance2": "TWD" },
{ "calInstance2": "WTemp" } ]
},
{
"name": "calInstance3",
"label": "Calibration Data Instance 3",
"type": "list",
"default": "---",
"description": "Data instance for calibration",
"list": [
"---",
"AWA",
"AWS",
"COG",
"DBT",
"HDM",
"PRPOS",
"RPOS",
"SOG",
"STW",
"TWA",
"TWS",
"TWD",
"WTemp"
],
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
}
},
{
"name": "calOffset3",
"label": "Data Instance 3 Calibration Offset",
"type": "number",
"default": "0.00",
"description": "Offset for data instance 3",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance3": "AWA" },
{ "calInstance3": "AWS" },
{ "calInstance3": "COG" },
{ "calInstance3": "DBT" },
{ "calInstance3": "HDM" },
{ "calInstance3": "PRPOS" },
{ "calInstance3": "RPOS" },
{ "calInstance3": "SOG" },
{ "calInstance3": "STW" },
{ "calInstance3": "TWA" },
{ "calInstance3": "TWS" },
{ "calInstance3": "TWD" },
{ "calInstance3": "WTemp" } ]
},
{
"name": "calSlope3",
"label": "Data Instance 3 Calibration Slope",
"type": "number",
"default": "1.00",
"description": "Slope for data instance 3",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance3": "AWA" },
{ "calInstance3": "AWS" },
{ "calInstance3": "COG" },
{ "calInstance3": "DBT" },
{ "calInstance3": "HDM" },
{ "calInstance3": "PRPOS" },
{ "calInstance3": "RPOS" },
{ "calInstance3": "SOG" },
{ "calInstance3": "STW" },
{ "calInstance3": "TWA" },
{ "calInstance3": "TWS" },
{ "calInstance3": "TWD" },
{ "calInstance3": "WTemp" } ]
},
{
"name": "calSmooth3",
"label": "Data Instance 3 Smoothing",
"type": "number",
"default": "0",
"check": "checkMinMax",
"min": 0,
"max": 10,
"description": "Smoothing factor [0..10]; 0 = no smoothing",
"category": "OBP60 Calibrations",
"capabilities": {
"obp60":"true"
},
"condition": [
{ "calInstance3": "AWA" },
{ "calInstance3": "AWS" },
{ "calInstance3": "COG" },
{ "calInstance3": "DBT" },
{ "calInstance3": "HDM" },
{ "calInstance3": "PRPOS" },
{ "calInstance3": "RPOS" },
{ "calInstance3": "SOG" },
{ "calInstance3": "STW" },
{ "calInstance3": "TWA" },
{ "calInstance3": "TWS" },
{ "calInstance3": "TWD" },
{ "calInstance3": "WTemp" } ]
},
{ {
"name": "display", "name": "display",
"label": "Display Mode", "label": "Display Mode",