储存TrainInfo的头码车运行路径(hctPath)信息

This commit is contained in:
joylink_zhangsai 2023-11-15 17:58:38 +08:00
parent 25c31fcefb
commit 352ef75923
4 changed files with 1674 additions and 1540 deletions

View File

@ -0,0 +1,25 @@
package club.joylink.rtss.simulation.cbtc.data.storage.support;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.SectionRunPath;
import java.util.List;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class StorageSectionRunPath {
private List<String> sectionCodes;
private boolean right;
public StorageSectionRunPath(SectionRunPath path) {
this.sectionCodes = path.getSections().stream().map(MapElement::getCode)
.collect(Collectors.toList());
this.right = path.isRight();
}
}

View File

@ -4,156 +4,201 @@ import club.joylink.rtss.simulation.cbtc.constant.DriveMode;
import club.joylink.rtss.simulation.cbtc.constant.RunLevel;
import club.joylink.rtss.simulation.cbtc.constant.TrainType;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.storage.support.StorageSectionRunPath;
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
import java.time.LocalTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.util.CollectionUtils;
import java.time.LocalTime;
import java.util.List;
import java.util.stream.Collectors;
@Getter
@Setter
@NoArgsConstructor
public class StorageTrainInfo {
private String code;
private String groupNumber;
private String code;
private TrainType type;
private String groupNumber;
private String serviceNumber;
private TrainType type;
private String tripNumber;
private String serviceNumber;
private String destinationCode;
private String tripNumber;
/** 是否准备入库 */
private boolean inbound;
private String destinationCode;
/** 入库删除剩余时间,单位ms */
private int deleteRemain;
/**
* 是否准备入库
*/
private boolean inbound;
/** 司机号 */
private String driverCode;
/**
* 入库删除剩余时间,单位ms
*/
private int deleteRemain;
/** 车站 */
private String stationCode;
/**
* 司机号
*/
private String driverCode;
/** 所处区段 */
private String section;
/**
* 车站
*/
private String stationCode;
/** 所处物理区段 */
private String physicalSection;
/**
* 所处区段
*/
private String section;
/** 物理区段偏移量百分比 */
private float offsetp;
/**
* 所处物理区段
*/
private String physicalSection;
private Boolean right;
/**
* 物理区段偏移量百分比
*/
private float offsetp;
private float speed;
private Boolean right;
private boolean doorOpen;
private float speed;
/** 跟踪模式 */
private RunLevel runLevel;
private boolean doorOpen;
/** 驾驶模式 */
private DriveMode driveMode;
/**
* 跟踪模式
*/
private RunLevel runLevel;
/** 标记ATP切除状态 */
private boolean atpCutOffMark;
/**
* 驾驶模式
*/
private DriveMode driveMode;
private boolean jump;
/**
* 标记ATP切除状态
*/
private boolean atpCutOffMark;
private boolean hold;
private boolean jump;
/** 停站状态 */
private boolean parking;
private boolean hold;
/** 计划站台轨 */
private String planStandTrack;
/**
* 停站状态
*/
private boolean parking;
/** 计划到点 */
private LocalTime planArriveTime;
/**
* 计划站台轨
*/
private String planStandTrack;
/** 计划发点 */
private LocalTime planLeaveTime;
/**
* 计划到点
*/
private LocalTime planArriveTime;
/** 预计到达站台 */
private String estimatedArriveStandTrack;
/**
* 计划发点
*/
private LocalTime planLeaveTime;
/** 预计到达时间 */
private LocalTime estimatedArriveTime;
/**
* 预计到达站台
*/
private String estimatedArriveStandTrack;
/** 实际到达站台 */
private String actualArriveStandTrack;
/**
* 预计到达时间
*/
private LocalTime estimatedArriveTime;
/** 实际到达时间 */
private LocalTime actualArriveTime;
/**
* 实际到达站台
*/
private String actualArriveStandTrack;
/** 预计离开站台 */
private String estimatedLeaveStandTrack;
/**
* 实际到达时间
*/
private LocalTime actualArriveTime;
/** 预计离开时间 */
private LocalTime estimatedLeaveTime;
/**
* 预计离开站台
*/
private String estimatedLeaveStandTrack;
/** 实际离开站台 */
private String actualLeaveStandTrack;
/**
* 预计离开时间
*/
private LocalTime estimatedLeaveTime;
/** 实际离开时间 */
private LocalTime actualLeaveTime;
/**
* 实际离开站台
*/
private String actualLeaveStandTrack;
/**备用车*/
private boolean backUp;
/**
* 实际离开时间
*/
private LocalTime actualLeaveTime;
/** 头码车的路径 */
private List<String> headPath;
/**
* 备用车
*/
private boolean backUp;
public StorageTrainInfo(TrainInfo info) {
this.code = info.getCode();
this.groupNumber = info.getGroupNumber();
this.type = info.getType();
this.serviceNumber = info.getServiceNumber();
this.tripNumber = info.getTripNumber();
this.destinationCode = info.getDestinationCode();
this.inbound = info.isInbound();
this.deleteRemain = info.getDeleteRemain();
this.driverCode = info.getDriverCode();
this.stationCode = info.getStationCode();
this.section = info.getSection();
this.physicalSection = info.getPhysicalSection();
this.offsetp = info.getOffsetp();
this.right = info.getRight();
this.speed = info.getSpeed();
this.doorOpen = info.isDoorOpen();
this.runLevel = info.getRunLevel();
this.driveMode = info.getDriveMode();
this.atpCutOffMark = info.isAtpCutOffMark();
this.jump = info.isJump();
this.hold = info.isHold();
this.parking = info.isParking();
this.planStandTrack = info.getPlanStandTrack();
this.planArriveTime = info.getPlanArriveTime();
this.planLeaveTime = info.getPlanLeaveTime();
this.estimatedArriveStandTrack = info.getEstimatedArriveStandTrack();
this.estimatedArriveTime = info.getEstimatedArriveTime();
this.actualArriveStandTrack = info.getActualArriveStandTrack();
this.actualArriveTime = info.getActualArriveTime();
this.estimatedLeaveStandTrack = info.getEstimatedLeaveStandTrack();
this.estimatedLeaveTime = info.getEstimatedLeaveTime();
this.actualLeaveStandTrack = info.getActualLeaveStandTrack();
this.actualLeaveTime = info.getActualLeaveTime();
this.backUp = info.isBackUp();
// if (!CollectionUtils.isEmpty(info.getHeadPath())) {
// this.headPath = info.getHeadPath().stream().map(MapElement::getCode).collect(Collectors.toList());
// }
/**
* 头码车的路径
*/
private StorageSectionRunPath hctPath;
public StorageTrainInfo(TrainInfo info) {
this.code = info.getCode();
this.groupNumber = info.getGroupNumber();
this.type = info.getType();
this.serviceNumber = info.getServiceNumber();
this.tripNumber = info.getTripNumber();
this.destinationCode = info.getDestinationCode();
this.inbound = info.isInbound();
this.deleteRemain = info.getDeleteRemain();
this.driverCode = info.getDriverCode();
this.stationCode = info.getStationCode();
this.section = info.getSection();
this.physicalSection = info.getPhysicalSection();
this.offsetp = info.getOffsetp();
this.right = info.getRight();
this.speed = info.getSpeed();
this.doorOpen = info.isDoorOpen();
this.runLevel = info.getRunLevel();
this.driveMode = info.getDriveMode();
this.atpCutOffMark = info.isAtpCutOffMark();
this.jump = info.isJump();
this.hold = info.isHold();
this.parking = info.isParking();
this.planStandTrack = info.getPlanStandTrack();
this.planArriveTime = info.getPlanArriveTime();
this.planLeaveTime = info.getPlanLeaveTime();
this.estimatedArriveStandTrack = info.getEstimatedArriveStandTrack();
this.estimatedArriveTime = info.getEstimatedArriveTime();
this.actualArriveStandTrack = info.getActualArriveStandTrack();
this.actualArriveTime = info.getActualArriveTime();
this.estimatedLeaveStandTrack = info.getEstimatedLeaveStandTrack();
this.estimatedLeaveTime = info.getEstimatedLeaveTime();
this.actualLeaveStandTrack = info.getActualLeaveStandTrack();
this.actualLeaveTime = info.getActualLeaveTime();
this.backUp = info.isBackUp();
if (info.getHctPath() != null) {
this.hctPath = new StorageSectionRunPath(info.getHctPath());
}
}
public TrainInfo convert2SimulationObj(SimulationDataRepository repository) {
return new TrainInfo(this, repository);
}
public TrainInfo convert2SimulationObj(SimulationDataRepository repository) {
return new TrainInfo(this, repository);
}
}