修改机器人驾驶逻辑:停车后不会自动开ATO,修改预选模式后即可自动开启ATO
This commit is contained in:
parent
b8768e6052
commit
b0d30ed58c
|
@ -17,6 +17,8 @@ public class StorageDriveParamVO {
|
|||
*/
|
||||
private Float speedLimit;
|
||||
|
||||
private boolean stop;
|
||||
|
||||
/**
|
||||
* 向前行驶(持续看信号行驶)
|
||||
*/
|
||||
|
@ -43,8 +45,11 @@ public class StorageDriveParamVO {
|
|||
|
||||
private boolean releaseEB;
|
||||
|
||||
private boolean openATO = true;
|
||||
|
||||
public StorageDriveParamVO(DriveParamVO param) {
|
||||
this.speedLimit = param.getSpeedLimit();
|
||||
this.stop = param.isStop();
|
||||
this.run = param.isRun();
|
||||
this.targetDeviceCode = param.getTargetDeviceCode();
|
||||
if (param.getTargetPosition() != null) {
|
||||
|
@ -59,6 +64,7 @@ public class StorageDriveParamVO {
|
|||
public DriveParamVO convert2SimulationObj(SimulationDataRepository repository) {
|
||||
DriveParamVO param = new DriveParamVO();
|
||||
param.setSpeedLimit(speedLimit);
|
||||
param.setStop(stop);
|
||||
param.setRun(run);
|
||||
param.setTargetDeviceCode(targetDeviceCode);
|
||||
if (targetPosition != null) {
|
||||
|
@ -70,6 +76,7 @@ public class StorageDriveParamVO {
|
|||
}
|
||||
param.setThroughSignalAspect(throughSignalAspect);
|
||||
param.setReleaseEB(releaseEB);
|
||||
param.setOpenATO(openATO);
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1396,6 +1396,7 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
|||
public void updateDriveParam(DriveParamVO paramVO) {
|
||||
paramVO.setDefaultStop(this.robotDriveParam.isDefaultStop());
|
||||
paramVO.setReleaseEB(true);
|
||||
paramVO.setOpenATO(this.robotDriveParam.isOpenATO());
|
||||
this.robotDriveParam = paramVO;
|
||||
}
|
||||
|
||||
|
|
|
@ -447,6 +447,7 @@ public class ATPService {
|
|||
break;
|
||||
case Confirm_Preselection:
|
||||
train.setPreselectionMode(train.getTempPreselectionMode());
|
||||
train.getRobotDriveParam().setOpenATO(true);
|
||||
break;
|
||||
case Confirm_Control_Level_Down:
|
||||
case Switch_To_RM:
|
||||
|
@ -589,6 +590,8 @@ public class ATPService {
|
|||
public void changePreselectionMode(Simulation simulation, String groupNumber,
|
||||
VirtualRealityTrain.PreselectionMode preselectionMode) {
|
||||
VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber);
|
||||
//如果是AM模式,则需要自动开ATO,如果不是AM模式,设置了自动开ATO也开不了,所以可以简化逻辑如下
|
||||
train.getRobotDriveParam().setOpenATO(true);
|
||||
if (preselectionMode == train.getPreselectionMode()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -180,8 +180,7 @@ public class SimulationRobotService {
|
|||
if (!train.getDriveMode().isManual() && train.getRobotDriveParam().isDefaultStop()) {
|
||||
train.getRobotDriveParam().setRun(false);
|
||||
}
|
||||
//没有下令停车的情况下,校验后开启ATO
|
||||
if (!train.isRobotNeedStop()) {
|
||||
if (train.getRobotDriveParam().isOpenATO()) {
|
||||
robotOpenATOAfterCheck(train);
|
||||
}
|
||||
//准备发车
|
||||
|
@ -622,6 +621,7 @@ public class SimulationRobotService {
|
|||
param);
|
||||
} else {
|
||||
train.getRobotDriveParam().setStop(true);
|
||||
train.getRobotDriveParam().setOpenATO(false);
|
||||
}
|
||||
train.getRobotDriveParam().setRun(false);
|
||||
}
|
||||
|
|
|
@ -86,6 +86,12 @@ public class DriveParamVO {
|
|||
@JsonIgnore
|
||||
private boolean releaseEB;
|
||||
|
||||
/**
|
||||
* 机器人驾驶时,是否在能开启ATO时就开启ATO
|
||||
*/
|
||||
@JsonIgnore
|
||||
private boolean openATO = true;
|
||||
|
||||
public void setSpeedLimit(Float speedLimit) {
|
||||
this.speedLimit = speedLimit;
|
||||
this.speedLimitInMs = speedLimit == null ? Float.MAX_VALUE : speedLimit / 3.6f;
|
||||
|
@ -152,6 +158,7 @@ public class DriveParamVO {
|
|||
paramVO.setThroughSignal(this.throughSignal);
|
||||
paramVO.setThroughSignalAspect(this.throughSignalAspect);
|
||||
paramVO.setReleaseEB(this.releaseEB);
|
||||
paramVO.setOpenATO(this.openATO);
|
||||
return paramVO;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue