refactor display class

Display class gets access to App interface and HmRadio
Display class prepares relevant online information for displays in new DisplayData structure
Displays get pointer to DisplayData and only use information received from there
This commit is contained in:
Wusaweki 2023-09-10 16:19:10 +02:00
parent e8fa9c747e
commit f1bff0b824
13 changed files with 207 additions and 197 deletions

View file

@ -46,9 +46,9 @@ void DisplayEPaper::init(uint8_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, u
}
}
void DisplayEPaper::config(uint8_t rotation, bool enPowerSafe) {
void DisplayEPaper::config(uint8_t rotation, bool enPowerSave) {
mDisplayRotation = rotation;
mEnPowerSafe = enPowerSafe;
mEnPowerSave = enPowerSave;
}
//***************************************************************************
@ -209,7 +209,7 @@ void DisplayEPaper::actualPowerPaged(float totalPower, float totalYieldDay, floa
} else
snprintf(_fmtText, sizeof(_fmtText), "offline");
if ((totalPower == 0) && (mEnPowerSafe)) {
if ((totalPower == 0) && (mEnPowerSave)) {
_display->fillRect(0, mHeadFootPadding, 200, 200, GxEPD_BLACK);
_display->drawBitmap(0, 0, logo, 200, 200, GxEPD_WHITE);
} else {
@ -291,7 +291,7 @@ void DisplayEPaper::loop(float totalPower, float totalYieldDay, float totalYield
if ((isprod > 0) && (_changed)) {
_changed = false;
lastUpdatePaged();
} else if ((0 == totalPower) && (mEnPowerSafe))
} else if ((0 == totalPower) && (mEnPowerSave))
offlineFooter();
_display->powerOff();