This commit is contained in:
norbert-walter 2022-04-18 17:32:58 +02:00
parent 662dd5e0e2
commit 4de0606521
1 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,7 @@ class PageBattery2 : public Page
bool init = false; // Marker for init done
bool keylock = false; // Keylock
int average = 0; // Average type [0...3], 0=off, 1=10s, 2=60s, 3=300s
bool trend = true; // Trend indicator [0|1], 0=off, 1=on
double raw = 0;
public:
@ -23,6 +24,12 @@ public:
return 0; // Commit the key
}
// Trend indicator
if(key == 5){
trend = !trend;
return 0; // Commit the key
}
// Code for keylock
if(key == 11){
keylock = !keylock; // Toggle keylock
@ -72,6 +79,9 @@ public:
valueTrend = commonData.data.batteryVoltage10;
}
// Get raw value for trend indicator
raw = commonData.data.batteryVoltage; // Live data
// Switch average values
switch (average) {
case 0: