|
@ -12,129 +12,397 @@ import java.util.Map; |
|
|
public class DeviceCommandGenerator { |
|
|
public class DeviceCommandGenerator { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* { |
|
|
|
|
|
* cmdName:'getInfoCmd' |
|
|
|
|
|
* cmdId:'', |
|
|
|
|
|
* device:'device', |
|
|
|
|
|
* action:'get' |
|
|
|
|
|
* } |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice device_status_get() { |
|
|
|
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
|
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
|
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
|
|
|
cmdToDevice.setCmdName("device_status_get"); |
|
|
|
|
|
cmdToDevice.setDevice("device"); |
|
|
|
|
|
cmdToDevice.setAction("get"); |
|
|
|
|
|
return cmdToDevice; |
|
|
|
|
|
|
|
|
* 全部关闭三通阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice three_way_valve_close_all() { |
|
|
|
|
|
return three_way_valve_control("close_all"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取设备当前湿度 |
|
|
|
|
|
* { |
|
|
|
|
|
* cmdName:'getInfoCmd' |
|
|
|
|
|
* cmdId:'', |
|
|
|
|
|
* device:'temperature', |
|
|
|
|
|
* action:'get' |
|
|
|
|
|
* } |
|
|
|
|
|
|
|
|
* 打开三通阀喷嘴管路 |
|
|
*/ |
|
|
*/ |
|
|
public static CMDToDevice humidity_get() { |
|
|
|
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
|
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
|
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
|
|
|
cmdToDevice.setCmdName("getInfoCmd"); |
|
|
|
|
|
cmdToDevice.setDevice("humidity"); |
|
|
|
|
|
cmdToDevice.setAction("get"); |
|
|
|
|
|
return cmdToDevice; |
|
|
|
|
|
|
|
|
public static CMDToDevice three_way_valve_open_syringe_pipeline() { |
|
|
|
|
|
return three_way_valve_control("open_nozzle"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 打开三通阀注射器管路 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice three_way_valve_open_spray_pipeline() { |
|
|
|
|
|
return three_way_valve_control("open_syringe"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制三通阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice three_way_valve_control(String action) { |
|
|
|
|
|
return controlCmd("three_way_valve", action, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 关闭清洗阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice wash_valve_close() { |
|
|
|
|
|
return nozzle_valve_control("close"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 开启清洗阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice wash_valve_open() { |
|
|
|
|
|
return nozzle_valve_control("open"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制清洗阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice wash_valve_control(String action) { |
|
|
|
|
|
return controlCmd("wash_valve", action, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 关闭喷嘴阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice nozzle_valve_close() { |
|
|
|
|
|
return nozzle_valve_control("close"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 开启喷嘴阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice nozzle_valve_open() { |
|
|
|
|
|
return nozzle_valve_control("open"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制喷嘴阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice nozzle_valve_control(String action) { |
|
|
|
|
|
return controlCmd("nozzle_valve", action, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 关闭除湿阀 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice dehumidifier_valve_close() { |
|
|
|
|
|
return dehumidifier_valve_control("close"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 开启除湿阀 |
|
|
* 开启除湿阀 |
|
|
* { |
|
|
|
|
|
* cmdName:'controlCmd' |
|
|
|
|
|
* cmdId:'', |
|
|
|
|
|
* device:'dehumidifier_valve', |
|
|
|
|
|
* action:'open|close' |
|
|
|
|
|
* } |
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice dehumidifier_valve_open() { |
|
|
|
|
|
return dehumidifier_valve_control("open"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制除湿阀 |
|
|
*/ |
|
|
*/ |
|
|
public static CMDToDevice dehumidifier_valve_control(String action) { |
|
|
public static CMDToDevice dehumidifier_valve_control(String action) { |
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
|
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
|
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
|
|
|
cmdToDevice.setCmdName("controlCmd"); |
|
|
|
|
|
cmdToDevice.setDevice("dehumidifier_valve"); |
|
|
|
|
|
cmdToDevice.setAction(action); |
|
|
|
|
|
return cmdToDevice; |
|
|
|
|
|
|
|
|
return controlCmd("dehumidifier_valve", action, null); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 推入推出玻片托盘 |
|
|
|
|
|
* { |
|
|
|
|
|
* cmdName:'controlMotorCmd' |
|
|
|
|
|
* cmdId:'', |
|
|
|
|
|
* device:'x', |
|
|
|
|
|
* action:'move', |
|
|
|
|
|
* param:{ |
|
|
|
|
|
* current:'',//电流 |
|
|
|
|
|
* direction:'forward|backward', |
|
|
|
|
|
* position:'根据坐标计算', |
|
|
|
|
|
* speed:''//移动速度 |
|
|
|
|
|
* } |
|
|
|
|
|
* } |
|
|
|
|
|
|
|
|
* 关闭照明灯板 |
|
|
*/ |
|
|
*/ |
|
|
public static CMDToDevice slide_tray(int current, int position, int speed) { |
|
|
|
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
|
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
|
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
|
|
|
cmdToDevice.setCmdName("controlMotorCmd"); |
|
|
|
|
|
cmdToDevice.setDevice("y"); |
|
|
|
|
|
cmdToDevice.setAction("move"); |
|
|
|
|
|
|
|
|
public static CMDToDevice lighting_panel_close() { |
|
|
|
|
|
return controlCmd("lighting_panel", "close", null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 打开照明灯板 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice lighting_panel_open() { |
|
|
|
|
|
return controlCmd("lighting_panel", "open", null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制照明灯板 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice lighting_panel_control(String action) { |
|
|
|
|
|
return controlCmd("lighting_panel", action, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 关闭激光 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice laser_control_close() { |
|
|
|
|
|
return laser_control("open", null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 打开激光 |
|
|
|
|
|
* |
|
|
|
|
|
* @param power 功率[0-100] |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice laser_control_open(Integer power) { |
|
|
|
|
|
return laser_control("open", power); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制激光 |
|
|
|
|
|
* |
|
|
|
|
|
* @param power 功率[0-100] |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice laser_control(String action, Integer power) { |
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
params.put("current",current ); |
|
|
|
|
|
params.put("direction", "forward"); |
|
|
|
|
|
params.put("position", position); |
|
|
|
|
|
params.put("speed", speed); |
|
|
|
|
|
cmdToDevice.setParam(params); |
|
|
|
|
|
return cmdToDevice; |
|
|
|
|
|
|
|
|
params.put("power", power); |
|
|
|
|
|
return controlCmd("laser", action, params); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 关闭高压 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice high_voltage_close() { |
|
|
|
|
|
return high_voltage_control("close", null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 开启高压 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice high_voltage_open(Integer voltage) { |
|
|
|
|
|
return high_voltage_control("open", voltage); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制高压 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice high_voltage_control(String action, Integer voltage) { |
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
|
|
params.put("voltage", voltage); |
|
|
|
|
|
return controlCmd("high_voltage", action, params); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 停止推动注射泵 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice syringe_pump_stop() { |
|
|
|
|
|
return controlCmd("syringe_pump", "stop", null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 推动移动注射泵 |
|
|
|
|
|
* |
|
|
|
|
|
* @param volume 是指注射泵每分钟注射多少微升(volume 最低0.1) |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice syringe_pump_injection_volume_set(Integer volume) { |
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
|
|
params.put("current", "forward"); |
|
|
|
|
|
params.put("volume", volume); |
|
|
|
|
|
return controlCmd("syringe_pump", "move", params); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制注射泵 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice syringe_pump_control(String action, String forward, Integer volume) { |
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
|
|
params.put("current", forward); |
|
|
|
|
|
params.put("volume", volume); |
|
|
|
|
|
return controlCmd("syringe_pump", action, params); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取设备当前湿度 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice humidity_get() { |
|
|
|
|
|
return getInfoCmd("humidity"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取设备当前温度 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice temperature_get() { |
|
|
|
|
|
return getInfoCmd("temperature"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 推入玻片托盘 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice slide_tray_in(int position, int speed) { |
|
|
|
|
|
return motor_y_distance_set(position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 推出玻片托盘 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice slide_tray_out(Integer position, Integer speed) { |
|
|
|
|
|
return motor_y_distance_set(position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获得电机XYZ相对原点坐标 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_xyz_position_get() { |
|
|
|
|
|
return getInfoCmd("xyz"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* x轴停止移动 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_x_stop() { |
|
|
|
|
|
return motor_x("stop", null, null, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* y轴停止移动 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_y_stop() { |
|
|
|
|
|
return motor_x("stop", null, null, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* z轴停止移动 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_z_stop() { |
|
|
|
|
|
return motor_x("stop", null, null, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* x轴回原点 |
|
|
* x轴回原点 |
|
|
*/ |
|
|
*/ |
|
|
public static CMDToDevice motor_x_to_home() { |
|
|
|
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
|
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
|
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
|
|
|
cmdToDevice.setCmdName("controlMotorCmd"); |
|
|
|
|
|
cmdToDevice.setDevice("x"); |
|
|
|
|
|
cmdToDevice.setAction("origin"); |
|
|
|
|
|
return cmdToDevice; |
|
|
|
|
|
|
|
|
public static CMDToDevice motor_x_origin() { |
|
|
|
|
|
return motor_x("origin", null, null, null, null); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* y轴回原点 |
|
|
* y轴回原点 |
|
|
*/ |
|
|
*/ |
|
|
public static CMDToDevice motor_y_to_home() { |
|
|
|
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
|
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
|
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
|
|
|
cmdToDevice.setCmdName("controlMotorCmd"); |
|
|
|
|
|
cmdToDevice.setDevice("y"); |
|
|
|
|
|
cmdToDevice.setAction("origin"); |
|
|
|
|
|
return cmdToDevice; |
|
|
|
|
|
|
|
|
public static CMDToDevice motor_y_origin() { |
|
|
|
|
|
return motor_y("origin", null, null, null, null); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* z轴回原点 |
|
|
* z轴回原点 |
|
|
*/ |
|
|
*/ |
|
|
public static CMDToDevice motor_z_to_home() { |
|
|
|
|
|
|
|
|
public static CMDToDevice motor_z_origin() { |
|
|
|
|
|
return motor_z("origin", null, null, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 移动x轴到指定位置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_x_distance_set(Integer position, Integer speed) { |
|
|
|
|
|
return motor_x("move", null, "forward", position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 移动y轴到指定位置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_y_distance_set(Integer position, Integer speed) { |
|
|
|
|
|
return motor_y("move", null, "forward", position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 移动z轴到指定位置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_z_distance_set(Integer position, Integer speed) { |
|
|
|
|
|
return motor_z("move", null, "forward", position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* x电机方向设置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_x_direction_set(String direction) { |
|
|
|
|
|
return motor_x("set", null, direction, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* y电机方向设置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_y_direction_set(String direction) { |
|
|
|
|
|
return motor_y("set", null, direction, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* z电机方向设置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_z_direction_set(String direction) { |
|
|
|
|
|
return motor_z("set", null, direction, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* x轴电机电流设置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_x_current_set(Integer current) { |
|
|
|
|
|
return controlMotorCmd("x", "set", current, null, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* y轴电机电流设置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_y_current_set(Integer current) { |
|
|
|
|
|
return controlMotorCmd("y", "set", current, null, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* z轴电机电流设置 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_z_current_set(Integer current) { |
|
|
|
|
|
return controlMotorCmd("z", "set", current, null, null, null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* x轴电机控制 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_x(String action, Integer current, String direction, Integer position, Integer speed) { |
|
|
|
|
|
return controlMotorCmd("x", action, current, direction, position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 轴电机控制 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_y(String action, Integer current, String direction, Integer position, Integer speed) { |
|
|
|
|
|
return controlMotorCmd("y", action, current, direction, position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* z轴电机控制 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice motor_z(String action, Integer current, String direction, Integer position, Integer speed) { |
|
|
|
|
|
return controlMotorCmd("z", action, current, direction, position, speed); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制电机指令 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice controlMotorCmd(String device, String action, Integer current, String direction, Integer position, Integer speed) { |
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
|
|
params.put("current", current); |
|
|
|
|
|
params.put("direction", direction); |
|
|
|
|
|
params.put("position", position); |
|
|
|
|
|
params.put("speed", speed); |
|
|
|
|
|
return deviceCmd("controlMotorCmd", device, action, params); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 控制指令 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice controlCmd(String device, String action, Map<String, Object> params) { |
|
|
|
|
|
return deviceCmd("controlCmd", device, action, params); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取信息指令 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice getInfoCmd(String device) { |
|
|
|
|
|
return deviceCmd("controlCmd", device, "get", null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 设备指令 |
|
|
|
|
|
*/ |
|
|
|
|
|
public static CMDToDevice deviceCmd(String cmdName, String device, String action, Map<String, Object> params) { |
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
int cmdId = CyclicNumberGenerator.getInstance().generateNumber(); |
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
CMDToDevice cmdToDevice = new CMDToDevice(); |
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
cmdToDevice.setCmdId(cmdId); |
|
|
cmdToDevice.setCmdName("controlMotorCmd"); |
|
|
|
|
|
cmdToDevice.setDevice("z"); |
|
|
|
|
|
cmdToDevice.setAction("origin"); |
|
|
|
|
|
|
|
|
cmdToDevice.setCmdName(cmdName); |
|
|
|
|
|
cmdToDevice.setDevice(device); |
|
|
|
|
|
cmdToDevice.setAction(action); |
|
|
|
|
|
cmdToDevice.setParam(params); |
|
|
return cmdToDevice; |
|
|
return cmdToDevice; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|