Browse Source

fix:喷涂路径规划不生效的问题

master
guoapeng 5 months ago
parent
commit
1fdad09f88
  1. 6
      src/components/spray/trayGraph/index.vue
  2. 13
      src/libs/utils.ts
  3. 37
      src/views/clean/index.vue
  4. 29
      src/views/home/index.vue
  5. 26
      src/views/main/index.vue
  6. 4
      src/views/spray/index.vue
  7. 62
      src/views/spraySet/index.vue
  8. 4
      vite.config.ts

6
src/components/spray/trayGraph/index.vue

@ -1,6 +1,6 @@
<script setup lang="ts">
import Konva from 'konva'
import { onMounted, ref, watch } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
const props = defineProps({
container: {
@ -166,9 +166,9 @@ const updateLine = (point: { x: number, y: number }) => {
}
// line
const hasLine = () => {
const hasLine = computed(() => {
return line.value !== undefined && line.value !== null
}
})
watch(
() => props.select,

13
src/libs/utils.ts

@ -41,18 +41,23 @@ export const sendControl = async (params: any, type?: string) => {
FtMessage.error('当前不可以暂停')
return
}
if (systemStatus.cleaningSyringePipeline && (type === 'debug' || ['nozzle_pipeline_wash', 'matrix_spray_start', 'matrix_prefill'].includes(params.cmdCode))) {
const PipelineDisableCmd = [
'syringe_pipeline_wash',
'nozzle_pipeline_wash',
'matrix_spray_start',
'matrix_prefill',
]
if (systemStatus.cleaningSyringePipeline && (type === 'debug' || PipelineDisableCmd.includes(params.cmdCode))) {
FtMessage.error('正在清洗注射器管路, 无法执行')
return
}
if (systemStatus.cleaningNozzlePipeline && (type === 'debug' || ['syringe_pipeline_wash', 'matrix_spray_start', 'matrix_prefill'].includes(params.cmdCode))) {
if (systemStatus.cleaningNozzlePipeline && (type === 'debug' || PipelineDisableCmd.includes(params.cmdCode))) {
FtMessage.error('正在清洗喷嘴管路, 无法执行')
return
}
if (systemStatus.prefilling && (type === 'debug' || ['nozzle_pipeline_wash', 'syringe_pipeline_wash', 'matrix_spray_start'].includes(params.cmdCode))) {
if (systemStatus.prefilling && (type === 'debug' || PipelineDisableCmd.includes(params.cmdCode))) {
FtMessage.error('正在预充管路, 无法执行')
return
}

37
src/views/clean/index.vue

@ -5,6 +5,8 @@ import { sendControl } from 'libs/utils'
import { h, ref } from 'vue'
const clearSpeed = ref()
const syringePipelineWashRef = ref()
const syringePipelineWash = () => {
if (!clearSpeed.value) {
FtMessage.error('请输入清洗速度')
@ -20,7 +22,8 @@ const syringePipelineWash = () => {
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
}).then(() => {
}).then(async () => {
syringePipelineWashRef.value.setLoading(true)
const params = {
cmdCode: 'syringe_pipeline_wash',
cmdId: '',
@ -28,12 +31,16 @@ const syringePipelineWash = () => {
speed: clearSpeed,
},
}
sendControl(params)
}).catch(() => {
FtMessage.error('取消清洗')
try {
await sendControl(params)
}
finally {
syringePipelineWashRef.value.setLoading(false)
}
})
}
const nozzlePipelineWashRef = ref()
const nozzlePipelineWash = () => {
if (!clearSpeed.value) {
FtMessage.error('请输入清洗速度')
@ -49,7 +56,8 @@ const nozzlePipelineWash = () => {
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
}).then(() => {
}).then(async () => {
nozzlePipelineWashRef.value.setLoading(true)
const params = {
cmdCode: 'nozzle_pipeline_wash',
cmdId: '',
@ -57,19 +65,22 @@ const nozzlePipelineWash = () => {
speed: clearSpeed,
},
}
sendControl(params)
}).catch(() => {
FtMessage.error('取消清洗')
try {
await sendControl(params)
}
finally {
nozzlePipelineWashRef.value.setLoading(false)
}
})
}
const syringePipelineWashStop = () => {
const syringePipelineWashStop = async () => {
const params = {
cmdCode: 'syringe_pipeline_wash_stop',
cmdId: '',
params: {},
}
sendControl(params)
await sendControl(params)
}
</script>
@ -80,13 +91,13 @@ const syringePipelineWashStop = () => {
<el-input v-model="clearSpeed" type="number" style="width: 100px;margin:0 10px" />
<span>uL/min</span>
</div>
<FtButton type="primary" @click="syringePipelineWash">
<FtButton ref="syringePipelineWashRef" type="primary" @click="syringePipelineWash">
清洗注射器管路
</FtButton>
<FtButton type="primary" @click="nozzlePipelineWash">
<FtButton ref="nozzlePipelineWashRef" type="primary" @click="nozzlePipelineWash">
清洗喷嘴管路
</FtButton>
<FtButton @click="syringePipelineWashStop">
<FtButton :click-handle="syringePipelineWashStop">
结束清洗
</FtButton>
</div>

29
src/views/home/index.vue

@ -1,35 +1,7 @@
<script setup lang="ts">
import { getDeviceStatus } from 'apis/system'
import Check from 'components/home/Check/index.vue'
import { ElMessageBox } from 'element-plus'
import { useSystemStore } from 'stores/useSystemStore'
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const systemStore = useSystemStore()
const router = useRouter()
const checkVisible = ref(false)
const ok = () => {
checkVisible.value = false
}
getDeviceStatus().then((res: any) => {
systemStore.updateSystemStatus(res)
if (!systemStore.systemStatus.selfTestCompleted) {
ElMessageBox.confirm('检测到您还未完成自检,是否开始自检?', '提示', {
type: 'warning',
confirmButtonText: '确定',
showCancelButton: false,
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
closeOnHashChange: false,
}).then(() => {
checkVisible.value = true
})
}
})
</script>
<template>
@ -60,7 +32,6 @@ getDeviceStatus().then((res: any) => {
<p>坐标管理</p>
</div>
</div>
<Check v-if="checkVisible" @ok="ok" @cancel="checkVisible = false" />
</div>
</template>

26
src/views/main/index.vue

@ -1,6 +1,9 @@
<script setup lang="ts">
import { getDeviceStatus } from 'apis/system'
import FtStream from 'components/common/FTStream/index.vue'
import Check from 'components/home/Check/index.vue'
import Stop from 'components/home/stop/index.vue'
import { ElMessageBox } from 'element-plus'
import { isClose, socket } from 'libs/socket'
import { sendControl } from 'libs/utils'
import { useSystemStore } from 'stores/useSystemStore' // systemStore
@ -11,6 +14,28 @@ const route = useRoute()
const router = useRouter()
const systemStore = useSystemStore() // 使 systemStore
const checkVisible = ref(false)
getDeviceStatus().then((res: any) => {
systemStore.updateSystemStatus(res)
if (!systemStore.systemStatus.selfTestCompleted) {
ElMessageBox.confirm('检测到您还未完成自检,是否开始自检?', '提示', {
type: 'warning',
confirmButtonText: '确定',
showCancelButton: false,
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
closeOnHashChange: false,
}).then(() => {
checkVisible.value = true
})
}
})
const ok = () => {
checkVisible.value = false
}
const statusMessage = (data: any) => {
// systemStore systemStatus
console.log(data)
@ -140,6 +165,7 @@ const slideTrayOut = async () => {
</el-footer>
<FtStream :visible="systemStore.streamVisible" />
<Stop v-if="systemStore.systemStatus.stopPressed" />
<Check v-if="checkVisible" @ok="ok" @cancel="checkVisible = false" />
</el-container>
</template>

4
src/views/spray/index.vue

@ -46,6 +46,10 @@ const infoVisible = ref(false)
onMounted(() => {
getMatrixList()
// nextTick(() => {
// currentSpeed = 1
// sprayPointReceiveMessage({ index: 0, currentPoint: { x: 1, y: 1 }, nextPoint: { x: 10, y: 1 } })
// })
})
const matrixList = ref([])

62
src/views/spraySet/index.vue

@ -50,7 +50,8 @@ const dehumidifierStart = () => {
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
}).then(async () => {
})
.then(async () => {
dehumidifierStartRef.value.setLoading(true)
const params = {
cmdCode: 'dehumidifier_start',
@ -61,7 +62,8 @@ const dehumidifierStart = () => {
}
await sendControl(params)
dehumidifierStartRef.value.setLoading(false)
}).catch(() => {
})
.catch(() => {
FtMessage.error('取消除湿')
})
}
@ -74,15 +76,13 @@ const syringePipelineWash = async () => {
}
ElMessageBox({
title: '提示',
message: h('div', null, [
h('p', null, '请检查废液瓶是否已满 '),
h('p', null, '请检查设备内是否有异物'),
]),
message: h('div', null, [h('p', null, '请检查废液瓶是否已满 '), h('p', null, '请检查设备内是否有异物')]),
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
}).then(async () => {
})
.then(async () => {
syringePipelineWashRef.value.setLoading(true)
const params = {
cmdCode: 'syringe_pipeline_wash',
@ -94,7 +94,8 @@ const syringePipelineWash = async () => {
console.log('sendControl', params)
await sendControl(params)
syringePipelineWashRef.value.setLoading(false)
}).catch(() => {
})
.catch(() => {
FtMessage.error('取消清洗')
})
}
@ -107,15 +108,13 @@ const nozzlePipelineWash = () => {
}
ElMessageBox({
title: '提示',
message: h('div', null, [
h('p', null, '请检查废液瓶是否已满 '),
h('p', null, '请检查设备内是否有异物'),
]),
message: h('div', null, [h('p', null, '请检查废液瓶是否已满 '), h('p', null, '请检查设备内是否有异物')]),
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
}).then(async () => {
})
.then(async () => {
nozzlePipelineWashRef.value.setLoading(true)
const params = {
cmdCode: 'nozzle_pipeline_wash',
@ -124,10 +123,12 @@ const nozzlePipelineWash = () => {
speed: clearSpeed.value,
},
}
try {
await sendControl(params)
}
finally {
nozzlePipelineWashRef.value.setLoading(false)
}).catch(() => {
FtMessage.error('取消清洗')
}
})
}
@ -139,15 +140,13 @@ const matrixPrefill = () => {
}
ElMessageBox({
title: '提示',
message: h('div', null, [
h('p', null, '请检查废液瓶是否已满 '),
h('p', null, '请检查设备内是否有异物'),
]),
message: h('div', null, [h('p', null, '请检查废液瓶是否已满 '), h('p', null, '请检查设备内是否有异物')]),
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
}).then(async () => {
})
.then(async () => {
matrixPrefillRef.value.setLoading(true)
const params = {
cmdCode: 'matrix_prefill',
@ -158,7 +157,8 @@ const matrixPrefill = () => {
}
await sendControl(params)
matrixPrefillRef.value.setLoading(false)
}).catch(() => {
})
.catch(() => {
FtMessage.error('取消预充')
})
}
@ -199,10 +199,10 @@ const dehumidifierStop = async () => {
<span> 清洗管道</span>
</div>
</template>
<div style="display: flex;align-items: center;margin-top: 20px">
<div style="display: flex;align-items: center;width: fit-content;margin-right: 30px">
<div style="display: flex; align-items: center; margin-top: 20px">
<div style="display: flex; align-items: center; width: fit-content; margin-right: 30px">
<span>清洗速度</span>
<el-input v-model="clearSpeed" type="number" style="width: 100px;margin:0 10px" />
<el-input v-model="clearSpeed" type="number" style="width: 100px; margin: 0 10px" />
<span>uL/min</span>
</div>
<ft-button ref="syringePipelineWashRef" type="primary" :click-handle="syringePipelineWash">
@ -225,10 +225,10 @@ const dehumidifierStop = async () => {
<span> 预充管道</span>
</div>
</template>
<div style="display: flex;align-items: center;margin-top: 20px">
<div style="display: flex;align-items: center;width: fit-content;margin-right: 30px">
<div style="display: flex; align-items: center; margin-top: 20px">
<div style="display: flex; align-items: center; width: fit-content; margin-right: 30px">
<span>预充速度</span>
<el-input v-model="speed" type="number" style="width: 100px;margin:0 10px" />
<el-input v-model="speed" type="number" style="width: 100px; margin: 0 10px" />
<span>uL/min</span>
</div>
<ft-button ref="matrixPrefillRef" type="primary" :click-handle="matrixPrefill">
@ -249,15 +249,15 @@ const dehumidifierStop = async () => {
<span> 环境设置</span>
</div>
</template>
<div style="display: flex;align-items: center;margin-top: 20px">
<div style="display: flex;align-items: center;width: fit-content;margin-right: 30px">
<div style="display: flex; align-items: center; margin-top: 20px">
<div style="display: flex; align-items: center; width: fit-content; margin-right: 30px">
<span>当前湿度</span>
<span class="num-text">{{ systemStore.systemSensor.humidity }}</span>
<span>%RH</span>
</div>
<div style="display: flex;align-items: center;width: fit-content;margin-right: 30px">
<div style="display: flex; align-items: center; width: fit-content; margin-right: 30px">
<span>要求湿度</span>
<el-input v-model="humidity" type="number" style="width: 100px;margin:0 10px" />
<el-input v-model="humidity" type="number" style="width: 100px; margin: 0 10px" />
<span>%RH</span>
</div>
<ft-button ref="dehumidifierStartRef" type="primary" :click-handle="dehumidifierStart">

4
vite.config.ts

@ -76,8 +76,8 @@ export default defineConfig({
host: '0.0.0.0',
proxy: {
'/api': {
// target: 'http://192.168.1.199:8080',
target: 'http://192.168.1.200:8080',
target: 'http://192.168.1.199:8080',
// target: 'http://192.168.1.200:8080',
// secure: false,
changeOrigin: true, // 是否跨域
rewrite: path => path.replace(/^\/api/, 'api'),

Loading…
Cancel
Save