From 12b41f932d90b423e12bac4be672d5df0e71a450 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 20 Jul 2023 15:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E8=A1=8C=E6=96=B9=E5=90=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/sectionLink/SectionLink.ts | 3 ++- src/graphics/train/Train.ts | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/graphics/sectionLink/SectionLink.ts b/src/graphics/sectionLink/SectionLink.ts index e9beb62..18b1bae 100644 --- a/src/graphics/sectionLink/SectionLink.ts +++ b/src/graphics/sectionLink/SectionLink.ts @@ -52,7 +52,7 @@ export class SectionLink extends JlGraphic implements ILineGraphic { lineGraphic: Graphics; labelGraphic: VectorText; divisionGraphic: Graphics = new Graphics(); - _linkLength = 0; + _linkLength = 0; // link长度 constructor() { super(SectionLink.Type); @@ -152,6 +152,7 @@ export class SectionLink extends JlGraphic implements ILineGraphic { this.updateData(old); } get linkLength(): number { + // 根据aSimRef和bSimRef获取link两侧公里标,计算link长度 if (!this._linkLength) { const queryStore = this.getGraphicApp().queryStore; const aSimDevice = queryStore.queryById(this.datas.aSimRef.id); diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index 6596c72..0aeb161 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -9,9 +9,7 @@ import { calculateMirrorPoint, distance, } from 'src/jl-graphic'; -import { AxleCounting } from '../axleCounting/AxleCounting'; import { SectionLink } from '../sectionLink/SectionLink'; -import { Turnout } from '../turnout/Turnout'; export interface ITrainData extends GraphicData { get code(): string; // 车号 @@ -106,9 +104,9 @@ export class TrainHead extends Container { this.pause.clear(); } doRepaint(states: ITrainState, bodyWH?: bodyWH) { - let direction = 'right'; + let direction = 'left'; if (states.up) { - direction = 'left'; + direction = 'right'; } this.clear(); if (!direction) {