Browse Source

相机状态判断

master
maochaoying 2 years ago
parent
commit
153f2ce4e2
  1. 2
      src/components/Debug.vue
  2. 8
      src/pages/index.vue

2
src/components/Debug.vue

@ -272,10 +272,12 @@ const websocketonmessage = e => {
const websocketonopen = () => { const websocketonopen = () => {
console.log('客户端链接成功!!!') console.log('客户端链接成功!!!')
handleGetCameraState() handleGetCameraState()
setTimeout(() => {
websocketsend(getCameraParametersInteger) websocketsend(getCameraParametersInteger)
// //
handleCloseFlashLight() handleCloseFlashLight()
websocketsend(getFlashBrightnessAnalog) websocketsend(getFlashBrightnessAnalog)
}, 1000)
} }
const websocketonerror = () => { const websocketonerror = () => {

8
src/pages/index.vue

@ -536,14 +536,22 @@ const check = async () => {
if (isCameraOpen.value) { if (isCameraOpen.value) {
websocketsend(getCharacterRecognitionResult) websocketsend(getCharacterRecognitionResult)
} else { } else {
setTimeout(() => {
if (isCameraOpen.value) {
websocketsend(getCharacterRecognitionResult)
} else {
MessagePlugin('error', { content: '请确保相机处于开机状态' }) MessagePlugin('error', { content: '请确保相机处于开机状态' })
} }
}, 1000)
}
} }
onMounted(async () => { onMounted(async () => {
websocket.value = new socket() websocket.value = new socket()
websocket.value.WebSocketSet(getSocketdata) websocket.value.WebSocketSet(getSocketdata)
getInitData() getInitData()
//
websocketsend(getCameraState)
}) })
const catCurrentTaskDetail = () => { const catCurrentTaskDetail = () => {

Loading…
Cancel
Save