From c5f380b69707a9a09fe988a2f4bd98e142bf64ae Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 10 七月 2025 17:29:48 +0800
Subject: [PATCH] 2025.7.10 1. 修改动态溯源异常判断逻辑

---
 src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRTExcChangeRate.kt |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RTExcChangeRate.kt b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRTExcChangeRate.kt
similarity index 86%
rename from src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RTExcChangeRate.kt
rename to src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRTExcChangeRate.kt
index f07fd1c..e36031e 100644
--- a/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RTExcChangeRate.kt
+++ b/src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRTExcChangeRate.kt
@@ -19,7 +19,7 @@
  * @date 2025/6/10
  * @author feiyu02
  */
-open class RTExcChangeRate(config: RTExcWindLevelConfig) :
+abstract class BaseRTExcChangeRate(config: RTExcWindLevelConfig) :
     BaseExceptionContinuous<ExceptionTag, RTExcWindLevelConfig, PollutedClue>(config, ExceptionTag::class.java) {
 
     constructor(config: RTExcWindLevelConfig, callback: NewPolluteClueCallback) : this(config){
@@ -28,7 +28,7 @@
 
     private var callback: NewPolluteClueCallback? = null
 
-    open var changeRate = this.config.changeRateUp
+    abstract var changeRate: MutableMap<FactorType, RTExcWindLevelConfig.WindLevelCondition>
 
     override fun getExceptionType(): ExceptionType {
         return ExceptionType.TYPE9
@@ -58,20 +58,17 @@
 
             val rate = changeRate[f]
 
-            val pValue = p.getByFactorType(f)!!
-            val nValue = n.getByFactorType(f)!!
-            // 璁$畻鍚庝竴涓暟鎹浉姣斾簬鍓嶄竴涓暟鎹殑鍙樺寲閫熺巼
-            val v = (nValue - pValue)
-
-            val b1 = if (rate != null) {
-                v in rate.mutationRate.first..rate.mutationRate.second
+            if (rate != null && n.windSpeed!! in rate.windSpeed.first..rate.windSpeed.second) {
+                val pValue = p.getByFactorType(f)!!
+                val nValue = n.getByFactorType(f)!!
+                // 璁$畻鍚庝竴涓暟鎹浉姣斾簬鍓嶄竴涓暟鎹殑鍙樺寲閫熺巼
+                val v = (nValue - pValue)
+                val b1 = v in rate.mutationRate.first..rate.mutationRate.second
+                println("鍥犲瓙锛�${f.des}锛岄�熺巼锛�${v}锛�${b1}")
+                res[f] = b1
             } else {
-                false
+                res[f] = false
             }
-//                val r = (nValue - pValue) / pValue
-//                val b1 = r >= con.mutationRate.first && r < con.mutationRate.second
-            println("鍥犲瓙锛�${f.des}锛岄�熺巼锛�${v}锛�${b1}")
-            res[f] = b1
         }
         return res
     }

--
Gitblit v1.9.3