From b87da0f454e6cb5eb3df8eb510050e950b0fabe4 Mon Sep 17 00:00:00 2001 From: lnk Date: Tue, 21 Apr 2026 16:33:46 +0800 Subject: [PATCH] add GGIO type --- cfg_parse/log4.cpp | 12 ++++++------ json/create_json.cpp | 2 +- log4cplus/log4.h | 1 + mms/mmscli_rpt.c | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cfg_parse/log4.cpp b/cfg_parse/log4.cpp index b77f519..a6302f4 100644 --- a/cfg_parse/log4.cpp +++ b/cfg_parse/log4.cpp @@ -354,7 +354,7 @@ protected: std::string final_msg = msg; if (suppressed_before_emit > 0) { std::ostringstream suppressed_oss; - suppressed_oss << msg << " 【中间重复抑制 " + suppressed_oss << msg << " 【已过滤重复同类日志 " << suppressed_before_emit << " 条】"; final_msg = suppressed_oss.str(); @@ -442,14 +442,14 @@ private: RateState& st = s_rate_map[key]; const int RESET_SEC = G_LOG_RATE_RESET_SEC ; // 1小时重置 - const int LIMIT_SEC = G_LOG_RATE_LIMIT_SEC ; // 进入限流后:1分钟1条 + const int LIMIT_SEC = G_LOG_RATE_LIMIT_SEC ; // 进入限流后:多久发1条 主要控制中频和高频那些,低频的都直接放行了 // 初始化 / 强制每小时重置 if (st.last_reset.time_since_epoch().count() == 0) { st.last_reset = now; } else { auto since_reset = duration_cast(now - st.last_reset).count(); - if (since_reset >= RESET_SEC) { + if (since_reset >= RESET_SEC) { //重置周期 st = RateState(); st.last_reset = now; } @@ -467,12 +467,12 @@ private: } else { auto gap_ms = duration_cast(now - st.last_seen).count(); - if (gap_ms >= G_LOG_RATE_KEEP_ALL_MS) { + if (gap_ms >= G_LOG_RATE_KEEP_ALL_MS) { //什么时候不需要限流 //低频 //如果这里设置的很低,就不会限流 allow_burst = -1; // 全部保留 } else if (gap_ms >= G_LOG_RATE_KEEP_BURST_MS) { - allow_burst = G_LOG_RATE_KEEP_BURST_COUNT; // 前60条 + allow_burst = G_LOG_RATE_KEEP_BURST_COUNT; // 前60条 //中频 //如果这里设置的比低频低,也不会生效 } else { - allow_burst = G_LOG_RATE_KEEP_HIGHFREQ_COUNT; // 前10条 + allow_burst = G_LOG_RATE_KEEP_HIGHFREQ_COUNT; // 前10条 //高频 } } diff --git a/json/create_json.cpp b/json/create_json.cpp index 8425058..4faeffd 100644 --- a/json/create_json.cpp +++ b/json/create_json.cpp @@ -2840,7 +2840,7 @@ void processGGIO_start_data_end(char* mp_id,char* fullname,double v,long long ti snprintf(mp_name, sizeof(mp_name), "unknown"); } - DIY_WARNLOG_CODE(mp_id,2 ,LOG_CODE_REPORT, + DIY_WARNLOG_CODE(mp_id,2 ,LOG_CODE_GGIO_LPHD, "监测点:%s(%s),在%s发生事件:%s,事件值:%.2f", mp_name, mp_id, time_str, descBa.constData(), v); diff --git a/log4cplus/log4.h b/log4cplus/log4.h index 7549007..a8ec818 100644 --- a/log4cplus/log4.h +++ b/log4cplus/log4.h @@ -170,6 +170,7 @@ typedef enum LogCode { LOG_CODE_TRANSIENT = 300, /* 暂态发生 */ LOG_CODE_TRANSIENT_COMM = 301, /* 暂态接口 */ LOG_CODE_COMTRADE_FILE = 302, /* 录波文件(Comtrade) */ + LOG_CODE_GGIO_LPHD = 304, /* GGIO事件 */ LOG_CODE_MQ = 400, /* MQ发送 */ LOG_CODE_RT_DATA = 401, /* 实时数据 */ LOG_CODE_LEDGER_UPDATE = 402, /* 台账更新 */ diff --git a/mms/mmscli_rpt.c b/mms/mmscli_rpt.c index 9586b95..0be6095 100644 --- a/mms/mmscli_rpt.c +++ b/mms/mmscli_rpt.c @@ -1455,7 +1455,7 @@ ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va, //need do nothing! not_set_rpt_q_this = FALSE; } - else if (strstr(FULL_FCDA_Name, "GGIO")) + else if (strstr(FULL_FCDA_Name, "GGIO") || strstr(FULL_FCDA_Name, "LPHD")) { not_set_rpt_q_this = FALSE; } @@ -1478,7 +1478,7 @@ ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va, //need do nothing! not_set_rpt_TimeID_this = FALSE; } - else if (strstr(FULL_FCDA_Name, "GGIO")) {//CZY 2023-08-17 WW 2022-11-14修改判断 LLN0$BR$brcbRDRE + else if (strstr(FULL_FCDA_Name, "GGIO") || strstr(FULL_FCDA_Name, "LPHD")) {//CZY 2023-08-17 WW 2022-11-14修改判断 LLN0$BR$brcbRDRE //need do nothing! not_set_rpt_TimeID_this = FALSE; }