feiyu02
2025-07-03 c56e1e74426238939f229f0005828d05089715ff
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/exceptiontype/RTExcChangeRate.kt
@@ -19,7 +19,7 @@
 * @date 2025/6/10
 * @author feiyu02
 */
class RTExcChangeRate(config: RTExcWindLevelConfig) :
open class RTExcChangeRate(config: RTExcWindLevelConfig) :
    BaseExceptionContinuous<ExceptionTag, RTExcWindLevelConfig, PollutedClue>(config, ExceptionTag::class.java) {
    constructor(config: RTExcWindLevelConfig, callback: NewPolluteClueCallback) : this(config){
@@ -28,8 +28,24 @@
    private var callback: NewPolluteClueCallback? = null
    open var changeRate = this.config.changeRateUp
    override fun getExceptionType(): ExceptionType {
        return ExceptionType.TYPE9
    }
    override fun judgeDataScale(p: BaseRealTimeData?, n: BaseRealTimeData): MutableMap<FactorType, Boolean> {
        val res = mutableMapOf<FactorType, Boolean>()
        config.factorFilter.mainList().forEach { f ->
            if (p?.getByFactorType(f) == null || n.getByFactorType(f) == null || n.windSpeed == null) {
                res[f] = (false)
                return@forEach
            }
            val nValue = n.getByFactorType(f)!!
            val minValue = FactorType.getVMin(f)
            res[f] = nValue >= minValue
        }
        return res
    }
    override fun judgeException(p: BaseRealTimeData?, n: BaseRealTimeData): MutableMap<FactorType, Boolean> {
@@ -40,7 +56,7 @@
                return@forEach
            }
            val rate = config.changeRate[f]
            val rate = changeRate[f]
            val pValue = p.getByFactorType(f)!!
            val nValue = n.getByFactorType(f)!!
@@ -48,7 +64,7 @@
            val v = (nValue - pValue)
            val b1 = if (rate != null) {
                v >= rate.mutationRate.first
                v in rate.mutationRate.first..rate.mutationRate.second
            } else {
                false
            }
@@ -61,7 +77,7 @@
    }
    override fun judgeExceptionCount(tag: ExceptionTag, factorType: FactorType?): Boolean {
        return tag.exceptionData.size >= (config.changeRate[factorType]?.countLimit ?: 1)
        return tag.exceptionData.size >= (changeRate[factorType]?.countLimit ?: 1)
    }
    override fun needCut(tag: ExceptionTag, hasException: Boolean?): Boolean {
@@ -97,7 +113,7 @@
    }
    override fun newResult(tag: ExceptionTag, factor: FactorFilter.SelectedFactor): PollutedClue {
        return PollutedClue(tag, factor, getExceptionType(), config, config.changeRate[factor.main])
        return PollutedClue(tag, factor, getExceptionType(), config, changeRate[factor.main])
    }
    override fun onNewException(