Riku
2025-07-13 37d47c6a7ab0f454b948b68c987146b261117993
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.flightfeather.uav.biz.dataanalysis.model
 
import com.flightfeather.uav.socket.eunm.FactorType
 
/**
 * 走航数据异常标准
 */
class ExceptionSetting {
 
    // 超标界限
    val no2 = 200f
    var co = 5000f
    var h2s = 500f
    var so2 = 500f
    var o3 = 200f
    var pm25 = 75f
    var pm10 = 150f
    var voc = 600f
 
    fun getByFactorIndex(i: Int): Float? {
        return when (i) {
            0 -> no2
            1 -> co
            2 -> h2s
            3 -> so2
            4 -> o3
            5 -> pm25
            6 -> pm10
            7 -> voc
            else -> null
        }
    }
 
    fun getByFactorType(factorType: FactorType): Float? {
        return when (factorType) {
            FactorType.NO2 -> no2
            FactorType.CO -> co
            FactorType.H2S -> h2s
            FactorType.SO2 -> so2
            FactorType.O3 -> o3
            FactorType.PM25 -> pm25
            FactorType.PM10 -> pm10
//            FactorType.TEMPERATURE -> temperature
//            FactorType.HUMIDITY -> humidity
            FactorType.VOC -> voc
//            FactorType.NOI -> noi
//            FactorType.LNG -> longitude?.toFloat()
//            FactorType.LAT -> latitude?.toFloat()
//            FactorType.VELOCITY -> velocity
//            FactorType.TIME -> noi
//            FactorType.WIND_SPEED -> windSpeed
//            FactorType.WIND_DIRECTION -> windDirection
//            FactorType.HEIGHT -> height
            else -> null
        }
    }
}