From 6b5c5d600ab58eced107d51f4232d95a382bed88 Mon Sep 17 00:00:00 2001 From: Maxwell Date: Tue, 10 Mar 2020 10:05:45 +0200 Subject: [PATCH] Load command buffer sizes from configuration Sets values for qpiws, qmod and qpigs from configuration file if they are available. See commit: dfbb0ecc0688ee47078f159e4007669523f4a80d --- sources/inverter-cli/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sources/inverter-cli/main.cpp b/sources/inverter-cli/main.cpp index e54c741..7650fab 100644 --- a/sources/inverter-cli/main.cpp +++ b/sources/inverter-cli/main.cpp @@ -43,7 +43,7 @@ string devicename; int runinterval; float ampfactor; float wattfactor; -int qpiri; +int qpiri, qpiws, qmod, qpigs; // --------------------------------------- @@ -93,6 +93,12 @@ void getSettingsFile(string filename) { attemptAddSetting(&wattfactor, linepart2); else if(linepart1 == "qpiri") attemptAddSetting(&qpiri, linepart2); + else if(linepart1 == "qpiws") + attemptAddSetting(&qpiws, linepart2); + else if(linepart1 == "qmod") + attemptAddSetting(&qmod, linepart2); + else if(linepart1 == "qpigs") + attemptAddSetting(&qpigs, linepart2); else continue; } @@ -174,7 +180,7 @@ int main(int argc, char* argv[]) { } bool ups_status_changed(false); - ups = new cInverter(devicename,qpiri); + ups = new cInverter(devicename,qpiri,qpiws,qmod,qpigs); // Logic to send 'raw commands' to the inverter.. if (!rawcmd.empty()) {