|
@@ -62,7 +62,7 @@ std::string ClassLogFile::getESPHeapInfo(){
|
|
|
return espInfoResultStr;
|
|
return espInfoResultStr;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void ClassLogFile::WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ErrorMessageText, std::string _digital, std::string _analog)
|
|
|
|
|
|
|
+void ClassLogFile::WriteToData(std::string _timestamp, std::string _name, std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ReturnRateValue, std::string _ReturnChangeAbsolute, std::string _ErrorMessageText, std::string _digital, std::string _analog)
|
|
|
{
|
|
{
|
|
|
ESP_LOGD(TAG, "Start WriteToData\n");
|
|
ESP_LOGD(TAG, "Start WriteToData\n");
|
|
|
time_t rawtime;
|
|
time_t rawtime;
|
|
@@ -86,23 +86,20 @@ void ClassLogFile::WriteToData(std::string _ReturnRawValue, std::string _ReturnV
|
|
|
pFile = fopen(logpath.c_str(), "a+");
|
|
pFile = fopen(logpath.c_str(), "a+");
|
|
|
|
|
|
|
|
if (pFile!=NULL) {
|
|
if (pFile!=NULL) {
|
|
|
- time_t rawtime;
|
|
|
|
|
- struct tm* timeinfo;
|
|
|
|
|
- char buffer[80];
|
|
|
|
|
-
|
|
|
|
|
- time(&rawtime);
|
|
|
|
|
- timeinfo = localtime(&rawtime);
|
|
|
|
|
-
|
|
|
|
|
- strftime(buffer, 80, "%Y-%m-%dT%H:%M:%S", timeinfo);
|
|
|
|
|
-
|
|
|
|
|
- zwtime = std::string(buffer) + "\t";
|
|
|
|
|
- fputs(zwtime.c_str(), pFile);
|
|
|
|
|
|
|
+ fputs(_timestamp.c_str(), pFile);
|
|
|
|
|
+ fputs("\t", pFile);
|
|
|
|
|
+ fputs(_name.c_str(), pFile);
|
|
|
|
|
+ fputs("\t", 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(_ReturnPreValue.c_str(), pFile);
|
|
|
fputs("\t", pFile);
|
|
fputs("\t", pFile);
|
|
|
|
|
+ fputs(_ReturnRateValue.c_str(), pFile);
|
|
|
|
|
+ fputs("\t", pFile);
|
|
|
|
|
+ fputs(_ReturnChangeAbsolute.c_str(), pFile);
|
|
|
|
|
+ fputs("\t", pFile);
|
|
|
fputs(_ErrorMessageText.c_str(), pFile);
|
|
fputs(_ErrorMessageText.c_str(), pFile);
|
|
|
fputs(_digital.c_str(), pFile);
|
|
fputs(_digital.c_str(), pFile);
|
|
|
fputs(_analog.c_str(), pFile);
|
|
fputs(_analog.c_str(), pFile);
|