From 437fd3edbe03d8c3ed116b325023c6ae79b2554d Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 12 Jul 2023 15:08:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logicSection/LogicSectionDrawAssistant.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/graphics/logicSection/LogicSectionDrawAssistant.ts b/src/graphics/logicSection/LogicSectionDrawAssistant.ts index 7e114bd..3b2e637 100644 --- a/src/graphics/logicSection/LogicSectionDrawAssistant.ts +++ b/src/graphics/logicSection/LogicSectionDrawAssistant.ts @@ -85,11 +85,14 @@ export class LogicSectionDraw extends GraphicDrawAssistant< AxleCountingSection.Type ); axleCountingSections.forEach((axleCountingSection) => { + if (map.has(`${axleCountingSection.id}`)) { + return; + } + map.set(`${axleCountingSection.id}`, 1); const turnoutPosRef = axleCountingSection.datas.turnoutPosRef; if (turnoutPosRef.length > 0) { turnoutPosRef.forEach((turnout) => { - if (turnout.position == 1 && !map.has(`${turnout.id}`)) { - map.set(`${turnout.id}`, 1); + if (turnout.position == 1) { const t = this.app.queryStore.queryById(turnout.id) as Turnout; const data = new LogicSectionData(); data.points = [ @@ -101,13 +104,10 @@ export class LogicSectionDraw extends GraphicDrawAssistant< } }); } - if (!map.has(`${axleCountingSection.id}`)) { - map.set(`${axleCountingSection.id}`, 1); - const data = new LogicSectionData(); - data.points = axleCountingSection.datas.points; - data.axleSectionId = axleCountingSection.id; - this.draw(data); - } + const data = new LogicSectionData(); + data.points = axleCountingSection.datas.points; + data.axleSectionId = axleCountingSection.id; + this.draw(data); }); } }