From e5bdf2e02090357cbd580d54e6cd2406dd541760 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 21 三月 2025 17:39:30 +0800
Subject: [PATCH] 1. 新增卫星遥测网格热力图计算逻辑(待完成)

---
 src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 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..ab8b068 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,9 @@
 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
@@ -19,4 +21,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