📄 sim_valve.h
字号:
//---------------------------------------------------------------------------
#ifndef Sim_ValveH
#define Sim_ValveH
#define VALVE_MAX_TIME 40
#define LIMIT_T1 -30
#define LIMIT_T2 -10
#define LIMIT_T3 0
#define LIMIT_T4 10
#define LIMIT_T5 30
#define LIMIT_T6 50
#define LIMIT_T7 70
#define LIMIT_T8 90
#define LIMIT_T9 110
#define TENY 1000000000
#define ALARMTIMEAUTO 10
#define ALARMLIMAUTO 2
#define UPARROR 0x01
#define DNARROR 0x02
#define MEARROR 0x04
#define CIARROR 0x08
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
//在程序存贮器中
//段选对应码
//用于8段选码
//数字
//0 1 2 3 4 5 6 7 8 9
//0 1 2 3 4 5 6 7 8 9
//字母
//1011121314151617 35
// A B C D E F G H I G K L M N O P Q R S T U V W X Y Z
//特殊符号
//36 37 38 39 40
//空 - + U 度
//这些段码存放在程序存贮器中,不占用内存
static unsigned char m_Code[50][2]={
{0x0F,0x0A}, //0
{0x06,0x00}, //1
{0x0D,0x06}, //2
{0x0F,0x04}, //3
{0x06,0x0C}, //4
{0x0B,0x0C}, //5
{0x0B,0x0E}, //6
{0x0E,0x00}, //7
{0x0F,0x0E}, //8
{0x0F,0x0C}, //9
{0x0E,0x0E}, //A
{0x03,0x0E}, //b
{0x01,0x06}, //c
{0x07,0x06}, //d
{0x09,0x0E}, //E
{0x08,0x0E}, //F
{0x0B,0x0A}, //G
{0x06,0x0E}, //H
{0x02,0x00}, //i
{0x07,0x00}, //J
{0x02,0x0E}, //K
{0x01,0x0A}, //L
{0x0E,0x0A}, //M
{0x02,0x06}, //n
{0x03,0x06}, //o
{0x0C,0x0E}, //P
{0x0E,0x0C}, //q
{0x00,0x06}, //r
{0x0B,0x0C}, //S
{0x01,0x0E}, //t
{0x03,0x02}, //u
{0x03,0x02}, //v
{0x07,0x0A}, //W
{0x00,0x00}, //X
{0x07,0x0C}, //y
{0x0D,0x06}, //Z
{0x00,0x00}, //空 a
{0x00,0x04}, //- b
{0x00,0x0E}, //+ c
{0x0C,0x0C}, //0度 d
{0x02,0x0C}, //报警号 e
{0x0A,0x06} //-n f
};
//用于14段选码,排列与8段选码相同
static unsigned char m_CodeM[50][4]={
{0x0F,0x00,0x00,0x03}, //0
{0x00,0x00,0x00,0x03}, //1
{0x0B,0x04,0x02,0x02}, //2
{0x09,0x04,0x02,0x03}, //3
{0x04,0x04,0x02,0x03}, //4
{0x0D,0x04,0x02,0x01}, //5
{0x0F,0x04,0x02,0x01}, //6
{0x08,0x00,0x00,0x03}, //7
{0x0F,0x04,0x02,0x03}, //8
{0x0D,0x04,0x02,0x03}, //9
{0x0E,0x04,0x02,0x03}, //A
{0x09,0x01,0x0A,0x03}, //B
{0x0F,0x00,0x00,0x00}, //C
{0x09,0x01,0x08,0x03}, //D
{0x0F,0x04,0x00,0x00}, //E
{0x0E,0x04,0x00,0x00}, //F
{0x0F,0x00,0x02,0x01}, //G
{0x06,0x04,0x02,0x03}, //H
{0x09,0x01,0x08,0x00}, //I
{0x01,0x00,0x00,0x03}, //J
{0x06,0x04,0x05,0x00}, //K
{0x07,0x00,0x00,0x00}, //L
{0x06,0x08,0x04,0x03}, //M
{0x06,0x08,0x01,0x03}, //N
{0x0F,0x00,0x00,0x03}, //O
{0x0E,0x04,0x02,0x02}, //P
{0x0F,0x00,0x01,0x03}, //Q
{0x0E,0x04,0x03,0x02}, //R
{0x0D,0x04,0x02,0x01}, //S
{0x08,0x01,0x08,0x00}, //T
{0x07,0x00,0x00,0x03}, //U
{0x06,0x02,0x04,0x00}, //V
{0x06,0x02,0x01,0x03}, //W
{0x00,0x0A,0x05,0x00}, //X
{0x00,0x09,0x04,0x00}, //Y
{0x09,0x02,0x04,0x00}, //Z
{0x00,0x00,0x00,0x00}, //空
{0x00,0x04,0x02,0x00}, //-
{0x00,0x05,0x0A,0x00}, //+
{0x0C,0x04,0x02,0x02}, //0度
{0x04,0x04,0x02,0x01} //报警号
};
//设定显示状态,参数名称
static unsigned char m_Set_State[55][6]={
{"YFCTa"},//1
{"YAGLa"},//2
{"YWAYa"},//3
{"INITR"},//4
{"INITM"},//5
{"SCURa"},//6
{"SDIRa"},//7
{"SPRAa"},//8
{"SPREa"},//9
{"TSUPa"},//10
{"TSDOa"},//11
{"SFCTa"},//12
{"SL0aa"},//13
{"SL1aa"},//14
{"SL2aa"},//15
{"SL3aa"},//16
{"SL4aa"},//17
{"SL5aa"},//18
{"SL6aa"},//19
{"SL7aa"},//20
{"SL8aa"},//21
{"SL9aa"},//22
{"SL10a"},//23
{"SL11a"},//24
{"SL12a"},//25
{"SL13a"},//26
{"SL14a"},//27
{"SL15a"},//28
{"SL16a"},//29
{"SL17a"},//30
{"SL18a"},//31
{"SL19a"},//32
{"SL20a"},//33
{"DEBAa"},//34
{"YAaaa"},//35
{"YEaaa"},//36
{"YNRMa"},//37
{"YDIRa"},//38
{"YCLSa"},//39
{"YCDOa"},//40
{"YCUPa"},//41
{"BIN1a"},//42
{"BIN2a"},//43
{"AFCTa"},//44
{"A1aaa"},//45
{"A2aaa"},//46
{"eFCTa"},//47
{"eTIMa"},//48
{"eLIMa"},//49
{"eSTRK"},//50
{"eDCHG"},//51
{"eZERO"},//52
{"eOPEN"},//53
{"eDEBA"},//54
{"PRSTa"},//55
};
//Check参数名称
static char m_Test_Name[35][6]={
{"STRKS"},//1,行程累积,按+5秒可复位为0(rESEt),需要确认
{"CHDIR"},//2,阀改变方向次数,按+5秒可复位为0(rESEt)
{"HCNTa"},//3,总报警次数,按+5秒可复位为0(rESEt)
{"A1CNT"},//4,A1报警次数,按+5秒可复位为0(rESEt)
{"A2CNT"},//5,A2报警次数,按+5秒可复位为0(rESEt)
{"HOURS"},//6,总运行时间(小时),以何为标准
{"WAYaa"},//7,当前操作方式,与m_YFCT对应,需要确认
{"TUPaa"},//8,阀上升定位时间,需要确认
{"TDOWN"},//9,阀下降定位时间,需要确认
{"LEAKa"},//10,执行机构泄漏,需要确认
{"P0aaa"},//11,
{"P100a"},//12,
{"IMPUP"},//13
{"IMPDN"},//14
{"DBUPa"},//15,死区正限位,为m_DEBA值
{"DBDNa"},//16,死区负限位,为-m_DEBA值
{"SSUPa"},//17
{"SSDNa"},//18
{"TEMPa"},//19,当前温度,按”+“可进行摄氏与华氏之间转换
{"TMINa"},//20,最小温度,
{"TMAXa"},//21,最大温度
{"T1aaa"},//22,T1运行时间
{"T2aaa"},//23,T2运行时间
{"T3aaa"},//24
{"T4aaa"},//25
{"T5aaa"},//26
{"T6aaa"},//27
{"T7aaa"},//28
{"T8aaa"},//29
{"T9aaa"},//30
{"VENT1"},//31,压电阀运行循环次数
{"VENT2"},//32,压电阀运行循环次数
{"STORE"},//33,存贮,按”+“5秒后存贮,出现Strt(Start)
{"PRUPa"},//34,
{"PRDNa"} //35,
};
static char m_Set_YFCT[6][6]={
{"TURNa"},
{"aWAYa"},
{"LWAYa"},
{"aNOST"},
{"bNOST"},
{"aNOSL"}
};
static char m_Set_YAGL[2][6]={
{"aa90d"},
{"aa33d"}
};
static char m_Set_YWAY[15][6]={
{"aaOFF"}, //1
{"aaaa5"}, //2
{"aaa10"}, //3
{"aaa15"}, //4
{"aaa20"}, //5
{"aaa25"}, //6
{"aaa30"}, //7
{"aaa35"}, //8
{"aaa40"}, //9
{"aaa50"}, //10
{"aaa60"}, //11
{"aaa70"}, //12
{"aaa90"}, //13
{"aa110"}, //14
{"aa130"} //15
};
static char m_Set_INITAM[3][6]={
{"NOINI"},
{"aaaNO"},
{"aSTRT"}
};
static char m_Set_SCUR[2][6]={
{"aa0MA"},
{"aa4MA"}
};
static char m_Set_SDIR[2][6]={
{"aRISE"},
{"aFALL"}
};
static char m_Set_SFCT[12][6]={
{"aaLIN"}, //1
{"1b25a"}, //2
{"1b33a"}, //3
{"1b50a"}, //4
{"N1b25"}, //5
{"N1b33"}, //6
{"N1b50"}, //7
{"aFREE"} //8
};
static char m_Set_YNRM[2][6]={
{"aMPOS"},
{"aFLOW"}
};
static char m_Set_YDIR[2][6]={
{"aRISE"},
{"aFALL"}
};
static char m_Set_YCLS[4][5]={
{"aaaNO"},
{"aaaUP"},
{"aaaDO"},
{"UPaDO"}
};
static char m_Set_BIN12[11][6]={
{"aaOFF"}, //1
{"aabON"}, //2
{"aaaON"}, //3
{"BLOC1"}, //4
{"BLOC2"}, //5
{"aaaUP"}, //6
{"aDOWN"}, //7
{"aSTOP"}, //8
{"aabUP"}, //9
{"bDOWN"}, //10
{"bSTOP"} //11
};
static char m_Set_AFCT[7][6]={
{"aOFFa"},
{"MIaMA"}, //1 NI NA
{"MIaMI"}, //2 NI NI
{"MAaMA"}, //3
{"fIafA"},
{"fIafI"},
{"fAafA"},
};
static char m_Set_HFCT[6][6]={
{"aeaaa"}, //1
{"aeNRa"}, //2
{"aeNAB"}, //3
{"beaaa"},
{"beNRa"},
{"beNRB"}
};
static char m_Set_PRST[3][6]={
{"aNOaa"}, //1 NI NA
{"aSTRT"}, //2 NI NI
{"aOCAY"} //3
};
static char m_Init_Disp[6][6]={
{"RUNa1"}, //1 NI NA
{"RUNa2"}, //2 NI NI
{"RUNa3"}, //3
{"RUNa4"}, //4
{"RUNa5"}, //5
{"FINSH"} //6
};
static char m_Mani_Init_Disp[4][6]={
{"YEND1"}, //1 NI NA
{"YEND2"}, //2 NI NI
{"RANGE"}, //3
{"MIDDL"} //4
};
//系统状态显示数据
static char m_SYS_State[7][6]={
{"ERROR"},
{"NOINI"},
{"MANa5"},
{"AUTa5"},
{"VERaa"},
{"CY201"},
{"aaaaa"}
};
static char m_Wait_Loop[6][4]={
{0x08,0x00,0x01,0x00},
{0x01,0x00,0x08,0x00},
{0x02,0x00,0x00,0x08},
{0x04,0x00,0x00,0x02},
{0x00,0x00,0x00,0x00}
};
//小二位数据
static char m_Work_Num[6][4]={
{0x00,0x00,0x00,0x00},
{0x08,0x00,0x01,0x00},
{0x01,0x00,0x08,0x00},
{0x02,0x00,0x00,0x08},
{0x04,0x00,0x00,0x02},
{0x00,0x00,0x00,0x00}
};
class TMainForm : public TForm
{
__published: // IDE-managed Components
TButton *FButton;
TButton *MButton;
TButton *AButton;
TPanel *Panel1;
TPaintBox *PaintBox1;
TPaintBox *PaintBox2;
TPaintBox *PaintBox3;
TButton *Button1;
TTimer *Work_Timer;
TButton *F_Button;
TButton *F_M_Button;
TButton *F_A_Button;
TButton *F_M_A_Button;
TButton *M1000Button;
TButton *A1000Button;
TTimer *Check_Timer;
TButton *A5Button;
TGroupBox *GroupBox1;
TLabel *Label1;
TLabel *Label2;
TLabel *Label3;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -