xieb
2023-10-17 e60ea14897e4512efe505b8b3aea7cb2e49df39f
src/main/java/com/dji/sample/control/service/impl/DrcServiceImpl.java
@@ -63,10 +63,10 @@
    @Autowired
    private IDeviceService deviceService;
    @Autowired
    private ObjectMapper mapper;
    @Autowired
    private ISendMessageService webSocketMessageService;
@@ -130,10 +130,10 @@
        if (dockOpt.isPresent() && (DockModeCodeEnum.IDLE == dockMode || DockModeCodeEnum.WORKING == dockMode)) {
            Optional<OsdSubDeviceReceiver> deviceOsd = deviceRedisService.getDeviceOsd(dockOpt.get().getChildDeviceSn(), OsdSubDeviceReceiver.class);
            if (deviceOsd.isEmpty() || deviceOsd.get().getElevation() <= 0) {
                throw new RuntimeException("The drone is not in the sky and cannot enter command flight mode.");
                throw new RuntimeException("无人机不在空中,不能进入指挥飞行模式。");
            }
        } else {
            throw new RuntimeException("The current state of the dock does not support entering command flight mode.");
            throw new RuntimeException("当前状态不支持进入命令飞行模式。");
        }
        ResponseResult result = controlService.seizeAuthority(dockSn, DroneAuthorityEnum.FLIGHT, null);
@@ -170,7 +170,7 @@
                    .build());
        if (ResponseResult.CODE_SUCCESS != reply.getResult()) {
            throw new RuntimeException("SN: " + param.getDockSn() + "; Error Code:" + reply.getResult() + "; Failed to enter command flight control mode, please try again later!");
            throw new RuntimeException("SN: " + param.getDockSn() + "; Error Code:" + reply.getResult() + "; 进入命令飞行控制模式失败,请稍后再试!");
        }
        refreshAcl(param.getDockSn(), param.getClientId(), pubTopic, subTopic);
@@ -190,13 +190,13 @@
    @Override
    public void deviceDrcExit(String workspaceId, DrcModeParam param) {
        if (!deviceService.checkDockDrcMode(param.getDockSn())) {
            throw new RuntimeException("The dock is not in flight control mode.");
            throw new RuntimeException("机场没有进入飞行控制模式");
        }
        ServiceReply reply = messageSenderService.publishServicesTopic(
                param.getDockSn(), DrcMethodEnum.DRC_MODE_EXIT.getMethod(), "");
        if (ResponseResult.CODE_SUCCESS != reply.getResult()) {
            throw new RuntimeException("SN: " + param.getDockSn() + "; Error Code:" +
                    reply.getResult() + "; Failed to exit command flight control mode, please try again later!");
                    reply.getResult() + "; 命令飞行控制模式退出失败,请稍后再试!");
        }
        String jobId = waylineRedisService.getPausedWaylineJobId(param.getDockSn());