| | |
| | | } else { |
| | | RTExcWindLevelConfig( |
| | | FactorFilter.builder() |
| | | // .withMain(FactorType.NO2) |
| | | // .withMain(FactorType.CO) |
| | | .withMain(FactorType.NO2) |
| | | .withMain(FactorType.CO) |
| | | // .withMain(FactorType.H2S) |
| | | // .withMain(FactorType.SO2) |
| | | // .withMain(FactorType.O3) |
| | | .withMain(FactorType.O3) |
| | | .withMain(FactorType.PM25) |
| | | .withMain(FactorType.PM10) |
| | | .withMain(FactorType.VOC) |
| | | // .withMain(FactorType.VOC) |
| | | .withCombination( |
| | | listOf( |
| | | listOf(FactorType.PM25, FactorType.PM10), |
| | | listOf(FactorType.VOC, FactorType.CO), |
| | | ) |
| | | ) |
| | | .create() |
| | | ) |
| | | } |
| | |
| | | private val sceneInfoRep: SceneInfoRep |
| | | private val sourceTraceRep: SourceTraceRep |
| | | private val config: RTExcWindLevelConfig |
| | | private val timer = Timer() |
| | | private var timerTask: TimerTask? = null |
| | | |
| | | private val taskList = mutableListOf<BaseExceptionAnalysis<RTExcWindLevelConfig, PollutedClue>>() |
| | | |
| | |
| | | * 计算新的一条实时走航数据 |
| | | */ |
| | | fun addOneData(data: BaseRealTimeData) { |
| | | // println("====================>") |
| | | // 计算异常 |
| | | taskList.forEach { it.onNextData(data) } |
| | | pollutedSummary.refreshLatestMonitorData(data) |
| | | // 限定时间内没有新数据传入,则结束当前的计算 |
| | | dealOnTimeout() |
| | | } |
| | | |
| | | /** |
| | | * 超时处理,较长时间没有新数据进入,进行初始化操作 |
| | | */ |
| | | private fun dealOnTimeout() { |
| | | val timer = Timer(true) |
| | | timer.schedule(object : TimerTask() { |
| | | // val timer = Timer() |
| | | timerTask?.cancel() |
| | | timer.purge() |
| | | timerTask = object : TimerTask() { |
| | | override fun run() { |
| | | TODO("Not yet implemented") |
| | | initTask() |
| | | } |
| | | }, 60 * 1000) |
| | | timer.cancel() |
| | | } |
| | | timer.schedule(timerTask, 2 * 60 * 60 * 1000) |
| | | } |
| | | |
| | | // 数据突变异常回调 |