mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-27 12:50:39 +03:00
Merge branch 'rolling' into add-log-level-to-logfile2
This commit is contained in:
@@ -21,6 +21,22 @@ static const char* TAG = "class_flow_postproc";
|
||||
#define PREVALUE_TIME_FORMAT_INPUT "%d-%d-%dT%d:%d:%d"
|
||||
|
||||
|
||||
std::string ClassFlowPostProcessing::getNumbersName()
|
||||
{
|
||||
std::string ret="";
|
||||
|
||||
for (int i = 0; i < NUMBERS.size(); ++i)
|
||||
{
|
||||
ret += NUMBERS[i]->name;
|
||||
if (i < NUMBERS.size()-1)
|
||||
ret = ret + "\t";
|
||||
}
|
||||
|
||||
// ESP_LOGI(TAG, "Result ClassFlowPostProcessing::getNumbersName: %s", ret.c_str());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string ClassFlowPostProcessing::GetJSON(std::string _id, std::string _mac, std::string _lineend)
|
||||
{
|
||||
std::string json="{" + _lineend;
|
||||
@@ -848,17 +864,26 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ClassFlowPostProcessing::WriteDataLog(int _analog)
|
||||
void ClassFlowPostProcessing::WriteDataLog(int _index)
|
||||
{
|
||||
string analog = "";
|
||||
string digital = "";
|
||||
string timezw = "";
|
||||
char buffer[80];
|
||||
struct tm* timeinfo = localtime(&NUMBERS[_index]->lastvalue);
|
||||
strftime(buffer, 80, PREVALUE_TIME_FORMAT_OUTPUT, timeinfo);
|
||||
timezw = std::string(buffer);
|
||||
|
||||
if (flowAnalog)
|
||||
analog = flowAnalog->getReadoutRawString(_analog);
|
||||
analog = flowAnalog->getReadoutRawString(_index);
|
||||
if (flowDigit)
|
||||
digital = flowDigit->getReadoutRawString(_analog);
|
||||
// LogFile.WriteToFile(ESP_LOG_INFO, analog);
|
||||
LogFile.WriteToData(NUMBERS[_analog]->ReturnRawValue, NUMBERS[_analog]->ReturnValue, NUMBERS[_analog]->ReturnPreValue, NUMBERS[_analog]->ErrorMessageText, digital, analog);
|
||||
ESP_LOGD(TAG, "WriteDataLog: %s, %s, %s, %s, %s", NUMBERS[_analog]->ReturnRawValue.c_str(), NUMBERS[_analog]->ReturnValue.c_str(), NUMBERS[_analog]->ErrorMessageText.c_str(), digital.c_str(), analog.c_str());
|
||||
digital = flowDigit->getReadoutRawString(_index);
|
||||
LogFile.WriteToData(timezw, NUMBERS[_index]->name,
|
||||
NUMBERS[_index]->ReturnRawValue, NUMBERS[_index]->ReturnValue, NUMBERS[_index]->ReturnPreValue,
|
||||
NUMBERS[_index]->ReturnRateValue, NUMBERS[_index]->ReturnChangeAbsolute,
|
||||
NUMBERS[_index]->ErrorMessageText,
|
||||
digital, analog);
|
||||
ESP_LOGD(TAG, "WriteDataLog: %s, %s, %s, %s, %s", NUMBERS[_index]->ReturnRawValue.c_str(), NUMBERS[_index]->ReturnValue.c_str(), NUMBERS[_index]->ErrorMessageText.c_str(), digital.c_str(), analog.c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -918,6 +943,8 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue, bool _noerror, i
|
||||
return NUMBERS[_number]->ReturnValue;
|
||||
}
|
||||
|
||||
/* Jetzt als globale Funktion in Helper.h
|
||||
|
||||
string ClassFlowPostProcessing::RundeOutput(double _in, int _anzNachkomma){
|
||||
std::stringstream stream;
|
||||
int _zw = _in;
|
||||
@@ -940,6 +967,7 @@ string ClassFlowPostProcessing::RundeOutput(double _in, int _anzNachkomma){
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
string ClassFlowPostProcessing::ErsetzteN(string input, double _prevalue)
|
||||
|
||||
Reference in New Issue
Block a user