mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 21:17:06 +03:00
Implement direct data logging
This commit is contained in:
@@ -95,7 +95,7 @@ void ClassLogFile::WriteToData(std::string _ReturnRawValue, std::string _ReturnV
|
||||
|
||||
strftime(buffer, 80, "%Y-%m-%dT%H:%M:%S", timeinfo);
|
||||
|
||||
zwtime = std::string(buffer) + ":\t";
|
||||
zwtime = std::string(buffer) + "\t";
|
||||
fputs(zwtime.c_str(), pFile);
|
||||
fputs(_ReturnRawValue.c_str(), pFile);
|
||||
fputs("\t", pFile);
|
||||
@@ -104,11 +104,8 @@ void ClassLogFile::WriteToData(std::string _ReturnRawValue, std::string _ReturnV
|
||||
fputs(_ReturnPreValue.c_str(), pFile);
|
||||
fputs("\t", pFile);
|
||||
fputs(_ErrorMessageText.c_str(), pFile);
|
||||
fputs("\t", pFile);
|
||||
fputs(_digital.c_str(), pFile);
|
||||
fputs("\t", pFile);
|
||||
fputs(_analog.c_str(), pFile);
|
||||
fputs("\t", pFile);
|
||||
fputs("\n", pFile);
|
||||
|
||||
fclose(pFile);
|
||||
@@ -284,6 +281,17 @@ void ClassLogFile::RemoveOld()
|
||||
closedir(dir);
|
||||
}
|
||||
|
||||
void ClassLogFile::CreateLogDirectories()
|
||||
{
|
||||
MakeDir("/sdcard/log");
|
||||
MakeDir("/sdcard/log/data");
|
||||
MakeDir("/sdcard/log/analog");
|
||||
MakeDir("/sdcard/log/digit");
|
||||
MakeDir("/sdcard/log/message");
|
||||
MakeDir("/sdcard/log/source");
|
||||
}
|
||||
|
||||
|
||||
ClassLogFile::ClassLogFile(std::string _logroot, std::string _logfile, std::string _logdatapath, std::string _datafile)
|
||||
{
|
||||
logroot = _logroot;
|
||||
@@ -294,6 +302,4 @@ ClassLogFile::ClassLogFile(std::string _logroot, std::string _logfile, std::stri
|
||||
retentionInDays = 10;
|
||||
loglevel = 0;
|
||||
MakeDir("/sdcard/log/data");
|
||||
MakeDir("/sdcard/test");
|
||||
MakeDir("/test");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user