From dbd01d71a312059f2284b90e5b8190d132f2a636 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 11 Jul 2023 17:35:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=8C=BA=E6=AE=B5=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logicSection/LogicSectionDrawAssistant.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/graphics/logicSection/LogicSectionDrawAssistant.ts b/src/graphics/logicSection/LogicSectionDrawAssistant.ts index 489d767..b7b1492 100644 --- a/src/graphics/logicSection/LogicSectionDrawAssistant.ts +++ b/src/graphics/logicSection/LogicSectionDrawAssistant.ts @@ -78,13 +78,11 @@ export class LogicSectionDraw extends GraphicDrawAssistant< AxleCountingSection.Type ); axleCountingSections.forEach((axleCountingSection) => { - if (map.has(`${axleCountingSection.id}`)) { - return; - } const turnoutPosRef = axleCountingSection.datas.turnoutPosRef; if (turnoutPosRef.length > 0) { turnoutPosRef.forEach((turnout) => { - if (turnout.position == 1) { + if (turnout.position == 1 && !map.has(`${turnout.id}`)) { + map.set(`${turnout.id}`, 1); const t = this.app.queryStore.queryById(turnout.id) as Turnout; const data = new LogicSectionData(); data.points = [ @@ -96,10 +94,13 @@ export class LogicSectionDraw extends GraphicDrawAssistant< } }); } - const data = new LogicSectionData(); - data.points = axleCountingSection.datas.points; - data.axleSectionId = axleCountingSection.id; - this.draw(data); + 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); + } }); } }