143 lines
5.3 KiB
C
143 lines
5.3 KiB
C
|
|
/**
|
|||
|
|
* @file: $RCSfile: mms_json_inter.h,v $
|
|||
|
|
* @brief: $IEC 61850 Protocol
|
|||
|
|
*
|
|||
|
|
* @version: $Revision: 1.5 $
|
|||
|
|
* @date: $Date: 2018/12/25 13:31:25 $
|
|||
|
|
* @author: $Author: lizhongming $
|
|||
|
|
* @state: $State: Exp $
|
|||
|
|
*
|
|||
|
|
* @latest: $Id: mms_json_inter.h,v 1.5 2018/12/25 13:31:25 lizhongming Exp $
|
|||
|
|
*
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#ifndef MMS_JSON_INTER_92327hyhy0923r_H
|
|||
|
|
#define MMS_JSON_INTER_92327hyhy0923r_H
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
|
|||
|
|
#include <QString>
|
|||
|
|
#include <QList>
|
|||
|
|
#include <QMutex>
|
|||
|
|
#include <QMap>
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define STAT_DATA_BASE_NODE_ID 100 //<2F><>̬<EFBFBD><CCAC>ͳ<EFBFBD><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
#define THREE_SECS_DATA_BASE_NODE_ID 200 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD>
|
|||
|
|
#define SOE_COMTRADE_BASE_NODE_ID 300 // soe ¼<><C2BC>
|
|||
|
|
#define HIS_DATA_BASE_NODE_ID 400 //<2F><>ʷ<EFBFBD><CAB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
class json_block_data //jsonƴ<6E>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
int monitorId; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
|
int func_type; //<2F><>Ӧ(#define<6E>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>100 <20><> 400)<29><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|||
|
|
int flag; //<2F><EFBFBD><DEB3><EFBFBD><EFBFBD>ǣ<EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><DEB3><EFBFBD>0<EFBFBD><EFBFBD><DEB3><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD> <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ρ<EFBFBD><CEA1><EFBFBD>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>·װ<C2B7>ô<EFBFBD><C3B4><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2018-11-21 19:32:38
|
|||
|
|
long long time; //ʱ<><CAB1><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>)
|
|||
|
|
double voltage_level; //CZY 2023-08-23 <20><>ѹ<EFBFBD>ȼ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>double<6C><65><EFBFBD><EFBFBD>)
|
|||
|
|
QString mp_id; //char<61>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
QString dev_type;//<2F>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
QMap<QString, double> mms_str_map; //<2F><><EFBFBD><EFBFBD>ֵ(61850<35><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>ֵ)
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
json_block_data() //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 09:03:30 ----<2D><><EFBFBD>Բ<EFBFBD><D4B2>Գ<EFBFBD>ֵ<EFBFBD><D6B5>
|
|||
|
|
{
|
|||
|
|
monitorId = 7501; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
|
partitionSize = 3; //kafka<6B><61><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
func_type = 100; //<2F><>Ӧ(#define<6E>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>100 <20><> 400)<29><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|||
|
|
data_type = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
flag = 0; //<2F><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
time = 1546099200000; //ʱ<><CAB1><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>2018-12-30??00:00:00
|
|||
|
|
//connectLineCount = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
//triggerLineCount = 1; //<2F>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
|
|||
|
|
mms_str_map.insert("MMXU4$MX$PhVDev$phsA$cVal$mag$f", 123.4567890); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsAHar[0]$ang$f", 200.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsAHar[47]$ang$f", 300.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsAHar[48]$ang$f", 300.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
|
|||
|
|
mms_str_map.insert("MMXU4$MX$PhVDev$phsB$cVal$mag$f", 123.4567890); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsBHar[0]$ang$f", 200.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsBar[47]$ang$f", 300.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsBar[48]$ang$f", 300.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
|
|||
|
|
mms_str_map.insert("MMXU4$MX$PhVDev$phsC$cVal$mag$f", 123.4567890); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsCHar[0]$ang$f", 200.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsCHar[47]$ang$f", 300.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
mms_str_map.insert("MHAI2$MX$HRPhV$phsCHar[48]$ang$f", 300.1234567); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD> zl 2018-11-22 10:46:15
|
|||
|
|
}
|
|||
|
|
*/
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class Ckafka_data_t //kafka<6B><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽṹ<DDBD><E1B9B9>
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
int monitor_id; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
|
QString strTopic; //kafka<6B><61><EFBFBD><EFBFBD>topic
|
|||
|
|
QString strText; //kafka<6B><61><EFBFBD>͵<EFBFBD>json<6F>ַ<EFBFBD><D6B7><EFBFBD>
|
|||
|
|
QString mp_id; //char<61><72><EFBFBD><EFBFBD>id
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class oss_data_t //oss<73><73><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽṹ<DDBD><E1B9B9> zw 2023-9-22 <20><><EFBFBD><EFBFBD>
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
QString filename; //<2F>Ʊ<EFBFBD><C6B1><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
QString savename; //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
QString data; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F><>־ͨ<D6BE>ò<EFBFBD><C3B2><EFBFBD>
|
|||
|
|
QString log_name; //<2F>ն<EFBFBD>id<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
|
|||
|
|
QString id; //<2F>ն<EFBFBD>id<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
|
|||
|
|
QString time; //ʱ<><CAB1>
|
|||
|
|
//match_log
|
|||
|
|
int base_mat_num;
|
|||
|
|
int adv_mat_num;
|
|||
|
|
int base_act_num;
|
|||
|
|
int adv_act_num;
|
|||
|
|
//reason_log
|
|||
|
|
int list_num;
|
|||
|
|
};
|
|||
|
|
//extern QMutex kafka_data_list_mutex;
|
|||
|
|
//extern QList<kafka_data_t> kafka_data_list;
|
|||
|
|
/* ʹ<><CAB9>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>룺
|
|||
|
|
Ckafka_data_t data;
|
|||
|
|
data.patition_id = 0;
|
|||
|
|
data.strText = QString("{a=1,b=2}");
|
|||
|
|
|
|||
|
|
kafka_data_list_mutex.lock();
|
|||
|
|
kafka_data_list.append(data);
|
|||
|
|
kafka_data_list_mutex.unlock();
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
int transfer_json_block_data(json_block_data *data);
|
|||
|
|
void errorlog_pgsql(char* id, QString time, QString filename);
|
|||
|
|
QString errorlog_num_pgsql(QString monitorId, QString datatime, QString filename, int count);
|
|||
|
|
QString errorlog_datamatch_pgsql(QString id, QString time, int BASE_MAT_NUM, int ADV_MAT_NUM, int BASE_ACT_NUM, int ADV_ACT_NUM, QString filename);
|
|||
|
|
|
|||
|
|
#endif /* __cplusplus */
|
|||
|
|
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
extern "C" {
|
|||
|
|
#endif /* __cplusplus */
|
|||
|
|
|
|||
|
|
int transfer_json_qvvr_data(unsigned int func_type,int monitor_id,float mag,float dur,long long start_tm,long long end_tm,int dis_kind, char* uuid_cfg, char* uuid_dat, char* mp_id, char* Qvvr_rptname, char* devtype);
|
|||
|
|
void processGGIO_start_data_end(char* mp_id, char* fullname, double v,long long time,char* devtype,int monitor_id);
|
|||
|
|
//void errorlog_num(CDataValue* pDataValue, double value, int monitorId, double UL, int maxcount);
|
|||
|
|
//void errorlog_num_json(int monitorId);
|
|||
|
|
void Set_xml_databaseinfo(char* MODEL_ID, char* TMNL_TYPE, char* TMNL_FACTORY, char* FILE_NAME, int year, int month, int day, int hour, int minute, int second);//zw<7A><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD>
|
|||
|
|
void Set_xml_nodeinfo();//zw<7A><EFBFBD>
|
|||
|
|
char* Get_xmlpath(char* devtype);
|
|||
|
|
char* Get_IED(char* devtype);
|
|||
|
|
char* Get_LDevice(char* devtype);
|
|||
|
|
void errorlog_json(char* id, char* ip, int port, int type, char* error_type, char* ERROR_DES, char* ERROR_PARAM);
|
|||
|
|
void SoeRptSql(char* id, int state, char* rpt);
|
|||
|
|
void connectlog_pgsql(char* id,char* datetime,int status);
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif //MMS_JSON_INTER_92327hyhy0923r_H
|