Merge branch 'demo' of http://s16s652780.51mypc.cn:49896/r/yskj/iot_drone_web into demo
| | |
| | | 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 |
| | | } |
| | |
| | | DrcStatusNotify = 'drc_status_notify', // 飞行控制模式状态 |
| | | } |
| | | |
| | | export const EBizCodeMessage = { |
| | | [EBizCode.DeviceOnline]:"设备在线", |
| | | [EBizCode.DeviceOffline]:"设备离线", |
| | | |
| | | [EBizCode.DeviceOsd]:"设备osd", |
| | | [EBizCode.GatewayOsd]:"网关osd", |
| | | [EBizCode.DockOsd]:"机场osd", |
| | | |
| | | [EBizCode.MapElementCreate]:"地图元素创建", |
| | | [EBizCode.MapElementUpdate]:"地图元素更新", |
| | | [EBizCode.MapElementDelete]:"地图元素删除", |
| | | |
| | | [EBizCode.FlightTaskProgress]:"机场任务执行进度", |
| | | |
| | | [EBizCode.DeviceHms]:"设备hms", |
| | | [EBizCode.DeviceReboot]:"设备重启", |
| | | [EBizCode.DroneOpen]:"机场打开", |
| | | [EBizCode.DroneClose]:"机场关闭", |
| | | |
| | | [EBizCode.PutterOpen]:"推杆展开", |
| | | [EBizCode.PutterClose]:"推杆闭合", |
| | | |
| | | [EBizCode.ChargeOpen]:"打开充电", |
| | | [EBizCode.ChargeClose]:"关闭充电", |
| | | |
| | | [EBizCode.ControlSourceChange]:"控制权更新", |
| | | [EBizCode.FlyToPointProgress]:"飞向目标点", |
| | | [EBizCode.TakeoffToPointProgress] : "一键起飞", |
| | | [EBizCode.DrcStatusNotify ]: "飞行控制模式状态", |
| | | [EBizCode.JoystickInvalidNotify]:"设备端退出drc模式", |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | export enum EDeviceTypeName { |
| | | Aircraft = 0, |
| | | Gateway = 2, |