Squashed commit of the following:
All checks were successful
CI / Docker-Build (push) Successful in 1m49s

commit 2e3fc1a1f2
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Tue May 7 15:12:28 2024 +0800

    切换列车驾驶台重新加载(订阅路径变)

commit a337216236
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Tue May 7 13:09:16 2024 +0800

    列车驾驶台加对应列车索引+生成继电器时加是否覆盖之前的采集驱动数据
This commit is contained in:
joylink_zhaoerwei 2024-05-07 15:16:37 +08:00
parent b368560398
commit 05dd848aba

View File

@ -7,6 +7,7 @@ import { errorNotify } from 'src/utils/CommonNotify';
import { request } from 'src/protos/request'; import { request } from 'src/protos/request';
import { TccHandle } from 'src/graphics/tccHandle/TccHandle'; import { TccHandle } from 'src/graphics/tccHandle/TccHandle';
import { TccKey } from 'src/graphics/tccKey/TccKey'; import { TccKey } from 'src/graphics/tccKey/TccKey';
import { IGraphicApp } from 'jl-graphic';
export const useTccStore = defineStore('tcc', { export const useTccStore = defineStore('tcc', {
state: () => ({ state: () => ({
@ -23,12 +24,8 @@ export const useTccStore = defineStore('tcc', {
getTccScene() { getTccScene() {
const lineApp = getLineApp(); const lineApp = getLineApp();
if (!lineApp) throw Error('未初始化app'); if (!lineApp) throw Error('未初始化app');
try { lineApp.removeScene('tcc');
return lineApp.getScene('tcc'); return initTccScene(lineApp, 'tcc');
} catch (error) {
const tccScene = initTccScene(lineApp, 'tcc');
return tccScene;
}
}, },
setTccParam(tccId: number, trainControlMapId: number) { setTccParam(tccId: number, trainControlMapId: number) {
this.tccId = tccId; this.tccId = tccId;
@ -42,9 +39,9 @@ export const useTccStore = defineStore('tcc', {
}, },
onMouseUpFromTccHandle() { onMouseUpFromTccHandle() {
const simulationId = useLineStore().simulationId; const simulationId = useLineStore().simulationId;
const tccHandle = this.getTccScene().queryStore.queryById<TccHandle>( const tccHandle = (getLineApp() as IGraphicApp)
this.tccHandleId .getScene('tcc')
); .queryStore.queryById<TccHandle>(this.tccHandleId);
if (!simulationId) return; if (!simulationId) return;
const handleVal = Number( const handleVal = Number(
(-(tccHandle._tccHandle.y / 144) * 100).toFixed() (-(tccHandle._tccHandle.y / 144) * 100).toFixed()
@ -62,9 +59,9 @@ export const useTccStore = defineStore('tcc', {
}); });
}, },
onMouseUpFromTccKeyDir() { onMouseUpFromTccKeyDir() {
const tccKeyDir = this.getTccScene().queryStore.queryById<TccKey>( const tccKeyDir = (getLineApp() as IGraphicApp)
this.tccKeyDirId .getScene('tcc')
); .queryStore.queryById<TccKey>(this.tccKeyDirId);
let position = 0; let position = 0;
switch (tccKeyDir._tccKey.rotation) { switch (tccKeyDir._tccKey.rotation) {
case Math.PI / 4: case Math.PI / 4: