| | |
| | | package com.flightfeather.uav.socket.bean |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | import kotlin.math.round |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/6/10 |
| | | */ |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class AirData : DataUnit() { |
| | | var factorId: String? = null |
| | | var factorName: String? = null |
| | |
| | | |
| | | //状态位 |
| | | var statusList: List<String>? = null |
| | | |
| | | fun setData(factorType: FactorType, value: Float?) { |
| | | setData(factorType, round(value?.toDouble()?.times(1000) ?: .0) / 1000) |
| | | } |
| | | |
| | | fun setData(factorType: FactorType, value: Double?) { |
| | | factorId = factorType.value.toString() |
| | | factorName = factorType.des |
| | | factorData = value |
| | | } |
| | | } |