移除列车调整

This commit is contained in:
dong 2023-10-18 15:04:08 +08:00
parent f126cef711
commit c5f033a598
2 changed files with 10 additions and 2 deletions

View File

@ -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));
}
});

View File

@ -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;