diff --git a/FeatureRequest.md b/FeatureRequest.md index 03953fbf..c28745b5 100644 --- a/FeatureRequest.md +++ b/FeatureRequest.md @@ -11,6 +11,12 @@ ____ +#### #8 MQTT configurable readout intervall + +Make the readout intervall configurable via MQTT. + +* Change the mqtt part to receive and process input and not only sending + #### #7 Extended Error Handling Check different types of error (e.g. tflite not availabe) and generate an error on the html page. diff --git a/README.md b/README.md index 4321fe52..5ed3264a 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,11 @@ In other cases you can contact the developer via email: -1) - { _digit = _decsep.substr(0, _pospunkt); - } else - { _digit = "default"; - } for (int j = 0; j < NUMBERS.size(); ++j) { @@ -271,6 +267,32 @@ void ClassFlowPostProcessing::handleDecimalSeparator(string _decsep, string _val } } +void ClassFlowPostProcessing::handleMaxRateValue(string _decsep, string _value) +{ + string _digit, _decpos; + int _pospunkt = _decsep.find_first_of("."); +// printf("Name: %s, Pospunkt: %d\n", _decsep.c_str(), _pospunkt); + if (_pospunkt > -1) + _digit = _decsep.substr(0, _pospunkt); + else + _digit = "default"; + + for (int j = 0; j < NUMBERS.size(); ++j) + { + if (_digit == "default") // erstmal auf default setzen (falls sonst nichts gesetzt) + { + NUMBERS[j]->useMaxRateValue = true; + NUMBERS[j]->MaxRateValue = stof(_value); + } + + if (NUMBERS[j]->name == _digit) + { + NUMBERS[j]->useMaxRateValue = true; + NUMBERS[j]->MaxRateValue = stof(_value); + } + } +} + bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph) { @@ -299,43 +321,39 @@ bool ClassFlowPostProcessing::ReadParameter(FILE* pfile, string& aktparamgraph) { handleDecimalSeparator(zerlegt[0], zerlegt[1]); } + if ((toUpper(_param) == "MAXRATEVALUE") && (zerlegt.size() > 1)) + { + handleDecimalSeparator(zerlegt[0], zerlegt[1]); + } - if ((toUpper(zerlegt[0]) == "PREVALUEUSE") && (zerlegt.size() > 1)) + if ((toUpper(_param) == "PREVALUEUSE") && (zerlegt.size() > 1)) { if (toUpper(zerlegt[1]) == "TRUE") { PreValueUse = true; } } - if ((toUpper(zerlegt[0]) == "CHECKDIGITINCREASECONSISTENCY") && (zerlegt.size() > 1)) + if ((toUpper(_param) == "CHECKDIGITINCREASECONSISTENCY") && (zerlegt.size() > 1)) { if (toUpper(zerlegt[1]) == "TRUE") for (_n = 0; _n < NUMBERS.size(); ++_n) NUMBERS[_n]->checkDigitIncreaseConsistency = true; } - if ((toUpper(zerlegt[0]) == "ALLOWNEGATIVERATES") && (zerlegt.size() > 1)) + if ((toUpper(_param) == "ALLOWNEGATIVERATES") && (zerlegt.size() > 1)) { if (toUpper(zerlegt[1]) == "TRUE") for (_n = 0; _n < NUMBERS.size(); ++_n) NUMBERS[_n]->AllowNegativeRates = true; } - if ((toUpper(zerlegt[0]) == "ERRORMESSAGE") && (zerlegt.size() > 1)) + if ((toUpper(_param) == "ERRORMESSAGE") && (zerlegt.size() > 1)) { if (toUpper(zerlegt[1]) == "TRUE") ErrorMessage = true; } - if ((toUpper(zerlegt[0]) == "PREVALUEAGESTARTUP") && (zerlegt.size() > 1)) + if ((toUpper(_param) == "PREVALUEAGESTARTUP") && (zerlegt.size() > 1)) { PreValueAgeStartup = std::stoi(zerlegt[1]); } - if ((toUpper(zerlegt[0]) == "MAXRATEVALUE") && (zerlegt.size() > 1)) - { - for (_n = 0; _n < NUMBERS.size(); ++_n) - { - NUMBERS[_n]->useMaxRateValue = true; - NUMBERS[_n]->MaxRateValue = std::stof(zerlegt[1]); - } - } } if (PreValueUse) { diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h index 30cd4da9..48a5510e 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h @@ -53,15 +53,8 @@ protected: bool PreValueUse; int PreValueAgeStartup; -// bool AllowNegativeRates; -// float MaxRateValue; -// bool useMaxRateValue; bool ErrorMessage; - // bool PreValueOkay; -// bool checkDigitIncreaseConsistency; -// int DecimalShift; -// time_t lastvalue; -// float FlowRateAct; // m3 / min + ClassFlowAnalog* flowAnalog; ClassFlowDigit* flowDigit; @@ -80,6 +73,7 @@ protected: void InitNUMBERS(); void handleDecimalSeparator(string _decsep, string _value); + void handleMaxRateValue(string _decsep, string _value); public: diff --git a/code/main/version.cpp b/code/main/version.cpp index 9f656470..ae5cc279 100644 --- a/code/main/version.cpp +++ b/code/main/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="45154cb"; +const char* GIT_REV="f243f4b"; const char* GIT_TAG=""; const char* GIT_BRANCH="rolling"; -const char* BUILD_TIME="2021-07-01 19:03"; \ No newline at end of file +const char* BUILD_TIME="2021-07-04 06:46"; \ No newline at end of file diff --git a/code/version.cpp b/code/version.cpp index 9f656470..ae5cc279 100644 --- a/code/version.cpp +++ b/code/version.cpp @@ -1,4 +1,4 @@ -const char* GIT_REV="45154cb"; +const char* GIT_REV="f243f4b"; const char* GIT_TAG=""; const char* GIT_BRANCH="rolling"; -const char* BUILD_TIME="2021-07-01 19:03"; \ No newline at end of file +const char* BUILD_TIME="2021-07-04 06:46"; \ No newline at end of file diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin index 1bbf3c6c..feded967 100644 Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ diff --git a/firmware/firmware.bin b/firmware/firmware.bin index cd6e5789..b44f28b7 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/html.zip b/firmware/html.zip index a907ca0b..ce2ce090 100644 Binary files a/firmware/html.zip and b/firmware/html.zip differ diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 8fd92d23..b05d5b37 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -410,20 +410,6 @@ textarea { Set on "false" to ensure, that only positive changes are accepted (typically for counter) - - - - - - MaxRateValue - - - - - - Maximum change of reading from one to the next readout - - @@ -484,6 +470,20 @@ textarea { shift the digit separator within the digital digits (positiv and negativ) + + + + + + MaxRateValue + + + + + + Maximum change of reading from one to the next readout + + @@ -722,7 +722,6 @@ function LoadConfigNeu() { alert("Config.ini could not be loaded!\nPlease reload the page."); return; } -// loadConfig(basepath); ParseConfig(); param = getConfigParameters(); category = getConfigCategory(); @@ -942,11 +941,13 @@ function UpdateInputIndividual() if (NUNBERSAkt != -1) { ReadParameter(param, "PostProcessing", "DecimalShift", true, false, NUNBERSAkt) + ReadParameter(param, "PostProcessing", "MaxRateValue", true, false, NUNBERSAkt) } var sel = document.getElementById("Numbers_value1"); NUNBERSAkt = sel.selectedIndex; WriteParameter(param, category, "PostProcessing", "DecimalShift", true, false, 1, NUNBERSAkt); + WriteParameter(param, category, "PostProcessing", "MaxRateValue", true, false, 1, NUNBERSAkt); } function UpdateInput() { @@ -982,7 +983,7 @@ function UpdateInput() { WriteParameter(param, category, "PostProcessing", "PreValueUse", true, true); WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true); WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true, true); - WriteParameter(param, category, "PostProcessing", "MaxRateValue", true); +// WriteParameter(param, category, "PostProcessing", "MaxRateValue", true); WriteParameter(param, category, "PostProcessing", "ErrorMessage", true, true); WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", true, true); diff --git a/sd-card/html/gethost.js b/sd-card/html/gethost.js index c927be05..223ea964 100644 --- a/sd-card/html/gethost.js +++ b/sd-card/html/gethost.js @@ -8,8 +8,8 @@ function getbasepath(){ if ((host == "127.0.0.1") || (host == "localhost")) { // host = "http://192.168.2.219"; // jomjol interner test - host = "http://192.168.178.47"; // jomjol interner test -// host = "http://192.168.178.22"; // jomjol interner Real +// host = "http://192.168.178.47"; // jomjol interner test + host = "http://192.168.178.22"; // jomjol interner Real // host = "."; // jomjol interner localhost diff --git a/sd-card/html/readconfigparam.js b/sd-card/html/readconfigparam.js index 2ed02107..9895321c 100644 --- a/sd-card/html/readconfigparam.js +++ b/sd-card/html/readconfigparam.js @@ -74,7 +74,7 @@ function ParseConfig() { ParamAddValue(param, catname, "PreValueUse"); ParamAddValue(param, catname, "PreValueAgeStartup"); ParamAddValue(param, catname, "AllowNegativeRates"); - ParamAddValue(param, catname, "MaxRateValue"); + ParamAddValue(param, catname, "MaxRateValue", 1, true); ParamAddValue(param, catname, "ErrorMessage"); ParamAddValue(param, catname, "CheckDigitIncreaseConsistency"); @@ -476,7 +476,8 @@ function getNUMBERS(_name, _type, _create = true) for (_cat in param) for (_param in param[_cat]) if (param[_cat][_param]["Numbers"] == true){ - _ret[_cat] = new Object(); + if (typeof _ret[_cat] == 'undefined') + _ret[_cat] = new Object(); _ret[_cat][_param] = new Object(); _ret[_cat][_param]["found"] = false; _ret[_cat][_param]["enabled"] = false; diff --git a/sd-card/html/version.txt b/sd-card/html/version.txt index f7ee0669..47da986f 100644 --- a/sd-card/html/version.txt +++ b/sd-card/html/version.txt @@ -1 +1 @@ -9.0.0 +9.1.0