From e181016014ed39fb888e453524546bc8be63c02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=A2=A6=E8=BF=9C?= <1063331231@qq.com> Date: Thu, 24 Jul 2025 14:17:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=8C=87=E4=BB=A4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/debug.d.ts | 2 +- src/views/debug/index.vue | 50 +++++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/types/debug.d.ts b/src/types/debug.d.ts index 81be497..f40230d 100644 --- a/src/types/debug.d.ts +++ b/src/types/debug.d.ts @@ -54,7 +54,7 @@ declare namespace Debug { interface PumpData { speed?: number - volume?: number + distance?: number direction?: 'forward' | 'backward' } diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index b05c255..14db9b6 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -178,8 +178,10 @@ const commandHandle = async (command: string, params?: unknown) => { el-form-item ft-button(size="small", type="primary", :click-handle="() => commandHandle('claw_open', { ...debugStore.formData.transferModule.clawMotorData, distance: debugStore.formData.transferModule.clawMotorData.distance })") | 打开 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('claw_close', { ...debugStore.formData.transferModule.clawMotorData, distance: -(debugStore.formData.transferModule.clawMotorData.distance ?? 0) })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('claw_open', { ...debugStore.formData.transferModule.clawMotorData, distance: -(debugStore.formData.transferModule.clawMotorData.distance ?? 0) })") | 闭合 + ft-button(size="small", type="primary", :click-handle="() => commandHandle('claw_stop', {})") + | 停止 el-col(:span="8") el-card template(#header) @@ -188,8 +190,8 @@ const commandHandle = async (command: string, params?: unknown) => { el-divider 陶瓷蠕动泵 div.card-box el-form - el-form-item(label="容量") - el-input(v-model="debugStore.formData.peristalticPumpData.ceramicPump.volume", type="number", placeholder="请输入容量") + el-form-item(label="距离") + el-input(v-model="debugStore.formData.peristalticPumpData.ceramicPump.distance", type="number", placeholder="请输入距离") template(#append) | mL el-form-item(label="速度") @@ -200,6 +202,8 @@ const commandHandle = async (command: string, params?: unknown) => { el-select(v-model="debugStore.formData.peristalticPumpData.ceramicPump.pumpCode", placeholder="请选择泵") el-option(v-for="item in 2", :key="item", :label="`泵-${item}`", :value="`ceramic_pump_${item}`") el-form-item + ft-button(size="small", type="primary", :click-handle="() => commandHandle('ceramic_pump_move', { ...debugStore.formData.peristalticPumpData.ceramicPump})") + | 移动 ft-button(size="small", type="primary", :click-handle="() => commandHandle('ceramic_pump_open', { ...debugStore.formData.peristalticPumpData.ceramicPump, direction: 'forward' })") | 正转 ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('ceramic_pump_close')") @@ -209,8 +213,8 @@ const commandHandle = async (command: string, params?: unknown) => { el-divider 无刷蠕动泵 div.card-box el-form - el-form-item(label="容量") - el-input(v-model="debugStore.formData.peristalticPumpData.brushlessPump.volume", type="number", placeholder="请输入容量") + el-form-item(label="距离") + el-input(v-model="debugStore.formData.peristalticPumpData.brushlessPump.distance", type="number", placeholder="请输入距离") template(#append) | mL el-form-item(label="速度") @@ -221,6 +225,8 @@ const commandHandle = async (command: string, params?: unknown) => { el-select(v-model="debugStore.formData.peristalticPumpData.brushlessPump.pumpCode", placeholder="请选择泵") el-option(v-for="item in 10", :key="item", :label="`泵-${item}`", :value="`brushless_pump_${item}`") el-form-item + ft-button(size="small", type="primary", :click-handle="() => commandHandle('brushless_pump_move', { ...debugStore.formData.peristalticPumpData.brushlessPump})") + | 正转 ft-button(size="small", type="primary", :click-handle="() => commandHandle('brushless_pump_open', { ...debugStore.formData.peristalticPumpData.brushlessPump, direction: 'forward' })") | 正转 ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('brushless_pump_close')") @@ -230,8 +236,8 @@ const commandHandle = async (command: string, params?: unknown) => { el-divider 步进蠕动泵 div.card-box el-form - el-form-item(label="容量") - el-input(v-model="debugStore.formData.peristalticPumpData.stepPump.volume", type="number", placeholder="请输入容量") + el-form-item(label="距离") + el-input(v-model="debugStore.formData.peristalticPumpData.stepPump.distance", type="number", placeholder="请输入距离") template(#append) | mL el-form-item(label="速度") @@ -242,6 +248,8 @@ const commandHandle = async (command: string, params?: unknown) => { el-select(v-model="debugStore.formData.peristalticPumpData.stepPump.pumpCode", type="number", placeholder="请选择泵") el-option(v-for="item in 3", :key="item", :label="`泵-${item}`", :value="`step_pump_${item}`") el-form-item + ft-button(size="small", type="primary", :click-handle="() => commandHandle('brushless_pump_move', { ...debugStore.formData.peristalticPumpData.stepPump})") + | 移动 ft-button(size="small", type="primary", :click-handle="() => commandHandle('brushless_pump_open', { ...debugStore.formData.peristalticPumpData.stepPump, direction: 'forward' })") | 正转 ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('brushless_pump_close')") @@ -271,16 +279,16 @@ const commandHandle = async (command: string, params?: unknown) => { el-option(v-for="item in 2", :key="item", :label="`电机${item}`", :value="`titration_motor_${item}`") el-form-item ft-button(size="small", type="primary", :click-handle="() => commandHandle('titration_motor_move_by', { ...debugStore.formData.titrationModule.relative, distance: debugStore.formData.titrationModule.relative.distance })") - | 前进 + | 相对移动 ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('titration_motor_stop', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") | 停止 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('z_move_by', { ...debugStore.formData.titrationModule.relative, distance: -(debugStore.formData.titrationModule.relative.distance ?? 0) })") - | 后退 + ft-button(size="small", type="primary", :click-handle="() => commandHandle('titration_motor_move_to', { ...debugStore.formData.titrationModule.relative, position: -(debugStore.formData.titrationModule.relative.distance ?? 0) })") + | 绝对移动 ft-button(type="primary", size="small", :click-handle="() => commandHandle('titration_motor_origin', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('z_enable', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('titration_motor_enable', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('z_disable', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") + ft-button(size="small", :click-handle="() => commandHandle('titration_motor_disable', { motorCode: debugStore.formData.titrationModule.relative.motorCode })") | 电机失能 el-col(:span="8") el-card @@ -312,9 +320,9 @@ const commandHandle = async (command: string, params?: unknown) => { el-select(v-model="debugStore.formData.lightModule.color", placeholder="请选择颜色") el-option(v-for="item in [{ value: 'red', label: '红色' }, { value: 'yellow', label: '黄色' }, { value: 'green', label: '绿色' }]", :key="item.value", :label="item.label", :value="item.value") el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('door_open', { ...debugStore.formData.door })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('light_open', { ...debugStore.formData.lightModule.color })") | 开启 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('door_stop')") + ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('light_close')") | 关闭 el-card template(#header) @@ -336,19 +344,19 @@ const commandHandle = async (command: string, params?: unknown) => { | 次 el-form-item(label="电机") el-select(v-model="debugStore.formData.magnetStirMotor.relative.motorCode", placeholder="请选择电机") - el-option(v-for="item in 2", :key="item", :label="`电机${item}`", :value="`magnet_stir_motor_${item}`") + el-option(v-for="item in 2", :key="item", :label="`电机${item}`", :value="`stir_motor_${item}`") el-form-item - ft-button(size="small", type="primary", :click-handle="() => commandHandle('magnet_stir_motor_move_by', { ...debugStore.formData.magnetStirMotor.relative, distance: debugStore.formData.magnetStirMotor.relative.distance })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_move_by', { ...debugStore.formData.magnetStirMotor.relative, distance: debugStore.formData.magnetStirMotor.relative.distance })") | 前进 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('magnet_stir_motor_stop', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") + ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('stir_motor_stop', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") | 停止 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('magnet_stir_motor_move_by', { ...debugStore.formData.magnetStirMotor.relative, distance: -(debugStore.formData.magnetStirMotor.relative.distance ?? 0) })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_move_by', { ...debugStore.formData.magnetStirMotor.relative, distance: -(debugStore.formData.magnetStirMotor.relative.distance ?? 0) })") | 后退 - ft-button(type="primary", size="small", :click-handle="() => commandHandle('magnet_stir_motor_origin', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") + ft-button(type="primary", size="small", :click-handle="() => commandHandle('stir_motor_origin', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('magnet_stir_motor_enable', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_enable', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('magnet_stir_motor_disable', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") + ft-button(size="small", :click-handle="() => commandHandle('stir_motor_disable', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") | 电机失能 el-divider 磁子投放 ft-button(size="small", type="primary", :click-handle="() => commandHandle('magnet_open')")