| | |
| | | import com.ard.work.domain.dto.BoxHistoryDTO; |
| | | import com.ard.work.domain.dto.BoxPhotosDTO; |
| | | import com.ard.work.domain.dto.BoxSettingsDTO; |
| | | import com.ard.work.domain.dto.BoxVideosDTO; |
| | | import com.ard.work.domain.dto.camera.*; |
| | | import com.ard.work.domain.dto.control.AbsAngleControlDTO; |
| | | import com.ard.work.domain.dto.control.AngleControlDTO; |
| | |
| | | import com.ard.work.domain.message.UavControlType; |
| | | import com.ard.work.domain.receiver.*; |
| | | import com.ard.work.service.IArdDroneInfoService; |
| | | import com.ard.work.service.IArdFlightTaskPartService; |
| | | import com.ard.work.service.IArdServerInfoService; |
| | | import com.ard.work.service.ITyService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | |
| | | private TyClient tyClient; |
| | | @Autowired |
| | | private RouteStateMachineService stateMachineService; |
| | | @Autowired |
| | | private IArdFlightTaskPartService ardFlightTaskPartService; |
| | | |
| | | /** |
| | | * 获取边缘服务器token信息 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取盒子图片 |
| | | * 获取任务图片 |
| | | * |
| | | * @return List<BoxPhotosReceiver> |
| | | */ |
| | |
| | | boxPhotosDTO); |
| | | return boxPhotos == null ? null : boxPhotos.getContent(); |
| | | } |
| | | |
| | | /** |
| | | * 获取任务视频 |
| | | * |
| | | * @return List<BoxVideosReceiver> |
| | | */ |
| | | @Override |
| | | public List<BoxVideosReceiver> getBoxVideos(BoxVideosDTO boxVideosDTO) { |
| | | String boxSn = boxVideosDTO.getBoxSn(); |
| | | ArdDroneInfo ardDroneInfo = ardDroneService.selectArdDroneByboxSn(boxSn); |
| | | if (ardDroneInfo == null) { |
| | | throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn); |
| | | } |
| | | TyHttpCommonReceiver<List<BoxVideosReceiver>> boxVideos = tyClient.getBoxVideos(ardDroneInfo.getServerId(), |
| | | boxVideosDTO); |
| | | return boxVideos == null ? null : boxVideos.getContent(); |
| | | } |
| | | /** |
| | | * 修改云盒设置 |
| | | */ |
| | |
| | | throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn); |
| | | } |
| | | //设置相机模式为拍照模式 |
| | | updateCameraMode(CameraModeDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build()); |
| | | //updateCameraMode(CameraModeDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build()); |
| | | //设置拍照回传 |
| | | photoReturnToggle(PhotoReturnToggleDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build()); |
| | | //photoReturnToggle(PhotoReturnToggleDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01) |
| | | // .build()); |
| | | |
| | | CapturePicCmd capturePicCommand = new CapturePicCmd(capturePicDto); |
| | | this.sendMessage(ardDroneInfo.getServerId(), capturePicCommand); |
| | |
| | | } |
| | | BaseCmd baseCmd; |
| | | if (recordDto.getIsRecord()) { |
| | | updateCameraMode(CameraModeDTO.builder().boxSn(recordDto.getBoxSn()).actionParam((byte) 0x02).build()); |
| | | //updateCameraMode(CameraModeDTO.builder().boxSn(recordDto.getBoxSn()).actionParam((byte) 0x02).build()); |
| | | baseCmd = new RecordStartCmd(recordDto); |
| | | } else { |
| | | baseCmd = new RecordStopCmd(recordDto); |
| | |
| | | if (ardDroneInfo == null) { |
| | | throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn); |
| | | } |
| | | //打点之前先停止打点 |
| | | FlyPointControlCancelCmd flyPointControlCancelCmd = new FlyPointControlCancelCmd(FlyPointControlCancelDTO.builder().boxSn(boxSn).build()); |
| | | this.sendMessage(ardDroneInfo.getServerId(), flyPointControlCancelCmd); |
| | | |
| | | FlyPointControlCmd flyPointControlCmd = new FlyPointControlCmd(flyPointControlDTO); |
| | | this.sendMessage(ardDroneInfo.getServerId(), flyPointControlCmd); |
| | | return true; |
| | |
| | | case (byte) 0xA9: |
| | | // 处理无人机遥测消息 |
| | | UavTelemetryDataCmd uavTelemetryDataCmd = (UavTelemetryDataCmd) tyCommand; |
| | | UavTelemetryDataCache.put(uavTelemetryDataCmd.getTelemetryData()); |
| | | TelemetryData telemetryData = uavTelemetryDataCmd.getTelemetryData(); |
| | | //telemetryData.setTimestamp(System.currentTimeMillis());//由于六合提供的状态时间戳不准,先以接收状态作为时间戳 |
| | | UavTelemetryDataCache.put(telemetryData); |
| | | //logPrint("无人机遥测", uavTelemetryDataCmd.getTelemetryData().getBoxSn()); |
| | | //WebSocketUtil.sendMessageAll(uavTelemetryDataCmd.getTelemetryData()); |
| | | break; |