取放货物
This commit is contained in:
@@ -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.standard_autodoor.StandardAutodoorDeviceDriver;
|
||||
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_stacking_site.StandardManipulatorStackingSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
@@ -859,10 +860,11 @@ public class AgvServiceImpl implements AgvService {
|
||||
Instruction inst = instructionService.findByCodeFromCache(jobno);
|
||||
TaskDto task = taskService.findByCode(inst.getTask_code());
|
||||
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
Device addressdevice = appService.findDeviceByCode(address);
|
||||
|
||||
StandardManipulatorStackingSiteDeviceDriver standardManipulatorStackingSiteDeviceDriver;
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
//取货的进入前等待和离开等待
|
||||
if (action.equals("Load")) {
|
||||
if ("EntryRequired".equals(type)) {
|
||||
@@ -879,6 +881,14 @@ public class AgvServiceImpl implements AgvService {
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
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 (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
|
||||
@@ -892,6 +902,14 @@ public class AgvServiceImpl implements AgvService {
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
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) {
|
||||
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 (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
|
||||
@@ -922,6 +948,14 @@ public class AgvServiceImpl implements AgvService {
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
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();
|
||||
|
||||
@@ -14,6 +14,7 @@ public class ItemProtocol {
|
||||
public static String item_heartbeat = "heartbeat";
|
||||
public static String item_mode = "mode";
|
||||
public static String item_move = "move";
|
||||
public static String item_action = "action";
|
||||
public static String item_ioaction = "ioaction";
|
||||
public static String item_error = "error";
|
||||
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_weight = "weight";
|
||||
|
||||
|
||||
private StandardInspectSiteDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(StandardInspectSiteDeviceDriver driver) {
|
||||
@@ -36,6 +38,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
|
||||
public int getAction(){return this.getOpcIntegerValue(item_action);}
|
||||
|
||||
public int getMove() {
|
||||
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_mode, "工作状态", "DB600.B2", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB600.B7"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB600.D10"));
|
||||
list.add(new ItemDto(item_action,"取放信号","DB600,B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB600.B5"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB600.D6"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,9 @@ public class StandardInspectSiteDefination implements OpcDeviceDriverDefination
|
||||
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_move, "光电开关信号", "DB600.B3"));
|
||||
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B7"));
|
||||
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D10"));
|
||||
list.add(new ItemDto(ItemProtocol.item_action,"取放信号","DB600,B4"));
|
||||
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B5"));
|
||||
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D6"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
int mode = 0;
|
||||
int error = 0;
|
||||
int move = 0;
|
||||
int action=0;
|
||||
int task = 0;
|
||||
int last_mode = 0;
|
||||
int last_error = 0;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class QueryAgvTaskStatus {
|
||||
JSONArray inst_rows = JSONArray.parseArray(response.body());
|
||||
for (int i = 0; i < inst_rows.size(); 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);
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user