Merge branch 'master' of https://git.code.tencent.com/beijing-rtss-test/bj-rtss-client
This commit is contained in:
commit
664a085d92
@ -105,7 +105,7 @@ export async function setSwitchPosition(data: SetSwitchParams) {
|
||||
}
|
||||
|
||||
export interface IbpButtonOperationParams {
|
||||
buttonCode: string;
|
||||
buttonId: string;
|
||||
down: boolean;
|
||||
mapId: number;
|
||||
simulationId: string;
|
||||
@ -131,7 +131,7 @@ export interface IbpKeyOperationParams {
|
||||
mapId: number;
|
||||
stationId: string;
|
||||
gear: number;
|
||||
keyCode: string;
|
||||
keyId: string;
|
||||
}
|
||||
|
||||
export async function ibpKeyOperation(params: IbpKeyOperationParams) {
|
||||
@ -142,7 +142,7 @@ export function checkMapData(data: { mapProto: string }) {
|
||||
return api.post(`${UriBase}/check/data`, data);
|
||||
}
|
||||
|
||||
export interface SimulationIem {
|
||||
export interface SimulationItem {
|
||||
mapId: number;
|
||||
projectId: number;
|
||||
simulationId: string;
|
||||
@ -155,7 +155,7 @@ export interface SimulationIem {
|
||||
* @param
|
||||
* @returns
|
||||
*/
|
||||
export async function getSimulationList(): Promise<Array<SimulationIem>> {
|
||||
export async function getSimulationList(): Promise<Array<SimulationItem>> {
|
||||
const response = await api.get(`${UriBase}/list`);
|
||||
return response.data;
|
||||
}
|
||||
@ -171,7 +171,7 @@ export interface createByProject {
|
||||
*/
|
||||
export async function createSimulationByProject(
|
||||
data: createByProject
|
||||
): Promise<SimulationIem> {
|
||||
): Promise<SimulationItem> {
|
||||
const response = await api.post(`${UriBase}/createByProject`, data);
|
||||
return response.data;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ export function useFormData<T extends GraphicDataBase>(
|
||||
});
|
||||
|
||||
function onUpdate() {
|
||||
const graphic = app.selectedGraphics[0];
|
||||
const graphic = app.queryStore.queryById(data.id);
|
||||
if (graphic) {
|
||||
app.updateGraphicAndRecord(graphic, toRaw(data));
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ import {
|
||||
deleteStationRelateDevice,
|
||||
loadStationRelateDeviceList,
|
||||
RelateDevicelistItem,
|
||||
} from 'src/drawApp/thApp';
|
||||
} from 'src/drawApp/commonApp';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
|
||||
const drawStore = useDrawStore();
|
||||
|
@ -26,6 +26,14 @@
|
||||
@update:model-value="onUpdate"
|
||||
label="右边关联的集中站"
|
||||
/>
|
||||
<q-toggle
|
||||
v-model="
|
||||
concentrationDividingLineModel.isOtherLineConcentrationDividingLine
|
||||
"
|
||||
label="是否与其它线的边界处"
|
||||
emit-value
|
||||
@update:model-value="onUpdate"
|
||||
/>
|
||||
<q-list bordered separator class="rounded-borders">
|
||||
<q-item
|
||||
v-for="sectionRelation in sectionRelations"
|
||||
@ -74,6 +82,7 @@ const sectionRelations = computed(() => {
|
||||
enum devicePort {
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
}
|
||||
const concentrationDividingLine =
|
||||
drawStore.selectedGraphic as ConcentrationDividingLine;
|
||||
@ -108,7 +117,7 @@ onMounted(() => {
|
||||
.queryStore.queryByType<Station>(Station.Type);
|
||||
centralizedStations.value = [];
|
||||
stations.forEach((station) => {
|
||||
if (station.datas.concentrationStations) {
|
||||
if (station.datas.concentrationStations || station.datas.depots) {
|
||||
centralizedStations.value.push({
|
||||
label: station.datas.stationName,
|
||||
value: station.datas.id,
|
||||
|
@ -13,6 +13,7 @@ import {
|
||||
createIbpRelateDevice,
|
||||
RelateDevicelistItem,
|
||||
} from 'src/drawApp/ibpDrawApp';
|
||||
import { IbpLight } from 'src/graphics/ibpLight/IbpLight';
|
||||
|
||||
defineExpose({ editRelateDevices });
|
||||
|
||||
@ -42,12 +43,13 @@ watch(
|
||||
() => ibpDrawStore.selectedGraphics,
|
||||
(val) => {
|
||||
if (val && val.length > 0 && clickIndex !== null) {
|
||||
const selectFilter = ibpDrawStore.selectedGraphics?.filter(
|
||||
(g) =>
|
||||
g.type == IBPButton.Type ||
|
||||
g.type == IbpAlarm.Type ||
|
||||
g.type == IbpKey.Type
|
||||
) as JlGraphic[];
|
||||
const selectFilter = ibpDrawStore.selectedGraphics!.filter(
|
||||
(g): g is JlGraphic =>
|
||||
g instanceof IBPButton ||
|
||||
g instanceof IbpAlarm ||
|
||||
g instanceof IbpKey ||
|
||||
g instanceof IbpLight
|
||||
);
|
||||
selectGraphic.push(...selectFilter);
|
||||
selectGraphic = Array.from(new Set(selectGraphic));
|
||||
ibpDrawStore.getDrawApp().updateSelected(...selectGraphic);
|
||||
|
@ -79,7 +79,10 @@ const screenDoorConfig = ref<{
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (loadScreenDoorConfig() == undefined) {
|
||||
if (
|
||||
loadScreenDoorConfig() == undefined ||
|
||||
loadScreenDoorConfig().screenDoorGroupList.length == 0
|
||||
) {
|
||||
const stopPositions = drawStore
|
||||
.getDrawApp()
|
||||
.queryStore.queryByType<StopPosition>(StopPosition.Type);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { QForm } from 'quasar';
|
||||
import { Section } from 'src/graphics/section/Section';
|
||||
import { Section, DevicePort } from 'src/graphics/section/Section';
|
||||
import { Turnout } from 'src/graphics/turnout/Turnout';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
@ -58,45 +58,36 @@ async function onSubmit() {
|
||||
) => {
|
||||
if (visited.includes(current.datas.id)) return;
|
||||
visited.push(current.datas.id);
|
||||
if (current instanceof Section) {
|
||||
[
|
||||
[current.datas.paRef?.id, 'A'],
|
||||
[current.datas.pbRef?.id, 'B'],
|
||||
]
|
||||
.filter((item): item is [string, 'A' | 'B'] => !!item[0])
|
||||
.forEach(([id, port]) => {
|
||||
const target = current.queryStore.queryById<Section | Turnout>(id);
|
||||
if (target instanceof Turnout) {
|
||||
queue.push({
|
||||
node: target,
|
||||
runningDirection,
|
||||
});
|
||||
} else {
|
||||
const isPortDiffrent =
|
||||
(port === 'B' && target.datas.paRef?.id === current.datas.id) ||
|
||||
(port === 'A' && target.datas.pbRef?.id === current.datas.id);
|
||||
queue.push({
|
||||
node: target,
|
||||
runningDirection: isPortDiffrent
|
||||
? runningDirection
|
||||
: reverseDirection(runningDirection),
|
||||
});
|
||||
}
|
||||
[
|
||||
current.getConnectElement(DevicePort.A),
|
||||
current.getConnectElement(DevicePort.B),
|
||||
].forEach((item, idx) => {
|
||||
if (!item) return;
|
||||
const { g, port } = item;
|
||||
if (g instanceof Turnout) {
|
||||
if (port === DevicePort.C) return;
|
||||
queue.push({
|
||||
node: g,
|
||||
runningDirection,
|
||||
});
|
||||
} else {
|
||||
const isPortDiffrent =
|
||||
(idx === 0 && port === DevicePort.B) ||
|
||||
(idx === 1 && port === DevicePort.A);
|
||||
const flip = current instanceof Section && !isPortDiffrent;
|
||||
queue.push({
|
||||
node: g,
|
||||
runningDirection: flip
|
||||
? reverseDirection(runningDirection)
|
||||
: runningDirection,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (current instanceof Section) {
|
||||
const data = current.datas.clone();
|
||||
data.normalRunningDirection = runningDirection;
|
||||
data.direction = direction.value;
|
||||
current.updateData(data);
|
||||
} else {
|
||||
[current.datas.paRef?.id, current.datas.pbRef?.id]
|
||||
.filter((id): id is string => !!id)
|
||||
.forEach((id) => {
|
||||
const target = current.queryStore.queryById<Section | Turnout>(id);
|
||||
queue.push({
|
||||
node: target,
|
||||
runningDirection,
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -46,7 +46,7 @@ import {
|
||||
creatStationRelateDevice,
|
||||
editStationRelateDevice,
|
||||
RelateDevicelistItem,
|
||||
} from 'src/drawApp/thApp';
|
||||
} from 'src/drawApp/commonApp';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import SelectConfigUtils from 'src/components/common/SelectConfigUtils.vue';
|
||||
|
||||
|
@ -402,22 +402,13 @@ const signalTypeOptions = [
|
||||
value: signalModel.HBU_DU,
|
||||
},
|
||||
];
|
||||
const signalTypeMap = new Map<graphicData.Signal.Model, string>([
|
||||
[signalModel.HL, '红绿'],
|
||||
[signalModel.HLU_FU, '红绿黄,封黄灯,无引导'],
|
||||
[signalModel.HLU_DU_YY, '红绿黄,不封灯,有单黄,带引导'],
|
||||
[signalModel.HLU_YY, '红绿黄,不封灯,无单黄,带引导'],
|
||||
[signalModel.HLU_FL_DU_YY, '红绿黄,封绿灯,有单黄,带引导'],
|
||||
[signalModel.HLU_DU, '红绿黄,不封灯,有单黄,无引导'],
|
||||
[signalModel.AB, '蓝白'],
|
||||
[signalModel.HBU_DU, '红白黄,不封灯,有单黄,无引导'],
|
||||
]);
|
||||
function setSignalType() {
|
||||
if (signalType.value) {
|
||||
if (signalType.value >= 0) {
|
||||
const showType = signalTypeOptions.find(
|
||||
(item) => item.value == signalType.value
|
||||
)?.label;
|
||||
$q.dialog({
|
||||
message: `确定批量设置选中信号机的类型为【${signalTypeMap.get(
|
||||
signalType.value
|
||||
)}】吗?`,
|
||||
message: `确定批量设置选中信号机的类型为【${showType}】吗?`,
|
||||
cancel: true,
|
||||
}).onOk(() => {
|
||||
drawStore.selectedGraphics?.forEach((signal) => {
|
||||
|
@ -13,13 +13,6 @@
|
||||
label="id"
|
||||
hint=""
|
||||
/>
|
||||
<QInput
|
||||
outlined
|
||||
readonly
|
||||
v-model="platformState.index"
|
||||
label="索引"
|
||||
hint=""
|
||||
/>
|
||||
<QInput
|
||||
outlined
|
||||
readonly
|
||||
@ -39,43 +32,47 @@
|
||||
disable
|
||||
/>
|
||||
</QItem>
|
||||
<QSeparator class="q-mt-sm" />
|
||||
<QItemLabel header>Spks继电器状态</QItemLabel>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
v-for="item in platformState.spksState"
|
||||
:key="item.id"
|
||||
dense
|
||||
v-model="item.xh"
|
||||
:label="item.code"
|
||||
disable
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator class="q-mt-sm" />
|
||||
<QItemLabel header
|
||||
>门控箱继电器状态 ({{ platformState.mkxJState.code }})</QItemLabel
|
||||
>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
v-for="reply in platformState.mkxJState.replyState"
|
||||
v-model="reply.xh"
|
||||
:label="reply.code"
|
||||
:key="reply.id"
|
||||
dense
|
||||
disable
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<template v-if="isSpksInfoShow">
|
||||
<QSeparator class="q-mt-sm" />
|
||||
<QItemLabel header>Spks继电器状态</QItemLabel>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
v-for="item in platformState.spksState"
|
||||
:key="item.id"
|
||||
dense
|
||||
v-model="item.xh"
|
||||
:label="item.code"
|
||||
disable
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
<template v-if="isMkxInfoShow">
|
||||
<QSeparator class="q-mt-sm" />
|
||||
<QItemLabel header
|
||||
>门控箱继电器状态 ({{ platformState.mkxJState.code }})</QItemLabel
|
||||
>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
v-for="reply in platformState.mkxJState.replyState"
|
||||
v-model="reply.xh"
|
||||
:label="reply.code"
|
||||
:key="reply.id"
|
||||
dense
|
||||
disable
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</QList>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useLineStore } from 'src/stores/line-store';
|
||||
import { ref, watch, watchEffect, onUnmounted } from 'vue';
|
||||
import { ref, watch, watchEffect, onUnmounted, computed } from 'vue';
|
||||
import { Platform } from 'src/graphics/platform/Platform';
|
||||
import { state } from 'src/protos/device_state';
|
||||
import { PlatformState } from 'src/drawApp/graphics/PlatformInteraction';
|
||||
@ -83,14 +80,12 @@ import { PlatformState } from 'src/drawApp/graphics/PlatformInteraction';
|
||||
const lineStore = useLineStore();
|
||||
const platformState = ref<{
|
||||
id: string;
|
||||
index: number;
|
||||
code: string;
|
||||
empj: boolean;
|
||||
spksState: state.ReplyState[];
|
||||
mkxJState: state.MkxJState;
|
||||
}>({
|
||||
id: '',
|
||||
index: 0,
|
||||
code: '',
|
||||
empj: false,
|
||||
spksState: [],
|
||||
@ -126,10 +121,25 @@ watch(
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const isSpksInfoShow = computed(() => {
|
||||
const selected = lineStore.selectedGraphics;
|
||||
if (!selected) return;
|
||||
const platform = selected[0] as Platform;
|
||||
console.log(platform.states);
|
||||
return platform.states.spksState?.length !== 0;
|
||||
});
|
||||
|
||||
const isMkxInfoShow = computed(() => {
|
||||
const selected = lineStore.selectedGraphics;
|
||||
if (!selected) return;
|
||||
const platform = selected[0] as Platform;
|
||||
return platform.states.mkxJState?.replyState?.length !== 0;
|
||||
});
|
||||
|
||||
function setPlatformState(platform: Platform) {
|
||||
platformState.value = {
|
||||
id: platform.datas.id,
|
||||
index: platform.datas.index,
|
||||
code: platform.datas.code,
|
||||
empj: platform.states.empj ?? false,
|
||||
spksState: platform.states.spksState ?? [],
|
||||
|
@ -1,34 +1,37 @@
|
||||
<template>
|
||||
<q-card flat bordered>
|
||||
<q-card-section>
|
||||
<q-card-section class="row justify-between items-center q-pb-none">
|
||||
<div class="text-h6">车站状态</div>
|
||||
<q-btn color="primary" @click="openIbp">打开IBP</q-btn>
|
||||
</q-card-section>
|
||||
<q-separator inset />
|
||||
<q-form>
|
||||
<q-input outlined readonly v-model="stationState.id" label="id" hint="" />
|
||||
<q-input
|
||||
outlined
|
||||
readonly
|
||||
v-model="stationState.index"
|
||||
label="索引"
|
||||
hint=""
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
readonly
|
||||
v-model.number="stationState.code"
|
||||
label="名称"
|
||||
/>
|
||||
</q-form>
|
||||
<q-card-section>
|
||||
<q-form>
|
||||
<q-input
|
||||
outlined
|
||||
readonly
|
||||
v-model="stationState.id"
|
||||
label="id"
|
||||
hint=""
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
readonly
|
||||
v-model.number="stationState.code"
|
||||
label="名称"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useLineStore } from 'src/stores/line-store';
|
||||
import { ref, watch, onMounted } from 'vue';
|
||||
import { ref, watch, onMounted, computed } from 'vue';
|
||||
import { Station } from 'src/graphics/station/Station';
|
||||
import { useIbpStore } from 'src/stores/ibp-store';
|
||||
|
||||
const lineStore = useLineStore();
|
||||
const stationState = ref({ id: '', index: 0, code: '' });
|
||||
const stationState = ref({ id: '', code: '' });
|
||||
|
||||
watch(
|
||||
() => lineStore.selectedGraphics,
|
||||
@ -38,28 +41,26 @@ watch(
|
||||
} else {
|
||||
stationState.value = {
|
||||
id: '',
|
||||
index: 0,
|
||||
code: '',
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function openIbp() {
|
||||
const selected = lineStore.selectedGraphics;
|
||||
if (!selected) return;
|
||||
const station = selected[0] as Station;
|
||||
if (!station) return;
|
||||
useIbpStore().openIbpScene(station);
|
||||
}
|
||||
|
||||
function setStationState(station: Station) {
|
||||
stationState.value = {
|
||||
id: station.datas.id,
|
||||
index: station.datas.index,
|
||||
code: station.datas.code,
|
||||
};
|
||||
}
|
||||
function submitState() {
|
||||
if (lineStore.simulationId) {
|
||||
}
|
||||
}
|
||||
function onReset() {
|
||||
if (lineStore.selectedGraphics) {
|
||||
setStationState(lineStore.selectedGraphics[0] as Station);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (lineStore.selectedGraphics) {
|
||||
|
@ -255,6 +255,7 @@ export function loadCommonDrawDatas(
|
||||
kilometerConvertList = storage.kilometerConvertList;
|
||||
sectionCodePointList = storage.sectionCodePointList;
|
||||
otherLineList = storage.otherLineList;
|
||||
refDevicesList = storage.stationRelateDeviceList;
|
||||
storage.Platforms.forEach((platform) => {
|
||||
datas.push(new PlatformData(platform));
|
||||
});
|
||||
@ -318,10 +319,7 @@ export function loadCommonDrawDatas(
|
||||
return datas;
|
||||
}
|
||||
|
||||
export function saveCommonDrawDatas(
|
||||
app: IDrawApp,
|
||||
refDevicesList?: graphicData.StationRelateDevice[]
|
||||
) {
|
||||
export function saveCommonDrawDatas(app: IDrawApp) {
|
||||
const storage = new graphicData.RtssGraphicStorage();
|
||||
const canvasData = app.canvas.saveData();
|
||||
storage.canvas = new graphicData.Canvas({
|
||||
@ -398,15 +396,13 @@ export function saveCommonDrawDatas(
|
||||
);
|
||||
}
|
||||
});
|
||||
if (refDevicesList) {
|
||||
storage.stationRelateDeviceList = refDevicesList;
|
||||
}
|
||||
storage.UniqueIdPrefix = UniqueIdPrefix;
|
||||
storage.screenDoorConfig = screenDoorConfig;
|
||||
storage.generateAxleCountingConfig = generateAxleCountingConfig;
|
||||
storage.kilometerConvertList = kilometerConvertList;
|
||||
storage.sectionCodePointList = sectionCodePointList;
|
||||
storage.otherLineList = otherLineList;
|
||||
storage.stationRelateDeviceList = refDevicesList;
|
||||
return storage;
|
||||
}
|
||||
|
||||
@ -562,3 +558,59 @@ export function editOtherLine(row: graphicData.OtherLine) {
|
||||
export function deleteOtherLine(index: number) {
|
||||
otherLineList.splice(index, 1);
|
||||
}
|
||||
|
||||
//关联设备列表的增删改查
|
||||
export interface RelateDevicelistItem {
|
||||
deviceType: graphicData.RelatedRef.DeviceType | undefined;
|
||||
code: string;
|
||||
combinationtypes: {
|
||||
code: string;
|
||||
refDevices: string[];
|
||||
refDevicesCode?: string[];
|
||||
expanded?: boolean;
|
||||
}[];
|
||||
}
|
||||
|
||||
let refDevicesList: graphicData.StationRelateDevice[] = [];
|
||||
export function loadStationRelateDeviceList() {
|
||||
return refDevicesList;
|
||||
}
|
||||
|
||||
export function creatStationRelateDevice(row: graphicData.StationRelateDevice) {
|
||||
refDevicesList.push(row);
|
||||
}
|
||||
|
||||
export function editStationRelateDevice(
|
||||
editRow: RelateDevicelistItem,
|
||||
newData: graphicData.StationRelateDevice
|
||||
) {
|
||||
for (let i = 0; i < refDevicesList.length; i++) {
|
||||
if (
|
||||
refDevicesList[i].deviceType == editRow.deviceType &&
|
||||
refDevicesList[i].code == editRow.code
|
||||
) {
|
||||
refDevicesList[i] = newData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function deleteStationRelateDevice(row: RelateDevicelistItem) {
|
||||
for (let i = 0; i < refDevicesList.length; i++) {
|
||||
if (
|
||||
refDevicesList[i].deviceType == row.deviceType &&
|
||||
refDevicesList[i].code == row.code
|
||||
) {
|
||||
refDevicesList.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function deleteStationRelateDeviceByType(
|
||||
deviceType: graphicData.RelatedRef.DeviceType
|
||||
) {
|
||||
refDevicesList = refDevicesList.filter(
|
||||
(item) => item.deviceType !== deviceType
|
||||
);
|
||||
}
|
||||
|
@ -59,6 +59,12 @@ export class ConcentrationDividingLineData
|
||||
set nodeConWithSecs(nodes: graphicData.NodeConWithSec[]) {
|
||||
this.data.nodeConWithSecs = nodes;
|
||||
}
|
||||
get isOtherLineConcentrationDividingLine(): boolean {
|
||||
return this.data.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
set isOtherLineConcentrationDividingLine(v: boolean) {
|
||||
this.data.isOtherLineConcentrationDividingLine = v;
|
||||
}
|
||||
clone(): ConcentrationDividingLineData {
|
||||
return new ConcentrationDividingLineData(this.data.cloneMessage());
|
||||
}
|
||||
|
@ -136,23 +136,23 @@ export class IbpButtonInteraction extends GraphicInteractionPlugin<IBPButton> {
|
||||
const g = e.target as IBPButton;
|
||||
const changeState = useIbpStore().ibpButtonOperation;
|
||||
if (g.datas.isSelfReset) {
|
||||
changeState(g.datas.code, true);
|
||||
changeState(g.datas.id, true);
|
||||
} else {
|
||||
changeState(g.datas.code, !g.state.down);
|
||||
changeState(g.datas.id, !g.state.down);
|
||||
}
|
||||
}
|
||||
onMouseUp(e: FederatedMouseEvent) {
|
||||
const changeState = useIbpStore().ibpButtonOperation;
|
||||
const g = e.target as IBPButton;
|
||||
if (g.datas.isSelfReset) {
|
||||
changeState(g.datas.code, false);
|
||||
changeState(g.datas.id, false);
|
||||
}
|
||||
}
|
||||
onMouseLeave(e: FederatedMouseEvent) {
|
||||
const changeState = useIbpStore().ibpButtonOperation;
|
||||
const g = e.target as IBPButton;
|
||||
if (g.datas.isSelfReset) {
|
||||
changeState(g.datas.code, false);
|
||||
changeState(g.datas.id, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +101,6 @@ export class IbpKeyInteraction extends GraphicInteractionPlugin<IbpKey> {
|
||||
onClick(e: FederatedMouseEvent): void {
|
||||
const g = e.target as IbpKey;
|
||||
const changeState = useIbpStore().ibpKeyOperation;
|
||||
changeState(g.datas.code, g.state.gear === 0 ? 1 : 0);
|
||||
changeState(g.datas.id, g.state.gear === 0 ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
@ -245,18 +245,23 @@ export class SectionOperateInteraction extends GraphicInteractionPlugin<Section>
|
||||
);
|
||||
let AKm;
|
||||
let BKm;
|
||||
if (relations.length == 2) {
|
||||
relations.forEach((item) => {
|
||||
const rp = item.getRelationParam(section);
|
||||
const other = item.getOtherGraphic(section) as AxleCounting;
|
||||
relations.forEach((item) => {
|
||||
const rp = item.getRelationParam(section);
|
||||
const other = item.getOtherGraphic(section) as AxleCounting;
|
||||
if (
|
||||
(other.datas.axleCountingRef.length > 1 &&
|
||||
other.datas.type ==
|
||||
graphicData.AxleCounting.TypeDetectionPoint.AxleCounting) ||
|
||||
other.datas.axleCountingRef.length == 1
|
||||
) {
|
||||
if (rp.getParam() == 'A') {
|
||||
AKm = other.datas.kilometerSystem;
|
||||
}
|
||||
if (rp.getParam() == 'B') {
|
||||
BKm = other.datas.kilometerSystem;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
const d = getKmDistance(BKm, AKm);
|
||||
Dialog.create({
|
||||
title: '创建列车',
|
||||
|
@ -121,7 +121,15 @@ export class TurnoutOperationPlugin extends GraphicInteractionPlugin<Turnout> {
|
||||
);
|
||||
const findAc = relations.find((item) => {
|
||||
const rp = item.getRelationParam(turnout);
|
||||
return rp.getParam() == port;
|
||||
const orp = item.getOtherRelationParam(turnout as Turnout);
|
||||
const ac = orp.g as AxleCounting;
|
||||
return (
|
||||
rp.getParam() == port &&
|
||||
((ac.datas.axleCountingRef.length > 1 &&
|
||||
ac.datas.type ==
|
||||
graphicData.AxleCounting.TypeDetectionPoint.AxleCounting) ||
|
||||
ac.datas.axleCountingRef.length == 1)
|
||||
);
|
||||
});
|
||||
const oKm = turnout.datas.kilometerSystem;
|
||||
let pKm;
|
||||
|
@ -124,7 +124,6 @@ export async function loadThDrawDatas(): Promise<IGraphicStorage> {
|
||||
storage.esbButtons.forEach((esbButton) => {
|
||||
datas.push(new EsbButtonData(esbButton));
|
||||
});
|
||||
refDevicesList = storage.stationRelateDeviceList;
|
||||
return Promise.resolve({
|
||||
canvasProperty: storage.canvas,
|
||||
datas: datas,
|
||||
@ -137,7 +136,7 @@ export async function loadThDrawDatas(): Promise<IGraphicStorage> {
|
||||
}
|
||||
|
||||
export function saveThDrawDatas(app: IDrawApp) {
|
||||
const storage = saveCommonDrawDatas(app, refDevicesList);
|
||||
const storage = saveCommonDrawDatas(app);
|
||||
console.log(storage, '保存数据');
|
||||
const graphics = app.queryStore.getAllGraphics();
|
||||
graphics.forEach((g) => {
|
||||
@ -157,53 +156,3 @@ export function saveThDrawDatas(app: IDrawApp) {
|
||||
const base64 = fromUint8Array(storage.serialize());
|
||||
return base64;
|
||||
}
|
||||
|
||||
//关联设备列表的增删改查
|
||||
export interface RelateDevicelistItem {
|
||||
deviceType: graphicData.RelatedRef.DeviceType | undefined;
|
||||
code: string;
|
||||
combinationtypes: {
|
||||
code: string;
|
||||
refDevices: string[];
|
||||
refDevicesCode?: string[];
|
||||
expanded?: boolean;
|
||||
}[];
|
||||
}
|
||||
|
||||
let refDevicesList: graphicData.StationRelateDevice[] = [];
|
||||
export function loadStationRelateDeviceList() {
|
||||
return refDevicesList;
|
||||
}
|
||||
|
||||
export function creatStationRelateDevice(row: graphicData.StationRelateDevice) {
|
||||
refDevicesList.push(row);
|
||||
thDrawApp?.emit('postdataloaded');
|
||||
}
|
||||
|
||||
export function editStationRelateDevice(
|
||||
editRow: RelateDevicelistItem,
|
||||
newData: graphicData.StationRelateDevice
|
||||
) {
|
||||
for (let i = 0; i < refDevicesList.length; i++) {
|
||||
if (
|
||||
refDevicesList[i].deviceType == editRow.deviceType &&
|
||||
refDevicesList[i].code == editRow.code
|
||||
) {
|
||||
refDevicesList[i] = newData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
thDrawApp?.emit('postdataloaded');
|
||||
}
|
||||
|
||||
export function deleteStationRelateDevice(row: RelateDevicelistItem) {
|
||||
for (let i = 0; i < refDevicesList.length; i++) {
|
||||
if (
|
||||
refDevicesList[i].deviceType == row.deviceType &&
|
||||
refDevicesList[i].code == row.code
|
||||
) {
|
||||
refDevicesList.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +173,6 @@ export async function loadZdwxDrawDatas(): Promise<IGraphicStorage> {
|
||||
storage.autoReturnBoxs.forEach((autoReturnBox) => {
|
||||
datas.push(new AutoReturnBoxData(autoReturnBox));
|
||||
});
|
||||
refDevicesList = storage.stationRelateDeviceList;
|
||||
return Promise.resolve({
|
||||
canvasProperty: storage.canvas,
|
||||
datas: datas,
|
||||
@ -186,7 +185,7 @@ export async function loadZdwxDrawDatas(): Promise<IGraphicStorage> {
|
||||
}
|
||||
|
||||
export function saveZdwxDrawDatas(app: IDrawApp) {
|
||||
const storage = saveCommonDrawDatas(app, refDevicesList);
|
||||
const storage = saveCommonDrawDatas(app);
|
||||
console.log(storage, '保存数据');
|
||||
const graphics = app.queryStore.getAllGraphics();
|
||||
graphics.forEach((g) => {
|
||||
@ -219,17 +218,3 @@ export function saveZdwxDrawDatas(app: IDrawApp) {
|
||||
const base64 = fromUint8Array(storage.serialize());
|
||||
return base64;
|
||||
}
|
||||
|
||||
//关联设备列表的增删改查
|
||||
export interface RelateDevicelistItem {
|
||||
deviceType: graphicData.RelatedRef.DeviceType | undefined;
|
||||
code: string;
|
||||
combinationtypes: {
|
||||
code: string;
|
||||
refDevices: string[];
|
||||
refDevicesCode?: string[];
|
||||
expanded?: boolean;
|
||||
}[];
|
||||
}
|
||||
|
||||
let refDevicesList: graphicData.StationRelateDevice[] = [];
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Graphics } from 'pixi.js';
|
||||
import { calculateMirrorPoint } from 'src/jl-graphic';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { Turnout, TurnoutPort } from './turnout/Turnout';
|
||||
import { Section, SectionPort } from './section/Section';
|
||||
import { Turnout } from './turnout/Turnout';
|
||||
import { Section, DevicePort } from './section/Section';
|
||||
import { TrainWindow } from './trainWindow/TrainWindow';
|
||||
import { AxleCounting } from './axleCounting/AxleCounting';
|
||||
import { Station } from './station/Station';
|
||||
@ -80,7 +80,7 @@ export function drawArrow(
|
||||
export function createRelatedRefProto(
|
||||
type: string,
|
||||
id: string,
|
||||
port?: TurnoutPort | SectionPort
|
||||
port?: DevicePort
|
||||
) {
|
||||
const typeMap = new Map([
|
||||
[Section.Type, graphicData.RelatedRef.DeviceType.Section],
|
||||
@ -97,11 +97,11 @@ export function createRelatedRefProto(
|
||||
id,
|
||||
});
|
||||
if (port) {
|
||||
if (port === 'A')
|
||||
if (port === DevicePort.A)
|
||||
protoData.devicePort = graphicData.RelatedRef.DevicePort.A;
|
||||
if (port === 'B')
|
||||
if (port === DevicePort.B)
|
||||
protoData.devicePort = graphicData.RelatedRef.DevicePort.B;
|
||||
if (port === 'C')
|
||||
if (port === DevicePort.C)
|
||||
protoData.devicePort = graphicData.RelatedRef.DevicePort.C;
|
||||
}
|
||||
return protoData;
|
||||
|
@ -15,28 +15,17 @@ import {
|
||||
AxleCounting,
|
||||
AxleCountingTemplate,
|
||||
} from './AxleCounting';
|
||||
import { Section, SectionPort, SectionType } from '../section/Section';
|
||||
import { Turnout, TurnoutPort } from '../turnout/Turnout';
|
||||
import { Section, DevicePort, SectionType } from '../section/Section';
|
||||
import { Turnout } from '../turnout/Turnout';
|
||||
import { IRelatedRefData, createRelatedRefProto } from '../CommonGraphics';
|
||||
import { Signal } from '../signal/Signal';
|
||||
import { loadGenerateAxleCountingConfig } from 'src/drawApp/commonApp';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
|
||||
export interface IAxleCountingDrawOptions {
|
||||
newData: () => IAxleCountingData;
|
||||
}
|
||||
|
||||
enum DevicePort {
|
||||
A = 0,
|
||||
B = 1,
|
||||
C = 2,
|
||||
}
|
||||
|
||||
enum DevicePortN {
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
}
|
||||
|
||||
export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
AxleCountingTemplate,
|
||||
IAxleCountingData
|
||||
@ -74,11 +63,11 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
ps: IPoint,
|
||||
direction: number,
|
||||
graphic: Section | Turnout,
|
||||
port: TurnoutPort | SectionPort,
|
||||
port: DevicePort,
|
||||
map: Map<string, number>,
|
||||
reftype: string,
|
||||
refGraphic: Section | Turnout,
|
||||
refPort: TurnoutPort | SectionPort
|
||||
refPort: DevicePort
|
||||
) {
|
||||
const generateAxleCountingConfig = loadGenerateAxleCountingConfig();
|
||||
if (generateAxleCountingConfig?.noGenerateGroup !== undefined) {
|
||||
@ -98,8 +87,8 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
if (
|
||||
graphic.type == 'Turnout' &&
|
||||
reftype == 'Turnout' &&
|
||||
port == TurnoutPort.B &&
|
||||
refPort == TurnoutPort.B
|
||||
port == DevicePort.B &&
|
||||
refPort == DevicePort.B
|
||||
) {
|
||||
//查看生成计轴bb配置
|
||||
let hasBB = false;
|
||||
@ -155,7 +144,7 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
ps: IPoint,
|
||||
direction: number,
|
||||
graphic: Section | Turnout,
|
||||
port: TurnoutPort | SectionPort,
|
||||
port: DevicePort,
|
||||
map: Map<string, number>
|
||||
) {
|
||||
if (!map.has(`${graphic.id}-${port}`)) {
|
||||
@ -186,7 +175,9 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
});
|
||||
axleCountingRefs.forEach((axleCountingRef) => {
|
||||
map.set(
|
||||
`${axleCountingRef.id}-${DevicePortN[axleCountingRef.devicePort]}`,
|
||||
`${axleCountingRef.id}-${
|
||||
graphicData.RelatedRef.DevicePort[axleCountingRef.devicePort]
|
||||
}`,
|
||||
1
|
||||
);
|
||||
});
|
||||
@ -244,12 +235,12 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
if (axleCountingRelations.length < 2) {
|
||||
axleCountingRelations.forEach((relation) => {
|
||||
const port = relation.getRelationParam(section).param;
|
||||
let addPort = SectionPort.A;
|
||||
let addPort = DevicePort.A;
|
||||
let direction = 1;
|
||||
let axleCountingPs = ps;
|
||||
if (port == 'A') {
|
||||
axleCountingPs = pe;
|
||||
addPort = SectionPort.B;
|
||||
addPort = DevicePort.B;
|
||||
}
|
||||
if (axleCountingPs.y > height.y) {
|
||||
direction = -1;
|
||||
@ -282,8 +273,10 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
Turnout.Type
|
||||
);
|
||||
turnoutRelations.forEach((relation) => {
|
||||
const port = relation.getRelationParam(turnout).param;
|
||||
const portIndex = DevicePort[port] as unknown as number;
|
||||
const port = relation.getRelationParam(turnout).getParam<DevicePort>();
|
||||
const portIndex = Object.values(DevicePort).findIndex(
|
||||
(p) => p === port
|
||||
);
|
||||
const refTurnout = relation.getOtherGraphic<Turnout>(turnout);
|
||||
const refTurnoutPort = relation.getOtherRelationParam(turnout).param;
|
||||
const portPs = turnout.localToCanvasPoints(...points[portIndex])[
|
||||
@ -309,14 +302,16 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
AxleCounting.Type
|
||||
);
|
||||
const points = turnout.getPortPoints();
|
||||
const turnoutPort = [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C];
|
||||
const turnoutPort = [DevicePort.A, DevicePort.B, DevicePort.C];
|
||||
if (axleCountingRelations.length == 1) {
|
||||
const port = axleCountingRelations[0].getRelationParam(turnout).param;
|
||||
const otherPort = turnoutPort.filter((p) => {
|
||||
return p !== port && p;
|
||||
});
|
||||
otherPort.forEach((port) => {
|
||||
const portIndex = DevicePort[port] as unknown as number;
|
||||
const portIndex = Object.values(DevicePort).findIndex(
|
||||
(p) => p === port
|
||||
);
|
||||
const axleCountingPs1 = turnout.localToCanvasPoints(
|
||||
...points[portIndex]
|
||||
)[points[portIndex].length - 1];
|
||||
@ -330,7 +325,9 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
return p !== port[0] && p !== port[1] && p;
|
||||
});
|
||||
if (otherPort.length) {
|
||||
const portIndex = DevicePort[otherPort[0]] as unknown as number;
|
||||
const portIndex = Object.values(DevicePort).findIndex(
|
||||
(p) => p === otherPort[0]
|
||||
);
|
||||
const axleCountingPs1 = turnout.localToCanvasPoints(
|
||||
...points[portIndex]
|
||||
)[points[portIndex].length - 1];
|
||||
@ -339,8 +336,8 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
} else if (axleCountingRelations.length == 0) {
|
||||
const axleCountingPsA = turnout.localToCanvasPoints(points[0][0])[0];
|
||||
const axleCountingPsC = turnout.localToCanvasPoints(points[2][0])[0];
|
||||
this.drawAdd(axleCountingPsA, 1, turnout, TurnoutPort.A, map);
|
||||
this.drawAdd(axleCountingPsC, 1, turnout, TurnoutPort.C, map);
|
||||
this.drawAdd(axleCountingPsA, 1, turnout, DevicePort.A, map);
|
||||
this.drawAdd(axleCountingPsC, 1, turnout, DevicePort.C, map);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
calculateLineMidpoint,
|
||||
} from 'src/jl-graphic';
|
||||
import { IRelatedRefData, protoPort2Data } from '../CommonGraphics';
|
||||
import { SectionPort } from '../section/Section';
|
||||
import { DevicePort } from '../section/Section';
|
||||
|
||||
export interface ITurnoutPosRefData {
|
||||
get id(): string; //道岔的ID
|
||||
@ -100,7 +100,7 @@ export class AxleCountingSection extends JlGraphic {
|
||||
loadRelations() {
|
||||
if (this.datas?.paRef?.id) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, SectionPort.A),
|
||||
new GraphicRelationParam(this, DevicePort.A),
|
||||
new GraphicRelationParam(
|
||||
this.queryStore.queryById(this.datas.paRef.id),
|
||||
protoPort2Data(this.datas.paRef.devicePort)
|
||||
@ -109,7 +109,7 @@ export class AxleCountingSection extends JlGraphic {
|
||||
}
|
||||
if (this.datas?.pbRef?.id) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, SectionPort.B),
|
||||
new GraphicRelationParam(this, DevicePort.B),
|
||||
new GraphicRelationParam(
|
||||
this.queryStore.queryById(this.datas.pbRef.id),
|
||||
protoPort2Data(this.datas.pbRef.devicePort)
|
||||
|
@ -9,10 +9,10 @@ import {
|
||||
import { ILineGraphic } from 'src/jl-graphic/plugins/GraphicEditPlugin';
|
||||
import { SectionGraphic } from '../sectionGraphic/SectionGraphic';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { Section, SectionPort, SectionType } from '../section/Section';
|
||||
import { Section, DevicePort, SectionType } from '../section/Section';
|
||||
import { arePolylinesIntersect } from './ConcentrationDividingLineUtils';
|
||||
import { createRelatedRefProto } from '../CommonGraphics';
|
||||
import { Turnout, TurnoutPort } from '../turnout/Turnout';
|
||||
import { Turnout } from '../turnout/Turnout';
|
||||
|
||||
export interface IConcentrationDividingLineData extends GraphicData {
|
||||
get code(): string; // 编号
|
||||
@ -25,6 +25,8 @@ export interface IConcentrationDividingLineData extends GraphicData {
|
||||
set refRightStationId(v: string);
|
||||
get nodeConWithSecs(): graphicData.NodeConWithSec[]; // 集中区分割线与区段的交点
|
||||
set nodeConWithSecs(nodes: graphicData.NodeConWithSec[]);
|
||||
get isOtherLineConcentrationDividingLine(): boolean; //集中区分割线绘制在其它线的边界处
|
||||
set isOtherLineConcentrationDividingLine(v: boolean);
|
||||
clone(): IConcentrationDividingLineData;
|
||||
copyFrom(data: IConcentrationDividingLineData): void;
|
||||
eq(other: IConcentrationDividingLineData): boolean;
|
||||
@ -108,7 +110,7 @@ export class ConcentrationDividingLine
|
||||
hasNode.segment2[1],
|
||||
section.localToCanvasPoint(section.getEndPoint())
|
||||
);
|
||||
const relationParam = minA > minB ? SectionPort.B : SectionPort.A;
|
||||
const relationParam = minA > minB ? DevicePort.B : DevicePort.A;
|
||||
const portRefOtherDevice =
|
||||
relationParam == 'A' ? section.datas.paRef : section.datas.pbRef;
|
||||
if (
|
||||
@ -131,7 +133,7 @@ export class ConcentrationDividingLine
|
||||
device: refDevice,
|
||||
port: devicePort[
|
||||
portRefOtherDevice.devicePort
|
||||
] as TurnoutPort,
|
||||
] as DevicePort,
|
||||
},
|
||||
{ device: section, port: relationParam },
|
||||
]
|
||||
@ -141,7 +143,7 @@ export class ConcentrationDividingLine
|
||||
device: refDevice,
|
||||
port: devicePort[
|
||||
portRefOtherDevice.devicePort
|
||||
] as TurnoutPort,
|
||||
] as DevicePort,
|
||||
},
|
||||
];
|
||||
hasNodeSection.set(leftDevice.device.id, '1');
|
||||
@ -169,12 +171,12 @@ export class ConcentrationDividingLine
|
||||
leftSection: createRelatedRefProto(
|
||||
Section.Type,
|
||||
leftSectionId,
|
||||
SectionPort.B
|
||||
DevicePort.B
|
||||
),
|
||||
rightSection: createRelatedRefProto(
|
||||
Section.Type,
|
||||
rightSectionId,
|
||||
SectionPort.A
|
||||
DevicePort.A
|
||||
),
|
||||
})
|
||||
);
|
||||
|
@ -33,11 +33,6 @@ export enum SectionType {
|
||||
TurnoutPhysical = 2,
|
||||
}
|
||||
|
||||
export enum SectionPort {
|
||||
A = 'A',
|
||||
B = 'B',
|
||||
}
|
||||
|
||||
export interface ISectionData extends GraphicData {
|
||||
get code(): string; // 编号
|
||||
set code(v: string);
|
||||
@ -83,6 +78,12 @@ export const SectionConsts = {
|
||||
lineWidth: 5,
|
||||
};
|
||||
|
||||
export enum DevicePort {
|
||||
A = 'A',
|
||||
B = 'B',
|
||||
C = 'C',
|
||||
}
|
||||
|
||||
export class Section extends JlGraphic implements ILineGraphic {
|
||||
static Type = 'Section';
|
||||
lineGraphic: SectionGraphic;
|
||||
@ -189,6 +190,24 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
this.updateData(old);
|
||||
}
|
||||
|
||||
getConnectElement(port: DevicePort) {
|
||||
const relation = this.relationManage
|
||||
.getRelationsOfGraphic(this)
|
||||
.find(
|
||||
(relation) =>
|
||||
relation.getRelationParam(this).getParam<DevicePort>() === port &&
|
||||
(relation.getOtherGraphic(this) instanceof Section ||
|
||||
relation.getOtherGraphic(this) instanceof Turnout)
|
||||
);
|
||||
if (!relation) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
g: relation?.getOtherGraphic(this) as Section | Turnout,
|
||||
port: relation?.getOtherRelationParam(this).getParam<DevicePort>(),
|
||||
};
|
||||
}
|
||||
|
||||
/** 获取拆分逻辑区段数据 */
|
||||
getSplitPoints(count: number): IPointData[][] {
|
||||
if (this.datas.points.length !== 2) {
|
||||
@ -243,14 +262,14 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
this.queryStore.queryByType<Section>(Section.Type).forEach((section) => {
|
||||
if (section.id === this.id) return;
|
||||
|
||||
let param: SectionPort[] = [];
|
||||
let param: DevicePort[] = [];
|
||||
if (
|
||||
distance2(
|
||||
this.localToCanvasPoint(this.getStartPoint()),
|
||||
section.localToCanvasPoint(section.getStartPoint())
|
||||
) <= tolerance
|
||||
) {
|
||||
param = [SectionPort.A, SectionPort.A];
|
||||
param = [DevicePort.A, DevicePort.A];
|
||||
}
|
||||
if (
|
||||
distance2(
|
||||
@ -258,7 +277,7 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
section.localToCanvasPoint(section.getStartPoint())
|
||||
) <= tolerance
|
||||
) {
|
||||
param = [SectionPort.B, SectionPort.A];
|
||||
param = [DevicePort.B, DevicePort.A];
|
||||
}
|
||||
if (
|
||||
distance2(
|
||||
@ -266,7 +285,7 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
section.localToCanvasPoint(section.getEndPoint())
|
||||
) <= tolerance
|
||||
) {
|
||||
param = [SectionPort.A, SectionPort.B];
|
||||
param = [DevicePort.A, DevicePort.B];
|
||||
}
|
||||
if (
|
||||
distance2(
|
||||
@ -274,7 +293,7 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
section.localToCanvasPoint(section.getEndPoint())
|
||||
) <= tolerance
|
||||
) {
|
||||
param = [SectionPort.B, SectionPort.B];
|
||||
param = [DevicePort.B, DevicePort.B];
|
||||
}
|
||||
if (param.length) {
|
||||
this.relationManage.addRelation(
|
||||
@ -291,7 +310,7 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
.getRelationsOfGraphic(this)
|
||||
.find(
|
||||
(relation) =>
|
||||
relation.getRelationParam(this).param === SectionPort.A &&
|
||||
relation.getRelationParam(this).param === DevicePort.A &&
|
||||
(relation.getOtherGraphic(this) instanceof Section ||
|
||||
relation.getOtherGraphic(this) instanceof Turnout)
|
||||
);
|
||||
@ -309,7 +328,7 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
.getRelationsOfGraphic(this)
|
||||
.find(
|
||||
(relation) =>
|
||||
relation.getRelationParam(this).param === SectionPort.B &&
|
||||
relation.getRelationParam(this).param === DevicePort.B &&
|
||||
(relation.getOtherGraphic(this) instanceof Section ||
|
||||
relation.getOtherGraphic(this) instanceof Turnout)
|
||||
);
|
||||
@ -331,7 +350,7 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
loadRelations() {
|
||||
if (this.datas?.paRef?.id) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, SectionPort.A),
|
||||
new GraphicRelationParam(this, DevicePort.A),
|
||||
new GraphicRelationParam(
|
||||
this.queryStore.queryById(this.datas.paRef.id),
|
||||
protoPort2Data(this.datas.paRef.devicePort)
|
||||
@ -340,7 +359,7 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
}
|
||||
if (this.datas?.pbRef?.id) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, SectionPort.B),
|
||||
new GraphicRelationParam(this, DevicePort.B),
|
||||
new GraphicRelationParam(
|
||||
this.queryStore.queryById(this.datas.pbRef.id),
|
||||
protoPort2Data(this.datas.pbRef.devicePort)
|
||||
|
@ -48,10 +48,11 @@ import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { AxleCounting } from '../axleCounting/AxleCounting';
|
||||
import { LogicSection } from '../logicSection/LogicSection';
|
||||
import { LogicSectionDraw } from '../logicSection/LogicSectionDrawAssistant';
|
||||
import { Turnout, TurnoutPort } from '../turnout/Turnout';
|
||||
import { Turnout } from '../turnout/Turnout';
|
||||
import {
|
||||
ISectionData,
|
||||
Section,
|
||||
DevicePort,
|
||||
SectionConsts,
|
||||
SectionTemplate,
|
||||
SectionType,
|
||||
@ -222,7 +223,7 @@ export class SectionDraw extends GraphicDrawAssistant<
|
||||
|
||||
turnouts.push(turnout);
|
||||
|
||||
Object.values(TurnoutPort).forEach((port) => {
|
||||
Object.values(DevicePort).forEach((port) => {
|
||||
const currentPortRelated = turnout.getGraphicOfPort(port);
|
||||
if (
|
||||
currentPortRelated.some((graphic) => graphic instanceof AxleCounting)
|
||||
|
@ -17,8 +17,8 @@ import {
|
||||
createRelatedRefProto,
|
||||
} from '../CommonGraphics';
|
||||
import { SignalCode } from './SignalCode';
|
||||
import { Section, SectionPort, SectionType } from '../section/Section';
|
||||
import { Turnout, TurnoutPort } from '../turnout/Turnout';
|
||||
import { Section, DevicePort, SectionType } from '../section/Section';
|
||||
import { Turnout } from '../turnout/Turnout';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
|
||||
export enum Direction {
|
||||
@ -201,7 +201,7 @@ export class Signal extends JlGraphic {
|
||||
let deviceId = '';
|
||||
let deviceType = '';
|
||||
let minD = Number.MAX_SAFE_INTEGER;
|
||||
let port: SectionPort | TurnoutPort = SectionPort.A;
|
||||
let port: DevicePort = DevicePort.A;
|
||||
sections.forEach((sec: Section) => {
|
||||
const verticesList = sec.getVerticesList();
|
||||
for (let i = 0; i < verticesList.length - 1; i++) {
|
||||
@ -224,7 +224,7 @@ export class Signal extends JlGraphic {
|
||||
minD = d;
|
||||
deviceId = sec.id;
|
||||
deviceType = sec.type;
|
||||
port = SectionPort.A;
|
||||
port = DevicePort.A;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -242,7 +242,7 @@ export class Signal extends JlGraphic {
|
||||
minD = d;
|
||||
deviceId = turnout.id;
|
||||
deviceType = turnout.type;
|
||||
port = TurnoutPort.A;
|
||||
port = DevicePort.A;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < turnout.datas.pointB.length; i++) {
|
||||
@ -257,7 +257,7 @@ export class Signal extends JlGraphic {
|
||||
minD = d;
|
||||
deviceId = turnout.id;
|
||||
deviceType = turnout.type;
|
||||
port = TurnoutPort.B;
|
||||
port = DevicePort.B;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < turnout.datas.pointC.length; i++) {
|
||||
@ -272,7 +272,7 @@ export class Signal extends JlGraphic {
|
||||
minD = d;
|
||||
deviceId = turnout.id;
|
||||
deviceType = turnout.type;
|
||||
port = TurnoutPort.C;
|
||||
port = DevicePort.C;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
VectorText,
|
||||
} from 'src/jl-graphic';
|
||||
import { KilometerSystem } from '../signal/Signal';
|
||||
import { Platform } from '../platform/Platform';
|
||||
|
||||
export interface IStationData extends GraphicData {
|
||||
get code(): string; // 车站站名
|
||||
@ -80,6 +81,14 @@ export class Station extends JlGraphic {
|
||||
kilometerGraph.anchor.set(0.5);
|
||||
kilometerGraph.position.set(0, stationConsts.kilometerCodeOffsetY);
|
||||
}
|
||||
|
||||
getPlatforms(): Platform[] {
|
||||
const relations = this.relationManage.getRelationsOfGraphicAndOtherType(
|
||||
this,
|
||||
Platform.Type
|
||||
);
|
||||
return relations.map((r) => r.getOtherGraphic(this));
|
||||
}
|
||||
}
|
||||
|
||||
export class StationTemplate extends JlGraphicTemplate<Station> {
|
||||
|
@ -14,7 +14,7 @@ import {
|
||||
createRelatedRefProto,
|
||||
protoPort2Data,
|
||||
} from '../CommonGraphics';
|
||||
import { Section, SectionPort } from '../section/Section';
|
||||
import { Section, DevicePort } from '../section/Section';
|
||||
|
||||
export enum CoachNum {
|
||||
Four = 0,
|
||||
@ -106,7 +106,7 @@ export class StopPosition extends JlGraphic {
|
||||
let deviceId = '';
|
||||
let deviceType = '';
|
||||
let minD = Number.MAX_SAFE_INTEGER;
|
||||
let port = SectionPort.A;
|
||||
let port = DevicePort.A;
|
||||
sections.forEach((sec: Section) => {
|
||||
const verticesList = sec.getVerticesList();
|
||||
for (let i = 0; i < verticesList.length - 1; i++) {
|
||||
@ -129,7 +129,7 @@ export class StopPosition extends JlGraphic {
|
||||
minD = d;
|
||||
deviceId = sec.id;
|
||||
deviceType = sec.type;
|
||||
port = SectionPort.A;
|
||||
port = DevicePort.A;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -9,11 +9,12 @@ import {
|
||||
calculateMirrorPoint,
|
||||
distance,
|
||||
} from 'src/jl-graphic';
|
||||
import { Turnout, TurnoutPort } from '../turnout/Turnout';
|
||||
import { Section } from '../section/Section';
|
||||
import { Turnout } from '../turnout/Turnout';
|
||||
import { DevicePort, Section } from '../section/Section';
|
||||
import { AxleCounting } from '../axleCounting/AxleCounting';
|
||||
import { state } from 'src/protos/device_state';
|
||||
import { getKmDistance } from 'src/drawApp/lineScene';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
|
||||
export interface ITrainData extends GraphicData {
|
||||
get code(): string; // 车号
|
||||
@ -335,7 +336,7 @@ export class Train extends JlGraphic {
|
||||
if (!dev) {
|
||||
return;
|
||||
}
|
||||
const portArr = [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C];
|
||||
const portArr = [DevicePort.A, DevicePort.B, DevicePort.C];
|
||||
const findIndex = portArr.findIndex((item) => {
|
||||
return item == this.states.devicePort;
|
||||
});
|
||||
@ -347,7 +348,15 @@ export class Train extends JlGraphic {
|
||||
);
|
||||
const findAc = relations.find((item) => {
|
||||
const rp = item.getRelationParam(dev as Turnout);
|
||||
return rp.getParam() == this.states.devicePort;
|
||||
const orp = item.getOtherRelationParam(dev as Turnout);
|
||||
const ac = orp.g as AxleCounting;
|
||||
return (
|
||||
rp.getParam() == this.states.devicePort &&
|
||||
((ac.datas.axleCountingRef.length > 1 &&
|
||||
ac.datas.type ==
|
||||
graphicData.AxleCounting.TypeDetectionPoint.AxleCounting) ||
|
||||
ac.datas.axleCountingRef.length == 1)
|
||||
);
|
||||
});
|
||||
const oKm = dev.datas.kilometerSystem;
|
||||
let pKm;
|
||||
@ -398,13 +407,20 @@ export class Train extends JlGraphic {
|
||||
relations.forEach((item) => {
|
||||
const rp = item.getRelationParam(dev as Section);
|
||||
const other = item.getOtherGraphic(dev as Section) as AxleCounting;
|
||||
if (rp.getParam() == 'A') {
|
||||
AKm = other.datas.kilometerSystem;
|
||||
hasA = true;
|
||||
}
|
||||
if (rp.getParam() == 'B') {
|
||||
BKm = other.datas.kilometerSystem;
|
||||
hasB = true;
|
||||
if (
|
||||
(other.datas.axleCountingRef.length > 1 &&
|
||||
other.datas.type ==
|
||||
graphicData.AxleCounting.TypeDetectionPoint.AxleCounting) ||
|
||||
other.datas.axleCountingRef.length == 1
|
||||
) {
|
||||
if (rp.getParam() == 'A') {
|
||||
AKm = other.datas.kilometerSystem;
|
||||
hasA = true;
|
||||
}
|
||||
if (rp.getParam() == 'B') {
|
||||
BKm = other.datas.kilometerSystem;
|
||||
hasB = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (hasA && hasB) {
|
||||
|
@ -16,10 +16,10 @@ import {
|
||||
import {
|
||||
Section,
|
||||
SectionConsts,
|
||||
SectionPort,
|
||||
DevicePort,
|
||||
SectionType,
|
||||
} from '../section/Section';
|
||||
import { Turnout, TurnoutConsts, TurnoutPort } from '../turnout/Turnout';
|
||||
import { Turnout, TurnoutConsts } from '../turnout/Turnout';
|
||||
|
||||
export interface ITransponderData extends GraphicData {
|
||||
get code(): string; // 编号
|
||||
@ -238,12 +238,12 @@ export class Transponder extends JlGraphic {
|
||||
if (findSection) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this),
|
||||
new GraphicRelationParam(findSection, SectionPort.A)
|
||||
new GraphicRelationParam(findSection, DevicePort.A)
|
||||
);
|
||||
return;
|
||||
}
|
||||
let tPort: TurnoutPort | null = null;
|
||||
const portList = [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C];
|
||||
let tPort: DevicePort | null = null;
|
||||
const portList = [DevicePort.A, DevicePort.B, DevicePort.C];
|
||||
const turnouts = this.queryStore.queryByType<Turnout>(Turnout.Type);
|
||||
const findTurnout = turnouts.find((turnout) => {
|
||||
let s = false;
|
||||
|
@ -10,8 +10,7 @@ import {
|
||||
angleOfIncludedAngle,
|
||||
distance2,
|
||||
} from 'src/jl-graphic';
|
||||
import { Section, SectionPort, SectionType } from '../section/Section';
|
||||
import { epsilon } from 'src/jl-graphic/math';
|
||||
import { Section, DevicePort, SectionType } from '../section/Section';
|
||||
import {
|
||||
IRelatedRefData,
|
||||
createRelatedRefProto,
|
||||
@ -90,12 +89,6 @@ export enum TurnoutPosition {
|
||||
REVERSE = 1,
|
||||
}
|
||||
|
||||
export enum TurnoutPort {
|
||||
A = 'A',
|
||||
B = 'B',
|
||||
C = 'C',
|
||||
}
|
||||
|
||||
export function getForkPoint(r: number, p: IPointData): IPointData {
|
||||
if (r === 0) return { x: 0, y: 0 };
|
||||
const len = Math.sqrt((-p.x) ** 2 + (-p.y) ** 2);
|
||||
@ -105,8 +98,8 @@ export function getForkPoint(r: number, p: IPointData): IPointData {
|
||||
|
||||
export class TurnoutSection extends Graphics {
|
||||
turnout: Turnout;
|
||||
port: TurnoutPort;
|
||||
constructor(turnout: Turnout, port: TurnoutPort) {
|
||||
port: DevicePort;
|
||||
constructor(turnout: Turnout, port: DevicePort) {
|
||||
super();
|
||||
this.turnout = turnout;
|
||||
this.port = port;
|
||||
@ -115,23 +108,23 @@ export class TurnoutSection extends Graphics {
|
||||
paint() {
|
||||
let pList: IPointData[] = [];
|
||||
switch (this.port) {
|
||||
case TurnoutPort.A:
|
||||
case DevicePort.A:
|
||||
pList = this.turnout.datas.pointA;
|
||||
break;
|
||||
case TurnoutPort.B:
|
||||
case DevicePort.B:
|
||||
pList = this.turnout.datas.pointB;
|
||||
break;
|
||||
case TurnoutPort.C:
|
||||
case DevicePort.C:
|
||||
pList = this.turnout.datas.pointC;
|
||||
break;
|
||||
}
|
||||
const gap = this.port === TurnoutPort.A ? 0 : TurnoutConsts.forkLenth;
|
||||
const gap = this.port === DevicePort.A ? 0 : TurnoutConsts.forkLenth;
|
||||
let color = TurnoutConsts.lineColor;
|
||||
if (this.turnout.states.occupied) {
|
||||
if (
|
||||
this.port === TurnoutPort.A ||
|
||||
(this.turnout.states.dw && this.port === TurnoutPort.B) ||
|
||||
(this.turnout.states.fw && this.port === TurnoutPort.C)
|
||||
this.port === DevicePort.A ||
|
||||
(this.turnout.states.dw && this.port === DevicePort.B) ||
|
||||
(this.turnout.states.fw && this.port === DevicePort.C)
|
||||
) {
|
||||
color = TurnoutConsts.occupiedColor;
|
||||
}
|
||||
@ -181,9 +174,9 @@ export class Turnout extends JlGraphic {
|
||||
this.graphics = {
|
||||
fork: new ForkGraphic(this),
|
||||
sections: [
|
||||
new TurnoutSection(this, TurnoutPort.A),
|
||||
new TurnoutSection(this, TurnoutPort.B),
|
||||
new TurnoutSection(this, TurnoutPort.C),
|
||||
new TurnoutSection(this, DevicePort.A),
|
||||
new TurnoutSection(this, DevicePort.B),
|
||||
new TurnoutSection(this, DevicePort.C),
|
||||
],
|
||||
label: new VectorText(),
|
||||
};
|
||||
@ -259,6 +252,24 @@ export class Turnout extends JlGraphic {
|
||||
}
|
||||
}
|
||||
|
||||
getConnectElement(port: DevicePort) {
|
||||
const relation = this.relationManage
|
||||
.getRelationsOfGraphic(this)
|
||||
.find(
|
||||
(relation) =>
|
||||
relation.getRelationParam(this).getParam<DevicePort>() === port &&
|
||||
(relation.getOtherGraphic(this) instanceof Section ||
|
||||
relation.getOtherGraphic(this) instanceof Turnout)
|
||||
);
|
||||
if (!relation) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
g: relation?.getOtherGraphic(this) as Section | Turnout,
|
||||
port: relation?.getOtherRelationParam(this).getParam<DevicePort>(),
|
||||
};
|
||||
}
|
||||
|
||||
buildRelation(): void {
|
||||
this.relationManage.deleteRelationOfGraphic(this);
|
||||
|
||||
@ -275,9 +286,9 @@ export class Turnout extends JlGraphic {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(
|
||||
this,
|
||||
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
|
||||
[DevicePort.A, DevicePort.B, DevicePort.C][i]
|
||||
),
|
||||
new GraphicRelationParam(section, SectionPort.A)
|
||||
new GraphicRelationParam(section, DevicePort.A)
|
||||
);
|
||||
}
|
||||
if (
|
||||
@ -289,9 +300,9 @@ export class Turnout extends JlGraphic {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(
|
||||
this,
|
||||
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
|
||||
[DevicePort.A, DevicePort.B, DevicePort.C][i]
|
||||
),
|
||||
new GraphicRelationParam(section, SectionPort.B)
|
||||
new GraphicRelationParam(section, DevicePort.B)
|
||||
);
|
||||
}
|
||||
});
|
||||
@ -324,11 +335,11 @@ export class Turnout extends JlGraphic {
|
||||
params = [
|
||||
new GraphicRelationParam(
|
||||
this,
|
||||
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
|
||||
[DevicePort.A, DevicePort.B, DevicePort.C][i]
|
||||
),
|
||||
new GraphicRelationParam(
|
||||
turnout,
|
||||
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][j]
|
||||
[DevicePort.A, DevicePort.B, DevicePort.C][j]
|
||||
),
|
||||
];
|
||||
}
|
||||
@ -346,7 +357,7 @@ export class Turnout extends JlGraphic {
|
||||
.getRelationsOfGraphic(this)
|
||||
.find(
|
||||
(relation) =>
|
||||
relation.getRelationParam(this).param === TurnoutPort.A &&
|
||||
relation.getRelationParam(this).param === DevicePort.A &&
|
||||
(relation.getOtherGraphic(this) instanceof Section ||
|
||||
relation.getOtherGraphic(this) instanceof Turnout)
|
||||
);
|
||||
@ -364,7 +375,7 @@ export class Turnout extends JlGraphic {
|
||||
.getRelationsOfGraphic(this)
|
||||
.find(
|
||||
(relation) =>
|
||||
relation.getRelationParam(this).param === TurnoutPort.B &&
|
||||
relation.getRelationParam(this).param === DevicePort.B &&
|
||||
(relation.getOtherGraphic(this) instanceof Section ||
|
||||
relation.getOtherGraphic(this) instanceof Turnout)
|
||||
);
|
||||
@ -381,7 +392,7 @@ export class Turnout extends JlGraphic {
|
||||
const pcRelation = this.relationManage
|
||||
.getRelationsOfGraphic(this)
|
||||
.find(
|
||||
(relation) => relation.getRelationParam(this).param === TurnoutPort.C
|
||||
(relation) => relation.getRelationParam(this).param === DevicePort.C
|
||||
);
|
||||
const pcDevice = pcRelation?.getOtherGraphic<Section | Turnout>(this);
|
||||
if (pcDevice) {
|
||||
@ -398,7 +409,7 @@ export class Turnout extends JlGraphic {
|
||||
loadRelations() {
|
||||
if (this.datas.paRef?.id) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, TurnoutPort.A),
|
||||
new GraphicRelationParam(this, DevicePort.A),
|
||||
new GraphicRelationParam(
|
||||
this.queryStore.queryById(this.datas.paRef.id),
|
||||
protoPort2Data(this.datas.paRef.devicePort)
|
||||
@ -407,7 +418,7 @@ export class Turnout extends JlGraphic {
|
||||
}
|
||||
if (this.datas.pbRef?.id) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, TurnoutPort.B),
|
||||
new GraphicRelationParam(this, DevicePort.B),
|
||||
new GraphicRelationParam(
|
||||
this.queryStore.queryById(this.datas.pbRef.id),
|
||||
protoPort2Data(this.datas.pbRef.devicePort)
|
||||
@ -416,7 +427,7 @@ export class Turnout extends JlGraphic {
|
||||
}
|
||||
if (this.datas.pcRef?.id) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, TurnoutPort.C),
|
||||
new GraphicRelationParam(this, DevicePort.C),
|
||||
new GraphicRelationParam(
|
||||
this.queryStore.queryById(this.datas.pcRef.id),
|
||||
protoPort2Data(this.datas.pcRef.devicePort)
|
||||
@ -425,30 +436,30 @@ export class Turnout extends JlGraphic {
|
||||
}
|
||||
if (this.datas.paTrackSectionId) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, TurnoutPort.A),
|
||||
new GraphicRelationParam(this, DevicePort.A),
|
||||
this.queryStore.queryById<TrackSection>(this.datas.paTrackSectionId)
|
||||
);
|
||||
}
|
||||
if (this.datas.pbTrackSectionId) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, TurnoutPort.B),
|
||||
new GraphicRelationParam(this, DevicePort.B),
|
||||
this.queryStore.queryById<TrackSection>(this.datas.pbTrackSectionId)
|
||||
);
|
||||
}
|
||||
if (this.datas.paTrackSectionId) {
|
||||
this.relationManage.addRelation(
|
||||
new GraphicRelationParam(this, TurnoutPort.C),
|
||||
new GraphicRelationParam(this, DevicePort.C),
|
||||
this.queryStore.queryById<TrackSection>(this.datas.pcTrackSectionId)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
getGraphicOfPort(port: TurnoutPort) {
|
||||
getGraphicOfPort(port: DevicePort) {
|
||||
return this.relationManage
|
||||
.getRelationsOfGraphic(this)
|
||||
.filter(
|
||||
(relation) =>
|
||||
relation.getRelationParam(this).getParam<TurnoutPort>() === port
|
||||
relation.getRelationParam(this).getParam<DevicePort>() === port
|
||||
)
|
||||
.map((relation) => {
|
||||
return relation.getOtherGraphic(this);
|
||||
|
@ -16,7 +16,6 @@ import {
|
||||
ITurnoutData,
|
||||
Turnout,
|
||||
TurnoutConsts,
|
||||
TurnoutPort,
|
||||
TurnoutSection,
|
||||
TurnoutTemplate,
|
||||
getForkPoint,
|
||||
@ -32,7 +31,7 @@ import {
|
||||
GraphicEditPlugin,
|
||||
getWaypointRangeIndex,
|
||||
} from 'src/jl-graphic/plugins/GraphicEditPlugin';
|
||||
import { Section } from '../section/Section';
|
||||
import { DevicePort, Section } from '../section/Section';
|
||||
import AbsorbablePoint, {
|
||||
AbsorbableLine,
|
||||
} from 'src/jl-graphic/graphic/AbsorbablePosition';
|
||||
@ -110,15 +109,15 @@ export class TurnoutSectionHitArea implements IHitArea {
|
||||
let points: IPointData[];
|
||||
let start: IPointData;
|
||||
switch (this.section.port) {
|
||||
case TurnoutPort.A:
|
||||
case DevicePort.A:
|
||||
points = this.section.turnout.datas.pointA;
|
||||
start = { x: 0, y: 0 };
|
||||
break;
|
||||
case TurnoutPort.B:
|
||||
case DevicePort.B:
|
||||
points = this.section.turnout.datas.pointB;
|
||||
start = getForkPoint(TurnoutConsts.forkLenth, points[0]);
|
||||
break;
|
||||
case TurnoutPort.C:
|
||||
case DevicePort.C:
|
||||
points = this.section.turnout.datas.pointC;
|
||||
start = getForkPoint(TurnoutConsts.forkLenth, points[0]);
|
||||
break;
|
||||
@ -217,7 +216,7 @@ export class TurnoutPointsInteractionPlugin extends GraphicInteractionPlugin<Tur
|
||||
onSectionContextMenu(e: FederatedMouseEvent, section: TurnoutSection) {
|
||||
const p = section.turnout.screenToLocalPoint(e.global);
|
||||
addPointConfig.handler = () => {
|
||||
if (section.port === TurnoutPort.A) {
|
||||
if (section.port === DevicePort.A) {
|
||||
const { start } = getWaypointRangeIndex(
|
||||
[{ x: 0, y: 0 }, ...section.turnout.datas.pointA],
|
||||
false,
|
||||
@ -230,7 +229,7 @@ export class TurnoutPointsInteractionPlugin extends GraphicInteractionPlugin<Tur
|
||||
ps.push(...points.slice(start));
|
||||
section.turnout.datas.pointA = ps;
|
||||
}
|
||||
if (section.port === TurnoutPort.B) {
|
||||
if (section.port === DevicePort.B) {
|
||||
const { start } = getWaypointRangeIndex(
|
||||
[{ x: 0, y: 0 }, ...section.turnout.datas.pointB],
|
||||
false,
|
||||
@ -243,7 +242,7 @@ export class TurnoutPointsInteractionPlugin extends GraphicInteractionPlugin<Tur
|
||||
ps.push(...points.slice(start));
|
||||
section.turnout.datas.pointB = ps;
|
||||
}
|
||||
if (section.port === TurnoutPort.C) {
|
||||
if (section.port === DevicePort.C) {
|
||||
const { start } = getWaypointRangeIndex(
|
||||
[{ x: 0, y: 0 }, ...section.turnout.datas.pointC],
|
||||
false,
|
||||
@ -259,15 +258,15 @@ export class TurnoutPointsInteractionPlugin extends GraphicInteractionPlugin<Tur
|
||||
this.onSelected(section.turnout);
|
||||
};
|
||||
clearPointConfig.handler = () => {
|
||||
if (section.port === TurnoutPort.A)
|
||||
if (section.port === DevicePort.A)
|
||||
section.turnout.datas.pointA = [
|
||||
section.turnout.datas.pointA[section.turnout.datas.pointA.length - 1],
|
||||
];
|
||||
if (section.port === TurnoutPort.B)
|
||||
if (section.port === DevicePort.B)
|
||||
section.turnout.datas.pointB = [
|
||||
section.turnout.datas.pointB[section.turnout.datas.pointB.length - 1],
|
||||
];
|
||||
if (section.port === TurnoutPort.C)
|
||||
if (section.port === DevicePort.C)
|
||||
section.turnout.datas.pointC = [
|
||||
section.turnout.datas.pointC[section.turnout.datas.pointC.length - 1],
|
||||
];
|
||||
|
@ -196,9 +196,13 @@ import {
|
||||
checkDataToServer,
|
||||
loadUniqueIdPrefix,
|
||||
setUniqueIdPrefix,
|
||||
creatStationRelateDevice,
|
||||
deleteStationRelateDeviceByType,
|
||||
loadOtherLineList,
|
||||
} from 'src/drawApp/commonApp';
|
||||
import { saveJkDrawDatas, loadLinkDatas } from 'src/drawApp/jkApp';
|
||||
import { RelateDevicelistItem, saveThDrawDatas } from 'src/drawApp/thApp';
|
||||
import { RelateDevicelistItem } from 'src/drawApp/commonApp';
|
||||
import { saveThDrawDatas } from 'src/drawApp/thApp';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
@ -266,7 +270,7 @@ import OtherLineList from 'src/components/draw-app/dialogs/OtherLineList.vue';
|
||||
import OtherLineConfig from 'src/components/draw-app/properties/OtherLineConfig.vue';
|
||||
import SectionDirectionConfig from 'src/components/draw-app/properties/SectionDirectionConfig.vue';
|
||||
import SignalDirectionConfig from 'src/components/draw-app/properties/SignalDirectionConfig.vue';
|
||||
import { distance2 } from 'src/jl-graphic';
|
||||
import { distance2, JlGraphic } from 'src/jl-graphic';
|
||||
import { Point } from 'pixi.js';
|
||||
|
||||
const $q = useQuasar();
|
||||
@ -364,6 +368,10 @@ const leftMenuConfig = [
|
||||
label: '一键生成所有紧急停车继电器的编号',
|
||||
click: oneClickGenerateEsbRelayCode,
|
||||
},
|
||||
{
|
||||
label: '一键生成所有紧急停车按钮组合数据',
|
||||
click: oneClickGenerateEsbCombinationData,
|
||||
},
|
||||
];
|
||||
|
||||
//数据管理下拉按钮
|
||||
@ -641,72 +649,18 @@ function oneClickRelateCentralizedStation() {
|
||||
const drawApp = drawStore.getDrawApp();
|
||||
const concentrationDividingLines = drawApp.queryStore
|
||||
.queryByType<ConcentrationDividingLine>(ConcentrationDividingLine.Type)
|
||||
.filter((g) => !g.datas.isOtherLineConcentrationDividingLine)
|
||||
.sort((a, b) => a.datas.points[0].x - b.datas.points[0].x);
|
||||
//需要考虑是否绘制左边界
|
||||
const leftBoundary = concentrationDividingLines[0];
|
||||
if (leftBoundary.datas.refLeftStationId) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const leftSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
leftBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.leftSection.id !== '') {
|
||||
leftSections.push({
|
||||
section: drawApp.queryStore.queryById(node.leftSection.id),
|
||||
port: node.leftSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...leftSections.map((g) => g.section.id)];
|
||||
leftSections.forEach((leftSection) => {
|
||||
findContainDevice(
|
||||
leftSection.section,
|
||||
leftSection.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
handleContainDevices(containDeviceIds, [
|
||||
leftBoundary.datas.refLeftStationId,
|
||||
]);
|
||||
}
|
||||
//需要考虑是否绘制右边界
|
||||
const rightBoundary =
|
||||
concentrationDividingLines[concentrationDividingLines.length - 1];
|
||||
if (rightBoundary.datas.refRightStationId) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const rightSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
rightBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.rightSection.id !== '') {
|
||||
rightSections.push({
|
||||
section: drawApp.queryStore.queryById(node.rightSection.id),
|
||||
port: node.rightSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...rightSections.map((g) => g.section.id)];
|
||||
rightSections.forEach((rightSections) => {
|
||||
findContainDevice(
|
||||
rightSections.section,
|
||||
rightSections.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
handleContainDevices(containDeviceIds, [
|
||||
rightBoundary.datas.refRightStationId,
|
||||
]);
|
||||
}
|
||||
const hasHandleStation: string[] = [];
|
||||
for (let i = 0; i < concentrationDividingLines.length - 1; i++) {
|
||||
let containDeviceIds: string[] = [];
|
||||
//右边
|
||||
const rightDatas = concentrationDividingLines[i].datas;
|
||||
if (hasHandleStation.includes(rightDatas.refRightStationId)) {
|
||||
continue;
|
||||
} else {
|
||||
hasHandleStation.push(rightDatas.refRightStationId);
|
||||
}
|
||||
const rightSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
@ -749,6 +703,27 @@ function oneClickRelateCentralizedStation() {
|
||||
handleContainDevices(containDeviceIds, [rightDatas.refRightStationId]);
|
||||
}
|
||||
}
|
||||
//需要考虑是否绘制左右边界和车辆段这种
|
||||
const leftBoundary = concentrationDividingLines[0];
|
||||
handleLeftBoundary(leftBoundary);
|
||||
const rightBoundary =
|
||||
concentrationDividingLines[concentrationDividingLines.length - 1];
|
||||
handleRightBoundary(rightBoundary);
|
||||
concentrationDividingLines.forEach((concentrationDividingLine) => {
|
||||
const datas = concentrationDividingLine.datas;
|
||||
if (
|
||||
datas.refLeftStationId &&
|
||||
drawApp.queryStore.queryById<Station>(datas.refLeftStationId).datas.depots
|
||||
) {
|
||||
handleLeftBoundary(concentrationDividingLine);
|
||||
} else if (
|
||||
datas.refRightStationId &&
|
||||
drawApp.queryStore.queryById<Station>(datas.refRightStationId).datas
|
||||
.depots
|
||||
) {
|
||||
handleRightBoundary(concentrationDividingLine);
|
||||
}
|
||||
});
|
||||
//区段边界的计轴和信号机单独处理
|
||||
const axleCountings = drawApp.queryStore
|
||||
.queryByType<AxleCounting>(AxleCounting.Type)
|
||||
@ -789,6 +764,16 @@ function oneClickRelateCentralizedStation() {
|
||||
}
|
||||
);
|
||||
});
|
||||
//其它线路设备集中站置空
|
||||
const otherLineList = loadOtherLineList();
|
||||
const otherLineListDevice: JlGraphic[] = [];
|
||||
otherLineList.forEach((otherLine) => {
|
||||
otherLine.ids.forEach((id) => {
|
||||
const device = drawApp.queryStore.queryById(id);
|
||||
otherLineListDevice.push(device);
|
||||
});
|
||||
});
|
||||
handleCentralizedStationsData(otherLineListDevice, []);
|
||||
|
||||
function handleNodeConWithSec(
|
||||
relatedRef: graphicData.RelatedRef,
|
||||
@ -850,6 +835,70 @@ function oneClickRelateCentralizedStation() {
|
||||
centralizedStations
|
||||
);
|
||||
}
|
||||
function handleLeftBoundary(leftBoundary: ConcentrationDividingLine) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const leftSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
leftBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.leftSection.id !== '') {
|
||||
leftSections.push({
|
||||
section: drawApp.queryStore.queryById(node.leftSection.id),
|
||||
port: node.leftSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...leftSections.map((g) => g.section.id)];
|
||||
leftSections.forEach((leftSection) => {
|
||||
findContainDevice(
|
||||
leftSection.section,
|
||||
leftSection.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
if (leftBoundary.datas.refLeftStationId == '') {
|
||||
handleContainDevices(containDeviceIds, []);
|
||||
} else {
|
||||
handleContainDevices(containDeviceIds, [
|
||||
leftBoundary.datas.refLeftStationId,
|
||||
]);
|
||||
}
|
||||
}
|
||||
function handleRightBoundary(rightBoundary: ConcentrationDividingLine) {
|
||||
let containDeviceIds: string[] = [];
|
||||
const rightSections: {
|
||||
section: Section;
|
||||
port: graphicData.RelatedRef.DevicePort;
|
||||
}[] = [];
|
||||
rightBoundary.datas.nodeConWithSecs.forEach((node) => {
|
||||
if (node.rightSection.id !== '') {
|
||||
rightSections.push({
|
||||
section: drawApp.queryStore.queryById(node.rightSection.id),
|
||||
port: node.rightSection.devicePort,
|
||||
});
|
||||
}
|
||||
});
|
||||
containDeviceIds = [...rightSections.map((g) => g.section.id)];
|
||||
rightSections.forEach((rightSections) => {
|
||||
findContainDevice(
|
||||
rightSections.section,
|
||||
rightSections.port,
|
||||
containDeviceIds,
|
||||
drawApp
|
||||
);
|
||||
containDeviceIds = Array.from(new Set(containDeviceIds));
|
||||
});
|
||||
if (rightBoundary.datas.refRightStationId == '') {
|
||||
handleContainDevices(containDeviceIds, []);
|
||||
} else {
|
||||
handleContainDevices(containDeviceIds, [
|
||||
rightBoundary.datas.refRightStationId,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function oneClickGeneratePlatformType() {
|
||||
@ -894,6 +943,56 @@ function oneClickGenerateEsbRelayCode() {
|
||||
});
|
||||
}
|
||||
|
||||
function oneClickGenerateEsbCombinationData() {
|
||||
deleteStationRelateDeviceByType(graphicData.RelatedRef.DeviceType.station);
|
||||
const stations = drawStore
|
||||
.getDrawApp()
|
||||
.queryStore.queryByType<Station>(Station.Type)
|
||||
.filter((g) => g.datas.depots == false);
|
||||
stations.forEach((station) => {
|
||||
const platforms = drawStore
|
||||
.getDrawApp()
|
||||
.queryStore.queryByType<Platform>(Platform.Type)
|
||||
.filter((g) => g.datas.refStation == station?.id);
|
||||
let refEsbRelayCodes = platforms.map((g) => g.datas.refEsbRelayCode);
|
||||
refEsbRelayCodes = Array.from(new Set(refEsbRelayCodes));
|
||||
const combinationtypes: graphicData.DeviceCombinationtype[] = [];
|
||||
const esbButtons = drawStore
|
||||
.getDrawApp()
|
||||
.queryStore.queryByType<EsbButton>(EsbButton.Type);
|
||||
if (refEsbRelayCodes.length == 1) {
|
||||
const platformIds = platforms.map((g) => g.id);
|
||||
const esbButtonIds = esbButtons
|
||||
.filter((g) => platformIds.includes(g.datas.refStand))
|
||||
.map((g) => g.id);
|
||||
combinationtypes.push(
|
||||
new graphicData.DeviceCombinationtype({
|
||||
code: refEsbRelayCodes[0],
|
||||
refDevices: esbButtonIds,
|
||||
})
|
||||
);
|
||||
} else {
|
||||
platforms.forEach((platform) => {
|
||||
const esbButtonIds = esbButtons
|
||||
.filter((g) => g.datas.refStand == platform.id)
|
||||
.map((g) => g.id);
|
||||
combinationtypes.push(
|
||||
new graphicData.DeviceCombinationtype({
|
||||
code: platform.datas.refEsbRelayCode,
|
||||
refDevices: esbButtonIds,
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
const stationRelateDevice = new graphicData.StationRelateDevice({
|
||||
deviceType: graphicData.RelatedRef.DeviceType.station,
|
||||
code: station.datas.stationName,
|
||||
combinationtypes: combinationtypes,
|
||||
});
|
||||
creatStationRelateDevice(stationRelateDevice);
|
||||
});
|
||||
}
|
||||
|
||||
function backConfirm() {
|
||||
router.go(-1);
|
||||
}
|
||||
@ -949,6 +1048,10 @@ onUnmounted(() => {
|
||||
drawStore.setEditOtherLineIndex(-1);
|
||||
drawStore.destroy();
|
||||
drawStore.setCategoryType(null);
|
||||
drawStore.setRelateDeviceConfigVisible(false);
|
||||
if (relateDeviceDialogInstance) {
|
||||
relateDeviceDialogInstance.hide();
|
||||
}
|
||||
});
|
||||
|
||||
const dialogInstance = ref();
|
||||
|
@ -466,7 +466,7 @@ watch(changeScreenDoorGroup, (group) => {
|
||||
if (group?.length == 1) {
|
||||
downScreenDoorCjList[0].refDeviceCodesAndPos.unshift([
|
||||
{
|
||||
code: 'KMJ',
|
||||
code: 'XKMJ',
|
||||
position: PostionType.Q,
|
||||
},
|
||||
]);
|
||||
|
@ -99,7 +99,7 @@ upScreenDoorQdList.forEach((qdData) => {
|
||||
watch(changeScreenDoorGroup, (group) => {
|
||||
downScreenDoorQdList[0].refDeviceCodes = [['XGMJ']];
|
||||
if (group?.length == 1) {
|
||||
downScreenDoorQdList[0].refDeviceCodes.unshift(['KMJ']);
|
||||
downScreenDoorQdList[0].refDeviceCodes.unshift(['XKMJ']);
|
||||
} else {
|
||||
group?.forEach((trainGroupAmount) => {
|
||||
switch (trainGroupAmount) {
|
||||
|
@ -118,4 +118,8 @@ export function generateRelayLayout(relays: GenerateRelaysCongig[]) {
|
||||
);
|
||||
}
|
||||
}
|
||||
const canvasWidth =
|
||||
relayCabinet[relayCabinet.length - 1].position.x + relayCabinetConsts.width;
|
||||
relayCabinetStore.getJlCanvas().properties.width =
|
||||
canvasWidth > 1920 ? canvasWidth : 1920;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
<q-btn color="primary" label="启动" @click="createFormShow = true" />
|
||||
</template>
|
||||
|
||||
<template v-slot:body-cell-operations="props">
|
||||
<template #body-cell-operations="props">
|
||||
<q-td :props="props">
|
||||
<div class="q-gutter-sm row justify-center">
|
||||
<q-btn
|
||||
@ -46,6 +46,18 @@
|
||||
</div>
|
||||
</q-td>
|
||||
</template>
|
||||
|
||||
<template #body-cell="props">
|
||||
<td class="text-center" v-if="props.col.name === 'mapIds'">
|
||||
<q-tooltip>{{ props.value }} </q-tooltip>
|
||||
{{
|
||||
props.value.length > 40
|
||||
? props.value.slice(0, 40) + '…'
|
||||
: props.value
|
||||
}}
|
||||
</td>
|
||||
<td class="text-center" v-else>{{ props.value }}</td>
|
||||
</template>
|
||||
</q-table>
|
||||
|
||||
<q-dialog
|
||||
@ -99,7 +111,7 @@ import { useQuasar, type QTableColumn, QForm } from 'quasar';
|
||||
import { getProjectList } from '../api/ProjectApi';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
import {
|
||||
SimulationIem,
|
||||
SimulationItem,
|
||||
createByProject,
|
||||
createSimulationByProject,
|
||||
getSimulationList,
|
||||
@ -168,7 +180,7 @@ const columnDefs: QTableColumn[] = [
|
||||
|
||||
const operateDisabled = ref(false);
|
||||
const tableRef = ref();
|
||||
const rows = reactive<SimulationIem[]>([]);
|
||||
const rows = reactive<SimulationItem[]>([]);
|
||||
const filter = reactive({
|
||||
name: '',
|
||||
});
|
||||
@ -317,7 +329,7 @@ function getProjectName(id: number): string {
|
||||
return name;
|
||||
}
|
||||
|
||||
function joinTest(val: SimulationIem) {
|
||||
function joinTest(val: SimulationItem) {
|
||||
const query = {
|
||||
defaultMapId: val.mapId,
|
||||
simulationId: val.simulationId,
|
||||
@ -325,7 +337,7 @@ function joinTest(val: SimulationIem) {
|
||||
};
|
||||
router.push({ path: '/linemap', query });
|
||||
}
|
||||
function endTest(val: SimulationIem) {
|
||||
function endTest(val: SimulationItem) {
|
||||
operateDisabled.value = true;
|
||||
const name = getProjectName(val.projectId);
|
||||
$q.dialog({
|
||||
|
@ -1698,6 +1698,7 @@ export namespace graphicData {
|
||||
refLeftStationId?: string;
|
||||
refRightStationId?: string;
|
||||
nodeConWithSecs?: NodeConWithSec[];
|
||||
isOtherLineConcentrationDividingLine?: boolean;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 6], this.#one_of_decls);
|
||||
@ -1720,6 +1721,9 @@ export namespace graphicData {
|
||||
if ("nodeConWithSecs" in data && data.nodeConWithSecs != undefined) {
|
||||
this.nodeConWithSecs = data.nodeConWithSecs;
|
||||
}
|
||||
if ("isOtherLineConcentrationDividingLine" in data && data.isOtherLineConcentrationDividingLine != undefined) {
|
||||
this.isOtherLineConcentrationDividingLine = data.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
get common() {
|
||||
@ -1761,6 +1765,12 @@ export namespace graphicData {
|
||||
set nodeConWithSecs(value: NodeConWithSec[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 6, value);
|
||||
}
|
||||
get isOtherLineConcentrationDividingLine() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean;
|
||||
}
|
||||
set isOtherLineConcentrationDividingLine(value: boolean) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
@ -1768,6 +1778,7 @@ export namespace graphicData {
|
||||
refLeftStationId?: string;
|
||||
refRightStationId?: string;
|
||||
nodeConWithSecs?: ReturnType<typeof NodeConWithSec.prototype.toObject>[];
|
||||
isOtherLineConcentrationDividingLine?: boolean;
|
||||
}): ConcentrationDividingLine {
|
||||
const message = new ConcentrationDividingLine({});
|
||||
if (data.common != null) {
|
||||
@ -1788,6 +1799,9 @@ export namespace graphicData {
|
||||
if (data.nodeConWithSecs != null) {
|
||||
message.nodeConWithSecs = data.nodeConWithSecs.map(item => NodeConWithSec.fromObject(item));
|
||||
}
|
||||
if (data.isOtherLineConcentrationDividingLine != null) {
|
||||
message.isOtherLineConcentrationDividingLine = data.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -1798,6 +1812,7 @@ export namespace graphicData {
|
||||
refLeftStationId?: string;
|
||||
refRightStationId?: string;
|
||||
nodeConWithSecs?: ReturnType<typeof NodeConWithSec.prototype.toObject>[];
|
||||
isOtherLineConcentrationDividingLine?: boolean;
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
@ -1817,6 +1832,9 @@ export namespace graphicData {
|
||||
if (this.nodeConWithSecs != null) {
|
||||
data.nodeConWithSecs = this.nodeConWithSecs.map((item: NodeConWithSec) => item.toObject());
|
||||
}
|
||||
if (this.isOtherLineConcentrationDividingLine != null) {
|
||||
data.isOtherLineConcentrationDividingLine = this.isOtherLineConcentrationDividingLine;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -1835,6 +1853,8 @@ export namespace graphicData {
|
||||
writer.writeString(5, this.refRightStationId);
|
||||
if (this.nodeConWithSecs.length)
|
||||
writer.writeRepeatedMessage(6, this.nodeConWithSecs, (item: NodeConWithSec) => item.serialize(writer));
|
||||
if (this.isOtherLineConcentrationDividingLine != false)
|
||||
writer.writeBool(7, this.isOtherLineConcentrationDividingLine);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -1862,6 +1882,9 @@ export namespace graphicData {
|
||||
case 6:
|
||||
reader.readMessage(message.nodeConWithSecs, () => pb_1.Message.addToRepeatedWrapperField(message, 6, NodeConWithSec.deserialize(reader), NodeConWithSec));
|
||||
break;
|
||||
case 7:
|
||||
message.isOtherLineConcentrationDividingLine = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
@ -46,8 +46,9 @@ export const useIbpStore = defineStore('ibp', {
|
||||
const stations = lineScene.queryStore
|
||||
.queryByType<Station>(Station.Type)
|
||||
.filter(
|
||||
(station) =>
|
||||
station.datas.kilometerSystem.coordinateSystem === 'MAIN_LINE'
|
||||
(s) =>
|
||||
s.datas.kilometerSystem.coordinateSystem ===
|
||||
station.datas.kilometerSystem.coordinateSystem
|
||||
)
|
||||
.sort(
|
||||
(a, b) =>
|
||||
@ -69,16 +70,16 @@ export const useIbpStore = defineStore('ibp', {
|
||||
},
|
||||
async ibpButtonOperation(id: string, down: boolean) {
|
||||
return await ibpButtonOperation({
|
||||
buttonCode: id,
|
||||
buttonId: id,
|
||||
down,
|
||||
mapId: Number(this.mapId),
|
||||
simulationId: this.simulationId,
|
||||
stationId: this.stationId,
|
||||
});
|
||||
},
|
||||
async ibpKeyOperation(keyCode: string, gear: number) {
|
||||
async ibpKeyOperation(keyId: string, gear: number) {
|
||||
return await ibpKeyOperation({
|
||||
keyCode,
|
||||
keyId,
|
||||
gear,
|
||||
mapId: Number(this.mapId),
|
||||
simulationId: this.simulationId,
|
||||
|
Loading…
Reference in New Issue
Block a user