mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
Implement direct data log
This commit is contained in:
@@ -848,11 +848,11 @@ void ClassFlowPostProcessing::WriteDataLog(int _analog)
|
|||||||
string analog = "";
|
string analog = "";
|
||||||
string digital = "";
|
string digital = "";
|
||||||
if (flowAnalog)
|
if (flowAnalog)
|
||||||
analog = flowAnalog->getReadout(_analog);
|
analog = flowAnalog->getReadoutRawString(_analog);
|
||||||
if (flowDigit)
|
if (flowDigit)
|
||||||
digital = flowDigit->getReadout(_analog);
|
digital = flowDigit->getReadoutRawString(_analog);
|
||||||
// LogFile.WriteToFile(analog);
|
// LogFile.WriteToFile(analog);
|
||||||
LogFile.WriteToData(NUMBERS[_analog]->ReturnRawValue, NUMBERS[_analog]->ReturnValue, NUMBERS[_analog]->ErrorMessageText, digital, analog);
|
LogFile.WriteToData(NUMBERS[_analog]->ReturnRawValue, NUMBERS[_analog]->ReturnValue, NUMBERS[_analog]->ReturnPreValue, NUMBERS[_analog]->ErrorMessageText, digital, analog);
|
||||||
printf("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());
|
printf("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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ std::string ClassLogFile::getESPHeapInfo(){
|
|||||||
return espInfoResultStr;
|
return espInfoResultStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassLogFile::WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ErrorMessageText, std::string _digital, std::string _analog)
|
void ClassLogFile::WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ErrorMessageText, std::string _digital, std::string _analog)
|
||||||
{
|
{
|
||||||
printf("Start WriteToData\n");
|
printf("Start WriteToData\n");
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
@@ -95,12 +95,14 @@ void ClassLogFile::WriteToData(std::string _ReturnRawValue, std::string _ReturnV
|
|||||||
|
|
||||||
strftime(buffer, 80, "%Y-%m-%dT%H:%M:%S", timeinfo);
|
strftime(buffer, 80, "%Y-%m-%dT%H:%M:%S", timeinfo);
|
||||||
|
|
||||||
zwtime = std::string(buffer) + ":";
|
zwtime = std::string(buffer) + ":\t";
|
||||||
fputs(zwtime.c_str(), pFile);
|
fputs(zwtime.c_str(), pFile);
|
||||||
fputs(_ReturnRawValue.c_str(), pFile);
|
fputs(_ReturnRawValue.c_str(), pFile);
|
||||||
fputs("\t", pFile);
|
fputs("\t", pFile);
|
||||||
fputs(_ReturnValue.c_str(), pFile);
|
fputs(_ReturnValue.c_str(), pFile);
|
||||||
fputs("\t", pFile);
|
fputs("\t", pFile);
|
||||||
|
fputs(_ReturnPreValue.c_str(), pFile);
|
||||||
|
fputs("\t", pFile);
|
||||||
fputs(_ErrorMessageText.c_str(), pFile);
|
fputs(_ErrorMessageText.c_str(), pFile);
|
||||||
fputs("\t", pFile);
|
fputs("\t", pFile);
|
||||||
fputs(_digital.c_str(), pFile);
|
fputs(_digital.c_str(), pFile);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
void WriteToDedicatedFile(std::string _fn, std::string info, bool _time = true);
|
void WriteToDedicatedFile(std::string _fn, std::string info, bool _time = true);
|
||||||
void RemoveOld();
|
void RemoveOld();
|
||||||
|
|
||||||
void WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ErrorMessageText, std::string _digital, std::string _analog);
|
void WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ErrorMessageText, std::string _digital, std::string _analog);
|
||||||
|
|
||||||
|
|
||||||
std::string GetCurrentFileName();
|
std::string GetCurrentFileName();
|
||||||
|
|||||||
Reference in New Issue
Block a user