应急调度指挥项目列车计算位置调整
This commit is contained in:
parent
c44983c4a5
commit
f6040af47b
@ -137,15 +137,15 @@ export default class Train extends Group {
|
||||
if (style.Section.trainPosition.display) {
|
||||
const data = this.model.physicalCode;
|
||||
const oldmodel = store.getters['map/getDeviceByCode'](data);
|
||||
const leftPoint = oldmodel.points[0];
|
||||
const rightPoint = oldmodel.points[oldmodel.points.length - 1];
|
||||
const leftPoint = oldmodel.instance.computedPoints[0];
|
||||
const rightPoint = oldmodel.instance.computedPoints[oldmodel.instance.computedPoints.length - 1];
|
||||
this.startX = this.model.right == 1 ? leftPoint.x : rightPoint.x;
|
||||
this.startY = this.model.right == 1 ? leftPoint.y : rightPoint.y;
|
||||
// 算出折线的长度
|
||||
this.lineLength = 0;
|
||||
let oldPoint = null;
|
||||
this.pointList = [];
|
||||
oldmodel.points.forEach((point) => {
|
||||
oldmodel.instance.computedPoints.forEach((point) => {
|
||||
if (oldPoint) {
|
||||
const temp = Math.sqrt(
|
||||
Math.pow(point.x - oldPoint.x, 2) +
|
||||
|
Loading…
Reference in New Issue
Block a user