Date: Wed, 27 Dec 2023 08:54:26 +0800
Subject: [PATCH 05/12] =?UTF-8?q?=E6=95=85=E9=9A=9C=E6=B5=8B=E8=AF=95?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/AlertMock.ts | 9 +-
src/components/alarm/setAlarmText.vue | 232 ++++++++++++++++++--------
2 files changed, 169 insertions(+), 72 deletions(-)
diff --git a/src/api/AlertMock.ts b/src/api/AlertMock.ts
index 3823b34..97f24af 100644
--- a/src/api/AlertMock.ts
+++ b/src/api/AlertMock.ts
@@ -9,9 +9,12 @@ export function mockLocalDemoTestSet(
alertType: string,
data: {
lineId: number;
- deviceInfos: { deviceName: string; deviceType: string }[];
- status: string;
- groupId?: string;
+ deviceInfos: {
+ deviceName: string;
+ deviceType: string;
+ status: string;
+ groupId?: string;
+ }[][];
}
) {
return api.post(`${alertUriBase}/localDemoTest/${alertType}`, data);
diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue
index d0f3ae6..a55e103 100644
--- a/src/components/alarm/setAlarmText.vue
+++ b/src/components/alarm/setAlarmText.vue
@@ -26,51 +26,78 @@
:options="optionsAlertType"
:rules="[(val) => val.length > 0 || '请选择故障类型!']"
/>
-
-
-
-
- 框选的设备
-
-
- {{ item.deviceName }}
-
-
-
-
-
+
+
+
+
+
+
+
+ {{ item.deviceName }}
+
+
+
+
+
+
+
+
+
+
({
lineId: '',
alertType: '',
- deviceInfos: [],
- status: '',
- groupId: '',
+ groupList: [
+ {
+ groupName: '测试组',
+ groupId: '',
+ status: '',
+ deviceInfos: [],
+ expanded: false,
+ },
+ ],
});
const optionsAlertType = [
'蓝显',
@@ -141,7 +183,12 @@ let selectGraphic: JlGraphic[] = [];
watch(
() => lineStore.selectedGraphics,
(val) => {
- if (val && val.length > 0 && setAlartTextData.value.alertType) {
+ if (
+ val &&
+ val.length > 0 &&
+ setAlartTextData.value.alertType &&
+ clickIndex !== null
+ ) {
const selectGraphicId = selectGraphic.map((g) => g.id);
const appSelectedGraphicsId = lineStore.selectedGraphics?.map(
(g) => g.id
@@ -176,12 +223,19 @@ watch(
}
selectGraphic = Array.from(new Set(selectGraphic));
lineStore.getLineApp().updateSelected(...selectGraphic);
- setAlartTextData.value.deviceInfos = [];
+ setAlartTextData.value.groupList[clickIndex].deviceInfos = [];
+ const status = setAlartTextData.value.groupList[clickIndex].status;
+ const groupId =
+ setAlartTextData.value.groupList[clickIndex].groupId || '';
selectGraphic.forEach((g) => {
- setAlartTextData.value.deviceInfos.push({
- deviceName: g.code,
- deviceType: (DeviceType as never)[g.type + ''],
- });
+ setAlartTextData.value.groupList[clickIndex as number].deviceInfos.push(
+ {
+ deviceName: g.code,
+ deviceType: (DeviceType as never)[g.type + ''],
+ status,
+ groupId,
+ }
+ );
});
}
}
@@ -196,7 +250,6 @@ onMounted(() => {
wheelZoom: true,
},
});
- clearSelect();
onReset();
setAlartTextData.value.lineId = lineStore.lineId as unknown as string;
});
@@ -211,9 +264,9 @@ async function onSubmit() {
try {
const params = {
lineId: +setAlartTextData.value.lineId,
- deviceInfos: setAlartTextData.value.deviceInfos,
- status: setAlartTextData.value.status,
- groupId: setAlartTextData.value.groupId,
+ deviceInfos: setAlartTextData.value.groupList.map(
+ (item) => item.deviceInfos
+ ),
};
const alertType = (saveAlertTypeData as never)[
setAlartTextData.value.alertType + ''
@@ -237,17 +290,52 @@ async function onSubmit() {
});
}
-function removeSelect(code: { deviceName: string; deviceType: string }) {
- const removeIndex = setAlartTextData.value.deviceInfos.findIndex(
- (item) => item == code
- );
+let clickIndex: null | number = null;
+function toggleItem(index: number) {
+ const lineApp = lineStore.getLineApp();
+ selectGraphic = [];
+ lineApp.updateSelected();
+ if (setAlartTextData.value.groupList[index].expanded == true) {
+ clickIndex = index;
+ const select: JlGraphic[] = [];
+ setAlartTextData.value.groupList[index].deviceInfos.forEach(
+ (deviceInfo) => {
+ const g = lineApp.queryStore.queryById(deviceInfo.deviceName);
+ select.push(g);
+ }
+ );
+ lineApp.updateSelected(...select);
+ } else {
+ clickIndex = null;
+ }
+}
+
+function removeSelect(removeIndex: number) {
+ const clickTarget = setAlartTextData.value.groupList[clickIndex as number];
selectGraphic.splice(removeIndex, 1);
- setAlartTextData.value.deviceInfos.splice(removeIndex, 1);
+ clickTarget.deviceInfos.splice(removeIndex, 1);
+ clickTarget.deviceInfos.splice(removeIndex, 1);
lineStore.getLineApp().updateSelected(...selectGraphic);
}
-function clearSelect() {
- setAlartTextData.value.deviceInfos = [];
+function clearAllSelect(index: number) {
+ setAlartTextData.value.groupList[index].deviceInfos = [];
+ selectGraphic = [];
+ lineStore.getLineApp().updateSelected();
+}
+
+function addSelectConfig() {
+ setAlartTextData.value.groupList.push({
+ groupName: '测试组',
+ groupId: '',
+ status: '',
+ deviceInfos: [],
+ expanded: false,
+ });
+}
+
+function deleteSelectConfig(index: number) {
+ setAlartTextData.value.groupList.splice(index, 1);
selectGraphic = [];
lineStore.getLineApp().updateSelected();
}
@@ -256,9 +344,15 @@ function onReset() {
setAlartTextData.value = {
lineId: lineStore.lineId as unknown as string,
alertType: '',
- deviceInfos: [],
- status: '',
- groupId: '',
+ groupList: [
+ {
+ groupName: '测试组',
+ groupId: '',
+ status: '',
+ deviceInfos: [],
+ expanded: false,
+ },
+ ],
};
selectGraphic = [];
}
From e97a677c3b187ddb1eb9ec12a6b0692516432e03 Mon Sep 17 00:00:00 2001
From: joylink_zhaoerwei
Date: Wed, 27 Dec 2023 09:27:34 +0800
Subject: [PATCH 06/12] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/AlertMock.ts | 2 +-
src/components/alarm/setAlarmText.vue | 25 +++++++++++++++++++------
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/api/AlertMock.ts b/src/api/AlertMock.ts
index 97f24af..0f48670 100644
--- a/src/api/AlertMock.ts
+++ b/src/api/AlertMock.ts
@@ -14,7 +14,7 @@ export function mockLocalDemoTestSet(
deviceType: string;
status: string;
groupId?: string;
- }[][];
+ }[];
}
) {
return api.post(`${alertUriBase}/localDemoTest/${alertType}`, data);
diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue
index a55e103..b1c60a7 100644
--- a/src/components/alarm/setAlarmText.vue
+++ b/src/components/alarm/setAlarmText.vue
@@ -25,6 +25,7 @@
v-model="setAlartTextData.alertType"
:options="optionsAlertType"
:rules="[(val) => val.length > 0 || '请选择故障类型!']"
+ @update:model-value="onChooseAlertType"
/>
{
if (res) {
+ const deviceInfos = setAlartTextData.value.groupList
+ .map((item) => item.deviceInfos)
+ .flat();
try {
const params = {
lineId: +setAlartTextData.value.lineId,
- deviceInfos: setAlartTextData.value.groupList.map(
- (item) => item.deviceInfos
- ),
+ deviceInfos,
};
const alertType = (saveAlertTypeData as never)[
setAlartTextData.value.alertType + ''
@@ -340,6 +341,18 @@ function deleteSelectConfig(index: number) {
lineStore.getLineApp().updateSelected();
}
+function onChooseAlertType() {
+ setAlartTextData.value.groupList = [
+ {
+ groupName: '测试组',
+ groupId: '',
+ status: '',
+ deviceInfos: [],
+ expanded: false,
+ },
+ ];
+}
+
function onReset() {
setAlartTextData.value = {
lineId: lineStore.lineId as unknown as string,
From a0b9e27e715784388ebd5befbda7b9c67960e9c2 Mon Sep 17 00:00:00 2001
From: joylink_zhaoerwei
Date: Wed, 27 Dec 2023 09:47:24 +0800
Subject: [PATCH 07/12] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/alarm/setAlarmText.vue | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue
index b1c60a7..3917c2d 100644
--- a/src/components/alarm/setAlarmText.vue
+++ b/src/components/alarm/setAlarmText.vue
@@ -134,10 +134,8 @@ const setAlartTextData = ref<{
groupId?: string;
status: string;
deviceInfos: {
- groupId?: string;
deviceName: string;
deviceType: string;
- status: string;
}[];
expanded: boolean;
}[];
@@ -224,16 +222,11 @@ watch(
selectGraphic = Array.from(new Set(selectGraphic));
lineStore.getLineApp().updateSelected(...selectGraphic);
setAlartTextData.value.groupList[clickIndex].deviceInfos = [];
- const status = setAlartTextData.value.groupList[clickIndex].status;
- const groupId =
- setAlartTextData.value.groupList[clickIndex].groupId || '';
selectGraphic.forEach((g) => {
setAlartTextData.value.groupList[clickIndex as number].deviceInfos.push(
{
deviceName: g.code,
deviceType: (DeviceType as never)[g.type + ''],
- status,
- groupId,
}
);
});
@@ -262,7 +255,19 @@ async function onSubmit() {
myForm.value?.validate().then(async (res) => {
if (res) {
const deviceInfos = setAlartTextData.value.groupList
- .map((item) => item.deviceInfos)
+ .map((group) => {
+ const deviceInfo = group.deviceInfos.map((deviceInfo) => {
+ const status = group.status;
+ const groupId = group.groupId || '';
+ return {
+ deviceName: deviceInfo.deviceName,
+ deviceType: deviceInfo.deviceType,
+ status,
+ groupId,
+ };
+ });
+ return deviceInfo;
+ })
.flat();
try {
const params = {
From 91d290abf10079c231b3f5b4e71c35dab8c41c67 Mon Sep 17 00:00:00 2001
From: joylink_zhaoerwei
Date: Wed, 27 Dec 2023 13:21:10 +0800
Subject: [PATCH 08/12] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/alarm/setAlarmText.vue | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue
index 3917c2d..ca4192a 100644
--- a/src/components/alarm/setAlarmText.vue
+++ b/src/components/alarm/setAlarmText.vue
@@ -306,7 +306,13 @@ function toggleItem(index: number) {
const select: JlGraphic[] = [];
setAlartTextData.value.groupList[index].deviceInfos.forEach(
(deviceInfo) => {
- const g = lineApp.queryStore.queryById(deviceInfo.deviceName);
+ const deviceType = (
+ Object.keys(DeviceType) as Array
+ ).find((key) => DeviceType[key] === deviceInfo.deviceType) as string;
+ const g = lineApp.queryStore.queryByCodeAndType(
+ deviceInfo.deviceName,
+ deviceType
+ ) as JlGraphic;
select.push(g);
}
);
@@ -316,6 +322,21 @@ function toggleItem(index: number) {
}
}
+function clickSelectCenter(index: number) {
+ const lineApp = lineStore.getLineApp();
+ const clickTarget = setAlartTextData.value.groupList[clickIndex as number];
+ const deviceType = (
+ Object.keys(DeviceType) as Array
+ ).find(
+ (key) => DeviceType[key] === clickTarget.deviceInfos[index].deviceType
+ ) as string;
+ const clickGraphic = lineApp.queryStore.queryByCodeAndType(
+ clickTarget.deviceInfos[index].deviceName,
+ deviceType
+ ) as JlGraphic;
+ lineApp.makeGraphicCenterShow(clickGraphic);
+}
+
function removeSelect(removeIndex: number) {
const clickTarget = setAlartTextData.value.groupList[clickIndex as number];
selectGraphic.splice(removeIndex, 1);
From 17fdddb17ea08150c242841687945b3091c462c7 Mon Sep 17 00:00:00 2001
From: Yuan
Date: Wed, 27 Dec 2023 16:57:37 +0800
Subject: [PATCH 09/12] =?UTF-8?q?=E9=81=93=E5=B2=94=E5=8F=8A=E5=8C=BA?=
=?UTF-8?q?=E6=AE=B5=E5=85=B3=E7=B3=BB=E9=80=BB=E8=BE=91=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/drawApp/graphics/SectionInteraction.ts | 8 +--
src/graphics/section/Section.ts | 7 +-
src/graphics/section/SectionDrawAssistant.ts | 14 +++-
src/graphics/turnout/Turnout.ts | 73 +++++++++++---------
4 files changed, 63 insertions(+), 39 deletions(-)
diff --git a/src/drawApp/graphics/SectionInteraction.ts b/src/drawApp/graphics/SectionInteraction.ts
index 2906369..ee63ffb 100644
--- a/src/drawApp/graphics/SectionInteraction.ts
+++ b/src/drawApp/graphics/SectionInteraction.ts
@@ -53,11 +53,11 @@ export class SectionData extends GraphicDataBase implements ISectionData {
set sectionType(type: graphicData.Section.SectionType) {
this.data.sectionType = type;
}
- get axleCountings(): string[] {
- return this.data.axleCountings;
+ get axleCountings(): number[] {
+ return this.data.axleCountings.map((a) => Number(a));
}
- set axleCountings(axleCountings: string[]) {
- this.data.axleCountings = axleCountings;
+ set axleCountings(axleCountings: number[]) {
+ this.data.axleCountings = axleCountings.map((a) => a.toString());
}
get children(): number[] {
return this.data.children;
diff --git a/src/graphics/section/Section.ts b/src/graphics/section/Section.ts
index 499121d..3ab5e19 100644
--- a/src/graphics/section/Section.ts
+++ b/src/graphics/section/Section.ts
@@ -40,8 +40,8 @@ export interface ISectionData extends GraphicData {
set pbRef(ref: IRelatedRefData | undefined);
get sectionType(): SectionType;
set sectionType(type: SectionType);
- get axleCountings(): string[];
- set axleCountings(axleCountings: string[]);
+ get axleCountings(): number[];
+ set axleCountings(axleCountings: number[]);
get children(): number[];
set children(children: number[]);
get destinationCode(): string;
@@ -233,9 +233,11 @@ export class Section extends JlGraphic implements ILineGraphic {
buildRelation() {
this.relationManage.deleteRelationOfGraphicAndOtherType(this, Section.Type);
+ if (this.datas.sectionType === SectionType.TurnoutPhysical) return;
/** 区段与区段 */
this.queryStore.queryByType(Section.Type).forEach((section) => {
if (section.id === this.id) return;
+ if (section.datas.sectionType === SectionType.TurnoutPhysical) return;
let param: SectionPort[] = [];
if (
@@ -346,7 +348,6 @@ export class Section extends JlGraphic implements ILineGraphic {
});
}
if (
- this.datas.children &&
this.datas.children &&
this.datas.sectionType === SectionType.TurnoutPhysical
) {
diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts
index f6291f7..9b7a126 100644
--- a/src/graphics/section/SectionDrawAssistant.ts
+++ b/src/graphics/section/SectionDrawAssistant.ts
@@ -123,7 +123,7 @@ export class SectionDraw extends GraphicDrawAssistant<
}
generateTurnoutSection() {
- const turnoutIds: string[] = []; /* 已遍历的道岔id列表 */
+ const turnoutIds: number[] = []; /* 已遍历的道岔id列表 */
const dfs = (turnout: Turnout) => {
const axleCountings: AxleCounting[] = [];
const turnouts: Turnout[] = [];
@@ -173,6 +173,18 @@ export class SectionDraw extends GraphicDrawAssistant<
turnoutPhysicalSectionData.axleCountings = result.axleCountings.map(
(ac) => ac.datas.id
);
+ const exsit = this.app.queryStore
+ .queryByType(Section.Type)
+ .filter((g) => g.datas.sectionType === SectionType.TurnoutPhysical)
+ .some(
+ (ts) =>
+ ts.datas.axleCountings.every((id) =>
+ turnoutPhysicalSectionData.axleCountings.includes(id)
+ ) &&
+ ts.datas.axleCountings.length ===
+ turnoutPhysicalSectionData.axleCountings.length
+ );
+ if (exsit) return;
turnoutPhysicalSectionData.children = result.turnouts.map(
(t) => t.datas.id
);
diff --git a/src/graphics/turnout/Turnout.ts b/src/graphics/turnout/Turnout.ts
index c938cb0..3075798 100644
--- a/src/graphics/turnout/Turnout.ts
+++ b/src/graphics/turnout/Turnout.ts
@@ -13,7 +13,7 @@ import {
epsilon,
Vector2,
} from 'jl-graphic';
-import { Section, SectionPort } from '../section/Section';
+import { Section, SectionPort, SectionType } from '../section/Section';
import {
IRelatedRefData,
createRelatedRefProto,
@@ -541,39 +541,47 @@ export class Turnout extends JlGraphic {
buildRelation(): void {
this.relationManage.deleteRelationOfGraphic(this);
+
/** 道岔和区段 */
- this.queryStore.queryByType(Section.Type).forEach((section) => {
- this.getPortPoints().forEach((port, i) => {
- if (
- distance2(
- section.localToCanvasPoint(section.getStartPoint()),
- this.localToCanvasPoint(port[port.length - 1])
- ) <= epsilon
- ) {
- this.relationManage.addRelation(
- new GraphicRelationParam(
- this,
- [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
- ),
- new GraphicRelationParam(section, SectionPort.A)
- );
- }
- if (
- distance2(
- section.localToCanvasPoint(section.getEndPoint()),
- this.localToCanvasPoint(port[port.length - 1])
- ) <= epsilon
- ) {
- this.relationManage.addRelation(
- new GraphicRelationParam(
- this,
- [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
- ),
- new GraphicRelationParam(section, SectionPort.B)
- );
+ this.queryStore.queryByType(Section.Type)
+ .forEach((section) => {
+ if (section.datas.sectionType === SectionType.TurnoutPhysical) {
+ if (section.datas.children.includes(this.datas.id)) {
+ this.relationManage.addRelation(this, section)
+ }
+ return
}
+ this.getPortPoints().forEach((port, i) => {
+ if (
+ distance2(
+ section.localToCanvasPoint(section.getStartPoint()),
+ this.localToCanvasPoint(port[port.length - 1])
+ ) <= epsilon
+ ) {
+ this.relationManage.addRelation(
+ new GraphicRelationParam(
+ this,
+ [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
+ ),
+ new GraphicRelationParam(section, SectionPort.A)
+ );
+ }
+ if (
+ distance2(
+ section.localToCanvasPoint(section.getEndPoint()),
+ this.localToCanvasPoint(port[port.length - 1])
+ ) <= epsilon
+ ) {
+ this.relationManage.addRelation(
+ new GraphicRelationParam(
+ this,
+ [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
+ ),
+ new GraphicRelationParam(section, SectionPort.B)
+ );
+ }
+ });
});
- });
/** 道岔和道岔 */
this.getPortPoints().forEach((thisPort, i) => {
@@ -656,10 +664,13 @@ export class Turnout extends JlGraphic {
} else {
this.datas.pbRef = undefined;
}
+
const pcRelation = this.relationManage
.getRelationsOfGraphic(this)
.find(
(relation) => relation.getRelationParam(this).param === TurnoutPort.C
+ && (!(relation.getOtherGraphic(this) instanceof Section
+ && relation.getOtherGraphic(this).datas.sectionType !== SectionType.TurnoutPhysical))
);
const pcDevice = pcRelation?.getOtherGraphic(this);
if (pcDevice) {
From c8580b9d423759bf62bc64d0e2a703fc754b16f6 Mon Sep 17 00:00:00 2001
From: joylink_zhaoerwei
Date: Wed, 27 Dec 2023 17:37:35 +0800
Subject: [PATCH 10/12] =?UTF-8?q?=E5=BE=AE=E8=B0=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/alarm/setAlarmText.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue
index ca4192a..7583bdb 100644
--- a/src/components/alarm/setAlarmText.vue
+++ b/src/components/alarm/setAlarmText.vue
@@ -38,7 +38,7 @@
@click="toggleItem(index)"
>
-
+
Date: Thu, 28 Dec 2023 15:10:41 +0800
Subject: [PATCH 11/12] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=BE=AE=E8=B0=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/alarm/setAlarmText.vue | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/components/alarm/setAlarmText.vue b/src/components/alarm/setAlarmText.vue
index 7583bdb..a805df6 100644
--- a/src/components/alarm/setAlarmText.vue
+++ b/src/components/alarm/setAlarmText.vue
@@ -341,7 +341,6 @@ function removeSelect(removeIndex: number) {
const clickTarget = setAlartTextData.value.groupList[clickIndex as number];
selectGraphic.splice(removeIndex, 1);
clickTarget.deviceInfos.splice(removeIndex, 1);
- clickTarget.deviceInfos.splice(removeIndex, 1);
lineStore.getLineApp().updateSelected(...selectGraphic);
}
From 12f0bdf6d25f80b0a82f029aee6d8ba03266ec44 Mon Sep 17 00:00:00 2001
From: joylink_zhaoerwei
Date: Wed, 10 Jan 2024 16:30:37 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E5=90=B8=E9=99=84?=
=?UTF-8?q?=E7=82=B9=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/graphics/section/SectionDrawAssistant.ts | 31 ++++++++++++--------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts
index 9b7a126..8a3ad65 100644
--- a/src/graphics/section/SectionDrawAssistant.ts
+++ b/src/graphics/section/SectionDrawAssistant.ts
@@ -244,18 +244,25 @@ export class SectionGraphicHitArea implements IHitArea {
function buildAbsorbablePositions(section: Section): AbsorbablePosition[] {
const aps: AbsorbablePosition[] = [];
- const sections = section.queryStore.queryByType(Section.Type);
- sections.forEach((other) => {
- const [ps, pe] = [
- other.localToCanvasPoint(other.getStartPoint()),
- other.localToCanvasPoint(other.getEndPoint()),
- ];
- const { width, height } = section.getGraphicApp().canvas;
- const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y });
- const ys = new AbsorbableLine({ x: ps.x, y: 0 }, { x: ps.x, y: height });
- const xe = new AbsorbableLine({ x: 0, y: pe.y }, { x: width, y: pe.y });
- const ye = new AbsorbableLine({ x: pe.x, y: 0 }, { x: pe.x, y: height });
- aps.push(xs, ys, xe, ye);
+ const [ps, pe] = [
+ section.localToCanvasPoint(section.getStartPoint()),
+ section.localToCanvasPoint(section.getEndPoint()),
+ ];
+ const { width, height } = section.getGraphicApp().canvas;
+ const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y });
+ const ys = new AbsorbableLine({ x: ps.x, y: 0 }, { x: ps.x, y: height });
+ const xe = new AbsorbableLine({ x: 0, y: pe.y }, { x: width, y: pe.y });
+ const ye = new AbsorbableLine({ x: pe.x, y: 0 }, { x: pe.x, y: height });
+ aps.push(xs, ys, xe, ye);
+ const sections = section.queryStore
+ .queryByType(Section.Type)
+ .filter((g) => g.datas.sectionType == SectionType.Physical);
+ sections.forEach((item) => {
+ if (item.id !== section.id) {
+ item.localToCanvasPoints(...item.datas.points).forEach((p) => {
+ aps.push(new AbsorbablePoint(p));
+ });
+ }
});
const turnouts = section.queryStore.queryByType(Turnout.Type);