张江玮 1 year ago
parent
commit
42ccec8be8
  1. 45
      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

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

@ -573,7 +573,7 @@ public class AgvServiceImpl implements AgvService {
if (result.getStatus() == 200) {
arr.add(result.body());
}
} catch (Exception e ){
} catch (Exception e) {
e.printStackTrace();
}
}
@ -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;
}
@ -846,7 +848,7 @@ public class AgvServiceImpl implements AgvService {
//请求取货
if ("Load".equals(action)) {
if (standardSpecialInspectSiteDeviceDriver.getMode() == 2 && standardSpecialInspectSiteDeviceDriver.getMove() > 0) {
if(standardSpecialInspectSiteDeviceDriver.getAction()> 0){
if (standardSpecialInspectSiteDeviceDriver.getAction() > 0) {
inst.setExecute_status("1");
is_feedback = true;
} else {
@ -857,7 +859,7 @@ public class AgvServiceImpl implements AgvService {
//请求放货
} else if ("Unload".equals(action)) {
if (standardSpecialInspectSiteDeviceDriver.getMode() == 2 && standardSpecialInspectSiteDeviceDriver.getMove() == 0) {
if(standardSpecialInspectSiteDeviceDriver.getAction()>0){
if (standardSpecialInspectSiteDeviceDriver.getAction() > 0) {
inst.setExecute_status("1");
is_feedback = true;
} else {
@ -929,7 +931,7 @@ public class AgvServiceImpl implements AgvService {
yzjaSpecialDeviceDriver.setManua_confirm(0);
inst.setExecute_status("1");
is_feedback = true;
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("1")){
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("1")) {
yzjaSpecialDeviceDriver.setManua_confirm(1);
}
} else {
@ -945,7 +947,7 @@ public class AgvServiceImpl implements AgvService {
yzjaSpecialDeviceDriver.setManua_confirm(0);
inst.setExecute_status("3");
is_feedback = true;
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("3")){
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("3")) {
yzjaSpecialDeviceDriver.setManua_confirm(1);
}
} else {
@ -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();
@ -1198,7 +1198,7 @@ public class AgvServiceImpl implements AgvService {
//请求进
if (StrUtil.equals(type, "07") && address.endsWith("IQ")) {
sandardManipulatorInspectSiteDeviceDriver.writing(1, 7);
if ( sandardManipulatorInspectSiteDeviceDriver.getIo_action() == 1
if (sandardManipulatorInspectSiteDeviceDriver.getIo_action() == 1
|| sandardManipulatorInspectSiteDeviceDriver.getIo_action() == 3) {
is_feedback = true;
}
@ -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