1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 23:13:07 +01:00

Add PageGenerator

This commit is contained in:
norbert-walter
2022-07-19 15:35:28 +02:00
parent c43797fef2
commit 564e7ede3d
5 changed files with 268 additions and 19 deletions

View File

@@ -42,9 +42,9 @@ public:
double value3 = 0; // Solar power consumption
// Get values
value1 = commonData.data.batteryVoltage; // Live data
value2 = commonData.data.batteryCurrent;
value3 = commonData.data.batteryPower;
value1 = commonData.data.solarVoltage; // Live data
value2 = commonData.data.solarCurrent;
value3 = commonData.data.solarPower;
solPercentage = value3 / solarMaxPower * 100; // Power level calculation
if(solPercentage < 0){ // Limiting values
solPercentage = 0;
@@ -115,9 +115,9 @@ public:
display.setCursor(10, 235);
display.print("Installed");
display.setCursor(10, 255);
display.print("Solar Type");
display.print("Solar Power");
// Show battery with fill level
// Show solar icon
batteryGraphic(150, 45, solPercentage, pixelcolor, bgcolor);
// Show average settings
@@ -237,7 +237,7 @@ static Page *createPage(CommonData &common){
* and will will provide the names of the fixed values we need
*/
PageDescription registerPageSolar(
"Solar", // Name of page
"Solar", // Name of page
createPage, // Action
0, // Number of bus values depends on selection in Web configuration
{}, // Names of bus values undepends on selection in Web configuration (refer GwBoatData.h)