feiyu02
23 小时以前 8eb584869b4fd4de0f51c93f2616f12e51df9193
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/model/PollutedClue.kt
@@ -18,42 +18,24 @@
 * @date 2025/5/27
 * @author feiyu02
 */
class PollutedClue() : BaseExceptionResult(){
//    constructor(
//        start: BaseRealTimeData,
//        end: BaseRealTimeData?,
//        factor: FactorFilter.SelectedFactor,
//        exceptionData: List<BaseRealTimeData>,
//        eType: ExceptionType,
//        config: RTExcWindLevelConfig,
//        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
//    ) : this() {
//        if (exceptionData.isEmpty()) return
//        pollutedData = PollutedData(start, end, factor, exceptionData, eType, windLevelCondition)
//        pollutedArea = PollutedArea(exceptionData, config, windLevelCondition)
//    }
class PollutedClue() : BaseExceptionResult() {
    constructor(
        tag: ExceptionTag, factor: FactorFilter.SelectedFactor, eType: ExceptionType, config: RTExcWindLevelConfig,
        exceptions: List<Pair<FactorFilter.SelectedFactor, ExceptionTag>>,
        eType: ExceptionType,
        config: RTExcWindLevelConfig,
        windLevelCondition: RTExcWindLevelConfig.WindLevelCondition?,
    ) : this()
//            this(
//        tag.startData!!, tag.endData, factor, tag.exceptionData, eType, config,
//        windLevelCondition
//    )
    {
        if (tag.exceptionData.isEmpty()) return
        deviceCode = tag.startData?.deviceCode
        pollutedData = PollutedData(
            tag.startData!!, tag.endData, factor, tag.exceptionData, tag.historyData, eType, windLevelCondition
        )
        pollutedArea = PollutedArea(tag.historyData, tag.exceptionData, config, windLevelCondition)
    }
    ) : this() {
        if (exceptions.isEmpty() || exceptions[0].second.exceptionData.isEmpty()) return
        deviceCode = exceptions[0].second.startData?.deviceCode
    /**
     * 6. 展示数据变化情况,上升速率等等
     */
        // 获取去重后的监测因子类型
        val factorList = exceptions.map { it.first }.distinct()
        pollutedData = PollutedData(exceptions, eType)
        pollutedArea = PollutedArea(pollutedData!!, config, windLevelCondition)
    }
    /**
     * @see [MsgType]