feiyu02
2025-07-03 c56e1e74426238939f229f0005828d05089715ff
src/main/kotlin/com/flightfeather/uav/biz/sourcetrace/SourceTraceController.kt
@@ -35,23 +35,23 @@
        else
            RTExcWindLevelConfig(
                FactorFilter.builder()
//                .withMain(FactorType.NO2)
                    .withMain(FactorType.CO)
//                .withMain(FactorType.H2S)
//                .withMain(FactorType.SO2)
//                .withMain(FactorType.O3)
//                    .withMain(FactorType.NO2)
//                    .withMain(FactorType.CO)
//                    .withMain(FactorType.H2S)
//                    .withMain(FactorType.SO2)
//                    .withMain(FactorType.O3)
                    .withMain(FactorType.PM25)
                    .withMain(FactorType.PM10)
                    .withMain(FactorType.VOC)
                    .create()
            )
        pollutedSummary = PollutedSummary(config){ summaryCallback(it)}
        pollutedSummary = PollutedSummary(config) { summaryCallback(it) }
        newTask()
    }
    constructor(sceneInfoRep: SceneInfoRep) : this(sceneInfoRep, null)
    private val pollutedSummary:PollutedSummary
    private val pollutedSummary: PollutedSummary
    private val sceneInfoRep: SceneInfoRep
@@ -71,6 +71,8 @@
            add(RTExcWindLevel1_1(config) { exceptionCallback(it) }.also { it.init() })
            add(RTExcWindLevel4(config) { exceptionCallback(it) }.also { it.init() })
            add(RTExcWindLevel6(config) { exceptionCallback(it) }.also { it.init() })
            add(RTExcChangeRate(config) { exceptionCallback(it) }.also { it.init() })
            add(RTWarnChangeRate(config) { dataChangeCallback(it) }.also { it.init() })
        }
    }
@@ -102,11 +104,20 @@
        // 溯源污染源信息
        ex.searchScenes(sceneInfoRep)
        // 记录污染线索
        pollutedSummary.addClue(ex)
        // 广播污染溯源异常结果
        UnderwayWebSocketSender.broadcast(MsgType.PolClue.value, ex)
        // 记录污染线索
        pollutedSummary.addClue(ex)
    }
    // 数据变化提醒回调
    private fun dataChangeCallback(ex: PollutedClue) {
        // 溯源污染源信息
        ex.searchScenes(sceneInfoRep)
        // 广播数据变化提醒
        UnderwayWebSocketSender.broadcast(MsgType.DataChange.value, ex)
    }
    private fun summaryCallback(ex: PollutedSummary.AnalysisResult) {