📄 common.h
字号:
};//struct check_time_t
extern struct check_time_t check_time;
extern char password[6]; //save yk password
struct yx_info_t
{
unsigned int yx_set_bit[64]; //64*16=1024
unsigned int yx_set_value[64]; //64*16=1024
unsigned int yx_value[64]; //64*16=1024
};//struct yx_info_t
//extern struct yx_info_t yx_info; //64*16=1024
//extern unsigned int yx_compress[1024][5]; //defined in commclass.h used in windows.cpp
//1024 yx num [i][0]:port1 [1]:port2 [2]:port3 [3]:port4 [4]:port5678 [5]:not [6]:soe
//extern unsigned int protect_yx[512][6];
//total 256 yx [0]portno [1]monno [2]caseno [3]acttype [4]reset [5]time
//extern unsigned int prot_yx[32]; //yx 256
//extern unsigned int port_yx[2][32]; //yx //only use [0]:1234 [1]:5678
struct time_tt
{
unsigned int year;
BYTE month;
BYTE day;
BYTE hour;
BYTE minute;
BYTE second;
int mil_second;//value
};//struct time_tt
typedef struct SOE1 ///Structure of SOE1
{
int orderno;
BYTE status;
BYTE send_status[10];
struct time_tt time;
};//typedef struct SOE1 ///Structure of SOE1
typedef struct SOE2 ///Structure of SOE2
{
BYTE start;
BYTE next; //where the next SOE place
BYTE size; //total size of buffers
BYTE count[10]; //how many SOE now
SOE1 soe_log[256]; //SOE saver
WORD readptr[10];
WORD writeptr;
};//typedef struct SOE2 ///Structure of SOE2
//extern SOE2 soe_ctl[8]; //for cotrol SOE operation
typedef struct SOE3
{
unsigned int year;
BYTE month;
BYTE day;
BYTE hour;
BYTE minute;
BYTE second;
int mil_second;//value
BYTE status;
int orderno;
};
struct yx_bw_tt
{
BYTE func_code;
unsigned int two_yx_word[2];
BYTE send_count[10];
};//struct yx_bw_tt
struct yx_bw_t
{
BYTE start;
BYTE next;
BYTE count[10];
BYTE size;
WORD readptr[10];
WORD writeptr;
struct yx_bw_tt bw[256];
};//struct yx_bw_t
struct ybt {
BYTE func_code;
WORD yx1;
WORD yx2;
};
struct yc_info_t
{
unsigned int yc_set_bit[32]; //32*16=512
float base[512];
float coef[512];
int yc_value[512];
};//struct yc_info_t
//extern struct yc_info_t yc_info;
//extern unsigned int yc_sequence[512][2]; //defined in ycclass.h used in windows.cpp
//total 512 yc [0]port1&&port5 [1]port2&port6 [2]port3&port7 [3]port4&port8
//extern unsigned int yc_define[256][4];
//total 256 yc [0]portno [1]monno [2]caseno [3]measuretype
//extern int port_yc[2][512]; //for save port yc value [0]:1234 [1]:5678
struct ym_info_t
{
unsigned int ym_set_bit[10]; //8*16=128
float base[128];
float coef[128];
unsigned long ym_value[128];
};//struct yc_info_t
//extern struct ym_info_t ym_info;
//extern unsigned int ym_sequence[128][2]; //defined in ymclass.h used in windows.cpp
//total 128 ym [0]port1&&port5 [1]port2&port6 [2]port3&port7 [3]port4&port8
//extern unsigned int ym_define[64][4];
//total 64 yc [0]portno [1]monno [2]caseno [3]measuretype
//extern long unsigned int gport_ym[128];//for get
//below is used in windows.cpp
//extern long unsigned int sport_ym[128];//for send
struct ykop_t
{
char pwd[6];
int ykobj;
int ykcmd;
BOOLEAN preset;
BOOLEAN exec;
BOOLEAN esc;
char pwd1[6];
char pwd2[6];
BOOLEAN changepwd;
int checkresult; //=0x55:no in =0xcc ok =0x33 error
BOOLEAN endflag;
BOOLEAN pwdokflag;
};//struct ykop_t
//extern struct ykop_t ykop; //used in winclass.cpp
#define YKCCLOSE 0xcc
#define YKCTRIP 0x33
#define YKCEXEC 0xaa
#define YKCESC 0x55
#define YKINONE 0x00
#define YKICLOSE 0xcc
#define YKITRIP 0x33
#define YKIEXEC 0xaa
#define YKIESC 0x55
#define YKSNONE 0x33
#define YKSPRESET 0xcc
#define YKSEXEC 0xaa
#define YKSESC 0x55
#define YKRNONE 0x55
#define YKROK 0xcc
#define YKRERROR 0x33
#define YKRTOUT 0xaa
#define YKFNONE 0x33
#define YKFP1 0x00
#define YKFP2 0x01
#define YKFP3 0x02
#define YKFP4 0x03
#define YKFP5 0x04
#define YKFP6 0x05
#define YKFP7 0x06
#define YKFP8 0x10
#define YKFCOM1 0x08
#define YKFWIN 0x09
#define YKMNONE 0x33
#define YKMC3A 0xcc
#define YKMDMU 0xaa
#define YKPNONE 0xcc
#define YKPERROR 0x33
#define YKMCOM 0x44
struct ykoperation_t
{
int ykobj; //0-255
int ykcmd;
//0xcc:close 0x33:trip
//YKCCLOSE 0xcc YKCTRIP 0x33
int ykcmdint;
//init:0x00:no command 0xcc:close 0x33:trip 0xaa:exec 0x55:esc
//YKINONE 0x00 YKICLOSE 0xcc YKITRIP 0x33 YKIEXEC 0xaa YKIESC 0x55
int preseterr; //0xcc noerror //0x33 error
//YKPNONE 0xcc YKPERROR 0x33
int ykstate;
//init:0x33:no yk cmd 0xcc:ykpreset 0xaa:ykexecute 0x55:ykescape
//YKSNONE 0x33 YKSPRESET 0xcc YKSEXEC 0xaa YKSESC 0x55
int timer;//in that state start the timer
int timerlimit; //in diff state has a limit
int ykcheckresult;
//init:0x55:nonecheck 0xcc:checkok 0x33:checkerror 0xaa:timeouterroe
//YKRNONE 0x55 YKROK 0xcc YKRERROR 0x33 YKRTOUT 0xaa
int ykfrom;
//init:0x33:noyk cmd 0x00:port1 0x07:port8 0x08:com1 0x09:windows
//YKFNONE 0x33 YKFP1 0x00 YKFP2 0x01 YKFCOM 0x08 YKFWIN 0x09
int ykexeman;
//init:0x33:no ykcmd 0xcc:c3aboard 0xaa:dmusubstation
//YKMNONE 0x33 YKMC3A 0xcc YKMDMU 0xaa
BOOLEAN isover;
};//struct ykoperation_t
//extern struct ykoperation_t ykoper;//defined in common.h mainprog.h used in ykclass.cpp
struct ykreturn_t
{
BOOLEAN ykretflag[10];
int ykretobj;
int ykretcmd; //0xcc:close 0x33:trip 0xff:error
};//struct ykreturn_t
//extern struct ykreturn_t ykret;//defined in common.h mainprog.h used in ykclass.cpp
//extern unsigned int yk_time[112][2];//64 YK [i][0]:close time in second
// YK [i][1]: trip time in second
struct isatimer_t
{
/*
int querycount;
int querylimit;
int checktime;
int checklimit;
*/
unsigned int querycount;
unsigned int querylimit;
unsigned int checktime;
unsigned long checklimit;
};//struct isatimer_t
//below is for protect yx reset
struct prot_yx_reset
{
BOOLEAN flag;
unsigned int timer;
unsigned int timer_limit;
};//struct prot_yx_reset
#define WATCHDOGLIMIT 1000
extern unsigned int watchdog[10];//for watch dog defined in mainprog.h
//here define extend nbbclass that is add in protect protocol
struct protect_handover_t //type is defined in common.h
{
BYTE tstart;
BYTE tnext;
BYTE tcount;
BYTE tsize;
BYTE tbuf[1024];
BYTE rstart;
BYTE rnext;
BYTE rcount;
BYTE rsize;
BYTE rbuf[1024];
};//struct protect_handover_t //type is defined in common.h
//struct protect_handover_t protectbuf[8];//type is defined in common.h
//protectbuf[8] is defined in nbbclass.h used in nbbclass.cpp and all protectclass.cpp
//initialized in comclass.cpp--initprotectbuf();
struct ts_CDT_data_t
{
BOOLEAN flag; //on or off
BYTE port;
};//struct ts_CDT_data_t
//struct ts_CDT_data_t ts_CDT_data; // struct ts_CDT_data_t is defined in common.h
//is for flag if send CDT of a port to COM1 ts_CDT_data is defined in tsclass.h
struct port_time_t
{
BYTE year;
BYTE month;
BYTE day;
BYTE hour;
BYTE minute;
BYTE second;
unsigned int mil_second;
};//struct port_time_t
extern BOOLEAN displaymode; //for display message :: display with check(FALSE) without(TRUE)
#define STATE0 0
#define STATE1 1
#define STATE2 2
#define START_LOG_BUF_SIZE 40
struct start_record_data_t
{
int no;
struct date d;
struct time t;
};//ostruct start_record_data_t
struct start_record_t
{
unsigned int start;
unsigned int next;
unsigned int count;
unsigned int total;
unsigned int size;
struct start_record_data_t data_array[START_LOG_BUF_SIZE];
};//struct start_record_t
struct yk_info_t {
int yk_num;
INT8U yk_cmd; //0x00 NULL, 0xcc close, 0x33 open
INT8U yk_order;//0xff no effect;
INT8U portno;
INT8U devadd;
INT8U interno;
BOOLEAN Y_PRESET;
BOOLEAN Y_CHECK;
BOOLEAN Y_EXEC;
BOOLEAN Y_ESC;
BOOLEAN Y_CHKERR;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -