Load command buffer sizes from configuration

Sets values for qpiws, qmod and qpigs from configuration file if they are available.

See commit: dfbb0ecc06
This commit is contained in:
Maxwell
2020-03-10 10:05:45 +02:00
parent de8bc8f812
commit 6b5c5d600a
+8 -2
View File
@@ -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()) {