| | |
| | | this.sceneInfoRep = sceneInfoRep |
| | | this.sourceTraceRep = sourceTraceRep |
| | | this.config = if (factorFilter != null) { |
| | | RTExcWindLevelConfig(factorFilter, emptyList()) |
| | | RTExcWindLevelConfig(factorFilter) |
| | | } else { |
| | | RTExcWindLevelConfig( |
| | | FactorFilter.builder() |
| | |
| | | .withMain(FactorType.PM25) |
| | | .withMain(FactorType.PM10) |
| | | .withMain(FactorType.VOC) |
| | | .create(), |
| | | .withCombination( |
| | | listOf( |
| | | listOf(FactorType.PM25, FactorType.PM10), |
| | | listOf(FactorType.VOC, FactorType.CO), |
| | | ) |
| | | ) |
| | | .create() |
| | | ) |
| | | } |
| | | pollutedSummary = PollutedSummary(config) { summaryCallback(it) } |
| | |
| | | } |
| | | |
| | | // 数据突变异常回调 |
| | | private fun exceptionCallback(ex: List<PollutedClue>) { |
| | | ex.forEach { |
| | | private fun exceptionCallback(ex: PollutedClue) { |
| | | // 溯源污染源信息 |
| | | it.searchScenes(sceneInfoRep) |
| | | it.msgType = MsgType.PolClue.value |
| | | } |
| | | ex.searchScenes(sceneInfoRep) |
| | | ex.msgType = MsgType.PolClue.value |
| | | |
| | | // 广播污染溯源异常结果 |
| | | UnderwayWebSocketSender.broadcast(MsgType.PolClue.value, ex) |
| | | sourceTraceRep.insertList(MsgType.PolClue, ex) |
| | | sourceTraceRep.insert(MsgType.PolClue, ex) |
| | | |
| | | // 记录污染线索 |
| | | pollutedSummary.addClueList(ex) |
| | | pollutedSummary.addClue(ex) |
| | | } |
| | | |
| | | // 数据变化提醒回调 |
| | | private fun dataChangeCallback(ex: List<PollutedClue>) { |
| | | ex.forEach { |
| | | private fun dataChangeCallback(ex: PollutedClue) { |
| | | // 溯源污染源信息 |
| | | it.searchScenes(sceneInfoRep) |
| | | it.msgType = MsgType.DataChange.value |
| | | } |
| | | ex.searchScenes(sceneInfoRep) |
| | | ex.msgType = MsgType.DataChange.value |
| | | |
| | | // 广播数据变化提醒 |
| | | UnderwayWebSocketSender.broadcast(MsgType.DataChange.value, ex) |
| | | sourceTraceRep.insertList(MsgType.DataChange, ex) |
| | | sourceTraceRep.insert(MsgType.DataChange, ex) |
| | | } |
| | | |
| | | private fun summaryCallback(ex: AnalysisResult) { |