From 807e4cec303e188aeedb0fe969b00ff9463052a9 Mon Sep 17 00:00:00 2001 From: Ulrich Meine <145987006+Scorgan01@users.noreply.github.com> Date: Sun, 12 Jul 2026 00:39:54 +0200 Subject: [PATCH] Fix failing initialization of AWD history buffer --- lib/obp60task/OBPDataOperations.h | 10 +++++++++- lib/obp60task/obp60task.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/obp60task/OBPDataOperations.h b/lib/obp60task/OBPDataOperations.h index 27a1a80..3f4d209 100644 --- a/lib/obp60task/OBPDataOperations.h +++ b/lib/obp60task/OBPDataOperations.h @@ -120,6 +120,12 @@ private: static constexpr double DBL_MAX = std::numeric_limits::max(); GwLog* logger; + // specify missing data for boat value type AWD; AWD is not available in core gateway and need to be specified here + void defineAWD() { + awdBVal->setFormat("formatCourse"); + awdBVal->valid = false; + } + public: WindUtils(BoatValueList* boatValues, GwLog* log) : logger(log) @@ -130,13 +136,15 @@ public: twdBVal = boatValues->findValueOrCreate("TWD"); awaBVal = boatValues->findValueOrCreate("AWA"); awsBVal = boatValues->findValueOrCreate("AWS"); - awdBVal = boatValues->findValueOrCreate("AWD"); cogBVal = boatValues->findValueOrCreate("COG"); stwBVal = boatValues->findValueOrCreate("STW"); sogBVal = boatValues->findValueOrCreate("SOG"); hdtBVal = boatValues->findValueOrCreate("HDT"); hdmBVal = boatValues->findValueOrCreate("HDM"); varBVal = boatValues->findValueOrCreate("VAR"); + + awdBVal = boatValues->findValueOrCreate("AWD"); + defineAWD(); }; static double to2PI(double a); diff --git a/lib/obp60task/obp60task.cpp b/lib/obp60task/obp60task.cpp index 6da0a4c..6a24c3b 100644 --- a/lib/obp60task/obp60task.cpp +++ b/lib/obp60task/obp60task.cpp @@ -851,7 +851,7 @@ void OBP60Task(GwApi *api){ // ulong startHandl = millis(); trueWind.handleWinds(calcTrueWnds); // calculate true wind data from apparent wind values - trueWind.setMaxWs(); // maintain MaxTWS value in any case; invalid TWS value is considered automatically + trueWind.setMaxWs(); // maintain MaxTWS value in any case; invalid TWS value is considered automatically; MaxAWS is provided by core gateway if AWS is available calibrationDataList.handleCalibration(&boatValues); // Process calibration for all boat data in hstryBufferList.handleHstryBufs(useSimuData, commonData); // Handle history buffers for certain boat data for charts and other usage // LOG_DEBUG(GwLog::DEBUG, "obp60task: data handling: %d ms", millis() - startHandl);