张江玮 1 year ago
parent
commit
42ccec8be8
  1. 33
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java
  2. 12
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java

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

@ -825,17 +825,19 @@ public class AgvServiceImpl implements AgvService {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
//请求取货
if ("Load".equals(action)) {
standardInspectSiteDeviceDriver.setFlag(1);
standardInspectSiteDeviceDriver.writing(1);
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() > 0
&& (standardInspectSiteDeviceDriver.getAction() == 1 || standardInspectSiteDeviceDriver.getAction() == 3)) {
&& standardInspectSiteDeviceDriver.getAction() == 1) {
inst.setExecute_status("1");
is_feedback = true;
}
//请求放货
} else if ("Unload".equals(action)) {
standardInspectSiteDeviceDriver.setFlag(3);
standardInspectSiteDeviceDriver.writing(3);
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() == 0
&& (standardInspectSiteDeviceDriver.getAction() == 2 || standardInspectSiteDeviceDriver.getAction() == 3)) {
&& standardInspectSiteDeviceDriver.getAction() == 1) {
inst.setExecute_status("3");
is_feedback = true;
}
@ -973,26 +975,24 @@ public class AgvServiceImpl implements AgvService {
} else if ("onStation".equals(type)) {
System.out.println("取放货完成");
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
//取货完成
if ("Load".equals(action)) {
standardInspectSiteDeviceDriver.writing(2);
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() == 0) {
inst.setExecute_device_code(processingVehicle);
inst.setExecute_status("2");
standardInspectSiteDeviceDriver.setFlag(2);
inst.setExecute_status("1");
is_feedback = true;
}
//放货完成
} else if ("Unload".equals(action)) {
standardInspectSiteDeviceDriver.writing(4);
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() > 0) {
inst.setExecute_device_code(address);
inst.setExecute_status("4");
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() != 0) {
standardInspectSiteDeviceDriver.setFlag(4);
inst.setExecute_status("3");
is_feedback = true;
}
}
}
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) {
standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) addressdevice.getDeviceDriver();
@ -1386,18 +1386,21 @@ public class AgvServiceImpl implements AgvService {
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
flag = true;
log.info("agvstatus:" + standardInspectSiteDeviceDriver.getFlag() + "");
//取货完成离开
if (standardInspectSiteDeviceDriver.getFlag() == 2) {
if (standardInspectSiteDeviceDriver.getMove() == 0) {
if (standardInspectSiteDeviceDriver.getFlag() == 1 || standardInspectSiteDeviceDriver.getFlag() == 2) {
standardInspectSiteDeviceDriver.writing(2);
if (standardInspectSiteDeviceDriver.getMode() != 0
&& standardInspectSiteDeviceDriver.getMove() == 0) {
flag = true;
standardInspectSiteDeviceDriver.setFlag(5);
}
}
//放货完成离开
if (standardInspectSiteDeviceDriver.getFlag() == 4) {
if (standardInspectSiteDeviceDriver.getMove() == 1) {
if (standardInspectSiteDeviceDriver.getFlag() == 3 || standardInspectSiteDeviceDriver.getFlag() == 4) {
standardInspectSiteDeviceDriver.writing(4);
if (standardInspectSiteDeviceDriver.getMode() != 0
&& standardInspectSiteDeviceDriver.getMove() != 0) {
flag = true;
standardInspectSiteDeviceDriver.setFlag(6);
}

12
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java

@ -321,18 +321,6 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
break;
}
switch (flag) {
//取货完成
case 1:
writing(2);
return;
//放货完成
case 2:
writing(3);
return;
}
}
last_mode = mode;
last_error = error;

Loading…
Cancel
Save