From 2463a962044a47b44aec75ddb675d4191ad59d49 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 22 Sep 2021 16:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=9F=E5=AE=9EIBP/PSL=E7=9B=98=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=BF=9E=E6=8E=A5vrIBP/PSL=EF=BC=88=E4=BB=85=E4=B9=89?= =?UTF-8?q?=E4=B9=8C=E9=A1=B9=E7=9B=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/IVirtualRealityIbpService.java | 4 + .../services/VirtualRealityIbpService.java | 103 ++++++++------- .../psl/IVirtualRealityPslService.java | 2 + .../psl/VirtualRealityPslService.java | 59 +++++++-- .../rtss/simulation/cbtc/CI/CiApiService.java | 9 +- .../simulation/cbtc/CI/CiApiServiceImpl2.java | 11 +- .../cbtc/CI/device/CiStandService.java | 2 +- .../ProjectJointSimulationServiceImpl.java | 6 +- .../cbtc/build/MapDeviceBuilder.java | 12 +- .../cbtc/build/SimulationBuilder.java | 15 ++- .../cbtc/data/SimulationDataRepository.java | 10 -- .../cbtc/data/vr/VirtualRealityIbp.java | 21 +-- .../cbtc/data/vr/VirtualRealityPsl.java | 2 + .../SimulationRealDeviceConnectManager.java | 4 + .../modbustcp/richor/ZjdIbpServiceImpl.java | 120 ++++++++++-------- .../modbustcp/richor/ZjdPslServiceImpl.java | 18 ++- .../cbtc/onboard/ATO/service/ATOService.java | 5 +- .../cbtc/onboard/ATP/ATPService.java | 5 +- .../client/project/richor/ZjdIbpConfigVO.java | 6 +- .../client/project/richor/ZjdPslConfigVO.java | 2 +- 20 files changed, 243 insertions(+), 173 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java b/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java index 574f1fb13..5366f2a3d 100644 --- a/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java +++ b/src/main/java/club/joylink/rtss/services/IVirtualRealityIbpService.java @@ -2,6 +2,7 @@ package club.joylink.rtss.services; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.status.IbpStatus; +import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityIbp; /** * 虚拟真实IBP服务 @@ -18,6 +19,9 @@ public interface IVirtualRealityIbpService { */ void pressTheButton(String group, String stationCode, String buttonCode); + void updateElementStatus(Simulation simulation, VirtualRealityIbp ibp, + VirtualRealityIbp.IbpElement element, boolean pressed); + /** * 收集并发送IBP的状态数据 * @param simulation diff --git a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java index 7e2b464eb..6bc35285b 100644 --- a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java +++ b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java @@ -2,10 +2,9 @@ package club.joylink.rtss.services; import club.joylink.rtss.exception.BaseException; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; -import club.joylink.rtss.services.publishData.IbpService; -import club.joylink.rtss.services.publishData.IbpServiceImpl; import club.joylink.rtss.simulation.cbtc.ATS.operation.handler.StandOperateHandler; import club.joylink.rtss.simulation.cbtc.CI.CiApiService; +import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService; import club.joylink.rtss.simulation.cbtc.GroupSimulationCache; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; @@ -18,12 +17,6 @@ import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.status.IbpStatus; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityIbp; import club.joylink.rtss.simulation.cbtc.event.SimulationIbpStatusEvent; -import club.joylink.rtss.simulation.cbtc.exception.SimulationException; -import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; -import club.joylink.rtss.util.JsonUtils; -import club.joylink.rtss.vo.client.ibp.IbpData; -import club.joylink.rtss.vo.client.ibp.IbpQueryVO; -import club.joylink.rtss.vo.client.ibp.IbpVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; @@ -50,10 +43,7 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { private ApplicationContext applicationContext; @Autowired - private IbpService ibpService; - - @Autowired - private IbpServiceImpl ibpServiceImpl; + private CiStandService ciStandService; @Override public IbpStatus getIbpStatus(String group, String stationCode) { @@ -76,79 +66,82 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { Simulation simulation = groupSimulationCache.getSimulationByGroup(group); Station station = simulation.getRepository().getByCode(stationCode, Station.class); VirtualRealityIbp ibp = collect4Ibp(simulation, station); - MapConfig config = simulation.getRepository().getConfig(); - VirtualRealityIbp.IbpElement element = ibp.getByCode(buttonCode); + theButtonIsPressed(simulation, ibp, element); + } + + private void theButtonIsPressed(Simulation simulation, VirtualRealityIbp ibp, VirtualRealityIbp.IbpElement element) { + boolean change = false; if (VirtualRealityIbp.Type.KEY.equals(element.getType())) { element.setOn(!element.isOn()); return; - } - List stands = chooseStands(station, element, config); - boolean change = false; - VirtualRealityIbp.SquareButton button = null; - if (VirtualRealityIbp.Type.BUTTON.equals(element.getType())) { - button = (VirtualRealityIbp.SquareButton) element; - if (!button.isPressed()) + } else if (VirtualRealityIbp.Type.BUTTON.equals(element.getType())) { + VirtualRealityIbp.SquareButton button = (VirtualRealityIbp.SquareButton) element; + if (!button.isOn()) change = true; button.setPressed(true); - if (button.getMean() == null) { - button.setOn(true); - return; - } + element.setOn(true); } + if (change) + effective(simulation, ibp, element); + } + + /** + * IBP盘上元素对应的功能生效 + */ + private void effective(Simulation simulation, VirtualRealityIbp ibp, VirtualRealityIbp.IbpElement element) { + if (!element.isOn()) + return; + Station station = ibp.getStation(); + MapConfig config = simulation.getRepository().getConfig(); + List stands = chooseStands(station, element, config); switch (element.getMean()) { case KC: - element.setOn(true); stands.forEach(stand -> ciApiService.ibpHoldTrain(simulation, stand.getCode())); break; case ZZKC: - element.setOn(true); stands.forEach(stand -> ciApiService.ibpHoldTrainCancel(simulation, stand.getCode())); break; case JJTC: - element.setOn(true); stands.forEach(stand -> ciApiService.standEC(simulation, stand)); ibp.query(VirtualRealityIbp.Mean.ALARM, element.getUp()).forEach(alarm -> alarm.setOn(true)); break; case QXJJTC: - element.setOn(true); stands.forEach(stand -> ciApiService.cancelStandEC(simulation, stand)); break; case BJQC: - element.setOn(true); ibp.query(VirtualRealityIbp.Mean.ALARM, element.getUp()).forEach(ele -> ele.setOn(false)); break; case ALARM: break; case KM: { - element.setOn(true); - stands.forEach(stand -> ciApiService.openScreenDoor(simulation, stand.getCode())); + stands.forEach(stand -> ciApiService.openScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.IBP)); break; } case GM: { - element.setOn(true); - stands.forEach(stand -> ciApiService.closeScreenDoor(simulation, stand.getCode())); + stands.forEach(stand -> ciApiService.closeScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.IBP)); break; } case XXYS: case SXYS: - element.setOn(!element.isOn()); +// element.setOn(!element.isOn()); break; - case AXLE_RESET: - element.setOn(true); + case AXLE_RESET: { + VirtualRealityIbp.SquareButton button = (VirtualRealityIbp.SquareButton) element; ciApiService.axleReset(simulation, button.getSectionCode()); break; - case AXLE_PRE_RESET: - if (change) { + } + case AXLE_PRE_RESET: { + VirtualRealityIbp.SquareButton button = (VirtualRealityIbp.SquareButton) element; + if (!button.isEffective()) { button.setEffective(true); button.setPressTime(LocalDateTime.now()); } break; + } case PRERESET_Z: - element.setOn(true); break; case SD: - element.setOn(true); ibp.queryByType(VirtualRealityIbp.Type.LIGHT).forEach(light -> light.setOn(true)); break; default: @@ -169,14 +162,30 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { Station station = simulation.getRepository().getByCode(stationCode, Station.class); VirtualRealityIbp ibp = collect4Ibp(simulation, station); VirtualRealityIbp.IbpElement element = ibp.getByCode(buttonCode); + theButtonIsReleased(element); + } + + private void theButtonIsReleased(VirtualRealityIbp.IbpElement element) { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(VirtualRealityIbp.Type.BUTTON.equals(element.getType()), "元素非按钮"); VirtualRealityIbp.SquareButton button = (VirtualRealityIbp.SquareButton) element; - button.setPressed(false); if (!VirtualRealityIbp.Mean.AXLE_PRE_RESET.equals(button.getMean())) { button.setOn(false); + } else { + button.setEffective(false); } - if (VirtualRealityIbp.Mean.SD.equals(button.getMean())) { - ibp.queryByType(VirtualRealityIbp.Type.LIGHT).forEach(light -> light.setOn(false)); + } + + /** + * 更新IBP元素状态 + * @param pressed true-按下;false-松开 + */ + @Override + public void updateElementStatus(Simulation simulation, VirtualRealityIbp ibp, + VirtualRealityIbp.IbpElement element, boolean pressed) { + if (pressed) { + theButtonIsPressed(simulation, ibp, element); + } else { + theButtonIsReleased(element); } } @@ -209,12 +218,12 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { @Override public void addJobs(Simulation simulation) { - simulation.addJob(Simulation.JobName.ibpJob, () -> this.logic(simulation), 500); + simulation.addJob(Simulation.JobName.ibpJob, () -> this.preResetLogic(simulation), 500); simulation.addJob(SimulationModule.IBP_STATUS.name(), () -> this.collectAndDispatcher(simulation), SimulationConstants.IBP_STATUS_COLLECT_RATE); } - private void logic(Simulation simulation) { + private void preResetLogic(Simulation simulation) { SimulationDataRepository repository = simulation.getRepository(); for (Station station : repository.getStationList()) { VirtualRealityIbp ibp = station.getVrIbp(); @@ -256,8 +265,6 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { boolean sd = false; if (!CollectionUtils.isEmpty(sdList)) { sd = sdList.stream().anyMatch(VirtualRealityIbp.IbpElement::isOn); -// VirtualRealityIbp.SquareButton sdButton = (VirtualRealityIbp.SquareButton) sdList.get(0); -// sd = sdButton.isOn(); } for (VirtualRealityIbp.IbpElement element : vrIbp.getElementList()) { List stands = chooseStands(station, element, config); diff --git a/src/main/java/club/joylink/rtss/services/psl/IVirtualRealityPslService.java b/src/main/java/club/joylink/rtss/services/psl/IVirtualRealityPslService.java index 5caee2cf3..b3a361e6a 100644 --- a/src/main/java/club/joylink/rtss/services/psl/IVirtualRealityPslService.java +++ b/src/main/java/club/joylink/rtss/services/psl/IVirtualRealityPslService.java @@ -10,5 +10,7 @@ public interface IVirtualRealityPslService { void pressTheButton(String group, String standCode, VirtualRealityPsl.Button button); + void updateStatus(Simulation simulation, VirtualRealityPsl vrPsl, VirtualRealityPsl.Button button, boolean on); + void addJobs(Simulation simulation); } diff --git a/src/main/java/club/joylink/rtss/services/psl/VirtualRealityPslService.java b/src/main/java/club/joylink/rtss/services/psl/VirtualRealityPslService.java index 33b0eec65..0aead1d0e 100644 --- a/src/main/java/club/joylink/rtss/services/psl/VirtualRealityPslService.java +++ b/src/main/java/club/joylink/rtss/services/psl/VirtualRealityPslService.java @@ -1,6 +1,7 @@ package club.joylink.rtss.services.psl; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.simulation.cbtc.CI.CiApiService; import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService; import club.joylink.rtss.simulation.cbtc.GroupSimulationService; import club.joylink.rtss.simulation.cbtc.Simulation; @@ -9,8 +10,6 @@ import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.map.PSD; import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityPsl; -import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityScreenDoor; -import club.joylink.rtss.simulation.cbtc.device.virtual.VirtualRealityDeviceService; import club.joylink.rtss.simulation.cbtc.event.SimulationPslStatusEvent; import club.joylink.rtss.vo.client.psl.PslStatus; import org.springframework.beans.factory.annotation.Autowired; @@ -22,7 +21,7 @@ import java.util.HashMap; import java.util.Map; @Service -public class VirtualRealityPslService implements IVirtualRealityPslService{ +public class VirtualRealityPslService implements IVirtualRealityPslService { @Autowired private GroupSimulationService groupSimulationService; @@ -31,9 +30,7 @@ public class VirtualRealityPslService implements IVirtualRealityPslService{ private ApplicationContext applicationContext; @Autowired - private CiStandService standService; - @Autowired - private VirtualRealityDeviceService virtualRealityDeviceService; + private CiApiService ciApiService; @Override public PslStatus getStatus(String group, String standCode) { @@ -58,6 +55,11 @@ public class VirtualRealityPslService implements IVirtualRealityPslService{ Simulation simulation = groupSimulationService.getSimulationByGroup(group); Stand stand = simulation.getRepository().getByCode(standCode, Stand.class); VirtualRealityPsl vrPsl = collectStatus(stand); + theButtonIsPressed(simulation, vrPsl, button); + } + + private void theButtonIsPressed(Simulation simulation, VirtualRealityPsl vrPsl, VirtualRealityPsl.Button button) { + Stand stand = vrPsl.getStand(); synchronized (vrPsl) { switch (button) { case YXJZ: @@ -65,13 +67,13 @@ public class VirtualRealityPslService implements IVirtualRealityPslService{ break; case HSJC: vrPsl.setHsjcKey(!vrPsl.isHsjcKey()); - standService.setOrCancelInterlockRelease(simulation, stand, vrPsl.isHsjcKey()); + ciApiService.setOrCancelInterlockRelease(simulation, stand, vrPsl.isHsjcKey()); break; case KM: - standService.openScreenDoor(simulation, stand, CiStandService.PsdCommandSource.PSL); + ciApiService.openScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.PSL); break; case GM: - standService.closeScreenDoor(simulation, stand, CiStandService.PsdCommandSource.PSL); + ciApiService.closeScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.PSL); break; case SD: vrPsl.setSdButton(!vrPsl.isSdButton()); @@ -80,6 +82,45 @@ public class VirtualRealityPslService implements IVirtualRealityPslService{ } } + @Override + public void updateStatus(Simulation simulation, VirtualRealityPsl vrPsl, VirtualRealityPsl.Button button, boolean on) { + switch (button) { + case YXJZ: + vrPsl.setYxjzKey(on); + break; + case HSJC: + vrPsl.setHsjcKey(on); + break; + case KM: + case GM: + break; + case SD: + vrPsl.setSdButton(on); + break; + } + effective(simulation, vrPsl.getStand(), button, on); + } + + private void effective(Simulation simulation, Stand stand, VirtualRealityPsl.Button button, boolean on) { + switch (button) { + case YXJZ: + break; + case HSJC: + ciApiService.setOrCancelInterlockRelease(simulation, stand, on); + break; + case KM: + if (on) + ciApiService.openScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.PSL); + break; + case GM: + if (on) + ciApiService.closeScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.PSL); + break; + case SD: + break; + } + } + @Override public void addJobs(Simulation simulation) { simulation.addJobIfAbsent(Simulation.JobName.pslStatus, diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java index 838eb285f..a8092e2f4 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java @@ -1,5 +1,6 @@ package club.joylink.rtss.simulation.cbtc.CI; +import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.ESP; import club.joylink.rtss.simulation.cbtc.data.map.Route; @@ -222,15 +223,17 @@ public interface CiApiService { * 开站台屏蔽门 * @param simulation * @param standCode + * @param source */ - void openScreenDoor(Simulation simulation, String standCode); + void openScreenDoor(Simulation simulation, String standCode, CiStandService.PsdCommandSource source); /** * 关站台屏蔽门 * @param simulation * @param standCode + * @param source */ - void closeScreenDoor(Simulation simulation, String standCode); + void closeScreenDoor(Simulation simulation, String standCode, CiStandService.PsdCommandSource source); /** * 站台扣车,联锁关系处理 @@ -349,4 +352,6 @@ public interface CiApiService { * @param overlapCode */ void setOverlap(Simulation simulation, String signalCode, String overlapCode); + + void setOrCancelInterlockRelease(Simulation simulation, Stand stand, boolean release); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java index f70ff9ee7..e6d6a7140 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl2.java @@ -318,15 +318,15 @@ public class CiApiServiceImpl2 implements CiApiService { } @Override - public void openScreenDoor(Simulation simulation, String standCode) { + public void openScreenDoor(Simulation simulation, String standCode, CiStandService.PsdCommandSource source) { Stand stand = simulation.getRepository().getByCode(standCode, Stand.class); if (Objects.nonNull(stand.getPsd())) { - standService.openScreenDoor(simulation, stand, CiStandService.PsdCommandSource.SIG); + standService.openScreenDoor(simulation, stand, source); } } @Override - public void closeScreenDoor(Simulation simulation, String standCode) { + public void closeScreenDoor(Simulation simulation, String standCode, CiStandService.PsdCommandSource source) { Stand stand = simulation.getRepository().getByCode(standCode, Stand.class); if (Objects.nonNull(stand.getPsd())) { standService.closeScreenDoor(simulation, stand, CiStandService.PsdCommandSource.SIG); @@ -593,6 +593,11 @@ public class CiApiServiceImpl2 implements CiApiService { this.routeService.setOverlap(simulation, overlap); } + @Override + public void setOrCancelInterlockRelease(Simulation simulation, Stand stand, boolean release) { + standService.setOrCancelInterlockRelease(stand, release); + } + /** * 获取计轴器并为预复位/复位操作检查设备状态 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiStandService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiStandService.java index 8c01c8a24..f89f9e2b2 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiStandService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiStandService.java @@ -148,7 +148,7 @@ public class CiStandService { * 设置或取消互锁解除 * @param release 是否是设置 */ - public void setOrCancelInterlockRelease(Simulation simulation, Stand stand, boolean release) { + public void setOrCancelInterlockRelease(Stand stand, boolean release) { stand.getPsd().getVirtualScreenDoor().updateIL(release); stand.getPsd().setInterlockRelease(release); // if (release) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java index edb50b349..e0750f61d 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java @@ -15,6 +15,7 @@ import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1Ib import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PscConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PslConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.richor.ZjdIbpConfig; +import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.richor.ZjdPslConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.xty.XtyPsdConfig; import club.joylink.rtss.simulation.cbtc.event.SimulationUserEnterEvent; import club.joylink.rtss.simulation.cbtc.member.MemberManager; @@ -24,6 +25,7 @@ import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.client.project.LwConfigVO; import club.joylink.rtss.vo.client.project.ProjectDeviceVO; +import club.joylink.rtss.vo.client.project.richor.ZjdPslConfigVO; import club.joylink.rtss.vo.map.MapVO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -139,7 +141,9 @@ public class ProjectJointSimulationServiceImpl implements ProjectJointSimulation case RICHOR_JOINT: { switch (config.getDeviceType()) { case IBP: - return ((ZjdIbpConfig) config).getConfigVO().getStationCode(); + return ((ZjdIbpConfig) config).getConfigVO().getIbpCode(); + case PSL: + return ((ZjdPslConfig) config).getConfigVO().getPslCode(); } } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java index 8fbf0850d..0c64e25f4 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java @@ -812,6 +812,7 @@ public class MapDeviceBuilder { //PSL VirtualRealityPsl vrPsl = new VirtualRealityPsl(stand.getCode() + "_PSL", stand.getName() + "_PSL"); stand.setVrPsl(vrPsl); + vrPsl.setStand(stand); elementMap.put(vrPsl.getCode(), vrPsl); deviceMap.put(vrPsl.getCode(), vrPsl); } @@ -1307,17 +1308,6 @@ public class MapDeviceBuilder { if (station.isHasControlMode()) { // 有控制模式,初始化为中控 station.setControlMode(Station.ControlMode.Center); } - //构建添加IBP - Ibp ibp = ibpMap.get(station.getCode()); - if (ibp == null) - ibp = ibpMap.get(null); - if (ibp != null) { - IbpData ibpData = JsonUtils.read(ibp.getData(), IbpData.class); - VirtualRealityIbp vrIbp = new VirtualRealityIbp(station.getCode() + "_IBP", station.getName() + "_IBP", ibpData); - station.setVrIbp(vrIbp); - elementMap.put(vrIbp.getCode(), vrIbp); - deviceMap.put(vrIbp.getCode(), vrIbp); - } }); // 设备集中站下的车站关联ZC,联锁站下的车站关联联锁站 stationList.forEach(stationVO -> { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java index f180a0bf6..1d9ab270a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java @@ -26,6 +26,7 @@ import javax.swing.text.Element; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; @Slf4j public class SimulationBuilder { @@ -81,13 +82,13 @@ public class SimulationBuilder { private static void buildIbpData(SimulationDeviceBuildResult mapDataBuildResult, List ibpList) { if (CollectionUtils.isEmpty(ibpList)) return; - Map elementMap = mapDataBuildResult.getDeviceMap(); + Map deviceMap = mapDataBuildResult.getDeviceMap(); + Map vrDeviceMap = mapDataBuildResult.getVrDeviceMap(); Map ibpMap = ibpList.stream().collect(Collectors.toMap(Ibp::getStationCode, Function.identity())); - elementMap.values().stream() + List collect = deviceMap.values().stream() .filter(element -> MapElement.DeviceType.STATION.equals(element.getDeviceType())) - .map(element -> (Station) element) - .forEach(station -> { - + .map(element -> (Station) element).collect(Collectors.toList()); + collect.forEach(station -> { //构建添加IBP Ibp ibp = ibpMap.get(station.getCode()); if (ibp == null) @@ -96,8 +97,8 @@ public class SimulationBuilder { IbpData ibpData = JsonUtils.read(ibp.getData(), IbpData.class); VirtualRealityIbp vrIbp = new VirtualRealityIbp(station.getCode() + "_IBP", station.getName() + "_IBP", ibpData, station); station.setVrIbp(vrIbp); - elementMap.put(vrIbp.getCode(), vrIbp); - elementMap.put(vrIbp.getCode(), vrIbp); + deviceMap.put(vrIbp.getCode(), vrIbp); + vrDeviceMap.put(vrIbp.getCode(), vrIbp); } }); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java index 2cd932e71..1042af922 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java @@ -1162,14 +1162,4 @@ public class SimulationDataRepository { .assertNotNull(vrPsl, String.format("%s无对应的vrPsl", vrPsd.debugStr())); return vrPsl; } - - public Station getStationByVrIbp(@NonNull VirtualRealityIbp vrIbp) { - for (Station station : this.getStationList()) { - if (vrIbp.equals(station.getVrIbp())) { - return station; - } - } - throw BusinessExceptionAssertEnum.DATA_NOT_EXIST - .exception(String.format("%s无对应的车站", vrIbp.debugStr())); - } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java index 99ce40a99..f66129692 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityIbp.java @@ -1,6 +1,6 @@ package club.joylink.rtss.simulation.cbtc.data.vr; -import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement; +import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.vo.client.ibp.IbpData; import lombok.Getter; import lombok.Setter; @@ -18,11 +18,13 @@ import java.util.stream.Collectors; * 虚拟真实IBP盘 */ public class VirtualRealityIbp extends VirtualRealityDevice { + @Getter + private final Station station; private final Map elementMap = new ConcurrentHashMap<>(); - public VirtualRealityIbp(String code, String name, IbpData ibpData) { - super(code, name, DeviceType.ESP); + public VirtualRealityIbp(String code, String name, IbpData ibpData, Station station) { + super(code, name, DeviceType.IBP); if (!CollectionUtils.isEmpty(ibpData.getDrawData().getSquareButtonList())) { for (IbpData.SquareButtonVO vo : ibpData.getDrawData().getSquareButtonList()) { SquareButton button = new SquareButton(vo.getCode(), vo.getMean(), false, vo.getSectionCode(), vo.getDirection()); @@ -48,6 +50,7 @@ public class VirtualRealityIbp extends VirtualRealityDevice { } } } + this.station = station; } public void reset() { @@ -100,7 +103,7 @@ public class VirtualRealityIbp extends VirtualRealityDevice { private Mean mean; - /** 是否生效(是否亮灯) */ + /** 是否开启/亮灯 */ private boolean on; /** 是否上行 */ @@ -122,9 +125,7 @@ public class VirtualRealityIbp extends VirtualRealityDevice { @Getter @Setter public class SquareButton extends IbpElement { - /** - * 是否被按下 - */ + /** 是否被按下 */ private boolean pressed; /** 按钮被按下的时刻 */ @@ -135,8 +136,8 @@ public class VirtualRealityIbp extends VirtualRealityDevice { /** 有效的(防止计轴预复位按钮多次生效) */ private boolean effective; - public SquareButton(String code, Mean mean, boolean status, String sectionCode, Boolean up) { - super(code, Type.BUTTON, mean, status, up); + public SquareButton(String code, Mean mean, boolean on, String sectionCode, Boolean up) { + super(code, Type.BUTTON, mean, on, up); this.sectionCode = sectionCode; } } @@ -157,7 +158,7 @@ public class VirtualRealityIbp extends VirtualRealityDevice { */ KC, /** - * 下行终止扣车 + * 终止扣车 */ ZZKC, /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityPsl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityPsl.java index 734d6ee65..bba8e67c0 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityPsl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealityPsl.java @@ -1,12 +1,14 @@ package club.joylink.rtss.simulation.cbtc.data.vr; import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement; +import club.joylink.rtss.simulation.cbtc.data.map.Stand; import lombok.Getter; import lombok.Setter; @Getter @Setter public class VirtualRealityPsl extends VirtualRealityDevice { + private Stand stand; /** 所有滑动门/应急门关闭且紧锁指示灯 */ private boolean qbgmLight; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/SimulationRealDeviceConnectManager.java b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/SimulationRealDeviceConnectManager.java index 22f46d3c1..30b34cc64 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/SimulationRealDeviceConnectManager.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/SimulationRealDeviceConnectManager.java @@ -85,6 +85,10 @@ public class SimulationRealDeviceConnectManager { typeEqual = true; realDevice.connect(vrDevice); } + if (MapElement.DeviceType.PSL.equals(vrDevice.getDeviceType())) { + typeEqual = true; + realDevice.connect(vrDevice); + } break; } case IBP:{ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdIbpServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdIbpServiceImpl.java index be99b7304..751f51753 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdIbpServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdIbpServiceImpl.java @@ -1,5 +1,6 @@ package club.joylink.rtss.simulation.cbtc.device.real.modbustcp.richor; +import club.joylink.rtss.services.IVirtualRealityIbpService; import club.joylink.rtss.simulation.cbtc.CI.CiApiService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; @@ -18,12 +19,14 @@ import club.joylink.rtss.simulation.rt.iscs.IscsStatusPublisher; import club.joylink.rtss.vo.client.project.richor.ZjdIbpConfigVO; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; +import javafx.scene.effect.Light; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Objects; @Slf4j @Component @@ -36,7 +39,7 @@ public class ZjdIbpServiceImpl implements RealDeviceService { private CiApiService ciApiService; @Autowired - private ApplicationContext applicationContext; + private IVirtualRealityIbpService iVirtualRealityIbpService; @Override public boolean canHandle(RealDeviceConfig deviceConfig) { @@ -67,8 +70,8 @@ public class ZjdIbpServiceImpl implements RealDeviceService { if (plcGateway == null) return; ZjdIbpConfig config = (ZjdIbpConfig) deviceConfig; - Station station = (Station) config.getMapElement(); - if (station == null) + VirtualRealityIbp vrIbp = (VirtualRealityIbp) config.getMapElement(); + if (vrIbp == null) return; ZjdIbpConfigVO configVO = config.getConfigVO(); ByteBuf deviceStatus = RealDeviceConfig.getDeviceCoilStatus(byteBuf, configVO.getAddr(), configVO.getQuantity()); @@ -93,58 +96,67 @@ public class ZjdIbpServiceImpl implements RealDeviceService { int baseAddr = plcGateway.getConfig().getAddr() + configVO.getAddr(); Channel channel = plcGateway.getChannel(); //查找真实设备和vr设备 - SimulationDataRepository repository = simulation.getRepository(); - MapConfig mapConfig = repository.getConfig(); - List stands = station.getAllNormalStands(); - List upStands = station.getNormalStand(mapConfig.isRight(true)); - List downStands = station.getNormalStand(mapConfig.isRight(false)); - //输入 - if (r_xx_jjtc) - downStands.forEach(stand -> ciApiService.standEC(simulation, stand)); - if (r_xx_qxjt) - downStands.forEach(stand -> ciApiService.cancelStandEC(simulation, stand)); - if (r_xx_kc) { - for (Stand stand : downStands) { - if (!stand.isIbpHoldTrain()) { - ciApiService.ibpHoldTrain(simulation, stand.getCode()); - } - } - } - if (r_xx_qxkc) - downStands.forEach(stand -> ciApiService.ibpHoldTrainCancel(simulation, stand.getCode())); - if (r_sx_jjtc) - upStands.forEach(stand -> ciApiService.standEC(simulation, stand)); - if (r_sx_qxjt) - upStands.forEach(stand -> ciApiService.cancelStandEC(simulation, stand)); - if (r_sx_kc) { - for (Stand stand : upStands) { - if (!stand.isIbpHoldTrain()) { - ciApiService.ibpHoldTrain(simulation, stand.getCode()); - } - } - } - if (r_sx_qxkc) - upStands.forEach(stand -> ciApiService.ibpHoldTrainCancel(simulation, stand.getCode())); - VirtualRealityIbp vrIbp = station.getVrIbp(); - List ibpElements = vrIbp.queryByMean(VirtualRealityIbp.Mean.SXYS); + /*------------------------- 输入 -------------------------*/ + //下行紧急停车 + List jjtc = vrIbp.query(VirtualRealityIbp.Mean.JJTC, false); + jjtc.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_xx_jjtc)); + //下行取消紧停 + List qxjt = vrIbp.query(VirtualRealityIbp.Mean.QXJJTC, false); + qxjt.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_xx_qxjt)); + //下行扣车 + List kc = vrIbp.query(VirtualRealityIbp.Mean.KC, false); + kc.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_xx_kc)); + //下行取消扣车 + List qxkc = vrIbp.query(VirtualRealityIbp.Mean.ZZKC, false); + qxkc.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_xx_qxkc)); + //上行紧急停车 + List sxjjtc = vrIbp.query(VirtualRealityIbp.Mean.JJTC, true); + sxjjtc.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_sx_jjtc)); + //上行取消紧停 + List sxqxjt = vrIbp.query(VirtualRealityIbp.Mean.QXJJTC, true); + sxqxjt.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_sx_qxjt)); + //上行扣车 + List sxkc = vrIbp.query(VirtualRealityIbp.Mean.KC, true); + sxkc.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_sx_kc)); + //上行取消扣车 + List sxqxkc = vrIbp.query(VirtualRealityIbp.Mean.ZZKC, true); + sxqxkc.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_sx_qxkc)); + //试灯 + List sd = vrIbp.queryByMean(VirtualRealityIbp.Mean.SD); + sd.forEach(element -> iVirtualRealityIbpService.updateElementStatus(simulation, vrIbp, element, r_sd)); + //下行允许禁止钥匙 + List ibpElements = vrIbp.queryByMean(VirtualRealityIbp.Mean.XXYS); ibpElements.forEach(ibpElement -> ibpElement.setOn(r_sx_czyx)); - //输出 - if (r_sd) { - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_kcd(), w_sx_kcd, true, channel); - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_jjtcd(), w_sx_jjtcd, true, channel); - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_kcd(), w_xx_kcd, true, channel); - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_jjtcd(), w_xx_jjtcd, true, channel); - } else { - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_fmq(), w_fmq, false, channel); - boolean upHoldTrain = upStands.stream().anyMatch(Stand::isIbpHoldTrain); - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_kcd(), w_sx_kcd, upHoldTrain, channel); - boolean upEc = upStands.stream().anyMatch(Stand::isEmergencyClosed); - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_jjtcd(), w_sx_jjtcd, upEc, channel); - boolean downHoldTrain = downStands.stream().anyMatch(Stand::isIbpHoldTrain); - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_kcd(), w_xx_kcd, downHoldTrain, channel); - boolean downEc = downStands.stream().anyMatch(Stand::isEmergencyClosed); - plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_jjtcd(), w_xx_jjtcd, downEc, channel); - } + /*------------------------- 输出 -------------------------*/ + boolean xxkcd = vrIbp.query(VirtualRealityIbp.Mean.kcLight, false).stream() + .allMatch(VirtualRealityIbp.IbpElement::isOn); + plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_kcd(), w_xx_kcd, xxkcd, channel); + boolean sxkcd = vrIbp.query(VirtualRealityIbp.Mean.kcLight, true).stream() + .allMatch(VirtualRealityIbp.IbpElement::isOn); + plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_kcd(), w_sx_kcd, sxkcd, channel); + boolean xxjjtcd = vrIbp.query(VirtualRealityIbp.Mean.jjtcLight, false).stream() + .allMatch(VirtualRealityIbp.IbpElement::isOn); + plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_jjtcd(), w_xx_jjtcd, xxjjtcd, channel); + boolean sxjjtcd = vrIbp.query(VirtualRealityIbp.Mean.jjtcLight, true).stream() + .allMatch(VirtualRealityIbp.IbpElement::isOn); + plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_jjtcd(), w_sx_jjtcd, sxjjtcd, channel); +// //输出 +// if (r_sd) { +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_kcd(), w_sx_kcd, true, channel); +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_jjtcd(), w_sx_jjtcd, true, channel); +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_kcd(), w_xx_kcd, true, channel); +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_jjtcd(), w_xx_jjtcd, true, channel); +// } else { +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_fmq(), w_fmq, false, channel); +// boolean upHoldTrain = upStands.stream().anyMatch(Stand::isIbpHoldTrain); +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_kcd(), w_sx_kcd, upHoldTrain, channel); +// boolean upEc = upStands.stream().anyMatch(Stand::isEmergencyClosed); +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_sx_jjtcd(), w_sx_jjtcd, upEc, channel); +// boolean downHoldTrain = downStands.stream().anyMatch(Stand::isIbpHoldTrain); +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_kcd(), w_xx_kcd, downHoldTrain, channel); +// boolean downEc = downStands.stream().anyMatch(Stand::isEmergencyClosed); +// plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_xx_jjtcd(), w_xx_jjtcd, downEc, channel); +// } //ISCS状态 SimulationIscsDataRepository iscsRepository = simulation.getIscsRepository(); String iscsCode = configVO.getIscsCode(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdPslServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdPslServiceImpl.java index 2a6ae963e..8ccc73a3e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdPslServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/modbustcp/richor/ZjdPslServiceImpl.java @@ -1,9 +1,9 @@ package club.joylink.rtss.simulation.cbtc.device.real.modbustcp.richor; +import club.joylink.rtss.services.psl.IVirtualRealityPslService; import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.SimulationIscsDataRepository; -import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.vo.iscs.IscsPslStatusVO; import club.joylink.rtss.simulation.cbtc.data.vo.iscs.IscsStatusVO; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityPsl; @@ -20,6 +20,9 @@ public class ZjdPslServiceImpl implements RealDeviceService { @Autowired private CiStandService standService; + @Autowired + private IVirtualRealityPslService iVirtualRealityPslService; + @Override public boolean canHandle(RealDeviceConfig deviceConfig) { return deviceConfig instanceof ZjdPslConfig; @@ -40,12 +43,13 @@ public class ZjdPslServiceImpl implements RealDeviceService { boolean r_sx_gm = RealDeviceConfig.getBitOf(deviceStatus, configVO.getR_sx_gm()); boolean r_sx_hsjc = RealDeviceConfig.getBitOf(deviceStatus, configVO.getR_sx_hsjc()); //信号系统状态 - Stand stand = (Stand) config.getMapElement(); - if (stand != null) { - VirtualRealityPsl vrPsl = stand.getVrPsl(); - vrPsl.setYxjzKey(r_sx_czyx); - standService.setOrCancelInterlockRelease(simulation, stand, r_sx_hsjc); - } + VirtualRealityPsl vrPsl = (VirtualRealityPsl) config.getMapElement(); + if (vrPsl == null) + return; + iVirtualRealityPslService.updateStatus(simulation, vrPsl, VirtualRealityPsl.Button.YXJZ, r_sx_czyx); + iVirtualRealityPslService.updateStatus(simulation, vrPsl, VirtualRealityPsl.Button.KM, r_sx_km); + iVirtualRealityPslService.updateStatus(simulation, vrPsl, VirtualRealityPsl.Button.GM, r_sx_gm); + iVirtualRealityPslService.updateStatus(simulation, vrPsl, VirtualRealityPsl.Button.HSJC, r_sx_hsjc); //ISCS状态 SimulationIscsDataRepository iscsRepository = simulation.getIscsRepository(); String iscsCode = configVO.getIscsCode(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/service/ATOService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/service/ATOService.java index d86f6eea5..4fd571828 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/service/ATOService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATO/service/ATOService.java @@ -2,6 +2,7 @@ package club.joylink.rtss.simulation.cbtc.onboard.ATO.service; import club.joylink.rtss.simulation.cbtc.ATP.ground.MaService; import club.joylink.rtss.simulation.cbtc.CI.CiApiService; +import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.constant.DriveMode; import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; @@ -386,7 +387,7 @@ public class ATOService { } else { this.openTrainDoor(simulation, train, train.getDoor1()); } - this.ciApiService.openScreenDoor(simulation, stand.getCode()); + this.ciApiService.openScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.SIG); } } @@ -407,7 +408,7 @@ public class ATOService { this.closeTrainDoor(simulation, train, train.getDoor2()); } for (Stand stand : standList) { - this.ciApiService.closeScreenDoor(simulation, stand.getCode()); + this.ciApiService.closeScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.SIG); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java index be14dc358..51004df05 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java @@ -1,6 +1,7 @@ package club.joylink.rtss.simulation.cbtc.onboard.ATP; import club.joylink.rtss.simulation.cbtc.CI.CiApiService; +import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.constant.DriveMode; import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; @@ -310,7 +311,7 @@ public class ATPService { } if (train.isCommunicable()) { for (Stand stand : standList) { - this.ciApiService.openScreenDoor(simulation, stand.getCode()); + this.ciApiService.openScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.SIG); } } } else { @@ -320,7 +321,7 @@ public class ATPService { } if (train.isCommunicable()) { for (Stand stand : standList) { - this.ciApiService.closeScreenDoor(simulation, stand.getCode()); + this.ciApiService.closeScreenDoor(simulation, stand.getCode(), CiStandService.PsdCommandSource.SIG); } } } diff --git a/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdIbpConfigVO.java b/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdIbpConfigVO.java index 869734777..52c505d61 100644 --- a/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdIbpConfigVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdIbpConfigVO.java @@ -10,10 +10,7 @@ import lombok.Setter; @Getter @Setter public class ZjdIbpConfigVO extends RealConfigVO { - /** - * ibp盘绑定的车站 - */ - private String stationCode = "Station25166"; + private String ibpCode = "Station25166_IBP"; private String iscsCode = "ibp"; @@ -93,7 +90,6 @@ public class ZjdIbpConfigVO extends RealConfigVO { */ private Integer w_sx_kcd = 23; - /** 操作允许 */ private Integer r_sx_czyx = 77; diff --git a/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdPslConfigVO.java b/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdPslConfigVO.java index 234b55cde..6f764fdad 100644 --- a/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdPslConfigVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/project/richor/ZjdPslConfigVO.java @@ -10,7 +10,7 @@ import lombok.Setter; @Getter @Setter public class ZjdPslConfigVO extends RealConfigVO { - private String standCode = "PF59020"; + private String pslCode = "PF59020_PSL"; private String iscsCode = "psl";