feiyu02
2025-05-08 9a9a27f185bc0cf9dc0001cfc6839e6d13dbccd9
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
package com.flightfeather.uav.model.underwaygrid
 
import com.flightfeather.uav.domain.entity.GridCell
import com.flightfeather.uav.domain.entity.GridDataDetail
import com.flightfeather.uav.model.BaseMData
import com.flightfeather.uav.socket.eunm.FactorType
import com.flightfeather.uav.socket.eunm.FactorType.*
 
/**
 * 卫星网格坐标和监测数据
 * @date 2025/3/21
 * @author feiyu02
 */
class GridCellAndData(val gridCell: GridCell, val gridDataDetail: GridDataDetail): BaseMData() {
 
    override fun getFactorData(type: FactorType): Double? {
        return when (type) {
            NO2 -> gridDataDetail.no2.toDouble()
            CO -> gridDataDetail.co.toDouble()
            H2S -> gridDataDetail.h2s.toDouble()
            SO2 -> gridDataDetail.so2.toDouble()
            O3 -> gridDataDetail.o3.toDouble()
            PM25 -> gridDataDetail.pm25.toDouble()
            PM10 -> gridDataDetail.pm10.toDouble()
            TEMPERATURE -> gridDataDetail.temperature.toDouble()
            HUMIDITY -> gridDataDetail.humidity.toDouble()
            VOC -> gridDataDetail.voc.toDouble()
            NOI -> gridDataDetail.noi.toDouble()
            WIND_SPEED -> gridDataDetail.windSpeed.toDouble()
            WIND_DIRECTION -> gridDataDetail.windDirection.toDouble()
            NO -> gridDataDetail.no.toDouble()
            else -> null
        }
    }
}