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. 47
      src/views/spraySet/index.vue

2
src/env.d.ts

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

56
src/stores/useSystemStore.ts

@ -12,6 +12,8 @@ export const useSystemStore = defineStore('system', {
dehumidifierRunning: false, // 是否正在除湿 dehumidifierRunning: false, // 是否正在除湿
selfTestCompleted: false, // 是否完成自检 selfTestCompleted: false, // 是否完成自检
stopPressed: false, // 是否按下急停 stopPressed: false, // 是否按下急停
nozzleHeating: false, // 是否正在加热喷嘴
slidePlatHeating: false, // 是否正在加热载玻台
}, },
systemSensor: { systemSensor: {
humidity: 0, humidity: 0,
@ -20,6 +22,12 @@ export const useSystemStore = defineStore('system', {
streamVisible: false, streamVisible: false,
systemList: [{ cmdCode: '' }], systemList: [{ cmdCode: '' }],
targetHumidity: 0, targetHumidity: 0,
cleanRemainingTime: '', // 清洗管道用时
cleanTimerId: null, // 清洗管道定时器
cleanStartTs: 0, // 清洗管道开始时间
preRemainingTime: '', // 预充用时
preTimerId: null, // 预充定时器
preStartTs: 0, // 预充开始时间
}), }),
actions: { actions: {
updateTargetHumidity(humidity: number) { updateTargetHumidity(humidity: number) {
@ -40,5 +48,53 @@ export const useSystemStore = defineStore('system', {
pushSystemList(text: any) { pushSystemList(text: any) {
this.systemList.push(text) 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', direction: 'forward',
speed: undefined, speed: undefined,
voltage: 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') => { const motorMove = async (device: 'x' | 'y' | 'z') => {
if (!form[device].position || !form[device].speed) { if (!form[device].position || !form[device].speed) {
FtMessage.error('请补全参数') FtMessage.error('请补全参数')
@ -197,7 +267,7 @@ const highVoltageClose = async () => {
<el-card> <el-card>
<el-form label-width="auto" label-suffix=":"> <el-form label-width="auto" label-suffix=":">
<el-form-item label="X轴"> <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"> <div style="margin: 0 5px">
<span>移动</span> <span>移动</span>
<el-input v-model="form.x.position" style="width: 100px" type="number" /> <el-input v-model="form.x.position" style="width: 100px" type="number" />
@ -232,7 +302,7 @@ const highVoltageClose = async () => {
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="Y轴"> <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"> <div style="margin: 0 5px">
<span>移动</span> <span>移动</span>
<el-input v-model="form.y.position" style="width: 100px" type="number" /> <el-input v-model="form.y.position" style="width: 100px" type="number" />
@ -267,7 +337,7 @@ const highVoltageClose = async () => {
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="Z轴"> <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"> <div style="margin: 0 5px">
<span>移动</span> <span>移动</span>
<el-input v-model="form.z.position" style="width: 100px" type="number" /> <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 label-width="auto" label-suffix=":">
<el-form-item label="注射泵"> <el-form-item label="注射泵">
<div style="display: flex; align-items: center; margin: 5px 0"> <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> <span>ul/min</span>
<el-radio-group v-model="form.direction" style="margin: 10px"> <el-radio-group v-model="form.direction" style="margin: 10px">
<div style="display: flex"> <div style="display: flex">
@ -330,7 +400,7 @@ const highVoltageClose = async () => {
<el-form-item label="电压控制器"> <el-form-item label="电压控制器">
<div style="display: flex; align-items: center; margin: 5px 0"> <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> <span>V</span>
<ft-button type="primary" style="margin-left: 10px" :click-handle="highVoltageOpen"> <ft-button type="primary" style="margin-left: 10px" :click-handle="highVoltageOpen">
开启 开启
@ -342,16 +412,51 @@ const highVoltageClose = async () => {
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </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-row :gutter="20">
<el-col :span="12"> <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 type="primary" :click-handle="lightingPanelOpen">
开启照明灯 开启照明灯
</ft-button> </ft-button>
<ft-button :click-handle="lightingPanelClose"> <ft-button :click-handle="lightingPanelClose">
关闭照明灯 关闭照明灯
</ft-button> </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 type="primary" :click-handle="threeWayValveOpenSyringePipeline"> -->
<!-- 打开喷嘴管路 --> <!-- 打开喷嘴管路 -->
<!-- </ft-button> --> <!-- </ft-button> -->
@ -365,7 +470,7 @@ const highVoltageClose = async () => {
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="12"> <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 type="primary" :click-handle="washValveOpen">
打开清洗阀 打开清洗阀
</ft-button> </ft-button>
@ -375,7 +480,7 @@ const highVoltageClose = async () => {
<ft-button type="primary" :click-handle="dehumidifierValveOpen"> <ft-button type="primary" :click-handle="dehumidifierValveOpen">
打开除湿阀 打开除湿阀
</ft-button> </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 :click-handle="washValveClose">
关闭清洗阀 关闭清洗阀
</ft-button> </ft-button>
@ -398,13 +503,16 @@ const highVoltageClose = async () => {
border-radius: 20px; border-radius: 20px;
color: var(--el-color-primary); color: var(--el-color-primary);
} }
:deep(.el-card__body) { :deep(.el-card__body) {
padding: 50px; padding: 50px;
} }
.card-header { .card-header {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.num-box { .num-box {
margin: 0 20px; margin: 0 20px;
width: 50px; width: 50px;
@ -417,11 +525,13 @@ const highVoltageClose = async () => {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.button-footer { .button-footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
margin: 50px; margin: 50px;
} }
.hint-text { .hint-text {
display: flex; display: flex;
height: 400px; height: 400px;
@ -431,6 +541,7 @@ const highVoltageClose = async () => {
font-size: 50px; font-size: 50px;
color: var(--el-color-primary); color: var(--el-color-primary);
} }
.num-text { .num-text {
color: var(--el-color-primary); color: var(--el-color-primary);
font-weight: 900; font-weight: 900;
@ -439,10 +550,10 @@ const highVoltageClose = async () => {
:deep(.el-form-item) { :deep(.el-form-item) {
--font-size: 40px; --font-size: 40px;
margin-bottom: 10px
margin-bottom: 10px;
} }
.el-input { .el-input {
margin: 0 15px
margin: 0 15px;
} }
</style> </style>

47
src/views/spraySet/index.vue

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

Loading…
Cancel
Save