Browse Source

fix:指令生成增加抱闸

master
王梦远 2 months ago
parent
commit
c0efcb9028
  1. 150
      src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java
  2. 2
      src/main/java/com/iflytop/sgs/common/enums/cmd/CmdAction.java

150
src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java

@ -72,19 +72,23 @@ public class DeviceCommandGenerator {
public static DeviceCommandBundle doorEnable() { public static DeviceCommandBundle doorEnable() {
return controlMotorCmd(CmdDevice.door_motor, CmdAction.enable, null, "门 使能"); 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轴设置参数 * 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轴回原点 * z轴回原点
@ -135,59 +135,78 @@ public class DeviceCommandGenerator {
public static DeviceCommandBundle transferZOrigin() { public static DeviceCommandBundle transferZOrigin() {
return controlMotorCmd(CmdDevice.z_motor, CmdAction.origin, null, "z轴回原点"); 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 * @param position 位置 单位 mm
*/ */
public static DeviceCommandBundle transferXMove(Double position) {
public static DeviceCommandBundle transferZMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position); 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 * @param position 位置 单位 mm
*/ */
public static DeviceCommandBundle transferZMove(Double position) {
public static DeviceCommandBundle transferZMoveBy(Double position) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position); 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 * @param position 位置 单位 mm
*/ */
public static DeviceCommandBundle transferXMoveBy(Double position) {
public static DeviceCommandBundle transferXMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position); 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 * @param position 位置 单位 mm
*/ */
public static DeviceCommandBundle transferZMoveBy(Double position) {
public static DeviceCommandBundle transferXMoveBy(Double position) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position); params.setPosition(position);
return controlMotorCmd(CmdDevice.z_motor, CmdAction.move_by, params, "z轴相对移动");
return controlMotorCmd(CmdDevice.x_motor, CmdAction.move_by, params, "x轴相对移动");
} }
/** /**
* 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() { 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 * @param speed 速度 单位 mm/s

2
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, close, stop, start, set, get,
open_power, close_power, open_circle, close_circle, open_power, close_power, open_circle, close_circle,
open_heart, close_heart, open_cool, close_cool, take_photo, open_heart, close_heart, open_cool, close_cool, take_photo,
enable,disable
enable,disable,open_clamp,close_clamp,
} }
Loading…
Cancel
Save