From 1571cd0f137ced4345fa8785e166a29dc31b6ad1 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 13 五月 2025 17:42:39 +0800
Subject: [PATCH] 1. 新增动态污染溯源的数据异常判断逻辑 2. 新增动态污染溯源websocket连接功能

---
 src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/exceptiontype/ExceptionSlideAverage.kt |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/exceptiontype/ExceptionSlideAverage.kt b/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/exceptiontype/ExceptionSlideAverage.kt
index 391e20d..6ac4ab8 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/exceptiontype/ExceptionSlideAverage.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/dataanalysis/exceptiontype/ExceptionSlideAverage.kt
@@ -3,6 +3,7 @@
 import com.flightfeather.uav.biz.FactorFilter
 import com.flightfeather.uav.biz.dataanalysis.BaseExceptionAnalysis
 import com.flightfeather.uav.biz.dataanalysis.model.DataAnalysisConfig
+import com.flightfeather.uav.biz.dataanalysis.model.ExceptionResult
 import com.flightfeather.uav.biz.dataanalysis.model.ExceptionType
 import com.flightfeather.uav.domain.entity.BaseRealTimeData
 import com.flightfeather.uav.socket.eunm.FactorType
@@ -11,7 +12,8 @@
 /**
  * 婊戝姩骞冲潎鍊肩獊鍙樺紓甯�
  */
-class ExceptionSlideAverage(config: DataAnalysisConfig) : BaseExceptionAnalysis(config) {
+class ExceptionSlideAverage(config: DataAnalysisConfig) :
+    BaseExceptionAnalysis<DataAnalysisConfig, ExceptionResult>(config) {
 
     private val historyDataList = mutableListOf<BaseRealTimeData>()
     private val tempDataList = mutableListOf<BaseRealTimeData>()
@@ -27,7 +29,7 @@
         var sIndex = 0
 
         // 璧峰鏁版嵁瀵硅薄
-        var startData :BaseRealTimeData? = null
+        var startData: BaseRealTimeData? = null
 
         // 鏈熬鏁版嵁涓嬫爣
         var eIndex = -1
@@ -66,7 +68,7 @@
         lastData = null
 
         tagMap.clear()
-        config.factorFilter.mainList().forEach {f->
+        config.factorFilter.mainList().forEach { f ->
             tagMap[f] = Tag()
         }
 //        avgListReverse.clear()
@@ -86,7 +88,7 @@
         if (tempDataList.size > config.changeTrendGroup) {
             tempDataList.removeAt(0)
         }
-        config.factorFilter.selectedList.forEach {s->
+        config.factorFilter.selectedList.forEach { s ->
             val f = s.main
             tagMap[f]?.let {
                 it.eIndex++
@@ -198,4 +200,14 @@
         }
 
     }
+
+    fun newResult(
+        start: BaseRealTimeData,
+        end: BaseRealTimeData?,
+        factor: FactorFilter.SelectedFactor,
+        exceptionData: List<BaseRealTimeData>,
+    ): ExceptionResult {
+        val eType = getExceptionType()
+        return ExceptionResult(start, end, factor, exceptionData, config.mission.missionCode, eType)
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3