Fixed issue with irradiation calculation

getChannelMaxPower is zero based while the first string is 1 based on getChannelFieldData
This commit is contained in:
Thomas Basler 2022-06-25 11:13:25 +02:00
parent d17d7f7082
commit 96ef182d38

View File

@ -264,8 +264,8 @@ static float calcEffiencyCh0(InverterAbstract* iv, uint8_t arg0)
static float calcIrradiation(InverterAbstract* iv, uint8_t arg0) static float calcIrradiation(InverterAbstract* iv, uint8_t arg0)
{ {
if (NULL != iv) { if (NULL != iv) {
if (iv->getChannelMaxPower(arg0) > 0) if (iv->getChannelMaxPower(arg0 - 1) > 0)
return iv->getChannelFieldValue(arg0, FLD_PDC) / iv->getChannelMaxPower(arg0) * 100.0f; return iv->getChannelFieldValue(arg0, FLD_PDC) / iv->getChannelMaxPower(arg0 - 1) * 100.0f;
} }
return 0.0; return 0.0;
} }