From 5d1d7412826c4439d5bbf154de156217298c80ae Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Sat, 29 Jul 2023 14:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 20 ++++++++++---------- src/api/camera.js | 7 +++++++ src/components/Debug.vue | 1 - src/components/Task.vue | 24 ++++++++++++++++++++++-- src/pages/index.vue | 16 +++++++++++++++- 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/.env b/.env index 63bfb08..3a06073 100644 --- a/.env +++ b/.env @@ -1,15 +1,15 @@ -VITE_BASE_URL=http://192.168.1.194:8899 -VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.194:8899/websocket/nuclear -# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear -VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.194:8081/ws/cmd -VITE_HOST_URL=http://192.168.1.194:8081/ +# VITE_BASE_URL=http://192.168.1.194:8899 +# VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.194:8899/websocket/nuclear +# # VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear +# VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.194:8081/ws/cmd +# VITE_HOST_URL=http://192.168.1.194:8081/ -# VITE_BASE_URL=http://127.0.0.1:8899 -# VITE_WEBSOCKET_JAVA_URL=ws://127.0.0.1:8899/websocket/nuclear -# # VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear -# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8081/ws/cmd -# VITE_HOST_URL=http://127.0.0.1:8081/ +VITE_BASE_URL=http://127.0.0.1:8899 +VITE_WEBSOCKET_JAVA_URL=ws://127.0.0.1:8899/websocket/nuclear +# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear +VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8081/ws/cmd +VITE_HOST_URL=http://127.0.0.1:8081/ # VITE_BASE_URL=http://192.168.1.111:8899 # VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear diff --git a/src/api/camera.js b/src/api/camera.js index e1fc74b..d622423 100644 --- a/src/api/camera.js +++ b/src/api/camera.js @@ -7,3 +7,10 @@ export const addCameraConfig = data => { data, }) } + +export const getCameraConfig = nuclearCoreId => { + return request({ + url: `/camera/info/${nuclearCoreId}`, + method: 'GET', + }) +} diff --git a/src/components/Debug.vue b/src/components/Debug.vue index 79efc24..be67b7f 100644 --- a/src/components/Debug.vue +++ b/src/components/Debug.vue @@ -278,7 +278,6 @@ const reconnect = () => { const websocketonmessage = e => { // 相机启动停止后接收到回执 而后发送获取相机状态指令 实时改变页面状态 const data = JSON.parse(e.data) - console.log(data) const { messageId, success } = data if (success) { switch (messageId) { diff --git a/src/components/Task.vue b/src/components/Task.vue index bd8d1ff..1e00907 100644 --- a/src/components/Task.vue +++ b/src/components/Task.vue @@ -129,6 +129,7 @@ import { useCameraStore, } from '@/store' import { allOperatorApi } from '@/api/publish' +import { getCameraConfig } from '@/api/camera' import moment from 'moment' import Cookie from '@/utils/cookie' const accountStore = useAccountStore() @@ -416,7 +417,11 @@ export default { ], } }, - props: ['startCaptureFunc'], + props: [ + 'startCaptureFunc', + 'handleSimulationBrightness', + 'handleExposureTime', + ], components: { PathPlan, }, @@ -538,10 +543,25 @@ export default { accountStore.changePage(0) taskStore.updateCurrentDetailTaskId(null) }, - startTask(row, coreName, flag, canUpload) { + async startTask(row, coreName, flag, canUpload) { if (flag == 1 && canUpload) { return } + // 需要设置相机的参数 根据核堆id获取 + const res = await getCameraConfig(row.nuclearCoreId) + console.log(res) + if (res?.code == 200) { + if (res?.data?.exposure) { + // 改变相机的exposure + this.startCaptureFunc() + this.handleExposureTime() + } + if (res?.data?.simulation_brightness) { + // 改变相机的simulation_brightness + this.startCaptureFunc() + this.handleSimulationBrightness() + } + } this.startCaptureFunc() taskStore.updateTaskStatus(row.status) taskStore.updateCurrentCoord(row.currentCoord) diff --git a/src/pages/index.vue b/src/pages/index.vue index bd2a3ac..bf52a49 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -338,7 +338,11 @@