|
|
@ -170,7 +170,7 @@ typedef struct { |
|
|
|
} cfgIv_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
bool enabled; |
|
|
|
// bool enabled;
|
|
|
|
cfgIv_t iv[MAX_NUM_INVERTERS]; |
|
|
|
|
|
|
|
uint16_t sendInterval; |
|
|
@ -179,7 +179,6 @@ typedef struct { |
|
|
|
bool rstValsCommStop; |
|
|
|
bool rstMaxValsMidNight; |
|
|
|
bool startWithoutTime; |
|
|
|
float yieldEffiency; |
|
|
|
bool readGrid; |
|
|
|
} cfgInst_t; |
|
|
|
|
|
|
@ -495,7 +494,6 @@ class settings { |
|
|
|
mCfg.inst.rstValsCommStop = false; |
|
|
|
mCfg.inst.startWithoutTime = false; |
|
|
|
mCfg.inst.rstMaxValsMidNight = false; |
|
|
|
mCfg.inst.yieldEffiency = 1.0f; |
|
|
|
mCfg.inst.readGrid = true; |
|
|
|
|
|
|
|
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) { |
|
|
@ -840,30 +838,23 @@ class settings { |
|
|
|
void jsonInst(JsonObject obj, bool set = false) { |
|
|
|
if(set) { |
|
|
|
obj[F("intvl")] = mCfg.inst.sendInterval; |
|
|
|
obj[F("en")] = (bool)mCfg.inst.enabled; |
|
|
|
// obj[F("en")] = (bool)mCfg.inst.enabled;
|
|
|
|
obj[F("rstMidNight")] = (bool)mCfg.inst.rstYieldMidNight; |
|
|
|
obj[F("rstNotAvail")] = (bool)mCfg.inst.rstValsNotAvail; |
|
|
|
obj[F("rstComStop")] = (bool)mCfg.inst.rstValsCommStop; |
|
|
|
obj[F("strtWthtTime")] = (bool)mCfg.inst.startWithoutTime; |
|
|
|
obj[F("rstMaxMidNight")] = (bool)mCfg.inst.rstMaxValsMidNight; |
|
|
|
obj[F("yldEff")] = mCfg.inst.yieldEffiency; |
|
|
|
obj[F("rdGrid")] = (bool)mCfg.inst.readGrid; |
|
|
|
} |
|
|
|
else { |
|
|
|
getVal<uint16_t>(obj, F("intvl"), &mCfg.inst.sendInterval); |
|
|
|
getVal<bool>(obj, F("en"), &mCfg.inst.enabled); |
|
|
|
// getVal<bool>(obj, F("en"), &mCfg.inst.enabled);
|
|
|
|
getVal<bool>(obj, F("rstMidNight"), &mCfg.inst.rstYieldMidNight); |
|
|
|
getVal<bool>(obj, F("rstNotAvail"), &mCfg.inst.rstValsNotAvail); |
|
|
|
getVal<bool>(obj, F("rstComStop"), &mCfg.inst.rstValsCommStop); |
|
|
|
getVal<bool>(obj, F("strtWthtTime"), &mCfg.inst.startWithoutTime); |
|
|
|
getVal<bool>(obj, F("rstMaxMidNight"), &mCfg.inst.rstMaxValsMidNight); |
|
|
|
getVal<float>(obj, F("yldEff"), &mCfg.inst.yieldEffiency); |
|
|
|
getVal<bool>(obj, F("rdGrid"), &mCfg.inst.readGrid); |
|
|
|
|
|
|
|
if(mCfg.inst.yieldEffiency < 0.5) |
|
|
|
mCfg.inst.yieldEffiency = 1.0f; |
|
|
|
else if(mCfg.inst.yieldEffiency > 1.0f) |
|
|
|
mCfg.inst.yieldEffiency = 1.0f; |
|
|
|
} |
|
|
|
|
|
|
|
JsonArray ivArr; |
|
|
|