diff --git a/src/stores/debugStore.ts b/src/stores/debugStore.ts index b8d90a3..9894d3d 100644 --- a/src/stores/debugStore.ts +++ b/src/stores/debugStore.ts @@ -49,9 +49,9 @@ export const useDebugStore = defineStore('debug', { absolute: { motorCode: 'titration_motor_1' }, relative: { motorCode: 'titration_motor_1' }, }, - magnetStirMotor: { - absolute: { motorCode: 'magnet_stir_motor_1' }, - relative: { motorCode: 'magnet_stir_motor_1' }, + stirMotor: { + absolute: { motorCode: 'stir_motor_1' }, + relative: { motorCode: 'stir_motor_1' }, }, }, }), diff --git a/src/types/debug.d.ts b/src/types/debug.d.ts index f40230d..7144bff 100644 --- a/src/types/debug.d.ts +++ b/src/types/debug.d.ts @@ -8,15 +8,15 @@ declare namespace Debug { peristalticPumpData: PeristalticPump titrationModule: TitrationModule lightModule: LightModule - magnetStirMotor: MagnetStirMotor + stirMotor: StirMotor } - interface MagnetStirMotor { + interface StirMotor { absolute: MotorData & { - motorCode: 'magnet_stir_motor_1' | 'magnet_stir_motor_2' + motorCode: 'stir_motor_1' | 'stir_motor_2' } relative: MotorData & { - motorCode: 'magnet_stir_motor_1' | 'magnet_stir_motor_2' + motorCode: 'stir_motor_1' | 'stir_motor_2' } } diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index 14db9b6..ff23633 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -206,7 +206,7 @@ const commandHandle = async (command: string, params?: unknown) => { | 移动 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')") + ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('ceramic_pump_close',...debugStore.formData.peristalticPumpData.ceramicPump)") | 停止 ft-button(size="small", type="primary", class="stop-button", :click-handle="() => commandHandle('ceramic_pump_open', { ...debugStore.formData.peristalticPumpData.ceramicPump, direction: 'backward' })") | 反转 @@ -229,7 +229,7 @@ const commandHandle = async (command: string, params?: unknown) => { | 正转 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')") + ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('brushless_pump_close',{ ...debugStore.formData.peristalticPumpData.brushlessPump})") | 停止 ft-button(size="small", type="primary", class="stop-button", :click-handle="() => commandHandle('brushless_pump_open', { ...debugStore.formData.peristalticPumpData.brushlessPump, direction: 'backward' })") | 反转 @@ -248,13 +248,13 @@ 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('step_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", type="primary", :click-handle="() => commandHandle('step_pump_open', { ...debugStore.formData.peristalticPumpData.stepPump, direction: 'forward' })") | 正转 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('brushless_pump_close')") + ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('step_pump_close',{ ...debugStore.formData.peristalticPumpData.stepPump})") | 停止 - ft-button(size="small", type="primary", class="stop-button", :click-handle="() => commandHandle('brushless_pump_open', { ...debugStore.formData.peristalticPumpData.stepPump, direction: 'backward' })") + ft-button(size="small", type="primary", class="stop-button", :click-handle="() => commandHandle('step_pump_open', { ...debugStore.formData.peristalticPumpData.stepPump, direction: 'backward' })") | 反转 el-card template(#header) @@ -320,7 +320,7 @@ 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('light_open', { ...debugStore.formData.lightModule.color })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('light_open', { ...debugStore.formData.lightModule })") | 开启 ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('light_close')") | 关闭 @@ -331,32 +331,32 @@ const commandHandle = async (command: string, params?: unknown) => { div.card-box el-form el-form-item(label="距离") - el-input(v-model="debugStore.formData.magnetStirMotor.relative.distance", type="number", placeholder="请输入距离") + el-input(v-model="debugStore.formData.stirMotor.relative.distance", type="number", placeholder="请输入距离") template(#append) | mm el-form-item(label="速度") - el-input(v-model="debugStore.formData.magnetStirMotor.relative.speed", type="number", placeholder="请输入速度") + el-input(v-model="debugStore.formData.stirMotor.relative.speed", type="number", placeholder="请输入速度") template(#append) | rpm/min el-form-item(label="循环") - el-input(v-model="debugStore.formData.magnetStirMotor.relative.times", type="number", placeholder="请输入次数") + el-input(v-model="debugStore.formData.stirMotor.relative.times", type="number", placeholder="请输入次数") template(#append) | 次 el-form-item(label="电机") - el-select(v-model="debugStore.formData.magnetStirMotor.relative.motorCode", placeholder="请选择电机") + el-select(v-model="debugStore.formData.stirMotor.relative.motorCode", placeholder="请选择电机") 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('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.stirMotor.relative, distance: debugStore.formData.stirMotor.relative.distance })") | 前进 - ft-button(size="small", class="stop-button", :click-handle="() => commandHandle('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.stirMotor.relative.motorCode })") | 停止 - 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(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_move_by', { ...debugStore.formData.stirMotor.relative, distance: -(debugStore.formData.stirMotor.relative.distance ?? 0) })") | 后退 - ft-button(type="primary", size="small", :click-handle="() => commandHandle('stir_motor_origin', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") + ft-button(type="primary", size="small", :click-handle="() => commandHandle('stir_motor_origin', { motorCode: debugStore.formData.stirMotor.relative.motorCode })") | 回原点 - ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_enable', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") + ft-button(size="small", type="primary", :click-handle="() => commandHandle('stir_motor_enable', { motorCode: debugStore.formData.stirMotor.relative.motorCode })") | 电机使能 - ft-button(size="small", :click-handle="() => commandHandle('stir_motor_disable', { motorCode: debugStore.formData.magnetStirMotor.relative.motorCode })") + ft-button(size="small", :click-handle="() => commandHandle('stir_motor_disable', { motorCode: debugStore.formData.stirMotor.relative.motorCode })") | 电机失能 el-divider 磁子投放 ft-button(size="small", type="primary", :click-handle="() => commandHandle('magnet_open')")