Browse Source

取放货物

master
周俊杰 1 year ago
parent
commit
97165bc085
  1. 34
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java
  2. 9
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java
  3. 5
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java
  4. 1
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java
  5. 2
      hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryAgvTaskStatus.java

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

@ -22,6 +22,7 @@ import org.nl.acs.device_driver.ndxy_special_two.NdxySpecialTwoDeviceDriver;
import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver;
import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver;
import org.nl.acs.device_driver.standard_manipulator_stacking_site.StandardManipulatorStackingSiteDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_stacking_site.StandardManipulatorStackingSiteDeviceDriver;
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
@ -863,6 +864,7 @@ public class AgvServiceImpl implements AgvService {
Device addressdevice = appService.findDeviceByCode(address); Device addressdevice = appService.findDeviceByCode(address);
StandardManipulatorStackingSiteDeviceDriver standardManipulatorStackingSiteDeviceDriver; StandardManipulatorStackingSiteDeviceDriver standardManipulatorStackingSiteDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
//取货的进入前等待和离开等待 //取货的进入前等待和离开等待
if (action.equals("Load")) { if (action.equals("Load")) {
if ("EntryRequired".equals(type)) { if ("EntryRequired".equals(type)) {
@ -879,6 +881,14 @@ public class AgvServiceImpl implements AgvService {
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
is_feedback = true; is_feedback = true;
} }
if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver){
standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardInspectSiteDeviceDriver.getMove()==1&&standardInspectSiteDeviceDriver.getAction()==1){
is_feedback = true;
}else {
log.info("设备{} 请求取货,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove());
}
}
} }
if ("PauseOnStation".equals(type)) { if ("PauseOnStation".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
@ -892,6 +902,14 @@ public class AgvServiceImpl implements AgvService {
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
is_feedback = true; is_feedback = true;
} }
if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){
standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardInspectSiteDeviceDriver.getMove()==0){
is_feedback = true;
}else {
log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove());
}
}
} }
} }
@ -909,6 +927,14 @@ public class AgvServiceImpl implements AgvService {
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
is_feedback = true; is_feedback = true;
} }
if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){
standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardInspectSiteDeviceDriver.getMove()==0&&standardInspectSiteDeviceDriver.getAction()==2){
is_feedback = true;
}else {
log.info("设备{} 请求放货,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove());
}
}
} }
if ("PauseOnStation".equals(type)) { if ("PauseOnStation".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
@ -922,6 +948,14 @@ public class AgvServiceImpl implements AgvService {
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
is_feedback = true; is_feedback = true;
} }
if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){
standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardInspectSiteDeviceDriver.getMove()==1){
is_feedback = true;
}else {
log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove());
}
}
} }
} }
com.alibaba.fastjson.JSONObject requestjo = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject requestjo = new com.alibaba.fastjson.JSONObject();

9
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java

@ -14,6 +14,7 @@ public class ItemProtocol {
public static String item_heartbeat = "heartbeat"; public static String item_heartbeat = "heartbeat";
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_ioaction = "ioaction"; public static String item_ioaction = "ioaction";
public static String item_error = "error"; public static String item_error = "error";
public static String item_task = "task"; public static String item_task = "task";
@ -22,6 +23,7 @@ public class ItemProtocol {
public static String item_to_task = "to_task"; public static String item_to_task = "to_task";
public static String item_weight = "weight"; public static String item_weight = "weight";
private StandardInspectSiteDeviceDriver driver; private StandardInspectSiteDeviceDriver driver;
public ItemProtocol(StandardInspectSiteDeviceDriver driver) { public ItemProtocol(StandardInspectSiteDeviceDriver driver) {
@ -36,6 +38,8 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_mode); return this.getOpcIntegerValue(item_mode);
} }
public int getAction(){return this.getOpcIntegerValue(item_action);}
public int getMove() { public int getMove() {
return this.getOpcIntegerValue(item_move); return this.getOpcIntegerValue(item_move);
} }
@ -89,8 +93,9 @@ public class ItemProtocol {
list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0")); list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0"));
list.add(new ItemDto(item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true))); list.add(new ItemDto(item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3")); list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3"));
list.add(new ItemDto(item_error, "报警信号", "DB600.B7")); list.add(new ItemDto(item_action,"取放信号","DB600,B4"));
list.add(new ItemDto(item_task, "任务号", "DB600.D10")); list.add(new ItemDto(item_error, "报警信号", "DB600.B5"));
list.add(new ItemDto(item_task, "任务号", "DB600.D6"));
return list; return list;
} }

5
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java

@ -60,8 +60,9 @@ public class StandardInspectSiteDefination implements OpcDeviceDriverDefination
list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0"));
list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B2", true)); list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B2", true));
list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B3")); list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B3"));
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B7")); list.add(new ItemDto(ItemProtocol.item_action,"取放信号","DB600,B4"));
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D10")); list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B5"));
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D6"));
return list; return list;
} }

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

@ -66,6 +66,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
int mode = 0; int mode = 0;
int error = 0; int error = 0;
int move = 0; int move = 0;
int action=0;
int task = 0; int task = 0;
int last_mode = 0; int last_mode = 0;
int last_error = 0; int last_error = 0;

2
hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryAgvTaskStatus.java

@ -33,7 +33,7 @@ public class QueryAgvTaskStatus {
JSONArray inst_rows = JSONArray.parseArray(response.body()); JSONArray inst_rows = JSONArray.parseArray(response.body());
for (int i = 0; i < inst_rows.size(); i++) { for (int i = 0; i < inst_rows.size(); i++) {
JSONObject inst_jo = inst_rows.getJSONObject(i); JSONObject inst_jo = inst_rows.getJSONObject(i);
String inst_code = inst_jo.getString("task_code"); String inst_code = inst_jo.getString("taskCode");
Instruction inst = instructionService.findByCodeFromCache(inst_code); Instruction inst = instructionService.findByCodeFromCache(inst_code);
if (ObjectUtil.isEmpty(inst)) { if (ObjectUtil.isEmpty(inst)) {
continue; continue;

Loading…
Cancel
Save