diff --git a/src/CHANGES.md b/src/CHANGES.md index 89442499..ca123e3b 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -4,6 +4,7 @@ * fix translation #1346 * further improve sending active power control command faster #1332 * added history protection mask +* merge PR: display graph improvements #1347 ## 0.8.50 - 2024-01-09 * merge PR: added history charts to web #1336 diff --git a/src/hm/hmInverter.h b/src/hm/hmInverter.h index 4b2cc40d..1f623d85 100644 --- a/src/hm/hmInverter.h +++ b/src/hm/hmInverter.h @@ -151,7 +151,7 @@ class Inverter { static uint32_t *timestamp; // system timestamp static cfgInst_t *generalConfig; // general inverter configuration from setup - static IApp *app; // pointer to app interface + //static IApp *app; // pointer to app interface public: @@ -288,7 +288,7 @@ class Inverter { if(isConnected) { mDevControlRequest = true; devControlCmd = cmd; - app->triggerTickSend(); + //app->triggerTickSend(); // done in RestApi.h, because of "chicken-and-egg problem ;-)" } return isConnected; } diff --git a/src/hm/hmSystem.h b/src/hm/hmSystem.h index 6ff741bf..8f997104 100644 --- a/src/hm/hmSystem.h +++ b/src/hm/hmSystem.h @@ -18,7 +18,7 @@ class HmSystem { void setup(uint32_t *timestamp, cfgInst_t *config, IApp *app) { mInverter[0].timestamp = timestamp; mInverter[0].generalConfig = config; - mInverter[0].app = app; + //mInverter[0].app = app; } void addInverter(uint8_t id, std::function *iv)> cb) { diff --git a/src/plugins/Display/Display_Mono.h b/src/plugins/Display/Display_Mono.h index bd3ee30e..185e066e 100644 --- a/src/plugins/Display/Display_Mono.h +++ b/src/plugins/Display/Display_Mono.h @@ -135,7 +135,7 @@ class DisplayMono { } void initPowerGraph(uint8_t width, uint8_t height) { - DBGPRINTLN("---- Init Power Graph ----"); + DBGPRINTLN(F("---- Init Power Graph ----")); mPgWidth = width; mPgHeight = height; mPgData = new float[mPgWidth]; @@ -207,7 +207,7 @@ class DisplayMono { mDisplay->drawLine(xoff, yoff, xoff + mPgWidth, yoff); // horizontal axis // do not draw as long as time is not set correctly and no data was received - if ((mDisplayData->pGraphStartTime == 0) || (mDisplayData->pGraphEndTime == 0) || (mDisplayData->utcTs < 1) || (mPgMaxPwr < 1) || (mPgLastPos < 1)) + if ((mDisplayData->pGraphStartTime == 0) || (mDisplayData->pGraphEndTime == 0) || (mDisplayData->utcTs != 0) || (mPgMaxPwr != 0) || (mPgLastPos != 0)) return; // draw X scale diff --git a/src/web/RestApi.h b/src/web/RestApi.h index 73216ed5..8148eb20 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -842,6 +842,8 @@ class RestApi { iv->powerLimit[1] = AbsolutNonPersistent; accepted = iv->setDevControlRequest(ActivePowerContr); + if(accepted) + mApp->triggerTickSend(); } else if(F("dev") == jsonIn[F("cmd")]) { DPRINTLN(DBG_INFO, F("dev cmd")); iv->setDevCommand(jsonIn[F("val")].as());