269 lines
5.5 KiB
C++
269 lines
5.5 KiB
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "iec61850_server.h"
|
|
|
|
|
|
typedef struct
|
|
{
|
|
std::string desc;
|
|
std::string type;
|
|
}stru_DO;
|
|
|
|
typedef struct
|
|
{
|
|
std::string lnClass;
|
|
std::vector<std::string> vec_do;
|
|
std::map<std::string, stru_DO> map_do; // key:name
|
|
}stru_LNodeType;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
std::string bType;
|
|
std::string type;
|
|
std::string dchg;
|
|
std::string qchg;
|
|
std::string fc;
|
|
std::string text;
|
|
}stru_DA;
|
|
|
|
typedef struct
|
|
{
|
|
std::string cdc;
|
|
std::vector<std::string> vec_da;
|
|
std::map<std::string, stru_DA> map_da; // key:name
|
|
std::vector<std::string> vec_sdo;
|
|
std::map<std::string, std::string> map_sdo; // key:name
|
|
}stru_DOType;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
std::string bType;
|
|
std::string type;
|
|
std::string fc;
|
|
std::string dchg;
|
|
std::string qchg;
|
|
}stru_BDA;
|
|
|
|
typedef struct
|
|
{
|
|
std::vector<std::string> vec_bda;
|
|
std::map<std::string, stru_BDA> map_bda; // key:name
|
|
}stru_DAType;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
std::vector<int> vec_ord;
|
|
std::map<int, std::string> map_enumVal; // key:ord
|
|
}stru_EnumType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _all_DA
|
|
{
|
|
DataAttribute *DA;
|
|
std::string bType;
|
|
std::string type;
|
|
std::string fc;
|
|
std::string dchg;
|
|
std::string qchg;
|
|
std::string text;
|
|
|
|
std::string sAddr;
|
|
std::string val;
|
|
std::map<std::string, struct _all_DA *> map_all_da; // key:name
|
|
}stru_all_DA;
|
|
|
|
|
|
|
|
typedef struct _all_DO
|
|
{
|
|
DataObject *DO;
|
|
std::map<std::string, struct _all_DO *> map_all_sdo; // key:name
|
|
std::map<std::string, stru_all_DA *> map_all_da; // key:name
|
|
}stru_all_DO;
|
|
|
|
|
|
typedef struct _DAI
|
|
{
|
|
std::string sAddr;
|
|
std::string val;
|
|
}stru_DAI;
|
|
|
|
|
|
typedef struct _SDI
|
|
{
|
|
std::vector<std::string> vec_sdI;
|
|
std::map<std::string, struct _SDI> map_sdI; // key:name
|
|
std::vector<std::string> vec_daI;
|
|
std::map<std::string, stru_DAI> map_daI; // key:name
|
|
}stru_SDI;
|
|
|
|
typedef struct _DOI
|
|
{
|
|
std::string desc;
|
|
std::vector<std::string> vec_sdI;
|
|
std::map<std::string, stru_SDI> map_sdI; // key:name
|
|
std::vector<std::string> vec_daI;
|
|
std::map<std::string, stru_DAI> map_daI; // key:name
|
|
}stru_DOI;
|
|
|
|
typedef struct
|
|
{
|
|
std::string ldevice_inst;
|
|
std::string ln_type;
|
|
std::string ln_class;
|
|
std::string ln_inst;
|
|
std::string ln_prefix;
|
|
std::string do_name;
|
|
stru_all_DO *p_all_do;
|
|
}stru_contorl_DO;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
LogicalNode *LN;
|
|
std::string lnType;
|
|
std::string lnClass;
|
|
std::string desc;
|
|
std::string inst;
|
|
std::string prefix;
|
|
std::vector<std::string> vec_doI;
|
|
std::map<std::string, stru_DOI> map_doI; // key:name
|
|
std::map<std::string, stru_all_DO *> map_all_do; // key:name
|
|
}stru_LN;
|
|
|
|
typedef struct
|
|
{
|
|
DataSetEntry *fcda;
|
|
std::string ldInst;
|
|
std::string lnClass;
|
|
std::string lnInst;
|
|
std::string prefix;
|
|
std::string doName;
|
|
std::string daName;
|
|
std::string fc;
|
|
}stru_FCDA;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
DataSet *dataset;
|
|
std::string desc;
|
|
std::vector<stru_FCDA> vec_fcda;
|
|
}stru_DataSet;
|
|
|
|
typedef struct
|
|
{
|
|
bool dchg;
|
|
bool qchg;
|
|
bool dupd;
|
|
bool period;
|
|
}stru_TrgOps;
|
|
|
|
typedef struct
|
|
{
|
|
bool seqNum;
|
|
bool timeStamp;
|
|
bool dataSet;
|
|
bool reasonCode;
|
|
bool dataRef;
|
|
bool entryID;
|
|
bool configRef;
|
|
}stru_OptFields;
|
|
|
|
typedef struct
|
|
{
|
|
ReportControlBlock *Rcb;
|
|
std::string datSet;
|
|
int intgPd;
|
|
std::string rptID;
|
|
int confRev;
|
|
bool buffered;
|
|
int bufTime;
|
|
stru_TrgOps trgOps;
|
|
stru_OptFields optFields;
|
|
int RptEnabled_max;
|
|
}stru_ReportControl;
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t actSG;
|
|
uint8_t numOfSGs;
|
|
}stru_SettingControl;
|
|
|
|
typedef struct
|
|
{
|
|
LogicalNode *LLN0;
|
|
std::string lnType;
|
|
std::string lnClass;
|
|
std::vector<std::string> vec_dataset;
|
|
std::map<std::string, stru_DataSet> map_dataset; // key:name
|
|
std::vector<std::string> vec_reportControl;
|
|
std::map<std::string, stru_ReportControl> map_reportControl; // key:name
|
|
std::vector<std::string> vec_doI;
|
|
std::map<std::string, stru_DOI> map_doI; // key:name
|
|
std::map<std::string, stru_all_DO *> map_all_do; // key:name
|
|
stru_SettingControl settingControl;
|
|
}stru_LN0;
|
|
|
|
typedef struct
|
|
{
|
|
LogicalDevice *Ldevice;
|
|
SettingGroupControlBlock* sgcb;
|
|
stru_LN0 ln0;
|
|
std::vector<stru_LN> vec_ln;
|
|
}stru_LDevice;
|
|
|
|
typedef struct
|
|
{
|
|
ModelNode *node;
|
|
}stru_saddr_point;
|
|
|
|
typedef struct
|
|
{
|
|
DataAttribute *DA;
|
|
DataAttributeType type;
|
|
std::string str_val;
|
|
int val;
|
|
}stru_setting_info;
|
|
|
|
typedef struct
|
|
{
|
|
IedModel *model;
|
|
std::string name;
|
|
std::string desc;
|
|
std::string type;
|
|
std::vector<std::string> vec_ldevice;
|
|
std::map<std::string, stru_LDevice> map_ldevice; // key:inst
|
|
std::vector<stru_contorl_DO> vec_control_do;
|
|
std::vector<std::string> vec_saddr;
|
|
std::map<std::string, stru_saddr_point> map_saddr_point; // key:saddr
|
|
std::map<std::string, stru_setting_info> map_setting_info; // key:name
|
|
}stru_ied;
|
|
|
|
typedef struct
|
|
{
|
|
stru_ied ied;
|
|
std::vector<std::string> vec_lnType;
|
|
std::map<std::string, stru_LNodeType> map_lnType; // key:id
|
|
std::vector<std::string> vec_doType;
|
|
std::map<std::string, stru_DOType> map_doType; // key:id
|
|
std::vector<std::string> vec_daType;
|
|
std::map<std::string, stru_DAType> map_daType; // key:id
|
|
std::vector<std::string> vec_enumType;
|
|
std::map<std::string, stru_EnumType> map_enumType; // key:id
|
|
}stru_icd;
|
|
|
|
|
|
stru_icd *icd_parse(const char *icd_path);
|
|
void icd_show(stru_icd &icd); |