Private Sub Command1_Click()
On Error Resume Next
If Text1.Text < 0.05 Or Text1 = 0.05 Then
PSO2 = Text1.Text / 0.05 50
ElseIf Text1.Text > 0.05 And Text1.Text < 0.15 Or Text1.Text = 0.15 Then
PSO2 = ((100 - 50) / (0.15 - 0.05)) (Text1.Text - 0.05) + 50
ElseIf Text1.Text > 0.15 And Text1.Text < 0.8 Or Text1.Text = 0.8 Then
PSO2 = ((200 - 100) / (0.8 - 0.15)) (Text1.Text - 0.15) + 100
ElseIf Text1.Text > 0.8 And Text1.Text < 1.6 Or Text1.Text = 1.6 Then
PSO2 = ((300 - 200) / (1.6 - 0.8)) (Text1.Text - 0.8) + 200
ElseIf Text1.Text > 1.6 And Text1.Text < 2.1 Or Text1.Text = 2.1 Then
PSO2 = ((400 - 300) / (2.1 - 1.6)) (Text1.Text - 1.6) + 300
ElseIf Text1.Text > 2.1 And Text1.Text < 2.62 Or Text1.Text = 2.62 Then
PSO2 = ((500 - 400) / (2.62 - 2.1)) (Text1.Text - 2.1) + 400
End If
Text4.Text = Int(PSO2)
On Error Resume Next
If Text2.Text < 0.08 Or Text2 = 0.08 Then
PNO2 = Text2.Text / 0.08 50
ElseIf Text2.Text > 0.08 And Text2.Text < 0.12 Or Text2.Text = 0.12 Then
PNO2 = ((100 - 50) / (0.12 - 0.08)) (Text2.Text - 0.08) + 50
ElseIf Text2.Text > 0.12 And Text2.Text < 0.28 Or Text2.Text = 0.28 Then
PNO2 = ((200 - 100) / (0.28 - 0.12)) (Text2.Text - 0.12) + 100
ElseIf Text2.Text > 0.28 And Text2.Text < 0.565 Or Text2.Text = 0.565 Then
PNO2 = ((300 - 200) / (0.565 - 0.28)) (Text2.Text - 0.28) + 200
ElseIf Text2.Text > 0.565 And Text2.Text < 0.75 Or Text2.Text = 0.75 Then
PNO2 = ((400 - 300) / (0.75 - 0.565)) (Text2.Text - 0.565) + 300
ElseIf Text2.Text > 0.75 And Text2.Text < 0.94 Or Text2.Text = 0.94 Then
PNO2 = ((500 - 400) / (0.94 - 0.75)) (Text2.Text - 0.75) + 400
End If
Text5.Text = Int(PNO2)
On Error Resume Next
If Text3.Text < 0.05 Or Text3 = 0.05 Then
PM10 = Text3.Text / 0.05 50
ElseIf Text3.Text > 0.05 And Text3.Text < 0.15 Or Text3.Text = 0.15 Then
PM10 = ((100 - 50) / (0.15 - 0.05)) (Text3.Text - 0.05) + 50
ElseIf Text3.Text > 0.15 And Text3.Text < 0.35 Or Text3.Text = 0.35 Then
PM10 = ((200 - 100) / (0.35 - 0.15)) (Text3.Text - 0.15) + 100
ElseIf Text3.Text > 0.35 And Text3.Text < 0.42 Or Text3.Text = 0.42 Then
PM10 = ((300 - 200) / (0.42 - 0.35)) (Text3.Text - 0.35) + 200
ElseIf Text3.Text > 0.42 And Text3.Text < 0.5 Or Text3.Text = 0.5 Then
PM10 = ((400 - 300) / (0.5 - 0.42)) (Text3.Text - 0.42) + 300
ElseIf Text3.Text > 0.5 And Text3.Text < 0.6 Or Text3.Text = 0.6 Then
PM10 = ((500 - 400) / (0.6 - 0.5)) (Text3.Text - 0.5) + 400
End If
Text6.Text = Int(PM10)
cc = Text4.Text
DD = Text5.Text
EE = Text6.Text
If cc < DD Then
If DD < EE Then
AA = EE
Text9.Text = "PM10"
Else
AA = DD
Text9.Text = "NO2"
End If
ElseIf cc = DD Then
If DD < EE Then
AA = EE
Text9.Text = "PM10"
Else
AA = DD
Text9.Text = "NO2"
End If
ElseIf cc > DD Then
If cc < EE Then
AA = EE
Text9.Text = "PM10"
Else
AA = cc
Text9.Text = "SO2"
End If
End If
AA = Int(AA)
Text7.Text = AA
If AA < 50 Or AA = 50 Then
Text8.Text = "优"
ElseIf AA > 50 And AA < 100 Or AA = 100 Then
Text8.Text = "良"
ElseIf AA > 100 And AA < 150 Or AA = 150 Then
Text8.Text = "轻微污染"
ElseIf AA > 150 And AA < 200 Or AA = 200 Then
Text8.Text = "轻度污染"
ElseIf AA > 200 And AA < 250 Or AA = 250 Then
Text8.Text = "中度污染"
ElseIf AA > 250 And AA < 300 Or AA = 300 Then
Text8.Text = "中度重污染"
ElseIf AA > 300 Then
Text8.Text = "重污染"
Else
End If
End Sub
Private Sub Command2_Click()
空气污染指数及范围.Show
End Sub
Private Sub HScroll1_Scroll()
AA = 0.005248 HScroll1.Value - 0.004248
Text1.Text = Format(AA, "####.##")
Text1.ForeColor = HScroll1.Value / 2
End Sub
Private Sub HScroll2_Scroll()
bb = 0.00188 HScroll2.Value - 0.0008
Text2.Text = Format(bb, "####.###")
Text2.ForeColor = HScroll2.Value / 2
End Sub
Private Sub HScroll3_Scroll()
cc = 0.0012 * HScroll3.Value - 0.0002
Text3.Text = Format(cc, "####.###")
Text3.ForeColor = HScroll3.Value / 2
End Sub
Private Sub Text1_Change()
On Error Resume Next
HScroll1.Value = Int((Text1.Text + 0.004248) / 0.005248)
End Sub
Private Sub Text2_Change()
On Error Resume Next
HScroll2.Value = Int((Text2.Text + 0.0008) / 0.0018)
End Sub
Private Sub Text3_Change()
On Error Resume Next
HScroll3.Value = Int((Text3.Text + 0.0002) / 0.0012)
End Sub
空气指数计算(API)
相关文章
还没有评论
发表评论