From 9f310f95c91bd4f4f63f60817ae0e8a26ead58c1 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 20 Dec 2023 15:40:13 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=BC=B9=E7=AA=97=E5=85=A8=E5=B1=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/RunconfigManage.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/RunconfigManage.vue b/src/pages/RunconfigManage.vue index 84572c2..f60a09a 100644 --- a/src/pages/RunconfigManage.vue +++ b/src/pages/RunconfigManage.vue @@ -47,11 +47,13 @@ - +
@@ -90,7 +92,10 @@ :key="index" :name="item.fieldName" > -
+
{ return props.sizeHeight - 32; }); +const tabPanelHeight = computed(() => { + return props.sizeHeight - 289; +}); onMounted(() => { tableRef.value.requestServerInteraction(); From b3db0300ca3f6b50acbcf692b57f62be7aa01f1b Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 21 Dec 2023 16:00:12 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E9=9B=86=E4=B8=AD=E7=AB=99=E2=80=94?= =?UTF-8?q?=E2=80=94=E5=8F=B3=E8=BE=B9=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/DrawLayout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue index d3b7d1e..c5e7553 100644 --- a/src/layouts/DrawLayout.vue +++ b/src/layouts/DrawLayout.vue @@ -885,7 +885,7 @@ function oneClickRelateCentralizedStation() { ); containDeviceIds = Array.from(new Set(containDeviceIds)); }); - if (rightBoundary.datas.refRightStationId) { + if (!rightBoundary.datas.refRightStationId) { handleContainDevices(containDeviceIds, []); } else { handleContainDevices(containDeviceIds, [ From 4268a54a8b9a32726eb5c47c2f717d32360e192b Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 21 Dec 2023 17:08:53 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ConfigData.vue | 100 +++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/src/components/ConfigData.vue b/src/components/ConfigData.vue index f572e80..c1bfc0e 100644 --- a/src/components/ConfigData.vue +++ b/src/components/ConfigData.vue @@ -3,11 +3,21 @@
-
{{ menu.description }}
- 添加 + + + {{ menu.description }} + + +
+ 添加 +
+
+
添加 @@ -57,49 +67,51 @@
- + {{ menu.description }} - - - - - - - + +
+ + + + + + +
From d8a39d82a695f859c991d67a94b3e167fb3e5835 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 26 Dec 2023 11:11:23 +0800 Subject: [PATCH 04/11] =?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 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a1f4fb..08a6207 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "default-passive-events": "^2.0.0", "echarts": "^5.4.3", "google-protobuf": "^3.21.2", - "jl-graphic": "git+https://git.code.tencent.com/jl-framework/graphic-pixi.git#v0.1.0", + "jl-graphic": "git+https://git.code.tencent.com/jl-framework/graphic-pixi.git#v0.1.3", "js-base64": "^3.7.5", "pinia": "^2.0.11", "quasar": "^2.6.0", From 9b4116448e72ffc0838ef1bcab05395749a59662 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 4 Jan 2024 10:22:28 +0800 Subject: [PATCH 05/11] =?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 --- bj-rtss-message | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bj-rtss-message b/bj-rtss-message index b68103f..999608f 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit b68103fcf0d9a505a605675b8cebb6ca1bf5c533 +Subproject commit 999608fa88a430cba9bef8915f76993a0e4c6d8e From f813cea9e95305de9301e9adefc745274a9a33a4 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Fri, 5 Jan 2024 13:21:18 +0800 Subject: [PATCH 06/11] =?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 --- src/pages/AuthPathManage.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/AuthPathManage.vue b/src/pages/AuthPathManage.vue index b088f68..403fbfe 100644 --- a/src/pages/AuthPathManage.vue +++ b/src/pages/AuthPathManage.vue @@ -144,7 +144,7 @@ const columnDefs: QTableColumn[] = [ { name: 'id', label: 'ID', field: 'id', align: 'center' }, { name: 'name', - label: '用户名', + label: '权限接口名称', field: 'name', required: true, align: 'center', From 0f3b59254f05f0ae4df4b778f75b45d1d388571e Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 9 Jan 2024 13:57:14 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E7=BB=A7=E7=94=B5=E5=99=A8=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Simulation.ts | 7 +- src/components/line-app/states/RelayState.vue | 24 ++- .../relayCabinetGraphics/RelayInteraction.ts | 17 +- src/protos/request.ts | 183 ++++++++++++++++++ 4 files changed, 211 insertions(+), 20 deletions(-) diff --git a/src/api/Simulation.ts b/src/api/Simulation.ts index 0de6b7a..c94910e 100644 --- a/src/api/Simulation.ts +++ b/src/api/Simulation.ts @@ -1,4 +1,5 @@ import { api } from 'src/boot/axios'; +import { request } from 'src/protos/request'; const UriBase = '/api/v1/simulation'; @@ -192,10 +193,10 @@ export async function getSimulationChannelName(): Promise { * @returns */ export async function setRelayState(data: { - id: number; - mapId: number; simulationId: string; - td: boolean; + mapId: number; + deviceId: number; + operation: request.Relay.Operation; }) { return await api.post(`${UriBase}/relay/operation`, data); } diff --git a/src/components/line-app/states/RelayState.vue b/src/components/line-app/states/RelayState.vue index 5338367..40b6b89 100644 --- a/src/components/line-app/states/RelayState.vue +++ b/src/components/line-app/states/RelayState.vue @@ -32,6 +32,7 @@ import { useQuasar } from 'quasar'; import { ApiError } from 'src/boot/axios'; import { Relay } from 'src/graphics/relay/Relay'; import { RelayState } from 'src/drawApp/relayCabinetGraphics/RelayInteraction'; +import { request } from 'src/protos/request'; const $q = useQuasar(); const lineStore = useLineStore(); @@ -42,7 +43,7 @@ const relayState = ref({ }); let operateOptions: { label: string; - value: boolean; + value: request.Relay.Operation; }[] = []; let copySelectGraphic: Relay | null = null; @@ -74,8 +75,13 @@ function setNewRelayState(relay: Relay) { xh: relay.states.xh || false, }; operateOptions = relay.states.xh - ? [{ label: '驱动落下', value: false }] - : [{ label: '驱动吸起', value: true }]; + ? [{ label: '强制后接点位(落下)', value: request.Relay.Operation.ForceHw }] + : [ + { + label: '强制前接点位(吸起)', + value: request.Relay.Operation.ForceQw, + }, + ]; subscribeState(relay); } @@ -90,17 +96,17 @@ function unSubscribeState(g: Relay) { function updateState(newVal: RelayState) { relayState.value.xh = newVal.states.xh || false; operateOptions = newVal.states.xh - ? [{ label: '驱动落下', value: false }] - : [{ label: '驱动吸起', value: true }]; + ? [{ label: ' 强制后接点位(落下)', value: request.Relay.Operation.ForceHw }] + : [{ label: '强制前接点位(吸起)', value: request.Relay.Operation.ForceQw }]; } -function changePosition(td: boolean) { +function changePosition(operation: request.Relay.Operation) { if (lineStore.simulationId) { setRelayState({ - id: relayState.value.id, - mapId: lineStore.mapId as number, simulationId: lineStore.simulationId, - td, + mapId: lineStore.mapId as number, + deviceId: relayState.value.id, + operation, }) .then(() => { $q.notify({ type: 'positive', message: '修改继电器状态成功' }); diff --git a/src/drawApp/relayCabinetGraphics/RelayInteraction.ts b/src/drawApp/relayCabinetGraphics/RelayInteraction.ts index 7d11539..f553d78 100644 --- a/src/drawApp/relayCabinetGraphics/RelayInteraction.ts +++ b/src/drawApp/relayCabinetGraphics/RelayInteraction.ts @@ -15,6 +15,7 @@ import { DisplayObject, FederatedMouseEvent } from 'pixi.js'; import { setRelayState } from 'src/api/Simulation'; import { ApiError } from 'src/boot/axios'; import { errorNotify, successNotify } from 'src/utils/CommonNotify'; +import { request } from 'src/protos/request'; export class RelayData extends GraphicDataBase implements IRelayData { constructor(data?: relayCabinetGraphicData.Relay) { @@ -92,8 +93,8 @@ export class RelayState extends GraphicStateBase implements IRelayState { } } -const setOpen: MenuItemOptions = { name: '驱动落下' }; -const setClose: MenuItemOptions = { name: '驱动吸起' }; +const setOpen: MenuItemOptions = { name: '强制后接点位(落下)' }; +const setClose: MenuItemOptions = { name: '强制前接点位(吸起)' }; export class RelayOperationPlugin extends GraphicInteractionPlugin { static Name = 'relay_operate_menu'; @@ -137,12 +138,12 @@ export class RelayOperationPlugin extends GraphicInteractionPlugin { const mapId = useLineStore().mapId as number; setOpen.disabled = !relay.states.xh; setClose.disabled = relay.states.xh; - const changeRelayState = async (td: boolean) => { + const changeRelayState = async (operation: request.Relay.Operation) => { setRelayState({ - id: relay.datas.id, - mapId, simulationId, - td, + mapId, + deviceId: relay.datas.id, + operation, }) .then(() => { successNotify('修改继电器状态成功'); @@ -153,10 +154,10 @@ export class RelayOperationPlugin extends GraphicInteractionPlugin { }); }; setOpen.handler = () => { - changeRelayState(false); + changeRelayState(request.Relay.Operation.ForceHw); }; setClose.handler = () => { - changeRelayState(true); + changeRelayState(request.Relay.Operation.ForceQw); }; this.relayOperationMenu.open(e.global); } diff --git a/src/protos/request.ts b/src/protos/request.ts index d86a8fb..8de8dc5 100644 --- a/src/protos/request.ts +++ b/src/protos/request.ts @@ -5,6 +5,189 @@ * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace request { + export class Relay extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}): Relay { + const message = new Relay({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Relay { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Relay(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Relay { + return Relay.deserialize(bytes); + } + } + export namespace Relay { + export enum Operation { + Undefined = 0, + ForceQw = 1, + ForceHw = 2 + } + } + export class RelayOperationReq extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + simulationId?: string; + mapId?: number; + deviceId?: number; + operation?: Relay.Operation; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("simulationId" in data && data.simulationId != undefined) { + this.simulationId = data.simulationId; + } + if ("mapId" in data && data.mapId != undefined) { + this.mapId = data.mapId; + } + if ("deviceId" in data && data.deviceId != undefined) { + this.deviceId = data.deviceId; + } + if ("operation" in data && data.operation != undefined) { + this.operation = data.operation; + } + } + } + get simulationId() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set simulationId(value: string) { + pb_1.Message.setField(this, 1, value); + } + get mapId() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set mapId(value: number) { + pb_1.Message.setField(this, 2, value); + } + get deviceId() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set deviceId(value: number) { + pb_1.Message.setField(this, 3, value); + } + get operation() { + return pb_1.Message.getFieldWithDefault(this, 4, Relay.Operation.Undefined) as Relay.Operation; + } + set operation(value: Relay.Operation) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + simulationId?: string; + mapId?: number; + deviceId?: number; + operation?: Relay.Operation; + }): RelayOperationReq { + const message = new RelayOperationReq({}); + if (data.simulationId != null) { + message.simulationId = data.simulationId; + } + if (data.mapId != null) { + message.mapId = data.mapId; + } + if (data.deviceId != null) { + message.deviceId = data.deviceId; + } + if (data.operation != null) { + message.operation = data.operation; + } + return message; + } + toObject() { + const data: { + simulationId?: string; + mapId?: number; + deviceId?: number; + operation?: Relay.Operation; + } = {}; + if (this.simulationId != null) { + data.simulationId = this.simulationId; + } + if (this.mapId != null) { + data.mapId = this.mapId; + } + if (this.deviceId != null) { + data.deviceId = this.deviceId; + } + if (this.operation != null) { + data.operation = this.operation; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.simulationId.length) + writer.writeString(1, this.simulationId); + if (this.mapId != 0) + writer.writeInt32(2, this.mapId); + if (this.deviceId != 0) + writer.writeUint32(3, this.deviceId); + if (this.operation != Relay.Operation.Undefined) + writer.writeEnum(4, this.operation); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RelayOperationReq { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RelayOperationReq(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.simulationId = reader.readString(); + break; + case 2: + message.mapId = reader.readInt32(); + break; + case 3: + message.deviceId = reader.readUint32(); + break; + case 4: + message.operation = reader.readEnum(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RelayOperationReq { + return RelayOperationReq.deserialize(bytes); + } + } export class Turnout extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { From ed5463a370da54497fb200877b787f9e6e22f3f4 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 9 Jan 2024 14:44:40 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=A7=E7=94=B5?= =?UTF-8?q?=E5=99=A8=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/line-app/states/RelayState.vue | 17 +++++------------ .../relayCabinetGraphics/RelayInteraction.ts | 6 +++++- src/protos/request.ts | 3 ++- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/components/line-app/states/RelayState.vue b/src/components/line-app/states/RelayState.vue index 40b6b89..dd52067 100644 --- a/src/components/line-app/states/RelayState.vue +++ b/src/components/line-app/states/RelayState.vue @@ -44,7 +44,11 @@ const relayState = ref({ let operateOptions: { label: string; value: request.Relay.Operation; -}[] = []; +}[] = [ + { label: '强制前接点位(吸起)', value: request.Relay.Operation.ForceQw }, + { label: ' 强制后接点位(落下)', value: request.Relay.Operation.ForceHw }, + { label: ' 取消强制', value: request.Relay.Operation.CancelForce }, +]; let copySelectGraphic: Relay | null = null; watch( @@ -74,14 +78,6 @@ function setNewRelayState(relay: Relay) { code: relay.datas.code, xh: relay.states.xh || false, }; - operateOptions = relay.states.xh - ? [{ label: '强制后接点位(落下)', value: request.Relay.Operation.ForceHw }] - : [ - { - label: '强制前接点位(吸起)', - value: request.Relay.Operation.ForceQw, - }, - ]; subscribeState(relay); } @@ -95,9 +91,6 @@ function unSubscribeState(g: Relay) { function updateState(newVal: RelayState) { relayState.value.xh = newVal.states.xh || false; - operateOptions = newVal.states.xh - ? [{ label: ' 强制后接点位(落下)', value: request.Relay.Operation.ForceHw }] - : [{ label: '强制前接点位(吸起)', value: request.Relay.Operation.ForceQw }]; } function changePosition(operation: request.Relay.Operation) { diff --git a/src/drawApp/relayCabinetGraphics/RelayInteraction.ts b/src/drawApp/relayCabinetGraphics/RelayInteraction.ts index f553d78..0bc115e 100644 --- a/src/drawApp/relayCabinetGraphics/RelayInteraction.ts +++ b/src/drawApp/relayCabinetGraphics/RelayInteraction.ts @@ -95,12 +95,13 @@ export class RelayState extends GraphicStateBase implements IRelayState { const setOpen: MenuItemOptions = { name: '强制后接点位(落下)' }; const setClose: MenuItemOptions = { name: '强制前接点位(吸起)' }; +const cancelForce: MenuItemOptions = { name: '取消强制' }; export class RelayOperationPlugin extends GraphicInteractionPlugin { static Name = 'relay_operate_menu'; relayOperationMenu: ContextMenu = ContextMenu.init({ name: 'Relay操作', - groups: [{ items: [setOpen, setClose] }], + groups: [{ items: [setOpen, setClose, cancelForce] }], }); constructor(app: IGraphicScene) { @@ -159,6 +160,9 @@ export class RelayOperationPlugin extends GraphicInteractionPlugin { setClose.handler = () => { changeRelayState(request.Relay.Operation.ForceQw); }; + cancelForce.handler = () => { + changeRelayState(request.Relay.Operation.CancelForce); + }; this.relayOperationMenu.open(e.global); } } diff --git a/src/protos/request.ts b/src/protos/request.ts index 8de8dc5..fe829a0 100644 --- a/src/protos/request.ts +++ b/src/protos/request.ts @@ -49,7 +49,8 @@ export namespace request { export enum Operation { Undefined = 0, ForceQw = 1, - ForceHw = 2 + ForceHw = 2, + CancelForce = 3 } } export class RelayOperationReq extends pb_1.Message { From 347dec93d03e75984b49fa8adcff7d441fe76f67 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 10 Jan 2024 13:34:05 +0800 Subject: [PATCH 09/11] =?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 | 21 ++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index 3d43e96..79a5259 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -39,7 +39,7 @@ import { MenuItemOptions, AbsorbableLine, AbsorbablePosition, - AbsorbablePoint + AbsorbablePoint, } from 'jl-graphic'; import { graphicData } from 'src/protos/stationLayoutGraphics'; import { AxleCounting } from '../axleCounting/AxleCounting'; @@ -340,8 +340,10 @@ export class SectionGraphicHitArea implements IHitArea { function buildAbsorbablePositions(section: Section): AbsorbablePosition[] { const aps: AbsorbablePosition[] = []; - const sections = section.queryStore.queryByType
(Section.Type); - sections.forEach((other) => { + const sectionRef = section.relationManage + .getRelationsOfGraphicAndOtherType(section, Section.Type) + .map((r) => r.getOtherGraphic
(section)); + sectionRef.forEach((other) => { const [ps, pe] = [ other.localToCanvasPoint(other.getStartPoint()), other.localToCanvasPoint(other.getEndPoint()), @@ -353,7 +355,14 @@ function buildAbsorbablePositions(section: Section): AbsorbablePosition[] { 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); + 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); turnouts.forEach((turnout) => { turnout.getPortPoints().forEach((points) => { @@ -533,10 +542,10 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin
{ if ( (dir === 'ltr' && sectionData.points[0].x > - sectionData.points[sectionData.points.length - 1].x) || + sectionData.points[sectionData.points.length - 1].x) || (dir === 'rtl' && sectionData.points[0].x < - sectionData.points[sectionData.points.length - 1].x) + sectionData.points[sectionData.points.length - 1].x) ) { codeAppend = codeAppend.split('').reverse().join(''); } From fc23bb11d5d2fdb60c6525bb0ee550d3c9dd4551 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 10 Jan 2024 13:50:49 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E5=90=B8=E9=99=84?= =?UTF-8?q?=E7=82=B9=E5=8F=AA=E8=A6=81=E7=89=A9=E7=90=86=E5=8C=BA=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/section/SectionDrawAssistant.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index 79a5259..87595d0 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -355,7 +355,9 @@ function buildAbsorbablePositions(section: Section): AbsorbablePosition[] { 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); + 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) => { From 81e5c23093f07bcffe85cb9f02a848a8e774ca5e Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 10 Jan 2024 14:00:23 +0800 Subject: [PATCH 11/11] =?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/graphics/section/SectionDrawAssistant.ts | 26 ++++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index 87595d0..e2fdc0e 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -339,22 +339,16 @@ export class SectionGraphicHitArea implements IHitArea { function buildAbsorbablePositions(section: Section): AbsorbablePosition[] { const aps: AbsorbablePosition[] = []; - - const sectionRef = section.relationManage - .getRelationsOfGraphicAndOtherType(section, Section.Type) - .map((r) => r.getOtherGraphic
(section)); - sectionRef.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);