Browse Source

相机状态判断

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

10
src/components/Debug.vue

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

10
src/pages/index.vue

@ -536,7 +536,13 @@ const check = async () => {
if (isCameraOpen.value) { if (isCameraOpen.value) {
websocketsend(getCharacterRecognitionResult) websocketsend(getCharacterRecognitionResult)
} else { } else {
MessagePlugin('error', { content: '请确保相机处于开机状态' })
setTimeout(() => {
if (isCameraOpen.value) {
websocketsend(getCharacterRecognitionResult)
} else {
MessagePlugin('error', { content: '请确保相机处于开机状态' })
}
}, 1000)
} }
} }
@ -544,6 +550,8 @@ 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