⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 watersecurity.cls

📁 用VB+MO做的北京奥运交通查询系统
💻 CLS
📖 第 1 页 / 共 2 页
字号:
    ''Hg
    bGrade = HgStanded(m_arrWaterQuanlity(12)) = True
    If bGrade = False Then GoTo EF
    ''Cd
    bGrade = CdStanded(m_arrWaterQuanlity(13)) = True
    If bGrade = False Then GoTo EF
    ''Cr
    bGrade = CrStanded(m_arrWaterQuanlity(14)) = True
    If bGrade = False Then GoTo EF
    ''Pb
    bGrade = PbStanded(m_arrWaterQuanlity(15)) = True
    If bGrade = False Then GoTo EF
    ''NO3
    bGrade = NO3Standed(m_arrWaterQuanlity(16)) = True
    If bGrade = False Then GoTo EF
    ''Worm
    bGrade = WormGrade(m_arrWaterQuanlity(17)) = iGrade
    If bGrade = False Then GoTo EF
    ''SO4
    bGrade = ColiformGrade(m_arrWaterQuanlity(18)) = iGrade
    If bGrade = False Then GoTo EF
    ''返回结果
    WaterGrade = bGrade
    
    Exit Function
EF:
    WaterGrade = False
End Function

''************************************************************************************
''以下函数根据“农村饮水标准”按水质指标值对水质进行分类
''无特殊说明时,0:三种水均达标;1:一级水达标;2:二级水达标;3:三级水达标;4:不确定达标
''************************************************************************************

''色度分类
''IndexValue:色度值
Private Function ColorGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 15 And IndexValue >= 0) Or IndexValue = -1 Then
        ColorGrade = 1
    ElseIf IndexValue >= 15 And IndexValue <= 30 Then
        ColorGrade = 2
    ElseIf IndexValue > 30 Then
        ColorGrade = 3
    Else
        ColorGrade = 4
    End If
End Function

''浑浊度分类
''IndexValue:浑浊度值
Private Function TurbidityGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 3 And IndexValue >= 0) Or IndexValue = -1 Then
        TurbidityGrade = 1
    ElseIf IndexValue >= 3 And IndexValue <= 20 Then
        TurbidityGrade = 2
    ElseIf IndexValue > 20 Then
        TurbidityGrade = 3
    Else
        TurbidityGrade = 4
    End If
End Function

''总硬度分类
''IndexValue:总硬度值
Private Function RigidityGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 450 And IndexValue >= 0) Or IndexValue = -1 Then
        RigidityGrade = 1
    ElseIf IndexValue >= 450 And IndexValue <= 700 Then
        RigidityGrade = 2
    ElseIf IndexValue > 700 Then
        RigidityGrade = 3
    Else
        RigidityGrade = 4
    End If
End Function

''铁分类
''IndexValue:铁值
Private Function FeGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 0.3 And IndexValue >= 0) Or IndexValue = -1 Then
        FeGrade = 1
    ElseIf IndexValue >= 0.3 And IndexValue <= 1 Then
        FeGrade = 2
    ElseIf IndexValue > 1 Then
        FeGrade = 3
    Else
        FeGrade = 4
    End If
End Function

''锰分类
''IndexValue:锰值
Private Function MnGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 0.1 And IndexValue >= 0) Or IndexValue = -1 Then
        MnGrade = 1
    ElseIf IndexValue >= 0.1 And IndexValue <= 0.5 Then
        MnGrade = 2
    ElseIf IndexValue > 0.5 Then
        MnGrade = 3
    Else
        MnGrade = 4
    End If
End Function

''氯化物分类
''IndexValue:氯化物值
Private Function ClGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 250 And IndexValue >= 0) Or IndexValue = -1 Then
        ClGrade = 1
    ElseIf IndexValue >= 250 And IndexValue <= 450 Then
        ClGrade = 2
    ElseIf IndexValue > 450 Then
        ClGrade = 3
    Else
        ClGrade = 4
    End If
End Function

''硫酸盐分类
''IndexValue:硫酸盐值
Private Function SO4Grade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 250 And IndexValue >= 0) Or IndexValue = -1 Then
        SO4Grade = 1
    ElseIf IndexValue >= 250 And IndexValue <= 400 Then
        SO4Grade = 2
    ElseIf IndexValue > 400 Then
        SO4Grade = 3
    Else
        SO4Grade = 4
    End If
End Function

''溶解性总固体分类
''IndexValue:溶解性总固体值
Private Function TDSGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 1000 And IndexValue >= 0) Or IndexValue = -1 Then
        TDSGrade = 1
    ElseIf IndexValue >= 1000 And IndexValue <= 2000 Then
        TDSGrade = 2
    ElseIf IndexValue > 2000 Then
        TDSGrade = 3
    Else
        TDSGrade = 4
    End If
End Function

''氟化物分类
''IndexValue:氟化物值
Private Function FGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 1 And IndexValue >= 0) Or IndexValue = -1 Then
        FGrade = 1
    ElseIf IndexValue >= 1 And IndexValue <= 1.5 Then
        FGrade = 2
    ElseIf IndexValue > 1.5 Then
        FGrade = 3
    Else
        FGrade = 4
    End If
End Function

''细菌总数分类
''IndexValue:细菌总数值
Private Function WormGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 100 And IndexValue >= 0) Or IndexValue = -1 Then
        WormGrade = 1
    ElseIf IndexValue >= 100 And IndexValue <= 500 Then
        WormGrade = 2
    ElseIf IndexValue > 500 Then
        WormGrade = 3
    Else
        WormGrade = 4
    End If
End Function

''总大肠菌群分类
''IndexValue:总大肠菌群值
Private Function ColiformGrade(ByVal IndexValue As Double) As Integer
    If (IndexValue < 3 And IndexValue >= 0) Or IndexValue = -1 Then
        ColiformGrade = 1
    ElseIf IndexValue >= 3 And IndexValue <= 27 Then
        ColiformGrade = 2
    ElseIf IndexValue > 27 Then
        ColiformGrade = 3
    Else
        ColiformGrade = 4
    End If
End Function

''//////0:三种水都达标,1:二、三类水达标;2:都不达标
''PH分类
''IndexValue:PH值
Private Function PHStanded(ByVal IndexValue As Double) As Integer
    If (IndexValue >= 6.5 And IndexValue <= 8.5) Or IndexValue = -1 Then
        PHStanded = 0
    ElseIf (IndexValue >= 6 And IndexValue < 6.5) Or (IndexValue >= 8.5 And IndexValue <= 9) Then
        PHStanded = 1
    Else
        PHStanded = 2
    End If
End Function

''//////False三种水都不达标,True三种水都达标
''肉眼可见物
''IndexValue:肉眼可见物值 1:有,0:没有
Private Function VisibleThingsStanded(ByVal IndexValue As Double) As Boolean
    If IndexValue = 0 Or IndexValue = -1 Then
        VisibleThingsStanded = True
    Else
        VisibleThingsStanded = False
    End If
End Function

''//////False都不达标,True都达标
''砷分类
''IndexValue:砷值
Private Function AsStanded(ByVal IndexValue As Double) As Boolean
    If (IndexValue <= 0.05 And IndexValue >= 0) Or IndexValue = -1 Then
        AsStanded = True
    Else
        AsStanded = False
    End If
End Function

''//////False都不达标,True都达标
''汞分类
''IndexValue:汞值
Private Function HgStanded(ByVal IndexValue As Double) As Boolean
    If (IndexValue <= 0.001 And IndexValue >= 0) Or IndexValue = -1 Then
        HgStanded = True
    Else
        HgStanded = False
    End If
End Function

''//////False都不达标,True都达标
''镉分类
''IndexValue:镉值
Private Function CdStanded(ByVal IndexValue As Double) As Boolean
    If (IndexValue <= 0.01 And IndexValue >= 0) Or IndexValue = -1 Then
        CdStanded = True
    Else
        CdStanded = False
    End If
End Function

''//////False都不达标,True都达标
''铬分类
''IndexValue:铬值
Private Function CrStanded(ByVal IndexValue As Double) As Boolean
    If (IndexValue <= 0.05 And IndexValue >= 0) Or IndexValue = -1 Then
        CrStanded = True
    Else
        CrStanded = False
    End If
End Function

''//////False都不达标,True都达标
''铅分类
''IndexValue:铅值
Private Function PbStanded(ByVal IndexValue As Double) As Boolean
    If (IndexValue <= 0.05 And IndexValue >= 0) Or IndexValue = -1 Then
        PbStanded = True
    Else
        PbStanded = False
    End If
End Function

''//////False都不达标,True都达标
''硝酸盐分类
''IndexValue:硝酸盐值
Private Function NO3Standed(ByVal IndexValue As Double) As Boolean
    If (IndexValue <= 20 And IndexValue >= 0) Or IndexValue = -1 Then
        NO3Standed = True
    Else
        NO3Standed = False
    End If
End Function


''********************************农村饮用水标准********************************
''m_arrWaterQuanlity():水质指标值具体说明
''记录水质各项指标的具体数字:各指标的顺序如下:
''感官性状和一般化学指标:
   ''00色(度)                       15,并不呈现其它异色      20           30
   ''01浑浊度(度)                     3,特殊情况不超过5      10           20
   ''02肉眼可见物                                 不得含有      不得含有       不得含有
   ''03PH                                   6.5~8.5      6~9         6~9
   ''04总硬度(ml/L以碳酸钙计)                   450      550         700
   ''05铁 (ml/L)                                0.3      0.5         1.0
   ''06锰 (ml/L)                                0.1      0.3         0.5
   ''07氯化物 (ml/L)                            250      300         450
   ''08硫酸盐 (ml/L)                            250      300         400
   ''09溶解性总固体(ml/L)                       1000     1500       2000
''毒理学指标:
   ''10氟化物 (ml/L)                            1.0      1.2         1.5
   ''11砷 (ml/L)                                0.05    0.05       0.05
   ''12汞 (ml/L)                              0.001    0.001     0.001
   ''13镉 (ml/L)                                0.01    0.01       0.01
   ''14铬(六价) (ml/L)                         0.05    0.05       0.05
   ''15铅 (ml/L)                                0.05     0.05       0.05
   ''16硝酸盐 (ml/L以氮计)                          20     20           20
''细菌学指标:
   ''17细菌总数(个/ml)                            100      200         500
   ''18总大肠菌群(个/L)                               3      11           27

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -