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) {
|
||||
List<RouteOverlap> overlapList = signal.getOverlapList();
|
||||
Section section = this.queryOverlapLockedEndSection(overlapList);
|
||||
if (section == null) {
|
||||
section = signal.getSection();
|
||||
SectionPosition eoa = this.queryOverlapLockedEndSection(overlapList, right);
|
||||
if (eoa == null) {
|
||||
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) {
|
||||
if (routeOverlap.isLock()) {
|
||||
List<SectionPath> pathList = routeOverlap.getPathList();
|
||||
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();
|
||||
if (sectionList.get(sectionList.size() - 1).isOverlapLock()) {
|
||||
return sectionList.get(sectionList.size() - 1);
|
||||
Section last = sectionList.get(sectionList.size() - 1);
|
||||
if (last.isOverlapLock()) {
|
||||
return new SectionPosition(last, right ? last.getMaxOffset() : last.getMinOffset());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -101,15 +101,16 @@ public class TrainOperateHandler {
|
||||
* @param simulation
|
||||
* @param sectionCode 区段编号
|
||||
* @param groupNumber 车组号
|
||||
* @param dn 目的地码(可为空)
|
||||
* @param sn 服务号/表号(可为空)
|
||||
* @param tn 行程号/序号/车次号(可为空)
|
||||
* @param cn 乘务组号(可为空)
|
||||
* @param dn 目的地码(可为空)
|
||||
* @param sn 服务号/表号(可为空)
|
||||
* @param tn 行程号/序号/车次号(可为空)
|
||||
* @param cn 乘务组号(可为空)
|
||||
* @param autoTrigger 列车自动排列(可为空)
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Train_Add_Train_Trace)
|
||||
public void addTrainTrace(Simulation simulation, String sectionCode, String groupNumber,
|
||||
String dn, String sn, String tn, String cn) {
|
||||
this.atsTrainService.addTrainTrace(simulation, sectionCode, groupNumber, dn, sn, tn, cn);
|
||||
String dn, String sn, String tn, String cn, Boolean autoTrigger) {
|
||||
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());
|
||||
break;
|
||||
}
|
||||
this.atsTrainService.autoTrigger(simulation, updateParam.getGroupNumber(),
|
||||
Objects.isNull(updateParam.getAutoTrigger()) || updateParam.getAutoTrigger());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,6 +28,9 @@ public class TrainTypeUpdateParam {
|
||||
/** 更新为头码车的目的地码 */
|
||||
private String destinationCode;
|
||||
|
||||
/** 列车自动进路排列 */
|
||||
private Boolean autoTrigger;
|
||||
|
||||
public void validCheck() {
|
||||
if (Objects.isNull(this.groupNumber) || Objects.isNull(this.type)) {
|
||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument);
|
||||
|
@ -72,7 +72,7 @@ public class AtsTrainService {
|
||||
* @param cn
|
||||
*/
|
||||
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();
|
||||
//车组号检查
|
||||
TrainInfo trainInfo = repository.findSupervisedTrainByGroup(groupNumber);
|
||||
@ -101,6 +101,7 @@ public class AtsTrainService {
|
||||
ti = new TrainInfo(groupNumber, TrainType.MANUAL);
|
||||
}
|
||||
ti.init(section, dn, sn, tn, cn);
|
||||
ti.setAtsAutoTrigger(autoTrigger);
|
||||
repository.addTrainInfo(ti);
|
||||
}
|
||||
|
||||
@ -940,4 +941,9 @@ public class AtsTrainService {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(standCodes, "所选站台列表不能为空");
|
||||
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()) { // 人工车不触发
|
||||
return;
|
||||
}
|
||||
if (!trainInfo.isAtsAutoTrigger()) { // 关闭列车自动排列
|
||||
return;
|
||||
}
|
||||
Map<String, Route> atsTriggerRouteMap = trainInfo.getAtsTriggerRouteMap();
|
||||
boolean triggerRoute = triggerRoute(simulation, trainInfo, atsTriggerRouteMap); //触发了进路办理
|
||||
if (!triggerRoute) {
|
||||
|
@ -123,6 +123,8 @@ public class TrainStatus extends DeviceStatus {
|
||||
|
||||
private String turnBackStatus;
|
||||
|
||||
private Boolean autoTrigger;
|
||||
|
||||
public TrainStatus(TrainInfo train) {
|
||||
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
|
||||
this.groupNumber = train.getGroupNumber();
|
||||
@ -157,6 +159,7 @@ public class TrainStatus extends DeviceStatus {
|
||||
this.parkingRemainTime = train.getParkingRemainTimeInSeconds();
|
||||
this.turnBackStrategy = train.getTurnBackStrategy();
|
||||
this.turnBackStatus = train.getTurnBackStatus();
|
||||
this.autoTrigger = train.isAtsAutoTrigger();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -317,6 +320,11 @@ public class TrainStatus extends DeviceStatus {
|
||||
status.setTurnBackStatus(this.turnBackStatus);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.autoTrigger, train.isAtsAutoTrigger())) {
|
||||
this.autoTrigger = train.isAtsAutoTrigger();
|
||||
status.setAutoTrigger(this.autoTrigger);
|
||||
change = true;
|
||||
}
|
||||
return change;
|
||||
}
|
||||
|
||||
|
@ -239,6 +239,12 @@ public class TrainInfo extends MapElement {
|
||||
@Setter
|
||||
private String turnBackStrategy;
|
||||
|
||||
/**
|
||||
* 自动进路排列
|
||||
*/
|
||||
@Setter
|
||||
private boolean atsAutoTrigger = true;
|
||||
|
||||
/**
|
||||
* 折返状态
|
||||
*/
|
||||
|
@ -123,6 +123,8 @@ public class TrainStatusVO extends DeviceStatusVO {
|
||||
|
||||
private String turnBackStatus;
|
||||
|
||||
private Boolean autoTrigger;
|
||||
|
||||
public TrainStatusVO(TrainInfo train) {
|
||||
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
|
||||
}
|
||||
@ -156,6 +158,7 @@ public class TrainStatusVO extends DeviceStatusVO {
|
||||
this.parkingRemainTime = train.getParkingRemainTime();
|
||||
this.turnBackStrategy = train.getTurnBackStrategy();
|
||||
this.turnBackStatus = train.getTurnBackStatus();
|
||||
this.autoTrigger = train.getAutoTrigger();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user