diff --git a/src/services/globalCmd/globalCmd.ts b/src/services/globalCmd/globalCmd.ts index 4f2788a..9e26bcc 100644 --- a/src/services/globalCmd/globalCmd.ts +++ b/src/services/globalCmd/globalCmd.ts @@ -22,7 +22,6 @@ export function switchThreeWayValve(params: { type: string }) { }); } - //氮气三路 export function controlValve(params: ControlValueType) { const commandId = addTxnRecord({ ...params, category: "debug" }); @@ -72,6 +71,9 @@ export function pushInTray(params: Record) { export function rotate(params: any) { return httpRequest>({ url: "/api/cmd/rotate", params, method: "POST" }); } +export function setMotorSpeed(params: { axis: "X" | "Y" | "Z"; speed: number }) { + return httpRequest>({ url: "/api/cmd/setMotorSpeed", params: { params }, method: "POST" }); +} export type SprayParam = { matrixId: number; @@ -103,7 +105,6 @@ export function stopDehumidify() { return httpRequest({ url: "/api/cmd/stopDehumidify", method: "POST" }); } - //停止电机 export function stopMotor(params: any) { return httpRequest>({ url: "/api/cmd/stopMotor", params, method: "POST" }); diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index 1c7751b..db8ec07 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -102,7 +102,7 @@ Z
- 速度:毫米/秒 + 速度:毫米/秒
@@ -295,7 +295,8 @@ import { turnOffLightPanel, turnOnLightPanel, stopWash, - stopDehumidify + stopDehumidify, + setMotorSpeed } from "@/services/globalCmd/globalCmd"; const activeName = ref('debug') const voltageValue = ref() @@ -311,7 +312,7 @@ import { index: 0 }) - const rotateForm = ref>({}) + const rotateForm = ref<{ axis: "X" | "Y" | "Z"; speed: number }>({axis:"X",speed:20}) let subscription:any onMounted(()=>{ //连接websocket @@ -447,11 +448,10 @@ import { const onRotate = () => { const params = { - params : { ...rotateForm.value - } } - rotate(params).then((res:any) => { + + setMotorSpeed(params).then((res:any) => { success(res) }) }