mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-07 14:15:53 +02:00
fix 1ch AC calc
This commit is contained in:
parent
0fca99f833
commit
ae49f91966
1 changed files with 9 additions and 4 deletions
|
@ -579,10 +579,15 @@ const byteAssign_t InfoAssignment[] = {
|
|||
|
||||
//preliminary AC calculation...
|
||||
float ac_pow = 0;
|
||||
for(uint8_t i = 1; i <= iv->channels; i++) {
|
||||
if ((!iv->lastAlarm[i].code) || (iv->lastAlarm[i].code == 1)) {
|
||||
uint8_t pos = iv->getPosByChFld(i, FLD_PDC, rec);
|
||||
ac_pow += iv->getValue(pos, rec);
|
||||
if (iv->type == INV_TYPE_1CH) {
|
||||
if ((!iv->lastAlarm[0].code) || (iv->lastAlarm[0].code == 1))
|
||||
ac_pow += iv->getValue(iv->getPosByChFld(1, FLD_PDC, rec), rec);
|
||||
} else {
|
||||
for(uint8_t i = 1; i <= iv->channels; i++) {
|
||||
if ((!iv->lastAlarm[i].code) || (iv->lastAlarm[i].code == 1)) {
|
||||
uint8_t pos = iv->getPosByChFld(i, FLD_PDC, rec);
|
||||
ac_pow += iv->getValue(pos, rec);
|
||||
}
|
||||
}
|
||||
}
|
||||
ac_pow = (int) (ac_pow*9.5);
|
||||
|
|
Loading…
Add table
Reference in a new issue