修改:列车信息添加内容(西安三47)

This commit is contained in:
joylink_zhangsai 2021-06-30 13:53:44 +08:00
parent f04cb9ae19
commit 18fbefcee7
9 changed files with 270 additions and 94 deletions

View File

@ -153,7 +153,7 @@ public class TrainOperateHandler {
break; break;
case HEAD: case HEAD:
this.atsTrainService.setHeadTrain(simulation, updateParam.getGroupNumber(), this.atsTrainService.setHeadTrain(simulation, updateParam.getGroupNumber(),
updateParam.getServiceNumber(), null, updateParam.getDestinationCode()); updateParam.getServiceNumber(), updateParam.getTripNumber(), updateParam.getDestinationCode());
break; break;
} }
} }

View File

@ -460,34 +460,10 @@ public class InterlockBuilder2 {
log.info("目的地码构建耗时:" + (System.currentTimeMillis() - start)); log.info("目的地码构建耗时:" + (System.currentTimeMillis() - start));
// ------------目的地码end------------- // ------------目的地码end-------------
// // 交路的经过区段校验
// for (Routing routing : routingList) {
// List<Section> viaSectionList = routing.getViaSectionList();
// for (int i = 1; i < viaSectionList.size(); i++) {
// Section start = viaSectionList.get(i - 1);
// Section end = viaSectionList.get(i);
// boolean find = false;
// for (StationRunLevel stationRunLevel : stationRunLevelList) {
// if (Objects.equals(start, stationRunLevel.getStartSection()) &&
// Objects.equals(end, stationRunLevel.getEndSection())) {
// find = true;
// break;
// }
// }
// if (!find) {
// log.warn(String.format("交路[%s]中,从区段[%s(%s)]-区段[%s(%s)]的站间运行等级数据不存在",
// routing.getName(),
// start.getName(), start.getCode(),
// end.getName(), end.getCode()));
// }
// }
// }
// 根据站间运行等级数据构建路径单元 // 根据站间运行等级数据构建路径单元
if (!errMsgList.isEmpty()) { if (!errMsgList.isEmpty()) {
return; return;
} }
// buildRouteUnitFromStationRunLevel(stationRunLevelList, mapDataBuildResult, errMsgList);
buildRoutePathFromStationRunLevel(stationRunLevelList, mapDataBuildResult, errMsgList); buildRoutePathFromStationRunLevel(stationRunLevelList, mapDataBuildResult, errMsgList);
} }

View File

@ -410,6 +410,13 @@ public class MapDeviceBuilder {
} }
} }
} }
//站台默认折返策略
Stand.TurnBackType defaultStrategy = standVO.getDefaultReentryStrategy();
if (defaultStrategy == null) {
stand.setDefaultTypeStrategy(Stand.TurnBackType.DEFAULT);
} else {
stand.setDefaultTypeStrategy(defaultStrategy);
}
}); });
// 站台轨关系数据校验 // 站台轨关系数据校验
List<Section> standTrackList = elementMap.values().stream() List<Section> standTrackList = elementMap.values().stream()

View File

@ -1,5 +1,6 @@
package club.joylink.rtss.simulation.cbtc.data.map; package club.joylink.rtss.simulation.cbtc.data.map;
import club.joylink.rtss.simulation.cbtc.constant.TurnBackStrategyType;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityPsl; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityPsl;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityScreenDoor; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityScreenDoor;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
@ -62,6 +63,9 @@ public class Stand extends MayOutOfOrderDevice {
private VirtualRealityPsl vrPsl; private VirtualRealityPsl vrPsl;
/** 默认折返策略 */
private TurnBackType defaultTypeStrategy;
// -------------------------------状态属性--------------------------------- // -------------------------------状态属性---------------------------------
/** /**
@ -139,7 +143,7 @@ public class Stand extends MayOutOfOrderDevice {
*/ */
private boolean parkingAlwaysValid; private boolean parkingAlwaysValid;
private TurnBackType defaultTypeStrategy; // private TurnBackType defaultTypeStrategy;
/** /**
* 折返类型策略(无折返/自动换端/无人折返) * 折返类型策略(无折返/自动换端/无人折返)
@ -181,7 +185,7 @@ public class Stand extends MayOutOfOrderDevice {
this.runLevelTimeForever = false; this.runLevelTimeForever = false;
this.parkingTime = -1; this.parkingTime = -1;
this.parkingAlwaysValid = false; this.parkingAlwaysValid = false;
this.typeStrategy = TurnBackType.DEFAULT; this.typeStrategy = this.defaultTypeStrategy;
this.noStatus = false; this.noStatus = false;
this.closed = false; this.closed = false;
} }
@ -322,6 +326,10 @@ public class Stand extends MayOutOfOrderDevice {
this.closed = true; this.closed = true;
} }
public boolean turnBackTypeNonDefault() {
return !Objects.equals(typeStrategy, TurnBackType.DEFAULT);
}
/** /**
* 站台折返类型策略 * 站台折返类型策略
*/ */

View File

@ -80,6 +80,8 @@ public class StandStatus extends DeviceStatus {
@JsonSerialize(using = Boolean2NumSerializer.class) @JsonSerialize(using = Boolean2NumSerializer.class)
private boolean parkingAlwaysValid; private boolean parkingAlwaysValid;
private Stand.TurnBackType typeStrategy;
@JsonSerialize(using = Boolean2NumSerializer.class) @JsonSerialize(using = Boolean2NumSerializer.class)
private boolean noStatus; private boolean noStatus;

View File

@ -37,6 +37,9 @@ public class TrainStatus extends DeviceStatus {
/** 乘务组号 */ /** 乘务组号 */
private String crewNumber; private String crewNumber;
/** 最后一个抵达的车站 */
private String stationCode;
/** 计划交路类型 */ /** 计划交路类型 */
private PlanRoutingType planRoutingType; private PlanRoutingType planRoutingType;
@ -116,6 +119,10 @@ public class TrainStatus extends DeviceStatus {
private int parkingRemainTime; private int parkingRemainTime;
private String turnBackStrategy;
private String turnBackStatus;
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();
@ -129,6 +136,7 @@ public class TrainStatus extends DeviceStatus {
this.destinationCode = train.getDestinationCode(); this.destinationCode = train.getDestinationCode();
} }
this.crewNumber = train.getCrewNumber(); this.crewNumber = train.getCrewNumber();
this.stationCode = train.getStationCode();
this.sectionCode = train.getSection(); this.sectionCode = train.getSection();
this.physicalCode = train.getPhysicalSection(); this.physicalCode = train.getPhysicalSection();
this.offsetp = train.getOffsetp(); this.offsetp = train.getOffsetp();
@ -147,6 +155,8 @@ public class TrainStatus extends DeviceStatus {
this.endStation = train.getEndStation(); this.endStation = train.getEndStation();
this.runningTime = train.getRunningTimeInSeconds(); this.runningTime = train.getRunningTimeInSeconds();
this.parkingRemainTime = train.getParkingRemainTimeInSeconds(); this.parkingRemainTime = train.getParkingRemainTimeInSeconds();
this.turnBackStrategy = train.getTurnBackStrategy();
this.turnBackStatus = train.getTurnBackStatus();
} }
/** /**
@ -187,6 +197,11 @@ public class TrainStatus extends DeviceStatus {
status.setCrewNumber(this.crewNumber); status.setCrewNumber(this.crewNumber);
change = true; change = true;
} }
if (!Objects.equals(this.stationCode, train.getStationCode())) {
this.stationCode = train.getStationCode();
status.setStationCode(this.stationCode);
change = true;
}
if (!Objects.equals(this.planRoutingType, train.getPlanRoutingType())) { if (!Objects.equals(this.planRoutingType, train.getPlanRoutingType())) {
this.planRoutingType = train.getPlanRoutingType(); this.planRoutingType = train.getPlanRoutingType();
change = true; change = true;
@ -292,35 +307,46 @@ public class TrainStatus extends DeviceStatus {
status.setParkingRemainTime(this.parkingRemainTime); status.setParkingRemainTime(this.parkingRemainTime);
change = true; change = true;
} }
if (!Objects.equals(this.turnBackStrategy, train.getTurnBackStrategy())) {
this.turnBackStrategy = train.getTurnBackStrategy();
status.setTurnBackStrategy(this.turnBackStrategy);
change = true;
}
if (!Objects.equals(this.turnBackStatus, train.getTurnBackStatus())) {
this.turnBackStatus = train.getTurnBackStatus();
status.setTurnBackStatus(this.turnBackStatus);
change = true;
}
return change; return change;
} }
@Override @Override
public DeviceStatusVO convert2VO(MapElement device) { public DeviceStatusVO convert2VO(MapElement device) {
TrainStatusVO statusVO = new TrainStatusVO((TrainInfo) device); return new TrainStatusVO(this);
statusVO.setDt(dt); // TrainStatusVO statusVO = new TrainStatusVO((TrainInfo) device);
statusVO.setHold(hold); // statusVO.setDt(dt);
statusVO.setJump(jump); // statusVO.setHold(hold);
statusVO.setSpeed(speed); // statusVO.setJump(jump);
statusVO.setDoorCloseLock(doorCloseLock); // statusVO.setSpeed(speed);
statusVO.setDriveMode(driveMode); // statusVO.setDoorCloseLock(doorCloseLock);
statusVO.setRunLevel(runLevel); // statusVO.setDriveMode(driveMode);
statusVO.setRight(right); // statusVO.setRunLevel(runLevel);
statusVO.setOffsetp(offsetp); // statusVO.setRight(right);
statusVO.setPhysicalCode(physicalCode); // statusVO.setOffsetp(offsetp);
statusVO.setSectionCode(sectionCode); // statusVO.setPhysicalCode(physicalCode);
statusVO.setType(type); // statusVO.setSectionCode(sectionCode);
statusVO.setDestinationCode(destinationCode); // statusVO.setType(type);
statusVO.setPlanRoutingType(planRoutingType); // statusVO.setDestinationCode(destinationCode);
statusVO.setTripNumber(tripNumber); // statusVO.setPlanRoutingType(planRoutingType);
statusVO.setServiceNumber(serviceNumber); // statusVO.setTripNumber(tripNumber);
statusVO.setGroupNumber(groupNumber); // statusVO.setServiceNumber(serviceNumber);
statusVO.setDispose(dispose); // statusVO.setGroupNumber(groupNumber);
statusVO.setStop(stop); // statusVO.setDispose(dispose);
statusVO.setBackUp(backUp); // statusVO.setStop(stop);
statusVO.setOrderStop(orderStop); // statusVO.setBackUp(backUp);
statusVO.setCrewNumber(crewNumber); // statusVO.setOrderStop(orderStop);
return statusVO; // statusVO.setCrewNumber(crewNumber);
// return statusVO;
} }
@Override @Override

View File

@ -38,10 +38,14 @@ public class TrainInfo extends MapElement {
private String destinationCode; private String destinationCode;
/** 是否准备入库 */ /**
* 是否准备入库
*/
private boolean inbound; private boolean inbound;
/** 入库删除剩余时间,单位ms */ /**
* 入库删除剩余时间,单位ms
*/
private int deleteRemain; private int deleteRemain;
/** /**
@ -49,25 +53,39 @@ public class TrainInfo extends MapElement {
*/ */
private Routing routing; private Routing routing;
/** 计划交路类型 */ /**
* 计划交路类型
*/
private PlanRoutingType planRoutingType; private PlanRoutingType planRoutingType;
/** 司机号 */ /**
* 司机号
*/
private String driverCode; private String driverCode;
/** 乘务组号 */ /**
* 乘务组号
*/
private String crewNumber; private String crewNumber;
/** 车站 */ /**
* 车站
*/
private String stationCode; private String stationCode;
/** 所处区段 */ /**
* 所处区段
*/
private String section; private String section;
/** 所处物理区段 */ /**
* 所处物理区段
*/
private String physicalSection; private String physicalSection;
/** 物理区段偏移量百分比 */ /**
* 物理区段偏移量百分比
*/
private float offsetp; private float offsetp;
@Setter @Setter
@ -77,95 +95,171 @@ public class TrainInfo extends MapElement {
private boolean doorOpen; private boolean doorOpen;
/** 跟踪模式 */ /**
* 跟踪模式
*/
private RunLevel runLevel; private RunLevel runLevel;
/** 驾驶模式 */ /**
* 驾驶模式
*/
private DriveMode driveMode; private DriveMode driveMode;
/** 标记ATP切除状态 */ /**
* 标记ATP切除状态
*/
private boolean atpCutOffMark; private boolean atpCutOffMark;
private boolean jump; private boolean jump;
private boolean hold; private boolean hold;
/** 停站状态 */ /**
* 停站状态
*/
private boolean parking; private boolean parking;
/** 站前折返剩余时间,单位ms */ /**
* 站前折返剩余时间,单位ms
*/
private int ftbRemain; private int ftbRemain;
/** 折返 */ /**
* 折返
*/
private boolean turnBack; private boolean turnBack;
/** 优先排进路 */ /**
* 优先排进路
*/
private boolean priorityRouteSet; private boolean priorityRouteSet;
/** 与计划时间差 */ /**
* 与计划时间差
*/
private int dt; private int dt;
/** 计划站台轨 */ /**
* 计划站台轨
*/
@Setter @Setter
private String planStandTrack; private String planStandTrack;
/** 计划到点 */ /**
* 计划到点
*/
private LocalTime planArriveTime; private LocalTime planArriveTime;
/** 计划发点 */ /**
* 计划发点
*/
private LocalTime planLeaveTime; private LocalTime planLeaveTime;
/** 预计到达站台 */ /**
* 预计到达站台
*/
private String estimatedArriveStandTrack; private String estimatedArriveStandTrack;
/** 预计到达时间 */ /**
* 预计到达时间
*/
private LocalTime estimatedArriveTime; private LocalTime estimatedArriveTime;
/** 实际到达站台轨 */ /**
* 实际到达站台轨
*/
private String actualArriveStandTrack; private String actualArriveStandTrack;
/** 实际到达时间 */ /**
* 实际到达时间
*/
private LocalTime actualArriveTime; private LocalTime actualArriveTime;
/** 预计离开站台 */ /**
* 预计离开站台
*/
private String estimatedLeaveStandTrack; private String estimatedLeaveStandTrack;
/** 预计离开时间 */ /**
* 预计离开时间
*/
private LocalTime estimatedLeaveTime; private LocalTime estimatedLeaveTime;
/** 实际离开站台 */ /**
* 实际离开站台
*/
private String actualLeaveStandTrack; private String actualLeaveStandTrack;
/** 实际离开时间 */ /**
* 实际离开时间
*/
private LocalTime actualLeaveTime; private LocalTime actualLeaveTime;
/**备用车*/ /**
* 备用车
*/
private boolean backUp; private boolean backUp;
/** 头码车的区段路径 */ /**
* 头码车的区段路径
*/
@Setter @Setter
private List<Section> headPath; private List<Section> headPath;
/** 下令停车 */ /**
* 下令停车
*/
private boolean orderStop; private boolean orderStop;
/** 起点车站 */ /**
* 起点车站
*/
private String startStation; private String startStation;
/** 终点车站 */ /**
* 终点车站
*/
private String endStation; private String endStation;
/** 运行时间 */ /**
* 运行时间
*/
private int runningTime; private int runningTime;
/** 停站时间 */ /**
* 停站时间
*/
private int parkingRemainTime; private int parkingRemainTime;
/** 折返策略 */ /**
* 折返策略
*/
private String turnBackStrategy; private String turnBackStrategy;
/** 折返状态 */ /**
private String turnBackStatus; * 折返状态
*/
private String turnBackStatus = NON;
/**
* 无折返
*/
public static String NON = "NON";
/**
* 初始化
*/
public static String INIT = "INIT";
/**
* 开往折返轨
*/
public static String TO = "TO";
/**
* 到达折返轨停稳
*/
public static String STOP = "STOP";
/**
* 开出折返轨
*/
public static String EXIT = "EXIT";
public TrainInfo(String groupNumber) { public TrainInfo(String groupNumber) {
super(groupNumber, DeviceType.TRAIN); super(groupNumber, DeviceType.TRAIN);
@ -298,7 +392,16 @@ public class TrainInfo extends MapElement {
this.backUp = train.isBackUp(); this.backUp = train.isBackUp();
this.orderStop = train.isOrderStop(); this.orderStop = train.isOrderStop();
this.runningTime = train.getRunningTime(); this.runningTime = train.getRunningTime();
if (train.isParkingAt()) {
this.parkingRemainTime = train.getParkRemainTime(); this.parkingRemainTime = train.getParkRemainTime();
} else {
this.parkingRemainTime = -1000;
}
if (speed == 0 && turnBackStatus.equals(TO) && headPosition.getSection().isTurnBackTrack()) {
this.turnBackStatus = STOP;
} else if (speed != 0 && this.turnBackStatus.equals(STOP)) {
this.turnBackStatus = EXIT;
}
} }
public boolean isCbtcTrack() { public boolean isCbtcTrack() {
@ -336,6 +439,11 @@ public class TrainInfo extends MapElement {
this.parking = false; this.parking = false;
this.actualLeaveStandTrack = section.getCode(); this.actualLeaveStandTrack = section.getCode();
this.actualLeaveTime = leaveTime; this.actualLeaveTime = leaveTime;
if (!CollectionUtils.isEmpty(section.getStandList())) {
if (section.getStandList().get(0).turnBackTypeNonDefault()) {
this.turnBackStatus = TO;
}
}
} }
public void updatePlanInfo(StationPlan nextStationPlan) { public void updatePlanInfo(StationPlan nextStationPlan) {
@ -343,6 +451,7 @@ public class TrainInfo extends MapElement {
this.planStandTrack = nextStationPlan.getSection().getCode(); this.planStandTrack = nextStationPlan.getSection().getCode();
this.planArriveTime = nextStationPlan.getArriveTime(); this.planArriveTime = nextStationPlan.getArriveTime();
this.planLeaveTime = nextStationPlan.getLeaveTime(); this.planLeaveTime = nextStationPlan.getLeaveTime();
this.turnBackStrategy = nextStationPlan.getSection().getStandList().get(0).getTypeStrategy().name();
} else { } else {
this.planStandTrack = null; this.planStandTrack = null;
this.planArriveTime = null; this.planArriveTime = null;
@ -363,6 +472,13 @@ public class TrainInfo extends MapElement {
log.warn(String.format("列车[%s-%s|%s|%s]到达车站,没有计划到达,无法更新到达与计划误差时间", log.warn(String.format("列车[%s-%s|%s|%s]到达车站,没有计划到达,无法更新到达与计划误差时间",
groupNumber, serviceNumber, tripNumber, destinationCode)); groupNumber, serviceNumber, tripNumber, destinationCode));
} }
if (EXIT.equals(this.turnBackStatus)) {
this.turnBackStatus = NON;
} else if (!CollectionUtils.isEmpty(section.getStandList())) {
if (section.getStandList().get(0).turnBackTypeNonDefault()) {
this.turnBackStatus = INIT;
}
}
} }
public void updateEstimatedArriveInfo(Section section, LocalTime arriveTime) { public void updateEstimatedArriveInfo(Section section, LocalTime arriveTime) {

View File

@ -5,6 +5,7 @@ import club.joylink.rtss.simulation.cbtc.constant.PlanRoutingType;
import club.joylink.rtss.simulation.cbtc.constant.RunLevel; import club.joylink.rtss.simulation.cbtc.constant.RunLevel;
import club.joylink.rtss.simulation.cbtc.constant.TrainType; import club.joylink.rtss.simulation.cbtc.constant.TrainType;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement; import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.status.TrainStatus;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer; import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@ -35,6 +36,8 @@ public class TrainStatusVO extends DeviceStatusVO {
/** 乘务组号 */ /** 乘务组号 */
private String crewNumber; private String crewNumber;
private String stationCode;
/** 计划交路类型 */ /** 计划交路类型 */
@JsonInclude(JsonInclude.Include.ALWAYS) @JsonInclude(JsonInclude.Include.ALWAYS)
private PlanRoutingType planRoutingType; private PlanRoutingType planRoutingType;
@ -116,10 +119,47 @@ public class TrainStatusVO extends DeviceStatusVO {
private Integer parkingRemainTime; private Integer parkingRemainTime;
private String turnBackStrategy;
private String turnBackStatus;
public TrainStatusVO(TrainInfo train) { public TrainStatusVO(TrainInfo train) {
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN); super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
} }
public TrainStatusVO(TrainStatus train) {
super(train.getGroupNumber(), MapElement.DeviceType.TRAIN);
this.serviceNumber = train.getServiceNumber();
this.tripNumber = train.getTripNumber();
this.destinationCode = train.getDestinationCode();
this.crewNumber = train.getCrewNumber();
this.planRoutingType = train.getPlanRoutingType();
this.sectionCode = train.getSectionCode();
this.physicalCode = train.getPhysicalCode();
this.offsetp = train.getOffsetp();
this.speed = train.getSpeed();
this.right = train.getRight();
this.doorCloseLock = train.isDoorCloseLock();
this.stop = train.isStop();
this.type = train.getType();
this.runLevel = train.getRunLevel();
this.driveMode = train.getDriveMode();
this.jump = train.isJump();
this.hold = train.isHold();
this.dt = train.getDt();
this.dispose = train.isDispose();
this.backUp = train.isBackUp();
this.orderStop = train.isOrderStop();
this.startStation = train.getStartStation();
this.endStation = train.getEndStation();
this.runningTime = train.getRunningTime();
this.parkingRemainTime = train.getParkingRemainTime();
this.turnBackStrategy = train.getTurnBackStrategy();
this.turnBackStatus = train.getTurnBackStatus();
}
public TrainStatusVO(String groupNumber) { public TrainStatusVO(String groupNumber) {
super(groupNumber, MapElement.DeviceType.TRAIN); super(groupNumber, MapElement.DeviceType.TRAIN);
} }

View File

@ -1,5 +1,6 @@
package club.joylink.rtss.vo.map; package club.joylink.rtss.vo.map;
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@ -46,7 +47,7 @@ public class MapStationStandNewVO {
/** /**
* 默认折返策略02-无人折返03-自动换端 * 默认折返策略02-无人折返03-自动换端
*/ */
private String defaultReentryStrategy; private Stand.TurnBackType defaultReentryStrategy;
/** /**