Browse Source

provide localized times to display mono classes

(cherry picked from commit daacb3b1902a41c03099ab2a583f9920181c8a25)
pull/1376/head
you69man 1 year ago
parent
commit
cd59315545
  1. 9
      src/plugins/Display/Display.h
  2. 2
      src/plugins/Display/Display_Mono_128X32.h
  3. 2
      src/plugins/Display/Display_Mono_128X64.h
  4. 2
      src/plugins/Display/Display_Mono_64X48.h
  5. 2
      src/plugins/Display/Display_Mono_84X48.h
  6. 6
      src/plugins/Display/Display_data.h

9
src/plugins/Display/Display.h

@ -162,14 +162,15 @@ class Display {
mDisplayData.RadioRSSI = ivQuality2RadioRSSI(minQAllInv); // Workaround as NRF24 has no RSSI. Approximation by quality levels from heuristic function mDisplayData.RadioRSSI = ivQuality2RadioRSSI(minQAllInv); // Workaround as NRF24 has no RSSI. Approximation by quality levels from heuristic function
mDisplayData.WifiRSSI = (WiFi.status() == WL_CONNECTED) ? WiFi.RSSI() : SCHAR_MIN; mDisplayData.WifiRSSI = (WiFi.status() == WL_CONNECTED) ? WiFi.RSSI() : SCHAR_MIN;
mDisplayData.ipAddress = WiFi.localIP(); mDisplayData.ipAddress = WiFi.localIP();
// provide localized times to display classes
time_t utc= mApp->getTimestamp(); time_t utc= mApp->getTimestamp();
if (year(utc) > 2020) if (year(utc) > 2020)
mDisplayData.utcTs = utc; mDisplayData.utcTs = gTimezone.toLocal(utc);
else else
mDisplayData.utcTs = 0; mDisplayData.utcTs = 0;
mDisplayData.pGraphStartTime = gTimezone.toLocal(mApp->getSunrise());
mDisplayData.pGraphStartTime = mApp->getSunrise(); mDisplayData.pGraphEndTime = gTimezone.toLocal(mApp->getSunset());
mDisplayData.pGraphEndTime = mApp->getSunset();
if (mMono ) { if (mMono ) {
mMono->disp(); mMono->disp();

2
src/plugins/Display/Display_Mono_128X32.h

@ -56,7 +56,7 @@ class DisplayMono128X32 : public DisplayMono {
snprintf(mFmtText, DISP_FMT_TEXT_LEN, "%d Inverter on", mDisplayData->nrProducing); snprintf(mFmtText, DISP_FMT_TEXT_LEN, "%d Inverter on", mDisplayData->nrProducing);
printText(mFmtText, 3); printText(mFmtText, 3);
} else if (0 != mDisplayData->utcTs) } else if (0 != mDisplayData->utcTs)
printText(ah::getTimeStr(gTimezone.toLocal(mDisplayData->utcTs)).c_str(), 3); printText(ah::getTimeStr(mDisplayData->utcTs).c_str(), 3);
mDisplay->sendBuffer(); mDisplay->sendBuffer();

2
src/plugins/Display/Display_Mono_128X64.h

@ -95,7 +95,7 @@ class DisplayMono128X64 : public DisplayMono {
// print Date and time // print Date and time
if (0 != mDisplayData->utcTs) if (0 != mDisplayData->utcTs)
printText(ah::getDateTimeStrShort(gTimezone.toLocal(mDisplayData->utcTs)).c_str(), l_Time, 0xff); printText(ah::getDateTimeStrShort(mDisplayData->utcTs).c_str(), l_Time, 0xff);
if (showLine(l_Status)) { if (showLine(l_Status)) {
// alternatively: // alternatively:

2
src/plugins/Display/Display_Mono_64X48.h

@ -58,7 +58,7 @@ class DisplayMono64X48 : public DisplayMono {
snprintf(mFmtText, DISP_FMT_TEXT_LEN, "active Inv: %d", mDisplayData->nrProducing); snprintf(mFmtText, DISP_FMT_TEXT_LEN, "active Inv: %d", mDisplayData->nrProducing);
printText(mFmtText, 3); printText(mFmtText, 3);
} else if (0 != mDisplayData->utcTs) } else if (0 != mDisplayData->utcTs)
printText(ah::getTimeStr(gTimezone.toLocal(mDisplayData->utcTs)).c_str(), 3); printText(ah::getTimeStr(mDisplayData->utcTs).c_str(), 3);
mDisplay->sendBuffer(); mDisplay->sendBuffer();

2
src/plugins/Display/Display_Mono_84X48.h

@ -78,7 +78,7 @@ class DisplayMono84X48 : public DisplayMono {
// print Date and time // print Date and time
if (0 != mDisplayData->utcTs) if (0 != mDisplayData->utcTs)
printText(ah::getDateTimeStrShort(gTimezone.toLocal(mDisplayData->utcTs)).c_str(), l_Time, 0xff); printText(ah::getDateTimeStrShort(mDisplayData->utcTs).c_str(), l_Time, 0xff);
if (showLine(l_Status)) { if (showLine(l_Status)) {
// alternatively: // alternatively:

6
src/plugins/Display/Display_data.h

@ -8,9 +8,9 @@ struct DisplayData {
float totalPower=0.0f; // indicate current power (W) float totalPower=0.0f; // indicate current power (W)
float totalYieldDay=0.0f; // indicate day yield (Wh) float totalYieldDay=0.0f; // indicate day yield (Wh)
float totalYieldTotal=0.0f; // indicate total yield (kWh) float totalYieldTotal=0.0f; // indicate total yield (kWh)
uint32_t utcTs=0; // indicate absolute timestamp (utc unix time). 0 = time is not synchonized uint32_t utcTs=0; // indicate absolute timestamp (localized utc unix time). 0 = time is not synchonized
uint32_t pGraphStartTime=0; // starttime for power graph (e.g. sunRise) uint32_t pGraphStartTime=0; // localized starttime for power graph (e.g. sunRise)
uint32_t pGraphEndTime=0; // starttime for power graph (e.g. sunSet) uint32_t pGraphEndTime=0; // localized endttime for power graph (e.g. sunSet)
uint8_t nrProducing=0; // indicate number of producing inverters uint8_t nrProducing=0; // indicate number of producing inverters
uint8_t nrSleeping=0; // indicate number of sleeping inverters uint8_t nrSleeping=0; // indicate number of sleeping inverters
bool WifiSymbol = false; // indicate if WiFi is connected bool WifiSymbol = false; // indicate if WiFi is connected

Loading…
Cancel
Save