From 698f8f0f22af4c66581ce284407e986ca036aec6 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 23 一月 2025 17:10:26 +0800 Subject: [PATCH] 1. 网格细分逻辑(编写中) --- src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 45 insertions(+), 1 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt b/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt index c3b6f14..7ac9d4b 100644 --- a/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt +++ b/src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt @@ -1,7 +1,10 @@ package com.flightfeather.uav.lightshare.bean +import com.fasterxml.jackson.annotation.JsonIgnore 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 @@ -19,4 +22,45 @@ var lng: Double? = null, //绾害 var lat: Double? = null -) \ No newline at end of file +) : BaseMData() { + override fun getFactorData(type: FactorType): Double? { + if (values == null) throw IllegalStateException(this.javaClass.name + ": 鐩戞祴鏁版嵁鏁扮粍涓簄ull") + 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 { + if (FactorType.outputFactor(it.factorName)) { + 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 { + if (FactorType.outputFactor(it.factorName)) { + val name = it.factorName ?: "" + list.add(name) +// list.add("$name(鐗╃悊閲�)") + } + } + return list.toTypedArray() + } +} \ No newline at end of file -- Gitblit v1.9.3