Browse Source

增加喷头加热 载玻台加热 读取温度 调试按钮

增加清洗管道和预充的正向计时功能
master
王梦远 3 weeks ago
parent
commit
f6f3fc6718
  1. 2
      src/env.d.ts
  2. 56
      src/stores/useSystemStore.ts
  3. 133
      src/views/debug/index.vue
  4. 83
      src/views/spraySet/index.vue

2
src/env.d.ts

@ -10,7 +10,7 @@ interface ImportMeta {
readonly env: ImportMetaEnv
}
declare const __APP_VERSION__: string;
declare const __APP_VERSION__: string
declare module '*.vue' {
import type { DefineComponent } from 'vue'

56
src/stores/useSystemStore.ts

@ -12,6 +12,8 @@ export const useSystemStore = defineStore('system', {
dehumidifierRunning: false, // 是否正在除湿
selfTestCompleted: false, // 是否完成自检
stopPressed: false, // 是否按下急停
nozzleHeating: false, // 是否正在加热喷嘴
slidePlatHeating: false, // 是否正在加热载玻台
},
systemSensor: {
humidity: 0,
@ -20,6 +22,12 @@ export const useSystemStore = defineStore('system', {
streamVisible: false,
systemList: [{ cmdCode: '' }],
targetHumidity: 0,
cleanRemainingTime: '', // 清洗管道用时
cleanTimerId: null, // 清洗管道定时器
cleanStartTs: 0, // 清洗管道开始时间
preRemainingTime: '', // 预充用时
preTimerId: null, // 预充定时器
preStartTs: 0, // 预充开始时间
}),
actions: {
updateTargetHumidity(humidity: number) {
@ -40,5 +48,53 @@ export const useSystemStore = defineStore('system', {
pushSystemList(text: any) {
this.systemList.push(text)
},
startCleanTimer() {
if (this.cleanTimerId)
return
this.cleanStartTs = Date.now()
this.cleanRemainingTime = '00:00:00'
this.cleanTimerId = window.setInterval(() => {
const diff = Date.now() - this.cleanStartTs
const secs = Math.floor(diff / 1000)
const h = Math.floor(secs / 3600)
const m = Math.floor((secs % 3600) / 60)
const s = secs % 60
const hh = String(h).padStart(2, '0')
const mm = String(m).padStart(2, '0')
const ss = String(s).padStart(2, '0')
this.cleanRemainingTime = `${hh}:${mm}:${ss}`
}, 1000)
},
stopCleanTimer() {
if (this.cleanTimerId) {
window.clearInterval(this.cleanTimerId)
this.cleanTimerId = null
}
},
startPreTimer() {
if (this.preTimerId)
return
this.preStartTs = Date.now()
this.preRemainingTime = '00:00:00'
this.preTimerId = window.setInterval(() => {
const diff = Date.now() - this.preStartTs
const secs = Math.floor(diff / 1000)
const h = Math.floor(secs / 3600)
const m = Math.floor((secs % 3600) / 60)
const s = secs % 60
const hh = String(h).padStart(2, '0')
const mm = String(m).padStart(2, '0')
const ss = String(s).padStart(2, '0')
this.preRemainingTime = `${hh}:${mm}:${ss}`
}, 1000)
},
stopPreTimer() {
if (this.preTimerId) {
window.clearInterval(this.preTimerId)
this.preTimerId = undefined
}
// this.preRemainingTime = ''
this.preStartTs = 0
},
},
})

133
src/views/debug/index.vue

@ -25,7 +25,77 @@ const form = reactive({
direction: 'forward',
speed: undefined,
voltage: undefined,
nozzle: {
temperature: undefined,
},
slidePlat: {
temperature: undefined,
},
})
const nozzleHeatOpen = async () => {
if (!form.nozzle.temperature) {
FtMessage.error('请输入设置温度')
return
}
const params = {
cmdCode: 'nozzle_heat_open',
cmdId: '',
params: {
temperature: form.nozzle.temperature,
},
}
await sendControl(params, 'debug')
}
const nozzleHeatClose = async () => {
const params = {
cmdCode: 'nozzle_heat_close',
cmdId: '',
params: {
},
}
await sendControl(params, 'debug')
}
const nozzleHeatGet = async () => {
const params = {
cmdCode: 'nozzle_heat_get',
cmdId: '',
params: {
},
}
await sendControl(params, 'debug')
}
const slidePlatHeatOpen = async () => {
if (!form.nozzle.temperature) {
FtMessage.error('请输入设置温度')
return
}
const params = {
cmdCode: 'slide_plat_heat_open',
cmdId: '',
params: {
temperature: form.nozzle.temperature,
},
}
await sendControl(params, 'debug')
}
const slidePlatHeatClose = async () => {
const params = {
cmdCode: 'slide_plat_heat_close',
cmdId: '',
params: {
},
}
await sendControl(params, 'debug')
}
const slidePlatHeatGet = async () => {
const params = {
cmdCode: 'slide_plat_heat_get',
cmdId: '',
params: {
},
}
await sendControl(params, 'debug')
}
const motorMove = async (device: 'x' | 'y' | 'z') => {
if (!form[device].position || !form[device].speed) {
FtMessage.error('请补全参数')
@ -197,7 +267,7 @@ const highVoltageClose = async () => {
<el-card>
<el-form label-width="auto" label-suffix=":">
<el-form-item label="X轴">
<div style="display: flex; align-items: center;margin: 5px 0">
<div style="display: flex; align-items: center; margin: 5px 0">
<div style="margin: 0 5px">
<span>移动</span>
<el-input v-model="form.x.position" style="width: 100px" type="number" />
@ -232,7 +302,7 @@ const highVoltageClose = async () => {
</div>
</el-form-item>
<el-form-item label="Y轴">
<div style="display: flex; align-items: center;margin: 5px 0">
<div style="display: flex; align-items: center; margin: 5px 0">
<div style="margin: 0 5px">
<span>移动</span>
<el-input v-model="form.y.position" style="width: 100px" type="number" />
@ -267,7 +337,7 @@ const highVoltageClose = async () => {
</div>
</el-form-item>
<el-form-item label="Z轴">
<div style="display: flex; align-items: center;margin: 5px 0">
<div style="display: flex; align-items: center; margin: 5px 0">
<div style="margin: 0 5px">
<span>移动</span>
<el-input v-model="form.z.position" style="width: 100px" type="number" />
@ -307,7 +377,7 @@ const highVoltageClose = async () => {
<el-form label-width="auto" label-suffix=":">
<el-form-item label="注射泵">
<div style="display: flex; align-items: center; margin: 5px 0">
<el-input v-model="form.speed" type="number" style="width: 100px;" />
<el-input v-model="form.speed" type="number" style="width: 100px" />
<span>ul/min</span>
<el-radio-group v-model="form.direction" style="margin: 10px">
<div style="display: flex">
@ -330,7 +400,7 @@ const highVoltageClose = async () => {
<el-form-item label="电压控制器">
<div style="display: flex; align-items: center; margin: 5px 0">
<el-input v-model="form.voltage" type="number" style="width: 100px;" />
<el-input v-model="form.voltage" type="number" style="width: 100px" />
<span>V</span>
<ft-button type="primary" style="margin-left: 10px" :click-handle="highVoltageOpen">
开启
@ -342,16 +412,51 @@ const highVoltageClose = async () => {
</el-form-item>
</el-form>
</el-card>
<el-card>
<el-form label-width="auto" label-suffix=":">
<el-form-item label="喷头加热">
<div style="display: flex; align-items: center; margin: 5px 0">
<el-input v-model="form.nozzle.temperature" type="number" style="width: 100px" />
<span></span>
<ft-button type="primary" size="small" style="margin-left: 10px" :click-handle="nozzleHeatOpen">
开启
</ft-button>
<ft-button :click-handle="nozzleHeatClose">
关闭
</ft-button>
<ft-button :click-handle="nozzleHeatGet">
读取
</ft-button>
</div>
</el-form-item>
<el-form-item label="载玻台加热">
<div style="display: flex; align-items: center; margin: 5px 0">
<el-input v-model="form.slidePlat.temperature" type="number" style="width: 100px" />
<span></span>
<ft-button type="primary" style="margin-left: 10px" :click-handle="slidePlatHeatOpen">
开启
</ft-button>
<ft-button :click-handle="slidePlatHeatClose">
关闭
</ft-button>
<ft-button :click-handle="slidePlatHeatGet">
读取
</ft-button>
</div>
</el-form-item>
</el-form>
</el-card>
<el-row :gutter="20">
<el-col :span="12">
<el-card style="display: flex;justify-content: center">
<el-card style="display: flex; justify-content: center">
<ft-button type="primary" :click-handle="lightingPanelOpen">
开启照明灯
</ft-button>
<ft-button :click-handle="lightingPanelClose">
关闭照明灯
</ft-button>
<div style="margin-top: 10px;display: flex;justify-content: center">
<div style="margin-top: 10px; display: flex; justify-content: center">
<!-- <ft-button type="primary" :click-handle="threeWayValveOpenSyringePipeline"> -->
<!-- 打开喷嘴管路 -->
<!-- </ft-button> -->
@ -365,7 +470,7 @@ const highVoltageClose = async () => {
</el-card>
</el-col>
<el-col :span="12">
<el-card style="display: flex;justify-content: center">
<el-card style="display: flex; justify-content: center">
<ft-button type="primary" :click-handle="washValveOpen">
打开清洗阀
</ft-button>
@ -375,7 +480,7 @@ const highVoltageClose = async () => {
<ft-button type="primary" :click-handle="dehumidifierValveOpen">
打开除湿阀
</ft-button>
<div style="margin-top: 10px;display: flex;justify-content: center">
<div style="margin-top: 10px; display: flex; justify-content: center">
<ft-button :click-handle="washValveClose">
关闭清洗阀
</ft-button>
@ -398,13 +503,16 @@ const highVoltageClose = async () => {
border-radius: 20px;
color: var(--el-color-primary);
}
:deep(.el-card__body) {
padding: 50px;
}
.card-header {
display: flex;
align-items: center;
}
.num-box {
margin: 0 20px;
width: 50px;
@ -417,11 +525,13 @@ const highVoltageClose = async () => {
justify-content: center;
align-items: center;
}
.button-footer {
display: flex;
justify-content: flex-end;
margin: 50px;
}
.hint-text {
display: flex;
height: 400px;
@ -431,6 +541,7 @@ const highVoltageClose = async () => {
font-size: 50px;
color: var(--el-color-primary);
}
.num-text {
color: var(--el-color-primary);
font-weight: 900;
@ -439,10 +550,10 @@ const highVoltageClose = async () => {
:deep(.el-form-item) {
--font-size: 40px;
margin-bottom: 10px
margin-bottom: 10px;
}
.el-input {
margin: 0 15px
margin: 0 15px;
}
</style>

83
src/views/spraySet/index.vue

@ -3,7 +3,7 @@ import { ElMessageBox } from 'element-plus'
import { FtMessage } from 'libs/message'
import { sendControl } from 'libs/utils'
import { useSystemStore } from 'stores/useSystemStore'
import { h, ref } from 'vue'
import { computed, h, ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
@ -72,7 +72,7 @@ const dehumidifierStart = () => {
FtMessage.error('取消除湿')
})
}
const cleanRemainingTime = computed(() => systemStore.cleanRemainingTime)
const syringePipelineWashRef = ref()
const syringePipelineWash = async () => {
if (!clearSpeed.value) {
@ -103,9 +103,11 @@ const syringePipelineWash = async () => {
console.log('sendControl', params)
await sendControl(params)
syringePipelineWashRef.value.setLoading(false)
systemStore.startCleanTimer()
})
.catch(() => {
FtMessage.error('取消清洗')
systemStore.stopCleanTimer()
})
}
@ -126,26 +128,25 @@ const nozzlePipelineWash = () => {
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
}).then(async () => {
nozzlePipelineWashRef.value.setLoading(true)
const params = {
cmdCode: 'nozzle_pipeline_wash',
cmdId: '',
params: {
speed: clearSpeed.value,
},
}
try {
await sendControl(params)
}
finally {
nozzlePipelineWashRef.value.setLoading(false)
}
})
.then(async () => {
nozzlePipelineWashRef.value.setLoading(true)
const params = {
cmdCode: 'nozzle_pipeline_wash',
cmdId: '',
params: {
speed: clearSpeed.value,
},
}
try {
await sendControl(params)
}
finally {
nozzlePipelineWashRef.value.setLoading(false)
}
})
}
console.log(nozzlePipelineWash)
const preRemainingTime = computed(() => systemStore.preRemainingTime)
const matrixPrefillRef = ref()
const matrixPrefill = () => {
if (!speed.value) {
@ -173,11 +174,13 @@ const matrixPrefill = () => {
speed: speed.value,
},
}
systemStore.startPreTimer()
await sendControl(params)
matrixPrefillRef.value.setLoading(false)
})
.catch(() => {
FtMessage.error('取消预充')
systemStore.stopPreTimer()
})
}
@ -186,6 +189,7 @@ const pipelineWashStop = async () => {
cmdCode: 'syringe_pipeline_wash_stop',
cmdId: '',
}
systemStore.stopCleanTimer()
await sendControl(params)
}
@ -194,6 +198,7 @@ const matrixPrefillStop = async () => {
cmdCode: 'matrix_prefill_stop',
cmdId: '',
}
systemStore.stopPreTimer()
await sendControl(params)
}
@ -227,10 +232,12 @@ const dehumidifierStop = async () => {
ref="syringePipelineWashRef"
type="primary"
:click-handle="syringePipelineWash"
:disabled="systemStore.systemStatus.spraying
|| systemStore.systemStatus.cleaningSyringePipeline
|| systemStore.systemStatus.cleaningNozzlePipeline
|| systemStore.systemStatus.prefilling"
:disabled="
systemStore.systemStatus.spraying
|| systemStore.systemStatus.cleaningSyringePipeline
|| systemStore.systemStatus.cleaningNozzlePipeline
|| systemStore.systemStatus.prefilling
"
>
清洗注射器管路
</ft-button>
@ -242,9 +249,15 @@ const dehumidifierStop = async () => {
<!-- > -->
<!-- 清洗喷嘴管路 -->
<!-- </ft-button> -->
<ft-button :click-handle="pipelineWashStop" :disabled="!systemStore.systemStatus.cleaningSyringePipeline && !systemStore.systemStatus.cleaningNozzlePipeline">
<ft-button
:click-handle="pipelineWashStop"
:disabled="
!systemStore.systemStatus.cleaningSyringePipeline && !systemStore.systemStatus.cleaningNozzlePipeline
"
>
停止清洗
</ft-button>
<span> 清洗计时 {{ cleanRemainingTime }}</span>
</div>
</el-card>
<el-card>
@ -263,16 +276,22 @@ const dehumidifierStop = async () => {
<span>uL/min</span>
</div>
<ft-button
ref="matrixPrefillRef" type="primary" :click-handle="matrixPrefill" :disabled="systemStore.systemStatus.spraying
|| systemStore.systemStatus.cleaningSyringePipeline
|| systemStore.systemStatus.cleaningNozzlePipeline
|| systemStore.systemStatus.prefilling"
ref="matrixPrefillRef"
type="primary"
:click-handle="matrixPrefill"
:disabled="
systemStore.systemStatus.spraying
|| systemStore.systemStatus.cleaningSyringePipeline
|| systemStore.systemStatus.cleaningNozzlePipeline
|| systemStore.systemStatus.prefilling
"
>
开始预充
</ft-button>
<ft-button :click-handle="matrixPrefillStop" :disabled="!systemStore.systemStatus.prefilling">
结束预充
</ft-button>
<span> 预充计时 {{ preRemainingTime }}</span>
</div>
</el-card>
<el-card>
@ -317,13 +336,16 @@ const dehumidifierStop = async () => {
color: var(--el-color-primary);
border-radius: 20px;
}
:deep(.el-card__body) {
padding: 50px;
}
.card-header {
display: flex;
align-items: center;
}
.num-box {
margin: 0 20px;
width: 50px;
@ -336,11 +358,13 @@ const dehumidifierStop = async () => {
justify-content: center;
align-items: center;
}
.button-footer {
display: flex;
justify-content: center;
margin: 50px;
}
.hint-text {
display: flex;
height: 400px;
@ -350,13 +374,16 @@ const dehumidifierStop = async () => {
font-size: 50px;
color: var(--el-color-primary);
}
.num-text {
color: var(--el-color-primary);
font-weight: 900;
font-size: 70px;
}
:deep(.set-button) {
margin-top: 50px;
.my-button {
width: 500px;
height: 150px;

Loading…
Cancel
Save