修改机器人驾驶逻辑:停车后不会自动开ATO,修改预选模式后即可自动开启ATO

This commit is contained in:
joylink_zhangsai 2023-12-04 12:17:43 +08:00
parent b8768e6052
commit b0d30ed58c
5 changed files with 20 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;
}
}