Browse Source
combine two for-loops into one
waste of time with two for-loops
pull/1638/head
DanielR92
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
8 deletions
-
src/plugins/zeroExport/zeroExport.h
|
|
@ -106,18 +106,14 @@ class ZeroExport { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// Calc Data->groupPower
|
|
|
|
uint16_t groupPower = 0; |
|
|
|
for (uint8_t inv = 0; inv < ZEROEXPORT_GROUP_MAX_INVERTERS; inv++) { |
|
|
|
groupPower += mCfg->groups[group].inverters[inv].power; |
|
|
|
} |
|
|
|
mLog["gP"] = groupPower; |
|
|
|
|
|
|
|
// Calc Data->groupLimit
|
|
|
|
uint16_t groupPower = 0; |
|
|
|
uint16_t groupLimit = 0; |
|
|
|
for (uint8_t inv = 0; inv < ZEROEXPORT_GROUP_MAX_INVERTERS; inv++) { |
|
|
|
groupLimit += mCfg->groups[group].inverters[inv].limit; |
|
|
|
groupPower += mCfg->groups[group].inverters[inv].power; // Calc Data->groupPower
|
|
|
|
groupLimit += mCfg->groups[group].inverters[inv].limit; // Calc Data->groupLimit
|
|
|
|
} |
|
|
|
mLog["gP"] = groupPower; |
|
|
|
mLog["gL"] = groupLimit; |
|
|
|
|
|
|
|
// Batteryprotection
|
|
|
|