diff --git a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java index 3a387029d..d1758b8ca 100644 --- a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java +++ b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java @@ -11,7 +11,6 @@ import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.command.CommandInitiateVO; import club.joylink.rtss.simulation.cbtc.communication.vo.fault.DeviceFaultInfo; import club.joylink.rtss.simulation.cbtc.data.status.IbpStatus; -import club.joylink.rtss.simulation.cbtc.data.vo.RoutePathVO; import club.joylink.rtss.simulation.cbtc.data.vo.SimulationVO; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityIbp; import club.joylink.rtss.simulation.cbtc.member.SimulationMember; @@ -306,9 +305,9 @@ public class SimulationV1Controller { return groupSimulationService.getLog(group, queryVO); } - @ApiOperation("查询进路路径") - @GetMapping("/{group}/queryRoutePaths") - public List queryRoutePaths(@PathVariable String group, String groupNumber, String standCode, String signalCode) { + @ApiOperation("查询区段路径") + @GetMapping("/{group}/querySectionPaths") + public List> querySectionPaths(@PathVariable String group, String groupNumber, String standCode, String signalCode) { return simulationSupportService.queryRoutePaths(group, groupNumber, standCode, signalCode); } } diff --git a/src/main/java/club/joylink/rtss/services/simulation/SimulationSupportService.java b/src/main/java/club/joylink/rtss/services/simulation/SimulationSupportService.java index 22079e229..a9956d830 100644 --- a/src/main/java/club/joylink/rtss/services/simulation/SimulationSupportService.java +++ b/src/main/java/club/joylink/rtss/services/simulation/SimulationSupportService.java @@ -4,17 +4,18 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.simulation.cbtc.GroupSimulationService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.CalculateService; +import club.joylink.rtss.simulation.cbtc.data.map.MapElement; import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; -import club.joylink.rtss.simulation.cbtc.data.vo.RoutePathVO; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; import java.util.List; +import java.util.stream.Collectors; /** * 仿真运行支持 @@ -24,7 +25,7 @@ public class SimulationSupportService { @Autowired private GroupSimulationService groupSimulationService; - public List queryRoutePaths(String group, String groupNumber, String standCode, String signalCode) { + public List> queryRoutePaths(String group, String groupNumber, String standCode, String signalCode) { Simulation simulation = groupSimulationService.getSimulationByGroup(group); Section destination; if (StringUtils.hasText(standCode)) { @@ -40,6 +41,9 @@ public class SimulationSupportService { Section startSection = train.getHeadPosition().getSection(); List routePaths = CalculateService.queryRoutePathsOnDirection(startSection, destination, train.isRight()); - return RoutePathVO.convert(routePaths); + return routePaths.stream() + .map(routePath -> CalculateService.selectUniqueRoutes(routePath, false) + .stream().map(MapElement::getCode).collect(Collectors.toList())) + .collect(Collectors.toList()); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/TrainOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/TrainOperateHandler.java index 64b710df2..8edd6be1b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/TrainOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/TrainOperateHandler.java @@ -13,7 +13,6 @@ import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; import club.joylink.rtss.simulation.cbtc.data.support.TrainLoadParam2; -import club.joylink.rtss.simulation.cbtc.data.vo.RoutePathVO; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; @@ -322,8 +321,8 @@ public class TrainOperateHandler { * 排列进路到(站台/信号机)【泰雷兹】 */ @OperateHandlerMapping(type = Operation.Type.Train_Set_Route) - public void setRouteTo(Simulation simulation, RoutePathVO routePath) { - atsTrainService.setRouteTo(simulation, routePath); + public void setRouteTo(Simulation simulation, List routes) { + atsTrainService.setRouteTo(simulation, routes); } /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainService.java index 2dbf1012c..e7e7614c0 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainService.java @@ -13,7 +13,6 @@ import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; import club.joylink.rtss.simulation.cbtc.data.support.StationTurnBackStrategyOption; -import club.joylink.rtss.simulation.cbtc.data.vo.RoutePathVO; import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; import club.joylink.rtss.simulation.cbtc.exception.SimulationException; @@ -894,8 +893,8 @@ public class AtsTrainService { /** * 排列进路到(站台/信号机) */ - public void setRouteTo(Simulation simulation, RoutePathVO routePath) { - routePath.getRouteList().forEach(routeCode -> ciApiService.settingRoute(simulation, routeCode)); + public void setRouteTo(Simulation simulation, List routes) { + routes.forEach(code -> ciApiService.settingRoute(simulation, code)); } /**