riku
2021-06-30 5353617c7b2135ab00f98d8e05b2f8dfb2e096ed
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
package com.flightfeather.uav.lightshare.bean
 
import com.fasterxml.jackson.annotation.JsonInclude
import com.flightfeather.uav.model.BaseMData
import com.flightfeather.uav.socket.bean.AirData
import com.flightfeather.uav.socket.eunm.FactorType
 
/**
 * @author riku
 * Date: 2020/9/10
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
data class DataVo(
        //时间,  yyyy-MM-dd HH:mm:ss
        var time: String? = null,
        //站点编号
        var deviceCode: String? = null,
        //数据值
        var values: List<AirData>? = null,
        //经度
        var lng: Double? = null,
        //纬度
        var lat: Double? = null
) : BaseMData() {
        override fun getFactorData(type: FactorType): Double? {
                if (values == null) throw IllegalStateException(this.javaClass.name + ": 监测数据数组为null")
                for (d in values!!) {
                        if (d.factorName == type.name) {
                                return d.factorData
                        }
                }
                return null
        }
}