| | |
| | | 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 |
| | |
| | | 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 |
| | | } |
| | | |
| | | fun toRowContent(): Array<Any> { |
| | | val row = mutableListOf<Any>() |
| | | row.add(deviceCode ?: "") |
| | | row.add(time ?: "") |
| | | row.add(lng ?: -1.0) |
| | | row.add(lat ?: -1.0) |
| | | values?.forEach { |
| | | row.add(it.factorData ?: -1.0) |
| | | row.add(it.physicalQuantity ?: -1.0) |
| | | } |
| | | return row.toTypedArray() |
| | | } |
| | | |
| | | fun toRowTitle(): Array<String> { |
| | | val list = mutableListOf<String>() |
| | | list.add("编号") |
| | | list.add("采样时间") |
| | | list.add("经度") |
| | | list.add("纬度") |
| | | values?.forEach { |
| | | val name = it.factorName ?: "" |
| | | list.add(name) |
| | | list.add("$name(物理量)") |
| | | } |
| | | return list.toTypedArray() |
| | | } |
| | | } |