diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java index ac81eca3f..646b979dc 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -759,23 +759,69 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { if (Math.abs(start.getStation().getSn() - end.getStation().getSn()) == 1) { if (this.canArriveNearby(start, end, right)) { // 相邻车站,起始是转换轨且终点是正常站台轨或特殊站台(无正常站台轨且不是停车场的车站) - if ((start.isTransferTrack() && (end.isNormalStandTrack() || end.getStation().isNoDepotAndNoNormalStand())) - || ((start.isNormalStandTrack() || start.getStation().isNoDepotAndNoNormalStand()) && end.isTransferTrack())) { - paths.add(end); - pathsList.add(paths); - return; +// if ((start.isTransferTrack() && (end.isNormalStandTrack() || end.getStation().isNoDepotAndNoNormalStand())) +// || ((start.isNormalStandTrack() || start.getStation().isNoDepotAndNoNormalStand()) && end.isTransferTrack())) { +// paths.add(end); +// pathsList.add(paths); +// return; +// } + + if(start.isTransferTrack()){ + if(end.isNormalStandTrack() || end.getStation().isNoDepotAndNoNormalStand()){ + paths.add(end); + pathsList.add(paths); + return; + } + Signal signal = start.querySignalOnDirectionConsiderSectionType(right); + this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); + if(nstdList.size()==0){ + paths.add(end); + pathsList.add(paths); + return; + } + if(nstdList.size()==1){ + if (!this.canArriveNearby(nstdList.get(0), end, right)){ + paths.add(end); + pathsList.add(paths); + return; + } + } + } + + if(end.isTransferTrack()){ + if(start.isNormalStandTrack() || start.getStation().isNoDepotAndNoNormalStand()){ + paths.add(end); + pathsList.add(paths); + return; + } + Signal signal = start.querySignalOnDirectionConsiderSectionType(right); + this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); + if(nstdList.size()==0){ + paths.add(end); + pathsList.add(paths); + return; + } + if(nstdList.size()==1){ + if (!this.canArriveNearby(nstdList.get(0), end, right)){ + paths.add(end); + pathsList.add(paths); + return; + } + } } } else { // 相邻站,不能到达的直接返回 return; } } // 起始查询 - Signal signal = start.querySignalOnDirectionConsiderSectionType(right); - this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); + if(CollectionUtils.isEmpty(nstdList)){ + Signal signal = start.querySignalOnDirectionConsiderSectionType(right); + this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); + } if (CollectionUtils.isEmpty(nstdList)) { // 未找到,如果是折返轨/转换轨,反向尝试 if ((start.isTurnBackTrack() || start.isTransferTrack()) && !start.isNormalStandTrack()) { - signal = start.getSignalOf(!right); + Signal signal = start.getSignalOf(!right); this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); } }