| | |
| | | import com.flightfeather.uav.model.epw.EPWDataPrep |
| | | import com.flightfeather.uav.domain.repository.AirDataRep |
| | | import com.flightfeather.uav.domain.repository.RealTimeDataRep |
| | | import com.flightfeather.uav.domain.repository.SceneInfoRep |
| | | import com.flightfeather.uav.domain.repository.SegmentInfoRep |
| | | import com.flightfeather.uav.socket.bean.AirDataPackage |
| | | import com.flightfeather.uav.socket.decoder.AirDataDecoder |
| | |
| | | @Component |
| | | class UnderwayProcessor( |
| | | private val airDataRep: AirDataRep, |
| | | private val realTimeDataRep: RealTimeDataRep, |
| | | private val locationRoadNearby: LocationRoadNearby, |
| | | private val segmentInfoRep: SegmentInfoRep, |
| | | private val underwayWebSocketServerHandler: UnderwayWebSocketServerHandler, |
| | | private val sceneInfoRep: SceneInfoRep, |
| | | ) : BaseProcessor() { |
| | | |
| | | companion object { |
| | |
| | | private val dataProcessMap = mutableMapOf<String?, EPWDataPrep>() |
| | | |
| | | // 实时走航污染溯源处理器 |
| | | private val realTimeExceptionAnalysisController = |
| | | RealTimeExceptionAnalysisController( |
| | | realTimeDataRep, |
| | | locationRoadNearby, |
| | | segmentInfoRep, |
| | | underwayWebSocketServerHandler, |
| | | FactorFilter.builder() |
| | | // .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() |
| | | ) |
| | | private val realTimeExceptionAnalysisMap = mutableMapOf<String?, RealTimeExceptionAnalysisController>() |
| | | |
| | | override var tag: String = "走航监测" |
| | | |
| | |
| | | deviceSession.saveDevice(packageData.deviceCode, ctx) |
| | | saveToTxt(msg) |
| | | saveToDataBase(packageData)?.takeIf { it.isNotEmpty() }?.get(0)?.let { |
| | | // 每台设备有各自单独的异常数据处理器 |
| | | if (!realTimeExceptionAnalysisMap.containsKey(it.deviceCode)) { |
| | | realTimeExceptionAnalysisMap[it.deviceCode] = RealTimeExceptionAnalysisController(sceneInfoRep) |
| | | } |
| | | // 将走航数据传入异常处理器 |
| | | realTimeExceptionAnalysisController.addOneData(it) |
| | | realTimeExceptionAnalysisMap[it.deviceCode]?.addOneData(it) |
| | | } |
| | | |
| | | } else { |