Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
8cc9e9f3d2
@ -58,9 +58,6 @@ public class AtsRouteSettingService {
|
||||
signalTrainMap.forEach((signal, train) -> {
|
||||
// log.debug(String.format("ATS为列车[%s]触发信号机[%s(%s)]的进路",
|
||||
// train.getGroupNumber(), signal.getName(), signal.getCode()));
|
||||
if (CollectionUtils.isEmpty(signal.getRouteList())) { // 信号机不是进路始端,结束
|
||||
return;
|
||||
}
|
||||
Route route = null;
|
||||
if (train.isPlanTrain()) { // 计划车
|
||||
route = this.queryPlanTrainNeedRoute(simulation, train, signal, trainList);
|
||||
|
@ -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.VirtualRealitySignal;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -20,6 +21,7 @@ import java.util.List;
|
||||
/**
|
||||
* CI主线逻辑循环
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CILogicLoop {
|
||||
|
||||
|
@ -289,6 +289,10 @@ public class RouteService {
|
||||
log.info(String.format("进路[%s]排列检查失败,无法排列:%s", route.debugStr(), check.debugStr()));
|
||||
return check;
|
||||
}
|
||||
if (route.isLock()) {
|
||||
log.info(String.format("进路[%s]已经锁闭", route.debugStr()));
|
||||
return null;
|
||||
}
|
||||
// 进路开始办理
|
||||
LocalDateTime systemTime = simulation.getSystemTime();
|
||||
route.startSetting(systemTime);
|
||||
@ -792,6 +796,9 @@ public class RouteService {
|
||||
int level = checkRouteLevel(route);
|
||||
route.getStart().setLevel(level);
|
||||
if (level != Signal.LEVEL_3) {
|
||||
if (route.isOpen()) {
|
||||
log.info(String.format("进路[%s]联锁检查等级为[%s]", route.debugStr(), level));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -863,6 +870,7 @@ public class RouteService {
|
||||
}
|
||||
}
|
||||
if (!level1Result) {
|
||||
log.info(String.format("进路[%s]连锁条件检查失败:侧防不满足", route.debugStr()));
|
||||
return level;
|
||||
}
|
||||
}
|
||||
@ -1169,7 +1177,7 @@ public class RouteService {
|
||||
*/
|
||||
public void openedRouteCheck(Simulation simulation, Route route) {
|
||||
// if (route.isOpen()) {
|
||||
this.checkAndSetLockedRouteOverlap(simulation, route);
|
||||
// this.checkAndSetLockedRouteOverlap(simulation, route);
|
||||
// 区段锁闭在进路方向上
|
||||
boolean right = route.getStart().isRight();
|
||||
for (Section section : route.getSectionList()) {
|
||||
@ -1177,12 +1185,14 @@ public class RouteService {
|
||||
section.routeLocking(right);
|
||||
}
|
||||
}
|
||||
boolean interlocked = this.isInterlocked(route);
|
||||
if (!interlocked) {
|
||||
// 进路信号开放,联锁逻辑不满足,需关闭信号
|
||||
this.routeClose(simulation, route);
|
||||
log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯",
|
||||
route.debugStr(), route.getStart().getName(), route.getStart().getCode()));
|
||||
if (route.isOpen()) {
|
||||
boolean interlocked = this.isInterlocked(route);
|
||||
if (!interlocked) {
|
||||
// 进路信号开放,联锁逻辑不满足,需关闭信号
|
||||
this.routeClose(simulation, route);
|
||||
log.info(String.format("进路[%s]始端信号联锁条件不满足,信号机[%s(%s)]关灯",
|
||||
route.debugStr(), route.getStart().getName(), route.getStart().getCode()));
|
||||
}
|
||||
}
|
||||
// this.reLockOverlap(simulation, route);
|
||||
// }
|
||||
|
@ -38,6 +38,11 @@ public class SwitchService {
|
||||
*/
|
||||
private void controlSwitch(Simulation simulation, Switch aSwitch, boolean toNormal) {
|
||||
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)) {
|
||||
return;
|
||||
}
|
||||
|
@ -155,6 +155,26 @@ public class TripPlan {
|
||||
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) {
|
||||
List<StationPlan> planList = this.getPlanList();
|
||||
for (int i = 0; i < planList.size(); i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user