mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-09-11 19:55:14 +02:00
Add late chart object initialization to pages with charts
This commit is contained in:
@@ -243,7 +243,7 @@ public:
|
||||
dataHstryBuf = pageData.hstryBuffers->getBuffer(bValName1);
|
||||
|
||||
if (dataHstryBuf) {
|
||||
dataChart.reset(new Chart(*dataHstryBuf, Chart::dfltChrtDta[bValFormat].range, *commonData, useSimuData));
|
||||
dataChart.reset(new Chart(*dataHstryBuf, *commonData, useSimuData));
|
||||
LOG_DEBUG(GwLog::DEBUG, "PageOneValue: Created chart objects for %s", bValName1);
|
||||
} else {
|
||||
LOG_DEBUG(GwLog::DEBUG, "PageOneValue: No chart objects available for %s", bValName1);
|
||||
@@ -276,6 +276,10 @@ public:
|
||||
|
||||
displaySetPartialWindow(0, 0, width, height); // Set partial update
|
||||
|
||||
if (!dataChart->isValid()) {
|
||||
dataChart->init(); // try late initialization if chart object could not be properly initialized earlier due to missing boat data
|
||||
}
|
||||
|
||||
if (pageMode == VALUE || dataHstryBuf == nullptr) {
|
||||
// show only data value; ignore other pageMode options if no chart supported boat data history buffer is available
|
||||
showData(bValue1, FULL);
|
||||
|
||||
Reference in New Issue
Block a user