Refactor power factor strategy additions

The PF loop in the constructor (lines 87–90) used string concatenation, while the rest of the constructor uses explicit string literals. 

Changed CB1-8_PF to string literals to match syntax.
This commit is contained in:
2026-04-02 09:01:17 -05:00
committed by GitHub
parent 15b3cbec07
commit 6595958de8

View File

@@ -84,10 +84,14 @@ StandbyState<ModbusIP>::StandbyState() {
addStrategy("CB15_kW", new SingleValueStrategy(3.1F, 3.0f, 1000)); addStrategy("CB15_kW", new SingleValueStrategy(3.1F, 3.0f, 1000));
addStrategy("CB16_kW", new SingleValueStrategy(3.1F, 3.0f, 1000)); addStrategy("CB16_kW", new SingleValueStrategy(3.1F, 3.0f, 1000));
addStrategy("MainCB_PF", new SingleValueStrategy(0.9F, 0.05f, 1000)); addStrategy("CB1_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
for (int i = 1; i <= 8; i++) { addStrategy("CB2_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
addStrategy("CB" + std::to_string(i) + "_PF", new SingleValueStrategy(0.9F, 0.05f, 1000)); addStrategy("CB3_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
} addStrategy("CB4_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
addStrategy("CB5_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
addStrategy("CB6_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
addStrategy("CB7_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
addStrategy("CB8_PF", new SingleValueStrategy(0.9F, 0.05f, 1000));
} }
/** /**