Merge remote-tracking branch 'origin/test' into dev
# Conflicts: # src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/TrainOperateHandler.java
This commit is contained in:
commit
09890ab2a1
@ -259,21 +259,30 @@ public class MaService {
|
|||||||
|
|
||||||
private SectionPosition buildEoaOfLimitSignalWithOverlap(Signal signal, boolean right) {
|
private SectionPosition buildEoaOfLimitSignalWithOverlap(Signal signal, boolean right) {
|
||||||
List<RouteOverlap> overlapList = signal.getOverlapList();
|
List<RouteOverlap> overlapList = signal.getOverlapList();
|
||||||
Section section = this.queryOverlapLockedEndSection(overlapList);
|
SectionPosition eoa = this.queryOverlapLockedEndSection(overlapList, right);
|
||||||
if (section == null) {
|
if (eoa == null) {
|
||||||
section = signal.getSection();
|
Section section = signal.getSection();
|
||||||
|
eoa = new SectionPosition(section, right ? section.getMaxOffset() : section.getMinOffset());
|
||||||
}
|
}
|
||||||
return new SectionPosition(section, right ? section.getLen() : 0);
|
return eoa;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Section queryOverlapLockedEndSection(List<RouteOverlap> overlapList) {
|
private SectionPosition queryOverlapLockedEndSection(List<RouteOverlap> overlapList, boolean right) {
|
||||||
for (RouteOverlap routeOverlap : overlapList) {
|
for (RouteOverlap routeOverlap : overlapList) {
|
||||||
if (routeOverlap.isLock()) {
|
if (routeOverlap.isLock()) {
|
||||||
List<SectionPath> pathList = routeOverlap.getPathList();
|
List<SectionPath> pathList = routeOverlap.getPathList();
|
||||||
for (SectionPath sectionPath : pathList) {
|
for (SectionPath sectionPath : pathList) {
|
||||||
|
List<Section> logicList = sectionPath.getLogicList();
|
||||||
|
if (!CollectionUtils.isEmpty(logicList)) {
|
||||||
|
Section lastSection = logicList.get(logicList.size() - 1);
|
||||||
|
if (lastSection.isOverlapLock()) {
|
||||||
|
return new SectionPosition(lastSection.getParent(), right ? lastSection.getMaxOffset() : lastSection.getMinOffset());
|
||||||
|
}
|
||||||
|
}
|
||||||
List<Section> sectionList = sectionPath.getSectionList();
|
List<Section> sectionList = sectionPath.getSectionList();
|
||||||
if (sectionList.get(sectionList.size() - 1).isOverlapLock()) {
|
Section last = sectionList.get(sectionList.size() - 1);
|
||||||
return sectionList.get(sectionList.size() - 1);
|
if (last.isOverlapLock()) {
|
||||||
|
return new SectionPosition(last, right ? last.getMaxOffset() : last.getMinOffset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,11 +105,12 @@ public class TrainOperateHandler {
|
|||||||
* @param sn 服务号/表号(可为空)
|
* @param sn 服务号/表号(可为空)
|
||||||
* @param tn 行程号/序号/车次号(可为空)
|
* @param tn 行程号/序号/车次号(可为空)
|
||||||
* @param cn 乘务组号(可为空)
|
* @param cn 乘务组号(可为空)
|
||||||
|
* @param autoTrigger 列车自动排列(可为空)
|
||||||
*/
|
*/
|
||||||
@OperateHandlerMapping(type = Operation.Type.Train_Add_Train_Trace)
|
@OperateHandlerMapping(type = Operation.Type.Train_Add_Train_Trace)
|
||||||
public void addTrainTrace(Simulation simulation, String sectionCode, String groupNumber,
|
public void addTrainTrace(Simulation simulation, String sectionCode, String groupNumber,
|
||||||
String dn, String sn, String tn, String cn) {
|
String dn, String sn, String tn, String cn, Boolean autoTrigger) {
|
||||||
this.atsTrainService.addTrainTrace(simulation, sectionCode, groupNumber, dn, sn, tn, cn);
|
this.atsTrainService.addTrainTrace(simulation, sectionCode, groupNumber, dn, sn, tn, cn, Objects.isNull(autoTrigger) || autoTrigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -157,6 +158,8 @@ public class TrainOperateHandler {
|
|||||||
updateParam.getServiceNumber(), updateParam.getTripNumber(), updateParam.getDestinationCode());
|
updateParam.getServiceNumber(), updateParam.getTripNumber(), updateParam.getDestinationCode());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
this.atsTrainService.autoTrigger(simulation, updateParam.getGroupNumber(),
|
||||||
|
Objects.isNull(updateParam.getAutoTrigger()) || updateParam.getAutoTrigger());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,6 +28,9 @@ public class TrainTypeUpdateParam {
|
|||||||
/** 更新为头码车的目的地码 */
|
/** 更新为头码车的目的地码 */
|
||||||
private String destinationCode;
|
private String destinationCode;
|
||||||
|
|
||||||
|
/** 列车自动进路排列 */
|
||||||
|
private Boolean autoTrigger;
|
||||||
|
|
||||||
public void validCheck() {
|
public void validCheck() {
|
||||||
if (Objects.isNull(this.groupNumber) || Objects.isNull(this.type)) {
|
if (Objects.isNull(this.groupNumber) || Objects.isNull(this.type)) {
|
||||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||||
|
@ -72,7 +72,7 @@ public class AtsTrainService {
|
|||||||
* @param cn
|
* @param cn
|
||||||
*/
|
*/
|
||||||
public void addTrainTrace(Simulation simulation, String sectionCode, String groupNumber,
|
public void addTrainTrace(Simulation simulation, String sectionCode, String groupNumber,
|
||||||
String dn, String sn, String tn, String cn) {
|
String dn, String sn, String tn, String cn, boolean autoTrigger) {
|
||||||
SimulationDataRepository repository = simulation.getRepository();
|
SimulationDataRepository repository = simulation.getRepository();
|
||||||
//车组号检查
|
//车组号检查
|
||||||
TrainInfo trainInfo = repository.findSupervisedTrainByGroup(groupNumber);
|
TrainInfo trainInfo = repository.findSupervisedTrainByGroup(groupNumber);
|
||||||
@ -101,6 +101,7 @@ public class AtsTrainService {
|
|||||||
ti = new TrainInfo(groupNumber, TrainType.MANUAL);
|
ti = new TrainInfo(groupNumber, TrainType.MANUAL);
|
||||||
}
|
}
|
||||||
ti.init(section, dn, sn, tn, cn);
|
ti.init(section, dn, sn, tn, cn);
|
||||||
|
ti.setAtsAutoTrigger(autoTrigger);
|
||||||
repository.addTrainInfo(ti);
|
repository.addTrainInfo(ti);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -940,4 +941,9 @@ public class AtsTrainService {
|
|||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(standCodes, "所选站台列表不能为空");
|
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(standCodes, "所选站台列表不能为空");
|
||||||
standCodes.forEach(code -> atsStandService.cancelJumpStop(simulation, code, groupNumber));
|
standCodes.forEach(code -> atsStandService.cancelJumpStop(simulation, code, groupNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void autoTrigger(Simulation simulation, String groupNumber, boolean autoTrigger) {
|
||||||
|
TrainInfo trainInfo = simulation.getRepository().getSupervisedTrainByGroup(groupNumber);
|
||||||
|
trainInfo.setAtsAutoTrigger(autoTrigger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,9 @@ public class AtsTriggerRouteService {
|
|||||||
if (trainInfo.isManualTrain()) { // 人工车不触发
|
if (trainInfo.isManualTrain()) { // 人工车不触发
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!trainInfo.isAtsAutoTrigger()) { // 关闭列车自动排列
|
||||||
|
return;
|
||||||
|
}
|
||||||
Map<String, Route> atsTriggerRouteMap = trainInfo.getAtsTriggerRouteMap();
|
Map<String, Route> atsTriggerRouteMap = trainInfo.getAtsTriggerRouteMap();
|
||||||
boolean triggerRoute = triggerRoute(simulation, trainInfo, atsTriggerRouteMap); //触发了进路办理
|
boolean triggerRoute = triggerRoute(simulation, trainInfo, atsTriggerRouteMap); //触发了进路办理
|
||||||
if (!triggerRoute) {
|
if (!triggerRoute) {
|
||||||
|
@ -123,6 +123,8 @@ public class TrainStatus extends DeviceStatus {
|
|||||||
|
|
||||||
private String turnBackStatus;
|
private String turnBackStatus;
|
||||||
|
|
||||||
|
private Boolean autoTrigger;
|
||||||
|
|
||||||
public TrainStatus(TrainInfo train) {
|
public TrainStatus(TrainInfo train) {
|
||||||
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
|
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
|
||||||
this.groupNumber = train.getGroupNumber();
|
this.groupNumber = train.getGroupNumber();
|
||||||
@ -157,6 +159,7 @@ public class TrainStatus extends DeviceStatus {
|
|||||||
this.parkingRemainTime = train.getParkingRemainTimeInSeconds();
|
this.parkingRemainTime = train.getParkingRemainTimeInSeconds();
|
||||||
this.turnBackStrategy = train.getTurnBackStrategy();
|
this.turnBackStrategy = train.getTurnBackStrategy();
|
||||||
this.turnBackStatus = train.getTurnBackStatus();
|
this.turnBackStatus = train.getTurnBackStatus();
|
||||||
|
this.autoTrigger = train.isAtsAutoTrigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -317,6 +320,11 @@ public class TrainStatus extends DeviceStatus {
|
|||||||
status.setTurnBackStatus(this.turnBackStatus);
|
status.setTurnBackStatus(this.turnBackStatus);
|
||||||
change = true;
|
change = true;
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(this.autoTrigger, train.isAtsAutoTrigger())) {
|
||||||
|
this.autoTrigger = train.isAtsAutoTrigger();
|
||||||
|
status.setAutoTrigger(this.autoTrigger);
|
||||||
|
change = true;
|
||||||
|
}
|
||||||
return change;
|
return change;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,6 +239,12 @@ public class TrainInfo extends MapElement {
|
|||||||
@Setter
|
@Setter
|
||||||
private String turnBackStrategy;
|
private String turnBackStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动进路排列
|
||||||
|
*/
|
||||||
|
@Setter
|
||||||
|
private boolean atsAutoTrigger = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 折返状态
|
* 折返状态
|
||||||
*/
|
*/
|
||||||
|
@ -123,6 +123,8 @@ public class TrainStatusVO extends DeviceStatusVO {
|
|||||||
|
|
||||||
private String turnBackStatus;
|
private String turnBackStatus;
|
||||||
|
|
||||||
|
private Boolean autoTrigger;
|
||||||
|
|
||||||
public TrainStatusVO(TrainInfo train) {
|
public TrainStatusVO(TrainInfo train) {
|
||||||
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
|
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
|
||||||
}
|
}
|
||||||
@ -156,6 +158,7 @@ public class TrainStatusVO extends DeviceStatusVO {
|
|||||||
this.parkingRemainTime = train.getParkingRemainTime();
|
this.parkingRemainTime = train.getParkingRemainTime();
|
||||||
this.turnBackStrategy = train.getTurnBackStrategy();
|
this.turnBackStrategy = train.getTurnBackStrategy();
|
||||||
this.turnBackStatus = train.getTurnBackStatus();
|
this.turnBackStatus = train.getTurnBackStatus();
|
||||||
|
this.autoTrigger = train.getAutoTrigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user