更新agv交互

This commit is contained in:
USER-20220102CG\noblelift
2023-02-07 19:28:07 +08:00
parent 73dc7e6d27
commit c71ae7fce7
4 changed files with 21 additions and 10 deletions

View File

@@ -232,14 +232,19 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
siemensConveyorDeviceDriver.writing(list);
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
if(siemensConveyorDeviceDriver.getTo_command() == 2){
log.info("取货完成请求离开当前输送to_command:"+siemensConveyorDeviceDriver.getTo_command());
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else {
log.info("取货完成请求离开下发输送信号当前输送to_command:"+siemensConveyorDeviceDriver.getTo_command());
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
siemensConveyorDeviceDriver.writing(list);
siemensConveyorDeviceDriver.writing(list);
}
}
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {

View File

@@ -73,6 +73,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_task);
}
public int getTo_command() {
return this.getOpcIntegerValue(item_to_command);
}
Boolean isonline;

View File

@@ -93,6 +93,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
int last_task = 0;
int agvphase = 0;
String task_code = null;
int to_command = 0;
int phase = 0;
int index = 0;
@@ -147,6 +148,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
carrier_direction = this.itemProtocol.getCarrier_direction();
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getTo_command();
if (mode != last_mode) {
if (mode == 2) {
requireSucess = false;
@@ -284,7 +286,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
break;
case 4:
//申请捆扎
if (move > 0 && !requireSucess) {
if (move > 0 ) {
applyLaStrangulation();
}
break;

View File

@@ -25,7 +25,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
//设备扩展表【acs_device_extra】
WQLObject extraTab = WQLObject.getWQLObject("acs_device_extra");
JSONArray arr = extraTab.query("filed_type='02' and device_id = '" + this.getDevice().getDevice_id() + "'").getResultJSONArray(0);
JSONArray arr = extraTab.query(" (filed_type='02' or filed_type='03' )and device_id = '" + this.getDevice().getDevice_id() + "'").getResultJSONArray(0);
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
OpcItemDto dto = new OpcItemDto();