📄 pubvar.bas
字号:
Attribute VB_Name = "pubVar"
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/07/09
'描 述:CBB三表户外计量系统 Ver 5.2
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
'---------------------------------------------------------------------------------------------------
'接口卡系统变量
Global BaseAddr As Integer
Global PortA_1 As Integer
Global PortB_1 As Integer
Global PortC_1 As Integer
Global Ctrl_1 As Integer
Global PortA_2 As Integer
Global PortB_2 As Integer
'PortC_2没用
Global PortC_2 As Integer
Global Ctrl_2 As Integer
Global bRead1 As Integer
Global bRead2 As Integer
Global bDev As Integer
Global bUser As Integer
Global bEnd As Integer
Global bBuild As Integer
Global bFeedBack As Integer
Global bAlert As Integer
Global Addr(2) As Integer
Global Const DEVOP_OPEN = 14
Global Const DEVOP_SHUT = 13
'---------------------------------------------------------------------------------------------------
'系统动态链接库声明
Declare Function OutBit Lib "cbbdll" (ByVal Port As Integer, ByVal OutVal As Integer) As Integer
Declare Function chkPort Lib "cbbdll" (ByVal Port As Integer) As Integer
'Declare Sub Init8255 Lib "cbbdll" (ByVal BaseAddr As Integer)
'Declare Sub SendCode Lib "cbbdll" (ByVal BaseAddr As Integer, ByVal UserAddr As Integer)
'函数ChkBit说明:WORD FAR PASCAL _export chkBit(WORD Port,WORD WhichBit,WORD ChkWhat)
Declare Function chkBit Lib "cbbdll" (ByVal Port As Integer, ByVal WhichBit As Integer, ByVal chkWhat As Integer, ByVal Delay As Long) As Integer
'Declare Sub MessageBeep Lib "User" (ByVal N As Integer)
'Declare Sub openDoor Lib "cbbdll24" (ByVal N As Integer)
'Declare Sub shutDoor Lib "cbbdll24" (ByVal N As Integer)
'Declare Function soundAlert Lib "cbbdll24" (ByVal N As Integer) As Integer
'Declare Function muteAlert Lib "cbbdll24" (ByVal N As Integer) As Integer
'Declare Function CheckGate Lib "cbbdll24" (ByVal N As Integer) As Integer
'Declare Function CheckBuild Lib "cbbdll24" (ByVal N As Integer) As Integer
'Declare Function CheckBBus Lib "cbbdll24" (ByVal N As Integer) As Integer
'Declare Function CollectOne Lib "cbbdll24" (ByVal N As Integer) As Integer
'Declare Function NCollectOne Lib "cbbdll24" (ByVal N As Integer) As Integer
'Declare Function Alert Lib "cbbdll24" () As Integer
'Declare Function AlertNew Lib "cbbdll24" () As Integer
'---------------------------------------------------------------------------------------------------
Global dbCbb As Database '系统数据库
Global curBit As Integer '当前用户板数据位类型(4bit or 5bit)
Global selIDs() As String '用于frmUserDev0中,来向frmUserDev1传递选中的用户号
Global TemplateType As Integer '确定模板表单以何种方式运行,"保存"或"设置"
Global LGate As Integer '网关地址下限
Global UGate As Integer '网关地址上限
Global LBuild As Integer '安全器地址下限
Global UBuild As Integer '安全器地址上限
Global LUser As Integer '用户地址下限
Global UUser As Integer '用户地址上限
Global pubTimer1 As Timer '公共计时器1
Global pubTimerCount1 As Long '公共计时器计数1
Global pubTimerDelay As Timer '公共延时计时器
Global pubTimerCountDelay As Long '公共延时计时器计数
Global DelayCancel As Boolean '终止延时标志
Global pubLblStatus As Label '公共状态显示标签
'数据查询frmQuery and frmShowAll
Global QBuild As String
Global QUnit As String
Global QFloor As String
Global QDoor As String
Global QUserID As Integer
Global QUserName As String
Global CondStr As String '条件字符串
Global rcQUser As Recordset '查询用户列表
Global QData As String '保存用户数据所在表名("UserData" or "temUserData") __用来使frmShowAll能被frmQuery和指定用户采集结束后自动显示采集结果frmGetSome公用
Global QAll As Boolean '是否查询所有用户数据 TRUE---是
Global QDate1 As Date '日期一
Global QDate2 As Date '日期二
Global QBuildW As String
Global QUnitW As String
Global QFloorW As String
Global QDoorW As String
Global QUserIDW As Integer
Global QUserNameW As String
Global CondStrW As String '条件字符串
Global QAllw As Boolean '是否查询所有用户数据 TRUE---是
Global curPassword As String
Global FOveride As Integer '询问是否覆盖数据表单返回值 0--Yes,1--YesToAll,2--No,3--cancel ; used in frmOveride
Global PORTC1_VAL As Integer 'PortC_1的当前值
Global QuitAlert As Boolean '是否退出报警监视标志
Global Alerting As Boolean '当前是否在接受报警信息
Global curEchoAlert As Integer '当前显示报警信息窗口的警型(panel---frmCurAlert)
Global curAlert(4) As Integer '当前报警(用户号)
Global curAlertDate(4) As Date '当前报警(日期,时间)
Global curAlertTime(4) As Date '当前报警(时间)
' curAlert(1)---盗水气
' curAlert(2)---煤气
' curAlert(3)---防盗
' curAlert(4)---救护
Global curOP As String '当前操作员(由frmAskWho确定)
Global curSetOP As String '当前选中操作员(用于操作员设置frmOP---frmOPSet)
Global OPThen As Integer '询问口令后的操作(用于决定在询问口令"frnAskWho"后,设置什么,1---frmOP.show, 2---frmSuper.show,3---frmMain.show)
Global RED As Long
Global GREEN As Long
Global BLUE As Long
Global DARKGRAY As Long
Global SYS_COLOR As Long
Global showType As Integer '标志是从何处调用frmShowAll 1---frmQuery,2---frmGetSome
Public Const ALERT_LIFE As Integer = 8
Public Const ALERT_ROB As Integer = 2
Public Const ALERT_GAS As Integer = 1
Public Const ALERT_WATER As Integer = 0
Global curAlertForm(4) As frmCurAlert
Global DData() As Long '保存由各位数据换算得的该表数据
Global CancelCollect As Boolean '取消采集标志
Global CancelBrowse As Boolean '取消浏览标志
Global f_frmUserMap_Visible As Boolean '标志当前frmUserMap表单是否正打开
Global f_frmGetSome_Visible As Boolean '标志当前frmGetSome表单是否正打开,因为这两个表单不能同时打开,否则会报错
Global AutoTime As Date '自动采集时间
Global AutoDate As Integer '自动采集日期
Global Auto_Manual As Boolean '标志当前用自动还是手工采集 TRUE---自动,FALSE---手工
Global Const icoBLUE = 1
Global Const icoRED = 2
Global Const icoYELLOW = 3
Global fStillCollecting As Boolean
Global StatusStr As String
Global BrowInfo As Boolean '标志frmMainInfo是否打开,TRUE---打开,FALSE---关闭
'Type DevInfo
' ID As Integer
' Name As String * 20
' Price As Currency
' Quan As Single
' MinFee As Currency
' Shut As Integer
' ShutFee As Currency
'End Type
'Global g_curDevInfo() As DevInfo
Type fldUserData
UserID As Integer
devID As Integer
Value As Long
Date As Date
Status As Integer
End Type
Global curForm() As Form
Global g_SelDate As Date
Global g_IsSaveData As Boolean
Global gCurMinFee As Currency
Global gCurShutFee As Currency
Global gCurAutoOpenLamp As Integer
Global gCurAutoShut As Integer
Global gCollectType As Integer
Global fCollected As Boolean
Global rcDevsMapRpt As Recordset
Global DevName As String
Global DevIDQ As Integer
Global temStrDate As Date
Global gblnCollected As Boolean '如采集数据后打开浏览窗口,gblnCollected为True
Declare Function findwindow& Lib "user32" Alias "FindWindowA" (ByVal lpclassname As String, ByVal lpwindowName As String)
Declare Function ShowWindow& Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long)
'2001.7.10
Global gblnCollecting As Boolean '
'---------------------------------------------------------------------------------------------
'video card property
Global gVideoBrightness As Long '亮度
Global gVideoContrast As Long '对比度
Global gVideoHue As Long '色度
Global gVideoSaturation As Long '饱和度
Global gVideoJPGFile As String 'JPG图片文件存放目录
Global gVideoStandard As Integer '制式
Global gVideoSource As Integer '端口/通道
Global gVideoShowDate As Boolean '是否显示日期
Global gVideoShowTime As Boolean '是否显示时间
Global gVideoXDate As Integer '日期显示x坐标
Global gVideoYDate As Integer '日期显示y坐标
Global gVideoXTime As Integer '时间显示x坐标
Global gVideoYTime As Integer '时间显示y坐标
Global gVideoImageHeight As Integer '输出图片高度 240
Global gVideoImageWidth As Integer '输出图片宽度 320
Global gVideoColor As Integer '输出图片颜色
Global gVideoCapDelay As Integer '图片采集时延(单位:毫秒)
Global gVideoCapWait As Integer '等待视频信号最大时间(单位:10毫秒),缺省设置200,即2秒
Global gCapRetryTimes As Integer '采集失败重试次数,缺省设置为2次
Global gVideoFrameRate As Integer '采集帧数
'video recogonizing
Declare Function Starting Lib "Recognize" () As Long
'Declare Function Translate Lib "plugin" (ByVal strFileName As String) As Long
Declare Function Recognize Lib "Recognize" (ByVal strFileName As String, ByVal strAddr As String) As Long
Declare Sub Feedback Lib "Recognize" (ByVal nRealNum As Long)
Declare Function Stopped Lib "Recognize" () As Long
Declare Sub LoadDefault Lib "Recognize" ()
Global gCurJPGdir As String '当前察看的图片文件目录
Global gCurJPGFile As String '当前察看的图片文件名
Global gJPGShow As Boolean '当前察看图片窗口是否打开
Global gShowJPGFrom As Integer '当前图片察看窗口由哪个窗口调用,1--frmQuery.QData1;2--frmQuery.QData2
Global gCurDevAddr As String
'========================================================================
'API 调用,将窗口设置为Always On Top
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOACTIVATE = &H10
Public Const FLAG = SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const HWND_TOP = 0
Public Const HWND_BOTTOM = 1
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -