| | |
| | | package com.flightfeather.uav.socket.processor |
| | | |
| | | import com.flightfeather.uav.biz.FactorFilter |
| | | import com.flightfeather.uav.biz.sourcetrace.RealTimeExceptionAnalysisController |
| | | import com.flightfeather.uav.common.location.LocationRoadNearby |
| | | import com.flightfeather.uav.biz.sourcetrace.SourceTraceController |
| | | import com.flightfeather.uav.domain.entity.BaseRealTimeData |
| | | 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 |
| | | import com.flightfeather.uav.socket.decoder.DataPackageDecoder |
| | | import com.flightfeather.uav.socket.eunm.AirCommandUnit |
| | | import com.flightfeather.uav.socket.eunm.FactorType |
| | | import com.flightfeather.uav.socket.eunm.UWDeviceType |
| | | import com.flightfeather.uav.socket.handler.UnderwayWebSocketServerHandler |
| | | import io.netty.channel.ChannelHandlerContext |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Component |
| | | import java.text.SimpleDateFormat |
| | | import java.util.* |
| | | import javax.annotation.PostConstruct |
| | | |
| | | /** |
| | | * 处理socket接收的消息 |
| | |
| | | private val dataProcessMap = mutableMapOf<String?, EPWDataPrep>() |
| | | |
| | | // 实时走航污染溯源处理器 |
| | | private val realTimeExceptionAnalysisMap = mutableMapOf<String?, RealTimeExceptionAnalysisController>() |
| | | private val sourceTraceMap = mutableMapOf<String?, SourceTraceController>() |
| | | |
| | | override var tag: String = "走航监测" |
| | | |
| | |
| | | saveToTxt(msg) |
| | | saveToDataBase(packageData)?.takeIf { it.isNotEmpty() }?.get(0)?.let { |
| | | // 每台设备有各自单独的异常数据处理器 |
| | | if (!realTimeExceptionAnalysisMap.containsKey(it.deviceCode)) { |
| | | realTimeExceptionAnalysisMap[it.deviceCode] = RealTimeExceptionAnalysisController(sceneInfoRep) |
| | | if (!sourceTraceMap.containsKey(it.deviceCode)) { |
| | | sourceTraceMap[it.deviceCode] = SourceTraceController(sceneInfoRep) |
| | | } |
| | | // 将走航数据传入异常处理器 |
| | | realTimeExceptionAnalysisMap[it.deviceCode]?.addOneData(it) |
| | | sourceTraceMap[it.deviceCode]?.addOneData(it) |
| | | } |
| | | |
| | | } else { |