📄 frmgateprocess.frm
字号:
VERSION 5.00
Begin VB.Form frmGateProcess
BorderStyle = 1 'Fixed Single
Caption = "网关操作"
ClientHeight = 2115
ClientLeft = 45
ClientTop = 330
ClientWidth = 3780
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2115
ScaleWidth = 3780
Begin VB.Frame Frame1
Height = 855
Left = 360
TabIndex = 4
Top = 480
Width = 3015
Begin VB.CheckBox chkFrontGate
Caption = "前向网关"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 6
Top = 240
Width = 1455
End
Begin VB.CheckBox chkBackGate
Caption = "后向网关"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 5
Top = 480
Width = 1455
End
Begin VB.Label lblFrontGate
Height = 255
Left = 1560
TabIndex = 8
Top = 240
Width = 1215
End
Begin VB.Label lblBackGate
Height = 255
Left = 1560
TabIndex = 7
Top = 480
Width = 1215
End
End
Begin VB.CommandButton cmdOpen
Caption = "打开"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 3
Top = 1560
Width = 1095
End
Begin VB.CommandButton cmdClose
Caption = "关闭"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 2
Top = 1560
Width = 1095
End
Begin VB.CommandButton cmdCancle
Caption = "取消"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 1
Top = 1560
Width = 1095
End
Begin VB.ComboBox cmbFrame
Height = 300
Left = 945
Style = 2 'Dropdown List
TabIndex = 0
Top = 120
Width = 2415
End
Begin VB.Label lblGate
BackColor = &H80000004&
BackStyle = 0 'Transparent
Caption = "网段:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 9
Top = 120
Width = 615
End
End
Attribute VB_Name = "frmGateProcess"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期: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
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Dim rcGate As Recordset
Private Sub cmbFrame_Click()
Dim curFrame As Integer
If IsNumeric(cmbFrame.List(cmbFrame.ListIndex)) Then
curFrame = Val(cmbFrame.List(cmbFrame.ListIndex))
rcGate.FindFirst "FrameID=" + Format(curFrame)
If Not rcGate.NoMatch Then
cmdOpen.Enabled = True
cmdClose.Enabled = True
If rcGate!StartGate <> 0 Then
lblFrontGate = rcGate!StartGate
chkFrontGate.Enabled = True
Else
lblFrontGate = ""
chkFrontGate.Enabled = False
End If
If rcGate!endGate <> 0 Then
lblBackGate = rcGate!endGate
chkBackGate.Enabled = True
Else
lblBackGate = ""
chkBackGate.Enabled = False
End If
Else
cmdOpen.Enabled = False
cmdClose.Enabled = fasle
lblFrontGate = ""
chkFrontGate.Enabled = False
lblBackGate = ""
chkBackGate.Enabled = False
End If
End If
End Sub
Private Sub cmdCancle_Click()
Unload frmGateProcess
End Sub
Private Sub cmdCancle_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
cmdCancle_Click
End If
End Sub
Private Sub cmdClose_Click()
If IsNumeric(Trim(lblFrontGate.Caption)) And chkFrontGate.Enabled Then
If Val(Trim(lblFrontGate.Caption)) <> 0 Then
'status
AppendStatusInfo "关闭前向网关" & Val(Trim(lblFrontGate.Caption)), icoBLUE
SaveLog "关闭前向网关" & Val(Trim(lblFrontGate.Caption)), 0
CloseGate (Val(Trim(lblFrontGate.Caption)))
End If
End If
If IsNumeric(Trim(lblBackGate.Caption)) And chkBackGate.Enabled Then
If Val(Trim(lblBackGate.Caption)) <> 0 Then
'status
AppendStatusInfo "关闭后向网关" & Val(Trim(lblFrontGate.Caption)), icoBLUE
SaveLog "关闭后向网关" & Val(Trim(lblFrontGate.Caption)), 0
CloseGate (Val(Trim(lblBackGate.Caption)))
End If
End If
End Sub
Private Sub cmdClose_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
cmdCancle_Click
End If
End Sub
Private Sub cmdOpen_Click()
Dim temval1 As Boolean
Dim temval2 As Boolean
Dim MsgStr As String
If IsNumeric(Trim(lblFrontGate.Caption)) And chkFrontGate.Enabled Then
If Val(Trim(lblFrontGate.Caption)) <> 0 Then
'status
AppendStatusInfo "打开前向网关" & Val(Trim(lblFrontGate.Caption)), icoBLUE
SaveLog "打开前向网关" & Val(Trim(lblFrontGate.Caption)), 0
temval1 = openGate(Val(Trim(lblFrontGate.Caption)))
'status
AppendStatusInfo "打开前向网关" & Val(Trim(lblFrontGate.Caption)) & _
IIf(temval1, "成功", "失败"), IIf(temval1, icoBLUE, icoRED)
SaveLog "打开前向网关" & Val(Trim(lblFrontGate.Caption)) & _
IIf(temval1, "成功", "失败"), IIf(temval1, 0, 1)
End If
End If
If IsNumeric(Trim(lblBackGate.Caption)) And chkBackGate.Enabled Then
If Val(Trim(lblBackGate.Caption)) <> 0 Then
'status
AppendStatusInfo "打开后向网关" & Val(Trim(lblFrontGate.Caption)), icoBLUE
SaveLog "打开后向网关" & Val(Trim(lblFrontGate.Caption)), 0
temval2 = openGate(Val(Trim(lblBackGate.Caption)))
'status
AppendStatusInfo "打开后向网关" & Val(Trim(lblFrontGate.Caption)) & _
IIf(temval1, "成功", "失败"), IIf(temval1, icoBLUE, icoRED)
SaveLog "打开后向网关" & Val(Trim(lblFrontGate.Caption)) & _
IIf(temval1, "成功", "失败"), IIf(temval1, 0, 1)
End If
End If
MsgStr = ""
If Not temval1 Then
MsgStr = MsgStr + "前向网关打开失败!" + Chr(10)
End If
If Not temval2 Then
MsgStr = MsgStr + "后向网关打开失败!" + Chr(10)
End If
If MsgStr <> "" Then
MsgBox MsgStr, 48, "打开网关"
End If
End Sub
Private Sub cmdOpen_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
cmdCancle_Click
End If
End Sub
Private Sub Form_Load()
If UBound(curForm) > 0 Then
curForm(UBound(curForm)).Enabled = False
End If
ReDim Preserve curForm(UBound(curForm) + 1)
Set curForm(UBound(curForm)) = Me
SQL = "select * from GateMap order by FrameID ASC "
Set rcGate = dbCbb.OpenRecordset(SQL)
Do While Not rcGate.EOF
cmbFrame.AddItem Format(rcGate!FrameID)
rcGate.MoveNext
Loop
cmdOpen.Enabled = False
cmdClose.Enabled = False
DoEvents
End Sub
Private Sub txtGateNum_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
cmdCancle_Click
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
ReDim Preserve curForm(UBound(curForm) - 1)
If UBound(curForm) > 0 Then
curForm(UBound(curForm)).Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -