Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
joylink_zhangsai 2021-01-22 16:29:46 +08:00
commit 8cc9e9f3d2
5 changed files with 44 additions and 10 deletions

View File

@ -58,9 +58,6 @@ public class AtsRouteSettingService {
signalTrainMap.forEach((signal, train) -> { signalTrainMap.forEach((signal, train) -> {
// log.debug(String.format("ATS为列车[%s]触发信号机[%s(%s)]的进路", // log.debug(String.format("ATS为列车[%s]触发信号机[%s(%s)]的进路",
// train.getGroupNumber(), signal.getName(), signal.getCode())); // train.getGroupNumber(), signal.getName(), signal.getCode()));
if (CollectionUtils.isEmpty(signal.getRouteList())) { // 信号机不是进路始端结束
return;
}
Route route = null; Route route = null;
if (train.isPlanTrain()) { // 计划车 if (train.isPlanTrain()) { // 计划车
route = this.queryPlanTrainNeedRoute(simulation, train, signal, trainList); route = this.queryPlanTrainNeedRoute(simulation, train, signal, trainList);

View File

@ -11,6 +11,7 @@ import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityScreenDoor;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -20,6 +21,7 @@ import java.util.List;
/** /**
* CI主线逻辑循环 * CI主线逻辑循环
*/ */
@Slf4j
@Component @Component
public class CILogicLoop { public class CILogicLoop {

View File

@ -289,6 +289,10 @@ public class RouteService {
log.info(String.format("进路[%s]排列检查失败,无法排列:%s", route.debugStr(), check.debugStr())); log.info(String.format("进路[%s]排列检查失败,无法排列:%s", route.debugStr(), check.debugStr()));
return check; return check;
} }
if (route.isLock()) {
log.info(String.format("进路[%s]已经锁闭", route.debugStr()));
return null;
}
// 进路开始办理 // 进路开始办理
LocalDateTime systemTime = simulation.getSystemTime(); LocalDateTime systemTime = simulation.getSystemTime();
route.startSetting(systemTime); route.startSetting(systemTime);
@ -792,6 +796,9 @@ public class RouteService {
int level = checkRouteLevel(route); int level = checkRouteLevel(route);
route.getStart().setLevel(level); route.getStart().setLevel(level);
if (level != Signal.LEVEL_3) { if (level != Signal.LEVEL_3) {
if (route.isOpen()) {
log.info(String.format("进路[%s]联锁检查等级为[%s]", route.debugStr(), level));
}
return false; return false;
} }
return true; return true;
@ -863,6 +870,7 @@ public class RouteService {
} }
} }
if (!level1Result) { if (!level1Result) {
log.info(String.format("进路[%s]连锁条件检查失败:侧防不满足", route.debugStr()));
return level; return level;
} }
} }
@ -1169,7 +1177,7 @@ public class RouteService {
*/ */
public void openedRouteCheck(Simulation simulation, Route route) { public void openedRouteCheck(Simulation simulation, Route route) {
// if (route.isOpen()) { // if (route.isOpen()) {
this.checkAndSetLockedRouteOverlap(simulation, route); // this.checkAndSetLockedRouteOverlap(simulation, route);
// 区段锁闭在进路方向上 // 区段锁闭在进路方向上
boolean right = route.getStart().isRight(); boolean right = route.getStart().isRight();
for (Section section : route.getSectionList()) { for (Section section : route.getSectionList()) {
@ -1177,6 +1185,7 @@ public class RouteService {
section.routeLocking(right); section.routeLocking(right);
} }
} }
if (route.isOpen()) {
boolean interlocked = this.isInterlocked(route); boolean interlocked = this.isInterlocked(route);
if (!interlocked) { if (!interlocked) {
// 进路信号开放联锁逻辑不满足需关闭信号 // 进路信号开放联锁逻辑不满足需关闭信号
@ -1184,6 +1193,7 @@ public class RouteService {
log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯", log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯",
route.debugStr(), route.getStart().getName(), route.getStart().getCode())); route.debugStr(), route.getStart().getName(), route.getStart().getCode()));
} }
}
// this.reLockOverlap(simulation, route); // this.reLockOverlap(simulation, route);
// } // }
} }

View File

@ -38,6 +38,11 @@ public class SwitchService {
*/ */
private void controlSwitch(Simulation simulation, Switch aSwitch, boolean toNormal) { private void controlSwitch(Simulation simulation, Switch aSwitch, boolean toNormal) {
VirtualRealitySwitch virtualSwitch = aSwitch.getVirtualSwitch(); VirtualRealitySwitch virtualSwitch = aSwitch.getVirtualSwitch();
if ((virtualSwitch.isNormal() && toNormal) ||
(virtualSwitch.isReverse() && !toNormal)) {
log.debug(String.format("道岔[%s]已经在指定位置[%s],无需转动", aSwitch.debugStr(), virtualSwitch.isNormal()?"N":"R"));
return;
}
if (virtualSwitch.isSettingTo(toNormal)) { if (virtualSwitch.isSettingTo(toNormal)) {
return; return;
} }

View File

@ -155,6 +155,26 @@ public class TripPlan {
return null; return null;
} }
public StationPlan queryStationPlanByStationCode(String stationCode) {
for (StationPlan stationPlan : this.planList) {
if (Objects.equals(stationPlan.getStation().getCode(), stationCode)) {
return stationPlan;
}
}
return null;
}
public StationPlan queryNextStationPlanByStationCode(String stationCode) {
List<StationPlan> planList = this.getPlanList();
for (int i = 0; i < planList.size()-1; i++) {
StationPlan stationPlan = planList.get(i);
if (Objects.equals(stationPlan.getStation().getCode(), stationCode)) {
return planList.get(i+1);
}
}
return null;
}
public StationPlan queryNextStationPlan(Station station) { public StationPlan queryNextStationPlan(Station station) {
List<StationPlan> planList = this.getPlanList(); List<StationPlan> planList = this.getPlanList();
for (int i = 0; i < planList.size(); i++) { for (int i = 0; i < planList.size(); i++) {