📄 frmcatenation.frm
字号:
Top = 720
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "高高限值"
Height = 180
Index = 3
Left = 5880
TabIndex = 6
Top = 360
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "输出点"
Height = 180
Index = 2
Left = 2760
TabIndex = 5
Top = 1800
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "输入点"
Height = 180
Index = 1
Left = 2760
TabIndex = 4
Top = 360
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "连锁信息点"
Height = 180
Index = 0
Left = 120
TabIndex = 0
Top = 120
Width = 900
End
End
Attribute VB_Name = "frmCatenation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Caten_index As Long
Dim SendEN As Boolean
Private Sub Cmd_Seting_Click()
Dim str1 As String
If Not Check1(0).Enabled Then
If Caten_index < 13 Then
lngPopedom = 3
frmPassword.Show 1
If mPassword Then
mPassword = False
For i = 0 To 3
Text1(i).Enabled = True
Check1(i).Enabled = True
Next
Else
Exit Sub
End If
Else
lngPopedom = 1
frmPassword.Show 1
If mPassword Then
mPassword = False
For i = 0 To 3
Text1(i).Enabled = True
Check1(i).Enabled = True
Next
Cmd_Seting.Enabled = True
Else
Exit Sub
End If
End If
Else
With Catenation(Caten_index)
If Val(Text1(0)) <> .HHighAlarm Then
.HHighAlarm = Val(Text1(0))
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "HHighAlarm", CStr(.HHighAlarm), iniPaths + "Catenat.ini"
AddWork .Nmae & "--HHighAlarm=" & .HHighAlarm
End If
If CBool(Check1(0).Value) <> .HHCaten Then
.HHCaten = CBool(Check1(0).Value)
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "HHCaten", CStr(.HHCaten), iniPaths + "Catenat.ini"
AddWork .Nmae & "--HHCaten=" & .HHCaten
End If
If Val(Text1(1)) <> .HighAlarm Then
.HighAlarm = Val(Text1(1))
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "HighAlarm", CStr(.HighAlarm), iniPaths + "Catenat.ini"
AddWork .Nmae & "--HighAlarm=" & .HighAlarm
End If
If CBool(Check1(1).Value) <> .HCaten Then
.HCaten = CBool(Check1(1).Value)
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "HCaten", CStr(.HCaten), iniPaths + "Catenat.ini"
AddWork .Nmae & "--HCaten=" & .HCaten
End If
If Val(Text1(2)) <> .LowAlarm Then
.LowAlarm = Val(Text1(2))
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "LowAlarm", CStr(.LowAlarm), iniPaths + "Catenat.ini"
AddWork .Nmae & "--LowAlarm=" & .LowAlarm
End If
If CBool(Check1(2).Value) <> .LCaten Then
.LCaten = CBool(Check1(2).Value)
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "LCaten", CStr(.LCaten), iniPaths + "Catenat.ini"
AddWork .Nmae & "--LCaten=" & .LCaten
End If
If Val(Text1(3)) <> .LLowAlarm Then
.LLowAlarm = Val(Text1(3))
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "LLowAlarm", CStr(.LLowAlarm), iniPaths + "Catenat.ini"
AddWork .Nmae & "--LLowAlarm=" & .LLowAlarm
End If
If CBool(Check1(3).Value) <> .LLCaten Then
.LLCaten = CBool(Check1(3).Value)
SendEN = True
WritePrivateProfileString "Catenation" & Caten_index, "LLCaten", CStr(.LLCaten), iniPaths + "Catenat.ini"
AddWork .Nmae & "--LLCaten=" & .LLCaten
End If
If SendEN Then
str1 = "@" & Caten_index & "@" & .HHighAlarm & "@" & .HighAlarm & "@" & .LowAlarm & "@" & .LLowAlarm & "@" & .HHCaten & "@" & .HCaten & "@" & .LCaten & "@" & .LLCaten
SynchroMsg str1
SendEN = False
End If
End With
End If
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub CmdRes_Click(Index As Integer)
On Error Resume Next
If Catenation(Caten_index).Calc <> 3 Then
If Check1(Index).Enabled Then
If Index <= UBound(Catenation(Caten_index).OutTag) Then
With Catenation(Caten_index)
strPIDCommand = "$" & Format(MotherBoard(Signal(.OutTag(Index)).Board).Port_Dip, "00") & "Out" & Signal(.OutTag(Index)).Channel & "=0"
AddWork .Nmae & "--" & Replace(Signal(.OutTag(Index)).Name, " ", "") & "--复位"
strPIDSYNC = "|" & Caten_index & "|" & "Out" & "|" & strPIDCommand
SynchroMsg strPIDSYNC
End With
End If
End If
End If
End Sub
Private Sub CmdSet_Click(Index As Integer)
On Error Resume Next
If Catenation(Caten_index).Calc <> 3 Then
If Check1(Index).Enabled Then
If Index <= UBound(Catenation(Caten_index).OutTag) Then
With Catenation(Caten_index)
strPIDCommand = "$" & Format(MotherBoard(Signal(.OutTag(Index)).Board).Port_Dip, "00") & "Out" & Signal(.OutTag(Index)).Channel & "=1"
AddWork .Nmae & "--" & Replace(Signal(.OutTag(Index)).Name, " ", "") & "--置位"
strPIDSYNC = "|" & Caten_index & "|" & "Out" & "|" & strPIDCommand
SynchroMsg strPIDSYNC
End With
End If
End If
End If
End Sub
Private Sub Form_Load()
Dim j As Long, lp_hand As Long
On Error Resume Next
lp_hand = SetParent(Me.hWnd, frmMain.hWnd)
For j = 0 To UBound(Catenation)
List1.AddItem Catenation(j).Nmae
Next
End Sub
Private Sub List1_Click()
Dim j As Long
On Error Resume Next
Caten_index = List1.ListIndex
List2(0).Clear
With Catenation(Caten_index)
For j = 0 To UBound(.InTag)
List2(0).AddItem Signal(.InTag(j)).Name
Next
List2(1).Clear
For j = 0 To UBound(.OutTag)
List2(1).AddItem Signal(.OutTag(j)).Name
If Signal(.OutTag(j)).CalValue = 1 Then
CmdRes(j).BackColor = &HFF&
CmdSet(j).BackColor = &H8000000F
Else
CmdRes(j).BackColor = &H8000000F
CmdSet(j).BackColor = &HFF00&
End If
Next
Text1(0) = .HHighAlarm
Text1(1) = .HighAlarm
Text1(2) = .LowAlarm
Text1(3) = .LLowAlarm
Text1(4) = .Calc
If .HHCaten Then
Check1(0).Value = 1
CmdRes(0).Enabled = False
CmdSet(0).Enabled = False
Else
Check1(0).Value = 0
CmdRes(0).Enabled = True
CmdSet(0).Enabled = True
End If
If .HCaten Then
Check1(1).Value = 1
CmdRes(1).Enabled = False
CmdSet(1).Enabled = False
Else
Check1(1).Value = 0
CmdRes(1).Enabled = True
CmdSet(1).Enabled = True
End If
If .LCaten Then
Check1(2).Value = 1
CmdRes(2).Enabled = False
CmdSet(2).Enabled = False
Else
Check1(2).Value = 0
CmdRes(2).Enabled = True
CmdSet(2).Enabled = True
End If
If .LLCaten Then
Check1(3).Value = 1
CmdRes(3).Enabled = False
CmdSet(3).Enabled = False
Else
Check1(3).Value = 0
CmdRes(3).Enabled = True
CmdSet(3).Enabled = True
End If
If Caten_index > 13 Then
If Check1(0).Enabled Then
For j = 0 To 3
Check1(j).Enabled = False
Next
End If
End If
End With
End Sub
Private Sub Text1_Change(Index As Integer)
If Not IsNumeric(Text1(Index).Text) Then
MsgBox "输入的数据类型错误", vbOKOnly, "错误提示"
Text1(Index).Text = 0
Exit Sub
End If
End Sub
Private Sub Timer1_Timer()
Dim j As Long
With Catenation(Caten_index)
For j = 0 To UBound(.OutTag)
If Signal(.OutTag(j)).CalValue = 1 Then
CmdRes(j).BackColor = &HFF&
CmdSet(j).BackColor = &H8000000F
Else
CmdRes(j).BackColor = &H8000000F
CmdSet(j).BackColor = &HFF00&
End If
Next
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -