src/main/kotlin/com/flightfeather/uav/socket/bean/AirData.kt
@@ -1,6 +1,8 @@
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
@@ -20,4 +22,14 @@
    //状态位
    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
    }
}