Merge remote-tracking branch 'origin/test' into simulation-new-logic
This commit is contained in:
commit
d71ca4f07c
@ -157,10 +157,7 @@ public class AtsRouteService {
|
|||||||
Signal signal = simulation.getRepository().getByCode(signalCode, Signal.class);
|
Signal signal = simulation.getRepository().getByCode(signalCode, Signal.class);
|
||||||
List<Route> routeList = signal.getRouteList();
|
List<Route> routeList = signal.getRouteList();
|
||||||
if (!CollectionUtils.isEmpty(routeList)) {
|
if (!CollectionUtils.isEmpty(routeList)) {
|
||||||
for (Route route : routeList) {
|
routeList.stream().filter(Route::isArs).forEach(route -> {
|
||||||
if (!route.isArs()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (route.isFleetMode()) {
|
if (route.isFleetMode()) {
|
||||||
throw new SimulationException(SimulationExceptionType.Operation_Conflict,
|
throw new SimulationException(SimulationExceptionType.Operation_Conflict,
|
||||||
String.format("进路[%s(%s)]自动通过已开启,不能设置自动追踪", route.getName(), route.getCode()));
|
String.format("进路[%s(%s)]自动通过已开启,不能设置自动追踪", route.getName(), route.getCode()));
|
||||||
@ -171,9 +168,11 @@ public class AtsRouteService {
|
|||||||
if (simulation.getRepository().getConfig().isSignalHumanControlBeforeSetAtsControlOrCIAutoTrigger()) {
|
if (simulation.getRepository().getConfig().isSignalHumanControlBeforeSetAtsControlOrCIAutoTrigger()) {
|
||||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isHumanControl(), String.format("信号机[%s]需处于人工控", signal.getCode()));
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isHumanControl(), String.format("信号机[%s]需处于人工控", signal.getCode()));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
for (Route route : routeList) {
|
||||||
route.setAtsControl(false);
|
route.setAtsControl(false);
|
||||||
route.setCiControl(true);
|
if (route.isArs())
|
||||||
break;
|
route.setCiControl(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,6 +303,7 @@ public class AtsStationService {
|
|||||||
List<Route> routeList = repository.getRouteList();
|
List<Route> routeList = repository.getRouteList();
|
||||||
for (Route route : routeList) {
|
for (Route route : routeList) {
|
||||||
if (Objects.equals(route.getInterlockStation(), station)) {
|
if (Objects.equals(route.getInterlockStation(), station)) {
|
||||||
|
route.setAtsControl(false);
|
||||||
if (!route.isArs() || route.isFleetMode() || route.isCiControl()) {
|
if (!route.isArs() || route.isFleetMode() || route.isCiControl()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -467,12 +467,31 @@ public class Route extends MapNamedElement {
|
|||||||
public boolean isCiTrigger() {
|
public boolean isCiTrigger() {
|
||||||
List<SectionPath> approachPathList = this.start.getApproachPathList();
|
List<SectionPath> approachPathList = this.start.getApproachPathList();
|
||||||
for (SectionPath sectionPath : approachPathList) {
|
for (SectionPath sectionPath : approachPathList) {
|
||||||
|
//检查区段占用
|
||||||
List<Section> sectionList = sectionPath.getSectionList();
|
List<Section> sectionList = sectionPath.getSectionList();
|
||||||
|
boolean sectionOccupied = false;
|
||||||
for (Section section : sectionList) {
|
for (Section section : sectionList) {
|
||||||
if (section.isOccupiedOn(this.getStart().isRight())) {
|
if (section.isOccupiedOn(this.getStart().isRight())) {
|
||||||
return true;
|
sectionOccupied = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!sectionOccupied)
|
||||||
|
continue;
|
||||||
|
//检查道岔位置
|
||||||
|
if (CollectionUtils.isEmpty(sectionPath.getSwitchList())) {
|
||||||
|
boolean switchOnPosition = true;
|
||||||
|
for (SwitchElement switchElement : sectionPath.getSwitchList()) {
|
||||||
|
if (!switchElement.isOnPosition()) {
|
||||||
|
switchOnPosition = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!switchOnPosition)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user