From 07b6ede1df1ad0fb25f6c991b39cbe7b59b843ed Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 3 Jul 2023 16:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E8=B7=AF=E5=9B=BE=E8=BD=A6=E6=AC=A1?= =?UTF-8?q?=E7=AA=97=E5=92=8C=E8=AE=A1=E8=BD=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/lineApp.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/drawApp/lineApp.ts b/src/drawApp/lineApp.ts index 2ebdd59..b5ad768 100644 --- a/src/drawApp/lineApp.ts +++ b/src/drawApp/lineApp.ts @@ -32,6 +32,16 @@ import { toUint8Array } from 'js-base64'; import { getWebsocketUrl } from 'src/configs/UrlManage'; import { getJwtToken } from 'src/configs/TokenManage'; import { state } from 'src/protos/ws_message'; +import { + AxleCounting, + AxleCountingTemplate, +} from 'src/graphics/axleCounting/AxleCounting'; +import { AxleCountingData } from './graphics/AxleCountingInteraction'; +import { + TrainWindow, + TrainWindowTemplate, +} from 'src/graphics/trainWindow/TrainWindow'; +import { TrainWindowData } from './graphics/TrainWindowInteraction'; let lineApp: GraphicApp | null = null; let msgBroker: AppWsMsgBroker | null = null; @@ -59,6 +69,8 @@ export function initLineApp(dom: HTMLElement): GraphicApp { new StationTemplate(new StationData(), new StationState()), new TurnoutTemplate(new TurnoutData()), new SectionTemplate(new SectionData()), + new AxleCountingTemplate(new AxleCountingData()), + new TrainWindowTemplate(new TrainWindowData()), ]; lineApp.registerGraphicTemplates(...graphicTemplate); lineApp.setOptions({ @@ -113,8 +125,28 @@ export async function loadLineDatas(app: GraphicApp) { storage.section.forEach((section) => { datas.push(new SectionData(section)); }); + storage.axleCountings.forEach((axleCounting) => { + datas.push(new AxleCountingData(axleCounting)); + }); + storage.trainWindows.forEach((trainWindow) => { + datas.push(new TrainWindowData(trainWindow)); + }); await app.loadGraphic(datas); + //隐藏计轴--和车次窗 + const axleCountings = app.queryStore.queryByType( + AxleCounting.Type + ); + axleCountings.forEach((axleCounting) => { + axleCounting.visible = false; + }); + const trainWindows = app.queryStore.queryByType( + TrainWindow.Type + ); + trainWindows.forEach((trainWindow) => { + trainWindow.visible = false; + }); + StompCli.new({ wsUrl: `${getWebsocketUrl()}`, token: getJwtToken() as string,