add:自动门互锁,AD4、AD7和AD2、AD8自动门一个开启,另一个必须关闭后才能开启
This commit is contained in:
@@ -20,6 +20,7 @@ import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.region.domain.Region;
|
||||
import org.nl.acs.region.service.RegionService;
|
||||
import org.nl.config.MapOf;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
@@ -34,6 +35,7 @@ import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.nl.acs.agv.server.impl.NDCAgvServiceImpl.Bytes2HexString;
|
||||
|
||||
@@ -60,7 +62,10 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
boolean requireSucessRegion = false;
|
||||
boolean requireSucessTake = false;
|
||||
boolean requireSucessPut = false;
|
||||
|
||||
/**
|
||||
* 两个门必须互锁,其中一个门关闭,才能给另一个门开启信号
|
||||
*/
|
||||
private Map<String, String> lockDoorMap = MapOf.of("AD4", "AD7", "AD7", "AD4", "AD2", "AD8", "AD8", "AD2");
|
||||
|
||||
@Autowired
|
||||
ISysParamService paramService;
|
||||
@@ -240,6 +245,19 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(device)) {
|
||||
String lockDoor = lockDoorMap.get(device_code);
|
||||
if (StrUtil.isNotEmpty(lockDoor)) {
|
||||
Device lockDevice = deviceAppService.findDeviceByCode(lockDoor);
|
||||
if (ObjectUtil.isNotEmpty(lockDevice)) {
|
||||
if (lockDevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||
StandardAutodoorDeviceDriver lockStandardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) lockDevice.getDeviceDriver();
|
||||
if (lockStandardAutodoorDeviceDriver.getClose() != 1) {
|
||||
log.info("未下发{}自动门开门信号,因为自动门{}未关到位,所以未反馈NDC信开门信息", device_code, lockDoor);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
||||
String region_code = (String) device.getExtraValue().get("region");
|
||||
|
||||
Reference in New Issue
Block a user