【运行方向箭头亮灯逻辑问题修复】

This commit is contained in:
weizhihong 2022-05-10 10:03:23 +08:00
parent d4b8a99f50
commit 39ac31901f
2 changed files with 14 additions and 23 deletions

View File

@ -51,23 +51,8 @@ public class CiLogic {
// 区间灯点灯逻辑
if (simulation.getRepository().getConfig().isHasCTC()) {
// 联锁数据检查
simulation.getBuildParams().getMap().getLogicDataNew().getDraftMapStationDirectionList()
.stream()
simulation.getBuildParams().getMap().getLogicDataNew().getDraftMapStationDirectionList().stream()
.forEach(stationDirectionLabel -> stationDirectionService.refreshSectionLightStatus(simulation, stationDirectionLabel));
// // 区间灯点灯
// simulation.getBuildParams().getMap().getLogicDataNew().getDraftMapStationDirectionLabelVOList()
// .stream()
// .filter(indicatorButton -> "indicator".equals(indicatorButton.getModelType()) && "section".equals(indicatorButton.getType()))
// .forEach(indicatorSectionVO -> assistService.refreshSectionLightStatus(simulation, indicatorSectionVO));
//
// // 接发车点灯
// simulation.getRepository().getStationList()
// .stream()
// .filter(station -> !CollectionUtils.isEmpty(station.getIndicatorList()))
// .forEach(station -> {
// Stream.of(DirectionLabelEnum.values())
// .forEach(label -> assistService.refreshReceiveAndDeliverLightStatus(station, label));
// });
}
}

View File

@ -9,6 +9,7 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
/**
@ -338,16 +339,17 @@ public class StationDirection extends MapNamedElement {
/**
* 判断信号机发车方向的三个区段是否解锁
*
* @param runRight 列车的运行方向
* @return 锁闭状态
*/
private boolean judgeSignalLock() {
private boolean judgeSignalLock(boolean runRight) {
// 发车方向
boolean isRight = this.deliverRouteList.stream().findAny().get().isRight();
boolean deliverRight = this.deliverRouteList.stream().anyMatch(Route::isRight);
Section section = this.getSignal().getSection();
boolean isLock = section.isOccupied();
boolean isLock = section.isOccupied() && Objects.equals(section.isTrainRight(), runRight);
for (int index = 0; !isLock && index < 3 && section != null; index++) {
isLock = section.isOccupied();
section = section.getNextSection(isRight);
isLock = section.isOccupied() && Objects.equals(section.isTrainRight(), runRight);
section = section.getNextSection(deliverRight);
}
return isLock;
}
@ -387,14 +389,18 @@ public class StationDirection extends MapNamedElement {
// 进路区段占用判断点灯颜色
if (ReceiveAndDeliverModel.R.equals(this.runStatus)) {
deliverAspect = IndicatorStatusEnum.F;
// 运行方向
boolean runRight = this.receiveRouteList.stream().anyMatch(Route::isRight);
// 接车进路锁闭
receiveAspect = judgeSignalLock() ? IndicatorStatusEnum.O : IndicatorStatusEnum.F;
receiveAspect = judgeSignalLock(runRight) ? IndicatorStatusEnum.O : IndicatorStatusEnum.F;
} else if (ReceiveAndDeliverModel.D.equals(this.runStatus)) {
receiveAspect = IndicatorStatusEnum.F;
// 信号机进路锁闭
Section section = this.getSignal().getSection();
// 运行方向
boolean runRight = this.deliverRouteList.stream().anyMatch(Route::isRight);
// 发车进路锁闭
deliverAspect = judgeSignalLock() || section.isRouteLock() ? IndicatorStatusEnum.O : IndicatorStatusEnum.F;
deliverAspect = judgeSignalLock(runRight) || section.isRouteLock() ? IndicatorStatusEnum.O : IndicatorStatusEnum.F;
} else {
receiveAspect = this.receiveAspect;
deliverAspect = this.receiveAspect;