add 烘箱桁架 分切桁架 行走行信号

This commit is contained in:
张江玮
2023-10-09 10:40:16 +08:00
parent 1dd02f0195
commit c5a061454f
5 changed files with 41 additions and 6 deletions

View File

@@ -22,10 +22,12 @@ public class ItemProtocol {
public static String item_action = "action"; public static String item_action = "action";
//行走列 //行走列
public static String item_walk_y = "walk_y"; public static String item_walk_y = "walk_y";
//报警
public static String item_error = "error";
//任务号 //任务号
public static String item_task = "task"; public static String item_task = "task";
//报警
public static String item_error = "error";
//行走行
public static String item_walk_x = "walk_x";
//下发命令 //下发命令
public static String item_to_command = "to_command"; public static String item_to_command = "to_command";
@@ -87,6 +89,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_onset); return this.getOpcIntegerValue(item_to_onset);
} }
public int getWalk_x() {
return this.getOpcIntegerValue(item_walk_x);
}
Boolean isonline; Boolean isonline;
@@ -114,7 +120,7 @@ public class ItemProtocol {
} }
public static List<ItemDto> getReadableItemDtos() { public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList(); ArrayList<ItemDto> list = new ArrayList<>();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1")); list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
list.add(new ItemDto(item_move, "光电信号", "DB1.B2")); list.add(new ItemDto(item_move, "光电信号", "DB1.B2"));
@@ -122,11 +128,12 @@ public class ItemProtocol {
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
list.add(new ItemDto(item_task, "任务号", "DB1.D6")); list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
list.add(new ItemDto(item_walk_x, "行走行", "DB1.B10"));
return list; return list;
} }
public static List<ItemDto> getWriteableItemDtos() { public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList(); ArrayList<ItemDto> list = new ArrayList<>();
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0")); list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2")); list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2"));
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4")); list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4"));

View File

@@ -88,6 +88,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
//任务号 //任务号
int task = 0; int task = 0;
int last_task = 0; int last_task = 0;
//行走行
int walk_x = 0;
int last_walk_x = 0;
int heartbeat = 0; int heartbeat = 0;
int last_heartbeat = 0; int last_heartbeat = 0;
@@ -163,6 +166,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
to_target = this.itemProtocol.getTo_target(); to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task(); to_task = this.itemProtocol.getTo_task();
to_onset = this.itemProtocol.getTo_onset(); to_onset = this.itemProtocol.getTo_onset();
// walk_x = this.itemProtocol.getWalk_x();
// if(heartbeat != last_heartbeat){ // if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat); // logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// } // }
@@ -244,6 +248,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task); logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
} }
// if (walk_x != last_walk_x) {
// logServer.deviceItemValue(this.device_code, "walk_x", String.valueOf(walk_x));
// logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_x" + last_walk_x + "->" + walk_x);
// }
update_instruction_status(); update_instruction_status();
@@ -320,6 +328,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
last_to_command = to_command; last_to_command = to_command;
last_to_target = to_target; last_to_target = to_target;
last_to_onset = to_onset; last_to_onset = to_onset;
// last_walk_x = walk_x;
} }

View File

@@ -36,6 +36,8 @@ public class ItemProtocol {
public static String item_task1 = "task1"; public static String item_task1 = "task1";
//后工位任务号 //后工位任务号
public static String item_task2 = "task2"; public static String item_task2 = "task2";
//行走行
public static String item_walk_x = "walk_x";
//前工位下发命令 //前工位下发命令
@@ -144,6 +146,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_onset2); return this.getOpcIntegerValue(item_to_onset2);
} }
public int getWalk_x() {
return this.getOpcIntegerValue(item_walk_x);
}
//是否有货 //是否有货
public int hasGoods(int move) { public int hasGoods(int move) {
@@ -176,7 +182,7 @@ public class ItemProtocol {
} }
public static List<ItemDto> getReadableItemDtos() { public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList(); ArrayList<ItemDto> list = new ArrayList<>();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1")); list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
list.add(new ItemDto(item_status, "设备状态", "DB1.B2")); list.add(new ItemDto(item_status, "设备状态", "DB1.B2"));
@@ -189,11 +195,12 @@ public class ItemProtocol {
list.add(new ItemDto(item_type, "任务类型", "DB1.B9")); list.add(new ItemDto(item_type, "任务类型", "DB1.B9"));
list.add(new ItemDto(item_task1, "前工位任务号", "DB1.D10")); list.add(new ItemDto(item_task1, "前工位任务号", "DB1.D10"));
list.add(new ItemDto(item_task2, "后工位任务号", "DB1.D14")); list.add(new ItemDto(item_task2, "后工位任务号", "DB1.D14"));
list.add(new ItemDto(item_walk_x, "行走列", "DB1.B18"));
return list; return list;
} }
public static List<ItemDto> getWriteableItemDtos() { public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList(); ArrayList<ItemDto> list = new ArrayList<>();
list.add(new ItemDto(item_to_command1, "前工位下发命令", "DB2.W0")); list.add(new ItemDto(item_to_command1, "前工位下发命令", "DB2.W0"));
list.add(new ItemDto(item_to_onset1, "前工位下发起始站", "DB2.W2")); list.add(new ItemDto(item_to_onset1, "前工位下发起始站", "DB2.W2"));
list.add(new ItemDto(item_to_target1, "前工位下发目标站", "DB2.W4")); list.add(new ItemDto(item_to_target1, "前工位下发目标站", "DB2.W4"));

View File

@@ -104,6 +104,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
int last_task1 = 0; int last_task1 = 0;
int task2 = 0; int task2 = 0;
int last_task2 = 0; int last_task2 = 0;
//行走行
int walk_x = 0;
int last_walk_x = 0;
int to_command1 = 0; int to_command1 = 0;
int last_to_command1 = 0; int last_to_command1 = 0;
int to_command2 = 0; int to_command2 = 0;
@@ -194,6 +198,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
type = this.itemProtocol.getType(); type = this.itemProtocol.getType();
task1 = this.itemProtocol.getTask1(); task1 = this.itemProtocol.getTask1();
task2 = this.itemProtocol.getTask2(); task2 = this.itemProtocol.getTask2();
// walk_x = this.itemProtocol.getWalk_x();
to_command1 = this.itemProtocol.getTo_command1(); to_command1 = this.itemProtocol.getTo_command1();
to_command2 = this.itemProtocol.getTo_command2(); to_command2 = this.itemProtocol.getTo_command2();
heartbeat = this.itemProtocol.getHeartbeat(); heartbeat = this.itemProtocol.getHeartbeat();
@@ -312,6 +317,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
logServer.deviceItemValue(this.device_code, "task2", String.valueOf(task2)); logServer.deviceItemValue(this.device_code, "task2", String.valueOf(task2));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task2" + last_task2 + "->" + task2); logServer.deviceExecuteLog(this.device_code, "", "", "信号task2" + last_task2 + "->" + task2);
} }
// if (walk_x != last_walk_x) {
// logServer.deviceItemValue(this.device_code, "walk_x", String.valueOf(walk_x));
// logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_x" + last_walk_x + "->" + walk_x);
// }
update_instruction_status(); update_instruction_status();
@@ -397,6 +406,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
last_to_task2 = to_task2; last_to_task2 = to_task2;
last_to_onset2 = to_onset2; last_to_onset2 = to_onset2;
last_to_target2 = to_target2; last_to_target2 = to_target2;
// last_walk_x = walk_x;
} }
public synchronized boolean task_check() { public synchronized boolean task_check() {

View File

@@ -341,6 +341,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_code", driver.getDevice().getDevice_code()); jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name()); jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode())); jo.put("status", Math.min(3, driver.getMode()));
jo.put("x", driver.getWalk_x());
jo.put("y", driver.getWalk_y()); jo.put("y", driver.getWalk_y());
jo.put("error", driver.getError()); jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(driver.getError()))); jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(driver.getError())));
@@ -349,6 +350,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_code", driver.getDevice().getDevice_code()); jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name()); jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode())); jo.put("status", Math.min(3, driver.getMode()));
jo.put("x", driver.getWalk_x());
jo.put("y", driver.getWalk_y()); jo.put("y", driver.getWalk_y());
jo.put("error", driver.getError()); jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(driver.getError()))); jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(driver.getError())));