| | |
| | | import com.ard.tianyu.model.dto.converter.UavTelemetryDataConverter; |
| | | import com.ard.tianyu.model.dto.converter.wayline.PlanLineDataConverter; |
| | | import com.ard.tianyu.model.dto.manual.*; |
| | | import com.ard.tianyu.model.dto.settings.ReturnHeightSettingDTO; |
| | | import com.ard.tianyu.model.dto.settings.ReturnPointSettingDTO; |
| | | import com.ard.tianyu.model.dto.settings.VideoStreamSettingDTO; |
| | | import com.ard.tianyu.model.dto.signal.SignalInfo; |
| | | import com.ard.tianyu.model.dto.speaker.*; |
| | | import com.ard.tianyu.model.dto.state.UavState; |
| | |
| | | import com.ard.tianyu.netty.command.real.UavStateCmd; |
| | | import com.ard.tianyu.netty.command.real.UavTelemetryDataCmd; |
| | | import com.ard.tianyu.netty.command.register.*; |
| | | import com.ard.tianyu.netty.command.settings.*; |
| | | import com.ard.tianyu.netty.command.speaker.*; |
| | | import com.ard.tianyu.netty.command.wayline.*; |
| | | import com.ard.tianyu.netty.handler.ErrorCodeEnum; |
| | |
| | | public Boolean updateBoxSettings(BoxSettingsDTO boxSettingsDTO) { |
| | | TyHttpCommonReceiver<?> result = tyClient.updateBoxSettings(boxSettingsDTO, tyConfiguration.getAccessToken().convertFromDTO()); |
| | | return result.getState() == 1; |
| | | } |
| | | |
| | | /** |
| | | * 设置返航高度 |
| | | */ |
| | | @Override |
| | | public void updateReturnHeight(ReturnHeightSettingDTO returnHeightSettingDTO) { |
| | | ReturnHeightSettingCmd returnHeightSettingCmd = new ReturnHeightSettingCmd(returnHeightSettingDTO); |
| | | this.sendMessage(tyConfiguration.getIpPort(), returnHeightSettingCmd); |
| | | } |
| | | |
| | | /** |
| | | * 设置返航点 |
| | | */ |
| | | @Override |
| | | public void updateReturnPoint(ReturnPointSettingDTO returnPointSettingDTO) { |
| | | ReturnPointSettingCmd returnPointSettingCmd = new ReturnPointSettingCmd(returnPointSettingDTO); |
| | | this.sendMessage(tyConfiguration.getIpPort(), returnPointSettingCmd); |
| | | } |
| | | |
| | | /** |
| | | * 设置视频码流 |
| | | */ |
| | | @Override |
| | | public void updateVideoStream(VideoStreamSettingDTO videoStreamSettingDTO) { |
| | | VideoStreamSettingCmd videoStreamSettingCmd = new VideoStreamSettingCmd(videoStreamSettingDTO); |
| | | this.sendMessage(tyConfiguration.getIpPort(), videoStreamSettingCmd); |
| | | } |
| | | |
| | | /** |
| | |
| | | WayLineUploadReplyCmd wayLineUploadReplyCmd = (WayLineUploadReplyCmd) tyCommand; |
| | | logPrint("上传航线", wayLineUploadReplyCmd.getResult(), wayLineUploadReplyCmd.getErrorCode()); |
| | | } |
| | | //开始航线回复 |
| | | if (tyCommand instanceof WayLineBeginReplyCmd) { |
| | | WayLineBeginReplyCmd wayLineBeginReplyCmd = (WayLineBeginReplyCmd) tyCommand; |
| | | logPrint("开始航线", wayLineBeginReplyCmd.getResult(), wayLineBeginReplyCmd.getErrorCode()); |
| | | } |
| | | //暂停航线回复 |
| | | if (tyCommand instanceof WayLinePauseReplyCmd) { |
| | | WayLinePauseReplyCmd wayLinePauseReplyCmd = (WayLinePauseReplyCmd) tyCommand; |
| | | logPrint("暂停航线", wayLinePauseReplyCmd.getResult(), wayLinePauseReplyCmd.getErrorCode()); |
| | | } |
| | | //恢复航线回复 |
| | | if (tyCommand instanceof WayLineResumeReplyCmd) { |
| | | WayLineResumeReplyCmd wayLineResumeReplyCmd = (WayLineResumeReplyCmd) tyCommand; |
| | | logPrint("恢复航线", wayLineResumeReplyCmd.getResult(), wayLineResumeReplyCmd.getErrorCode()); |
| | | } |
| | | //结束航线回复 |
| | | if (tyCommand instanceof WayLineEndReplyCmd) { |
| | | WayLineEndReplyCmd wayLineEndReplyCmd = (WayLineEndReplyCmd) tyCommand; |
| | | logPrint("结束航线", wayLineEndReplyCmd.getResult(), wayLineEndReplyCmd.getErrorCode()); |
| | | } |
| | | //设置返航高度回复 |
| | | if (tyCommand instanceof ReturnHeightSettingReplyCmd) { |
| | | ReturnHeightSettingReplyCmd returnHeightSettingReplyCmd = (ReturnHeightSettingReplyCmd) tyCommand; |
| | | logPrint("设置返航高度", returnHeightSettingReplyCmd.getResult(), returnHeightSettingReplyCmd.getErrorCode()); |
| | | } |
| | | //设置返航点回复 |
| | | if (tyCommand instanceof ReturnPointSettingReplyCmd) { |
| | | ReturnPointSettingReplyCmd returnPointSettingReplyCmd = (ReturnPointSettingReplyCmd) tyCommand; |
| | | logPrint("设置返航点", returnPointSettingReplyCmd.getResult(), returnPointSettingReplyCmd.getErrorCode()); |
| | | } |
| | | break; |
| | | case (byte) 0xD2: |
| | | //设置视频码流回复 |
| | | if (tyCommand instanceof VideoStreamSettingReplyCmd) { |
| | | VideoStreamSettingReplyCmd videoStreamSettingReplyCmd = (VideoStreamSettingReplyCmd) tyCommand; |
| | | logPrint("设置视频码流", videoStreamSettingReplyCmd.getResult(), videoStreamSettingReplyCmd.getErrorCode()); |
| | | } |
| | | break; |
| | | default: |
| | | // 处理其他消息 |