Browse Source

rev agv交互

master
汪菘 1 year ago
parent
commit
1cbbc3a974
  1. 5
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 11
      acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java

5
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -360,6 +360,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
if(device.getDeviceDriver() instanceof ConveyorBarcodeDeviceDriver){
conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver();
if (conveyorBarcodeDeviceDriver.getMode() == 2
&& conveyorBarcodeDeviceDriver.getMove() == 1
) {
inst.setExecute_status("1");
instructionService.update(inst);
@ -879,7 +880,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
if(device.getDeviceDriver() instanceof ConveyorBarcodeDeviceDriver){
conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver();
conveyorBarcodeDeviceDriver.writing(4);
if (conveyorBarcodeDeviceDriver.getMode() == 2){
if (conveyorBarcodeDeviceDriver.getMode() == 2
&& conveyorBarcodeDeviceDriver.getMove() == 0
){
inst.setExecute_status("3");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);

11
acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java

@ -407,25 +407,26 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
Object obj = accessor_value.getValue(relate);
sb.append("key:" + relate + "value:" + obj + ";");
}
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb});
log.info("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb});
// 存在上次点位值为null情况 则不记录日志
if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) {
if((ObjectUtil.equal(his,"null") || ObjectUtil.isEmpty(his)) || (ObjectUtil.equal(value,"null") || ObjectUtil.isEmpty(value)) ){
//lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), String.valueOf(his), String.valueOf(value)));
} else {
lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), String.valueOf(his), String.valueOf(value)));
}
}
} else {
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
log.info("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
// 存在上次点位值为null情况 则不记录日志
if (!itemDto.getItem_code().endsWith("heartbeat") && !itemDto.getItem_code().endsWith("time")) {
if((ObjectUtil.equal(his,"null") || ObjectUtil.isEmpty(his)) || (ObjectUtil.equal(value,"null") || ObjectUtil.isEmpty(value)) ){
//lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), String.valueOf(his), String.valueOf(value)));
} else {
lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".") + 1), String.valueOf(his), String.valueOf(value)));
}
}
}
}
}

Loading…
Cancel
Save