1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-01-26 08:13:05 +01:00

Initial change to history buffers taking any boat value

This commit is contained in:
Ulrich Meine
2025-12-13 17:59:16 +01:00
parent 6edf847958
commit 3ce1e31e64
5 changed files with 129 additions and 159 deletions

View File

@@ -433,7 +433,7 @@ void OBP60Task(GwApi *api){
int lastPage=pageNumber;
BoatValueList boatValues; //all the boat values for the api query
HstryBuf hstryBufList(1920); // Create ring buffers for history storage of some boat data (1920 seconds = 32 minutes)
HstryManager hstryManager(1920, logger, &boatValues); // Create and manage history buffers
WindUtils trueWind(&boatValues); // Create helper object for true wind calculation
//commonData.distanceformat=config->getString(xxx);
//add all necessary data to common data
@@ -477,21 +477,19 @@ void OBP60Task(GwApi *api){
LOG_DEBUG(GwLog::DEBUG,"added fixed value %s to page %d",value->getName().c_str(),i);
pages[i].parameters.values.push_back(value);
}
// Add boat history data to page parameters
pages[i].parameters.boatHstry = &hstryBufList;
// Add history manager to page parameters
pages[i].parameters.hstryManager = &hstryManager;
}
// add out of band system page (always available)
Page *syspage = allPages.pages[0]->creator(commonData);
// Read all calibration data settings from config
calibrationData.readConfig(config, logger);
// Check user settings for true wind calculation
bool calcTrueWnds = api->getConfig()->getBool(api->getConfig()->calcTrueWnds, false);
bool useSimuData = api->getConfig()->getBool(api->getConfig()->useSimuData, false);
// Initialize history buffer for certain boat data
hstryBufList.init(&boatValues, logger);
// Read all calibration data settings from config
calibrationData.readConfig(config, logger);
// Display screenshot handler for HTTP request
// http://192.168.15.1/api/user/OBP60Task/screenshot
@@ -809,7 +807,7 @@ void OBP60Task(GwApi *api){
trueWind.addTrueWind(api, &boatValues, logger);
}
// Handle history buffers for certain boat data for windplot page and other usage
hstryBufList.handleHstryBuf(useSimuData);
hstryManager.handleHstryBufs(useSimuData);
// Clear display
// getdisplay().fillRect(0, 0, getdisplay().width(), getdisplay().height(), commonData.bgcolor);