From b10c22af595bd995e56946bff63b8f2f984b13e8 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 14 八月 2025 17:25:05 +0800
Subject: [PATCH] 2025.8.14 1. 动态溯源模块添加滑动平均异常计算(调试中)

---
 src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
index 83bb5c7..d2b696f 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
@@ -28,7 +28,12 @@
      * 姣忎竴鍒婚挓瀵瑰巻鍙茬嚎绱㈣繘琛岀粺璁★紝鎻愬嚭浼氬晢寤鸿锛堢姹℃煋婧愯緝杩溿�佹薄鏌撴簮鏁伴噺銆佸嚭鐜版鏁帮級銆佽蛋鑸矾绾胯皟鏁村缓璁紙绂绘薄鏌撴簮杈冭繎銆佽蛋鑸建杩规湭鎺ヨ繎婧簮鍦烘櫙锛�
      */
 
-    constructor(sceneInfoRep: SceneInfoRep, sourceTraceRep: SourceTraceRep, factorFilter: FactorFilter?) {
+    constructor(
+        sceneInfoRep: SceneInfoRep,
+        sourceTraceRep: SourceTraceRep,
+        factorFilter: FactorFilter?,
+        isSearchAddress: Boolean,
+    ) {
         this.sceneInfoRep = sceneInfoRep
         this.sourceTraceRep = sourceTraceRep
         this.config = if (factorFilter != null) {
@@ -43,7 +48,7 @@
                     .withMain(FactorType.O3)
                     .withMain(FactorType.PM25)
                     .withMain(FactorType.PM10)
-//                    .withMain(FactorType.VOC)
+                    .withMain(FactorType.VOC)
                     .withCombination(
                         listOf(
                             listOf(FactorType.PM25, FactorType.PM10),
@@ -53,11 +58,14 @@
                     .create()
             )
         }
+        this.config.isSearchAddress = isSearchAddress
+
         pollutedSummary = PollutedSummary(config) { summaryCallback(it) }
         newTask()
     }
 
-    constructor(sceneInfoRep: SceneInfoRep, sourceTraceRep: SourceTraceRep) : this(sceneInfoRep, sourceTraceRep, null)
+    constructor(sceneInfoRep: SceneInfoRep, sourceTraceRep: SourceTraceRep, isSearchAddress: Boolean = true)
+            : this(sceneInfoRep, sourceTraceRep, null, isSearchAddress)
 
     private val pollutedSummary: PollutedSummary
     private val sceneInfoRep: SceneInfoRep
@@ -76,6 +84,7 @@
 
     private fun newTask() {
         taskList.apply {
+//            add(RTExcSlideAverage(config) { dataChangeCallback(it) }.also { it.init() })
             add(RTExcWindLevel1(config) { exceptionCallback(it) }.also { it.init() })
             add(RTExcWindLevel1_1(config) { exceptionCallback(it) }.also { it.init() })
             add(RTExcWindLevel4(config) { exceptionCallback(it) }.also { it.init() })
@@ -102,6 +111,16 @@
         dealOnTimeout()
     }
 
+    fun addDataList(dataList: List<BaseRealTimeData>) {
+        // 璁$畻寮傚父
+        dataList.forEach { data ->
+            taskList.forEach { it.onNextData(data) }
+            pollutedSummary.refreshLatestMonitorData(data)
+        }
+        // 闄愬畾鏃堕棿鍐呮病鏈夋柊鏁版嵁浼犲叆锛屽垯缁撴潫褰撳墠鐨勮绠�
+        dealOnTimeout()
+    }
+
     /**
      * 瓒呮椂澶勭悊锛岃緝闀挎椂闂存病鏈夋柊鏁版嵁杩涘叆锛岃繘琛屽垵濮嬪寲鎿嶄綔
      */

--
Gitblit v1.9.3