From ebfb3240728092e34af4aebc835b7ee9182f0897 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 13 Jun 2022 16:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E9=93=81=E9=99=A2=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../real/modbustcp/xty/XtyPsdServiceImpl.java | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/xty/XtyPsdServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/xty/XtyPsdServiceImpl.java index 69547bf75..17841e22d 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/xty/XtyPsdServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/xty/XtyPsdServiceImpl.java @@ -61,12 +61,26 @@ public class XtyPsdServiceImpl implements RealDeviceService { int wvgm = configVO.getWvgm();// 关门控制值 if (vrPsd.isTurning()) { // 屏蔽门设置中且为信号系统可操作状态 - if (autoMode && vrPsd.isCommandOpen() && (cv & wvkm) != wvkm) { // 开门 - this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), - configVO.getWbi(), cv, wvkm, plcGateway.getChannel()); + if (autoMode && vrPsd.isCommandOpen() /*&& (cv & wvkm) != wvkm*/) { // 开门 + if ((cv & wvkm) != wvkm) { + this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), + configVO.getWbi(), cv, wvkm, plcGateway.getChannel()); + } else if (vrPsd.isLockAndClose()) { + this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), + configVO.getWbi(), cv, wvgm, plcGateway.getChannel()); + this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), + configVO.getWbi(), cv, wvkm, plcGateway.getChannel()); + } } else if(autoMode && !vrPsd.isCommandOpen() && (cv & wvgm) != wvgm){ // 关门 - this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), - configVO.getWbi(), cv, wvgm, plcGateway.getChannel()); + if ((cv & wvgm) != wvgm) { + this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), + configVO.getWbi(), cv, wvgm, plcGateway.getChannel()); + } else if (vrPsd.isOpen2End()) { + this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), + configVO.getWbi(), cv, wvkm, plcGateway.getChannel()); + this.plcGatewayService.checkEqualAndWriteSingleRegister(plcGateway.getConfig().getAddr(), + configVO.getWbi(), cv, wvgm, plcGateway.getChannel()); + } } } if (rbkmdw && rbgmdw) { // 开关门进行中