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 @@
- +
{ + websocketsend(setExposureTimeRaw(value)) +} + const detailProcess = computed(() => { const testArr = taskStore.excelData.filter( item => item.firstSign && item.secondSign, @@ -415,6 +425,10 @@ const detailProcess = computed(() => { return parseInt((hasTested.length / testArr.length) * 100) }) +const handleSimulationBrightness = value => { + websocketsend(setFlashBrightnessAnalog(value)) +} + const checked = ref(false) const onChange = async val => {