Browse Source

更新

master
loujf 2 years ago
parent
commit
a096990b0c
  1. 27
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java
  2. 11
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java
  3. 16
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java

27
hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java

@ -960,9 +960,21 @@ public class AgvServiceImpl implements AgvService {
} }
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) {
standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) addressdevice.getDeviceDriver(); standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) addressdevice.getDeviceDriver();
String apply_task = addressdevice.getExtraValue().get("apply_task").toString();
//取货完成 //取货完成
if ("Load".equals(action)) { if ("Load".equals(action)) {
if (standardInspectSiteSmartDeviceDriver.getMode() != 0 && standardInspectSiteSmartDeviceDriver.getMove() == 0) { //如果开启呼叫按钮,那么就需要判断进出动作信号
if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) {
if (standardInspectSiteSmartDeviceDriver.getMode() != 0
&& standardInspectSiteSmartDeviceDriver.getMove() == 0
&& standardInspectSiteSmartDeviceDriver.getAction() == 3
&& standardInspectSiteSmartDeviceDriver.getIo_action() == 3) {
inst.setExecute_device_code(processingVehicle);
inst.setExecute_status("2");
standardInspectSiteSmartDeviceDriver.writing(2);
is_feedback = true;
}
} else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 && standardInspectSiteSmartDeviceDriver.getMove() == 0) {
inst.setExecute_device_code(processingVehicle); inst.setExecute_device_code(processingVehicle);
inst.setExecute_status("2"); inst.setExecute_status("2");
standardInspectSiteSmartDeviceDriver.writing(2); standardInspectSiteSmartDeviceDriver.writing(2);
@ -970,7 +982,18 @@ public class AgvServiceImpl implements AgvService {
} }
//放货完成 //放货完成
} else if ("Unload".equals(action)) { } else if ("Unload".equals(action)) {
if (standardInspectSiteSmartDeviceDriver.getMode() != 0 && standardInspectSiteSmartDeviceDriver.getMove() > 0) {
if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) {
if (standardInspectSiteSmartDeviceDriver.getMode() != 0
&& standardInspectSiteSmartDeviceDriver.getMove() > 0
&& standardInspectSiteSmartDeviceDriver.getAction() == 3
&& standardInspectSiteSmartDeviceDriver.getIo_action() == 3) {
inst.setExecute_device_code(address);
inst.setExecute_status("4");
standardInspectSiteSmartDeviceDriver.writing(3);
is_feedback = true;
}
} else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 && standardInspectSiteSmartDeviceDriver.getMove() > 0) {
inst.setExecute_device_code(address); inst.setExecute_device_code(address);
inst.setExecute_status("4"); inst.setExecute_status("4");
standardInspectSiteSmartDeviceDriver.writing(3); standardInspectSiteSmartDeviceDriver.writing(3);

11
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java

@ -15,7 +15,7 @@ public class ItemProtocol {
public static String item_mode = "mode"; public static String item_mode = "mode";
public static String item_move = "move"; public static String item_move = "move";
public static String item_action = "action"; public static String item_action = "action";
public static String item_ioaction = "ioaction"; public static String item_ioaction = "io_action";
public static String item_error = "error"; public static String item_error = "error";
public static String item_task = "task"; public static String item_task = "task";
public static String item_to_command = "to_command"; public static String item_to_command = "to_command";
@ -41,7 +41,11 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_move); return this.getOpcIntegerValue(item_move);
} }
public int getIoaction() { public int getAction() {
return this.getOpcIntegerValue(item_action);
}
public int getIo_action() {
return this.getOpcIntegerValue(item_ioaction); return this.getOpcIntegerValue(item_ioaction);
} }
@ -90,7 +94,8 @@ public class ItemProtocol {
list.add(new ItemDto(item_heartbeat, "心跳", "VW0")); list.add(new ItemDto(item_heartbeat, "心跳", "VW0"));
list.add(new ItemDto(item_mode, "工作状态", "VW2", Boolean.valueOf(true))); list.add(new ItemDto(item_mode, "工作状态", "VW2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "VW4")); list.add(new ItemDto(item_move, "光电开关信号", "VW4"));
list.add(new ItemDto(item_action, "动作信号", "VW8")); list.add(new ItemDto(item_action, "动作信号", "VW6"));
list.add(new ItemDto(item_ioaction, "进出信号", "VW8"));
list.add(new ItemDto(item_error, "报警信号", "VW12")); list.add(new ItemDto(item_error, "报警信号", "VW12"));
list.add(new ItemDto(item_task, "任务号", "VD14")); list.add(new ItemDto(item_task, "任务号", "VD14"));
return list; return list;

16
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java

@ -68,6 +68,10 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
int error = 0; int error = 0;
int move = 0; int move = 0;
int task = 0; int task = 0;
int action = 0;
int io_action = 0;
int last_action = 0;
int last_io_action = 0;
int last_mode = 0; int last_mode = 0;
int last_error = 0; int last_error = 0;
int last_move = 0; int last_move = 0;
@ -162,6 +166,8 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
mode = this.itemProtocol.getMode(); mode = this.itemProtocol.getMode();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
move = this.itemProtocol.getMove(); move = this.itemProtocol.getMove();
action = this.itemProtocol.getAction();
io_action = this.itemProtocol.getIo_action();
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove(); hasGoods = this.itemProtocol.getMove();
@ -198,6 +204,14 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
this.execute_log.setResource(this.devicecode, this.device.getDevice_name()); this.execute_log.setResource(this.devicecode, this.device.getDevice_name());
this.execute_log.log("设备:" + device_code + ",last_move -> move:" + last_mode + "->" + move); this.execute_log.log("设备:" + device_code + ",last_move -> move:" + last_mode + "->" + move);
} }
if (action != last_action) {
this.execute_log.setResource(this.devicecode, this.device.getDevice_name());
this.execute_log.log("设备:" + device_code + ",last_action -> action:" + last_action + "->" + action);
}
if (io_action != last_io_action) {
this.execute_log.setResource(this.devicecode, this.device.getDevice_name());
this.execute_log.log("设备:" + device_code + ",last_io_action -> io_action:" + last_io_action + "->" + io_action);
}
if (error != last_error) { if (error != last_error) {
this.execute_log.setResource(this.devicecode, this.device.getDevice_name()); this.execute_log.setResource(this.devicecode, this.device.getDevice_name());
this.execute_log.log("设备:" + device_code + ",last_error -> error:" + last_error + "->" + error); this.execute_log.log("设备:" + device_code + ",last_error -> error:" + last_error + "->" + error);
@ -370,6 +384,8 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
last_mode = mode; last_mode = mode;
last_error = error; last_error = error;
last_move = move; last_move = move;
last_action = action;
last_io_action = io_action;
last_task = task; last_task = task;
} }

Loading…
Cancel
Save