mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-12 15:41:38 +02:00
ZE optimize groupSetLimit
This commit is contained in:
parent
c1be041a27
commit
208c0f7202
1 changed files with 11 additions and 4 deletions
|
@ -1376,6 +1376,8 @@ class ZeroExport {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate
|
// Calculate
|
||||||
|
uint16_t power100proz = mIv[group][inv]->getMaxPower();
|
||||||
|
uint16_t power2proz = (power100proz *2) / 100;
|
||||||
|
|
||||||
// if isOff -> Limit Pmin
|
// if isOff -> Limit Pmin
|
||||||
if (!mIv[group][inv]->isProducing()) {
|
if (!mIv[group][inv]->isProducing()) {
|
||||||
|
@ -1388,22 +1390,29 @@ class ZeroExport {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restriction LimitNew < 2%
|
// Restriction LimitNew < 2%
|
||||||
uint16_t power2proz = (mIv[group][inv]->getMaxPower() *2) / 100;
|
|
||||||
if (cfgGroupInv->limitNew < power2proz) {
|
if (cfgGroupInv->limitNew < power2proz) {
|
||||||
cfgGroupInv->limitNew = power2proz;
|
cfgGroupInv->limitNew = power2proz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restriction Power + 10% < Limit
|
||||||
|
if ((cfgGroupInv->power + (power100proz * 10 / 100)) < cfgGroupInv->limit) {
|
||||||
|
cfgGroupInv->limitNew += (power100proz * 10 / 100);
|
||||||
|
}
|
||||||
|
|
||||||
// Restriction LimitNew > Pmax
|
// Restriction LimitNew > Pmax
|
||||||
if (cfgGroupInv->limitNew > cfgGroupInv->powerMax) {
|
if (cfgGroupInv->limitNew > cfgGroupInv->powerMax) {
|
||||||
cfgGroupInv->limitNew = cfgGroupInv->powerMax;
|
cfgGroupInv->limitNew = cfgGroupInv->powerMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restriction LimitNew > 100%
|
// Restriction LimitNew > 100%
|
||||||
uint16_t power100proz = mIv[group][inv]->getMaxPower();
|
|
||||||
if (cfgGroupInv->limitNew > power100proz) {
|
if (cfgGroupInv->limitNew > power100proz) {
|
||||||
cfgGroupInv->limitNew = power100proz;
|
cfgGroupInv->limitNew = power100proz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restriction modulo 4 bzw 2
|
||||||
|
cfgGroupInv->limitNew = cfgGroupInv->limitNew - (cfgGroupInv->limitNew % 4);
|
||||||
|
// TODO: HM-800 kann vermutlich nur in 4W Schritten ... 20W -> 16W ... 100W -> 96W
|
||||||
|
|
||||||
// Restriction deltaLimitNew < 5 W
|
// Restriction deltaLimitNew < 5 W
|
||||||
/*
|
/*
|
||||||
if (
|
if (
|
||||||
|
@ -1417,8 +1426,6 @@ class ZeroExport {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
logObj["zeLold"] = cfgGroupInv->limit;
|
|
||||||
|
|
||||||
if (cfgGroupInv->limit != cfgGroupInv->limitNew) {
|
if (cfgGroupInv->limit != cfgGroupInv->limitNew) {
|
||||||
cfgGroupInv->doLimit = 1;
|
cfgGroupInv->doLimit = 1;
|
||||||
cfgGroupInv->waitLimitAck = 60;
|
cfgGroupInv->waitLimitAck = 60;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue