Riku
2025-06-02 e731486b50c4ea6e2d28f302df449b4bd0b2be57
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/BaseRTExcWindLevel.kt
@@ -39,6 +39,7 @@
    override fun judgeException(p: BaseRealTimeData?, n: BaseRealTimeData): MutableMap<FactorType, Boolean> {
        val res = mutableMapOf<FactorType, Boolean>()
        println()
        config.factorFilter.mainList().forEach { f ->
            if (p?.getByFactorType(f) == null || n.getByFactorType(f) == null || n.windSpeed == null) {
                res[f] = (false)
@@ -48,17 +49,20 @@
            val con = windLevelCondition
            if (n.windSpeed!! in con.windSpeed.first..con.windSpeed.second) {
                println("风速:${n.windSpeed},[${con.windSpeed.first} - ${con.windSpeed.second}]")
                val pValue = p.getByFactorType(f)!!
                val nValue = n.getByFactorType(f)!!
                // 计算后一个数据相比于前一个数据的变化率
                val r = (nValue - pValue) / pValue
                val b1 = r >= con.mutationRate.first
                println("因子:${f.des},幅度:${r},限定:${con.mutationRate.first},${b1}")
                res[f] = b1
            } else {
                res[f] = false
            }
        }
        return res
    }