| | |
| | | const store = useMyStore() |
| | | |
| | | export function useDroneControlWsEvent (sn: string, payloadSn: string, funcs?: UseDroneControlWsEventParams) { |
| | | const droneControlSource = ref('') |
| | | const droneControlSource = ref(ControlSource.A) |
| | | const payloadControlSource = ref(ControlSource.B) |
| | | function onControlSourceChange (data: ControlSourceChangeInfo) { |
| | | if (data.type === ControlSourceChangeType.Flight && data.sn === sn) { |
| | | droneControlSource.value = data.control_source |
| | | store.commit('SET_DRONE_CONTROL_SOURCE', droneControlSource.value) |
| | | // message.info(`飞行控制改为 ${droneControlSource.value}`) |
| | | message.info(`飞行控制改为 ${droneControlSource.value}`) |
| | | return |
| | | } |
| | | if (data.type === ControlSourceChangeType.Payload && data.sn === payloadSn) { |