From bc8c84386593e0dfd337494ff56f529c037b93b4 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Wed, 1 Apr 2026 17:41:07 +0800 Subject: [PATCH] fix bugs , add log --- dbaccess/sql_db.cpp | 1 + jsonparse/web_cmd_parse2.cpp | 2 +- uart/uart.cpp | 17 +++++++++++------ uart/uart_feature_parse.cpp | 12 ++++++------ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dbaccess/sql_db.cpp b/dbaccess/sql_db.cpp index c160363..d16bcbb 100644 --- a/dbaccess/sql_db.cpp +++ b/dbaccess/sql_db.cpp @@ -1349,6 +1349,7 @@ int SqliteDB::QueryofflineData() { valdatastatic["dataNodeNo"] = arrRetData[j][0].c_str(); valNodeData.append(valdatastatic); + valNodeData.append(valNodeData); root["data"] = valNodeData; root["TimeStamp"] = atoi(arrRetData[j][8].c_str()); diff --git a/jsonparse/web_cmd_parse2.cpp b/jsonparse/web_cmd_parse2.cpp index e1e08a6..c11eaed 100644 --- a/jsonparse/web_cmd_parse2.cpp +++ b/jsonparse/web_cmd_parse2.cpp @@ -672,7 +672,7 @@ std::string JsonData::JsonCmd_Cgi_30(Param_30 ¶m) { resolution = 1 / 3.2; } - zlog_info(zct, "the sample rate is %d,the resolution %f", SampleRate, resolution); + zlog_info(zct, "the sample rate is %d,the resolution %f,fftWave %d", SampleRate, resolution,fftWave.size()); char buf[32]; memset(buf, 0, 32); sprintf(buf, "%f", resolution); diff --git a/uart/uart.cpp b/uart/uart.cpp index d52cac4..7a5e407 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -654,12 +654,17 @@ int Uart::DealFeatureValue(const char *pData,uint16_t ushortAdd){ } char logInfo[100] = {0x00}; std::vector& data_vec = map_send_data[ushortAdd]; - const uint8_t* send_data = data_vec.data(); - WriteToUart((const char*)send_data, 100); - mssleep(50000); - WriteToUart((const char*)send_data, 100); - mssleep(50000); - WriteToUart((const char*)send_data, 100); + if (data_vec.size() > 0) + { + const uint8_t* send_data = data_vec.data(); + WriteToUart((const char*)send_data, 100); + mssleep(50000); + WriteToUart((const char*)send_data, 100); + mssleep(50000); + WriteToUart((const char*)send_data, 100); + } + + }else { DealAskTask(ushortAdd); DealDataNodeFeature(pData, 0); diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index fef7493..1a6f352 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -1360,32 +1360,32 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan case WAVE_X: { strFileName = "/opt/data/" + strMeasurementID + "-X.dat"; strChannelID = strMeasurementID + "-X"; - wave_type = WAVE_X; + wave_type = 0; } break; case WAVE_Y: { strFileName = "/opt/data/" + strMeasurementID + "-Y.dat"; strChannelID = strMeasurementID + "-Y"; - wave_type = WAVE_Y; + wave_type = 0; } break; case WAVE_Z: { strFileName = "/opt/data/" + strMeasurementID + "-Z.dat"; strChannelID = strMeasurementID + "-Z"; - wave_type = WAVE_Z; + wave_type = 0; } break; case WAVE_LF_X: { strFileName = "/opt/data/" + strMeasurementID + "-X-LF.dat"; strChannelID = strMeasurementID + "-X"; - wave_type = WAVE_LF_X; + wave_type = 1; } break; case WAVE_LF_Y: { strFileName = "/opt/data/" + strMeasurementID + "-Y-LF.dat"; strChannelID = strMeasurementID + "-Y"; - wave_type = WAVE_LF_Y; + wave_type = 1; } break; case WAVE_LF_Z: { strFileName = "/opt/data/" + strMeasurementID + "-Z-LF.dat"; strChannelID = strMeasurementID + "-Z"; - wave_type = WAVE_LF_Z; + wave_type = 1; } break; default: break; }