rejoe2
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
4 deletions
-
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); |
|
|
|
|
|
|
|