| | |
| | | import { message, notification } from 'ant-design-vue' |
| | | import { ref, onMounted, onBeforeUnmount } from 'vue' |
| | | import {message, notification} from 'ant-design-vue' |
| | | import {onBeforeUnmount, onMounted, ref} from 'vue' |
| | | import EventBus from '/@/event-bus/' |
| | | import { EBizCode } from '/@/types' |
| | | import { ControlSource } from '/@/types/device' |
| | | import { ControlSourceChangeType, ControlSourceChangeInfo, FlyToPointMessage, TakeoffToPointMessage, DrcModeExitNotifyMessage, DrcStatusNotifyMessage } from '/@/types/drone-control' |
| | | import {EBizCode, EBizCodeMessage} from '/@/types' |
| | | import {ControlSource} from '/@/types/device' |
| | | import { |
| | | ControlSourceChangeInfo, |
| | | ControlSourceChangeType, |
| | | DrcModeExitNotifyMessage, |
| | | DrcStatusNotifyMessage, |
| | | FlyToPointMessage, |
| | | TakeoffToPointMessage |
| | | } from '/@/types/drone-control' |
| | | |
| | | export interface UseDroneControlWsEventParams { |
| | | } |
| | |
| | | case EBizCode.FlyToPointProgress: { |
| | | const { sn: deviceSn, result, message: msg } = payload.data as FlyToPointMessage |
| | | if (deviceSn !== sn) return |
| | | handleProgress(EBizCode.FlyToPointProgress, `设备(编码: ${deviceSn}) ${msg}`, result) |
| | | handleProgress(EBizCodeMessage[EBizCode.FlyToPointProgress], `设备(编码: ${deviceSn}) ${msg}`, result) |
| | | break |
| | | } |
| | | case EBizCode.TakeoffToPointProgress: { |
| | | const { sn: deviceSn, result, message: msg } = payload.data as TakeoffToPointMessage |
| | | if (deviceSn !== sn) return |
| | | handleProgress(EBizCode.TakeoffToPointProgress, `设备(编码: ${deviceSn}) ${msg}`, result) |
| | | handleProgress(EBizCodeMessage[EBizCode.TakeoffToPointProgress], `设备(编码: ${deviceSn}) ${msg}`, result) |
| | | break |
| | | } |
| | | case EBizCode.JoystickInvalidNotify: { |
| | | const { sn: deviceSn, result, message: msg } = payload.data as DrcModeExitNotifyMessage |
| | | if (deviceSn !== sn) return |
| | | handleProgress(EBizCode.JoystickInvalidNotify, `设备(编码: ${deviceSn}) ${msg}`, result) |
| | | handleProgress(EBizCodeMessage[EBizCode.JoystickInvalidNotify], `设备(编码: ${deviceSn}) ${msg}`, result) |
| | | break |
| | | } |
| | | case EBizCode.DrcStatusNotify: { |
| | | const { sn: deviceSn, result, message: msg } = payload.data as DrcStatusNotifyMessage |
| | | // handleProgress(EBizCode.DrcStatusNotify, `device(sn: ${deviceSn}) ${msg}`, result) |
| | | // handleProgress(EBizCodeMessage[EBizCode.DrcStatusNotify], `device(sn: ${deviceSn}) ${msg}`, result) |
| | | |
| | | break |
| | | } |