更新
This commit is contained in:
@@ -929,13 +929,15 @@ public class AgvServiceImpl implements AgvService {
|
||||
//请求取货
|
||||
if ("Load".equals(action)) {
|
||||
if(standardInspectSiteSmartDeviceDriver.getMode()>0
|
||||
&& standardInspectSiteSmartDeviceDriver.getAction() == 3 && standardInspectSiteSmartDeviceDriver.getError()==0){
|
||||
&& ( standardInspectSiteSmartDeviceDriver.getAction() == 3 || standardInspectSiteSmartDeviceDriver.getAction() == 1 )
|
||||
&& standardInspectSiteSmartDeviceDriver.getError()==0){
|
||||
is_feedback = true;
|
||||
}
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if(standardInspectSiteSmartDeviceDriver.getMode()>0
|
||||
&& standardInspectSiteSmartDeviceDriver.getAction() == 3 && standardInspectSiteSmartDeviceDriver.getError()==0){
|
||||
&& (standardInspectSiteSmartDeviceDriver.getAction() == 3 || standardInspectSiteSmartDeviceDriver.getAction() == 2 )
|
||||
&& standardInspectSiteSmartDeviceDriver.getError()==0){
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
@@ -981,46 +983,51 @@ public class AgvServiceImpl implements AgvService {
|
||||
String apply_task = addressdevice.getExtraValue().get("apply_task").toString();
|
||||
//取货完成
|
||||
if ("Load".equals(action)) {
|
||||
standardInspectSiteSmartDeviceDriver.setFlag(2);
|
||||
is_feedback = true;
|
||||
|
||||
//如果开启呼叫按钮,那么就需要判断进出动作信号
|
||||
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_status("2");
|
||||
standardInspectSiteSmartDeviceDriver.writing(2);
|
||||
is_feedback = true;
|
||||
}
|
||||
// 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_status("2");
|
||||
// standardInspectSiteSmartDeviceDriver.writing(2);
|
||||
// is_feedback = true;
|
||||
// }
|
||||
//放货完成
|
||||
} else if ("Unload".equals(action)) {
|
||||
standardInspectSiteSmartDeviceDriver.setFlag(4);
|
||||
is_feedback = true;
|
||||
|
||||
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_status("4");
|
||||
standardInspectSiteSmartDeviceDriver.writing(3);
|
||||
is_feedback = true;
|
||||
}
|
||||
// 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_status("4");
|
||||
// standardInspectSiteSmartDeviceDriver.writing(3);
|
||||
// is_feedback = true;
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1369,6 +1376,7 @@ public class AgvServiceImpl implements AgvService {
|
||||
Device addressdevice = appService.findDeviceByCode(address);
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver;
|
||||
StandardStorageDeviceDriver standardStorageDeviceDriver;
|
||||
//mes = AgvClientXZ.mes(zlbh, device, type);
|
||||
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
|
||||
@@ -1413,6 +1421,52 @@ public class AgvServiceImpl implements AgvService {
|
||||
}
|
||||
}
|
||||
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) {
|
||||
standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) addressdevice.getDeviceDriver();
|
||||
String apply_task = addressdevice.getExtraValue().get("apply_task").toString();
|
||||
|
||||
//取货完成请求离开
|
||||
if (standardInspectSiteSmartDeviceDriver.getFlag() == 2) {
|
||||
//如果开启呼叫按钮,那么就需要判断进出动作信号
|
||||
if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) {
|
||||
if (standardInspectSiteSmartDeviceDriver.getMode() != 0
|
||||
//&& standardInspectSiteSmartDeviceDriver.getMove() == 0
|
||||
&& standardInspectSiteSmartDeviceDriver.getAction() == 3
|
||||
&& standardInspectSiteSmartDeviceDriver.getIo_action() == 3) {
|
||||
|
||||
standardInspectSiteSmartDeviceDriver.writing(2);
|
||||
flag = true;
|
||||
}
|
||||
} else if (standardInspectSiteSmartDeviceDriver.getMode() != 0
|
||||
// && standardInspectSiteSmartDeviceDriver.getMove() == 0
|
||||
) {
|
||||
|
||||
standardInspectSiteSmartDeviceDriver.writing(2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
//放货完成请求离开
|
||||
if (standardInspectSiteSmartDeviceDriver.getFlag() == 4) {
|
||||
//如果开启呼叫按钮,那么就需要判断进出动作信号
|
||||
if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) {
|
||||
if (standardInspectSiteSmartDeviceDriver.getMode() != 0
|
||||
//&& standardInspectSiteSmartDeviceDriver.getMove() == 0
|
||||
&& standardInspectSiteSmartDeviceDriver.getAction() == 3
|
||||
&& standardInspectSiteSmartDeviceDriver.getIo_action() == 3) {
|
||||
|
||||
standardInspectSiteSmartDeviceDriver.writing(2);
|
||||
flag = true;
|
||||
}
|
||||
} else if (standardInspectSiteSmartDeviceDriver.getMode() != 0
|
||||
// && standardInspectSiteSmartDeviceDriver.getMove() == 0
|
||||
) {
|
||||
|
||||
standardInspectSiteSmartDeviceDriver.writing(2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
log.info("AGV请求离开,反馈成功:{}", address);
|
||||
System.out.println("AGV请求离开,反馈成功 " + address);
|
||||
|
||||
@@ -95,7 +95,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_mode, "工作状态", "VW2", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_move, "光电开关信号", "VW4"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "VW6"));
|
||||
list.add(new ItemDto(item_ioaction, "进出信号", "VW8"));
|
||||
// list.add(new ItemDto(item_ioaction, "进出信号", "VW8"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "VW12"));
|
||||
list.add(new ItemDto(item_task, "任务号", "VD14"));
|
||||
return list;
|
||||
@@ -109,5 +109,11 @@ public class ItemProtocol {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
|
||||
error = this.itemProtocol.getError();
|
||||
move = this.itemProtocol.getMove();
|
||||
action = this.itemProtocol.getAction();
|
||||
io_action = this.itemProtocol.getIo_action();
|
||||
//io_action = this.itemProtocol.getIo_action();
|
||||
task = this.itemProtocol.getTask();
|
||||
hasGoods = this.itemProtocol.getMove();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user