📄 valveruning.ctl
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.UserControl MyValve
ClientHeight = 1260
ClientLeft = 0
ClientTop = 0
ClientWidth = 1650
LockControls = -1 'True
PropertyPages = "ValveRuning.ctx":0000
ScaleHeight = 1260
ScaleWidth = 1650
ToolboxBitmap = "ValveRuning.ctx":0031
Begin VB.Timer CycTime
Enabled = 0 'False
Interval = 60000
Left = 1530
Top = 1020
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 100
Left = 3000
Top = 1860
End
Begin VB.PictureBox Picture1
AutoSize = -1 'True
BorderStyle = 0 'None
FillStyle = 0 'Solid
Height = 1455
Left = 150
MouseIcon = "ValveRuning.ctx":0343
MousePointer = 99 'Custom
ScaleHeight = 1455
ScaleWidth = 1455
TabIndex = 0
Top = 120
Width = 1455
Begin VB.Label Label1
BackColor = &H000000FF&
Caption = "A"
BeginProperty Font
Name = "宋体"
Size = 7.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 165
Left = 180
TabIndex = 1
Top = 180
Width = 105
End
End
Begin MSComctlLib.ImageList ImageList1
Left = 1860
Top = 2580
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "ValveRuning.ctx":0495
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "ValveRuning.ctx":07B1
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "ValveRuning.ctx":0ACD
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "ValveRuning.ctx":0DE9
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "ValveRuning.ctx":1105
Key = ""
EndProperty
EndProperty
End
Begin VB.Menu MnuValve
Caption = "阀控制"
Begin VB.Menu MnuTitl
Caption = "阀名"
End
Begin VB.Menu MnuSeparate
Caption = "-"
End
Begin VB.Menu MnuOpen
Caption = "开阀&O"
End
Begin VB.Menu MnuClose
Caption = "关阀&C"
End
Begin VB.Menu MnuSeparate2
Caption = "-"
End
Begin VB.Menu MnuData
Caption = "灌溉信息查询"
End
Begin VB.Menu MnuSeparate3
Caption = "-"
End
Begin VB.Menu mnuFluxSpeed
Caption = "流速:0.0(T/H)"
End
Begin VB.Menu mnuCurAmout
Caption = "灌量:0.0 (T)"
End
End
End
Attribute VB_Name = "MyValve"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "PropPageWizardRun" ,"Yes"
Option Explicit
'声明属性
Private xx As Integer '画面计数器
Private mRuning As Boolean
Private mTitlName As String
Private mIndexID As Integer
Private mSetOpenTime
Private mSetCloseTime
Private mOpenTime
Private mCloseTime
Private mSetAmount As Double '设置流量
Private mCurAmount As Double '当前流量
Private mAddAmount As Double '合计流量
Private mFluxSpeed As Single '当前流速
Private mComputAuto As Boolean
Private mInCyc As Boolean '是否在自动循环里
Private mFFOHandOpen As Boolean '田间操作器的手动状态
Private mIsChange As Boolean '阀 状 态 已 改 变
Private mIsInTab As Boolean '是否在自动链表里
Private mValveState As Integer '阀的不同状态
Private mRelationValveID As Integer '同层关系的阀号
Private mPopuMnuAble As Boolean '是否显示弹出菜单
Private mIsMaster As Boolean '是否为上游元件
Private mMasterID As Integer '上游元件
Private mCycNextID As Integer '循环中的下一个阀号。
Private mCycKeepTime As Integer '循环持续时间
Private DecTimekeep As Integer '循环保持时间计数器
'声明事件
Event MyValveError(MyErrorString As String)
Event MenuInfor(munIndex As Integer)
Event Click()
Event DbClick()
Event KeyDown(KeyCode As Integer, Shift As Integer)
Event KeyPress(KeyAscii As Integer)
Event KeyUp(KeyCode As Integer, Shift As Integer)
Event MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
Event MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
Event MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Event DoOpen()
Event DoClose()
Event IsOpen(IsInAutoCyc As Boolean, IsFFOHandOpen As Boolean)
Event IsClose(IsInAutoCyc As Boolean)
Event SetTimeOverDoOpen()
Event SetTimeOverDoClose()
Event CycTimeOverDoOpen()
Event CycTimeOverDoClose()
Event MasterDoOpen(TheMasterID)
Private Sub CycTime_Timer()
DecTimekeep = DecTimekeep - 1
If DecTimekeep <= 0 Then
RaiseEvent CycTimeOverDoClose
CycTime.Enabled = False
End If
End Sub
Private Sub Label1_DblClick()
RaiseEvent DbClick
End Sub
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1.BorderStyle = 1
Select Case Button
Case 1
RaiseEvent MouseDown(Button, Shift, X, y)
Case 2
If PopuMnuAble Then
MnuTitl.Caption = TitlName
PopupMenu MnuValve
Else
RaiseEvent MouseDown(Button, Shift, X, y)
End If
End Select
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
RaiseEvent MouseMove(Button, Shift, X, y)
End Sub
Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1.BorderStyle = 0
RaiseEvent MouseUp(Button, Shift, X, y)
End Sub
Private Sub Picture1_DblClick()
RaiseEvent DbClick
End Sub
Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyDown(KeyCode, Shift)
End Sub
Private Sub Picture1_KeyPress(KeyAscii As Integer)
RaiseEvent KeyPress(KeyAscii)
End Sub
Private Sub Picture1_KeyUp(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyUp(KeyCode, Shift)
End Sub
Private Sub MnuOpen_Click()
RaiseEvent DoOpen
End Sub
Private Sub MnuClose_Click()
RaiseEvent DoClose
End Sub
Private Sub MnuData_Click()
RaiseEvent MenuInfor(0)
End Sub
Private Sub Picture1_LostFocus()
Picture1.BorderStyle = 0
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1.BorderStyle = 1
If Runing Then
MnuOpen.Enabled = False
MnuClose.Enabled = True
Else
MnuOpen.Enabled = True
MnuClose.Enabled = False
End If
Select Case Button
Case 1
RaiseEvent MouseDown(Button, Shift, X, y)
Case 2
If PopuMnuAble Then
MnuTitl.Caption = " 【" & TitlName & "】 "
PopupMenu MnuValve
Else
RaiseEvent MouseDown(Button, Shift, X, y)
End If
End Select
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
Picture1.BorderStyle = 0
RaiseEvent MouseUp(Button, Shift, X, y)
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
RaiseEvent MouseMove(Button, Shift, X, y)
End Sub
Private Sub UserControl_AmbientChanged(PropertyName As String)
PropertyName = "BackColor"
Picture1.BackColor = Ambient.BackColor
UserControl.BackColor = Ambient.BackColor
End Sub
'IndexID Property
Public Property Get IndexID() As Integer
Attribute IndexID.VB_ProcData.VB_Invoke_Property = "通用"
IndexID = mIndexID
End Property
Public Property Let IndexID(ByVal vNewValue As Integer)
mIndexID = vNewValue
PropertyChanged "IndexID"
End Property
'SetOpenTime Property
Public Property Get SetOpenTime()
SetOpenTime = mSetOpenTime
End Property
Public Property Let SetOpenTime(ByVal vNewValue)
mSetOpenTime = vNewValue
PropertyChanged "SetOpenTime"
End Property
'mCycKeepTime Property
Public Property Get CycKeepTime()
CycKeepTime = mCycKeepTime
End Property
Public Property Let CycKeepTime(ByVal vNewValue)
mCycKeepTime = vNewValue
DecTimekeep = mCycKeepTime '循环保持时间
PropertyChanged "CycKeepTime"
End Property
'MasterID Property
Public Property Get MasterID() As Integer
Attribute MasterID.VB_ProcData.VB_Invoke_Property = "通用"
MasterID = mMasterID
End Property
Public Property Let MasterID(ByVal vNewValue As Integer)
mMasterID = vNewValue
PropertyChanged "MasterID"
End Property
'IsMaster Property
Public Property Get IsMaster() As Boolean
Attribute IsMaster.VB_ProcData.VB_Invoke_Property = "通用"
IsMaster = mIsMaster
End Property
Public Property Let IsMaster(ByVal vNewValue As Boolean)
mIsMaster = vNewValue
PropertyChanged "IsMaster"
End Property
'RelationValveID Property
Public Property Get RelationValveID() As Integer
Attribute RelationValveID.VB_ProcData.VB_Invoke_Property = "通用"
RelationValveID = mRelationValveID
End Property
Public Property Let RelationValveID(ByVal vNewValue As Integer)
mRelationValveID = vNewValue
PropertyChanged "RelationValveID"
End Property
'PopuMnuAble Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -