fix realdata in different icd
This commit is contained in:
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -8,8 +8,8 @@
|
|||||||
"args": [],
|
"args": [],
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"externalConsole": true,
|
"externalConsole": true,
|
||||||
"cwd": "d:/canneng/pms3.0_czy_2024-10-9/pt61850netd_pqfe/mms",
|
"cwd": "d:/canneng/pms3.0_czy_2024-10-9/pt61850netd_pqfe/json",
|
||||||
"program": "d:/canneng/pms3.0_czy_2024-10-9/pt61850netd_pqfe/mms/build/Debug/outDebug",
|
"program": "d:/canneng/pms3.0_czy_2024-10-9/pt61850netd_pqfe/json/build/Debug/outDebug",
|
||||||
"MIMode": "gdb",
|
"MIMode": "gdb",
|
||||||
"miDebuggerPath": "gdb",
|
"miDebuggerPath": "gdb",
|
||||||
"setupCommands": [
|
"setupCommands": [
|
||||||
|
|||||||
@@ -1974,7 +1974,7 @@ QString BAK_WEBSERVICE_3S_TRIG_COMMAND_XML_FN = THREE_SECS_WEBSERVICE_DIR + "bak
|
|||||||
int parse_3s_xml(trigger_3s_xml_t* trigger_3s_xml)
|
int parse_3s_xml(trigger_3s_xml_t* trigger_3s_xml)
|
||||||
{
|
{
|
||||||
//调试用
|
//调试用
|
||||||
printf("begin 3s xml...\n");
|
//printf("begin 3s xml...\n");
|
||||||
memset(trigger_3s_xml, 0, sizeof(trigger_3s_xml_t));
|
memset(trigger_3s_xml, 0, sizeof(trigger_3s_xml_t));
|
||||||
|
|
||||||
//这个文件是用来记录正在进行中的实时触发
|
//这个文件是用来记录正在进行中的实时触发
|
||||||
@@ -2001,7 +2001,7 @@ int parse_3s_xml(trigger_3s_xml_t* trigger_3s_xml)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//调试用
|
//调试用
|
||||||
printf("3s xml fail...\n");
|
//printf("3s xml fail...\n");
|
||||||
return APR_EGENERAL;
|
return APR_EGENERAL;
|
||||||
}
|
}
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ bool showinshellflag =false;
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
const int MAX_LIST_SIZE = 16;
|
const int MAX_LIST_SIZE = 16;
|
||||||
static QMap<int, QList<long long> > real_data_report_map;
|
//static QMap<int, QList<long long> > real_data_report_map;
|
||||||
|
static QMap<int, QMap<int, QList<long long>>> real_data_report_map; //多个监测点的多个实时报告的时间列表lnk20250624
|
||||||
static QMap<QString, json_block_data*> json_data_map;//CZY 2023-08-17 ww 2023年3月13日17:23:17扩展Map,用于保存各条线路的数据
|
static QMap<QString, json_block_data*> json_data_map;//CZY 2023-08-17 ww 2023年3月13日17:23:17扩展Map,用于保存各条线路的数据
|
||||||
static QMap<QString, json_block_data*> json_flicker_data_map;//CZY 2023-09-11 展Map,用于保存各条线路的闪变数据
|
static QMap<QString, json_block_data*> json_flicker_data_map;//CZY 2023-09-11 展Map,用于保存各条线路的闪变数据
|
||||||
static QMap<QString, json_block_data*> json_pst_data_map;//CZY 2023-09-11 展Map,用于保存各条线路的闪变数据
|
static QMap<QString, json_block_data*> json_pst_data_map;//CZY 2023-09-11 展Map,用于保存各条线路的闪变数据
|
||||||
@@ -156,9 +157,9 @@ bool is_blank(const std::string& str)
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int urcbRealDataHasReceived(int dev_index, LD_info_t* LD_info, long long Time)
|
int urcbRealDataHasReceived(int dev_index, int rptNo, LD_info_t* LD_info, long long Time) //增加报告入参lnk20250624
|
||||||
{
|
{
|
||||||
QList<long long>& ts_list = real_data_report_map[LD_info->line_id];
|
QList<long long>& ts_list = real_data_report_map[LD_info->line_id][rptNo];
|
||||||
bool bFind = ts_list.contains(Time); //实时数据时间链表
|
bool bFind = ts_list.contains(Time); //实时数据时间链表
|
||||||
if (bFind == false) {
|
if (bFind == false) {
|
||||||
ts_list.append(Time);
|
ts_list.append(Time);
|
||||||
@@ -167,7 +168,8 @@ int urcbRealDataHasReceived(int dev_index, LD_info_t* LD_info, long long Time)
|
|||||||
|
|
||||||
//lnk20241223每收到一次实时数据就检查一下数量
|
//lnk20241223每收到一次实时数据就检查一下数量
|
||||||
int real_report_count = 0;
|
int real_report_count = 0;
|
||||||
real_report_count = get_real_report_count(LD_info);
|
//real_report_count = get_real_report_count(LD_info);
|
||||||
|
real_report_count = LD_info->rptinfo[rptNo]->count;//lnk20250624
|
||||||
|
|
||||||
//调试
|
//调试
|
||||||
std::cout << "real_report_count is" << real_report_count << std::endl;
|
std::cout << "real_report_count is" << real_report_count << std::endl;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ void del_mvl_type_ctrl();
|
|||||||
#define DB_INTERFACE_H
|
#define DB_INTERFACE_H
|
||||||
// 前向声明 LD_info_t
|
// 前向声明 LD_info_t
|
||||||
typedef struct LD_info_t LD_info_t;
|
typedef struct LD_info_t LD_info_t;
|
||||||
int urcbRealDataHasReceived(int dev_index, LD_info_t* LD_info, long long Time); //lnk20241223
|
int urcbRealDataHasReceived(int dev_index,int rptNo, LD_info_t* LD_info, long long Time); //lnk20241223 20250624
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
apr_status_t app_get_private_config(const char *myfilename);
|
apr_status_t app_get_private_config(const char *myfilename);
|
||||||
|
|||||||
@@ -1085,12 +1085,12 @@ ST_VOID u_iec_rpt_ind_data_by_devtype(MVL_VAR_ASSOC** info_va,
|
|||||||
json_block_create_time(LD_info->mp_id, t / 1000, rptinfo->flickerflag);
|
json_block_create_time(LD_info->mp_id, t / 1000, rptinfo->flickerflag);
|
||||||
printf("rcb_info->RptID=%s ,LineId=%d , Timestamp= %lld \n", rcb_info->RptID, LD_info->line_id, t / 1000);
|
printf("rcb_info->RptID=%s ,LineId=%d , Timestamp= %lld \n", rcb_info->RptID, LD_info->line_id, t / 1000);
|
||||||
not_set_rpt_TimeID_this = FALSE;
|
not_set_rpt_TimeID_this = FALSE;
|
||||||
if (strstr(rcb_info->RptID, "LLN0$RP$urcbRealData")) {
|
/*if (strstr(rcb_info->RptID, "LLN0$RP$urcbRealData")) {//lnk 20250624
|
||||||
//20241223lnk添加终端号参数
|
//20241223lnk添加终端号参数
|
||||||
ied_usr_t *ied_usr = GET_IEDEXT_ADDR(ied);
|
ied_usr_t *ied_usr = GET_IEDEXT_ADDR(ied);
|
||||||
if (urcbRealDataHasReceived(ied_usr->dev_idx,LD_info, t / 1000))
|
if (urcbRealDataHasReceived(ied_usr->dev_idx,LD_info, t / 1000))
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1196,6 +1196,20 @@ ST_VOID u_iec_rpt_ind_data_by_devtype(MVL_VAR_ASSOC** info_va,
|
|||||||
echo_err5("va_num!=va_total! Report From %s %s %s , %d!=%d !!!",
|
echo_err5("va_num!=va_total! Report From %s %s %s , %d!=%d !!!",
|
||||||
APR_EGENERAL, chnl_usr->ip_str, LD_info->LD_name, rcb_info->RptID, va_num, va_total);
|
APR_EGENERAL, chnl_usr->ip_str, LD_info->LD_name, rcb_info->RptID, va_num, va_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//lnk 20250624匹配不同的实时控制块
|
||||||
|
const char* extractAfterUrCb(const char* rptID) {
|
||||||
|
if (!rptID) return NULL;
|
||||||
|
|
||||||
|
// 查找 "urcb"(区分大小写)
|
||||||
|
const char* pos = strstr(rptID, "urcb");
|
||||||
|
if (!pos) return rptID; // 如果没有 urcb,就退而求其次返回整个字符串
|
||||||
|
|
||||||
|
return pos + 4; // 返回 "urcb" 后面的部分指针
|
||||||
|
}
|
||||||
|
//lnk
|
||||||
|
|
||||||
ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va,
|
ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va,
|
||||||
ST_UINT8* OptFldsData, /* ptr to data part of OptFlds bvstring */
|
ST_UINT8* OptFldsData, /* ptr to data part of OptFlds bvstring */
|
||||||
ST_UINT8* InclusionData, /* ptr to Inclusion bstring */
|
ST_UINT8* InclusionData, /* ptr to Inclusion bstring */
|
||||||
@@ -1380,6 +1394,7 @@ ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va,
|
|||||||
if (LD_info->rptPstRecvCheckFlag == 0)
|
if (LD_info->rptPstRecvCheckFlag == 0)
|
||||||
json_block_create_start(LD_info->voltage_level, LD_info->mp_id, rptinfo->flickerflag, ied_usr->dev_type, LD_info->line_id);
|
json_block_create_start(LD_info->voltage_level, LD_info->mp_id, rptinfo->flickerflag, ied_usr->dev_type, LD_info->line_id);
|
||||||
LD_info->rptPstRecvCheckFlag |= 0x01 << rptinfo->rptNo;
|
LD_info->rptPstRecvCheckFlag |= 0x01 << rptinfo->rptNo;
|
||||||
|
printf("LD_info->rptPstRecvCheckFlag=%d",LD_info->rptPstRecvCheckFlag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1478,11 +1493,20 @@ ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va,
|
|||||||
json_block_create_time(LD_info->mp_id, t / 1000, rptinfo->flickerflag);
|
json_block_create_time(LD_info->mp_id, t / 1000, rptinfo->flickerflag);
|
||||||
printf("rcb_info->RptID=%s ,LineId=%d , Timestamp= %lld \n", rcb_info->RptID, LD_info->line_id, t / 1000);
|
printf("rcb_info->RptID=%s ,LineId=%d , Timestamp= %lld \n", rcb_info->RptID, LD_info->line_id, t / 1000);
|
||||||
not_set_rpt_TimeID_this = FALSE;
|
not_set_rpt_TimeID_this = FALSE;
|
||||||
if (strstr(rcb_info->RptID, "LLN0$RP$urcbRealData")) {
|
//if (strstr(rcb_info->RptID, "LLN0$RP$urcbRealData")) {
|
||||||
//20241223lnk添加终端号参数
|
int rpt_no;
|
||||||
ied_usr_t *ied_usr = GET_IEDEXT_ADDR(ied);
|
//20241223lnk添加终端号参数
|
||||||
if (urcbRealDataHasReceived(ied_usr->dev_idx,LD_info, t / 1000))//判断时间重复
|
ied_usr_t *ied_usr = GET_IEDEXT_ADDR(ied);
|
||||||
return;
|
for(rpt_no=0 ; rpt_no<LD_info->rptcount; rpt_no++) {//实时数据的每份报告都进行时间判断lnk20250624
|
||||||
|
printf("LD_info->rptinfo[%d]->rptID=%s ",rpt_no,LD_info->rptinfo[rpt_no]->rptID);
|
||||||
|
|
||||||
|
if(strstr(rcb_info->RptID,extractAfterUrCb(LD_info->rptinfo[rpt_no]->rptID ))){
|
||||||
|
printf("rtdata RptID match");
|
||||||
|
if (urcbRealDataHasReceived(ied_usr->dev_idx,rpt_no,LD_info, t / 1000)){//判断时间重复
|
||||||
|
printf("this rt report Time repeats");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1542,6 +1566,7 @@ ST_VOID u_iec_rpt_ind_data(MVL_VAR_ASSOC** info_va,
|
|||||||
}
|
}
|
||||||
else if (rptinfo->flickerflag == 0) {//CZY 2023-08-17 WW 2022-11-14 增加多个报告判断
|
else if (rptinfo->flickerflag == 0) {//CZY 2023-08-17 WW 2022-11-14 增加多个报告判断
|
||||||
if (LD_info->rptRecvFlag == LD_info->rptRecvCheckFlag) {
|
if (LD_info->rptRecvFlag == LD_info->rptRecvCheckFlag) {
|
||||||
|
//LD_info->rptRecvFlag是报告初始化时报告序号左移之和,固定于报告初始化
|
||||||
//ied_usr_t* ied_usr = ied->usr_ext;//CZY 2023-08-17 WW 2022年12月6日14:09:08 增加多个ICD支持
|
//ied_usr_t* ied_usr = ied->usr_ext;//CZY 2023-08-17 WW 2022年12月6日14:09:08 增加多个ICD支持
|
||||||
//int devkind = ied_usr->dev_flag;
|
//int devkind = ied_usr->dev_flag;
|
||||||
json_block_create_end(LD_info->v_wiring_type, LD_info->mp_id, rptinfo->flickerflag);//lnk角形处理
|
json_block_create_end(LD_info->v_wiring_type, LD_info->mp_id, rptinfo->flickerflag);//lnk角形处理
|
||||||
|
|||||||
Reference in New Issue
Block a user