根据配置决定列车转人工模式后是否默认为停车

This commit is contained in:
joylink_zhangsai 2023-10-30 14:26:38 +08:00
parent 9b4480f376
commit 9b5c54f749
4 changed files with 32 additions and 13 deletions

View File

@ -506,10 +506,10 @@ public class AtsTrainService {
float len = linkTrain.getLen() + (distance == null ? 0 : distance);
targetPosition = new SectionPosition(targetSection, offset + (len * (right ? -1 : 1)));
}
linkTrain.setRobotDriveParam(linkParamVO);
linkTrain.updateDriveParam(linkParamVO);
}
param.setTargetPosition(targetPosition);
train.setRobotDriveParam(param);
train.updateDriveParam(param);
}

View File

@ -254,10 +254,13 @@ public class MapDeviceBuilder {
private static void buildTrain(RealLineConfigVO realLineConfig, MapGraphDataNewVO graphData, Map<String, MapElement> elementMap, Map<String, VirtualRealityDevice> deviceMap, List<String> errMsgList) {
boolean railway;
boolean manualTrainDefaultStop;
if (realLineConfig != null) {
railway = realLineConfig.isRailway();
manualTrainDefaultStop = realLineConfig.isManualTrainDefaultStop();
} else {
railway = true;
manualTrainDefaultStop = false;
}
List<MapTrainVO> trainList = graphData.getTrainList();
if (CollectionUtils.isEmpty(trainList)) {
@ -266,7 +269,8 @@ public class MapDeviceBuilder {
Map<String, MapTrainModelVO> trainModelMap = graphData.getTrainModelList().stream()
.collect(Collectors.toMap(MapTrainModelVO::getCode, Function.identity()));
trainList.forEach(trainVO -> {
VirtualRealityTrain virtualRealityTrain = new VirtualRealityTrain(trainVO.getGroupNumber(), trainVO.getGroupNumber(), railway);
VirtualRealityTrain virtualRealityTrain = new VirtualRealityTrain(trainVO.getGroupNumber(),
trainVO.getGroupNumber(), railway, manualTrainDefaultStop);
if (Objects.nonNull(deviceMap.get(virtualRealityTrain.getGroupNumber()))) {
errMsgList.add(String.format("车组号为[%s]的列车不唯一",
virtualRealityTrain.getName(), virtualRealityTrain.getGroupNumber()));

View File

@ -461,9 +461,11 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
/**
* 为解决地铁和大铁列车最高速度不同的问题
* @param railway 是大铁线路如果是将最高速度改为320km/h
*
* @param railway 是大铁线路如果是将最高速度改为320km/h
* @param manualTrainDefaultStop
*/
public VirtualRealityTrain(String code, String groupNumber, boolean railway) {
public VirtualRealityTrain(String code, String groupNumber, boolean railway, boolean manualTrainDefaultStop) {
super(code, groupNumber, DeviceType.TRAIN);
this.groupNumber = groupNumber;
this.gear = Handwheel.ATO;
@ -479,6 +481,7 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
if (railway) {
this.speedMax = (80 * 4) / 3.6f;
}
robotDriveParam.setDefaultStop(manualTrainDefaultStop);
}
public SectionPosition getTailPosition() {
@ -597,7 +600,14 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
this.doorSelection = DoorSelection.Z;
this.confirmationMessages.clear();
this.atoCanOpen = false;
boolean defaultStop = this.robotDriveParam.isDefaultStop();
this.robotDriveParam = new DriveParamVO();
if (defaultStop) {
this.robotDriveParam.setDefaultStop(true);
this.robotDriveParam.setStop(true);
this.robotDriveParam.setRun(false);
}
}
public boolean isEB() {
@ -1305,14 +1315,6 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
public boolean isCommunicable() {
Section section = headPosition.getSection();
return communication && section.anyZcWorking();
// Station deviceStation = section.getDeviceStation();
// if (VirtualRealityTrain.Fault.COMMUNICATION_ABNORMAL == fault
// || Station.Fault.INTERLOCK_MACHINE_FAULT == deviceStation.getFault()
// || !section.anyZcWorking()) {
// return false;
// }
// return true;
}
public boolean isCMMode() {
@ -1323,6 +1325,11 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
return DriveMode.AM.equals(this.driveMode);
}
public void updateDriveParam(DriveParamVO paramVO) {
paramVO.setDefaultStop(this.robotDriveParam.isDefaultStop());
this.robotDriveParam = paramVO;
}
public enum Fault {
/**
* 通信异常

View File

@ -17,6 +17,13 @@ import lombok.Setter;
@NoArgsConstructor
public class DriveParamVO {
//----------------- 初始化信息 -----------------
/**
* 转为人工驾驶时默认停车
*/
private boolean defaultStop;
//----------------- 运行信息 -----------------
/**
* 限速值km/h
*/
@ -136,6 +143,7 @@ public class DriveParamVO {
public DriveParamVO cloneParamVO() {
DriveParamVO paramVO = new DriveParamVO();
paramVO.setDefaultStop(defaultStop);
paramVO.setSpeedLimit(speedLimit);
paramVO.setStop(this.stop);
paramVO.setRun(this.run);