|
|
@ -249,16 +249,20 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
log.info(agvaddr + "对应设备号为空!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (ObjectUtil.isNotEmpty(device)) { |
|
|
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { |
|
|
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); |
|
|
|
if (standardAutodoorDeviceDriver.getDoor() == 1) { |
|
|
|
if(device_code.equals("AD1")||device_code.equals("AD2")||device_code.equals("AD3")||device_code.equals("AD4")) { |
|
|
|
standardAutodoorDeviceDriver.writing("to_command", 1); |
|
|
|
if (standardAutodoorDeviceDriver.getDoor() == 1) { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); |
|
|
|
} else { |
|
|
|
log.info("未下发NDC信号原因: 读取开门到位信号值为:{}", standardAutodoorDeviceDriver.getDoor()); |
|
|
|
} |
|
|
|
}else if(device_code.equals("AD5")||device_code.equals("AD6")||device_code.equals("AD7")||device_code.equals("AD8")||device_code.equals("AD9")) { |
|
|
|
standardAutodoorDeviceDriver.writing("to_command", 1); |
|
|
|
} |
|
|
|
if (standardAutodoorDeviceDriver.getTo_command() == 1) { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); |
|
|
|
} else { |
|
|
|
log.info("未下发NDC信号原因: 读取下发信号值为:{}", standardAutodoorDeviceDriver.getTo_command()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
@ -270,8 +274,11 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
log.info(agvaddr + "对应设备号为空!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (ObjectUtil.isNotEmpty(device)) { |
|
|
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); |
|
|
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { |
|
|
|
standardAutodoorDeviceDriver.writing("to_command", 2); |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
} else { |
|
|
@ -350,13 +357,13 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
dos.flush(); |
|
|
|
} catch (Exception e) { |
|
|
|
// TODO Auto-generated catch block
|
|
|
|
try { |
|
|
|
try{ |
|
|
|
Thread.sleep(5000); |
|
|
|
log.info("再次下发agv数据:" + Bytes2HexString(b)); |
|
|
|
System.out.println("再次下发agv数据:" + Bytes2HexString(b)); |
|
|
|
dos.write(b); |
|
|
|
dos.flush(); |
|
|
|
} catch (Exception e1) { |
|
|
|
} catch (Exception e1){ |
|
|
|
e1.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|