Hoymiles Lib: Rename ChannelMaxPower to StringMaxPower
This commit is contained in:
parent
d4c838a16e
commit
ceaf08c1a0
@ -147,15 +147,15 @@ std::list<ChannelNum_t> StatisticsParser::getChannelsByType(ChannelType_t type)
|
||||
return l;
|
||||
}
|
||||
|
||||
uint16_t StatisticsParser::getChannelMaxPower(uint8_t channel)
|
||||
uint16_t StatisticsParser::getStringMaxPower(uint8_t channel)
|
||||
{
|
||||
return _chanMaxPower[channel];
|
||||
return _stringMaxPower[channel];
|
||||
}
|
||||
|
||||
void StatisticsParser::setChannelMaxPower(uint8_t channel, uint16_t power)
|
||||
void StatisticsParser::setStringMaxPower(uint8_t channel, uint16_t power)
|
||||
{
|
||||
if (channel < sizeof(_chanMaxPower) / sizeof(_chanMaxPower[0])) {
|
||||
_chanMaxPower[channel] = power;
|
||||
if (channel < sizeof(_stringMaxPower) / sizeof(_stringMaxPower[0])) {
|
||||
_stringMaxPower[channel] = power;
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,8 +230,8 @@ static float calcEffiencyCh0(StatisticsParser* iv, uint8_t arg0)
|
||||
static float calcIrradiation(StatisticsParser* iv, uint8_t arg0)
|
||||
{
|
||||
if (NULL != iv) {
|
||||
if (iv->getChannelMaxPower(arg0) > 0)
|
||||
return iv->getChannelFieldValue(TYPE_DC, static_cast<ChannelNum_t>(arg0), FLD_PDC) / iv->getChannelMaxPower(arg0) * 100.0f;
|
||||
if (iv->getStringMaxPower(arg0) > 0)
|
||||
return iv->getChannelFieldValue(TYPE_DC, static_cast<ChannelNum_t>(arg0), FLD_PDC) / iv->getStringMaxPower(arg0) * 100.0f;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@ -100,8 +100,8 @@ public:
|
||||
const char* getChannelTypeName(ChannelType_t type);
|
||||
std::list<ChannelNum_t> getChannelsByType(ChannelType_t type);
|
||||
|
||||
uint16_t getChannelMaxPower(uint8_t channel);
|
||||
void setChannelMaxPower(uint8_t channel, uint16_t power);
|
||||
uint16_t getStringMaxPower(uint8_t channel);
|
||||
void setStringMaxPower(uint8_t channel, uint16_t power);
|
||||
|
||||
void resetRxFailureCount();
|
||||
void incrementRxFailureCount();
|
||||
@ -110,7 +110,7 @@ public:
|
||||
private:
|
||||
uint8_t _payloadStatistic[STATISTIC_PACKET_SIZE] = {};
|
||||
uint8_t _statisticLength = 0;
|
||||
uint16_t _chanMaxPower[CH4];
|
||||
uint16_t _stringMaxPower[CH4];
|
||||
|
||||
const std::list<byteAssign_t>* _byteAssignment;
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ void WebApiInverterClass::onInverterAdd(AsyncWebServerRequest* request)
|
||||
|
||||
if (inv != nullptr) {
|
||||
for (uint8_t c = 0; c < INV_MAX_CHAN_COUNT; c++) {
|
||||
inv->Statistics()->setChannelMaxPower(c, inverter->channel[c].MaxChannelPower);
|
||||
inv->Statistics()->setStringMaxPower(c, inverter->channel[c].MaxChannelPower);
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@ void WebApiInverterClass::onInverterEdit(AsyncWebServerRequest* request)
|
||||
|
||||
if (inv != nullptr) {
|
||||
for (uint8_t c = 0; c < INV_MAX_CHAN_COUNT; c++) {
|
||||
inv->Statistics()->setChannelMaxPower(c, inverter.channel[c].MaxChannelPower);
|
||||
inv->Statistics()->setStringMaxPower(c, inverter.channel[c].MaxChannelPower);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -137,7 +137,7 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root)
|
||||
addField(invObject, i, inv, t, c, FLD_PF);
|
||||
addField(invObject, i, inv, t, c, FLD_PRA);
|
||||
addField(invObject, i, inv, t, c, FLD_EFF);
|
||||
if (t == TYPE_DC && inv->Statistics()->getChannelMaxPower(c) > 0) {
|
||||
if (t == TYPE_DC && inv->Statistics()->getStringMaxPower(c) > 0) {
|
||||
addField(invObject, i, inv, t, c, FLD_IRR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ void setup()
|
||||
|
||||
if (inv != nullptr) {
|
||||
for (uint8_t c = 0; c < INV_MAX_CHAN_COUNT; c++) {
|
||||
inv->Statistics()->setChannelMaxPower(c, config.Inverter[i].channel[c].MaxChannelPower);
|
||||
inv->Statistics()->setStringMaxPower(c, config.Inverter[i].channel[c].MaxChannelPower);
|
||||
}
|
||||
}
|
||||
MessageOutput.println(F(" done"));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user