diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java index eb10bf476..272473a33 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapRouteServiceImpl.java @@ -340,6 +340,8 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { /** * 生成调车进路 + * 调车进路的始终端都应具备调车功能。 + * 调车进路不会越过进站信号机。 */ private void generateShuntingRoute(Assistant assistant, int iter) { Signal startSignal = assistant.startSignal; @@ -358,8 +360,22 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { } while (section != null) { + boolean outStation = false; //超出车站范围 Signal sdSignal = section.getSignalOf(right); //同向信号机 + if (sdSignal != null) { + if (sdSignal.isReceivingDepartureSignal()) { + outStation = true; + } + sdSignal = sdSignal.hasShuntingFunction() ? sdSignal : null; + } Signal tempOdSignal = section.getSignalOf(!right); //反向信号机 + if (tempOdSignal != null) { + if (tempOdSignal.isReceivingDepartureSignal()) { + outStation = true; + } + tempOdSignal = tempOdSignal.hasShuntingFunction() ? tempOdSignal : null; + } + if (sdSignal != null) { if (tempOdSignal == null) { //仅有同向信号机 assistant.endSignal = sdSignal; @@ -396,6 +412,10 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { break; } + if (outStation) { + break; + } + Section next = section.getNextSection(right); if (next == null) { @@ -501,7 +521,7 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService { route.setType(Route.Type.SHUNTING); String startEndSignalCode = route.getStart().getCode() + route.getDestination().getCode(); Route otherRoute = routeMap.get(startEndSignalCode); //同始、终端信号机进路 - if (otherRoute != null) { //选择反位道岔更少的/反位道岔更靠后的 + if (otherRoute != null && Route.Type.SHUNTING.equals(otherRoute.getType())) { //选择反位道岔更少的/反位道岔更靠后的 int routeReverseSwitchQuantity = route.getReverseSwitchQuantity(); int otherRouteReverseSwitchQuantity = otherRoute.getReverseSwitchQuantity(); if (routeReverseSwitchQuantity < otherRouteReverseSwitchQuantity) { //选择反位道岔更少的 diff --git a/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java b/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java index 97de4154d..407276ca0 100644 --- a/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/mapFunction/RtsMapFunctionServiceImpl.java @@ -23,7 +23,6 @@ import club.joylink.rtss.vo.map.MapVO; import club.joylink.rtss.vo.map.graph.MapMemberVO; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; -import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -780,7 +779,6 @@ public class RtsMapFunctionServiceImpl implements RtsMapFunctionService { return fillFunctions; } - @Nullable private Supplier getEmergencyFunctionSupplier(long mapId, Set systemNameSet, List msgList, Simulation.Type simType) { //应急调度指挥系统 Supplier system = () -> {