diff --git a/src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java b/src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java index 8b7c71b..06440c1 100644 --- a/src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java +++ b/src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java @@ -72,19 +72,23 @@ public class DeviceCommandGenerator { public static DeviceCommandBundle doorEnable() { return controlMotorCmd(CmdDevice.door_motor, CmdAction.enable, null, "门 使能"); } - /** - * x轴设置参数 + * 门 开启抱闸 * - * @param speed 速度 单位 mm/s */ - public static DeviceCommandBundle transferXSet(Double speed) { - DeviceCommandParams params = new DeviceCommandParams(); - params.setSpeed(speed); - return setInfoCmd(CmdDevice.x_motor, CmdAction.set, params, "x轴设置参数"); + public static DeviceCommandBundle doorOpenClamp() { + return controlMotorCmd(CmdDevice.door_motor, CmdAction.open_clamp, null, "门 开启抱闸"); + } + /** + * 门 关闭抱闸 + * + */ + public static DeviceCommandBundle doorCloseClamp() { + return controlMotorCmd(CmdDevice.door_motor, CmdAction.close_clamp, null, "门 关闭抱闸"); } + /** * z轴设置参数 * @@ -97,37 +101,33 @@ public class DeviceCommandGenerator { } /** - * 加液位升降电机参数设置 + * z轴 失能 * - * @param speed 速度 单位 mm/s */ - public static DeviceCommandBundle liquidMotorSet(Double speed) { - DeviceCommandParams params = new DeviceCommandParams(); - params.setSpeed(speed); - return setInfoCmd(CmdDevice.liquid_motor, CmdAction.set, params, "加液臂电机设置参数"); + public static DeviceCommandBundle transferZDisable() { + return controlMotorCmd(CmdDevice.z_motor, CmdAction.disable, null, "z轴 失能"); } - - /** - * 转运 x轴回原点 + * z轴 使能 + * */ - public static DeviceCommandBundle transferXOrigin() { - return controlMotorCmd(CmdDevice.x_motor, CmdAction.origin, null, "x轴回原点"); + public static DeviceCommandBundle transferZEnable() { + return controlMotorCmd(CmdDevice.z_motor, CmdAction.enable, null, "z轴 使能"); } /** - * z轴 失能 + * z轴 开启抱闸 * */ - public static DeviceCommandBundle transferZDisable() { - return controlMotorCmd(CmdDevice.z_motor, CmdAction.disable, null, "z轴 失能"); + public static DeviceCommandBundle transferZOpenClamp() { + return controlMotorCmd(CmdDevice.z_motor, CmdAction.open_clamp, null, "z轴 开启抱闸"); } /** - * z轴 使能 + * z轴 关闭抱闸 * */ - public static DeviceCommandBundle transferZEnable() { - return controlMotorCmd(CmdDevice.z_motor, CmdAction.enable, null, "z轴 使能"); + public static DeviceCommandBundle transferZCloseClamp() { + return controlMotorCmd(CmdDevice.z_motor, CmdAction.close_clamp, null, "z轴 关闭抱闸"); } /** * z轴回原点 @@ -135,59 +135,78 @@ public class DeviceCommandGenerator { public static DeviceCommandBundle transferZOrigin() { return controlMotorCmd(CmdDevice.z_motor, CmdAction.origin, null, "z轴回原点"); } - /** - * 加液位升降电机回原点 - */ - public static DeviceCommandBundle motorLiquidOrigin() { - return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.origin, null, "加液位电机 回原点"); - } /** - * x轴移动 + * z轴移动 * * @param position 位置 单位 mm */ - public static DeviceCommandBundle transferXMove(Double position) { + public static DeviceCommandBundle transferZMove(Double position) { DeviceCommandParams params = new DeviceCommandParams(); params.setPosition(position); - return controlMotorCmd(CmdDevice.x_motor, CmdAction.move, params, "x轴绝对移动"); + return controlMotorCmd(CmdDevice.z_motor, CmdAction.move, params, "z轴移动"); } - - /** - * z轴移动 + * z轴停止 + */ + public static DeviceCommandBundle transferZStop() { + return controlMotorCmd(CmdDevice.z_motor, CmdAction.stop, null, "z轴停止"); + } + /** + * z轴相对移动 * * @param position 位置 单位 mm */ - public static DeviceCommandBundle transferZMove(Double position) { + public static DeviceCommandBundle transferZMoveBy(Double position) { DeviceCommandParams params = new DeviceCommandParams(); params.setPosition(position); - return controlMotorCmd(CmdDevice.z_motor, CmdAction.move, params, "z轴移动"); + return controlMotorCmd(CmdDevice.z_motor, CmdAction.move_by, params, "z轴相对移动"); } - /** - * x轴相对移动 + * 加液位升降电机回原点 + */ + public static DeviceCommandBundle motorLiquidOrigin() { + return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.origin, null, "加液位电机 回原点"); + } + /** + * x轴设置参数 + * + * @param speed 速度 单位 mm/s + */ + public static DeviceCommandBundle transferXSet(Double speed) { + DeviceCommandParams params = new DeviceCommandParams(); + params.setSpeed(speed); + return setInfoCmd(CmdDevice.x_motor, CmdAction.set, params, "x轴设置参数"); + } + /** + * x轴 回原点 + */ + public static DeviceCommandBundle transferXOrigin() { + return controlMotorCmd(CmdDevice.x_motor, CmdAction.origin, null, "x轴回原点"); + } + /** + * x轴移动 * * @param position 位置 单位 mm */ - public static DeviceCommandBundle transferXMoveBy(Double position) { + public static DeviceCommandBundle transferXMove(Double position) { DeviceCommandParams params = new DeviceCommandParams(); params.setPosition(position); - return controlMotorCmd(CmdDevice.x_motor, CmdAction.move_by, params, "x轴相对移动"); + return controlMotorCmd(CmdDevice.x_motor, CmdAction.move, params, "x轴绝对移动"); } - /** - * z轴相对移动 + * x轴相对移动 * * @param position 位置 单位 mm */ - public static DeviceCommandBundle transferZMoveBy(Double position) { + public static DeviceCommandBundle transferXMoveBy(Double position) { DeviceCommandParams params = new DeviceCommandParams(); params.setPosition(position); - return controlMotorCmd(CmdDevice.z_motor, CmdAction.move_by, params, "z轴相对移动"); + return controlMotorCmd(CmdDevice.x_motor, CmdAction.move_by, params, "x轴相对移动"); } + /** * x轴停止 */ @@ -210,13 +229,31 @@ public class DeviceCommandGenerator { } /** - * z轴停止 + * x轴 开启抱闸 + * */ - public static DeviceCommandBundle transferZStop() { - return controlMotorCmd(CmdDevice.z_motor, CmdAction.stop, null, "z轴停止"); + public static DeviceCommandBundle transferXOpenClamp() { + return controlMotorCmd(CmdDevice.x_motor, CmdAction.open_clamp, null, "x轴 开启抱闸"); + } + /** + * x轴 关闭抱闸 + * + */ + public static DeviceCommandBundle transferXCloseClamp() { + return controlMotorCmd(CmdDevice.x_motor, CmdAction.close_clamp, null, "x轴 关闭抱闸"); } /** + * 加液位升降电机参数设置 + * + * @param speed 速度 单位 mm/s + */ + public static DeviceCommandBundle liquidMotorSet(Double speed) { + DeviceCommandParams params = new DeviceCommandParams(); + params.setSpeed(speed); + return setInfoCmd(CmdDevice.liquid_motor, CmdAction.set, params, "加液臂电机设置参数"); + } + /** * 加液位电机停止 */ public static DeviceCommandBundle liquidMotorStop() { @@ -260,6 +297,21 @@ public class DeviceCommandGenerator { } /** + * 加液机械臂 开启抱闸 + * + */ + public static DeviceCommandBundle liquidMotorOpenClamp() { + return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.open_clamp, null, "加液机械臂 开启抱闸"); + } + /** + * 加液机械臂 关闭抱闸 + * + */ + public static DeviceCommandBundle liquidMotorCloseClamp() { + return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.close_clamp, null, "加液机械臂 关闭抱闸"); + } + + /** * 加液泵设置参数 * * @param speed 速度 单位 mm/s diff --git a/src/main/java/com/iflytop/sgs/common/enums/cmd/CmdAction.java b/src/main/java/com/iflytop/sgs/common/enums/cmd/CmdAction.java index aa3eb4a..1e741ad 100644 --- a/src/main/java/com/iflytop/sgs/common/enums/cmd/CmdAction.java +++ b/src/main/java/com/iflytop/sgs/common/enums/cmd/CmdAction.java @@ -6,5 +6,5 @@ public enum CmdAction { open, close, stop, start, set, get, open_power, close_power, open_circle, close_circle, open_heart, close_heart, open_cool, close_cool, take_photo, - enable,disable + enable,disable,open_clamp,close_clamp, }