Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/rtss-server into test1
This commit is contained in:
commit
a89d0735f7
@ -428,7 +428,7 @@ public class AtsTrainLoadService {
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
RoutePath routePath = this.selectDefaultRoutePath(repository, startStationPlan.getSection(), endStationPlan.getSection());
|
RoutePath routePath = this.selectDefaultRoutePath(repository, startStationPlan.getSection(), endStationPlan.getSection());
|
||||||
if (routePath.containsSection(headPosition.getSection())) {
|
if (routePath.containsPosition(headPosition)) {
|
||||||
// 站间运行
|
// 站间运行
|
||||||
train.setSpeed(0.1f);
|
train.setSpeed(0.1f);
|
||||||
trainInfo.updatePlanInfo(endStationPlan);
|
trainInfo.updatePlanInfo(endStationPlan);
|
||||||
|
@ -308,6 +308,35 @@ public class RoutePath {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean containsPosition(SectionPosition position) {
|
||||||
|
if (this.sectionList.contains(position.getSection())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (Objects.equals(position.getSection(), this.start)) {
|
||||||
|
if (this.isRight()) {
|
||||||
|
if (this.start.getStopPointRight() < position.getOffset()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (position.getOffset() < this.start.getStopPointLeft()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Objects.equals(position.getSection(), this.end)) {
|
||||||
|
if (this.isRight()) {
|
||||||
|
if (this.end.getStopPointRight() >= position.getOffset()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (position.getOffset() >= this.end.getStopPointLeft()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isStartSection(Section section) {
|
public boolean isStartSection(Section section) {
|
||||||
return Objects.equals(this.start, section);
|
return Objects.equals(this.start, section);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user