Browse Source

fix: 夹爪调试参数变更

feature/three
guoapeng 3 months ago
parent
commit
3368b94a94
  1. 3
      src/stores/debugStore.ts
  2. 3
      src/types/debug.d.ts
  3. 41
      src/views/debug/index.vue

3
src/stores/debugStore.ts

@ -66,7 +66,8 @@ export const useDebugStore = defineStore('debug', {
// 夹爪
JawData: {
velocity: undefined,
distance: undefined,
openDistance: undefined,
closeDistance: undefined,
times: undefined,
},
},

3
src/types/debug.d.ts

@ -71,7 +71,8 @@ declare namespace Debug {
interface JawData {
velocity: number | undefined
distance: number | undefined
openDistance: number | undefined
closeDistance: number | undefined
times: number | undefined
}

41
src/views/debug/index.vue

@ -348,13 +348,14 @@ const debug_transportation_arm_reset = async (motor: 'x' | 'y' | 'z') => {
}
const debug_transportation_arm_move = async (motor: 'x' | 'y' | 'z', direction: 'forward' | 'backward') => {
const distance = direction === 'backward' ? -debugStore.formData.transferModule[`${motor}MotorData`][`${motor}DimDistance`] : debugStore.formData.transferModule[`${motor}MotorData`][`${motor}DimDistance`]
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'debug_transportation_arm_move',
params: {
...debugStore.formData.transferModule[`${motor}MotorData`],
[`${motor}DimDistance`]: direction === 'backward' ? -debugStore.formData.transferModule[`${motor}MotorData`][`${motor}DimDistance`] : debugStore.formData.transferModule[`${motor}MotorData`][`${motor}DimDistance`],
[`${motor}DimDistance`]: distance,
},
}
await debugStore.sendControl(params)
@ -384,17 +385,17 @@ const debug_holding_jaw_open = async () => {
await debugStore.sendControl(params)
}
const debug_holding_jaw_close = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'debug_holding_jaw_close',
params: {
...debugStore.formData.transferModule.JawData,
},
}
await debugStore.sendControl(params)
}
// const debug_holding_jaw_close = async () => {
// currentCommandId = Date.now().toString()
// const params = {
// commandId: currentCommandId,
// command: 'debug_holding_jaw_close',
// params: {
// ...debugStore.formData.transferModule.JawData,
// },
// }
// await debugStore.sendControl(params)
// }
const debug_holding_jaw_pause = async () => {
currentCommandId = Date.now().toString()
@ -570,8 +571,15 @@ const debug_door_stop = async () => {
<el-divider>夹爪舵机</el-divider>
<div class="card-box">
<el-form>
<el-form-item label="距离">
<el-input v-model.number="debugStore.formData.transferModule.JawData.distance" type="number" placeholder="请输入距离">
<el-form-item label="打开位置">
<el-input v-model.number="debugStore.formData.transferModule.JawData.openDistance" type="number" placeholder="请输入打开位置">
<template #append>
mm
</template>
</el-input>
</el-form-item>
<el-form-item label="闭合位置">
<el-input v-model.number="debugStore.formData.transferModule.JawData.closeDistance" type="number" placeholder="请输入闭合位置">
<template #append>
mm
</template>
@ -593,10 +601,7 @@ const debug_door_stop = async () => {
</el-form-item>
<el-form-item>
<ft-button type="primary" :click-handle="debug_holding_jaw_open">
打开
</ft-button>
<ft-button type="primary" :click-handle="debug_holding_jaw_close">
闭合
执行
</ft-button>
<ft-button :click-handle="debug_holding_jaw_pause">
停止

Loading…
Cancel
Save