Browse Source

fix 1ch AC calc

pull/1219/head^2
rejoe2 12 months ago
committed by GitHub
parent
commit
ae49f91966
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/hm/Communication.h

5
src/hm/Communication.h

@ -579,12 +579,17 @@ const byteAssign_t InfoAssignment[] = {
//preliminary AC calculation...
float ac_pow = 0;
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);
iv->setValue(iv->getPosByChFld(0, FLD_PAC, rec), rec, (float) ac_pow/10);

Loading…
Cancel
Save