From c5f033a598ca22f257f9fc7780ec8c55ac3a52a7 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 18 Oct 2023 15:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=88=97=E8=BD=A6=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/lineApp.ts | 3 ++- src/graphics/train/Train.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/drawApp/lineApp.ts b/src/drawApp/lineApp.ts index 260711b..ad91ea4 100644 --- a/src/drawApp/lineApp.ts +++ b/src/drawApp/lineApp.ts @@ -225,7 +225,8 @@ export function initLineApp(lineId: number): IGraphicApp { const trainStorage = state.WsLineTrainMessage.deserialize(message); // console.log(trainStorage, '222'); trainStorage.trainInfo.forEach((item) => { - if (item.rtuId !== 81 && item.rtuId !== 82 && item.rtuId) { + // if (item.rtuId !== 81 && item.rtuId !== 82 && item.rtuId) { + if (item.rtuId) { states.push(new TrainState(item)); } }); diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index 515e855..c4caea4 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -421,10 +421,17 @@ export class Train extends JlGraphic { this.states.devName, deviceTypeString.get(this.states.devType) ); - if (!dev) { + const rtuIdArr = [81, 82]; + const hasRtuId = rtuIdArr.includes(this.states.rtuId); + if (!dev || hasRtuId) { // 移除列车 const app = this.getGraphicApp(); app.deleteGraphics(this); + console.warn( + '移除列车:', + !dev ? `没有找到${this.states.devName}区段!` : '', + hasRtuId ? `错误集中站${this.states.rtuId}` : '' + ); return; } let window = null;