From 2e07f7413b57d47c0692627c03d739e5389bc9d1 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 20 Feb 2024 09:56:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E6=98=BE=E7=A4=BApsl?= =?UTF-8?q?=E5=92=8Cibp,=E5=B1=8F=E8=94=BD=E9=97=A8=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E3=80=81=E7=BB=A7=E7=94=B5=E5=99=A8=E5=90=B8?= =?UTF-8?q?=E8=B5=B7/=E8=90=BD=E4=B8=8B=E7=BB=9F=E4=B8=80=E6=94=B9?= =?UTF-8?q?=E4=B8=BAQ/H?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../line-app/states/PlatformState.vue | 28 +++++------ src/components/line-app/states/RelayState.vue | 7 ++- .../line-app/states/ScreenDoorState.vue | 48 +++++++------------ src/drawApp/lineScene.ts | 16 +++++-- 4 files changed, 49 insertions(+), 50 deletions(-) diff --git a/src/components/line-app/states/PlatformState.vue b/src/components/line-app/states/PlatformState.vue index 370d20d..f3720c3 100644 --- a/src/components/line-app/states/PlatformState.vue +++ b/src/components/line-app/states/PlatformState.vue @@ -107,41 +107,41 @@ function setPlatformState(platform: Platform) { } function getEMPRelayState(v: boolean) { - if (v) return '吸起'; - return '落下'; + if (v) return 'Q'; + return 'H'; } function getSPKSXRelayState(spksState: state.ReplyState[]) { - if (spksState.find((item) => item.code == 'SPKSX旁路')?.xh) return '吸起'; - return '落下'; + if (spksState.find((item) => item.code == 'SPKSX旁路')?.xh) return 'Q'; + return 'H'; } function getSPKS1RelayState(spksState: state.ReplyState[]) { - if (spksState.find((item) => item.code == 'SPKS1')?.xh) return '吸起'; - return '落下'; + if (spksState.find((item) => item.code == 'SPKS1')?.xh) return 'Q'; + return 'H'; } function getSPKS3RelayState(spksState: state.ReplyState[]) { - if (spksState.find((item) => item.code == 'SPKS3')?.xh) return '吸起'; - return '落下'; + if (spksState.find((item) => item.code == 'SPKS3')?.xh) return 'Q'; + return 'H'; } function getConfirmRelayState(mkxJState: state.MkxJState) { if (mkxJState.replyState.find((item) => item.code == '站台确认继电器')?.xh) - return '吸起'; - return '落下'; + return 'Q'; + return 'H'; } function getCloseSPKS1RelayState(mkxJState: state.MkxJState) { if (mkxJState.replyState.find((item) => item.code == '站台关门继电器')?.xh) - return '吸起'; - return '落下'; + return 'Q'; + return 'H'; } function getOpenRelayState(mkxJState: state.MkxJState) { if (mkxJState.replyState.find((item) => item.code == '站台开门继电器')?.xh) - return '吸起'; - return '落下'; + return 'Q'; + return 'H'; } onUnmounted(stop); diff --git a/src/components/line-app/states/RelayState.vue b/src/components/line-app/states/RelayState.vue index 5492874..7be2833 100644 --- a/src/components/line-app/states/RelayState.vue +++ b/src/components/line-app/states/RelayState.vue @@ -87,7 +87,7 @@ interface KeyType { const list: KeyType[] = [ { label: '继电器索引', key: 'id' }, { label: '继电器名称', key: 'code' }, - { label: '是否吸合', key: 'xh', formatFn: getName }, + { label: '继电器状态', key: 'xh', formatFn: getRelayStateName }, { label: '是否强制', key: 'force', formatFn: getName }, ]; @@ -112,6 +112,11 @@ onMounted(() => { } }); +function getRelayStateName(v: boolean) { + if (v) return 'Q'; + return 'H'; +} + function getName(v: boolean) { if (v) return '是'; return '否'; diff --git a/src/components/line-app/states/ScreenDoorState.vue b/src/components/line-app/states/ScreenDoorState.vue index 049c34b..127a8f5 100644 --- a/src/components/line-app/states/ScreenDoorState.vue +++ b/src/components/line-app/states/ScreenDoorState.vue @@ -37,39 +37,25 @@ -
-
选择子门:
- diff --git a/src/drawApp/lineScene.ts b/src/drawApp/lineScene.ts index be5464c..63be7ee 100644 --- a/src/drawApp/lineScene.ts +++ b/src/drawApp/lineScene.ts @@ -161,10 +161,10 @@ import { import { errorNotify, successNotify } from 'src/utils/CommonNotify'; import { removeAllTrain } from 'src/api/Simulation'; import { ApiError } from 'src/boot/axios'; -import { IbpBox } from 'src/graphics/ibpBox/IbpBox'; -import { PslBox } from 'src/graphics/pslBox/PslBox'; -import { PslBoxOperateInteraction } from './graphics/PslBoxInteraction'; -import { IbpBoxOperateInteraction } from './graphics/IbpBoxInteraction'; +import { IbpBox,IbpBoxTemplate } from 'src/graphics/ibpBox/IbpBox'; +import { PslBox,PslBoxTemplate } from 'src/graphics/pslBox/PslBox'; +import { PslBoxData, PslBoxOperateInteraction } from './graphics/PslBoxInteraction'; +import { IbpBoxData, IbpBoxOperateInteraction } from './graphics/IbpBoxInteraction'; const showOptions: MenuItemOptions = { name: '显示控制', @@ -280,6 +280,8 @@ export function initLineScene(lineApp: IGraphicApp, sceneName: string) { new SpksSwitchTemplate(new SpksSwitchData()), new GatedBoxTemplate(new GatedBoxData()), new EsbButtonTemplate(new EsbButtonData(), new EsbButtonState()), + new IbpBoxTemplate(new IbpBoxData()), + new PslBoxTemplate(new PslBoxData()), new TransponderTemplate(new TransponderData(), new TransponderState()), new SlopeKiloMarkerTemplate(new SlopeKiloMarkerData()), // new LinkTemplate(new LinkData()), @@ -598,6 +600,12 @@ export async function loadLineDatas(): Promise { storage.autoReturnBoxs.forEach((autoReturnBox) => { datas.push(new AutoReturnBoxData(autoReturnBox)); }); + storage.ibpBoxs.forEach((ibpBox) => { + datas.push(new IbpBoxData(ibpBox)); + }); + storage.pslBoxs.forEach((pslBox) => { + datas.push(new PslBoxData(pslBox)); + }); // const linkIdGenerator = new IdGenerator(Link.Type); // storage.CalculateLink.forEach((link) => { // const g = new LinkData(link);