mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-29 18:26:21 +02:00
MI - Fix AC calc after midnight
For other than 1ch inverters
This commit is contained in:
parent
4ca05620dc
commit
5f3c6feb35
1 changed files with 9 additions and 2 deletions
|
@ -897,7 +897,14 @@ class Communication : public CommQueue<> {
|
||||||
stsok = false;
|
stsok = false;
|
||||||
if( (!oldState) || (!q->iv->alarmCnt) ) { // initial zero value? => just write this channel to main state and raise changed flags
|
if( (!oldState) || (!q->iv->alarmCnt) ) { // initial zero value? => just write this channel to main state and raise changed flags
|
||||||
changedStatus = true;
|
changedStatus = true;
|
||||||
q->iv->alarmCnt = 1; // minimum...
|
if( !q->iv->alarmCnt ) {
|
||||||
|
q->iv->alarmCnt = 1; // minimum...
|
||||||
|
for (uint8_t i = 1; i <= 9; i++) { //start with 1
|
||||||
|
if (i != stschan && q->iv->lastAlarm[i].code) {
|
||||||
|
q->iv->lastAlarm[i].code = 0; // zero outdated values
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//sth is or was wrong?
|
//sth is or was wrong?
|
||||||
if (q->iv->type == INV_TYPE_1CH) {
|
if (q->iv->type == INV_TYPE_1CH) {
|
||||||
|
@ -996,7 +1003,7 @@ class Communication : public CommQueue<> {
|
||||||
ac_pow += iv->getValue(iv->getPosByChFld(1, FLD_PDC, rec), rec);
|
ac_pow += iv->getValue(iv->getPosByChFld(1, FLD_PDC, rec), rec);
|
||||||
} else {
|
} else {
|
||||||
for(uint8_t i = 1; i <= iv->channels; i++) {
|
for(uint8_t i = 1; i <= iv->channels; i++) {
|
||||||
if ((!iv->lastAlarm[i].code) || (iv->lastAlarm[i].code == 1))
|
if ((!iv->lastAlarm[i].code) || (iv->lastAlarm[i].code == 1) || ( (iv->alarmCnt == 1) && (iv->lastAlarm[0].code == 1) ) )
|
||||||
ac_pow += iv->getValue(iv->getPosByChFld(i, FLD_PDC, rec), rec);
|
ac_pow += iv->getValue(iv->getPosByChFld(i, FLD_PDC, rec), rec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue