Skip to content

Commit

Permalink
implemented requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vaterlangen committed Oct 12, 2024
1 parent 4234e91 commit dc07b53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/Hoymiles/src/inverters/InverterAbstract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void InverterAbstract::resetRadioStats()
RadioStats = {};
}

std::vector<ChannelNum_t> InverterAbstract::getChannels() const
std::vector<ChannelNum_t> InverterAbstract::getChannelsDC() const
{
std::vector<ChannelNum_t> l;
for (uint8_t i = 0; i < getChannelMetaDataSize(); i++) {
Expand All @@ -299,7 +299,7 @@ std::vector<MpptNum_t> InverterAbstract::getMppts() const
return l;
}

std::vector<ChannelNum_t> InverterAbstract::getChannelsByMppt(const MpptNum_t mppt) const
std::vector<ChannelNum_t> InverterAbstract::getChannelsDCByMppt(const MpptNum_t mppt) const
{
std::vector<ChannelNum_t> l;
for (uint8_t i = 0; i < getChannelMetaDataSize(); i++) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Hoymiles/src/inverters/InverterAbstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ class InverterAbstract {
SystemConfigParaParser* SystemConfigPara();

std::vector<MpptNum_t> getMppts() const;
std::vector<ChannelNum_t> getChannels() const;
std::vector<ChannelNum_t> getChannelsByMppt(const MpptNum_t mppt) const;
std::vector<ChannelNum_t> getChannelsDC() const;
std::vector<ChannelNum_t> getChannelsDCByMppt(const MpptNum_t mppt) const;

protected:
HoymilesRadio* _radio;
Expand Down
6 changes: 3 additions & 3 deletions src/PowerLimiterSolarInverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts)
if (!isProducing()) { return expectedOutputWatts; }

auto pStats = _spInverter->Statistics();
std::vector<ChannelNum_t> dcChnls = _spInverter->getChannels();
std::vector<ChannelNum_t> dcChnls = _spInverter->getChannelsDC();
std::vector<MpptNum_t> dcMppts = _spInverter->getMppts();
size_t dcTotalChnls = dcChnls.size();
size_t dcTotalMppts = dcMppts.size();
Expand Down Expand Up @@ -110,7 +110,7 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts)

for (auto& m : dcMppts) {
float mpptPowerAC = 0.0;
std::vector<ChannelNum_t> mpptChnls = _spInverter->getChannelsByMppt(m);
std::vector<ChannelNum_t> mpptChnls = _spInverter->getChannelsDCByMppt(m);

for (auto& c : mpptChnls) {
mpptPowerAC += pStats->getChannelFieldValue(TYPE_DC, c, FLD_PDC) * inverterEfficiencyFactor;
Expand Down Expand Up @@ -169,7 +169,7 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts)
size_t dcProdMppts = 0;
for (auto& m : dcMppts) {
float dcPowerMppt = 0.0;
std::vector<ChannelNum_t> mpptChnls = _spInverter->getChannelsByMppt(m);
std::vector<ChannelNum_t> mpptChnls = _spInverter->getChannelsDCByMppt(m);

for (auto& c : mpptChnls) {
dcPowerMppt += pStats->getChannelFieldValue(TYPE_DC, c, FLD_PDC);
Expand Down

0 comments on commit dc07b53

Please sign in to comment.