From e366e895aff067b02340fa451e0718b7649f18db Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Thu, 19 Mar 2026 14:56:38 +0800 Subject: [PATCH] modify mqtt wave bugs --- common/common_func.hpp | 6 +++--- jsonparse/web_cmd_parse3.cpp | 2 +- localserver/web_cmd.cpp | 1 + uart/uart_feature_parse.cpp | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/common_func.hpp b/common/common_func.hpp index 2737732..11f9260 100644 --- a/common/common_func.hpp +++ b/common/common_func.hpp @@ -9,9 +9,9 @@ typedef struct statfs DISK, *pDISK; -#define SECTION_MAX_LEN 256 -#define STRVALUE_MAX_LEN 256 -#define LINE_CONTENT_MAX_LEN 256 +#define SECTION_MAX_LEN 1024 +#define STRVALUE_MAX_LEN 1024 +#define LINE_CONTENT_MAX_LEN 1024 //配置文件位置 #define NETWORK "/etc/network/interfaces" #define SYSTEMINFOFILE "/opt/configenv/SystemInfo.json" //系统信息 diff --git a/jsonparse/web_cmd_parse3.cpp b/jsonparse/web_cmd_parse3.cpp index 363d540..f45331e 100644 --- a/jsonparse/web_cmd_parse3.cpp +++ b/jsonparse/web_cmd_parse3.cpp @@ -1577,7 +1577,7 @@ std::string JsonData::JsonCmd_Cgi_69(Param_69 ¶m){ char whereCon[512] = {0}; char updateSql[256] = {0}; if (param.mMode == 1) { - trigerThresholdEnable = writeIntValue("config", "trigerThresholdEnable", param.trigerThresholdEnable, (char *)GlobalConfig::Config_G.c_str()); + trigerThresholdEnable = writeIntValue("config", "trigerThresholdEnable", param.trigerThresholdEnable ? 1:0, (char *)GlobalConfig::Config_G.c_str()); if(param.vecParam69.size() > 0){ for (size_t i = 0; i < param.vecParam69.size(); i++) { diff --git a/localserver/web_cmd.cpp b/localserver/web_cmd.cpp index 50c2bdc..815505a 100644 --- a/localserver/web_cmd.cpp +++ b/localserver/web_cmd.cpp @@ -634,6 +634,7 @@ std::string LocalServer::HandleCgi_cmd(std::string &pData) { param.mMode = 0; } Json::Value recvDataNodeNo = recvBody["DataNodeNo"]; + param.trigerThresholdEnable = recvBody["threshold"].asBool(); if (recvDataNodeNo.size() > 0) { for (size_t i = 0; i < recvDataNodeNo.size(); i++) { diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index 80cc66f..4932211 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -1377,6 +1377,10 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan outSize = 8192; outputData = Calculation::fftInterpolate(vecData, outSize); zlog_info(zct, " outputData_size %zu ,ACCSampleTime %f", outputData.size(),ACCSampleTime); + }else if(std::fabs(ACCSampleTime - 1.6) < epsilon){ + outSize = 5120; + outputData = Calculation::fftInterpolate(vecData, outSize); + zlog_info(zct, " outputData_size %zu ,ACCSampleTime %f", outputData.size(),ACCSampleTime); } zlog_info(zct, " outputData_size %d ", outputData.size()); float mean = Calculation::mean(outputData);