修改连挂时的列车逻辑;

This commit is contained in:
joylink_zhangsai 2021-06-30 13:52:06 +08:00
parent d7c5e7cd32
commit f04cb9ae19
3 changed files with 11 additions and 0 deletions

View File

@ -624,6 +624,9 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
* 强制改变牵引制动力 * 强制改变牵引制动力
*/ */
public void enforceUpdateTBForce(float fk, float fb) { public void enforceUpdateTBForce(float fk, float fb) {
if (linkTrain != null && linkTrain.isEB()) {
return;
}
this.fk = fk; this.fk = fk;
this.fb = fb; this.fb = fb;
if (fk > 0) { if (fk > 0) {

View File

@ -112,11 +112,14 @@ public class VRTrainRunningService {
if (right == aTrain.isRight()) { //车头同向 if (right == aTrain.isRight()) { //车头同向
if (!aTrainTailPosition.isAheadOf(checkPosition, right) && !checkPosition.isAheadOf(aTrainHeadPosition, right)) { if (!aTrainTailPosition.isAheadOf(checkPosition, right) && !checkPosition.isAheadOf(aTrainHeadPosition, right)) {
change = false; change = false;
train.setSpeed(0);
break; break;
} }
} else { } else {
if (!aTrainHeadPosition.isAheadOf(checkPosition, right) && !aTrainTailPosition.isAheadOf(checkPosition, right)) { if (!aTrainHeadPosition.isAheadOf(checkPosition, right) && !aTrainTailPosition.isAheadOf(checkPosition, right)) {
change = false; change = false;
train.setSpeed(0);
break;
} }
} }
} }

View File

@ -108,6 +108,11 @@ public class ATPService {
} }
case AM: case AM:
case CM:{ case CM:{
// 驾驶故障导致EB
if (VirtualRealityTrain.Fault.DRIVE_FAULT.equals(train.getFault()) && !train.isEB()) {
log.warn(train.debugStr() + "因驾驶故障EB");
this.triggerSignalEB(train);
}
MovementAuthority ma = train.getMa(); MovementAuthority ma = train.getMa();
if (Objects.nonNull(ma)) { // 通信正常,移动授权可用 if (Objects.nonNull(ma)) { // 通信正常,移动授权可用
// 获取移动授权剩余距离 // 获取移动授权剩余距离