From 62a55369aa23d4b9cee5e66e0520b3803c33de6f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 21 六月 2021 13:29:37 +0800
Subject: [PATCH] 1. 新增走航检测污染溯源模型逻辑

---
 src/main/kotlin/com/flightfeather/uav/model/epw/EPWModel.kt |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/model/epw/EPWModel.kt b/src/main/kotlin/com/flightfeather/uav/model/epw/EPWModel.kt
index be8689e..e3cb9cd 100644
--- a/src/main/kotlin/com/flightfeather/uav/model/epw/EPWModel.kt
+++ b/src/main/kotlin/com/flightfeather/uav/model/epw/EPWModel.kt
@@ -11,8 +11,8 @@
  */
 class EPWModel {
 
-//    private val windDirWeight = WindDirWeight()
-//    private val windDisWeight = WindDisWeight()
+    private val windDirWeight = WindDirWeight()
+    private val windDisWeight = WindDisWeight()
 
     private lateinit var datas: List<DataVo>
     private lateinit var sources: List<Company>
@@ -23,15 +23,26 @@
                 return@d
             }
 
+            var con = 0
+            var ws = 0.0
+            var wd = 0
+            var hr = 0
+            val lng = d.lng
+            val lat = d.lat
+
             sources.forEach s@ { s ->
                 // 缁忕含搴︽湁鏁堟�у垽鏂�
                 if (s.ciLongitude == null || s.ciLongitude == BigDecimal(0) || s.ciLatitude == null || s.ciLatitude == BigDecimal(0)) {
                     return@s
                 }
 
-                val p1 = Pair(d.lng!!, d.lat!!)
+                val p1 = Pair(lng!!, lat!!)
                 val p2 = Pair(s.ciLongitude.toDouble(), s.ciLatitude.toDouble())
-//                windDirWeight.getWeight(p1, p2)
+                windDirWeight.getWeight(p1, p2, wd)
+
+                windDisWeight.getWeight(p1, p2, ws)
+
+
             }
         }
     }

--
Gitblit v1.9.3