|
|
@ -255,17 +255,22 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
if (ObjectUtil.isNotEmpty(device)) { |
|
|
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { |
|
|
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); |
|
|
|
if(device_code.equals("AD1")||device_code.equals("AD2")||device_code.equals("AD3")||device_code.equals("AD4")) { |
|
|
|
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")) { |
|
|
|
} 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); |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
} else if (device.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { |
|
|
|
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) device.getDeviceDriver(); |
|
|
|
if (lampThreecolorDeviceDriver.getAction() == 1) { |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
log.info(agvaddr + "对应设备号为空!"); |
|
|
@ -278,8 +283,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { |
|
|
|
} |
|
|
|
device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
if (ObjectUtil.isNotEmpty(device)) { |
|
|
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); |
|
|
|
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { |
|
|
|
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); |
|
|
|
standardAutodoorDeviceDriver.writing("to_command", 2); |
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); |
|
|
|
} |
|
|
@ -359,13 +364,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(); |
|
|
|
} |
|
|
|
|
|
|
|