* added history protection mask
* merge PR: display graph improvements #1347
This commit is contained in:
lumapu 2024-01-11 00:20:55 +01:00
parent f2c432a5cd
commit ed3e93274e
5 changed files with 8 additions and 5 deletions

View file

@ -4,6 +4,7 @@
* fix translation #1346 * fix translation #1346
* further improve sending active power control command faster #1332 * further improve sending active power control command faster #1332
* added history protection mask * added history protection mask
* merge PR: display graph improvements #1347
## 0.8.50 - 2024-01-09 ## 0.8.50 - 2024-01-09
* merge PR: added history charts to web #1336 * merge PR: added history charts to web #1336

View file

@ -151,7 +151,7 @@ class Inverter {
static uint32_t *timestamp; // system timestamp static uint32_t *timestamp; // system timestamp
static cfgInst_t *generalConfig; // general inverter configuration from setup static cfgInst_t *generalConfig; // general inverter configuration from setup
static IApp *app; // pointer to app interface //static IApp *app; // pointer to app interface
public: public:
@ -288,7 +288,7 @@ class Inverter {
if(isConnected) { if(isConnected) {
mDevControlRequest = true; mDevControlRequest = true;
devControlCmd = cmd; devControlCmd = cmd;
app->triggerTickSend(); //app->triggerTickSend(); // done in RestApi.h, because of "chicken-and-egg problem ;-)"
} }
return isConnected; return isConnected;
} }

View file

@ -18,7 +18,7 @@ class HmSystem {
void setup(uint32_t *timestamp, cfgInst_t *config, IApp *app) { void setup(uint32_t *timestamp, cfgInst_t *config, IApp *app) {
mInverter[0].timestamp = timestamp; mInverter[0].timestamp = timestamp;
mInverter[0].generalConfig = config; mInverter[0].generalConfig = config;
mInverter[0].app = app; //mInverter[0].app = app;
} }
void addInverter(uint8_t id, std::function<void(Inverter<> *iv)> cb) { void addInverter(uint8_t id, std::function<void(Inverter<> *iv)> cb) {

View file

@ -135,7 +135,7 @@ class DisplayMono {
} }
void initPowerGraph(uint8_t width, uint8_t height) { void initPowerGraph(uint8_t width, uint8_t height) {
DBGPRINTLN("---- Init Power Graph ----"); DBGPRINTLN(F("---- Init Power Graph ----"));
mPgWidth = width; mPgWidth = width;
mPgHeight = height; mPgHeight = height;
mPgData = new float[mPgWidth]; mPgData = new float[mPgWidth];
@ -207,7 +207,7 @@ class DisplayMono {
mDisplay->drawLine(xoff, yoff, xoff + mPgWidth, yoff); // horizontal axis 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 // 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; return;
// draw X scale // draw X scale

View file

@ -842,6 +842,8 @@ class RestApi {
iv->powerLimit[1] = AbsolutNonPersistent; iv->powerLimit[1] = AbsolutNonPersistent;
accepted = iv->setDevControlRequest(ActivePowerContr); accepted = iv->setDevControlRequest(ActivePowerContr);
if(accepted)
mApp->triggerTickSend();
} else if(F("dev") == jsonIn[F("cmd")]) { } else if(F("dev") == jsonIn[F("cmd")]) {
DPRINTLN(DBG_INFO, F("dev cmd")); DPRINTLN(DBG_INFO, F("dev cmd"));
iv->setDevCommand(jsonIn[F("val")].as<int>()); iv->setDevCommand(jsonIn[F("val")].as<int>());