| | |
| | | let genPortOne = true //是一代机场 |
| | | const mqttHooks = useMqtt(mqttState,deviceTopicInfo) |
| | | let seq = 0 |
| | | let throttledPtz = null |
| | | |
| | | function handlePublish(params) { |
| | | const body = { |
| | |
| | | activeCodeKey.value = keyCode |
| | | break |
| | | case 'ArrowUp': |
| | | ptzThrottle[0]() |
| | | if (activeCodeKey.value === keyCode) return |
| | | myInterval = setInterval(()=>ptzControl('up'), 50) |
| | | activeCodeKey.value = keyCode |
| | | break |
| | | case 'ArrowDown': |
| | | ptzThrottle[1]() |
| | | if (activeCodeKey.value === keyCode) return |
| | | myInterval = setInterval(()=>ptzControl('down'), 50) |
| | | activeCodeKey.value = keyCode |
| | | break |
| | | case 'ArrowLeft': |
| | | ptzThrottle[2]() |
| | | if (activeCodeKey.value === keyCode) return |
| | | myInterval = setInterval(()=>ptzControl('left'), 50) |
| | | activeCodeKey.value = keyCode |
| | | break |
| | | case 'ArrowRight': |
| | | ptzThrottle[3]() |
| | | if (activeCodeKey.value === keyCode) return |
| | | myInterval = setInterval(()=>ptzControl('right'), 50) |
| | | activeCodeKey.value = keyCode |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | } |
| | | |
| | | // 云台控制节流list |
| | | const ptzThrottle = ['up','down','left','right'].map(key => throttle(()=>ptzControl(key), 500)) |
| | | |
| | | // 云台上下左右 |
| | | function ptzControl(key) { |