代码调整

This commit is contained in:
dong 2023-07-12 15:08:04 +08:00
parent 2981a131ce
commit 437fd3edbe

View File

@ -85,11 +85,14 @@ export class LogicSectionDraw extends GraphicDrawAssistant<
AxleCountingSection.Type AxleCountingSection.Type
); );
axleCountingSections.forEach((axleCountingSection) => { axleCountingSections.forEach((axleCountingSection) => {
if (map.has(`${axleCountingSection.id}`)) {
return;
}
map.set(`${axleCountingSection.id}`, 1);
const turnoutPosRef = axleCountingSection.datas.turnoutPosRef; const turnoutPosRef = axleCountingSection.datas.turnoutPosRef;
if (turnoutPosRef.length > 0) { if (turnoutPosRef.length > 0) {
turnoutPosRef.forEach((turnout) => { turnoutPosRef.forEach((turnout) => {
if (turnout.position == 1 && !map.has(`${turnout.id}`)) { if (turnout.position == 1) {
map.set(`${turnout.id}`, 1);
const t = this.app.queryStore.queryById(turnout.id) as Turnout; const t = this.app.queryStore.queryById(turnout.id) as Turnout;
const data = new LogicSectionData(); const data = new LogicSectionData();
data.points = [ data.points = [
@ -101,13 +104,10 @@ export class LogicSectionDraw extends GraphicDrawAssistant<
} }
}); });
} }
if (!map.has(`${axleCountingSection.id}`)) { const data = new LogicSectionData();
map.set(`${axleCountingSection.id}`, 1); data.points = axleCountingSection.datas.points;
const data = new LogicSectionData(); data.axleSectionId = axleCountingSection.id;
data.points = axleCountingSection.datas.points; this.draw(data);
data.axleSectionId = axleCountingSection.id;
this.draw(data);
}
}); });
} }
} }