From b3e03987e7ca072e5765edbc1ece1cd88680b975 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Thu, 10 Apr 2025 16:03:35 +0800 Subject: [PATCH] fix bugs --- common/global.hpp | 2 +- uart/uart_feature_parse.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/common/global.hpp b/common/global.hpp index ad8569c..f8b3ec6 100644 --- a/common/global.hpp +++ b/common/global.hpp @@ -18,7 +18,7 @@ enum enumZigBeeTransmitStatus { //#define NR5G_MODULE -#define Q4G_MODULE +//#define Q4G_MODULE //#define WIFI_MODULE //#define NR5G_MEIGE diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index 6887d2b..0e66e99 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -766,7 +766,7 @@ void Uart::DealWave() { std::string strMeasurementID = ""; std::string strFileName = ""; std::string strProduct = ""; - std::vector vecData; + std::vector vecDataX, vecDataY, vecDataZ; if (wave_trans_) { //对每个传感器的每个通道进行遍历然后处理数据,例如:传感器1x轴的数据处理完后,再去处理y轴的。传感器1的所有数据处理完后,再处理传感器2的 char getzigbeeShortAddr[32] = {0}; sprintf(getzigbeeShortAddr, "zigbeeShortAddr='%02x%02x'", (wave_shortAddr >> 8) & 0xFF,wave_shortAddr & 0xFF); @@ -804,8 +804,8 @@ void Uart::DealWave() { if (m_waveCountX > 0 || VecWaveDataX.size() > 0) { zlog_info(zct, "m_waveCountX = %d,VecWaveData = %d", m_waveCountX, VecWaveDataX.size()); coe = Calcoe(n, WAVE_X, strProduct, range); - vecData = DealData(WAVE_X, coe, sampleRate, ACCSampleTime, strProduct); - WriteDatFile(sampleRate, strMeasurementID, WAVE_X, vecData,strProduct,ACCSampleTime); + vecDataX = DealData(WAVE_X, coe, sampleRate, ACCSampleTime, strProduct); + WriteDatFile(sampleRate, strMeasurementID, WAVE_X, vecDataX,strProduct,ACCSampleTime); m_waveCountX = 0; g_VecWaveDataX.clear(); VecWaveDataX.clear(); @@ -813,8 +813,8 @@ void Uart::DealWave() { if (m_waveCountY > 0 || VecWaveDataY.size() > 0) { zlog_info(zct, "m_waveCountY = %d,VecWaveData = %d", m_waveCountY, VecWaveDataY.size()); coe = Calcoe(n, WAVE_Y, strProduct, range); - vecData = DealData(WAVE_Y, coe, sampleRate, ACCSampleTime, strProduct); - WriteDatFile(sampleRate, strMeasurementID, WAVE_Y, vecData,strProduct,ACCSampleTime); + vecDataY = DealData(WAVE_Y, coe, sampleRate, ACCSampleTime, strProduct); + WriteDatFile(sampleRate, strMeasurementID, WAVE_Y, vecDataY,strProduct,ACCSampleTime); m_waveCountY = 0; g_VecWaveDataY.clear(); VecWaveDataY.clear(); @@ -822,8 +822,8 @@ void Uart::DealWave() { if (m_waveCountZ > 0 || VecWaveDataZ.size() > 0) { zlog_info(zct, "m_waveCountZ = %d,VecWaveDataZ = %d", m_waveCountZ, VecWaveDataZ.size()); coe = Calcoe(n, WAVE_Z, strProduct, range); - vecData = DealData(WAVE_Z, coe, sampleRate, ACCSampleTime, strProduct); - WriteDatFile(sampleRate, strMeasurementID, WAVE_Z, vecData,strProduct,ACCSampleTime); + vecDataZ = DealData(WAVE_Z, coe, sampleRate, ACCSampleTime, strProduct); + WriteDatFile(sampleRate, strMeasurementID, WAVE_Z, vecDataZ,strProduct,ACCSampleTime); m_waveCountZ = 0; g_VecWaveDataZ.clear(); VecWaveDataZ.clear(); @@ -1117,7 +1117,6 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan zlog_info(zct, "rm dat file %s ", tmpCmd); } zlog_info(zct, "write data to filename %s", strFileName.c_str()); - std::vector().swap(vecData); JsonData jd; jd.JsonCmd_32(strMeasurementID,0,1,strChannelID,""); sleep(1);