📄 ucommon.pas
字号:
{**********************************************************************}
{ Currency Common Function Procedure Unit }
{ 通用公共函数过程单元 }
{ Ver:2.4070813B Author:Heaven.Ben. }
{ Last Version: 2.7080214B }
{ Create Date:2006-10-30 Ex. Date: 2008-02-14 }
{----------------------------------------------------------------------}
{ Statard Unit & Package: }
{ OleCtrls,Winsock,AgentObjects_TLB,ShellAPI,CommCtrol,ComObj }
{ Printers,IniFiles,Registry,Controls,IdSMTP,IdMessage,Jpeg, }
{ MMSystem,Menus,StrUtils,ComCtrls,ExtCtrls,TLHelp32
{----------------------------------------------------------------------}
{ Extend Unit & Package: }
{ DBGridEh,AgentObject_TLB,MSCommLib_TLB,FastReport,1StClass }
{ VCLZip,Winsock,cnPackage,1StClass,IdMessage,OleCtrls,CnPackage, }
{ VclUnZip,DBGridEhImpExp,RichViewPackage,DevExpress
{----------------------------------------------------------------------}
{ Custom Record & Class: }
{ Record: 1. TCommVar ------ Mscomm Info Used. }
{ 2. TMsCom ------ Mscomm Ctrl Used. }
{ 3. TCon ------ Connection Info Used. }
{ 4. TNetCfg ------ NetWork Seting Used. }
{ 5. TGDynamicMenu - UserRight Menu Used. }
{ 6. TGQuickTool --- UserQuickTool Used. }
{ 7. TGQuickButton-- UserQuickButton Used. }
{ 8. TcxPackage --- cxGridToExcel Used.
{----------------------------------------------------------------------}
{ Update Detail List: }
{ Update Version | Last ModifyDate | Modify Person | Remark}
{ Ver:2.4070803B | 2007-08-03 08:39 | Heaven.Ben. | N/A }
{ Ver:2.4070808B | 2007-08-08 17:22 | Heaven.Ben. | N/A }
{ Ver:2.4070813B | 2007-08-08 11:10 | Heaven.Ben. | N/A }
{ Ver:2.4090613B | 2007-09-06 11:10 | Heaven.Ben. | N/A }
{ Ver:2.5071105B | 2007-11-05 11:48 | Heaven.Ben. | N/A }
{ Ver:2.5071115B | 2007-11-15 11:03 | Heaven.Ben. | N/A }
{ Ver:2.6080129B | 2008-01-29 11:03 | Heaven.Ben. | N/A }
{ Ver:2.7080214B | 2008-02-14 11:11 | Heaven.Ben. | N/A }
{ Ver:2.7080721B | 2008-07-21 11:11 | Heaven.Ben. | N/A }
{ Ver:2.8080904B | 2008-09-04 13:01 | Heaven.Ben. | N/A }
{----------------------------------------------------------------------}
{ MSN: qdseashore@hotmail.com E-Mail:qdseashore@163.com }
{ QQ: 317599797 M-Phone:13969832386 }
{ Tel: 0532-83815400 PostCode:266021 }
{ LastCompany: QingDao Tianida SoftWare Co.Ltd. }
{ CopyRight (C) 2006-2007 HeavenBen Personal Studio }
{**********************************************************************}
unit uCommon;
interface
{**********************************************************************}
{ Adduction Unit Files Area }
{ 引用单元文件区域 }
{**********************************************************************}
uses
Classes, Windows, SysUtils, Dialogs, Variants, Winsock, ShellAPI, Messages,
Buttons, StdCtrls, IniFiles, Grids, ADODB, DB, Excel2000, OleCtrls, Graphics,
Printers, CommCtrl, Forms, Registry, Controls, IdSMTP, IdMessage, Jpeg,
DBGridEh, DBGrids, fcTreeView, fcTreeCombo, MMSystem, ComObj, Menus, CnClasses,
StrUtils, CnMD5, ComCtrls, ExtCtrls, VCLZip, VCLUnZip, DBGridEhImpExp,
MSCommLib_TLB, RVScroll, RichView, RVEdit, RVStyle, CnAAFont, CnAACtrls, CnButtons,
AgentObjects_TLB, TLHelp32, cxGrid, cxGridExportLink,FileCtrl;
{**********************************************************************}
{ User Custom Const Area }
{ 用户自定义常量区域 }
{**********************************************************************}
const
//默认的对话框自动关闭时间;
DEF_AUTOCLOSEDLG = 10000;
//默认本地数据库名称
DEF_VISUAL_DBPATH = 'Data\Store.mdb';
//默认配置文件
DEF_INIFILENAME = 'Kernel.dat';
//默认的日志文件夹
DEF_LOGFOLDERNAME='Logs';
//默认消息框标题
DEF_APPLDLGTITLE = '系统信息';
//默认的用户帐号表
DEF_USERTABLE = 'Sys_User';
//默认的用户账号表用户名字段
DEF_USERNAMEFIELD = 'UserID';
//默认的用户帐号密码字段
DEF_USERPWDFIELD = 'UserPassWord';
//默认的用户权限组表
DEF_LVGROUPTABLE = 'Sys_GroupLv';
//默认的用户权限组字段
DEF_LVGROUPFIELD = 'GroupName';
//默认的自动更新表
DEF_UPDATETABLE = 'Sys_AppUpdate';
//默认的自动更新表字段
DEF_UPDATEIDFIELD = 'FileName';
//默认的自动更新更新内容数据字段
DEF_UPDATEDATAFIELD = 'FileData';
//默认系统模块更新表
DEF_MODULEUPDATE = 'Sys_ModuleUpdate';
//默认的注册表根
DEF_REGROOT = HKEY_LOCAL_MACHINE;
//左分割符
DEF_BSEPCHAR = '『';
//连接分割符
DEF_LINKCHAR = '-';
//右分隔符
DEF_ESEPCHAR = '』';
//LED屏默认型号 1:BX-A16FE
DEF_LEDTYPE = 1;
//LED屏默认宽度 宽度 中文字个数*16
DEF_LEDWIDTH = 160;
//LED屏默认高度 高度 中文字个数*16
DEF_LEDHEIGHT = 32;
//LED屏默认时间 0.5秒 * N (每屏停留时间)
DEF_LEDTIME = 255;
//LED屏默认速度 0秒 (驶入速度)
DEF_LEDSPEED = 0;
//LED屏默认特效 快速打出
DEF_LEDSTUNT = 1;
//LED屏默认频率
DEF_LEDBAUDRATE = 57600;
{**********************************************************************}
{ Custom "Record,Class,Enum" Area }
{ 用户自定义记录结构体,类,枚举区域 }
{**********************************************************************}
//通用数据传递记录结构体
type
TCommVar = record
s1: string; s2: string; s3: string; s4: string; s5: string; s6: string; s7: string; s8: string; s9: string; s10: string;
s11: string; s12: string; s13: string; s14: string; s15: string; s16: string; s17: string; s18: string; s19: string; s20: string;
s21: string; s22: string; s23: string; s24: string; s25: string; s26: string; s27: string; s28: string; s29: string; s30: string;
s31: string; s32: string; s33: string; s34: string; s35: string; s36: string; s37: string; s38: string; s39: string; s40: string;
s41: string; s42: string; s43: string; s44: string; s45: string; s46: string; s47: string; s48: string; s49: string; s50: string;
s51: string; s52: string; s53: string; s54: string; s55: string; s56: string; s57: string; s58: string; s59: string; s60: string;
s61: string; s62: string; s63: string; s64: string; s65: string; s66: string; s67: string; s68: string; s69: string; s70: string;
s71: string; s72: string; s73: string; s74: string; s75: string; s76: string; s77: string; s78: string; s79: string; s80: string;
s81: string; s82: string; s83: string; s84: string; s85: string; s86: string; s87: string; s88: string; s89: string; s90: string;
s91: string; s92: string; s93: string; s94: string; s95: string; s96: string; s97: string; s98: string; s99: string; s100: string;
s101: string; s102: string; s103: string; s104: string; s105: string; s106: string; s107: string; s108: string; s109: string; s110: string;
s111: string; s112: string; s113: string; s114: string; s115: string; s116: string; s117: string; s118: string; s119: string; s120: string;
s121: string; s122: string; s123: string; s124: string; s125: string; s126: string; s127: string; s128: string; s129: string; s130: string;
end;
//通用串口组建信息记录结构体
type
TMsCom = record
//端口
iCommport: Smallint;
//设置
sSettings: string;
//比特率
sBaudRate: string;
//奇偶校验位
sParity: string;
//数据位
sByteSize: string;
//停止位
sStopBits: string;
//周期
iCycle: Integer;
//当前计数器
iCount: Integer;
end;
type
TLedScreen = record
//屏幕编号
iLedID: SmallInt;
//屏幕型号 1:BX-A16FE 2:BX-A16F 3:BX-A16 4:BX-A16L
iLedType: SmallInt;
//屏幕类型 单色为1,双色为2
iLedColor: SmallInt;
//屏幕串口 1-16;
iLedPort: SmallInt;
//屏幕比特率
iLedBaudRate: Integer;
//屏幕宽度
iLedWidth: Integer;
//屏幕高度
iLedHeight: Integer;
//屏幕分频倍数
iLedFrequency: Smallint;
//屏幕行顺序
iLedDataOff: SmallInt;
//屏幕存储空间
iLedRam: Integer;
//屏幕周期
iLedCyCle: Integer;
//当前计数器
iLedCount: Integer;
//合计计数器
iLedSumCount: Integer;
//速度
iLedSpeed: Integer;
//停留时间
iLedTime: Integer;
//特效
iLedStunt: SmallInt;
//点阵类型
iLed_MKType: SmallInt;
//屏DA极性
iLed_DataDA: SmallInt;
//屏OE极性
iLed_DataOE: SmallInt;
//配置信息保存的文件名
sLed_FileName: string;
//发送数据类型
iLed_SendDataType: Integer;
//串口名称
sLed_ComPort: string;
//图文横坐标
iLed_TW_x: Integer;
//图文纵坐标
iLed_TW_y: Integer;
//图文高度
iLed_TW_Height: Integer;
//图文宽度
iLed_TW_Width: Integer;
//文件类型 0: bmp 1:rtf
iLed_FileType: SmallInt;
//是否删除原文件
bLed_Deleted: Boolean;
//字体
sLed_FontName: string;
//字体大小
iLed_FontSize: SmallInt;
//活动字体
sLed_ActiveFontName: string;
//活动字体大小
iLed_ActiveFontSize: SmallInt;
end;
//通用连接数据库配置信息记录结构体
type
TCon = record
sServerName: string;
sDatabaseName: string;
sUserName: string;
sPassWord: string;
sFilePath: string;
sDBType: string;
sConnectionString: string;
end;
//通用网络设置信息
type
TNetCfg = record
sIP: string; //IP地址
sMask: string; //掩码
sGateway: string; //默认网关
end;
//动态菜单类
type
//菜单类继承自object
TGDynamicMenu = class
private
//指定的窗体类实例
FForm: TForm;
//指定的菜单类实例
FMainMenu: TMainMenu;
//指定系统权限表连接数据库字符串
FConStr: string;
//登陆用户名
FUserName: string;
//登录用户密码
FPassWord: string;
//清除原有项
FFirstClear: Boolean;
public
//动态创建菜单
procedure CreateMenu;
//动态菜单项的单击事件
procedure MenuItemOnClick(Sender: TObject);
//清楚菜单子项
procedure Clear;
//指定窗体实例属性
property aForm: TForm read FForm write FForm default nil;
//指定菜单实例属性
property MainMenu: TMainMenu read FMainMenu write FMainMenu default nil;
//指定连接字符串属性
property ConnectionString: string read FConStr write FConStr;
//指定用户帐号属性
property UserName: string read FUserName write FUserName;
//指定用户密码属性
property PassWord: string read FPassWord write FPassWord;
//是否清除原指定对象原有的内容
property FirstClear: Boolean read FFirstClear write FFirstClear default True;
end;
//动态快捷工具栏类
type
TGQuickTool = class
private
//工具栏组件对象
FToolBar: TToolBar;
//使用的窗体
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -