This commit is contained in:
joylink_zhaoerwei 2023-06-19 15:29:44 +08:00
parent 932409e700
commit 63052c4617

View File

@ -101,8 +101,11 @@ export class TrainWindowDraw extends GraphicDrawAssistant<
this.storeGraphic(...trainWindows);
}
oneGenerates() {
const trainWindows: TrainWindow[] = [];
const sections = this.app.queryStore.queryByType<Section>(Section.Type);
const trainWindowAll = this.app.queryStore.queryByType<TrainWindow>(
TrainWindow.Type
);
this.app.deleteGraphics(...trainWindowAll);
sections.forEach((section) => {
const points = section.datas.points;
for (let i = 0; i < points.length - 1; i++) {
@ -115,10 +118,10 @@ export class TrainWindowDraw extends GraphicDrawAssistant<
);
trainWindow.id = GraphicIdGenerator.next();
trainWindow.datas.sectionId = section.id;
trainWindows.push(trainWindow);
this.storeGraphic(trainWindow);
trainWindow.loadRealtions();
}
});
this.storeGraphic(...trainWindows);
}
}