【修改修改预选模式、机器人驾驶代码】

This commit is contained in:
weizhihong 2023-03-31 15:10:19 +08:00
parent df93f3d0ce
commit 04d46be14c
2 changed files with 7 additions and 5 deletions

View File

@ -573,10 +573,11 @@ public class ATPService {
if (!train.isAtpOn()) {
this.openAtp(train);
}
if (train.isSignalEB()) {
if (!train.isInTheGear(VirtualRealityTrain.Handwheel.MANUAL)) {
if ((train.isSignalEB() || preselectionMode.isMatchTheDriveMode(DriveMode.RM) )
&& !train.isInTheGear(VirtualRealityTrain.Handwheel.MANUAL)) { //确保当前在手动档位
changeGear(train, VirtualRealityTrain.Handwheel.MANUAL);
}
if (train.isSignalEB()) {
if (!train.isStop() || !train.isLeverNotInTractionGear()) {
changeTrainForce(train, -2F); // 改变列车的牵引/
}

View File

@ -314,8 +314,9 @@ public class SimulationRobotService {
*/
private void robotDrive(Simulation simulation, SimulationMember driver, VirtualRealityTrain train, SectionPosition targetPosition) {
if (!train.isInTheGear(VirtualRealityTrain.Handwheel.MANUAL)) { //确保当前在手动档位
CommandBO.Step step = CommandBO.buildGearChangeStep(train.getGroupNumber(), VirtualRealityTrain.Handwheel.MANUAL);
atsOperationDispatcher.execute(simulation, driver, step.getOperationType().name(), step.getOperationParams());
return;
// CommandBO.Step step = CommandBO.buildGearChangeStep(train.getGroupNumber(), VirtualRealityTrain.Handwheel.MANUAL);
// atsOperationDispatcher.execute(simulation, driver, step.getOperationType().name(), step.getOperationParams());
}
if (train.isEB()) {
if (train.getRobotDriveParam().isReleaseEB()) {