Browse Source

fix: 调试页面增加循环次数

feature/three
guoapeng 3 months ago
parent
commit
8055e05206
  1. 8
      src/stores/debugStore.ts
  2. 8
      src/types/debug.d.ts
  3. 113
      src/views/debug/index.vue

8
src/stores/debugStore.ts

@ -31,6 +31,7 @@ export const useDebugStore = defineStore('debug', {
heatMotorData: { heatMotorData: {
distance: undefined, distance: undefined,
velocity: undefined, velocity: undefined,
times: undefined,
}, },
heatTemperature: { heatTemperature: {
temperature: undefined, temperature: undefined,
@ -45,21 +46,28 @@ export const useDebugStore = defineStore('debug', {
xMotorData: { xMotorData: {
xDimDistance: undefined, xDimDistance: undefined,
xDimVelocity: undefined, xDimVelocity: undefined,
times: undefined,
direction: 'backward',
}, },
// y轴 // y轴
yMotorData: { yMotorData: {
yDimDistance: undefined, yDimDistance: undefined,
yDimVelocity: undefined, yDimVelocity: undefined,
times: undefined,
direction: 'backward',
}, },
// z轴 // z轴
zMotorData: { zMotorData: {
zDimDistance: undefined, zDimDistance: undefined,
zDimVelocity: undefined, zDimVelocity: undefined,
times: undefined,
direction: 'forward',
}, },
// 夹爪 // 夹爪
JawData: { JawData: {
velocity: undefined, velocity: undefined,
distance: undefined, distance: undefined,
times: undefined,
}, },
}, },
// 拍子模组 // 拍子模组

8
src/types/debug.d.ts

@ -31,6 +31,7 @@ declare namespace Debug {
interface HeatMotorData { interface HeatMotorData {
distance: number | undefined distance: number | undefined
velocity: number | undefined velocity: number | undefined
times: number | undefined
} }
interface HeatTemperature { interface HeatTemperature {
@ -50,21 +51,28 @@ declare namespace Debug {
interface XMotorData { interface XMotorData {
xDimDistance: number | undefined xDimDistance: number | undefined
xDimVelocity: number | undefined xDimVelocity: number | undefined
times: number | undefined
direction: 'forward' | 'backward'
} }
interface YMotorData { interface YMotorData {
yDimDistance: number | undefined yDimDistance: number | undefined
yDimVelocity: number | undefined yDimVelocity: number | undefined
times: number | undefined
direction: 'forward' | 'backward'
} }
interface ZMotorData { interface ZMotorData {
zDimDistance: number | undefined zDimDistance: number | undefined
zDimVelocity: number | undefined zDimVelocity: number | undefined
times: number | undefined
direction: 'forward' | 'backward'
} }
interface JawData { interface JawData {
velocity: number | undefined velocity: number | undefined
distance: number | undefined distance: number | undefined
times: number | undefined
} }
interface TransferModule { interface TransferModule {

113
src/views/debug/index.vue

@ -335,6 +335,7 @@ const debug_shaker_stop = async () => {
} }
const debug_transportation_arm_reset = async (motor: 'x' | 'y' | 'z') => { const debug_transportation_arm_reset = async (motor: 'x' | 'y' | 'z') => {
console.log(debugStore.formData.transferModule[`${motor}MotorData`])
currentCommandId = Date.now().toString() currentCommandId = Date.now().toString()
const params = { const params = {
commandId: currentCommandId, commandId: currentCommandId,
@ -346,13 +347,14 @@ const debug_transportation_arm_reset = async (motor: 'x' | 'y' | 'z') => {
await debugStore.sendControl(params) await debugStore.sendControl(params)
} }
const debug_transportation_arm_move = async (motor: 'x' | 'y' | 'z') => {
const debug_transportation_arm_move = async (motor: 'x' | 'y' | 'z', direction: 'forward' | 'backward') => {
currentCommandId = Date.now().toString() currentCommandId = Date.now().toString()
const params = { const params = {
commandId: currentCommandId, commandId: currentCommandId,
command: 'debug_transportation_arm_move', command: 'debug_transportation_arm_move',
params: { params: {
...debugStore.formData.transferModule[`${motor}MotorData`], ...debugStore.formData.transferModule[`${motor}MotorData`],
[`${motor}DimDistance`]: direction === 'backward' ? -debugStore.formData.transferModule[`${motor}MotorData`][`${motor}DimDistance`] : debugStore.formData.transferModule[`${motor}MotorData`][`${motor}DimDistance`],
}, },
} }
await debugStore.sendControl(params) await debugStore.sendControl(params)
@ -462,16 +464,26 @@ const debug_door_stop = async () => {
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="循环">
<el-input v-model.number="debugStore.formData.transferModule.xMotorData.times" type="number" placeholder="请输入次数">
<template #append>
</template>
</el-input>
</el-form-item>
<el-form-item> <el-form-item>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('x')">
回原点
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('x', 'forward')">
前进
</ft-button> </ft-button>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('x')">
开始
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('x', 'backward')">
后退
</ft-button> </ft-button>
<ft-button :click-handle="() => debug_transportation_arm_stop('x')"> <ft-button :click-handle="() => debug_transportation_arm_stop('x')">
停止 停止
</ft-button> </ft-button>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('x')">
回原点
</ft-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -492,16 +504,26 @@ const debug_door_stop = async () => {
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="循环">
<el-input v-model.number="debugStore.formData.transferModule.yMotorData.times" type="number" placeholder="请输入次数">
<template #append>
</template>
</el-input>
</el-form-item>
<el-form-item> <el-form-item>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('y')">
回原点
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('y', 'forward')">
前进
</ft-button> </ft-button>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('y')">
开始
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('y', 'backward')">
后退
</ft-button> </ft-button>
<ft-button :click-handle="() => debug_transportation_arm_stop('y')"> <ft-button :click-handle="() => debug_transportation_arm_stop('y')">
停止 停止
</ft-button> </ft-button>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('y')">
回原点
</ft-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -522,16 +544,26 @@ const debug_door_stop = async () => {
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="循环">
<el-input v-model.number="debugStore.formData.transferModule.zMotorData.times" type="number" placeholder="请输入次数">
<template #append>
</template>
</el-input>
</el-form-item>
<el-form-item> <el-form-item>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('z')">
回原点
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('z', 'forward')">
前进
</ft-button> </ft-button>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('z')">
开始
<ft-button type="primary" :click-handle="() => debug_transportation_arm_move('z', 'backward')">
后退
</ft-button> </ft-button>
<ft-button :click-handle="() => debug_transportation_arm_stop('z')"> <ft-button :click-handle="() => debug_transportation_arm_stop('z')">
停止 停止
</ft-button> </ft-button>
<ft-button type="primary" :click-handle="() => debug_transportation_arm_reset('z')">
回原点
</ft-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -552,6 +584,13 @@ const debug_door_stop = async () => {
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="循环">
<el-input v-model.number="debugStore.formData.transferModule.JawData.times" type="number" placeholder="请输入次数">
<template #append>
</template>
</el-input>
</el-form-item>
<el-form-item> <el-form-item>
<ft-button type="primary" :click-handle="debug_holding_jaw_open"> <ft-button type="primary" :click-handle="debug_holding_jaw_open">
打开 打开
@ -566,24 +605,6 @@ const debug_door_stop = async () => {
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
<el-card>
<template #header>
<div class="card-header">
<span></span>
</div>
</template>
<div class="card-box">
<ft-button type="primary" :click-handle="debug_door_open">
开门
</ft-button>
<ft-button type="primary" :click-handle="debug_door_close">
关门
</ft-button>
<ft-button :click-handle="debug_door_stop">
停止
</ft-button>
</div>
</el-card>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-card> <el-card>
@ -745,6 +766,24 @@ const debug_door_stop = async () => {
<!-- </el-form> --> <!-- </el-form> -->
</div> </div>
</el-card> </el-card>
<el-card>
<template #header>
<div class="card-header">
<span></span>
</div>
</template>
<div class="card-box">
<ft-button type="primary" :click-handle="debug_door_open">
开门
</ft-button>
<ft-button type="primary" :click-handle="debug_door_close">
关门
</ft-button>
<ft-button :click-handle="debug_door_stop">
停止
</ft-button>
</div>
</el-card>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-card> <el-card>
@ -775,6 +814,13 @@ const debug_door_stop = async () => {
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="循环">
<el-input v-model.number="debugStore.formData.heatArea.heatMotorData.times" type="number" placeholder="请输入次数">
<template #append>
</template>
</el-input>
</el-form-item>
</el-form> </el-form>
<ft-button type="primary" :click-handle="debug_pallet_elevator_lift_up"> <ft-button type="primary" :click-handle="debug_pallet_elevator_lift_up">
上升 上升
@ -958,4 +1004,9 @@ const debug_door_stop = async () => {
:deep(.el-card__body) { :deep(.el-card__body) {
padding: 10px; padding: 10px;
} }
.el-form-item__content {
.ft-button {
margin-bottom: 10px;
}
}
</style> </style>
Loading…
Cancel
Save