📄 constdef.pas
字号:
unit ConstDef;
interface
uses
Dialogs;
const
//========================================================//
//------------------ NIms安装序列号 --------------------//
Def_NIms_Soft_SN = '{8CB82E80-0171-11D4-B9FC-0080C8D6FC46}';
//-------------- 测试用 Def_NIms_Soft_SN = ---------------//
// '{E02CDC40-A394-11D3-B005-0080C88EDD0D}'; //
//--------------------------------------------------------//
//--------------------- 安装项目 -----------------------//
Def_Compy_Name = '西清智能表业有限公司';
Def_Host_Name = 'TrSoft';
//========================================================//
//===================================//
//----------- 工作目录 ----------//
DefClntDirKey = '\NImsClient';
DefSrvDirKey = '\NImsServer';
//===================================//
//===================================//
//----------- 常数定义 ----------//
MaxItmInfoLenth=30;
MaxOpNameLength=10;
MaxOpPswLength=8;
MaxHostNameLength=15;
MaxCntRsltNum=5;
//===================================//
//--------- IC卡常数定义 --------//
CEMemOrn = $20; //IC卡电卡内存起始地址
CEMemEnd = $ff; //IC卡电卡内存终止地址
{IC卡内存长度为224}
CEMemLen = CEMemEnd - CEMemOrn; //读写IC卡电卡内存长度
OriCardPsw = '998501'; //IC卡原始密码
{IC卡内存数据格式}
TaiYuanMemKind{太原格式} = 'DYF'{丁云峰};
//===================================//
//--------- 注册表参数定义 --------//
DefXORChar=#229; //注册表内数据加密字节
{NIms Reg Location}
DefRegLocation='.Default\Software\Microsoft\WujDvlp';
{Install Reg Key}
DefNImsInstallKey='\Inst';
{Clnt Reg Key}
DefClntRegKey = '\Clnt';
{Clnt Reg Key Item}
DefCompyKeyItem = 'Coop';
DefSum1KeyItem = 'UNst';
DefSum2KeyItem = 'UNnd';
DefSum3KeyItem = 'UNrd';
DefSum4KeyItem = 'UNfuth';
DefSum5KeyItem = 'UNfvth';
{Srv Reg Key}
DefSrvRegKey = '\Srv';
{Srv Reg Key Item}
DefSrvRegKeyItem = 'SrvHost';
{Reg End}
//========================================================//
//------------------ NIms接口定义 --------------------//
DefSrvGUID = '{9542C831-AE43-11D3-B9F9-0080C8D6FC46}';
//========================================================//
//===================================//
//--------- NIms界面定义 --------//
MaxCLntSwayBmpNum = 4;//CLnt动画BMP图案个数
MaxSrvSwayBmpNum = 4;//Srv动画BMP图案个数
//===================================//
//--------- 数据库定义 --------//
DefClntAlias='NImsClntDir'; //不能超过15个字符
DefSrvAlias ='NImsSrvDir'; //不能超过15个字符
DefSysNullChar = 'N'; //无
DefSysNullClass = '无';
DefSysOpChar = 'C'; //系统操作员
DefSysOpClass = '系统操作';
DefSysMChar = 'M'; //系统管理员
DefSysMClass = '系统管理';
DefSVChar = 'S'; //超级用户
DefSVClass = '超级管理';
DefSysWChar = 'W'; //系统监控
DefSysWClass = '系统监控';
//===================================//
type
//Enum类型
//Form Enter Mode
EnterModeType = (
//--------------- 远程连接模式 ---------------//
OpLogInMode,OpLogOffMode,OpChgPswMode,RefreshMode,
//--------------- IC卡操作模式 ---------------//
NewCustMode,EdtCustMode,CustBuyMode,CustUnBuyMode,
CustCloseMode,CustPatchMode,ReadCardMode,CheckDataMode,
//--------------- 查询统计模式 ---------------//
QSAllInfoMode,QSDefCustMode
);
//Remote Connect Result
CntResultType = (CntNone,InValidNetIms,UnRegNetIms,CntFail,CntSuccess,
CntAsk,CntNotExist,CntLogged,CntPswError,CntLogFail,CntLogOK,
CntChgPswOK,CntRecNotExist,CntRecExisted,CntRecFail,CntRecOK);
//IC Card Kind
CardKindType = ( UnKnowCard{未知卡型},
EmptyCard{空白卡}, NewCustCard{开户卡},
ForBuyCard{待购卡}, PatchForBuyCard{补待购卡},
BuyCard{申购卡}, PatchBuyCard{补申购卡},
ForChkCard{待查卡}, ChkedCard{检查卡},
UnBuyCard{结算卡}, CloseCard{销户卡},
AddCard{累加卡}, ClearCard{清零卡} );
//Record类型
//Computer Addr
RecAddrType = Record
D1,D2,D3,D4: byte;
end;
//length=MaxItmInfoLenth
InfoStringType = string[MaxItmInfoLenth];
//length=5
RecCheckSumType = Record {NetIMSID校验和}
btSum1,btSum2,btSum3,btSum4,btSum5: Byte;
end;
//length=3*MaxOpNameLength+2*MaxOpPswLength+1
RecOpInfoType = Record {操作员信息}
sAccount{登录帐号}: String[MaxOpPswLength];
sOpPsw{登录密码}: String[MaxOpPswLength];
sOpName{操作员姓名}: String[MaxOpNameLength];
cOpClass{操作员级别}: Char;
{N无 C系统操作员 M系统管理员 S超级用户 W系统监控}
sOpMark{操作员备注}: String[2*MaxOpNameLength];
end;
//length=MaxHostNameLength+4
RecHostInfoType = Record {本机信息}
sHostName: String[MaxHostNameLength];
RecAddr: RecAddrType;
end; {操作员所用计算机名,IP地址}
RecNImsInfoType = Record
RecSum: RecCheckSumType; {NetImsID Check Sum}
ClntHost: RecHostInfoType;{本机信息}
SrvHost: RecHostInfoType;{主机信息}
sCompy: InfoStringType;{公司名称}
end;
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
RecCustInfoType = Record //用户信息
sCustName: string[10]; //用户姓名
sIDNo: string[18]; //身份证号18位
sICSC: string[6]; //IC卡读写密码
sMark: string[60]; //备注
end;
RecEMeterInfoType = Record
sENo: string[8]; //电表号码
dtEDate: TDateTime; //开户日期(格式2000-02-12)
iEDegree: integer; //码盘度数
iEConstKind: integer; //电表类型
iEConst: integer; //电表常数
iEBuyLmt: integer; //购电限额
iERemind: integer; //提醒电量
iEWarn: integer; //报警电量
iESum: integer; //购电总量
iTotalNum: integer; //总申购次数
iEConsume: integer; //已用电量
iERemain: integer; //剩余电量
end;
RecBuyInfoType = Record
iBuyNum: integer; //第几次申购
dtBuyDate: TDateTime; //申购日期(格式2000-02-12)
iECurBuy: integer; //本次购电量
iEPriceKind: integer; //电价类型
fEPrice: Double; //电价
iWCurBuy: integer; //本次购水量
iGCurBuy: integer; //本次购气量
end;
//----------------------------------------//
// 用户数据信息RecRWCustDataType //
//----------------------------------------//
RecRWCustDataType = Record //IC卡读写数据结构
iCustNo: integer; //用户号
Cust: RecCustInfoType; //用户数据
EM: RecEMeterInfoType; //电表数据
Buy: RecBuyInfoType; //申购数据
sEMemDT: string[4]; //IC卡电卡内存数据格式
sGMemDT: string[4]; //IC卡气卡内存数据格式
sWMemDT: string[4]; //IC卡水卡内存数据格式
end;
RecWriteCardKindType = Record
ECK: CardKindType; //要写的电卡类型
GCK: CardKindType; //要写的气卡类型
WCK: CardKindType; //要写的水卡类型
end;
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
RecEMeterKindType = Record //表型数据库结构
sAilas: string[15];
iEKind: integer;
iEConst: integer;
sEMemDT: string[4]; //IC卡电表内存数据格式
sEMark: string[30];
end;
RecEPriceKindType = Record //价格数据库结构
sAilas: string[15];
iEPriceKind: integer;
sEPriceName: string[10];
fEPrice: Double;
sEPriceMark: string[20];
end;
///////////////////////////////////////////////////////
Function wFunShowError(sErrorMsg:String; AButtons: TMsgDlgButtons):Word;
Function wFunShowOK(sOKMsg:String; AButtons: TMsgDlgButtons):Word;
Function wFunShowASK(sASKMsg:String; AButtons: TMsgDlgButtons):Word;
implementation
Function wFunShowError(sErrorMsg:String; AButtons: TMsgDlgButtons):Word;
begin
Result:=MessageDlg(sErrorMsg,mtError,AButtons,0);
end;
Function wFunShowOK(sOKMsg:String; AButtons: TMsgDlgButtons):Word;
begin
Result:=MessageDlg(sOKMsg,mtInformation,AButtons,0);
end;
Function wFunShowASK(sASKMsg:String; AButtons: TMsgDlgButtons):Word;
begin
Result:=MessageDlg(sASKMsg,mtConfirmation,AButtons,0);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -