form2.frm
来自「测试温湿度以及烟感报警,硬件采用长应8000系列」· FRM 代码 · 共 748 行 · 第 1/2 页
FRM
748 行
Begin VB.Shape Shape2
BorderColor = &H80000005&
FillColor = &H00FFFFFF&
FillStyle = 0 'Solid
Height = 135
Index = 1
Left = 120
Top = 1080
Width = 2775
End
Begin VB.Shape Shape1
BorderColor = &H80000009&
FillColor = &H00FFFFFF&
FillStyle = 0 'Solid
Height = 135
Index = 1
Left = 120
Top = 480
Width = 2775
End
Begin VB.Label Label9
BackColor = &H80000003&
Caption = "0 5 10 15 20 25 30 35 40 45 50 "
Height = 255
Index = 1
Left = 120
TabIndex = 8
Top = 240
Width = 3015
End
End
Begin VB.Frame Frame1
BackColor = &H80000003&
Caption = "西堤头分理处1"
ForeColor = &H000000FF&
Height = 1785
Index = 0
Left = 3360
OLEDropMode = 1 'Manual
TabIndex = 0
Top = 6600
Width = 4005
Begin VB.TextBox Text_w
BackColor = &H80000003&
ForeColor = &H8000000E&
Height = 270
Index = 0
Left = 3000
TabIndex = 2
Text = "Text3"
Top = 1080
Width = 975
End
Begin VB.TextBox Text_tem
BackColor = &H80000003&
ForeColor = &H8000000E&
Height = 270
Index = 0
Left = 3000
TabIndex = 1
Text = "Text2"
Top = 480
Width = 975
End
Begin VB.Shape Shape_w
BorderColor = &H00000000&
FillStyle = 0 'Solid
Height = 135
Index = 0
Left = 120
Top = 1080
Width = 2775
End
Begin VB.Shape Shape_tem
BackColor = &H00FFFFFF&
BorderColor = &H0000FF00&
FillColor = &H0000FF00&
FillStyle = 0 'Solid
Height = 135
Index = 0
Left = 120
Top = 480
Width = 2775
End
Begin VB.Label Label9
BackColor = &H80000003&
Caption = "0 5 10 15 20 25 30 35 40 45 50 "
Height = 255
Index = 0
Left = 120
TabIndex = 4
Top = 240
Width = 3015
End
Begin VB.Shape Shape1
BorderColor = &H80000009&
FillColor = &H00FFFFFF&
FillStyle = 0 'Solid
Height = 135
Index = 0
Left = 120
Top = 480
Width = 2775
End
Begin VB.Shape Shape2
BorderColor = &H80000005&
FillColor = &H00FFFFFF&
FillStyle = 0 'Solid
Height = 135
Index = 0
Left = 120
Top = 1080
Width = 2775
End
Begin VB.Label Label1
BackColor = &H80000003&
Caption = "0 10 20 30 40 50 60 70 80 90 100 "
Height = 255
Index = 0
Left = 120
TabIndex = 3
Top = 840
Width = 3015
End
End
Begin VB.Line Line10
BorderColor = &H80000004&
X1 = 6120
X2 = 6120
Y1 = 2640
Y2 = 3360
End
Begin VB.Line Line9
BorderColor = &H80000005&
X1 = 4920
X2 = 4920
Y1 = 2640
Y2 = 3360
End
Begin VB.Line Line8
BorderColor = &H80000004&
X1 = 5520
X2 = 5520
Y1 = 1920
Y2 = 2640
End
Begin VB.Line Line7
BorderColor = &H80000005&
X1 = 7200
X2 = 7200
Y1 = 2640
Y2 = 3360
End
Begin VB.Line Line6
BorderColor = &H80000004&
X1 = 3840
X2 = 3840
Y1 = 2640
Y2 = 3360
End
Begin VB.Line Line5
BorderColor = &H80000004&
X1 = 3840
X2 = 7200
Y1 = 3360
Y2 = 3360
End
Begin VB.Line Line4
BorderColor = &H80000004&
X1 = 6600
X2 = 6600
Y1 = 1920
Y2 = 2640
End
Begin VB.Line Line3
BorderColor = &H80000004&
X1 = 4440
X2 = 4440
Y1 = 1920
Y2 = 2640
End
Begin VB.Line Line2
BorderColor = &H80000005&
X1 = 3840
X2 = 7200
Y1 = 2640
Y2 = 2640
End
Begin VB.Line Line1
BorderColor = &H80000005&
X1 = 4440
X2 = 6600
Y1 = 1920
Y2 = 1920
End
Begin VB.Shape Shape4
FillColor = &H0000FF00&
FillStyle = 0 'Solid
Height = 855
Left = 9960
Shape = 2 'Oval
Top = 5400
Width = 975
End
Begin VB.Shape Shape3
FillColor = &H0000FF00&
FillStyle = 0 'Solid
Height = 375
Index = 4
Left = 6120
Shape = 3 'Circle
Top = 2640
Width = 375
End
Begin VB.Shape Shape3
FillColor = &H0000FF00&
FillStyle = 0 'Solid
Height = 375
Index = 3
Left = 4920
Shape = 3 'Circle
Top = 2640
Width = 375
End
Begin VB.Shape Shape3
FillColor = &H0000FF00&
FillStyle = 0 'Solid
Height = 375
Index = 2
Left = 3840
Shape = 3 'Circle
Top = 2640
Width = 375
End
Begin VB.Shape Shape3
FillColor = &H0000FF00&
FillStyle = 0 'Solid
Height = 375
Index = 1
Left = 5520
Shape = 3 'Circle
Top = 1920
Width = 375
End
Begin VB.Shape Shape3
BorderColor = &H00000000&
FillColor = &H0000FF00&
FillStyle = 0 'Solid
Height = 375
Index = 0
Left = 4440
Shape = 3 'Circle
Top = 1920
Width = 375
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Timer1_Timer()
'####################################################
'调试用
'####################################################
Dim a_fire As Integer
Text_tem(0).Text = T_TMP(0, 0) & "℃"
Text_tem(1).Text = T_TMP(0, 1) & "℃"
Text_tem(2).Text = T_TMP(0, 2) & "℃"
Text_tem(3).Text = T_TMP(0, 3) & "℃"
Text_tem(4).Text = T_TMP(0, 4) & "℃"
Shape_tem(0).Width = (2775 * T_TMP(0, 0) \ 50)
Shape_tem(1).Width = (2775 * T_TMP(0, 1) \ 50)
Shape_tem(2).Width = (2775 * T_TMP(0, 2) \ 50)
Shape_tem(3).Width = (2775 * T_TMP(0, 3) \ 50)
Shape_tem(4).Width = (2775 * T_TMP(0, 4) \ 50)
Text_w(0).Text = T_WET(0, 0) & "%"
Text_w(1).Text = T_WET(0, 1) & "%"
Text_w(2).Text = T_WET(0, 2) & "%"
Text_w(3).Text = T_WET(0, 3) & "%"
Text_w(4).Text = T_WET(0, 4) & "%"
Shape_w(0).Width = (2775 * T_WET(0, 0) \ 100)
Shape_w(1).Width = (2775 * T_WET(0, 1) \ 100)
Shape_w(2).Width = (2775 * T_WET(0, 2) \ 100)
Shape_w(3).Width = (2775 * T_WET(0, 3) \ 100)
Shape_w(4).Width = (2775 * T_WET(0, 4) \ 100)
If T_FIRE(0) = 0 Then
Text1.Text = "正常"
a_fire = 0
ElseIf T_FIRE(0) < 0 Then
Text1.Text = "没有传感器"
a_fire = -1
Else
Text1.Text = "火警触发"
a_fire = 1
End If
If a_fire = 0 Then
Shape4.FillColor = &HFF00&
ElseIf a_fire = -1 Then
Shape4.FillColor = &HFFFF&
Else
If Shape4.FillColor = &HFF& Then
Shape4.FillColor = &H8080FF
Else
Shape4.FillColor = &HFF&
End If
End If
'#############################333
If T_TMP(0, 0) < 35 And T_WET(0, 0) > 30 Then
Shape3(0).FillColor = &HFF00&
Else
If Shape3(0).FillColor = &HFF& Then
Shape3(0).FillColor = &H8080FF
Else
Shape3(0).FillColor = &HFF&
End If
End If
If T_TMP(0, 1) < 35 And T_WET(0, 1) > 30 Then
Shape3(0).FillColor = &HFF00&
Else
If Shape3(1).FillColor = &HFF& Then
Shape3(1).FillColor = &H8080FF
Else
Shape3(1).FillColor = &HFF&
End If
End If
If T_TMP(0, 2) < 35 And T_WET(0, 2) > 30 Then
Shape3(2).FillColor = &HFF00&
Else
If Shape3(2).FillColor = &HFF& Then
Shape3(2).FillColor = &H8080FF
Else
Shape3(2).FillColor = &HFF&
End If
End If
If T_TMP(0, 3) < 35 And T_WET(0, 3) > 30 Then
Shape3(3).FillColor = &HFF00&
Else
If Shape3(3).FillColor = &HFF& Then
Shape3(3).FillColor = &H8080FF
Else
Shape3(3).FillColor = &HFF&
End If
End If
If T_TMP(0, 4) < 35 And T_WET(0, 4) > 30 Then
Shape3(4).FillColor = &HFF00&
Else
If Shape3(4).FillColor = &HFF& Then
Shape3(4).FillColor = &H8080FF
Else
Shape3(4).FillColor = &HFF&
End If
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?