Data_template.h
上传用户:tengfei
上传日期:2014-02-20
资源大小:423k
文件大小:58k
- #ifndef _DATA_TEMPLATE_
- #define _DATA_TEMPLATE_
- //#include "afx.h"
- #include "math.h"
- #include "typedef.h"
- #include "IEC104link.h"
- #include <sys/timeb.h>
- #include <time.h>
- #define YKselectTIMEOUT 20000
- struct EPTAdataStru
- {
- _BYTE ES;
- _WORD relaytime;
- };
- struct EPTBdataStru
- {
- _BYTE SPE;
- _WORD relaytime;
- };
- struct EPTCdataStru
- {
- _BYTE OCI;
- _WORD relaytime;
- };
- //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
- //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
- typedef _BYTE TP_SINGLE_POINT;
- typedef _BYTE TP_DOUBLE_POINT;
- typedef _WORD TP_DWPS_POINT;
- typedef _DWORD TP_BO_NA;
- typedef _char TP_BYST_POINT;
- typedef _WORD TP_ME_NA;
- typedef _WORD TP_ME_NB;
- typedef _float TP_ME_NC;
- typedef TP_ME_NA TP_ME_ND;
- typedef _DWORD TP_IT_NA;
- typedef _WORD TP_P_ME_NA;
- typedef struct EPTAdataStru TP_EP_TA;
- typedef struct EPTBdataStru TP_EP_TB;
- typedef struct EPTCdataStru TP_EP_TC;
- //#define SP_NA_TAG 1
- //#define ME_NVA_TAG 9
- #define FB_CYCLE 0x01
- //#define FB_BACK 0x02
- //#define FB_SPONT 0x04
- //#define FB_REQCALL 0x08
- typedef struct Timestru
- {
-
-
- _WORD year;
- _WORD month;
- _WORD day;
- _WORD hour;
- _WORD minute;
- _WORD second;
- _WORD millinsecs;
-
- } TIME_STRU;
- typedef struct asdu_attri_stru
- {
- _DWORD info_body_addr; //Maybe infomation Address is not continuous,
- //When Full data is requested , a new frame is produced
- //if continuousless info_body_addr happened
- //must be sequence
- _WORD funcbit;//Bit0:period/cycle scan . Only cycle bit has its function, others are useless.
- // Bit1:backgroud scan ,Bit2:spont , Bit3: req_call ....
- //Generally,Period scan is about 10 ~20 econds e.g. temprature...
- //if some type variables that has Period scan function bit should NOT have Req_Full_call or background bits.
- //Back ground is about long period ,which prevents req_FULL_data from loss data,increases all data security.
-
- _BYTE GroupNo;//1...16 group, GroupNo is same or different
- //The same GroupNo info is encoded the same frame ,
- //different GroupNo will create anew frame.
- // _BYTE transfer_reason;
- // _BYTE Type_tag_mode;//1:YK 2:Event 3:Req-call 4:PA 5:Cycle 6:Background
-
- // _BYTE QualityPosition;//0:Seperate 1: together with DataUnit SP DP. 2:no Quality
- // _BYTE TimeStruType;// 0: 3 bytes 1: 7 bytes
- _float coef;
- } ASDU_ATTRI;
- #define M_SP_NA_1 1
- #define M_SP_TA_1 2
- #define M_DP_NA_1 3
- #define M_DP_TA_1 4
- #define M_ST_NA_1 5
- #define M_ST_TA_1 6
- #define M_PS_NA_1 20
- #define M_BO_NA_1 7
- #define M_BO_TA_1 8
- #define C_CD_NA_1 106
- #define C_SC_NA_1 45
- #define C_DC_NA_1 46
- #define C_RC_NA_1 47
- #define C_SE_NA_1 48
- #define C_SE_NB_1 49
- #define C_SE_NC_1 50
- #define C_SE_ND_1 136
- #define C_BO_NA_1 51
- #define C_CS_NA_1 103
- #define C_IC_NA_1 100
- #define C_CI_NA_1 101 //pulse account
- #define M_ME_NA_1 9
- #define M_ME_TA_1 10
- #define M_ME_NB_1 11
- #define M_ME_TB_1 12
- #define M_ME_NC_1 13
- #define M_ME_TC_1 14
- #define M_IT_NA_1 15
- #define M_IT_TA_1 16
- #define M_EP_TA_1 17
- #define M_EP_TB_1 18
- #define M_EP_TC_1 19
- #define M_ME_ND_1 21
- #define M_SP_TB_1 30
- #define M_DP_TB_1 31
- #define M_ST_TB_1 32
- #define M_BO_TB_1 33
- #define M_ME_TD_1 34
- #define M_ME_TE_1 35
- #define M_ME_TF_1 36
- #define M_IT_TB_1 37
- #define M_EP_TD_1 38
- #define M_EP_TE_1 39
- #define M_EP_TF_1 40
- #define M_EI_NA_1 70
- #define P_ME_NA_1 110
- #define P_ME_NB_1 111
- #define P_ME_NC_1 112
- #define C_TS_NA_1 104
- #define C_RP_NA_1 105
- #define C_RD_NA_1 102
- //12-10
- #define PRI_EndSubInit 1//top
- #define PRI_Confirm_Control 2//45-69
- #define PRI_SpecialPS 3
- #define PRI_SpontPS 4
- #define PRI_Confirm_CS 5
- #define PRI_Confirm_CD 6
- #define PRI_Confirm_RD 7
- #define PRI_Confirm_TS 8
- #define PRI_Confirm_RP 9
- #define PRI_Confirm_P 10
- #define PRI_Confirm_IC 11
- #define PRI_Confirm_CI 12
- #define PRI_Confirm_res 13
- #define PRI_YKterm 14
- #define PRI_Special 15
- #define PRI_Event 16
- #define PRI_ReqCall 17
- #define PRI_ReqPulseAccount 18
- #define PRI_Cycle 19
- #define PRI_Back 20//lowest
- #define COT_Spont 3
- #define COT_act 6
- #define COT_confirm 7
- #define COT_deact 8
- #define COT_deactconfirm 9
- #define COT_unknown_type 44
- #define COT_unknownCause 45
- #define COT_unknownCommonAddr 46
- #define COT_unknownObjAddr 47
- #define COT_Reqdata 5
- #define COT_term 10
- #define COT_Cycle 1
- #define COT_Back 2
- #define TIME_CYCLE_SEC 20
- //#define TIME_BACK_SEC 5*60
- #define WDGCOUNTS 5
- #define MAXRXBUF 256
- #define MAXTXBUF 256
- #define MAXASDU_SERVNUM 20
- #define Data_SP_NA_COUNTS_MAX 1024
- #define Data_SP_TA_COUNTS 1024
- #define Data_ST_NA_COUNTS_MAX 1024
- #define Data_ST_TA_COUNTS 100
- #define Data_DP_NA_COUNTS_MAX 1024
- #define Data_DP_TA_COUNTS 100
- #define Data_PS_NA_COUNTS_MAX 1024
- #define Data_BO_NA_COUNTS_MAX 1024
- #define Data_BO_TA_COUNTS 100
- #define Data_ME_ND_COUNTS_MAX 1024
- #define Data_ME_NA_COUNTS_MAX 1024
- #define Data_ME_TA_COUNTS 100
- #define Data_ME_NB_COUNTS_MAX 1024
- #define Data_ME_TB_COUNTS 100
- #define Data_ME_NC_COUNTS_MAX 1024
- #define Data_ME_TC_COUNTS 100
- #define Data_EP_TA_COUNTS 100
- #define Data_EP_TB_COUNTS 100
- #define Data_EP_TC_COUNTS 100
- #define Data_IT_NA_COUNTS_MAX 1024
- #define Data_P_ME_NA_COUNTS_MAX 1024
- #define Data_P_ME_NB_COUNTS_MAX 1024
- #define Data_P_ME_NC_COUNTS_MAX 1024
- #define MAX_TPLIST 32
- #define Data_SP_TA_dispCOUNTS 50
- #define Data_DP_TA_dispCOUNTS 50
- #define Data_ST_TA_dispCOUNTS 50
- #define Data_ME_TA_dispCOUNTS 50
- #define Data_BO_TA_dispCOUNTS 50
- #define Data_ME_TB_dispCOUNTS 50
- #define Data_ME_TC_dispCOUNTS 50
- #define Data_EP_TA_dispCOUNTS 50
- #define Data_EP_TB_dispCOUNTS 50
- #define Data_EP_TC_dispCOUNTS 50
- #define MAX_TYPENO 256
- class AFX_EXT_CLASS CDataASDU:public CIEC104ASDU
- {
- public:
- void InitInstance();
- bool has_been_registered;
- WORD limit_rtunum;
- WORD limit_days;
- char m_hardno[128];
- bool ReadRegisterKey();
- bool End_subinit_flag;
- _char textMessageRemark[256*4];
- _char textAsduUpRemark[256*4];
- _char textAsduDnRemark[256*4];
- void printErrAsduDnRemark(_BYTE Tag,_BYTE which,_BYTE COT=0,_WORD asduaddr=0,_DWORD infobodyaddr=0);
- void printAsduDnRemark(_BYTE Tag,_char *others=0,_BYTE COT=0,_WORD asduaddr=0,_DWORD infobodyaddr=0);
- void printAsduUpRemark(_BYTE Tag,_char *others=0,_BYTE COT=0,_WORD asduaddr=0,_BYTE infobodynum=0,_BYTE group=0);
- virtual void On_init_ASDU_process(){};
- virtual void OnAsduUpRemark(){};
- virtual void OnAsduDnRemark(){};
- virtual void OnMessageRemark(){};
- /////////////////////////////////////////////////
- virtual BYTE On_C_SC_select(WORD point ,BYTE status){return 0;};
- virtual void On_C_SC_operate(WORD point ,BYTE status){};
- virtual BYTE On_C_DC_select(WORD point ,BYTE status){return 0;};
- virtual void On_C_DC_operate(WORD point ,BYTE status){};
- virtual BYTE On_C_RC_select(WORD point ,BYTE status){return 0;};
- virtual void On_C_RC_operate(WORD point ,BYTE status){};
- virtual BYTE On_C_BO_select(WORD point ,DWORD status){return 0;};
- virtual void On_C_BO_operate(WORD point ,DWORD status){};
- virtual void On_C_SE_NA_operate(WORD point ,WORD status){};///////////////////////////////////////////////////////////////////////////////////////
- virtual void On_C_SE_NB_operate(WORD point ,WORD value){};///////////////////////////////////////////////////////////////////////////////////////
- virtual void On_C_SE_NC_operate(WORD point ,float value){};///////////////////////////////////////////////////////////////////////////////////////
- virtual void On_C_SE_ND_operate(WORD point ,WORD value){};///////////////////////////////////////////////////////////////////////////////////////
-
- HANDLE YK_thread;
- bool YK_threadflag;
- void YK_startthread(bool start );
- static void YK_threadfunc(void *PP);
- void YK_func();
- void SC_exfunc();
- void DC_exfunc();
- void RC_exfunc();
- void BO_exfunc();
- void SE_NA_exfunc();
- void SE_NB_exfunc();
- void SE_NC_exfunc();
- void SE_ND_exfunc();
- /////////////////////////////////////////////////
- /////////////////////////////////////////////////
- _int TIME_BACK_SEC;
- _BYTE TimeBytetype[MAX_TYPENO];
- _WORD Data_SP_NA_COUNTS; //1024
- _WORD Data_ST_NA_COUNTS; //1024
- _WORD Data_DP_NA_COUNTS;
- _WORD Data_PS_NA_COUNTS;
- _WORD Data_BO_NA_COUNTS;
- _WORD Data_ME_NA_COUNTS;// 256
- _WORD Data_ME_NB_COUNTS;// 256
- _WORD Data_ME_NC_COUNTS;// 256
- _WORD Data_ME_ND_COUNTS;// 256
- _WORD Data_IT_NA_COUNTS; // 200
- _WORD Data_P_ME_NA_COUNTS;// 256
- _WORD Data_P_ME_NB_COUNTS;// 256
- _WORD Data_P_ME_NC_COUNTS;// 256
- _WORD ADDR_YXLOW ;//1
- _WORD ADDR_YXHIGH; //0x1000
- _WORD ADDR_STYXLOW ;//1
- _WORD ADDR_STYXHIGH; //0x1000
- _WORD ADDR_BOYXLOW ;//1
- _WORD ADDR_BOYXHIGH; //0x1000
- _WORD ADDR_PSYXLOW ;//1
- _WORD ADDR_PSYXHIGH; //0x1000
- _WORD ADDR_DPYXLOW ;//1
- _WORD ADDR_DPYXHIGH; //0x1000
- _WORD ADDR_YCLOW ;//0x4001
- _WORD ADDR_YCHIGH; //0x4400
- _WORD ADDR_NBYCLOW ;//0x4401
- _WORD ADDR_NBYCHIGH; //0x4800
- _WORD ADDR_NCYCLOW ;//0x4401
- _WORD ADDR_NCYCHIGH; //0x4800
- _WORD ADDR_NDYCLOW ;//0x4401
- _WORD ADDR_NDYCHIGH; //0x4800
- _WORD ADDR_PARALOW;// 0x5001
- _WORD ADDR_PARAHIGH;// 0x6000
- _WORD ADDR_PARANBLOW;// 0x5001
- _WORD ADDR_PARANBHIGH;// 0x6000
- _WORD ADDR_PARANCLOW;// 0x5001
- _WORD ADDR_PARANCHIGH;// 0x6000
- _WORD ADDR_YKLOW ;//0x6001
- _WORD ADDR_YKHIGH;// 0x6200
- _WORD ADDR_YKDCLOW ;//0x6001
- _WORD ADDR_YKDCHIGH;// 0x6200
- _WORD ADDR_YKRCLOW ;//0x6001
- _WORD ADDR_YKRCHIGH;// 0x6200
- _WORD ADDR_SENALOW ;//0x6001
- _WORD ADDR_SENAHIGH;// 0x6200
- _WORD ADDR_SENBLOW ;//0x6001
- _WORD ADDR_SENBHIGH;// 0x6200
- _WORD ADDR_SENCLOW ;//0x6001
- _WORD ADDR_SENCHIGH;// 0x6200
- _WORD ADDR_BONALOW ;//0x6001
- _WORD ADDR_BONAHIGH;// 0x6200
- _WORD ADDR_PULSELOW; //0x6401
- _WORD ADDR_PULSEHIGH ;//0x6600
- _WORD ADDR_EP_TALOW;
- _WORD ADDR_EP_TAHIGH;
- _WORD ADDR_EP_TBLOW;
- _WORD ADDR_EP_TBHIGH;
- _WORD ADDR_EP_TCLOW;
- _WORD ADDR_EP_TCHIGH;
- ///////////////////////////////////////////
- _BYTE Default_Group_SP_NA;
- _BYTE Default_Group_DP_NA;
- _BYTE Default_Group_ST_NA;
- _BYTE Default_Group_BO_NA;
- _BYTE Default_Group_PS_NA;
- _BYTE Default_Group_ME_NA;
- _BYTE Default_Group_ME_NB;
- _BYTE Default_Group_ME_NC;
- _BYTE Default_Group_ME_ND;
- _BYTE Default_Group_IT_NA;
- _BYTE Default_Group_P_ME_NA;
- _BYTE Default_Group_P_ME_NB;
- _BYTE Default_Group_P_ME_NC;
- /////////////////////////////////////////
- CDataASDU();
- ~CDataASDU();
- void ConstDef();
- void readDataTypedef();
- void readDefaultGroup();
- void readDataAddrdef();
- void readASDUconfig();
- void readASDUlistconfig();
- void readRTdataconfig(_BYTE Tag);
- void ClearAll();
- _int TransferCause_Size;// 1 or 2
- _int InfoBodyAddr_Size;// 1 2 or 3
- _int ASDU_Common_addr_size;// 1 or 2
- _WORD ASDU_Common_addr;
-
- _int Fill_TransferCause(_BYTE *buf,_BYTE cause,_BYTE source_addr=0);
- _int Fill_InfoBodyAddr(_BYTE *buf,_DWORD infoaddr);
- _int Fill_ASDU_Common_addr(_BYTE *buf,_WORD commonaddr);
- _int Get_TransferCause(_BYTE *buf,_BYTE *cause,_BYTE *source_addr);
- _int Get_InfoBodyAddr(_BYTE *buf,_DWORD *infoaddr);
- _int Get_ASDU_Common_addr(_BYTE *buf,_WORD *commonaddr);
-
- void Setlinkerbuffsize(_int length);
- void Set_Tran_Info_Common_size(_int TransferCauseSize,_int InfoBodyAddrSize,_int ASDU_Common_addrsize);
-
- //========================================================================================
- protected:
-
- _int linkerbuffsize;
- // HANDLE datamutex;
- // HANDLE qualmutex;
- HANDLE SP_NA_datamutex;
- HANDLE DP_NA_datamutex;
- HANDLE ST_NA_datamutex;
- HANDLE ST_TA_datamutex;
- HANDLE PS_NA_datamutex;
- HANDLE BO_NA_datamutex;
- HANDLE BO_TA_datamutex;
- HANDLE SP_TA_datamutex;
- HANDLE DP_TA_datamutex;
- HANDLE ME_NA_datamutex;
- HANDLE ME_ND_datamutex;
- HANDLE ME_TA_datamutex;
- HANDLE ME_TB_datamutex;
- HANDLE ME_TC_datamutex;
- HANDLE ME_NB_datamutex;
- HANDLE ME_NC_datamutex;
- HANDLE EP_TA_datamutex;
- HANDLE EP_TB_datamutex;
- HANDLE EP_TC_datamutex;
- HANDLE P_ME_NA_datamutex;
- HANDLE P_ME_NB_datamutex;
- HANDLE P_ME_NC_datamutex;
- HANDLE IT_NA_datamutex;
- void waitfordatamutex(HANDLE datamutex)
- {
- WaitForSingleObject(datamutex,0xFFFFFFFF);
- };
- void releasedatamutex(HANDLE datamutex)
- {
- ReleaseMutex(datamutex);
- };
- void waitforqualmutex()
- {
-
- };
- void releasequalmutex()
- {
-
- };
- void initdatamutex()
- {
- SP_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- PS_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- BO_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- BO_TA_datamutex=CreateMutex(NULL,FALSE,NULL);
- ST_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- ST_TA_datamutex=CreateMutex(NULL,FALSE,NULL);
-
- DP_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- SP_TA_datamutex=CreateMutex(NULL,FALSE,NULL);
- DP_TA_datamutex=CreateMutex(NULL,FALSE,NULL);
- ME_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- ME_ND_datamutex=CreateMutex(NULL,FALSE,NULL);
- ME_TA_datamutex=CreateMutex(NULL,FALSE,NULL);
- ME_TB_datamutex=CreateMutex(NULL,FALSE,NULL);
- ME_TC_datamutex=CreateMutex(NULL,FALSE,NULL);
- ME_NB_datamutex=CreateMutex(NULL,FALSE,NULL);
- ME_NC_datamutex=CreateMutex(NULL,FALSE,NULL);
- EP_TA_datamutex=CreateMutex(NULL,FALSE,NULL);
- EP_TB_datamutex=CreateMutex(NULL,FALSE,NULL);
- EP_TC_datamutex=CreateMutex(NULL,FALSE,NULL);
- P_ME_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- P_ME_NB_datamutex=CreateMutex(NULL,FALSE,NULL);
- P_ME_NC_datamutex=CreateMutex(NULL,FALSE,NULL);
- IT_NA_datamutex=CreateMutex(NULL,FALSE,NULL);
- };
- void initqualmutex()
- {
- };
-
- void closedatamutex()
- {
- CloseHandle( PS_NA_datamutex);
- CloseHandle( BO_NA_datamutex);
- CloseHandle( SP_NA_datamutex);
- CloseHandle( DP_NA_datamutex);
- CloseHandle( SP_TA_datamutex);
- CloseHandle( BO_TA_datamutex);
- CloseHandle( DP_TA_datamutex);
- CloseHandle( ME_NA_datamutex);
- CloseHandle( ME_ND_datamutex);
- CloseHandle( ME_NB_datamutex);
- CloseHandle( ME_NC_datamutex);
- CloseHandle( ME_TA_datamutex);
- CloseHandle( EP_TA_datamutex);
- CloseHandle( EP_TB_datamutex);
- CloseHandle( EP_TC_datamutex);
- CloseHandle( ME_TB_datamutex);
- CloseHandle( ME_TC_datamutex);
- CloseHandle( P_ME_NA_datamutex);
- CloseHandle( P_ME_NB_datamutex);
- CloseHandle( P_ME_NC_datamutex);
- CloseHandle( IT_NA_datamutex);
- };
- void closequalmutex()
- {
- };
- //=========================================================================
- public:
- void SP_NA_ResetDataflag();
- _int SP_NA_GetSpecialFrame(_BYTE* buff);
- // _int SP_NA_GetSpecialPSFrame(_BYTE* buff);
- // _int SP_NA_GetSpontPSFrame(_BYTE* buff);
- _int SP_NA_GetEventFrame(_BYTE* buff);//
- _int SP_NA_GetReqcallFrame(_BYTE* buff,_BYTE group);//0 :Total 1:group1 .....
- _int SP_NA_GetBackgroundFrame(_BYTE* buff);
- _int SP_NA_GetCycleFrame(_BYTE* buff);
- bool SP_NA_ScanSpecialSpontFlag();
- // bool SP_NA_ScanSpontPSFlag();
- // bool SP_NA_ScanSpecialPSFlag();
- bool SP_NA_ScanEventSpontFlag();
-
- bool SP_NA_ScanReqcallFlag(_BYTE group);
- bool SP_NA_ScanCycleFlag();
- bool SP_NA_ScanBackFlag();
- void SP_NA_SetData(_int index, TP_SINGLE_POINT * value);
- TP_SINGLE_POINT SP_NA_GetData(_int index);
- TP_SINGLE_POINT SP_NA_viewdata(_int index);
- TP_SINGLE_POINT SP_NA_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void SP_NA_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void SP_NA_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE SP_NA_GetByteQuality(_int index);
- bool SP_NA_ScanQualityChange();
- public:
- bool SP_NA_judgeDatachangeflag(_int index,TP_SINGLE_POINT *value);
- ASDU_ATTRI SP_NA_asdu_attri[Data_SP_NA_COUNTS_MAX];
-
- _int SP_NA_SpontPSPtr;
- _int SP_NA_SpecialPSPtr;
- _int SP_NA_SpecialSpontPtr;
- _int SP_NA_SpontPtr;
- _int SP_NA_ReqcallPtr;
- bool SP_NA_Reqcallflag;
- _int SP_NA_CyclescanPtr;
- bool SP_NA_Cycleflag;
- _int SP_NA_BackgroundPtr;
- bool SP_NA_Backflag;
- TP_SINGLE_POINT SP_NA_data_val[Data_SP_NA_COUNTS_MAX ];
- TP_SINGLE_POINT SP_NA_data_old_val[Data_SP_NA_COUNTS_MAX ];
- _BYTE SP_NA_data_quality[Data_SP_NA_COUNTS_MAX ];
- _BYTE SP_NA_data_old_quality[Data_SP_NA_COUNTS_MAX ];
- _BYTE SP_NA_changeflag[Data_SP_NA_COUNTS_MAX ];
- bool SP_NA_changequalflag[Data_SP_NA_COUNTS_MAX ];
- _BYTE SP_NA_SpecialCOT[Data_SP_NA_COUNTS_MAX ];
- //================================================================================
- public:
- bool SP_TA_IsEmpty();
- _int SP_TA_GetCounts();
- _int SP_TA_GetdispPtr();
- bool SP_TA_AddOneRecorder();
- bool SP_TA_GetFirstRecorder();
- bool SP_TA_RemoveOneRecorder();
-
-
- void SP_TA_SetDataIndex(_WORD index);
-
- void SP_TA_SetData(TP_SINGLE_POINT *value);//Note: index-->infobodyaddr
- void SP_TA_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void SP_TA_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void SP_TA_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
-
- void SP_TA_ResetDataflag();
- _int SP_TA_GetEventFrame(_BYTE* buff);//
- _int SP_TB_GetEventFrame(_BYTE* buff);//
- bool SP_TA_ScanEventSpontFlag();
- typedef struct SP_TA_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_SINGLE_POINT data_val;
- _BYTE data_quality;
- } SP_TA_SEQ_STRU;
- void SP_TA_dispStore(SP_TA_SEQ_STRU *soe);
- public:
- SP_TA_SEQ_STRU SP_TA_SeqNode;
- SP_TA_SEQ_STRU SP_TA_dispBuf[Data_SP_TA_dispCOUNTS];
- _int SP_TA_dispPtr;
- SP_TA_SEQ_STRU SP_TA_seqlist[Data_SP_TA_COUNTS];
- _WORD SP_TA_counter;
-
- //=======================================================================
- //Double
- void DP_NA_ResetDataflag();
- _int DP_NA_GetSpecialFrame(_BYTE* buff);
- // _int DP_NA_GetSpecialPSFrame(_BYTE* buff);
- // _int DP_NA_GetSpontPSFrame(_BYTE* buff);
- _int DP_NA_GetEventFrame(_BYTE* buff);//
- _int DP_NA_GetReqcallFrame(_BYTE* buff,_BYTE group);//0 :Total 1:group1 .....
- _int DP_NA_GetBackgroundFrame(_BYTE* buff);
- _int DP_NA_GetCycleFrame(_BYTE* buff);
- bool DP_NA_ScanSpecialSpontFlag();
- // bool DP_NA_ScanSpontPSFlag();
- // bool DP_NA_ScanSpecialPSFlag();
- bool DP_NA_ScanEventSpontFlag();
-
- bool DP_NA_ScanReqcallFlag(_BYTE group);
- bool DP_NA_ScanCycleFlag();
- bool DP_NA_ScanBackFlag();
- void DP_NA_SetData(_int index, TP_DOUBLE_POINT * value);
- TP_DOUBLE_POINT DP_NA_GetData(_int index);
- TP_DOUBLE_POINT DP_NA_viewdata(_int index);
- TP_DOUBLE_POINT DP_NA_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void DP_NA_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void DP_NA_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE DP_NA_GetByteQuality(_int index);
- bool DP_NA_ScanQualityChange();
- public:
- bool DP_NA_judgeDatachangeflag(_int index,TP_DOUBLE_POINT *value);
- ASDU_ATTRI DP_NA_asdu_attri[Data_DP_NA_COUNTS_MAX];
-
- _int DP_NA_SpontPSPtr;
- _int DP_NA_SpecialPSPtr;
- _int DP_NA_SpecialSpontPtr;
- _int DP_NA_SpontPtr;
- _int DP_NA_ReqcallPtr;
- bool DP_NA_Reqcallflag;
- _int DP_NA_CyclescanPtr;
- bool DP_NA_Cycleflag;
- _int DP_NA_BackgroundPtr;
- bool DP_NA_Backflag;
- TP_DOUBLE_POINT DP_NA_data_val[Data_DP_NA_COUNTS_MAX ];
- TP_DOUBLE_POINT DP_NA_data_old_val[Data_DP_NA_COUNTS_MAX ];
- _BYTE DP_NA_data_quality[Data_DP_NA_COUNTS_MAX ];
- _BYTE DP_NA_data_old_quality[Data_DP_NA_COUNTS_MAX ];
- _BYTE DP_NA_changeflag[Data_DP_NA_COUNTS_MAX ];
- bool DP_NA_changequalflag[Data_DP_NA_COUNTS_MAX ];
- _BYTE DP_NA_SpecialCOT[Data_DP_NA_COUNTS_MAX ];
- //============================================================================
- bool DP_TA_IsEmpty();
- _int DP_TA_GetCounts();
- _int DP_TA_GetdispPtr();
- bool DP_TA_AddOneRecorder();
- bool DP_TA_GetFirstRecorder();
- bool DP_TA_RemoveOneRecorder();
-
-
- void DP_TA_SetDataIndex(_WORD index);
-
- void DP_TA_SetData(TP_DOUBLE_POINT *value);//Note: index-->infobodyaddr
- void DP_TA_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void DP_TA_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void DP_TA_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
-
- void DP_TA_ResetDataflag();
- _int DP_TA_GetEventFrame(_BYTE* buff);//
- _int DP_TB_GetEventFrame(_BYTE* buff);
-
- bool DP_TA_ScanEventSpontFlag();
- typedef struct DP_TA_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_DOUBLE_POINT data_val;
- _BYTE data_quality;
- } DP_TA_SEQ_STRU;
- void DP_TA_dispStore(DP_TA_SEQ_STRU *soe);
- public:
- DP_TA_SEQ_STRU DP_TA_SeqNode;
- DP_TA_SEQ_STRU DP_TA_dispBuf[Data_DP_TA_dispCOUNTS];
- _int DP_TA_dispPtr;
- DP_TA_SEQ_STRU DP_TA_seqlist[Data_DP_TA_COUNTS];
- _WORD DP_TA_counter;
-
- //================================================================================
- public:
- void PS_NA_ResetDataflag();
- _int PS_NA_GetSpecialFrame(_BYTE* buff);
- _int PS_NA_GetEventFrame(_BYTE* buff);//
- _int PS_NA_GetReqcallFrame(_BYTE* buff,_BYTE group);//0 :Total 1:group1 .....
- _int PS_NA_GetBackgroundFrame(_BYTE* buff);
- _int PS_NA_GetCycleFrame(_BYTE* buff);
- bool PS_NA_ScanSpecialSpontFlag();
- bool PS_NA_ScanEventSpontFlag();
-
- bool PS_NA_ScanReqcallFlag(_BYTE group);
- bool PS_NA_ScanCycleFlag();
- bool PS_NA_ScanBackFlag();
- void PS_NA_SetData(_int index, TP_DWPS_POINT * value);
- TP_DWPS_POINT PS_NA_GetData(_int index);
- TP_DWPS_POINT PS_NA_viewdata(_int index);
- TP_DWPS_POINT PS_NA_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void PS_NA_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void PS_NA_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE PS_NA_GetByteQuality(_int index);
- bool PS_NA_ScanQualityChange();
- public:
- bool PS_NA_judgeDatachangeflag(_int index,TP_DWPS_POINT *value);
- ASDU_ATTRI PS_NA_asdu_attri[Data_PS_NA_COUNTS_MAX];
-
- _int PS_NA_SpontPSPtr;
- _int PS_NA_SpecialPSPtr;
- _int PS_NA_SpecialSpontPtr;
- _int PS_NA_SpontPtr;
- _int PS_NA_ReqcallPtr;
- bool PS_NA_Reqcallflag;
- _int PS_NA_CyclescanPtr;
- bool PS_NA_Cycleflag;
- _int PS_NA_BackgroundPtr;
- bool PS_NA_Backflag;
- TP_DWPS_POINT PS_NA_data_val[Data_PS_NA_COUNTS_MAX ];
- TP_DWPS_POINT PS_NA_data_old_val[Data_PS_NA_COUNTS_MAX ];
- _BYTE PS_NA_data_quality[Data_PS_NA_COUNTS_MAX ];
- _BYTE PS_NA_data_old_quality[Data_PS_NA_COUNTS_MAX ];
- _BYTE PS_NA_changeflag[Data_PS_NA_COUNTS_MAX ];
- bool PS_NA_changequalflag[Data_PS_NA_COUNTS_MAX ];
- _BYTE PS_NA_SpecialCOT[Data_PS_NA_COUNTS_MAX ];
- //=========================================================================
- public:
- void ST_NA_ResetDataflag();
- _int ST_NA_GetSpecialFrame(_BYTE* buff);
- // _int ST_NA_GetSpecialPSFrame(_BYTE* buff);
- // _int ST_NA_GetSpontPSFrame(_BYTE* buff);
- _int ST_NA_GetEventFrame(_BYTE* buff);//
- _int ST_NA_GetReqcallFrame(_BYTE* buff,_BYTE group);//0 :Total 1:group1 .....
- _int ST_NA_GetBackgroundFrame(_BYTE* buff);
- _int ST_NA_GetCycleFrame(_BYTE* buff);
- bool ST_NA_ScanSpecialSpontFlag();
- // bool ST_NA_ScanSpontPSFlag();
- // bool ST_NA_ScanSpecialPSFlag();
- bool ST_NA_ScanEventSpontFlag();
-
- bool ST_NA_ScanReqcallFlag(_BYTE group);
- bool ST_NA_ScanCycleFlag();
- bool ST_NA_ScanBackFlag();
- void ST_NA_SetData(_int index, TP_BYST_POINT * value);
- TP_BYST_POINT ST_NA_GetData(_int index);
- TP_BYST_POINT ST_NA_viewdata(_int index);
- TP_BYST_POINT ST_NA_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void ST_NA_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void ST_NA_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE ST_NA_GetByteQuality(_int index);
- bool ST_NA_ScanQualityChange();
- public:
- bool ST_NA_judgeDatachangeflag(_int index,TP_BYST_POINT *value);
- ASDU_ATTRI ST_NA_asdu_attri[Data_ST_NA_COUNTS_MAX];
-
- _int ST_NA_SpontPSPtr;
- _int ST_NA_SpecialPSPtr;
- _int ST_NA_SpecialSpontPtr;
- _int ST_NA_SpontPtr;
- _int ST_NA_ReqcallPtr;
- bool ST_NA_Reqcallflag;
- _int ST_NA_CyclescanPtr;
- bool ST_NA_Cycleflag;
- _int ST_NA_BackgroundPtr;
- bool ST_NA_Backflag;
- TP_BYST_POINT ST_NA_data_val[Data_ST_NA_COUNTS_MAX ];
- TP_BYST_POINT ST_NA_data_old_val[Data_ST_NA_COUNTS_MAX ];
- _BYTE ST_NA_data_quality[Data_ST_NA_COUNTS_MAX ];
- _BYTE ST_NA_data_old_quality[Data_ST_NA_COUNTS_MAX ];
- _BYTE ST_NA_changeflag[Data_ST_NA_COUNTS_MAX ];
- bool ST_NA_changequalflag[Data_ST_NA_COUNTS_MAX ];
- _BYTE ST_NA_SpecialCOT[Data_ST_NA_COUNTS_MAX ];
- //================================================================================
- //================================================================================
- public:
- bool ST_TA_IsEmpty();
- _int ST_TA_GetCounts();
- _int ST_TA_GetdispPtr();
- bool ST_TA_AddOneRecorder();
- bool ST_TA_GetFirstRecorder();
- bool ST_TA_RemoveOneRecorder();
-
-
- void ST_TA_SetDataIndex(_WORD index);
-
- void ST_TA_SetData(TP_BYST_POINT *value);//Note: index-->infobodyaddr
- void ST_TA_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void ST_TA_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void ST_TA_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
-
- void ST_TA_ResetDataflag();
- _int ST_TA_GetEventFrame(_BYTE* buff);//
- _int ST_TB_GetEventFrame(_BYTE* buff);//
- bool ST_TA_ScanEventSpontFlag();
- void TagToDescr(_BYTE Tag,_char *TagDescr);
- void COTtoDescr(_BYTE COT,_char *cotDescr);
- typedef struct ST_TA_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_BYST_POINT data_val;
- _BYTE data_quality;
- } ST_TA_SEQ_STRU;
- void ST_TA_dispStore(ST_TA_SEQ_STRU *soe);
- public:
- ST_TA_SEQ_STRU ST_TA_SeqNode;
- ST_TA_SEQ_STRU ST_TA_dispBuf[Data_ST_TA_dispCOUNTS];
- _int ST_TA_dispPtr;
- ST_TA_SEQ_STRU ST_TA_seqlist[Data_ST_TA_COUNTS];
- _WORD ST_TA_counter;
-
- //=======================================================================
- //================================================================================
- public:
- void BO_NA_ResetDataflag();
- _int BO_NA_GetEventFrame(_BYTE* buff);//
- _int BO_NA_GetReqcallFrame(_BYTE* buff,_BYTE group);//0 :Total 1:group1 .....
- _int BO_NA_GetBackgroundFrame(_BYTE* buff);
- _int BO_NA_GetCycleFrame(_BYTE* buff);
- bool BO_NA_ScanEventSpontFlag();
-
- bool BO_NA_ScanReqcallFlag(_BYTE group);
- bool BO_NA_ScanCycleFlag();
- bool BO_NA_ScanBackFlag();
- void BO_NA_SetData(_int index, TP_BO_NA * value);
- TP_BO_NA BO_NA_GetData(_int index);
- TP_BO_NA BO_NA_viewdata(_int index);
- TP_BO_NA BO_NA_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void BO_NA_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void BO_NA_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE BO_NA_GetByteQuality(_int index);
- bool BO_NA_ScanQualityChange();
- public:
- bool BO_NA_judgeDatachangeflag(_int index,TP_BO_NA *value);
- ASDU_ATTRI BO_NA_asdu_attri[Data_BO_NA_COUNTS_MAX];
-
- _int BO_NA_SpontPSPtr;
- _int BO_NA_SpecialPSPtr;
- _int BO_NA_SpecialSpontPtr;
- _int BO_NA_SpontPtr;
- _int BO_NA_ReqcallPtr;
- bool BO_NA_Reqcallflag;
- _int BO_NA_CyclescanPtr;
- bool BO_NA_Cycleflag;
- _int BO_NA_BackgroundPtr;
- bool BO_NA_Backflag;
- TP_BO_NA BO_NA_data_val[Data_BO_NA_COUNTS_MAX ];
- TP_BO_NA BO_NA_data_old_val[Data_BO_NA_COUNTS_MAX ];
- _BYTE BO_NA_data_quality[Data_BO_NA_COUNTS_MAX ];
- _BYTE BO_NA_data_old_quality[Data_BO_NA_COUNTS_MAX ];
- _BYTE BO_NA_changeflag[Data_BO_NA_COUNTS_MAX ];
- bool BO_NA_changequalflag[Data_BO_NA_COUNTS_MAX ];
- _BYTE BO_NA_SpecialCOT[Data_BO_NA_COUNTS_MAX ];
- //=========================================================================
- //================================================================================
- public:
- bool BO_TA_IsEmpty();
- _int BO_TA_GetCounts();
- _int BO_TA_GetdispPtr();
- bool BO_TA_AddOneRecorder();
- bool BO_TA_GetFirstRecorder();
- bool BO_TA_RemoveOneRecorder();
-
-
- void BO_TA_SetDataIndex(_WORD index);
-
- void BO_TA_SetData(TP_BO_NA *value);//Note: index-->infobodyaddr
- void BO_TA_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void BO_TA_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void BO_TA_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
-
- void BO_TA_ResetDataflag();
- _int BO_TA_GetEventFrame(_BYTE* buff);//
- _int BO_TB_GetEventFrame(_BYTE* buff);//
- bool BO_TA_ScanEventSpontFlag();
- typedef struct BO_TA_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_BO_NA data_val;
- _BYTE data_quality;
- } BO_TA_SEQ_STRU;
- void BO_TA_dispStore(BO_TA_SEQ_STRU *soe);
- public:
- BO_TA_SEQ_STRU BO_TA_SeqNode;
- BO_TA_SEQ_STRU BO_TA_dispBuf[Data_BO_TA_dispCOUNTS];
- _int BO_TA_dispPtr;
- BO_TA_SEQ_STRU BO_TA_seqlist[Data_BO_TA_COUNTS];
- _WORD BO_TA_counter;
-
- //=======================================================================
- public:
- void ME_ND_ResetDataflag();
- _int ME_ND_GetEventFrame(_BYTE* buff);//
- _int ME_ND_GetReqcallFrame(_BYTE* buff,_BYTE group);
- _int ME_ND_GetBackgroundFrame(_BYTE* buff);
- _int ME_ND_GetCycleFrame(_BYTE* buff);
- bool ME_ND_ScanEventSpontFlag();
- bool ME_ND_ScanReqcallFlag(_BYTE group);
- bool ME_ND_ScanCycleFlag();
- bool ME_ND_ScanBackFlag();
- void ME_ND_SetData(_int index, TP_ME_NA * value);
- void ME_ND_SetDeadBand(_int index,TP_ME_NA deadband);
- TP_ME_NA ME_ND_GetDeadBand(_int index);
- TP_ME_NA ME_ND_GetData(_int index);
- TP_ME_NA ME_ND_viewdata(_int index);
- TP_ME_NA ME_ND_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void ME_ND_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void ME_ND_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE ME_ND_GetByteQuality(_int index);
- bool ME_ND_ScanQualityChange();
- void ME_ND_SetToPara();
- public:
- bool ME_ND_judgeDatachangeflag(_int index,TP_ME_NA *value);
- ASDU_ATTRI ME_ND_asdu_attri[Data_ME_ND_COUNTS_MAX ];
- //TP_ME_NA ME_ND_deadband[Data_ME_ND_COUNTS];
- _int ME_ND_valveptr[Data_ME_ND_COUNTS_MAX ];
- _int ME_ND_highlimit[Data_ME_ND_COUNTS_MAX ];
- _int ME_ND_lowlimit[Data_ME_ND_COUNTS_MAX ];
-
- _int ME_ND_SpecialSpontPtr;
- _int ME_ND_SpontPtr;
- _int ME_ND_ReqcallPtr;
- _int ME_ND_CyclescanPtr;
- _int ME_ND_BackgroundPtr;
- bool ME_ND_Reqcallflag;
- bool ME_ND_Cycleflag;
- bool ME_ND_Backflag;
- TP_ME_NA ME_ND_data_val[Data_ME_ND_COUNTS_MAX ];
- TP_ME_NA ME_ND_data_old_val[Data_ME_ND_COUNTS_MAX ];
- _BYTE ME_ND_data_quality[Data_ME_ND_COUNTS_MAX ];
- _BYTE ME_ND_data_old_quality[Data_ME_ND_COUNTS_MAX ];
- bool ME_ND_changeflag[Data_ME_ND_COUNTS_MAX ];
- bool ME_ND_changequalflag[Data_ME_ND_COUNTS_MAX ];
- _BYTE ME_ND_specialCOT[Data_ME_ND_COUNTS_MAX ];
- //=================================================================================================
- //================================================================================
- public:
- void ME_NA_ResetDataflag();
- _int ME_NA_GetEventFrame(_BYTE* buff);//
- _int ME_NA_GetReqcallFrame(_BYTE* buff,_BYTE group);
- _int ME_NA_GetBackgroundFrame(_BYTE* buff);
- _int ME_NA_GetCycleFrame(_BYTE* buff);
- bool ME_NA_ScanEventSpontFlag();
- bool ME_NA_ScanReqcallFlag(_BYTE group);
- bool ME_NA_ScanCycleFlag();
- bool ME_NA_ScanBackFlag();
- void ME_NA_SetData(_int index, TP_ME_NA * value);
- void ME_NA_SetDeadBand(_int index,TP_ME_NA deadband);
- TP_ME_NA ME_NA_GetDeadBand(_int index);
- TP_ME_NA ME_NA_GetData(_int index);
- TP_ME_NA ME_NA_viewdata(_int index);
- TP_ME_NA ME_NA_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void ME_NA_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void ME_NA_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE ME_NA_GetByteQuality(_int index);
- bool ME_NA_ScanQualityChange();
- void ME_NA_SetToPara();
- public:
- bool ME_NA_judgeDatachangeflag(_int index,TP_ME_NA *value);
- ASDU_ATTRI ME_NA_asdu_attri[Data_ME_NA_COUNTS_MAX ];
- //TP_ME_NA ME_NA_deadband[Data_ME_NA_COUNTS];
- _int ME_NA_valveptr[Data_ME_NA_COUNTS_MAX ];
- _int ME_NA_highlimit[Data_ME_NA_COUNTS_MAX ];
- _int ME_NA_lowlimit[Data_ME_NA_COUNTS_MAX ];
-
- _int ME_NA_SpecialSpontPtr;
- _int ME_NA_SpontPtr;
- _int ME_NA_ReqcallPtr;
- _int ME_NA_CyclescanPtr;
- _int ME_NA_BackgroundPtr;
- bool ME_NA_Reqcallflag;
- bool ME_NA_Cycleflag;
- bool ME_NA_Backflag;
- TP_ME_NA ME_NA_data_val[Data_ME_NA_COUNTS_MAX ];
- TP_ME_NA ME_NA_data_old_val[Data_ME_NA_COUNTS_MAX ];
- _BYTE ME_NA_data_quality[Data_ME_NA_COUNTS_MAX ];
- _BYTE ME_NA_data_old_quality[Data_ME_NA_COUNTS_MAX ];
- bool ME_NA_changeflag[Data_ME_NA_COUNTS_MAX ];
- bool ME_NA_changequalflag[Data_ME_NA_COUNTS_MAX ];
- _BYTE ME_NA_specialCOT[Data_ME_NA_COUNTS_MAX ];
- //=================================================================================================
- public:
- void ME_NB_ResetDataflag();
- _int ME_NB_GetEventFrame(_BYTE* buff);//
- _int ME_NB_GetReqcallFrame(_BYTE* buff,_BYTE group);
- _int ME_NB_GetBackgroundFrame(_BYTE* buff);
- _int ME_NB_GetCycleFrame(_BYTE* buff);
- bool ME_NB_ScanEventSpontFlag();
- bool ME_NB_ScanReqcallFlag(_BYTE group);
- bool ME_NB_ScanCycleFlag();
- bool ME_NB_ScanBackFlag();
- void ME_NB_SetData(_int index, TP_ME_NB * value);
- void ME_NB_SetDeadBand(_int index,TP_ME_NB deadband);
- TP_ME_NB ME_NB_GetDeadBand(_int index);
- TP_ME_NB ME_NB_GetData(_int index);
- TP_ME_NB ME_NB_viewdata(_int index);
- TP_ME_NB ME_NB_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void ME_NB_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void ME_NB_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE ME_NB_GetByteQuality(_int index);
- bool ME_NB_ScanQualityChange();
- void ME_NB_SetToPara();
- public:
- bool ME_NB_judgeDatachangeflag(_int index,TP_ME_NB *value);
- ASDU_ATTRI ME_NB_asdu_attri[Data_ME_NB_COUNTS_MAX ];
- //TP_ME_NB ME_NB_deadband[Data_ME_NB_COUNTS];
- _int ME_NB_valveptr[Data_ME_NB_COUNTS_MAX ];
- _int ME_NB_highlimit[Data_ME_NB_COUNTS_MAX ];
- _int ME_NB_lowlimit[Data_ME_NB_COUNTS_MAX ];
-
- _int ME_NB_SpecialSpontPtr;
- _int ME_NB_SpontPtr;
- _int ME_NB_ReqcallPtr;
- _int ME_NB_CyclescanPtr;
- _int ME_NB_BackgroundPtr;
- bool ME_NB_Reqcallflag;
- bool ME_NB_Cycleflag;
- bool ME_NB_Backflag;
- TP_ME_NB ME_NB_data_val[Data_ME_NB_COUNTS_MAX ];
- TP_ME_NB ME_NB_data_old_val[Data_ME_NB_COUNTS_MAX ];
- _BYTE ME_NB_data_quality[Data_ME_NB_COUNTS_MAX ];
- _BYTE ME_NB_data_old_quality[Data_ME_NB_COUNTS_MAX ];
- bool ME_NB_changeflag[Data_ME_NB_COUNTS_MAX ];
- bool ME_NB_changequalflag[Data_ME_NB_COUNTS_MAX ];
- _BYTE ME_NB_specialCOT[Data_ME_NB_COUNTS_MAX ];
- //=================================================================================================
- public:
- void ME_NC_ResetDataflag();
- _int ME_NC_GetEventFrame(_BYTE* buff);//
- _int ME_NC_GetReqcallFrame(_BYTE* buff,_BYTE group);
- _int ME_NC_GetBackgroundFrame(_BYTE* buff);
- _int ME_NC_GetCycleFrame(_BYTE* buff);
- bool ME_NC_ScanEventSpontFlag();
- bool ME_NC_ScanReqcallFlag(_BYTE group);
- bool ME_NC_ScanCycleFlag();
- bool ME_NC_ScanBackFlag();
- void ME_NC_SetData(_int index, TP_ME_NC * value);
- void ME_NC_SetDeadBand(_int index,TP_ME_NC deadband);
- TP_ME_NC ME_NC_GetDeadBand(_int index);
- TP_ME_NC ME_NC_GetData(_int index);
- TP_ME_NC ME_NC_viewdata(_int index);
- TP_ME_NC ME_NC_GetOldData(_int index);
- //IV: 0有效/1无效 NT:0当前值/1非当前 SB:0未取代/1被取代 BL:0未被闭锁/1闭锁 OV:1溢出/ 0:不溢出
- void ME_NC_SetQuality(_int index,_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void ME_NC_GetQuality(_int index,_BYTE *IV,_BYTE *NT,_BYTE *SB,_BYTE *BL,_BYTE *OV);
- _BYTE ME_NC_GetByteQuality(_int index);
- bool ME_NC_ScanQualityChange();
- void ME_NC_SetToPara();
- public:
- bool ME_NC_judgeDatachangeflag(_int index,TP_ME_NC *value);
- ASDU_ATTRI ME_NC_asdu_attri[Data_ME_NC_COUNTS_MAX ];
- //TP_ME_NC ME_NC_deadband[Data_ME_NC_COUNTS];
- _int ME_NC_valveptr[Data_ME_NC_COUNTS_MAX ];
- _int ME_NC_highlimit[Data_ME_NC_COUNTS_MAX ];
- _int ME_NC_lowlimit[Data_ME_NC_COUNTS_MAX ];
-
- _int ME_NC_SpecialSpontPtr;
- _int ME_NC_SpontPtr;
- _int ME_NC_ReqcallPtr;
- _int ME_NC_CyclescanPtr;
- _int ME_NC_BackgroundPtr;
- bool ME_NC_Reqcallflag;
- bool ME_NC_Cycleflag;
- bool ME_NC_Backflag;
- TP_ME_NC ME_NC_data_val[Data_ME_NC_COUNTS_MAX ];
- TP_ME_NC ME_NC_data_old_val[Data_ME_NC_COUNTS_MAX ];
- _BYTE ME_NC_data_quality[Data_ME_NC_COUNTS_MAX ];
- _BYTE ME_NC_data_old_quality[Data_ME_NC_COUNTS_MAX ];
- bool ME_NC_changeflag[Data_ME_NC_COUNTS_MAX ];
- bool ME_NC_changequalflag[Data_ME_NC_COUNTS_MAX ];
- _BYTE ME_NC_specialCOT[Data_ME_NC_COUNTS_MAX ];
- //=================================================================================================
- bool ME_TA_IsEmpty();
- _int ME_TA_GetCounts();
- _int ME_TA_GetdispPtr();
- bool ME_TA_AddOneRecorder();
- bool ME_TA_GetFirstRecorder();
- bool ME_TA_RemoveOneRecorder();
-
-
- void ME_TA_SetDataIndex(_WORD index);
-
- void ME_TA_SetData(TP_ME_NA *value);//Note: index-->infobodyaddr
- void ME_TA_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void ME_TA_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void ME_TA_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
-
- void ME_TA_ResetDataflag();
- _int ME_TA_GetEventFrame(_BYTE* buff);//
- _int ME_TD_GetEventFrame(_BYTE* buff);//
- bool ME_TA_ScanEventSpontFlag();
- typedef struct ME_TA_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_ME_NA data_val;
- _BYTE data_quality;
- } ME_TA_SEQ_STRU;
- void ME_TA_dispStore(ME_TA_SEQ_STRU *soe);
- public:
- ME_TA_SEQ_STRU ME_TA_SeqNode;
- ME_TA_SEQ_STRU ME_TA_dispBuf[Data_ME_TA_dispCOUNTS];
- _int ME_TA_dispPtr;
- ME_TA_SEQ_STRU ME_TA_seqlist[Data_ME_TA_COUNTS];
- _WORD ME_TA_counter;
- //==============================================================================
- bool EP_TA_IsEmpty();
- _int EP_TA_GetCounts();
- _int EP_TA_GetdispPtr();
- bool EP_TA_AddOneRecorder();
- bool EP_TA_GetFirstRecorder();
- bool EP_TA_RemoveOneRecorder();
- void EP_TA_SetDataIndex(_WORD index);
- void EP_TA_SetData(TP_EP_TA *value);//Note: index-->infobodyaddr
- void EP_TA_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void EP_TA_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void EP_TA_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void EP_TA_ResetDataflag();
- _int EP_TA_GetEventFrame(_BYTE* buff);//
- _int EP_TD_GetEventFrame(_BYTE* buff);//
- bool EP_TA_ScanEventSpontFlag();
- typedef struct EP_TA_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_EP_TA data_val;
- _BYTE data_quality;
- } EP_TA_SEQ_STRU;
- void EP_TA_dispStore(EP_TA_SEQ_STRU *soe);
- public:
- EP_TA_SEQ_STRU EP_TA_SeqNode;
- EP_TA_SEQ_STRU EP_TA_dispBuf[Data_EP_TA_dispCOUNTS];
- _int EP_TA_dispPtr;
- EP_TA_SEQ_STRU EP_TA_seqlist[Data_EP_TA_COUNTS];
- _WORD EP_TA_counter;
- //=================================================================================================
- bool EP_TB_IsEmpty();
- _int EP_TB_GetCounts();
- _int EP_TB_GetdispPtr();
- bool EP_TB_AddOneRecorder();
- bool EP_TB_GetFirstRecorder();
- bool EP_TB_RemoveOneRecorder();
- void EP_TB_SetDataIndex(_WORD index);
- void EP_TB_SetData(TP_EP_TB *value);//Note: index-->infobodyaddr
- void EP_TB_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void EP_TB_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void EP_TB_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void EP_TB_ResetDataflag();
- _int EP_TB_GetEventFrame(_BYTE* buff);//
- _int EP_TE_GetEventFrame(_BYTE* buff);//
- bool EP_TB_ScanEventSpontFlag();
- typedef struct EP_TB_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_EP_TB data_val;
- _BYTE data_quality;
- } EP_TB_SEQ_STRU;
- void EP_TB_dispStore(EP_TB_SEQ_STRU *soe);
- public:
- EP_TB_SEQ_STRU EP_TB_SeqNode;
- EP_TB_SEQ_STRU EP_TB_dispBuf[Data_EP_TB_dispCOUNTS];
- _int EP_TB_dispPtr;
- EP_TB_SEQ_STRU EP_TB_seqlist[Data_EP_TB_COUNTS];
- _WORD EP_TB_counter;
- //========================================================================================
- //=================================================================================================
- bool EP_TC_IsEmpty();
- _int EP_TC_GetCounts();
- _int EP_TC_GetdispPtr();
- bool EP_TC_AddOneRecorder();
- bool EP_TC_GetFirstRecorder();
- bool EP_TC_RemoveOneRecorder();
- void EP_TC_SetDataIndex(_WORD index);
- void EP_TC_SetData(TP_EP_TC *value);//Note: index-->infobodyaddr
- void EP_TC_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void EP_TC_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void EP_TC_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
- void EP_TC_ResetDataflag();
- _int EP_TC_GetEventFrame(_BYTE* buff);//
- _int EP_TF_GetEventFrame(_BYTE* buff);//
- bool EP_TC_ScanEventSpontFlag();
- typedef struct EP_TC_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_EP_TC data_val;
- _BYTE data_quality;
- } EP_TC_SEQ_STRU;
- void EP_TC_dispStore(EP_TC_SEQ_STRU *soe);
- public:
- EP_TC_SEQ_STRU EP_TC_SeqNode;
- EP_TC_SEQ_STRU EP_TC_dispBuf[Data_EP_TC_dispCOUNTS];
- _int EP_TC_dispPtr;
- EP_TC_SEQ_STRU EP_TC_seqlist[Data_EP_TC_COUNTS];
- _WORD EP_TC_counter;
- //========================================================================================
- bool ME_TB_IsEmpty();
- _int ME_TB_GetCounts();
- _int ME_TB_GetdispPtr();
- bool ME_TB_AddOneRecorder();
- bool ME_TB_GetFirstRecorder();
- bool ME_TB_RemoveOneRecorder();
-
-
- void ME_TB_SetDataIndex(_WORD index);
-
- void ME_TB_SetData(TP_ME_NB *value);//Note: index-->infobodyaddr
- void ME_TB_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void ME_TB_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void ME_TB_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
-
- void ME_TB_ResetDataflag();
- _int ME_TB_GetEventFrame(_BYTE* buff);//
- _int ME_TE_GetEventFrame(_BYTE* buff);//
- bool ME_TB_ScanEventSpontFlag();
- typedef struct ME_TB_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_ME_NB data_val;
- _BYTE data_quality;
- } ME_TB_SEQ_STRU;
- void ME_TB_dispStore(ME_TB_SEQ_STRU *soe);
- public:
- ME_TB_SEQ_STRU ME_TB_SeqNode;
- ME_TB_SEQ_STRU ME_TB_dispBuf[Data_ME_TB_dispCOUNTS];
- _int ME_TB_dispPtr;
- ME_TB_SEQ_STRU ME_TB_seqlist[Data_ME_TB_COUNTS];
- _WORD ME_TB_counter;
- //==============================================================================
- //=================================================================================================
- bool ME_TC_IsEmpty();
- _int ME_TC_GetCounts();
- _int ME_TC_GetdispPtr();
- bool ME_TC_AddOneRecorder();
- bool ME_TC_GetFirstRecorder();
- bool ME_TC_RemoveOneRecorder();
-
-
- void ME_TC_SetDataIndex(_WORD index);
-
- void ME_TC_SetData(TP_ME_NC *value);//Note: index-->infobodyaddr
- void ME_TC_SetCOT(_BYTE cot);//Note: index-->infobodyaddr
- void ME_TC_SetTimeTag(TIME_STRU *value);//Note: index-->infobodyaddr
- void ME_TC_SetQuality(_BYTE IV=255,_BYTE NT=255,_BYTE SB=255,_BYTE BL=255,_BYTE OV=255);
-
- void ME_TC_ResetDataflag();
- _int ME_TC_GetEventFrame(_BYTE* buff);//
- _int ME_TF_GetEventFrame(_BYTE* buff);//
- bool ME_TC_ScanEventSpontFlag();
- typedef struct ME_TC_Seqstru
- {
- _BYTE SpecialCOT;
- _WORD index;//
- TIME_STRU timetag;
- TP_ME_NC data_val;
- _BYTE data_quality;
- } ME_TC_SEQ_STRU;
- void ME_TC_dispStore(ME_TC_SEQ_STRU *soe);
- public:
- ME_TC_SEQ_STRU ME_TC_SeqNode;
- ME_TC_SEQ_STRU ME_TC_dispBuf[Data_ME_TC_dispCOUNTS];
- _int ME_TC_dispPtr;
- ME_TC_SEQ_STRU ME_TC_seqlist[Data_ME_TC_COUNTS];
- _WORD ME_TC_counter;
-
- //==============================================================================
- //================================================================================
- public:
- void IT_NA_ResetDataflag();
- void IT_NA_Freeze();
- _int IT_NA_GetEventFrame(_BYTE* buff);//
- _int IT_TA_GetReqcallFrame(_BYTE* buff,_BYTE group);
- _int IT_TB_GetReqcallFrame(_BYTE* buff,_BYTE group);
- void IT_NA_SetData(_int index, TP_IT_NA * value);
- void IT_NA_SetQuality(_int index,_BYTE IV,_BYTE CA,_BYTE CY);
- // void IT_NA_GetQuality(_int index,_BYTE *IV,_BYTE *CA,_BYTE *CY);
- _BYTE IT_NA_GetByteQuality(_int index);
- bool IT_NA_ScanReqcallFlag(_BYTE group);
- TP_IT_NA IT_NA_GetData(_int index);
- TP_IT_NA IT_NA_GetFreezeData(_int index);
- void GetLocalDataTime(TIME_STRU *lt);
- public:
- ASDU_ATTRI IT_NA_asdu_attri[Data_IT_NA_COUNTS_MAX ];
- TP_IT_NA IT_NA_deadband[Data_IT_NA_COUNTS_MAX ];
- _BYTE IT_NA_quality[Data_IT_NA_COUNTS_MAX ];
- _int IT_NA_ReqcallPtr;
- bool IT_NA_Reqcallflag;
- _BYTE IT_NA_group;
- TP_IT_NA IT_NA_data_val[Data_IT_NA_COUNTS_MAX ];
- TP_IT_NA IT_NA_data_Freeze_val[Data_IT_NA_COUNTS_MAX ];
- TIME_STRU freezetime;
- //================================================================================
- public:
- void P_ME_NA_ResetDataflag();
- _int P_ME_NA_GetReqcallFrame(_BYTE* buff,_BYTE group);
- void P_ME_NA_SetData(_int index, TP_ME_NA * value);
- TP_ME_NA P_ME_NA_GetData(_int index,_BYTE kpa);
- bool P_ME_NA_ScanReqcallFlag(_BYTE group);
- public:
- ASDU_ATTRI P_ME_NA_asdu_attri[Data_P_ME_NA_COUNTS_MAX ];
- _int P_ME_NA_ReqcallPtr;
- bool P_ME_NA_Reqcallflag;
- //_BYTE P_ME_NA_group;
- TP_ME_NA P_ME_NA_data[Data_P_ME_NA_COUNTS_MAX ];//KPA:1
- //_BYTE P_ME_NA_QPM[Data_P_ME_NA_COUNTS];
- TP_ME_NA P_ME_NA_toplimit[Data_P_ME_NA_COUNTS_MAX ];//KPA:4
- TP_ME_NA P_ME_NA_lowlimit[Data_P_ME_NA_COUNTS_MAX ];//KPA:3
- TP_ME_NA P_ME_NA_filter[Data_P_ME_NA_COUNTS_MAX ];//KPA:2
- //_BYTE P_ME_NA_LPC[Data_P_ME_NA_COUNTS];//P_ME_NA_localSetData
- //_BYTE P_ME_NA_POP[Data_P_ME_NA_COUNTS];//P_ME_NA_localGetData
- ////////////////////////////////////////////////////////////////////////////
- public:
- void P_ME_NB_ResetDataflag();
- _int P_ME_NB_GetReqcallFrame(_BYTE* buff,_BYTE group);
- void P_ME_NB_SetData(_int index, TP_ME_NB * value);
- TP_ME_NB P_ME_NB_GetData(_int index,_BYTE kpa);
- bool P_ME_NB_ScanReqcallFlag(_BYTE group);
- public:
- ASDU_ATTRI P_ME_NB_asdu_attri[Data_P_ME_NB_COUNTS_MAX ];
- _int P_ME_NB_ReqcallPtr;
- bool P_ME_NB_Reqcallflag;
- //_BYTE P_ME_NB_group;
- TP_ME_NB P_ME_NB_data[Data_P_ME_NB_COUNTS_MAX ];//KPA:1
- //_BYTE P_ME_NB_QPM[Data_P_ME_NB_COUNTS];
- TP_ME_NB P_ME_NB_toplimit[Data_P_ME_NB_COUNTS_MAX ];//KPA:4
- TP_ME_NB P_ME_NB_lowlimit[Data_P_ME_NB_COUNTS_MAX ];//KPA:3
- TP_ME_NB P_ME_NB_filter[Data_P_ME_NB_COUNTS_MAX ];//KPA:2
- //_BYTE P_ME_NB_LPC[Data_P_ME_NB_COUNTS];//P_ME_NB_localSetData
- //_BYTE P_ME_NB_POP[Data_P_ME_NB_COUNTS];//P_ME_NB_localGetData
- ////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////
- public:
- void P_ME_NC_ResetDataflag();
- _int P_ME_NC_GetReqcallFrame(_BYTE* buff,_BYTE group);
- void P_ME_NC_SetData(_int index, TP_ME_NC * value);
- TP_ME_NC P_ME_NC_GetData(_int index,_BYTE kpa);
- bool P_ME_NC_ScanReqcallFlag(_BYTE group);
- public:
- ASDU_ATTRI P_ME_NC_asdu_attri[Data_P_ME_NC_COUNTS_MAX ];
- _int P_ME_NC_ReqcallPtr;
- bool P_ME_NC_Reqcallflag;
- //_BYTE P_ME_NC_group;
- TP_ME_NC P_ME_NC_data[Data_P_ME_NC_COUNTS_MAX ];//KPA:1
- //_BYTE P_ME_NC_QPM[Data_P_ME_NC_COUNTS];
- TP_ME_NC P_ME_NC_toplimit[Data_P_ME_NC_COUNTS_MAX ];//KPA:4
- TP_ME_NC P_ME_NC_lowlimit[Data_P_ME_NC_COUNTS_MAX ];//KPA:3
- TP_ME_NC P_ME_NC_filter[Data_P_ME_NC_COUNTS_MAX ];//KPA:2
- //_BYTE P_ME_NC_LPC[Data_P_ME_NC_COUNTS];//P_ME_NC_localSetData
- //_BYTE P_ME_NC_POP[Data_P_ME_NC_COUNTS];//P_ME_NC_localGetData
- ////////////////////////////////////////////////////////////////////////////
- public:
- bool C_SC_GetYK(_BYTE *pYKtype, _WORD *pYKpoint,_BYTE *pYKstatus);
- bool C_SC_SetYK(_BYTE pYKtype, _WORD pYKpoint,_BYTE pYKstatus);
- bool C_SC_GetYKrt(_BYTE *pYKrt);
- bool C_SC_SetYKrt(_BYTE pYKrt);
- private:
-
- bool C_SC_YKflag;
- _BYTE C_SC_YKtype;
- _WORD C_SC_YKpoint;
- _BYTE C_SC_YKstatus;
- _BYTE C_SC_YKrtflag;
- _BYTE C_SC_YKrtresult;
- public:
- bool C_DC_GetYK(_BYTE *pYKtype, _WORD *pYKpoint,_BYTE *pYKstatus);
- bool C_DC_SetYK(_BYTE pYKtype, _WORD pYKpoint,_BYTE pYKstatus);
- bool C_DC_GetYKrt(_BYTE *pYKrt);
- bool C_DC_SetYKrt(_BYTE pYKrt);
- private:
- bool C_DC_YKflag;
- _BYTE C_DC_YKtype;
- _WORD C_DC_YKpoint;
- _BYTE C_DC_YKstatus;
- _BYTE C_DC_YKrtflag;
- _BYTE C_DC_YKrtresult;
- public:
- bool C_RC_GetYK(_BYTE *pYKtype, _WORD *pYKpoint,_BYTE *pYKstatus);
- bool C_RC_SetYK(_BYTE pYKtype, _WORD pYKpoint,_BYTE pYKstatus);
- bool C_RC_GetYKrt(_BYTE *pYKrt);
- bool C_RC_SetYKrt(_BYTE pYKrt);
- private:
- bool C_RC_YKflag;
- _BYTE C_RC_YKtype;
- _WORD C_RC_YKpoint;
- _BYTE C_RC_YKstatus;
- _BYTE C_RC_YKrtflag;
- _BYTE C_RC_YKrtresult;
- public:
- bool C_SE_NA_GetYK(_BYTE *pYKtype, _WORD *pYKpoint,TP_ME_NA *pYKstatus);
- bool C_SE_NA_SetYK(_BYTE pYKtype, _WORD pYKpoint,TP_ME_NA pYKstatus);
- bool C_SE_NA_GetYKrt(_BYTE *pYKrt);
- bool C_SE_NA_SetYKrt(_BYTE pYKrt);
- private:
- bool C_SE_NA_YKflag;
- _BYTE C_SE_NA_YKtype;
- _WORD C_SE_NA_YKpoint;
- TP_ME_NA C_SE_NA_YKstatus;
- _BYTE C_SE_NA_YKrtflag;
- _BYTE C_SE_NA_YKrtresult;
- public:
- bool C_SE_NB_GetYK(_BYTE *pYKtype, _WORD *pYKpoint,TP_ME_NB *pYKstatus);
- bool C_SE_NB_SetYK(_BYTE pYKtype, _WORD pYKpoint,TP_ME_NB pYKstatus);
- bool C_SE_NB_GetYKrt(_BYTE *pYKrt);
- bool C_SE_NB_SetYKrt(_BYTE pYKrt);
- private:
- bool C_SE_NB_YKflag;
- _BYTE C_SE_NB_YKtype;
- _WORD C_SE_NB_YKpoint;
- TP_ME_NB C_SE_NB_YKstatus;
- _BYTE C_SE_NB_YKrtflag;
- _BYTE C_SE_NB_YKrtresult;
- public:
- bool C_SE_NC_GetYK(_BYTE *pYKtype, _WORD *pYKpoint,TP_ME_NC *pYKstatus);
- bool C_SE_NC_SetYK(_BYTE pYKtype, _WORD pYKpoint,TP_ME_NC pYKstatus);
- bool C_SE_NC_GetYKrt(_BYTE *pYKrt);
- bool C_SE_NC_SetYKrt(_BYTE pYKrt);
- private:
- bool C_SE_NC_YKflag;
- _BYTE C_SE_NC_YKtype;
- _WORD C_SE_NC_YKpoint;
- TP_ME_NC C_SE_NC_YKstatus;
- _BYTE C_SE_NC_YKrtflag;
- _BYTE C_SE_NC_YKrtresult;
- #define C_SE_ND_MaxCounts 32
- public:
- bool C_SE_ND_GetCounts(_int *counts);
- void C_SE_ND_SetTerm();
- void C_SE_ND_GetTerm();
- bool C_SE_ND_GetYK(_BYTE *pYKtype,_int ind, _WORD *pYKpoint,TP_ME_NA *pYKstatus);
- bool C_SE_ND_SetYK(_BYTE pYKtype,_int ind, _WORD pYKpoint,TP_ME_NA pYKstatus);
- bool C_SE_ND_GetYKrt(_BYTE *pYKrt);
- bool C_SE_ND_SetYKrt(_BYTE pYKrt);
- private:
- _int C_SE_ND_Counts;
- bool C_SE_ND_YKflag;
- _BYTE C_SE_ND_YKtype;
- _WORD C_SE_ND_YKpoint[C_SE_ND_MaxCounts];
- TP_ME_NA C_SE_ND_YKstatus[C_SE_ND_MaxCounts];
- _BYTE C_SE_ND_YKrtflag;
- _BYTE C_SE_ND_YKrtresult;
- public:
- bool C_BO_NA_GetYK(_BYTE *pYKtype, _WORD *pYKpoint,TP_BO_NA *pYKstatus);
- bool C_BO_NA_SetYK(_BYTE pYKtype, _WORD pYKpoint,TP_BO_NA pYKstatus);
- bool C_BO_NA_GetYKrt(_BYTE *pYKrt);
- bool C_BO_NA_SetYKrt(_BYTE pYKrt);
- private:
- bool C_BO_NA_YKflag;
- _BYTE C_BO_NA_YKtype;
- _WORD C_BO_NA_YKpoint;
- TP_BO_NA C_BO_NA_YKstatus;
- _BYTE C_BO_NA_YKrtflag;
- _BYTE C_BO_NA_YKrtresult;
- //===========================================================================================
- public:
- typedef struct serv_node_stru
- {
- _int ID;
- _char serv_name[32];//SpecialPS ,SpontPS,SpecialCOT ,YKterm,PA,Spont,ReqCall,Cycle,BackGround,SubEndinit is class1 data,
- //After SubEndinit, reset process.
-
- bool priority_bit;
- _BYTE nextTypeTag;
- _BYTE nextCOT;
-
- } SERV_NODE;
- //SERV_NODE serv[MAXASDU_SERVNUM] ;
- _BYTE bakbuf[MAXRXBUF];
- _int baklen;
- SERV_NODE priority[MAXASDU_SERVNUM];//
- void serv_Init_Priority();
- bool serv_isConfirm(_BYTE pri);
- void serv_SetPriorityBit(_BYTE bit);
- void serv_ResetPriorityBit(_BYTE bit);
- _BYTE serv_GetTopPriority();
- _BYTE serv_GetACDflag();
- _BYTE serv_GetNextTypeTag(_BYTE bit);
- _BYTE serv_GetNextCOT(_BYTE bit);//Cause Of Transfer
- void serv_SetNextTypeTag(_BYTE bit,_BYTE typetag);
- void serv_SetNextCOT(_BYTE bit,_BYTE cot);
- void serv_BackupData(_BYTE bit,_BYTE * buf,_int len);
- _BYTE * serv_RestoreData(_BYTE bit,_int * len);
- _BYTE serv_Does_Have_Class2();
- bool InitConfig()
- {return 1;};// read all of points defination from the file
- bool InitRtdb();// So many different type classes are created according to the Configuration of File
-
- void SetBit_EndSubInit();
- void ResetDataflag();
- void ResetProcess();
- bool InitASDU();
- bool wdg_threadflag;
- _BYTE datalist[MAX_TPLIST];
- bool IsTaginlist(_BYTE Tag);
- void set_Tag_enable(_BYTE tag,bool enable);
- bool noASDUrunning;
- bool CloseASDU();
- HANDLE wdg_handle;
- HANDLE Timer_handle;
- protected:
-
-
- private:
- _int SpecialSpontPtr;
- _int SpecialPSPtr;
- _int SpontPtr;
- _int SpontPSPtr;
- _int CyclePtr;
- _int BackPtr;
- _int ReqcallPtr;
- _int ITReqcallPtr;
- _BYTE group;
- static void Timer_thread(void *pp);
-
- // void linkprocess();
- static void wdg_thread(void *pp);
-
- _int wdg_counts;
- void Clear_Watchdog();
- _int Timer_Cycle_counts;
- _int Timer_Back_counts;
-
-
- bool ScanSpecialSpontFlag();
- bool ScanEventSpontFlag();
- // bool ScanSpecialPSFlag();
- // bool ScanSpontPSFlag();
- bool ScanCycleFlag();
- bool ScanBackFlag();
- bool ScanReqcallFlag(_BYTE group);
- bool ScanITReqcallFlag(_BYTE group);
- _int TxSubEnd(_BYTE *buf);
- _int TxYKterm(_BYTE *buf);
- _int TxSpecial(_BYTE *buf);
-
- _int TxEvent(_BYTE *buf);
- _int TxCycle(_BYTE *buf);
-
- _int TxBack(_BYTE *buf);
- // _int TxSpecialPS(BYTE *buf);
- // _int TxSpontPS(BYTE *buf);
- _int TxReqCall(_BYTE *buf,_BYTE group);
-
- _int TxReqPulseAccount(_BYTE *buf);
-
-
- bool ASDUcon_flag;
- _BYTE rxbuf[MAXRXBUF];
- _int rxlen;
- _BYTE txbuf[MAXTXBUF];
- _int txlen;
- void RxNoreply();
-
- void ParseApp(_int counts);
- void RxConfirm();
- void RxNoConfirm();
- _int TxConfirm(_BYTE *buf, _BYTE pri);
- _int Tx_class1data(_BYTE *buf,_BYTE pri);
- _int Tx_class2data(_BYTE *buf,_BYTE pri);
- void testASDUprocess(_BYTE *buff,_int *len,bool *ACD);
- void DumptoLinker(_BYTE *buff,_int len,bool ACD=0);
- void TxResponse(bool *finished);
- virtual void OnApplayer(_int type);
- _int inputbufsize;
- _int outpubufsize;
- void decodeC_TS_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_RP_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_CD_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_SC_NA_1(_BYTE cot,_BYTE *buf, _int len);
- bool C_SC_select_Ready;
- HANDLE SC_timeout_thread;
- static void SC_timeout_threadfunc(void *pp);
- void decodeC_DC_NA_1(_BYTE cot,_BYTE *buf, _int len);
- bool C_DC_select_Ready;
- HANDLE DC_timeout_thread;
- static void DC_timeout_threadfunc(void *pp);
-
- void decodeC_RC_NA_1(_BYTE cot,_BYTE *buf, _int len);
- bool C_RC_select_Ready;
- HANDLE RC_timeout_thread;
- static void RC_timeout_threadfunc(void *pp);
- void decodeC_SE_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_SE_NB_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_SE_NC_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_SE_ND_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_BO_NA_1(_BYTE cot,_BYTE *buf, _int len);
- bool C_BO_select_Ready;
- HANDLE BO_timeout_thread;
- static void BO_timeout_threadfunc(void *pp);
-
- void decodeC_CS_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_IC_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_CI_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeC_RD_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeP_ME_NA_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeP_ME_NB_1(_BYTE cot,_BYTE *buf, _int len);
- void decodeP_ME_NC_1(_BYTE cot,_BYTE *buf, _int len);
- _int encodeC_res_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);
- _int encodeC_SC_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_DC_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_RC_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_SE_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_SE_NB_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_SE_NC_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_SE_ND_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_BO_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeC_CS_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);//
- _int encodeC_IC_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);//prepare nextreq nextCOT Setbit BackUp Data
- _int encodeC_CI_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);//prepare nextreq nextCOT Setbit BackUp Data
- _int encodeC_TS_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);
- _int encodeC_RP_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);
- _int encodeC_RD_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);
- _int encodeC_CD_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);
- _int encodeSubEnd(_BYTE cot,_BYTE* buf);
- _int encodeC_ICterm_NA_1(_BYTE* buf);
- _int encodeC_CIterm_NA_1(_BYTE* buf);
- _int encodeP_ME_NA_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeP_ME_NB_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- _int encodeP_ME_NC_1(_BYTE cot,_BYTE* bakbuf,_int baklen,_BYTE* buf);////if YKexect ,Setbit Ykterm and BackUp Data.According to BackData of TeleCode bit.
- TIME_STRU oldlocaltime;
- struct _timeb localtime_rxCD;
- _int localdiff_time;//localThreadTime=localTimediff+CDmodifytime+GetLocalTime();
- _int localdiff_milli;
- _int CDtimediff;// recieve a Delay Time;
- _int CDmodifytime;
- };
- #endif