diff --git a/src/stores/debugStore.ts b/src/stores/debugStore.ts index 696c639..fa67abf 100644 --- a/src/stores/debugStore.ts +++ b/src/stores/debugStore.ts @@ -66,7 +66,8 @@ export const useDebugStore = defineStore('debug', { // 夹爪 JawData: { velocity: undefined, - distance: undefined, + openDistance: undefined, + closeDistance: undefined, times: undefined, }, }, diff --git a/src/types/debug.d.ts b/src/types/debug.d.ts index 5ab31c4..d6b7709 100644 --- a/src/types/debug.d.ts +++ b/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 } diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index d5efc60..07926bc 100644 --- a/src/views/debug/index.vue +++ b/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 () => { 夹爪舵机
- - + + + + + + + @@ -593,10 +601,7 @@ const debug_door_stop = async () => { - 打开 - - - 闭合 + 执行 停止