diff --git a/src/main/java/club/joylink/rtss/services/DraftMapService.java b/src/main/java/club/joylink/rtss/services/DraftMapService.java index c46f6aff9..9dba9d13c 100644 --- a/src/main/java/club/joylink/rtss/services/DraftMapService.java +++ b/src/main/java/club/joylink/rtss/services/DraftMapService.java @@ -570,7 +570,6 @@ public class DraftMapService implements IDraftMapService { this.draftMapRouteFlankProtectionDAO.insert(entity); }); } - } private void deleteMapLogicData(Long id) { diff --git a/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java b/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java index e97291401..c355bf86e 100644 --- a/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java +++ b/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java @@ -21,9 +21,12 @@ import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.client.LoginStatusVO; import club.joylink.rtss.vo.client.LoginUserVO; +import club.joylink.rtss.vo.client.SocketMessageVO; +import club.joylink.rtss.vo.client.factory.SocketMessageFactory; import club.joylink.rtss.vo.client.project.ProjectDeviceVO; import club.joylink.rtss.vo.client.project.RelationLoginConfigVO; import club.joylink.rtss.vo.wx.WmUserSession; +import club.joylink.rtss.websocket.StompMessageService; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -74,6 +77,9 @@ public class AuthenticateService implements IAuthenticateService { @Autowired private ProjectSimulationService projectSimulationService; + @Autowired + private StompMessageService stompMessageService; + @Override public LoginStatusVO getWmLoginUrl(String clientId, String secret, Project project, String deviceCode) { String envId = SystemEnv.getSystemEnvIdByName(this.otherConfig.getEnv()); @@ -322,6 +328,8 @@ public class AuthenticateService implements IAuthenticateService { } } for (LoginUserInfoVO infoVO : removeList) { + SocketMessageVO message = SocketMessageFactory.buildLoginSomewhereElseMessage(infoVO); + stompMessageService.sendToUser(infoVO.getAccountVO().getIdStr(), message); this.logout(infoVO); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java index b7ff1d3b2..53a3e4877 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java @@ -144,11 +144,11 @@ public class AtpSectionService { */ public void sectionARBCheck(Simulation simulation, Section section, List
sectionList) { //目前ARB故障才会导致ARB判定 - if (Section.AxleFault.ARB.equals(section.getFault())) { - if (section.getVirtualAxleCounter().isOccupy() && !sectionList.contains(section)) { + if (Section.AxleFault.ARB.equals(section.getFault()) && section.getVirtualAxleCounter().isOccupy()) { + if (!sectionList.contains(section)) { section.judgeAsARB(); - } else if (Section.AxleFault.FAULT.equals(section.getFault()) && section.getVirtualAxleCounter().isOccupy()) { - section.judgeAsNctOccupied(); + } else { + section.setFault(Section.AxleFault.FAULT); } } else if (Section.AxleFault.FAULT.equals(section.getFault()) && section.getVirtualAxleCounter().isOccupy()) { section.judgeAsNctOccupied(); @@ -174,9 +174,9 @@ public class AtpSectionService { public List
getTrainExistAxleSectionsUnderDelay(Simulation simulation, List trainList) { List
list = new ArrayList<>(); for (VirtualRealityTrain train : trainList) { -// //只统计非通信车 -// if (train.isCBTC()) -// continue; + //只统计非通信车 + if (train.isCommunicable()) + continue; boolean right = train.isRight(); SectionPosition headPosition = train.getHeadPosition(); float offset = 50; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java index 0a08b92d9..e133d9f2e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java @@ -68,6 +68,7 @@ public class ATSLogicLoop { this.trainOutboundLoadTool.loadOutboundTrain(simulation); this.atsStandService.countDown(simulation); this.atsTrainMonitorService.monitor(simulation); + this.atsStationService.updateFieldThatChangeOverTime(simulation); } public void addJobs(Simulation simulation) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java index c375e9e9d..4c4230df4 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java @@ -401,7 +401,7 @@ public class AtsStationService { /** * 更新车站随时间变化的属性 */ - public void updateField(Simulation simulation) { + public void updateFieldThatChangeOverTime(Simulation simulation) { List stations = simulation.getRepository().getStationList(); for (Station station : stations) { //更新车站控制权转换倒计时及有效性 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java index 1ea3d899d..cb3133f8e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPLogicLoop.java @@ -191,6 +191,7 @@ public class ATPLogicLoop { // EB 触发速度计算 SpeedCurve ebTriggerCurve = ma.getEbTriggerCurve(); float ebTriggerRemain = ma.calculateDistanceOfEbTriggerEnd(); + ma.setEbTriggerCurve(ebTriggerCurve); float totalDistance = ebTriggerCurve.getTotalDistance(); if (totalDistance < ebTriggerRemain) { ebTriggerRemain = totalDistance; @@ -198,6 +199,7 @@ public class ATPLogicLoop { float atpSpeed = ebTriggerCurve.getSpeedOf(ebTriggerRemain); // ATO推荐速度计算 SpeedCurve speedCurve = SpeedCurve.calculateAtoStopCurveAndUpdate(train, ma); + ma.setAtoStopCurve(speedCurve); float atoSpeed = speedCurve.getSpeedOf(speedCurve.getTotalDistance()); train.setAtpSpeed(atpSpeed); train.setAtoSpeed(atoSpeed); diff --git a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java index 26e4989f3..c765be268 100644 --- a/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java +++ b/src/main/java/club/joylink/rtss/vo/client/factory/SocketMessageFactory.java @@ -10,6 +10,7 @@ import club.joylink.rtss.simulation.cbtc.data.vo.*; import club.joylink.rtss.simulation.cbtc.member.SimulationMember; import club.joylink.rtss.simulation.cbtc.member.SimulationUser; import club.joylink.rtss.simulation.cbtc.message.websocket.SimulationSubscribeTopic; +import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.client.SocketMessageVO; import club.joylink.rtss.vo.client.WebSocketMessageType; import club.joylink.rtss.vo.client.passenger.PassengerFlowMessage2TD; @@ -269,6 +270,10 @@ public class SocketMessageFactory { return build(WebSocketMessageType.STATION_PFI_NUM, group, data); } + public static SocketMessageVO buildLoginSomewhereElseMessage(LoginUserInfoVO infoVO) { + return build(WebSocketMessageType.Be_Logged_Out, null, infoVO); + } + @Component private static class SpringContextUtil implements ApplicationContextAware {