mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-01 10:11:37 +02:00
Integration VersionNr durring startup
This commit is contained in:
parent
b12effd59e
commit
4ef38f1266
2 changed files with 43 additions and 19 deletions
|
@ -53,6 +53,9 @@ void DisplayEPaper::init(uint8_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, u
|
|||
|
||||
headlineIP();
|
||||
|
||||
_version = version;
|
||||
versionFooter();
|
||||
|
||||
// call the PowerPage to change the PV Power Values
|
||||
actualPowerPaged(0, 0, 0, 0);
|
||||
}
|
||||
|
@ -122,6 +125,26 @@ void DisplayEPaper::lastUpdatePaged() {
|
|||
} while (_display->nextPage());
|
||||
}
|
||||
//***************************************************************************
|
||||
void DisplayEPaper::versionFooter() {
|
||||
int16_t tbx, tby;
|
||||
uint16_t tbw, tbh;
|
||||
|
||||
_display->setFont(&FreeSans9pt7b);
|
||||
_display->setTextColor(GxEPD_WHITE);
|
||||
|
||||
_display->setPartialWindow(0, _display->height() - mHeadFootPadding, _display->width(), mHeadFootPadding);
|
||||
_display->fillScreen(GxEPD_BLACK);
|
||||
do {
|
||||
snprintf(_fmtText, sizeof(_fmtText), "Version: %s", _version);
|
||||
|
||||
_display->getTextBounds(_fmtText, 0, 0, &tbx, &tby, &tbw, &tbh);
|
||||
uint16_t x = ((_display->width() - tbw) / 2) - tbx;
|
||||
|
||||
_display->setCursor(x, (_display->height() - 3));
|
||||
_display->println(_fmtText);
|
||||
} while (_display->nextPage());
|
||||
}
|
||||
//***************************************************************************
|
||||
void DisplayEPaper::offlineFooter() {
|
||||
int16_t tbx, tby;
|
||||
uint16_t tbw, tbh;
|
||||
|
|
|
@ -25,27 +25,28 @@
|
|||
|
||||
class DisplayEPaper {
|
||||
public:
|
||||
DisplayEPaper();
|
||||
void fullRefresh();
|
||||
void init(uint8_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, uint8_t _BUSY, uint8_t _SCK, uint8_t _MOSI, uint32_t *utcTs, const char* version);
|
||||
void config(uint8_t rotation, bool enPowerSafe);
|
||||
void loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod);
|
||||
|
||||
DisplayEPaper();
|
||||
void fullRefresh();
|
||||
void init(uint8_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, uint8_t _BUSY, uint8_t _SCK, uint8_t _MOSI, uint32_t* utcTs, const char* version);
|
||||
void config(uint8_t rotation, bool enPowerSafe);
|
||||
void loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod);
|
||||
|
||||
private:
|
||||
void headlineIP();
|
||||
void actualPowerPaged(float _totalPower, float _totalYieldDay, float _totalYieldTotal, uint8_t _isprod);
|
||||
void lastUpdatePaged();
|
||||
void offlineFooter();
|
||||
void headlineIP();
|
||||
void actualPowerPaged(float _totalPower, float _totalYieldDay, float _totalYieldTotal, uint8_t _isprod);
|
||||
void lastUpdatePaged();
|
||||
void offlineFooter();
|
||||
void versionFooter();
|
||||
|
||||
uint8_t mDisplayRotation;
|
||||
bool _changed = false;
|
||||
char _fmtText[35];
|
||||
const char* _settedIP;
|
||||
uint8_t mHeadFootPadding;
|
||||
GxEPD2_GFX* _display;
|
||||
uint32_t *mUtcTs;
|
||||
bool mEnPowerSafe;
|
||||
uint8_t mDisplayRotation;
|
||||
bool _changed = false;
|
||||
char _fmtText[35];
|
||||
const char* _settedIP;
|
||||
uint8_t mHeadFootPadding;
|
||||
GxEPD2_GFX* _display;
|
||||
uint32_t* mUtcTs;
|
||||
bool mEnPowerSafe;
|
||||
const char* _version;
|
||||
};
|
||||
|
||||
#endif // ESP32
|
||||
#endif // ESP32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue