泰雷兹排列进路到操作修改

This commit is contained in:
joylink_zhangsai 2021-03-10 19:40:35 +08:00
parent 8ef6553a20
commit 2faf256501
4 changed files with 14 additions and 13 deletions

View File

@ -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<RoutePathVO> queryRoutePaths(@PathVariable String group, String groupNumber, String standCode, String signalCode) {
@ApiOperation("查询区段路径")
@GetMapping("/{group}/querySectionPaths")
public List<List<String>> querySectionPaths(@PathVariable String group, String groupNumber, String standCode, String signalCode) {
return simulationSupportService.queryRoutePaths(group, groupNumber, standCode, signalCode);
}
}

View File

@ -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<RoutePathVO> queryRoutePaths(String group, String groupNumber, String standCode, String signalCode) {
public List<List<String>> 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<RoutePath> 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());
}
}

View File

@ -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<String> routes) {
atsTrainService.setRouteTo(simulation, routes);
}
/**

View File

@ -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<String> routes) {
routes.forEach(code -> ciApiService.settingRoute(simulation, code));
}
/**