MA计算逻辑修改,取移动授权距离最近的作为结束

修改列车EB更新制动力问题
This commit is contained in:
walker-sheng 2021-08-12 11:30:06 +08:00
parent 2a6b0bebe1
commit 8d217cfae1
2 changed files with 13 additions and 3 deletions

View File

@ -381,8 +381,9 @@ public class MaService {
boolean right = train.isRight();
Ma ma = null;
boolean front = false;
int iterMax = 50;
Section section = tailPosition.getSection();
for (int i = 0; i < 50 && section != null; i++) {
for (int i = 0, j = 0; i < iterMax && j < 3 && section != null; i++) {
if (section.equals(headPosition.getSection())) {
front = true;
}
@ -433,7 +434,14 @@ public class MaService {
}
section = next;
if (ma != null) {
break;
if (ma.distanceToEoa <= 0) {
break;
}
if (j == 0) {
j = 1;
} else {
j++;
}
}
}
return ma;

View File

@ -687,6 +687,7 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
return;
}
this.fk = Math.min(fk, getCurrentFkMax());
this.fb = Math.min(fb, getCurrentFbMax());
if (fk > 0) {
this.tbControl = TrainTBControl.TRACTION;
@ -1053,7 +1054,8 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
* 设置紧急制动的功率和制动力
*/
public void emergencyBreak() {
enforceUpdateTBForce(0, 350);
this.fk = 0;
this.fb = 350;
}
public boolean isInTheStandArea() {