| | |
| | | |
| | | import cn.hutool.core.util.SerializeUtil; |
| | | import com.ard.common.utils.DateUtils; |
| | | |
| | | import com.ard.work.domain.cache.UavStateCache; |
| | | import com.ard.work.domain.cache.UavTelemetryDataCache; |
| | | import com.ard.work.domain.cache.UavWaylineCache; |
| | | import com.ard.work.domain.dto.UavFlightStateDTO; |
| | | import com.ard.work.domain.dto.state.UavState; |
| | | import com.ard.work.domain.dto.telemetry.TelemetryData; |
| | |
| | | log.debug("设备 {} 当前状态为:{}", boxSn, currentStatus); |
| | | // 只有飞行中才添加缓存 |
| | | if (currentStatus == 2) { |
| | | log.warn("设备 {} 当前状态为飞行中,添加遥测数据到缓存", boxSn); |
| | | int flightMode = telemetryData.getFlightMode(); |
| | | if (flightMode != 14) { |
| | | // 非航线模式 → 清理航线缓存,避免手动飞行被错绑 routeId |
| | | UavWaylineCache.remove(boxSn); |
| | | } |
| | | UavFlightStateDTO dto = new UavFlightStateDTO(uavState, telemetryData, dataTs); |
| | | addTelemetryData(dto); |
| | | } |