应急调度指挥项目列车计算位置调整

This commit is contained in:
fan 2023-02-14 17:31:53 +08:00
parent c44983c4a5
commit f6040af47b

View File

@ -137,15 +137,15 @@ export default class Train extends Group {
if (style.Section.trainPosition.display) { if (style.Section.trainPosition.display) {
const data = this.model.physicalCode; const data = this.model.physicalCode;
const oldmodel = store.getters['map/getDeviceByCode'](data); const oldmodel = store.getters['map/getDeviceByCode'](data);
const leftPoint = oldmodel.points[0]; const leftPoint = oldmodel.instance.computedPoints[0];
const rightPoint = oldmodel.points[oldmodel.points.length - 1]; const rightPoint = oldmodel.instance.computedPoints[oldmodel.instance.computedPoints.length - 1];
this.startX = this.model.right == 1 ? leftPoint.x : rightPoint.x; this.startX = this.model.right == 1 ? leftPoint.x : rightPoint.x;
this.startY = this.model.right == 1 ? leftPoint.y : rightPoint.y; this.startY = this.model.right == 1 ? leftPoint.y : rightPoint.y;
// 算出折线的长度 // 算出折线的长度
this.lineLength = 0; this.lineLength = 0;
let oldPoint = null; let oldPoint = null;
this.pointList = []; this.pointList = [];
oldmodel.points.forEach((point) => { oldmodel.instance.computedPoints.forEach((point) => {
if (oldPoint) { if (oldPoint) {
const temp = Math.sqrt( const temp = Math.sqrt(
Math.pow(point.x - oldPoint.x, 2) + Math.pow(point.x - oldPoint.x, 2) +