更新agv交互
This commit is contained in:
@@ -232,14 +232,19 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
List list = new ArrayList();
|
if(siemensConveyorDeviceDriver.getTo_command() == 2){
|
||||||
Map map = new HashMap();
|
log.info("取货完成请求离开,当前输送to_command:"+siemensConveyorDeviceDriver.getTo_command());
|
||||||
map.put("code", "to_command");
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
map.put("value", "2");
|
} else {
|
||||||
list.add(map);
|
log.info("取货完成请求离开下发输送信号,当前输送to_command:"+siemensConveyorDeviceDriver.getTo_command());
|
||||||
siemensConveyorDeviceDriver.writing(list);
|
List list = new ArrayList();
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
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) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_task);
|
return this.getOpcIntegerValue(item_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTo_command() {
|
||||||
|
return this.getOpcIntegerValue(item_to_command);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Boolean isonline;
|
Boolean isonline;
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
int last_task = 0;
|
int last_task = 0;
|
||||||
int agvphase = 0;
|
int agvphase = 0;
|
||||||
String task_code = null;
|
String task_code = null;
|
||||||
|
int to_command = 0;
|
||||||
|
|
||||||
int phase = 0;
|
int phase = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@@ -147,6 +148,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
carrier_direction = this.itemProtocol.getCarrier_direction();
|
carrier_direction = this.itemProtocol.getCarrier_direction();
|
||||||
error = this.itemProtocol.getError();
|
error = this.itemProtocol.getError();
|
||||||
task = this.itemProtocol.getTask();
|
task = this.itemProtocol.getTask();
|
||||||
|
to_command = this.itemProtocol.getTo_command();
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
@@ -284,7 +286,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
//申请捆扎
|
//申请捆扎
|
||||||
if (move > 0 && !requireSucess) {
|
if (move > 0 ) {
|
||||||
applyLaStrangulation();
|
applyLaStrangulation();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
|
|||||||
|
|
||||||
//设备扩展表【acs_device_extra】
|
//设备扩展表【acs_device_extra】
|
||||||
WQLObject extraTab = WQLObject.getWQLObject("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++) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
JSONObject json = arr.getJSONObject(i);
|
JSONObject json = arr.getJSONObject(i);
|
||||||
OpcItemDto dto = new OpcItemDto();
|
OpcItemDto dto = new OpcItemDto();
|
||||||
|
|||||||
Reference in New Issue
Block a user