Browse Source

自动设置

master
maochaoying 2 years ago
parent
commit
5d1d741282
  1. 20
      .env
  2. 7
      src/api/camera.js
  3. 1
      src/components/Debug.vue
  4. 24
      src/components/Task.vue
  5. 16
      src/pages/index.vue

20
.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_BASE_URL=http://192.168.1.111:8899
# VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear # VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear

7
src/api/camera.js

@ -7,3 +7,10 @@ export const addCameraConfig = data => {
data, data,
}) })
} }
export const getCameraConfig = nuclearCoreId => {
return request({
url: `/camera/info/${nuclearCoreId}`,
method: 'GET',
})
}

1
src/components/Debug.vue

@ -278,7 +278,6 @@ const reconnect = () => {
const websocketonmessage = e => { const websocketonmessage = e => {
// //
const data = JSON.parse(e.data) const data = JSON.parse(e.data)
console.log(data)
const { messageId, success } = data const { messageId, success } = data
if (success) { if (success) {
switch (messageId) { switch (messageId) {

24
src/components/Task.vue

@ -129,6 +129,7 @@ import {
useCameraStore, useCameraStore,
} from '@/store' } from '@/store'
import { allOperatorApi } from '@/api/publish' import { allOperatorApi } from '@/api/publish'
import { getCameraConfig } from '@/api/camera'
import moment from 'moment' import moment from 'moment'
import Cookie from '@/utils/cookie' import Cookie from '@/utils/cookie'
const accountStore = useAccountStore() const accountStore = useAccountStore()
@ -416,7 +417,11 @@ export default {
], ],
} }
}, },
props: ['startCaptureFunc'],
props: [
'startCaptureFunc',
'handleSimulationBrightness',
'handleExposureTime',
],
components: { components: {
PathPlan, PathPlan,
}, },
@ -538,10 +543,25 @@ export default {
accountStore.changePage(0) accountStore.changePage(0)
taskStore.updateCurrentDetailTaskId(null) taskStore.updateCurrentDetailTaskId(null)
}, },
startTask(row, coreName, flag, canUpload) {
async startTask(row, coreName, flag, canUpload) {
if (flag == 1 && canUpload) { if (flag == 1 && canUpload) {
return 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() this.startCaptureFunc()
taskStore.updateTaskStatus(row.status) taskStore.updateTaskStatus(row.status)
taskStore.updateCurrentCoord(row.currentCoord) taskStore.updateCurrentCoord(row.currentCoord)

16
src/pages/index.vue

@ -338,7 +338,11 @@
</div> </div>
</div> </div>
<div class="task_container" v-if="accountStore.activePage == 1"> <div class="task_container" v-if="accountStore.activePage == 1">
<Task :startCaptureFunc="startCaptureFunc" />
<Task
:startCaptureFunc="startCaptureFunc"
:handleSimulationBrightness="handleSimulationBrightness"
:handleExposureTime="handleExposureTime"
/>
</div> </div>
<div <div
class="publish_container" class="publish_container"
@ -391,6 +395,8 @@ import {
getCharacterRecognitionResult, getCharacterRecognitionResult,
getCameraState, getCameraState,
startCapture, startCapture,
setFlashBrightnessAnalog,
setExposureTimeRaw,
} from '@/command' } from '@/command'
const accountStore = useAccountStore() const accountStore = useAccountStore()
const taskStore = useTaskStore() const taskStore = useTaskStore()
@ -405,6 +411,10 @@ const testArrLength = ref(121)
// websocket // websocket
const websocket = ref(null) const websocket = ref(null)
const handleExposureTime = value => {
websocketsend(setExposureTimeRaw(value))
}
const detailProcess = computed(() => { const detailProcess = computed(() => {
const testArr = taskStore.excelData.filter( const testArr = taskStore.excelData.filter(
item => item.firstSign && item.secondSign, item => item.firstSign && item.secondSign,
@ -415,6 +425,10 @@ const detailProcess = computed(() => {
return parseInt((hasTested.length / testArr.length) * 100) return parseInt((hasTested.length / testArr.length) * 100)
}) })
const handleSimulationBrightness = value => {
websocketsend(setFlashBrightnessAnalog(value))
}
const checked = ref(false) const checked = ref(false)
const onChange = async val => { const onChange = async val => {

Loading…
Cancel
Save