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;