Compare commits

...

4 Commits

Author SHA1 Message Date
jomjol
a91f99faab update 2021-08-01 21:49:29 +02:00
jomjol
17a87b23a1 v8.0.5 2021-08-01 21:46:17 +02:00
jomjol
d4b5ec2ae2 v8.0.4 2021-07-29 20:18:53 +02:00
jomjol
1bcaf09855 v8.0.4 2021-07-29 20:14:36 +02:00
16 changed files with 51 additions and 26 deletions

View File

@@ -47,11 +47,13 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
##### 8.0.3 - Multi Meter Support (2021-07-25)
##### 8.0.5 - Multi Meter Support (2021-07-29)
* NEW 8.0.5: bug fix: saving prevalue
* NEW 8.0.4: bug fix: load config.ini after upgrade
* NEW 8.0.3: bug fix: reboot during `config.ini` handling, html error
* NEW 8.0.2: saving roundes prevalue, bug fix html server
* NEW 8.0.1: bug fix html handling of parameter `FixedExposure` and `ImageSize`
* NEW 8.0.1: bug fix: html handling of parameter `FixedExposure` and `ImageSize`
* Dual / multi meter support (more than 1 number to be recognized)
This is implemented with the feature "number" on the ROI definition as well as selected options
* MQTT: standardization of the naming - including new topics (`json`, `freeMem `, `uptime`)c

View File

@@ -39,18 +39,27 @@ bool ConfigFile::GetNextParagraph(std::string& aktparamgraph, bool &disabled, bo
bool ConfigFile::getNextLine(std::string *rt, bool &disabled, bool &eof)
{
eof = false;
char zw[1024];
char zw[1024] = "";
if (pFile == NULL)
{
*rt = "";
return false;
}
fgets(zw, 1024, pFile);
printf("%s", zw);
if ((strlen(zw) == 0) && feof(pFile))
if (fgets(zw, 1024, pFile))
{
printf("%s", zw);
if ((strlen(zw) == 0) && feof(pFile))
{
*rt = "";
eof = true;
return false;
}
}
else
{
*rt = "";
eof = true;
eof = true;
return false;
}
*rt = zw;

View File

@@ -216,6 +216,7 @@ void GpioHandler::init()
clear();
}
ESP_LOGI(TAG_SERVERGPIO, "read GPIO config and init GPIO");
if (!readConfig()) {
clear();
@@ -225,6 +226,7 @@ void GpioHandler::init()
return;
}
for(std::map<gpio_num_t, GpioPin*>::iterator it = gpioMap->begin(); it != gpioMap->end(); ++it) {
it->second->init();
}

View File

@@ -130,11 +130,9 @@ bool ClassFlow::getNextLine(FILE* pfile, string *rt)
*rt = trim(*rt);
while ((zw[0] == ';' || zw[0] == '#' || (rt->size() == 0)) && !(zw[1] == '[')) // Kommentarzeilen (; oder #) und Leerzeilen überspringen, es sei denn es ist ein neuer auskommentierter Paragraph
{
*rt = "";
if (!fgets(zw, 1024, pfile))
{
*rt = "";
return false;
}
printf("%s", zw);
*rt = zw;
*rt = trim(*rt);

View File

@@ -173,9 +173,12 @@ void ClassFlowControll::InitFlow(std::string config)
}
else
{
fgets(zw, 1024, pFile);
printf("%s", zw);
line = std::string(zw);
line = "";
if (fgets(zw, 1024, pFile) && !feof(pFile))
{
printf("Read: %s", zw);
line = std::string(zw);
}
}
}
@@ -328,7 +331,7 @@ string ClassFlowControll::GetPrevalue(std::string _number)
return std::string();
}
std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string _numbers)
std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string _numbers, bool _extern)
{
float zw;
char* p;
@@ -350,7 +353,7 @@ std::string ClassFlowControll::UpdatePrevalue(std::string _newvalue, std::string
if (flowpostprocessing)
{
flowpostprocessing->SetPreValue(zw, _numbers);
flowpostprocessing->SetPreValue(zw, _numbers, _extern);
return _newvalue;
}

View File

@@ -45,7 +45,7 @@ public:
bool getStatusSetupModus(){return SetupModeActive;};
string getReadout(bool _rawvalue, bool _noerror);
string getReadoutAll(int _type);
string UpdatePrevalue(std::string _newvalue, std::string _numbers);
string UpdatePrevalue(std::string _newvalue, std::string _numbers, bool _extern);
string GetPrevalue(std::string _number = "");
bool ReadParameter(FILE* pfile, string& aktparamgraph);

View File

@@ -152,7 +152,7 @@ bool ClassFlowMQTT::doFlow(string zwtime)
for (int i = 0; i < NUMBERS.size(); ++i)
{
result = NUMBERS[i]->ReturnValueNoError;
result = NUMBERS[i]->ReturnValue;
resulterror = NUMBERS[i]->ErrorMessageText;
resultrate = std::to_string(NUMBERS[i]->FlowRateAct);
resulttimestamp = NUMBERS[i]->timeStamp;

View File

@@ -37,12 +37,22 @@ string ClassFlowPostProcessing::GetPreValue(std::string _number)
return result;
}
void ClassFlowPostProcessing::SetPreValue(float zw, string _numbers)
void ClassFlowPostProcessing::SetPreValue(float zw, string _numbers, bool _extern)
{
printf("SetPrevalue: %f, %s\n", zw, _numbers.c_str());
for (int j = 0; j < NUMBERS.size(); ++j)
{
// printf("Number %d, %s\n", j, NUMBERS[j]->name.c_str());
if (NUMBERS[j]->name == _numbers)
{
NUMBERS[j]->PreValue = zw;
if (_extern)
{
time(&(NUMBERS[j]->lastvalue));
localtime(&(NUMBERS[j]->lastvalue));
}
// printf("Found %d! - set to %f\n", j, NUMBERS[j]->PreValue);
}
}
UpdatePreValueINI = true;
SavePreValue();
@@ -207,8 +217,9 @@ void ClassFlowPostProcessing::SavePreValue()
struct tm* timeinfo = localtime(&NUMBERS[j]->lastvalue);
strftime(buffer, 80, PREVALUE_TIME_FORMAT_OUTPUT, timeinfo);
NUMBERS[j]->timeStamp = std::string(buffer);
// printf("SaverPreValue %d, Value: %f, Nachkomma %d\n", j, NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma);
_zw = NUMBERS[j]->name + "\t" + NUMBERS[j]->timeStamp + "\t" + RundeOutput(NUMBERS[j]->Value, NUMBERS[j]->Nachkomma) + "\n";
_zw = NUMBERS[j]->name + "\t" + NUMBERS[j]->timeStamp + "\t" + RundeOutput(NUMBERS[j]->PreValue, NUMBERS[j]->Nachkomma) + "\n";
printf("Write PreValue Zeile: %s\n", _zw.c_str());
fputs(_zw.c_str(), pFile);

View File

@@ -87,7 +87,7 @@ public:
string getReadoutTimeStamp(int _number = 0);
void SavePreValue();
string GetPreValue(std::string _number = "");
void SetPreValue(float zw, string _numbers);
void SetPreValue(float zw, string _numbers, bool _extern = false);
std::vector<NumberPost*> GetNumbers(){return NUMBERS;};
string name(){return "ClassFlowPostProcessing";};

View File

@@ -569,7 +569,7 @@ esp_err_t handler_prevalue(httpd_req_t *req)
}
else
{
zw = "SetPrevalue to " + tfliteflow.UpdatePrevalue(_size, _numbers);
zw = "SetPrevalue to " + tfliteflow.UpdatePrevalue(_size, _numbers, true);
}
resp_str = zw.c_str();

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="ea72256";
const char* GIT_REV="17a87b2";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2021-07-25 18:09";
const char* BUILD_TIME="2021-08-01 21:47";

View File

@@ -13,7 +13,7 @@ extern "C"
#include "Helper.h"
#include <fstream>
const char* GIT_BASE_BRANCH = "master - v8.0.3 - 2021-07-25";
const char* GIT_BASE_BRANCH = "master - v8.0.5 - 2021-08-01";
const char* git_base_branch(void)

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="ea72256";
const char* GIT_REV="17a87b2";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2021-07-25 18:09";
const char* BUILD_TIME="2021-08-01 21:47";

Binary file not shown.

Binary file not shown.

Binary file not shown.