Merge remote-tracking branch 'origin/develop' into local-test
All checks were successful
CI / Docker-Build (push) Successful in 3m3s

This commit is contained in:
fan 2024-05-28 13:23:32 +08:00
commit 5ca9ed1d21
27 changed files with 2390 additions and 105 deletions

View File

@ -12,6 +12,7 @@
"dev": "quasar dev", "dev": "quasar dev",
"build": "quasar build", "build": "quasar build",
"build:local": "URL_ENV=local_test quasar build", "build:local": "URL_ENV=local_test quasar build",
"build:pxf": "URL_ENV=local_pxf quasar build",
"build:test": "URL_ENV=test quasar build", "build:test": "URL_ENV=test quasar build",
"build:publish": "URL_ENV=publish quasar build", "build:publish": "URL_ENV=publish quasar build",
"protoc": "node scripts/proto.cjs", "protoc": "node scripts/proto.cjs",

View File

@ -27,15 +27,30 @@
<path d="M20.7727 14.2727C20.7045 13.697 20.428 13.25 19.9432 12.9318C19.4583 12.6136 18.8636 12.4545 18.1591 12.4545C17.6439 12.4545 17.1932 12.5379 16.8068 12.7045C16.4242 12.8712 16.125 13.1004 15.9091 13.392C15.697 13.6837 15.5909 14.0152 15.5909 14.3864C15.5909 14.697 15.6648 14.964 15.8125 15.1875C15.964 15.4072 16.1572 15.5909 16.392 15.7386C16.6269 15.8826 16.8731 16.0019 17.1307 16.0966C17.3883 16.1875 17.625 16.2614 17.8409 16.3182L19.0227 16.6364C19.3258 16.7159 19.6629 16.8258 20.0341 16.9659C20.4091 17.1061 20.767 17.2973 21.108 17.5398C21.4527 17.7784 21.7367 18.0852 21.9602 18.4602C22.1837 18.8352 22.2955 19.2955 22.2955 19.8409C22.2955 20.4697 22.1307 21.0379 21.8011 21.5455C21.4754 22.053 20.9981 22.4564 20.3693 22.7557C19.7443 23.0549 18.9848 23.2045 18.0909 23.2045C17.2576 23.2045 16.536 23.0701 15.9261 22.8011C15.3201 22.5322 14.8428 22.1572 14.4943 21.6761C14.1496 21.1951 13.9545 20.6364 13.9091 20H15.3636C15.4015 20.4394 15.5492 20.803 15.8068 21.0909C16.0682 21.375 16.3977 21.5871 16.7955 21.7273C17.197 21.8636 17.6288 21.9318 18.0909 21.9318C18.6288 21.9318 19.1117 21.8447 19.5398 21.6705C19.9678 21.4924 20.3068 21.2462 20.5568 20.9318C20.8068 20.6136 20.9318 20.2424 20.9318 19.8182C20.9318 19.4318 20.8239 19.1174 20.608 18.875C20.392 18.6326 20.108 18.4356 19.7557 18.2841C19.4034 18.1326 19.0227 18 18.6136 17.8864L17.1818 17.4773C16.2727 17.2159 15.553 16.8428 15.0227 16.358C14.4924 15.8731 14.2273 15.2386 14.2273 14.4545C14.2273 13.803 14.4034 13.2348 14.7557 12.75C15.1117 12.2614 15.589 11.8826 16.1875 11.6136C16.7898 11.3409 17.4621 11.2045 18.2045 11.2045C18.9545 11.2045 19.6212 11.339 20.2045 11.608C20.7879 11.8731 21.25 12.2367 21.5909 12.6989C21.9356 13.161 22.1174 13.6856 22.1364 14.2727H20.7727Z" fill="white"/> <path d="M20.7727 14.2727C20.7045 13.697 20.428 13.25 19.9432 12.9318C19.4583 12.6136 18.8636 12.4545 18.1591 12.4545C17.6439 12.4545 17.1932 12.5379 16.8068 12.7045C16.4242 12.8712 16.125 13.1004 15.9091 13.392C15.697 13.6837 15.5909 14.0152 15.5909 14.3864C15.5909 14.697 15.6648 14.964 15.8125 15.1875C15.964 15.4072 16.1572 15.5909 16.392 15.7386C16.6269 15.8826 16.8731 16.0019 17.1307 16.0966C17.3883 16.1875 17.625 16.2614 17.8409 16.3182L19.0227 16.6364C19.3258 16.7159 19.6629 16.8258 20.0341 16.9659C20.4091 17.1061 20.767 17.2973 21.108 17.5398C21.4527 17.7784 21.7367 18.0852 21.9602 18.4602C22.1837 18.8352 22.2955 19.2955 22.2955 19.8409C22.2955 20.4697 22.1307 21.0379 21.8011 21.5455C21.4754 22.053 20.9981 22.4564 20.3693 22.7557C19.7443 23.0549 18.9848 23.2045 18.0909 23.2045C17.2576 23.2045 16.536 23.0701 15.9261 22.8011C15.3201 22.5322 14.8428 22.1572 14.4943 21.6761C14.1496 21.1951 13.9545 20.6364 13.9091 20H15.3636C15.4015 20.4394 15.5492 20.803 15.8068 21.0909C16.0682 21.375 16.3977 21.5871 16.7955 21.7273C17.197 21.8636 17.6288 21.9318 18.0909 21.9318C18.6288 21.9318 19.1117 21.8447 19.5398 21.6705C19.9678 21.4924 20.3068 21.2462 20.5568 20.9318C20.8068 20.6136 20.9318 20.2424 20.9318 19.8182C20.9318 19.4318 20.8239 19.1174 20.608 18.875C20.392 18.6326 20.108 18.4356 19.7557 18.2841C19.4034 18.1326 19.0227 18 18.6136 17.8864L17.1818 17.4773C16.2727 17.2159 15.553 16.8428 15.0227 16.358C14.4924 15.8731 14.2273 15.2386 14.2273 14.4545C14.2273 13.803 14.4034 13.2348 14.7557 12.75C15.1117 12.2614 15.589 11.8826 16.1875 11.6136C16.7898 11.3409 17.4621 11.2045 18.2045 11.2045C18.9545 11.2045 19.6212 11.339 20.2045 11.608C20.7879 11.8731 21.25 12.2367 21.5909 12.6989C21.9356 13.161 22.1174 13.6856 22.1364 14.2727H20.7727Z" fill="white"/>
<line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/> <line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/>
</symbol> </symbol>
<symbol id="icon-ibp-box" viewBox="0 0 35 34" fill="none">
<rect x="1" y="1" width="33" height="32" stroke="white" stroke-width="2"/>
<path d="M16.4659 9.81818V20H15.233V9.81818H16.4659Z" fill="white"/>
<line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/>
</symbol>
<symbol id="icon-gated-box" viewBox="0 0 35 34" fill="none"> <symbol id="icon-gated-box" viewBox="0 0 35 34" fill="none">
<rect x="1" y="1" width="33" height="32" stroke="white" stroke-width="2"/> <rect x="1" y="1" width="33" height="32" stroke="white" stroke-width="2"/>
<path d="M14.4091 23V11.3636H18.3409C19.2538 11.3636 20 11.5284 20.5795 11.858C21.1629 12.1837 21.5947 12.625 21.875 13.1818C22.1553 13.7386 22.2955 14.3598 22.2955 15.0455C22.2955 15.7311 22.1553 16.3542 21.875 16.9148C21.5985 17.4754 21.1705 17.9223 20.5909 18.2557C20.0114 18.5852 19.2689 18.75 18.3636 18.75H15.5455V17.5H18.3182C18.9432 17.5 19.4451 17.392 19.8239 17.1761C20.2027 16.9602 20.4773 16.6686 20.6477 16.3011C20.822 15.9299 20.9091 15.5114 20.9091 15.0455C20.9091 14.5795 20.822 14.1629 20.6477 13.7955C20.4773 13.428 20.2008 13.1402 19.8182 12.9318C19.4356 12.7197 18.928 12.6136 18.2955 12.6136H15.8182V23H14.4091Z" fill="white"/> <path d="M14.4091 23V11.3636H18.3409C19.2538 11.3636 20 11.5284 20.5795 11.858C21.1629 12.1837 21.5947 12.625 21.875 13.1818C22.1553 13.7386 22.2955 14.3598 22.2955 15.0455C22.2955 15.7311 22.1553 16.3542 21.875 16.9148C21.5985 17.4754 21.1705 17.9223 20.5909 18.2557C20.0114 18.5852 19.2689 18.75 18.3636 18.75H15.5455V17.5H18.3182C18.9432 17.5 19.4451 17.392 19.8239 17.1761C20.2027 16.9602 20.4773 16.6686 20.6477 16.3011C20.822 15.9299 20.9091 15.5114 20.9091 15.0455C20.9091 14.5795 20.822 14.1629 20.6477 13.7955C20.4773 13.428 20.2008 13.1402 19.8182 12.9318C19.4356 12.7197 18.928 12.6136 18.2955 12.6136H15.8182V23H14.4091Z" fill="white"/>
<line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/> <line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/>
</symbol> </symbol>
<symbol id="icon-esb-button" viewBox="0 0 35 34" fill="none"> <symbol id="icon-esb-button" viewBox="0 0 35 34" fill="none">
<rect x="1" y="1" width="33" height="32" stroke="white" stroke-width="2"/> <rect x="1" y="1" width="31" height="30" stroke="white" stroke-width="2"/>
<line y1="32" x2="35" y2="32" stroke="white" stroke-width="4"/> <line x1="0.0576497" y1="28.5011" x2="33.0333" y2="29.7694" stroke="white" stroke-width="3"/>
<circle cx="17.5" cy="16.5" r="7.5" fill="white"/> <path d="M13.233 20V9.81818H19.3778V10.9119H14.4659V14.3523H19.0597V15.446H14.4659V18.9062H19.4574V20H13.233Z" fill="white"/>
</symbol>
<symbol id="icon-hold-button" viewBox="0 0 35 34" fill="none">
<rect x="1" y="1" width="31" height="30" stroke="white" stroke-width="2"/>
<line x1="0.0576497" y1="28.5011" x2="33.0333" y2="29.7694" stroke="white" stroke-width="3"/>
<path d="M12.233 19V8.81818H13.4659V13.3523H18.8949V8.81818H20.1278V19H18.8949V14.446H13.4659V19H12.233Z" fill="white"/>
</symbol>
<symbol id="icon-unattenged-button" viewBox="0 0 35 34" fill="none">
<rect x="1" y="1" width="31" height="30" stroke="white" stroke-width="2"/>
<line x1="0.0576497" y1="28.5011" x2="33.0333" y2="29.7694" stroke="white" stroke-width="3"/>
<path d="M12.0824 21L9.2983 10.8182H10.5511L12.679 19.1108H12.7784L14.946 10.8182H16.3381L18.5057 19.1108H18.6051L20.733 10.8182H21.9858L19.2017 21H17.929L15.6818 12.8864H15.6023L13.3551 21H12.0824Z" fill="white"/>
</symbol> </symbol>
<symbol id="icon-psl-light" viewBox="0 0 30 30" fill="none"> <symbol id="icon-psl-light" viewBox="0 0 30 30" fill="none">
<circle cx="15" cy="15" r="14.5" stroke="white"/> <circle cx="15" cy="15" r="14.5" stroke="white"/>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

@ -1 +1 @@
Subproject commit 0ed6b1d451f617804d608ede072121a0f1e36fb5 Subproject commit fed626ac4b0d1b2696026438d32fe812ebd00ac2

View File

@ -148,6 +148,12 @@
<flood-gate-property <flood-gate-property
v-else-if="drawStore.selectedGraphicType === FloodGate.Type" v-else-if="drawStore.selectedGraphicType === FloodGate.Type"
></flood-gate-property> ></flood-gate-property>
<hold-button-property
v-else-if="drawStore.selectedGraphicType === HoldButton.Type"
></hold-button-property>
<unattenged-button-property
v-else-if="drawStore.selectedGraphicType === UnattengedButton.Type"
></unattenged-button-property>
</q-card-section> </q-card-section>
</template> </template>
<template v-else-if="drawStore.selectedGraphics.length > 1"> <template v-else-if="drawStore.selectedGraphics.length > 1">
@ -232,6 +238,10 @@ import CarWashingProperty from './properties/CarWashingProperty.vue';
import { CarWashing } from 'src/graphics/carWashing/CarWashing'; import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { FloodGate } from 'src/graphics/floodGate/FloodGate'; import { FloodGate } from 'src/graphics/floodGate/FloodGate';
import FloodGateProperty from './properties/FloodGateProperty.vue'; import FloodGateProperty from './properties/FloodGateProperty.vue';
import { HoldButton } from 'src/graphics/holdButton/HoldButton';
import HoldButtonProperty from './properties/HoldButtonProperty.vue';
import { UnattengedButton } from 'src/graphics/unattengedButton/UnattengedButton';
import UnattengedButtonProperty from './properties/UnattengedButtonProperty.vue';
const drawStore = useDrawStore(); const drawStore = useDrawStore();
</script> </script>

View File

@ -0,0 +1,708 @@
<!-- eslint-disable vue/no-mutating-props -->
<template>
<draggable-dialog
seamless
title="联锁编号映射数据"
v-model="showLianSuoBianHao"
@hide="dialogHide"
:width="600"
:height="500"
>
<q-splitter v-model="splitterModel" style="height: 480px">
<template v-slot:before>
<q-tabs
v-model="tab"
vertical
class="text-teal"
@update:model-value="tabUpdate"
>
<q-tab name="station" label="联锁站" />
<q-tab name="turnout" label="道岔" />
<q-tab name="screenDoor" label="屏蔽门" />
<q-tab name="signal" label="信号机" />
<q-tab name="section" label="区段" />
<q-tab name="floodGate" label="防淹门" />
<q-tab name="spksSwitch" label="SPKS" />
<q-tab name="garageDoor" label="车库门" />
<q-tab name="carWashing" label="洗车机" />
<q-tab name="esbButton" label="紧急停车按钮" />
<q-tab name="holdButton" label="扣车按钮"></q-tab>
<q-tab name="unattengedButton" label="无人折返按钮"></q-tab>
</q-tabs>
</template>
<template v-slot:after>
<q-tab-panels
v-model="tab"
animated
swipeable
vertical
transition-prev="jump-up"
transition-next="jump-up"
>
<q-tab-panel name="station">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in stationOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="turnout">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in turnoutOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="screenDoor">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in screenDoorOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="signal">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in signalOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="section">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in sectionOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="floodGate">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in floodGateOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="spksSwitch">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in spksSwitchOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="garageDoor">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in garageDoorOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="carWashing">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in carWashingOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="esbButton">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in esbButtonOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="holdButton">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in holdButtonOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
<q-tab-panel name="unattengedButton">
<div class="row" style="justify-content: space-around">
<template :key="item.id" v-for="item in unattengedButtonOptions">
<q-input
outlined
class="q-mt-sm"
v-model.number="item.index"
type="number"
:label="item.name + '联锁编号:'"
/>
</template>
</div>
</q-tab-panel>
</q-tab-panels>
</template>
</q-splitter>
</draggable-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import DraggableDialog from 'src/components/common/DraggableDialog.vue';
import { Station } from 'src/graphics/station/Station';
import { useDrawStore } from 'src/stores/draw-store';
import { Turnout } from 'src/graphics/turnout/Turnout';
import { ScreenDoor } from 'src/graphics/screenDoor/ScreenDoor';
import { Platform } from 'src/graphics/platform/Platform';
import { Signal } from 'src/graphics/signal/Signal';
import { Section } from 'src/graphics/section/Section';
import { FloodGate } from 'src/graphics/floodGate/FloodGate';
import { SpksSwitch } from 'src/graphics/spksSwitch/SpksSwitch';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { loadLianSuoData, setLianSuoData } from 'src/drawApp/commonApp';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { EsbButton } from 'src/graphics/esbButton/EsbButton';
import { HoldButton } from 'src/graphics/holdButton/HoldButton';
import { UnattengedButton } from 'src/graphics/unattengedButton/UnattengedButton';
const drawStore = useDrawStore();
const stationOptions = ref<{ id: number; name: string; index: number }[]>([]);
const turnoutOptions = ref<{ id: number; name: string; index: number }[]>([]);
const screenDoorOptions = ref<{ id: number; name: string; index: number }[]>(
[]
);
const signalOptions = ref<{ id: number; name: string; index: number }[]>([]);
const sectionOptions = ref<{ id: number; name: string; index: number }[]>([]);
const floodGateOptions = ref<{ id: number; name: string; index: number }[]>([]);
const spksSwitchOptions = ref<{ id: number; name: string; index: number }[]>(
[]
);
const garageDoorOptions = ref<{ id: number; name: string; index: number }[]>(
[]
);
const carWashingOptions = ref<{ id: number; name: string; index: number }[]>(
[]
);
const esbButtonOptions = ref<{ id: number; name: string; index: number }[]>([]);
const holdButtonOptions = ref<{ id: number; name: string; index: number }[]>(
[]
);
const unattengedButtonOptions = ref<
{ id: number; name: string; index: number }[]
>([]);
const tab = ref<string>('');
const splitterModel = ref<number>(20);
const showLianSuoBianHao = ref(true);
const drawApp = drawStore.getDrawApp();
let lianSuoMapData = new Map();
onMounted(() => {
lianSuoMapData = new Map();
const lianSuoData = loadLianSuoData();
lianSuoData.stations.forEach((s) => {
lianSuoMapData.set(s.id, s.index);
});
lianSuoData.switchs.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.screenDoors.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.signals.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.sections.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.garageDoors.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.spksSwitchs.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.floodGates.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.carWashing.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.esbButtons.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.holdButtons.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
lianSuoData.unattengedButtons.forEach((t) => {
lianSuoMapData.set(t.id, t.index);
});
stationUpdateData();
stationUpdateData();
turnoutUpdateData();
screenDoorUpdateData();
signalUpdateData();
sectionUpdateData();
floodGateUpdateData();
spksSwitchUpdateData();
garageDoorUpdateData();
carWashingUpdateData();
esbButtonUpdateData();
holdButtonUpdateData();
unattengedButtonUpdateData();
tab.value = 'station';
});
function stationUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const stations = drawApp.queryStore.queryByType<Station>(Station.Type);
stations.forEach((sta) => {
if (sta.datas.concentrationStations) {
const index = lianSuoMapData.get(sta.datas.id) || 0;
list.push({
id: sta.datas.id,
name: sta.datas.stationName,
index: index,
});
stationOptions.value = list;
}
});
}
function turnoutUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const turnouts = drawApp.queryStore.queryByType<Turnout>(Turnout.Type);
turnouts.forEach((turnout) => {
let name = turnout.datas.code;
if (turnout.datas.centralizedStations.length > 0) {
turnout.datas.centralizedStations.forEach((id) => {
const station = drawApp.queryStore.queryById<Station>(id);
name = name + '-' + station.datas.stationName;
});
}
const index = lianSuoMapData.get(turnout.datas.id) || 0;
list.push({ id: turnout.datas.id, name: name, index: index });
turnoutOptions.value = list;
});
}
function screenDoorUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const screenDoors = drawApp.queryStore.queryByType<ScreenDoor>(
ScreenDoor.Type
);
screenDoors.forEach((screenDoor) => {
let name = screenDoor.datas.code;
if (screenDoor.datas.refPlatform) {
const stand = drawApp.queryStore.queryById<Platform>(
screenDoor.datas.refPlatform
);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(screenDoor.datas.id) || 0;
list.push({
id: screenDoor.datas.id,
name: name,
index: index,
});
screenDoorOptions.value = list;
});
}
function signalUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const signals = drawApp.queryStore.queryByType<Signal>(Signal.Type);
signals.forEach((signal) => {
let name = signal.datas.code;
if (signal.datas.centralizedStations.length > 0) {
signal.datas.centralizedStations.forEach((id) => {
const station = drawApp.queryStore.queryById<Station>(id);
name = name + '-' + station.datas.stationName;
});
}
const index = lianSuoMapData.get(signal.datas.id) || 0;
list.push({
id: signal.datas.id,
name: name,
index: index,
});
signalOptions.value = list;
});
}
function sectionUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const sections = drawApp.queryStore.queryByType<Section>(Section.Type);
sections.forEach((section) => {
let name = section.datas.code;
if (section.datas.centralizedStations.length > 0) {
section.datas.centralizedStations.forEach((id) => {
const station = drawApp.queryStore.queryById<Station>(id);
name = name + '-' + station.datas.stationName;
});
}
const index = lianSuoMapData.get(section.datas.id) || 0;
list.push({
id: section.datas.id,
name: name,
index: index,
});
sectionOptions.value = list;
});
}
function floodGateUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const floodGates = drawApp.queryStore.queryByType<FloodGate>(FloodGate.Type);
floodGates.forEach((floodGate) => {
let name = floodGate.datas.code;
if (floodGate.datas.centralizedStations.length > 0) {
floodGate.datas.centralizedStations.forEach((id) => {
const station = drawApp.queryStore.queryById<Station>(id);
name = name + '-' + station.datas.stationName;
});
}
const index = lianSuoMapData.get(floodGate.datas.id) || 0;
list.push({
id: floodGate.datas.id,
name: name,
index: index,
});
floodGateOptions.value = list;
});
}
function spksSwitchUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const spksSwitches = drawApp.queryStore.queryByType<SpksSwitch>(
SpksSwitch.Type
);
spksSwitches.forEach((spksSwitch) => {
let name = spksSwitch.datas.code;
if (spksSwitch.datas.refStand) {
const stand = drawApp.queryStore.queryById<Platform>(
spksSwitch.datas.refStand
);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(spksSwitch.datas.id) || 0;
list.push({
id: spksSwitch.datas.id,
name: name,
index: index,
});
spksSwitchOptions.value = list;
});
}
function garageDoorUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const garageDoors = drawApp.queryStore.queryByType<GarageDoor>(
GarageDoor.Type
);
garageDoors.forEach((garageDoor) => {
let name = garageDoor.code;
if (garageDoor.datas.centralizedStations.length > 0) {
garageDoor.datas.centralizedStations.forEach((id) => {
const station = drawApp.queryStore.queryById<Station>(id);
name = name + '-' + station.datas.stationName;
});
}
const index = lianSuoMapData.get(garageDoor.datas.id) || 0;
list.push({
id: garageDoor.datas.id,
name: name,
index: index,
});
garageDoorOptions.value = list;
});
}
function carWashingUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const carWashings = drawApp.queryStore.queryByType<CarWashing>(
CarWashing.Type
);
carWashings.forEach((carWashing) => {
let name = carWashing.code;
if (carWashing.datas.centralizedStations.length > 0) {
carWashing.datas.centralizedStations.forEach((id) => {
const station = drawApp.queryStore.queryById<Station>(id);
name = name + '-' + station.datas.stationName;
});
}
const index = lianSuoMapData.get(carWashing.datas.id) || 0;
list.push({
id: carWashing.datas.id,
name: name,
index: index,
});
carWashingOptions.value = list;
});
}
function esbButtonUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const esbs = drawApp.queryStore.queryByType<EsbButton>(EsbButton.Type);
esbs.forEach((esb) => {
let name = esb.datas.code;
if (esb.datas.refStand) {
const stand = drawApp.queryStore.queryById<Platform>(esb.datas.refStand);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(esb.datas.id) || 0;
list.push({
id: esb.datas.id,
name: name,
index: index,
});
esbButtonOptions.value = list;
});
}
function holdButtonUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const holdButtons = drawApp.queryStore.queryByType<HoldButton>(
HoldButton.Type
);
holdButtons.forEach((holdButton) => {
let name = holdButton.datas.code;
if (holdButton.datas.refStand) {
const stand = drawApp.queryStore.queryById<Platform>(
holdButton.datas.refStand
);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(holdButton.datas.id) || 0;
list.push({
id: holdButton.datas.id,
name: name,
index: index,
});
holdButtonOptions.value = list;
});
}
function unattengedButtonUpdateData() {
const list: { id: number; name: string; index: number }[] = [];
const unattengedButtons = drawApp.queryStore.queryByType<UnattengedButton>(
UnattengedButton.Type
);
unattengedButtons.forEach((unattengedButton) => {
let name = unattengedButton.datas.code;
if (unattengedButton.datas.refStand) {
const stand = drawApp.queryStore.queryById<Platform>(
unattengedButton.datas.refStand
);
name = name + '-' + stand.datas.code;
if (stand.datas.refStation) {
const station = drawApp.queryStore.queryById<Station>(
stand.datas.refStation
);
name = name + '-' + station.datas.stationName;
}
}
const index = lianSuoMapData.get(unattengedButton.datas.id) || 0;
list.push({
id: unattengedButton.datas.id,
name: name,
index: index,
});
unattengedButtonOptions.value = list;
});
}
function tabUpdate() {
switch (tab.value) {
case 'station':
stationUpdateData();
break;
case 'turnout':
turnoutUpdateData();
break;
case 'screenDoor':
screenDoorUpdateData();
break;
case 'signal':
signalUpdateData();
break;
case 'section':
sectionUpdateData();
break;
case 'floodGate':
floodGateUpdateData();
break;
case 'spksSwitch':
spksSwitchUpdateData();
break;
case 'garageDoor':
garageDoorUpdateData();
break;
case 'carWashing':
carWashingUpdateData();
break;
case 'esbButton':
esbButtonUpdateData();
break;
case 'holdButton':
holdButtonUpdateData();
break;
case 'unattengedButton':
unattengedButtonUpdateData();
break;
}
}
function dialogHide() {
const newLianSuoData = new graphicData.LianSuoData();
stationOptions.value.forEach((st) => {
newLianSuoData.stations.push(
new graphicData.LianSuoIndexData({ id: st.id, index: st.index })
);
});
turnoutOptions.value.forEach((tu) => {
newLianSuoData.switchs.push(
new graphicData.LianSuoIndexData({ id: tu.id, index: tu.index })
);
});
screenDoorOptions.value.forEach((sd) => {
newLianSuoData.screenDoors.push(
new graphicData.LianSuoIndexData({ id: sd.id, index: sd.index })
);
});
sectionOptions.value.forEach((se) => {
newLianSuoData.sections.push(
new graphicData.LianSuoIndexData({ id: se.id, index: se.index })
);
});
signalOptions.value.forEach((si) => {
newLianSuoData.signals.push(
new graphicData.LianSuoIndexData({ id: si.id, index: si.index })
);
});
spksSwitchOptions.value.forEach((ss) => {
newLianSuoData.spksSwitchs.push(
new graphicData.LianSuoIndexData({ id: ss.id, index: ss.index })
);
});
floodGateOptions.value.forEach((fg) => {
newLianSuoData.floodGates.push(
new graphicData.LianSuoIndexData({ id: fg.id, index: fg.index })
);
});
garageDoorOptions.value.forEach((gd) => {
newLianSuoData.garageDoors.push(
new graphicData.LianSuoIndexData({ id: gd.id, index: gd.index })
);
});
carWashingOptions.value.forEach((cw) => {
newLianSuoData.carWashing.push(
new graphicData.LianSuoIndexData({ id: cw.id, index: cw.index })
);
});
esbButtonOptions.value.forEach((eb) => {
newLianSuoData.esbButtons.push(
new graphicData.LianSuoIndexData({ id: eb.id, index: eb.index })
);
});
holdButtonOptions.value.forEach((hb) => {
newLianSuoData.holdButtons.push(
new graphicData.LianSuoIndexData({ id: hb.id, index: hb.index })
);
});
unattengedButtonOptions.value.forEach((ub) => {
newLianSuoData.unattengedButtons.push(
new graphicData.LianSuoIndexData({ id: ub.id, index: ub.index })
);
});
setLianSuoData(newLianSuoData);
}
</script>
<style scoped></style>

View File

@ -66,10 +66,12 @@ onMounted(() => {
resp.data.forEach((element: { connType: number }) => { resp.data.forEach((element: { connType: number }) => {
if (element.connType === 1) { if (element.connType === 1) {
list.push({ label: '半实物', value: 1 }); list.push({ label: '半实物', value: 1 });
} else if (element.connType === 2) { } else if (element.connType === 3) {
list.push({ label: 'PC仿真', value: 2 }); list.push({ label: 'PC仿真A', value: 3 });
// } else if (element.connType === 0) { // } else if (element.connType === 0) {
// list.push({ label: '', value: 0 }); // list.push({ label: '', value: 0 });
} else if (element.connType === 4) {
list.push({ label: 'PC仿真B', value: 4 });
} }
}); });
connectOptions.value = list; connectOptions.value = list;

View File

@ -0,0 +1,55 @@
<template>
<q-form>
<q-input
outlined
readonly
v-model="holdButtonModel.id"
label="id"
hint=""
/>
<q-input
outlined
style="margin-top: 10px"
v-model="holdButtonModel.code"
@blur="onUpdate"
label="编号"
/>
<q-select
outlined
style="margin-top: 10px"
v-model="holdButtonModel.refStand"
:options="platformList"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="关联站台"
></q-select>
</q-form>
</template>
<script setup lang="ts">
import { useFormData } from 'src/components/DrawAppFormUtils';
import { HoldButtonData } from 'src/drawApp/graphics/HoldButtonInteraction';
import { Platform } from 'src/graphics/platform/Platform';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive } from 'vue';
const drawStore = useDrawStore();
const { data: holdButtonModel, onUpdate } = useFormData(
new HoldButtonData(),
drawStore.getDrawApp()
);
const platformList: { label: string; value: number }[] = reactive([]);
onMounted(() => {
const platforms = drawStore
.getDrawApp()
.queryStore.queryByType<Platform>(Platform.Type);
platforms.forEach((p) => {
platformList.push({
value: p.id,
label: `${p.datas.code}`,
});
});
});
</script>

View File

@ -24,17 +24,6 @@
@update:model-value="onUpdate" @update:model-value="onUpdate"
label="关联站台" label="关联站台"
></q-select> ></q-select>
<q-select
outlined
style="margin-top: 10px"
v-model="spksSwitchModel.refSections"
:options="sectionList"
:multiple="true"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="关联物理区段"
></q-select>
</q-form> </q-form>
</template> </template>

View File

@ -0,0 +1,55 @@
<template>
<q-form>
<q-input
outlined
readonly
v-model="unattengedButtonModel.id"
label="id"
hint=""
/>
<q-input
outlined
style="margin-top: 10px"
v-model="unattengedButtonModel.code"
@blur="onUpdate"
label="编号"
/>
<q-select
outlined
style="margin-top: 10px"
v-model="unattengedButtonModel.refStand"
:options="platformList"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="关联站台"
></q-select>
</q-form>
</template>
<script setup lang="ts">
import { useFormData } from 'src/components/DrawAppFormUtils';
import { UnattengedButtonData } from 'src/drawApp/graphics/UnattengedButtonInteraction';
import { Platform } from 'src/graphics/platform/Platform';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive } from 'vue';
const drawStore = useDrawStore();
const { data: unattengedButtonModel, onUpdate } = useFormData(
new UnattengedButtonData(),
drawStore.getDrawApp()
);
const platformList: { label: string; value: number }[] = reactive([]);
onMounted(() => {
const platforms = drawStore
.getDrawApp()
.queryStore.queryByType<Platform>(Platform.Type);
platforms.forEach((p) => {
platformList.push({
value: p.id,
label: `${p.datas.code}`,
});
});
});
</script>

View File

@ -455,13 +455,17 @@ function trainLengthFormat(v: number) {
function connStateFormat(v: boolean) { function connStateFormat(v: boolean) {
return v ? '已连接' : '未连接'; return v ? '已连接' : '未连接';
} }
// PC_SIM_A = 3; //PC仿
// PC_SIM_B = 4; //PC仿
function connTypeFormat(v: state.TrainConnState.TrainConnType) { function connTypeFormat(v: state.TrainConnState.TrainConnType) {
if (v === state.TrainConnState.TrainConnType.NONE) { if (v === state.TrainConnState.TrainConnType.NONE) {
return '无'; return '无';
} else if (v === state.TrainConnState.TrainConnType.PC_SIM) { } else if (v === state.TrainConnState.TrainConnType.PC_SIM_A) {
return 'PC仿真'; return 'PC仿真A';
} else if (v === state.TrainConnState.TrainConnType.VOBC) { } else if (v === state.TrainConnState.TrainConnType.VOBC) {
return '半实物'; return '半实物';
} else if (v === state.TrainConnState.TrainConnType.PC_SIM_B) {
return 'PC仿真B';
} else { } else {
return '无'; return '无';
} }

View File

@ -5,7 +5,12 @@ function getHost(): string {
return 'joylink.club/bjrtsts-server'; return 'joylink.club/bjrtsts-server';
} else if (process.env.URL_ENV == 'local_test') { } else if (process.env.URL_ENV == 'local_test') {
return '192.168.33.233:9091'; return '192.168.33.233:9091';
} else if (process.env.URL_ENV == 'local_pxf') {
//北京现场
return '172.29.5.168/bjrtss-server';
} }
// return '192.168.3.7:9091'; // return '192.168.3.7:9091';
// return '192.168.3.47:9091'; // return '192.168.3.47:9091';
// return '192.168.3.37:9091'; // return '192.168.3.37:9091';
@ -26,7 +31,7 @@ export function getHttpBase() {
export function getWebsocketUrl() { export function getWebsocketUrl() {
let protocol = 'ws'; let protocol = 'ws';
let host = '192.168.33.233'; let host = '192.168.33.233:9091';
// let host = 'test.joylink.club'; // let host = 'test.joylink.club';
let port = '8083'; let port = '8083';
let url = `${protocol}://${host}:${port}`; let url = `${protocol}://${host}:${port}`;
@ -42,6 +47,8 @@ export function getWebsocketUrl() {
url = `${protocol}://${host}`; url = `${protocol}://${host}`;
} else if (process.env.URL_ENV == 'local_test') { } else if (process.env.URL_ENV == 'local_test') {
host = '192.168.33.233'; host = '192.168.33.233';
} else if (process.env.URL_ENV == 'local_pxf') {
host = '172.29.5.168';
} }
return `${url}/mqtt`; return `${url}/mqtt`;

View File

@ -24,6 +24,8 @@ import { PslBox } from 'src/graphics/pslBox/PslBox';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor'; import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import { CarWashing } from 'src/graphics/carWashing/CarWashing'; import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { FloodGate } from 'src/graphics/floodGate/FloodGate'; import { FloodGate } from 'src/graphics/floodGate/FloodGate';
import { HoldButton } from 'src/graphics/holdButton/HoldButton';
import { UnattengedButton } from 'src/graphics/unattengedButton/UnattengedButton';
export const drawCommonLayerList = [ export const drawCommonLayerList = [
// 图层列表 默认显示的图层defaultShow: true // 图层列表 默认显示的图层defaultShow: true
@ -61,4 +63,6 @@ export const drawCommonLayerList = [
{ label: '车库门', value: GarageDoor.Type, defaultShow: true }, { label: '车库门', value: GarageDoor.Type, defaultShow: true },
{ label: '洗车机', value: CarWashing.Type, defaultShow: true }, { label: '洗车机', value: CarWashing.Type, defaultShow: true },
{ label: '防淹门', value: FloodGate.Type, defaultShow: true }, { label: '防淹门', value: FloodGate.Type, defaultShow: true },
{ label: '扣车按钮', value: HoldButton.Type, defaultShow: true },
{ label: '无人折返按钮', value: UnattengedButton.Type, defaultShow: true },
]; ];

View File

@ -91,6 +91,10 @@ import {
SpksSwitchData, SpksSwitchData,
DrawSpksSwitchInteraction, DrawSpksSwitchInteraction,
} from './graphics/SpksSwitchInteraction'; } from './graphics/SpksSwitchInteraction';
import { HoldButton, HoldButtonTemplate } from 'src/graphics/holdButton/HoldButton';
import { DrawHoldButtonInteraction, HoldButtonData } from './graphics/HoldButtonInteraction';
import { UnattengedButton, UnattengedButtonTemplate } from 'src/graphics/unattengedButton/UnattengedButton';
import { UnattengedButtonData, DrawUnattengedButtonInteraction } from './graphics/UnattengedButtonInteraction';
import { GatedBox, GatedBoxTemplate } from 'src/graphics/gatedBox/GatedBox'; import { GatedBox, GatedBoxTemplate } from 'src/graphics/gatedBox/GatedBox';
import { import {
GatedBoxData, GatedBoxData,
@ -103,6 +107,8 @@ import {
// EsbButtonState, // EsbButtonState,
// } from './graphics/EsbButtonInteraction'; // } from './graphics/EsbButtonInteraction';
import { SpksSwitchDraw } from 'src/graphics/spksSwitch/SpksSwitchDrawAssistant'; import { SpksSwitchDraw } from 'src/graphics/spksSwitch/SpksSwitchDrawAssistant';
import { HoldButtonDraw } from 'src/graphics/holdButton/HoldButtonDrawAssistant';
import { UnattengedButtonDraw } from 'src/graphics/unattengedButton/UnattengedButtonDrawAssistant';
import { GatedBoxDraw } from 'src/graphics/gatedBox/GatedBoxDrawAssistant'; import { GatedBoxDraw } from 'src/graphics/gatedBox/GatedBoxDrawAssistant';
// import { EsbButtonDraw } from 'src/graphics/esbButton/EsbButtonDrawAssistant'; // import { EsbButtonDraw } from 'src/graphics/esbButton/EsbButtonDrawAssistant';
import { TransponderDraw } from 'src/graphics/transponder/TransponderDrawAssistant'; import { TransponderDraw } from 'src/graphics/transponder/TransponderDrawAssistant';
@ -228,6 +234,8 @@ export function initCommonDrawApp(app: IDrawApp) {
); );
new StopPositionDraw(app, new StopPositionTemplate(new StopPositionData())); new StopPositionDraw(app, new StopPositionTemplate(new StopPositionData()));
new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData())); new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData()));
new HoldButtonDraw(app, new HoldButtonTemplate(new HoldButtonData()));
new UnattengedButtonDraw(app, new UnattengedButtonTemplate(new UnattengedButtonData()));
new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData())); new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData()));
// new EsbButtonDraw( // new EsbButtonDraw(
// app, // app,
@ -264,6 +272,8 @@ export function initCommonDrawApp(app: IDrawApp) {
DrawSignalInteraction.init(app); DrawSignalInteraction.init(app);
DrawStopPositionInteraction.init(app); DrawStopPositionInteraction.init(app);
DrawSpksSwitchInteraction.init(app); DrawSpksSwitchInteraction.init(app);
DrawHoldButtonInteraction.init(app);
DrawUnattengedButtonInteraction.init(app);
DrawGatedBoxInteraction.init(app); DrawGatedBoxInteraction.init(app);
// DrawEsbButtonInteraction.init(app); // DrawEsbButtonInteraction.init(app);
@ -293,6 +303,7 @@ export function initCommonDrawApp(app: IDrawApp) {
UniqueIdPrefix = new graphicData.UniqueIdOfStationLayout(); UniqueIdPrefix = new graphicData.UniqueIdOfStationLayout();
screenDoorConfig = new graphicData.ScreenDoorConfig(); screenDoorConfig = new graphicData.ScreenDoorConfig();
generateAxleCountingConfig = new graphicData.GenerateAxleCountingConfig(); generateAxleCountingConfig = new graphicData.GenerateAxleCountingConfig();
lianSuoData = new graphicData.LianSuoData();
kilometerConvertList = []; kilometerConvertList = [];
sectionCodePointList = []; sectionCodePointList = [];
otherLineList = []; otherLineList = [];
@ -351,10 +362,10 @@ export function initCommonDrawApp(app: IDrawApp) {
prev.localToCanvasPoint(prev.getStartPoint()), prev.localToCanvasPoint(prev.getStartPoint()),
mousePos mousePos
) > ) >
distance2( distance2(
cur.localToCanvasPoint(cur.getStartPoint()), cur.localToCanvasPoint(cur.getStartPoint()),
mousePos mousePos
)) ))
? cur ? cur
: prev; : prev;
}); });
@ -400,6 +411,9 @@ export function loadCommonDrawDatas(
UniqueIdPrefix = storage.UniqueIdPrefix; UniqueIdPrefix = storage.UniqueIdPrefix;
screenDoorConfig = storage.screenDoorConfig; screenDoorConfig = storage.screenDoorConfig;
generateAxleCountingConfig = storage.generateAxleCountingConfig; generateAxleCountingConfig = storage.generateAxleCountingConfig;
if (storage.lianSuoData) {
lianSuoData = storage.lianSuoData;
}
kilometerConvertList = storage.kilometerConvertList; kilometerConvertList = storage.kilometerConvertList;
sectionCodePointList = storage.sectionCodePointList; sectionCodePointList = storage.sectionCodePointList;
otherLineList = storage.otherLineList; otherLineList = storage.otherLineList;
@ -443,6 +457,12 @@ export function loadCommonDrawDatas(
storage.spksSwitchs.forEach((spksSwitch) => { storage.spksSwitchs.forEach((spksSwitch) => {
datas.push(new SpksSwitchData(spksSwitch)); datas.push(new SpksSwitchData(spksSwitch));
}); });
storage.holdButtons.forEach((holdButton) => {
datas.push(new HoldButtonData(holdButton));
})
storage.unattengedButtons.forEach((unattengedButton) => {
datas.push(new UnattengedButtonData(unattengedButton));
})
storage.gateBoxs.forEach((gatedBox) => { storage.gateBoxs.forEach((gatedBox) => {
datas.push(new GatedBoxData(gatedBox)); datas.push(new GatedBoxData(gatedBox));
}); });
@ -532,6 +552,14 @@ export function saveCommonDrawDatas(app: IDrawApp) {
} else if (SpksSwitch.Type === g.type) { } else if (SpksSwitch.Type === g.type) {
const spksSwitchData = (g as SpksSwitch).saveData(); const spksSwitchData = (g as SpksSwitch).saveData();
storage.spksSwitchs.push((spksSwitchData as SpksSwitchData).data); storage.spksSwitchs.push((spksSwitchData as SpksSwitchData).data);
} else if (HoldButton.Type === g.type) {
const holdButtonData = (g as HoldButton).saveData();
storage.holdButtons.push((holdButtonData as HoldButtonData).data);
} else if (UnattengedButton.Type === g.type) {
const unattengedButtonData = (g as UnattengedButton).saveData();
storage.unattengedButtons.push(
(unattengedButtonData as UnattengedButtonData).data
);
} else if (GatedBox.Type === g.type) { } else if (GatedBox.Type === g.type) {
const gatedBoxData = (g as GatedBox).saveData(); const gatedBoxData = (g as GatedBox).saveData();
storage.gateBoxs.push((gatedBoxData as GatedBoxData).data); storage.gateBoxs.push((gatedBoxData as GatedBoxData).data);
@ -692,6 +720,7 @@ export function saveCommonDrawDatas(app: IDrawApp) {
storage.sectionCodePointList = sectionCodePointList; storage.sectionCodePointList = sectionCodePointList;
storage.otherLineList = otherLineList; storage.otherLineList = otherLineList;
storage.stationRelateDeviceList = refDevicesList; storage.stationRelateDeviceList = refDevicesList;
storage.lianSuoData = lianSuoData;
// if (storage.generateAxleCountingConfig?.bbConnect) { // if (storage.generateAxleCountingConfig?.bbConnect) {
// storage.generateAxleCountingConfig.newbbConnect = // storage.generateAxleCountingConfig.newbbConnect =
// storage.generateAxleCountingConfig.bbConnect.map((item) => +item); // storage.generateAxleCountingConfig.bbConnect.map((item) => +item);
@ -845,6 +874,15 @@ export function setGenerateAxleCountingConfig(
generateAxleCountingConfig = newScreenDoorConfig; generateAxleCountingConfig = newScreenDoorConfig;
} }
let lianSuoData = new graphicData.LianSuoData();
export function loadLianSuoData() {
return lianSuoData;
}
export function setLianSuoData(newLianSuoData: graphicData.LianSuoData) {
lianSuoData = newLianSuoData;
}
// 其他线路数据 // 其他线路数据
let otherLineList: graphicData.OtherLine[] = []; let otherLineList: graphicData.OtherLine[] = [];
export function loadOtherLineList() { export function loadOtherLineList() {

View File

@ -0,0 +1,107 @@
import * as pb_1 from 'google-protobuf';
import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
import { IHoldButtonData, HoldButton } from 'src/graphics/holdButton/HoldButton';
import {
IGraphicApp,
GraphicInteractionPlugin,
JlGraphic,
IGraphicScene,
MenuItemOptions,
ContextMenu,
} from 'jl-graphic';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { GraphicDataBase } from './GraphicDataBase';
import { useIbpStore } from 'src/stores/ibp-store';
import { Station } from 'src/graphics/station/Station';
import { Platform } from 'src/graphics/platform/Platform';
export class HoldButtonData extends GraphicDataBase implements IHoldButtonData {
constructor(data?: graphicData.HoldButton) {
let holdButton;
if (!data) {
holdButton = new graphicData.HoldButton({
common: GraphicDataBase.defaultCommonInfo(HoldButton.Type),
});
} else {
holdButton = data;
}
super(holdButton);
}
public get data(): graphicData.HoldButton {
return this.getData<graphicData.HoldButton>();
}
get code(): string {
return this.data.code;
}
set code(v: string) {
this.data.code = v;
}
get flip(): boolean {
return this.data.flip;
}
set flip(v: boolean) {
this.data.flip = v;
}
get refStand(): number {
return this.data.refStand;
}
set refStand(v: number) {
this.data.refStand = v;
}
clone(): HoldButtonData {
return new HoldButtonData(this.data.cloneMessage());
}
copyFrom(data: HoldButtonData): void {
pb_1.Message.copyInto(data.data, this.data);
}
eq(other: HoldButtonData): boolean {
return pb_1.Message.equals(this.data, other.data);
}
}
const flipConfig: MenuItemOptions = {
name: '上下翻转',
};
const HoldButtonEditMenu: ContextMenu = ContextMenu.init({
name: '扣车按钮编辑菜单',
groups: [
{
items: [flipConfig],
},
],
});
export class DrawHoldButtonInteraction extends GraphicInteractionPlugin<HoldButton> {
static Name = 'hold_button_draw_right_menu';
constructor(app: IGraphicApp) {
super(DrawHoldButtonInteraction.Name, app);
app.registerMenu(HoldButtonEditMenu);
}
static init(app: IGraphicApp) {
return new DrawHoldButtonInteraction(app);
}
filter(...grahpics: JlGraphic[]): HoldButton[] | undefined {
return grahpics
.filter((g) => g.type === HoldButton.Type)
.map((g) => g as HoldButton);
}
bind(g: HoldButton): void {
g.on('_rightclick', this.onContextMenu, this);
}
unbind(g: HoldButton): void {
g.off('_rightclick', this.onContextMenu, this);
}
onContextMenu(e: FederatedMouseEvent) {
const target = e.target as DisplayObject;
const holdButton = target.getGraphic() as HoldButton;
this.app.updateSelected(holdButton);
flipConfig.handler = () => {
holdButton.datas.flip = !holdButton.datas.flip;
holdButton.repaint();
};
HoldButtonEditMenu.open(e.global);
}
}

View File

@ -53,12 +53,12 @@ export class SpksSwitchData extends GraphicDataBase implements ISpksSwitchData {
set refStand(v: number) { set refStand(v: number) {
this.data.refStand = v; this.data.refStand = v;
} }
get refSections(): number[] { // get refSections(): number[] {
return this.data.refSections; // return this.data.refSections;
} // }
set refSections(v: number[]) { // set refSections(v: number[]) {
this.data.refSections = v; // this.data.refSections = v;
} // }
clone(): SpksSwitchData { clone(): SpksSwitchData {
return new SpksSwitchData(this.data.cloneMessage()); return new SpksSwitchData(this.data.cloneMessage());
} }
@ -114,36 +114,3 @@ export class DrawSpksSwitchInteraction extends GraphicInteractionPlugin<SpksSwit
SpksSwitchEditMenu.open(e.global); SpksSwitchEditMenu.open(e.global);
} }
} }
export class SpksSwitchOperationInteraction extends GraphicInteractionPlugin<SpksSwitch> {
static Name = 'spks_switch_operation';
constructor(app: IGraphicScene) {
super(SpksSwitchOperationInteraction.Name, app);
}
static init(app: IGraphicScene) {
return new SpksSwitchOperationInteraction(app);
}
filter(...grahpics: JlGraphic[]): SpksSwitch[] | undefined {
return grahpics.filter((g): g is SpksSwitch => g instanceof SpksSwitch);
}
bind(g: SpksSwitch): void {
g.eventMode = 'static';
g.cursor = 'pointer';
g.on('_leftclick', this.onLeftClick, this);
}
unbind(g: SpksSwitch): void {
g.off('_leftclick', this.onLeftClick, this);
}
onLeftClick(e: FederatedMouseEvent) {
const target = e.target as DisplayObject;
const spksSwitch = target.getGraphic() as SpksSwitch;
const stand = this.app.queryStore.queryById<Platform>(
spksSwitch.datas.refStand
);
const station = this.app.queryStore.queryById<Station>(
stand.datas.refStation
);
useIbpStore().openIbpScene(station);
}
}

View File

@ -0,0 +1,107 @@
import * as pb_1 from 'google-protobuf';
import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
import { IUnattengedButtonData, UnattengedButton } from 'src/graphics/unattengedButton/UnattengedButton';
import {
IGraphicApp,
GraphicInteractionPlugin,
JlGraphic,
IGraphicScene,
MenuItemOptions,
ContextMenu,
} from 'jl-graphic';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { GraphicDataBase } from './GraphicDataBase';
import { useIbpStore } from 'src/stores/ibp-store';
import { Station } from 'src/graphics/station/Station';
import { Platform } from 'src/graphics/platform/Platform';
export class UnattengedButtonData extends GraphicDataBase implements IUnattengedButtonData {
constructor(data?: graphicData.UnattengedButton) {
let unattengedButton;
if (!data) {
unattengedButton = new graphicData.UnattengedButton({
common: GraphicDataBase.defaultCommonInfo(UnattengedButton.Type),
});
} else {
unattengedButton = data;
}
super(unattengedButton);
}
public get data(): graphicData.UnattengedButton {
return this.getData<graphicData.UnattengedButton>();
}
get code(): string {
return this.data.code;
}
set code(v: string) {
this.data.code = v;
}
get flip(): boolean {
return this.data.flip;
}
set flip(v: boolean) {
this.data.flip = v;
}
get refStand(): number {
return this.data.refStand;
}
set refStand(v: number) {
this.data.refStand = v;
}
clone(): UnattengedButtonData {
return new UnattengedButtonData(this.data.cloneMessage());
}
copyFrom(data: UnattengedButtonData): void {
pb_1.Message.copyInto(data.data, this.data);
}
eq(other: UnattengedButtonData): boolean {
return pb_1.Message.equals(this.data, other.data);
}
}
const flipConfig: MenuItemOptions = {
name: '上下翻转',
};
const UnattengedButtonEditMenu: ContextMenu = ContextMenu.init({
name: '无人折返按钮编辑菜单',
groups: [
{
items: [flipConfig],
},
],
});
export class DrawUnattengedButtonInteraction extends GraphicInteractionPlugin<UnattengedButton> {
static Name = 'unattenged_button_draw_right_menu';
constructor(app: IGraphicApp) {
super(DrawUnattengedButtonInteraction.Name, app);
app.registerMenu(UnattengedButtonEditMenu);
}
static init(app: IGraphicApp) {
return new DrawUnattengedButtonInteraction(app);
}
filter(...grahpics: JlGraphic[]): UnattengedButton[] | undefined {
return grahpics
.filter((g) => g.type === UnattengedButton.Type)
.map((g) => g as UnattengedButton);
}
bind(g: UnattengedButton): void {
g.on('_rightclick', this.onContextMenu, this);
}
unbind(g: UnattengedButton): void {
g.off('_rightclick', this.onContextMenu, this);
}
onContextMenu(e: FederatedMouseEvent) {
const target = e.target as DisplayObject;
const unattengedButton = target.getGraphic() as UnattengedButton;
this.app.updateSelected(unattengedButton);
flipConfig.handler = () => {
unattengedButton.datas.flip = !unattengedButton.datas.flip;
unattengedButton.repaint();
};
UnattengedButtonEditMenu.open(e.global);
}
}

View File

@ -122,7 +122,6 @@ import { EsbButton, EsbButtonTemplate } from 'src/graphics/esbButton/EsbButton';
import { StopPositionData } from './graphics/StopPositionInteraction'; import { StopPositionData } from './graphics/StopPositionInteraction';
import { import {
SpksSwitchData, SpksSwitchData,
SpksSwitchOperationInteraction,
} from './graphics/SpksSwitchInteraction'; } from './graphics/SpksSwitchInteraction';
import { GatedBoxData } from './graphics/GatedBoxInteraction'; import { GatedBoxData } from './graphics/GatedBoxInteraction';
import { import {
@ -195,6 +194,8 @@ import {
FloodGateOperationInteraction, FloodGateOperationInteraction,
FloodGateState, FloodGateState,
} from './graphics/FloodGateInteraction'; } from './graphics/FloodGateInteraction';
import { HoldButton } from 'src/graphics/holdButton/HoldButton';
import { UnattengedButton } from 'src/graphics/unattengedButton/UnattengedButton';
const showOptions: MenuItemOptions = { const showOptions: MenuItemOptions = {
name: '显示控制', name: '显示控制',
@ -260,6 +261,8 @@ export const layerList = [
{ label: '车库门', value: GarageDoor.Type, defaultShow: true }, { label: '车库门', value: GarageDoor.Type, defaultShow: true },
{ label: '洗车机', value: CarWashing.Type, defaultShow: true }, { label: '洗车机', value: CarWashing.Type, defaultShow: true },
{ label: '防淹门', value: FloodGate.Type, defaultShow: true }, { label: '防淹门', value: FloodGate.Type, defaultShow: true },
{ label: '扣车按钮', value: HoldButton.Type, defaultShow: true },
{ label: '无人折返按钮', value: UnattengedButton.Type, defaultShow: true },
]; ];
let lineScene: IGraphicScene; let lineScene: IGraphicScene;
@ -343,7 +346,6 @@ export function initLineScene(lineApp: IGraphicApp, sceneName: string) {
TurnoutOperationPlugin.init(lineScene); TurnoutOperationPlugin.init(lineScene);
TransponderOperationPlugin.init(lineScene); TransponderOperationPlugin.init(lineScene);
EsbButtonOperationInteraction.init(lineScene); EsbButtonOperationInteraction.init(lineScene);
SpksSwitchOperationInteraction.init(lineScene);
AutoReturnBoxOperationInteraction.init(lineScene); AutoReturnBoxOperationInteraction.init(lineScene);
PslBoxOperateInteraction.init(lineScene); PslBoxOperateInteraction.init(lineScene);
IbpBoxOperateInteraction.init(lineScene); IbpBoxOperateInteraction.init(lineScene);

View File

@ -42,7 +42,7 @@ const esbButtonConsts = {
export class EsbButton extends JlGraphic { export class EsbButton extends JlGraphic {
static Type = 'esbButton'; static Type = 'esbButton';
codeGraph: VectorText = new VectorText(''); codeGraph: VectorText = new VectorText('');
circleBody: Graphics = new Graphics(); textGraph: VectorText = new VectorText('E');
rectBody: Graphics = new Graphics(); rectBody: Graphics = new Graphics();
lineBody: Graphics = new Graphics(); lineBody: Graphics = new Graphics();
@ -51,7 +51,7 @@ export class EsbButton extends JlGraphic {
this.addChild(this.codeGraph); this.addChild(this.codeGraph);
this.addChild(this.rectBody); this.addChild(this.rectBody);
this.addChild(this.lineBody); this.addChild(this.lineBody);
this.addChild(this.circleBody); this.addChild(this.textGraph);
this.codeGraph.name = 'esb_code'; this.codeGraph.name = 'esb_code';
} }
get code(): string { get code(): string {
@ -80,15 +80,9 @@ export class EsbButton extends JlGraphic {
} else { } else {
codeGraph.position.set(-30, 0); codeGraph.position.set(-30, 0);
} }
this.circleBody.clear(); this.textGraph.style.fill = esbButtonConsts.codeColor;
this.circleBody.beginFill( this.textGraph.setVectorFontSize(esbButtonConsts.codeFontSize);
this.state.down this.textGraph.anchor.set(0.5);
? esbButtonConsts.pressedColor
: esbButtonConsts.bodyCircleColor,
1
);
this.circleBody.drawCircle(0, 0, esbButtonConsts.bodyCircleRadius);
this.circleBody.endFill();
this.rectBody.clear(); this.rectBody.clear();
this.rectBody.beginFill(esbButtonConsts.bodyColor, 0); this.rectBody.beginFill(esbButtonConsts.bodyColor, 0);
this.rectBody.lineStyle( this.rectBody.lineStyle(

View File

@ -0,0 +1,102 @@
import { Graphics } from 'pixi.js';
import {
GraphicData,
JlGraphic,
JlGraphicTemplate,
VectorText,
} from 'jl-graphic';
export interface IHoldButtonData extends GraphicData {
get code(): string;
set code(v: string);
get flip(): boolean;
set flip(v: boolean);
get refStand(): number;
set refStand(v: number);
}
const holdButtonConsts = {
codeFontSize: 12,
codeColor: 0xffffff,
bodyLineColor: 0xffffff,
bodyLineWidth: 4,
bodyRectLineColor: 0xffffff,
bodyRectLineWidth: 2,
bodyRectWidth: 20,
bodyRectHeight: 20,
bodyColor: 0x000000,
};
export class HoldButton extends JlGraphic {
static Type = 'holdButton';
codeGraph: VectorText = new VectorText('');
rectBody: Graphics = new Graphics();
lineBody: Graphics = new Graphics();
textGraph: VectorText = new VectorText('H');
constructor() {
super(HoldButton.Type);
this.addChild(this.codeGraph);
this.addChild(this.rectBody);
this.addChild(this.lineBody);
this.addChild(this.textGraph);
this.codeGraph.name = 'hold_button_code';
}
get datas(): IHoldButtonData {
return this.getDatas<IHoldButtonData>();
}
doRepaint(): void {
const codeGraph = this.codeGraph;
codeGraph.text = this.datas.code;
codeGraph.style.fill = holdButtonConsts.codeColor;
codeGraph.setVectorFontSize(holdButtonConsts.codeFontSize);
const codeTransform = this.datas?.childTransforms?.find(
(item) => item.name === 'hold_button_code'
);
if (codeTransform) {
const position = codeTransform?.transform.position;
const rotation = codeTransform?.transform?.rotation;
codeGraph.position.set(position?.x, position?.y);
codeGraph.rotation = rotation || 0;
} else {
codeGraph.position.set(20, 0);
}
codeGraph.anchor.set(0.5);
this.textGraph.style.fill = holdButtonConsts.codeColor;
this.textGraph.setVectorFontSize(holdButtonConsts.codeFontSize);
this.textGraph.anchor.set(0.5);
this.rectBody.clear();
this.rectBody.beginFill(holdButtonConsts.bodyColor, 0);
this.rectBody.lineStyle(
holdButtonConsts.bodyRectLineWidth,
holdButtonConsts.bodyRectLineColor
);
this.rectBody.drawRect(
-holdButtonConsts.bodyRectWidth / 2,
-holdButtonConsts.bodyRectHeight / 2,
holdButtonConsts.bodyRectWidth,
holdButtonConsts.bodyRectHeight
);
this.rectBody.endFill();
this.lineBody.clear();
const lineY = this.datas.flip
? holdButtonConsts.bodyRectHeight / 2
: -holdButtonConsts.bodyRectHeight / 2;
this.lineBody.lineStyle(
holdButtonConsts.bodyLineWidth,
holdButtonConsts.bodyLineColor
);
this.lineBody.moveTo(-holdButtonConsts.bodyRectWidth / 2, lineY);
this.lineBody.lineTo(holdButtonConsts.bodyRectWidth / 2, lineY);
}
}
export class HoldButtonTemplate extends JlGraphicTemplate<HoldButton> {
constructor(dataTemplate: IHoldButtonData) {
super(HoldButton.Type, { dataTemplate });
}
new(): HoldButton {
const holdButton = new HoldButton();
holdButton.loadData(this.datas);
return holdButton;
}
}

View File

@ -0,0 +1,128 @@
import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
import {
AbsorbableLine,
AbsorbablePosition,
GraphicDrawAssistant,
GraphicInteractionPlugin,
GraphicTransformEvent,
IDrawApp,
JlGraphic,
} from 'jl-graphic';
import { IHoldButtonData, HoldButton, HoldButtonTemplate } from './HoldButton';
export interface IHoldButtonDataDrawOptions {
newData: () => IHoldButtonData;
}
export class HoldButtonDraw extends GraphicDrawAssistant<
HoldButtonTemplate,
IHoldButtonData
> {
_holdButton: HoldButton | null = null;
constructor(app: IDrawApp, template: HoldButtonTemplate) {
super(
app,
template,
'svguse:../../drawIcon.svg#icon-hold-button',
'扣车按钮HoldButton'
);
HoldButtonInteraction.init(app);
}
public get holdButton(): HoldButton {
if (!this._holdButton) {
this._holdButton = this.graphicTemplate.new();
this._holdButton.loadData(this.graphicTemplate.datas);
this.container.addChild(this._holdButton);
}
return this._holdButton;
}
onLeftUp(e: FederatedMouseEvent): void {
this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
this.createAndStore(true);
}
redraw(p: Point): void {
this.holdButton.repaint();
this.container.position.set(p.x, p.y);
}
prepareData(data: IHoldButtonData): boolean {
data.transform = this.container.saveTransform();
data.code = 'H';
return true;
}
}
/**
* 线
* @param holdButton
*/
function buildAbsorbablePositions(
holdButton: HoldButton
): AbsorbablePosition[] {
const aps: AbsorbablePosition[] = [];
const holdButtons = holdButton.queryStore.queryByType<HoldButton>(
HoldButton.Type
);
const canvas = holdButton.getCanvas();
holdButtons.forEach((item) => {
if (item.id === holdButton.id) {
return;
}
const ala = new AbsorbableLine(
new Point(item.x, 0),
new Point(item.x, canvas.height)
);
const alb = new AbsorbableLine(
new Point(0, item.y),
new Point(canvas.width, item.y)
);
aps.push(ala);
aps.push(alb);
});
return aps;
}
export class HoldButtonInteraction extends GraphicInteractionPlugin<HoldButton> {
static Name = 'hold_button_transform';
constructor(app: IDrawApp) {
super(HoldButtonInteraction.Name, app);
}
static init(app: IDrawApp) {
return new HoldButtonInteraction(app);
}
filter(...grahpics: JlGraphic[]): HoldButton[] | undefined {
return grahpics
.filter((g) => g.type === HoldButton.Type)
.map((g) => g as HoldButton);
}
bind(g: HoldButton): void {
g.eventMode = 'static';
g.cursor = 'pointer';
g.scalable = true;
g.rotatable = true;
g.codeGraph.draggable = true;
g.codeGraph.selectable = true;
g.codeGraph.rotatable = true;
g.codeGraph.transformSave = true;
g.codeGraph.eventMode = 'static';
g.on('transformstart', this.transformstart, this);
}
unbind(g: HoldButton): void {
g.eventMode = 'none';
g.scalable = false;
g.rotatable = false;
g.codeGraph.draggable = false;
g.codeGraph.selectable = false;
g.codeGraph.rotatable = false;
g.codeGraph.transformSave = false;
g.codeGraph.eventMode = 'none';
g.off('transformstart', this.transformstart, this);
}
transformstart(e: GraphicTransformEvent) {
const target = e.target as DisplayObject;
const holdButton = target.getGraphic() as HoldButton;
holdButton.getGraphicApp().setOptions({
absorbablePositions: buildAbsorbablePositions(holdButton),
});
}
}

View File

@ -16,7 +16,7 @@ export interface IIbpBoxDrawOptions {
export class IbpBoxDraw extends GraphicDrawAssistant<IbpBoxTemplate, IIbpBox> { export class IbpBoxDraw extends GraphicDrawAssistant<IbpBoxTemplate, IIbpBox> {
_gatedBox: IbpBox | null = null; _gatedBox: IbpBox | null = null;
constructor(app: IDrawApp, template: IbpBoxTemplate) { constructor(app: IDrawApp, template: IbpBoxTemplate) {
super(app, template, 'svguse:../../drawIcon.svg#icon-spks-switch', 'Ibp'); super(app, template, 'svguse:../../drawIcon.svg#icon-ibp-box', 'Ibp');
IbpBoxInteraction.init(app); IbpBoxInteraction.init(app);
} }
public get gatedBox(): IbpBox { public get gatedBox(): IbpBox {

View File

@ -13,8 +13,8 @@ export interface ISpksSwitchData extends GraphicData {
set flip(v: boolean); set flip(v: boolean);
get refStand(): number; get refStand(): number;
set refStand(v: number); set refStand(v: number);
get refSections(): number[]; // get refSections(): number[];
set refSections(v: number[]); // set refSections(v: number[]);
} }
const spksSwitchConsts = { const spksSwitchConsts = {

View File

@ -0,0 +1,102 @@
import { Graphics } from 'pixi.js';
import {
GraphicData,
JlGraphic,
JlGraphicTemplate,
VectorText,
} from 'jl-graphic';
export interface IUnattengedButtonData extends GraphicData {
get code(): string;
set code(v: string);
get flip(): boolean;
set flip(v: boolean);
get refStand(): number;
set refStand(v: number);
}
const unattengedButtonConsts = {
codeFontSize: 12,
codeColor: 0xffffff,
bodyLineColor: 0xffffff,
bodyLineWidth: 4,
bodyRectLineColor: 0xffffff,
bodyRectLineWidth: 2,
bodyRectWidth: 20,
bodyRectHeight: 20,
bodyColor: 0x000000,
};
export class UnattengedButton extends JlGraphic {
static Type = 'unattengedButton';
codeGraph: VectorText = new VectorText('');
rectBody: Graphics = new Graphics();
lineBody: Graphics = new Graphics();
textGraph: VectorText = new VectorText('W');
constructor() {
super(UnattengedButton.Type);
this.addChild(this.codeGraph);
this.addChild(this.rectBody);
this.addChild(this.lineBody);
this.addChild(this.textGraph);
this.codeGraph.name = 'unattenged_button_code';
}
get datas(): IUnattengedButtonData {
return this.getDatas<IUnattengedButtonData>();
}
doRepaint(): void {
const codeGraph = this.codeGraph;
codeGraph.text = this.datas.code;
codeGraph.style.fill = unattengedButtonConsts.codeColor;
codeGraph.setVectorFontSize(unattengedButtonConsts.codeFontSize);
const codeTransform = this.datas?.childTransforms?.find(
(item) => item.name === 'unattenged_button_code'
);
if (codeTransform) {
const position = codeTransform?.transform.position;
const rotation = codeTransform?.transform?.rotation;
codeGraph.position.set(position?.x, position?.y);
codeGraph.rotation = rotation || 0;
} else {
codeGraph.position.set(20, 0);
}
codeGraph.anchor.set(0.5);
this.textGraph.style.fill = unattengedButtonConsts.codeColor;
this.textGraph.setVectorFontSize(unattengedButtonConsts.codeFontSize);
this.textGraph.anchor.set(0.5);
this.rectBody.clear();
this.rectBody.beginFill(unattengedButtonConsts.bodyColor, 0);
this.rectBody.lineStyle(
unattengedButtonConsts.bodyRectLineWidth,
unattengedButtonConsts.bodyRectLineColor
);
this.rectBody.drawRect(
-unattengedButtonConsts.bodyRectWidth / 2,
-unattengedButtonConsts.bodyRectHeight / 2,
unattengedButtonConsts.bodyRectWidth,
unattengedButtonConsts.bodyRectHeight
);
this.rectBody.endFill();
this.lineBody.clear();
const lineY = this.datas.flip
? unattengedButtonConsts.bodyRectHeight / 2
: -unattengedButtonConsts.bodyRectHeight / 2;
this.lineBody.lineStyle(
unattengedButtonConsts.bodyLineWidth,
unattengedButtonConsts.bodyLineColor
);
this.lineBody.moveTo(-unattengedButtonConsts.bodyRectWidth / 2, lineY);
this.lineBody.lineTo(unattengedButtonConsts.bodyRectWidth / 2, lineY);
}
}
export class UnattengedButtonTemplate extends JlGraphicTemplate<UnattengedButton> {
constructor(dataTemplate: IUnattengedButtonData) {
super(UnattengedButton.Type, { dataTemplate });
}
new(): UnattengedButton {
const unattengedButton = new UnattengedButton();
unattengedButton.loadData(this.datas);
return unattengedButton;
}
}

View File

@ -0,0 +1,128 @@
import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
import {
AbsorbableLine,
AbsorbablePosition,
GraphicDrawAssistant,
GraphicInteractionPlugin,
GraphicTransformEvent,
IDrawApp,
JlGraphic,
} from 'jl-graphic';
import { IUnattengedButtonData, UnattengedButton, UnattengedButtonTemplate } from './UnattengedButton';
export interface IUnattengedButtonDataOptions {
newData: () => IUnattengedButtonData;
}
export class UnattengedButtonDraw extends GraphicDrawAssistant<
UnattengedButtonTemplate,
IUnattengedButtonData
> {
_unattengedButton: UnattengedButton | null = null;
constructor(app: IDrawApp, template: UnattengedButtonTemplate) {
super(
app,
template,
'svguse:../../drawIcon.svg#icon-unattenged-button',
'无人折返按钮UnattengedButton'
);
UnattengedButtonInteraction.init(app);
}
public get unattengedButton(): UnattengedButton {
if (!this._unattengedButton) {
this._unattengedButton = this.graphicTemplate.new();
this._unattengedButton.loadData(this.graphicTemplate.datas);
this.container.addChild(this._unattengedButton);
}
return this._unattengedButton;
}
onLeftUp(e: FederatedMouseEvent): void {
this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
this.createAndStore(true);
}
redraw(p: Point): void {
this.unattengedButton.repaint();
this.container.position.set(p.x, p.y);
}
prepareData(data: IUnattengedButtonData): boolean {
data.transform = this.container.saveTransform();
data.code = 'W';
return true;
}
}
/**
* 线
* @param unattengedButton
*/
function buildAbsorbablePositions(
unattengedButton: UnattengedButton
): AbsorbablePosition[] {
const aps: AbsorbablePosition[] = [];
const unattengedButtons = unattengedButton.queryStore.queryByType<UnattengedButton>(
UnattengedButton.Type
);
const canvas = unattengedButton.getCanvas();
unattengedButtons.forEach((item) => {
if (item.id === unattengedButton.id) {
return;
}
const ala = new AbsorbableLine(
new Point(item.x, 0),
new Point(item.x, canvas.height)
);
const alb = new AbsorbableLine(
new Point(0, item.y),
new Point(canvas.width, item.y)
);
aps.push(ala);
aps.push(alb);
});
return aps;
}
export class UnattengedButtonInteraction extends GraphicInteractionPlugin<UnattengedButton> {
static Name = 'unattenged_button_transform';
constructor(app: IDrawApp) {
super(UnattengedButtonInteraction.Name, app);
}
static init(app: IDrawApp) {
return new UnattengedButtonInteraction(app);
}
filter(...grahpics: JlGraphic[]): UnattengedButton[] | undefined {
return grahpics
.filter((g) => g.type === UnattengedButton.Type)
.map((g) => g as UnattengedButton);
}
bind(g: UnattengedButton): void {
g.eventMode = 'static';
g.cursor = 'pointer';
g.scalable = true;
g.rotatable = true;
g.codeGraph.draggable = true;
g.codeGraph.selectable = true;
g.codeGraph.rotatable = true;
g.codeGraph.transformSave = true;
g.codeGraph.eventMode = 'static';
g.on('transformstart', this.transformstart, this);
}
unbind(g: UnattengedButton): void {
g.eventMode = 'none';
g.scalable = false;
g.rotatable = false;
g.codeGraph.draggable = false;
g.codeGraph.selectable = false;
g.codeGraph.rotatable = false;
g.codeGraph.transformSave = false;
g.codeGraph.eventMode = 'none';
g.off('transformstart', this.transformstart, this);
}
transformstart(e: GraphicTransformEvent) {
const target = e.target as DisplayObject;
const unattengedButton = target.getGraphic() as UnattengedButton;
unattengedButton.getGraphicApp().setOptions({
absorbablePositions: buildAbsorbablePositions(unattengedButton),
});
}
}

View File

@ -248,6 +248,7 @@ import { CategoryType } from 'src/components/CategoryType';
import { graphicData } from 'src/protos/stationLayoutGraphics'; import { graphicData } from 'src/protos/stationLayoutGraphics';
import KilometerConvertList from 'src/components/draw-app/dialogs/KilometerConvertList.vue'; import KilometerConvertList from 'src/components/draw-app/dialogs/KilometerConvertList.vue';
import LoadTransponderData from 'src/components/draw-app/dialogs/LoadTransponderData.vue'; import LoadTransponderData from 'src/components/draw-app/dialogs/LoadTransponderData.vue';
import LianSuoBianHao from 'src/components/draw-app/dialogs/LianSuoBianHao.vue';
import KilometerConvertConfig from 'src/components/draw-app/properties/KilometerConvertConfig.vue'; import KilometerConvertConfig from 'src/components/draw-app/properties/KilometerConvertConfig.vue';
import SectionCodePointList from 'src/components/draw-app/dialogs/SectionCodePointList.vue'; import SectionCodePointList from 'src/components/draw-app/dialogs/SectionCodePointList.vue';
import SectionCodePointConfig from 'src/components/draw-app/properties/SectionCodePointConfig.vue'; import SectionCodePointConfig from 'src/components/draw-app/properties/SectionCodePointConfig.vue';
@ -277,6 +278,8 @@ import { PslBox } from 'src/graphics/pslBox/PslBox';
import { CarWashing } from 'src/graphics/carWashing/CarWashing'; import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor'; import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import { FloodGate } from 'src/graphics/floodGate/FloodGate'; import { FloodGate } from 'src/graphics/floodGate/FloodGate';
import { HoldButton } from 'src/graphics/holdButton/HoldButton';
import { UnattengedButton } from 'src/graphics/unattengedButton/UnattengedButton';
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
@ -409,6 +412,10 @@ const dataManageConfig = [
label: '导入应答器报文', label: '导入应答器报文',
click: uploadTransponderMessage, click: uploadTransponderMessage,
}, },
{
label: '联锁编号映射数据',
click: lianSuoBianHao,
},
]; ];
onMounted(() => { onMounted(() => {
@ -445,6 +452,8 @@ onMounted(() => {
CarWashing.Type, CarWashing.Type,
GarageDoor.Type, GarageDoor.Type,
FloodGate.Type, FloodGate.Type,
HoldButton.Type,
UnattengedButton.Type,
]; ];
switch (drawStore.categoryType) { switch (drawStore.categoryType) {
case CategoryType.TH: case CategoryType.TH:
@ -1169,6 +1178,18 @@ function uploadTransponderMessage() {
}); });
} }
let lianSuoBianHaoDialog: DialogChainObject | null = null;
function lianSuoBianHao() {
if (lianSuoBianHaoDialog) return;
lianSuoBianHaoDialog = $q
.dialog({
component: LianSuoBianHao,
})
.onCancel(() => {
lianSuoBianHaoDialog = null;
});
}
let relateDeviceDialogInstance: DialogChainObject | null = null; let relateDeviceDialogInstance: DialogChainObject | null = null;
const relateDeviceConfigEdit = const relateDeviceConfigEdit =
ref<InstanceType<typeof StationRelateDeviceConfig>>(); ref<InstanceType<typeof StationRelateDeviceConfig>>();

View File

@ -1132,7 +1132,9 @@ export namespace state {
export enum TrainConnType { export enum TrainConnType {
NONE = 0, NONE = 0,
VOBC = 1, VOBC = 1,
PC_SIM = 2 PC_SIM = 2,
PC_SIM_A = 3,
PC_SIM_B = 4
} }
} }
export class TrainState extends pb_1.Message { export class TrainState extends pb_1.Message {

View File

@ -55,9 +55,12 @@ export namespace graphicData {
carWashings?: CarWashing[]; carWashings?: CarWashing[];
garageDoors?: GarageDoor[]; garageDoors?: GarageDoor[];
floodGates?: GarageDoor[]; floodGates?: GarageDoor[];
lianSuoData?: LianSuoData;
holdButtons?: HoldButton[];
unattengedButtons?: UnattengedButton[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) { if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas; this.canvas = data.canvas;
@ -185,6 +188,15 @@ export namespace graphicData {
if ("floodGates" in data && data.floodGates != undefined) { if ("floodGates" in data && data.floodGates != undefined) {
this.floodGates = data.floodGates; this.floodGates = data.floodGates;
} }
if ("lianSuoData" in data && data.lianSuoData != undefined) {
this.lianSuoData = data.lianSuoData;
}
if ("holdButtons" in data && data.holdButtons != undefined) {
this.holdButtons = data.holdButtons;
}
if ("unattengedButtons" in data && data.unattengedButtons != undefined) {
this.unattengedButtons = data.unattengedButtons;
}
} }
} }
get canvas() { get canvas() {
@ -451,6 +463,27 @@ export namespace graphicData {
set floodGates(value: GarageDoor[]) { set floodGates(value: GarageDoor[]) {
pb_1.Message.setRepeatedWrapperField(this, 47, value); pb_1.Message.setRepeatedWrapperField(this, 47, value);
} }
get lianSuoData() {
return pb_1.Message.getWrapperField(this, LianSuoData, 49) as LianSuoData;
}
set lianSuoData(value: LianSuoData) {
pb_1.Message.setWrapperField(this, 49, value);
}
get has_lianSuoData() {
return pb_1.Message.getField(this, 49) != null;
}
get holdButtons() {
return pb_1.Message.getRepeatedWrapperField(this, HoldButton, 50) as HoldButton[];
}
set holdButtons(value: HoldButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 50, value);
}
get unattengedButtons() {
return pb_1.Message.getRepeatedWrapperField(this, UnattengedButton, 51) as UnattengedButton[];
}
set unattengedButtons(value: UnattengedButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 51, value);
}
static fromObject(data: { static fromObject(data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>; canvas?: ReturnType<typeof Canvas.prototype.toObject>;
Platforms?: ReturnType<typeof Platform.prototype.toObject>[]; Platforms?: ReturnType<typeof Platform.prototype.toObject>[];
@ -494,6 +527,9 @@ export namespace graphicData {
carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[]; carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[];
garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[]; garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[];
floodGates?: ReturnType<typeof GarageDoor.prototype.toObject>[]; floodGates?: ReturnType<typeof GarageDoor.prototype.toObject>[];
lianSuoData?: ReturnType<typeof LianSuoData.prototype.toObject>;
holdButtons?: ReturnType<typeof HoldButton.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof UnattengedButton.prototype.toObject>[];
}): RtssGraphicStorage { }): RtssGraphicStorage {
const message = new RtssGraphicStorage({}); const message = new RtssGraphicStorage({});
if (data.canvas != null) { if (data.canvas != null) {
@ -622,6 +658,15 @@ export namespace graphicData {
if (data.floodGates != null) { if (data.floodGates != null) {
message.floodGates = data.floodGates.map(item => GarageDoor.fromObject(item)); message.floodGates = data.floodGates.map(item => GarageDoor.fromObject(item));
} }
if (data.lianSuoData != null) {
message.lianSuoData = LianSuoData.fromObject(data.lianSuoData);
}
if (data.holdButtons != null) {
message.holdButtons = data.holdButtons.map(item => HoldButton.fromObject(item));
}
if (data.unattengedButtons != null) {
message.unattengedButtons = data.unattengedButtons.map(item => UnattengedButton.fromObject(item));
}
return message; return message;
} }
toObject() { toObject() {
@ -668,6 +713,9 @@ export namespace graphicData {
carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[]; carWashings?: ReturnType<typeof CarWashing.prototype.toObject>[];
garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[]; garageDoors?: ReturnType<typeof GarageDoor.prototype.toObject>[];
floodGates?: ReturnType<typeof GarageDoor.prototype.toObject>[]; floodGates?: ReturnType<typeof GarageDoor.prototype.toObject>[];
lianSuoData?: ReturnType<typeof LianSuoData.prototype.toObject>;
holdButtons?: ReturnType<typeof HoldButton.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof UnattengedButton.prototype.toObject>[];
} = {}; } = {};
if (this.canvas != null) { if (this.canvas != null) {
data.canvas = this.canvas.toObject(); data.canvas = this.canvas.toObject();
@ -795,6 +843,15 @@ export namespace graphicData {
if (this.floodGates != null) { if (this.floodGates != null) {
data.floodGates = this.floodGates.map((item: GarageDoor) => item.toObject()); data.floodGates = this.floodGates.map((item: GarageDoor) => item.toObject());
} }
if (this.lianSuoData != null) {
data.lianSuoData = this.lianSuoData.toObject();
}
if (this.holdButtons != null) {
data.holdButtons = this.holdButtons.map((item: HoldButton) => item.toObject());
}
if (this.unattengedButtons != null) {
data.unattengedButtons = this.unattengedButtons.map((item: UnattengedButton) => item.toObject());
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -885,6 +942,12 @@ export namespace graphicData {
writer.writeRepeatedMessage(46, this.garageDoors, (item: GarageDoor) => item.serialize(writer)); writer.writeRepeatedMessage(46, this.garageDoors, (item: GarageDoor) => item.serialize(writer));
if (this.floodGates.length) if (this.floodGates.length)
writer.writeRepeatedMessage(47, this.floodGates, (item: GarageDoor) => item.serialize(writer)); writer.writeRepeatedMessage(47, this.floodGates, (item: GarageDoor) => item.serialize(writer));
if (this.has_lianSuoData)
writer.writeMessage(49, this.lianSuoData, () => this.lianSuoData.serialize(writer));
if (this.holdButtons.length)
writer.writeRepeatedMessage(50, this.holdButtons, (item: HoldButton) => item.serialize(writer));
if (this.unattengedButtons.length)
writer.writeRepeatedMessage(51, this.unattengedButtons, (item: UnattengedButton) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1020,6 +1083,15 @@ export namespace graphicData {
case 47: case 47:
reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 47, GarageDoor.deserialize(reader), GarageDoor)); reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 47, GarageDoor.deserialize(reader), GarageDoor));
break; break;
case 49:
reader.readMessage(message.lianSuoData, () => message.lianSuoData = LianSuoData.deserialize(reader));
break;
case 50:
reader.readMessage(message.holdButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 50, HoldButton.deserialize(reader), HoldButton));
break;
case 51:
reader.readMessage(message.unattengedButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 51, UnattengedButton.deserialize(reader), UnattengedButton));
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -6392,11 +6464,10 @@ export namespace graphicData {
common?: CommonInfo; common?: CommonInfo;
code?: string; code?: string;
flip?: boolean; flip?: boolean;
refSections?: number[];
refStand?: number; refStand?: number;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [8], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) { if ("common" in data && data.common != undefined) {
this.common = data.common; this.common = data.common;
@ -6407,9 +6478,6 @@ export namespace graphicData {
if ("flip" in data && data.flip != undefined) { if ("flip" in data && data.flip != undefined) {
this.flip = data.flip; this.flip = data.flip;
} }
if ("refSections" in data && data.refSections != undefined) {
this.refSections = data.refSections;
}
if ("refStand" in data && data.refStand != undefined) { if ("refStand" in data && data.refStand != undefined) {
this.refStand = data.refStand; this.refStand = data.refStand;
} }
@ -6436,12 +6504,6 @@ export namespace graphicData {
set flip(value: boolean) { set flip(value: boolean) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get refSections() {
return pb_1.Message.getFieldWithDefault(this, 8, []) as number[];
}
set refSections(value: number[]) {
pb_1.Message.setField(this, 8, value);
}
get refStand() { get refStand() {
return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; return pb_1.Message.getFieldWithDefault(this, 9, 0) as number;
} }
@ -6452,7 +6514,6 @@ export namespace graphicData {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
flip?: boolean; flip?: boolean;
refSections?: number[];
refStand?: number; refStand?: number;
}): SpksSwitch { }): SpksSwitch {
const message = new SpksSwitch({}); const message = new SpksSwitch({});
@ -6465,9 +6526,6 @@ export namespace graphicData {
if (data.flip != null) { if (data.flip != null) {
message.flip = data.flip; message.flip = data.flip;
} }
if (data.refSections != null) {
message.refSections = data.refSections;
}
if (data.refStand != null) { if (data.refStand != null) {
message.refStand = data.refStand; message.refStand = data.refStand;
} }
@ -6478,7 +6536,6 @@ export namespace graphicData {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
flip?: boolean; flip?: boolean;
refSections?: number[];
refStand?: number; refStand?: number;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
@ -6490,9 +6547,6 @@ export namespace graphicData {
if (this.flip != null) { if (this.flip != null) {
data.flip = this.flip; data.flip = this.flip;
} }
if (this.refSections != null) {
data.refSections = this.refSections;
}
if (this.refStand != null) { if (this.refStand != null) {
data.refStand = this.refStand; data.refStand = this.refStand;
} }
@ -6508,8 +6562,6 @@ export namespace graphicData {
writer.writeString(2, this.code); writer.writeString(2, this.code);
if (this.flip != false) if (this.flip != false)
writer.writeBool(3, this.flip); writer.writeBool(3, this.flip);
if (this.refSections.length)
writer.writePackedUint32(8, this.refSections);
if (this.refStand != 0) if (this.refStand != 0)
writer.writeUint32(9, this.refStand); writer.writeUint32(9, this.refStand);
if (!w) if (!w)
@ -6530,9 +6582,6 @@ export namespace graphicData {
case 3: case 3:
message.flip = reader.readBool(); message.flip = reader.readBool();
break; break;
case 8:
message.refSections = reader.readPackedUint32();
break;
case 9: case 9:
message.refStand = reader.readUint32(); message.refStand = reader.readUint32();
break; break;
@ -9238,4 +9287,692 @@ export namespace graphicData {
return OtherLine.deserialize(bytes); return OtherLine.deserialize(bytes);
} }
} }
export class LianSuoIndexData extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
id?: number;
index?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
}
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
}
}
get id() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set id(value: number) {
pb_1.Message.setField(this, 1, value);
}
get index() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set index(value: number) {
pb_1.Message.setField(this, 2, value);
}
static fromObject(data: {
id?: number;
index?: number;
}): LianSuoIndexData {
const message = new LianSuoIndexData({});
if (data.id != null) {
message.id = data.id;
}
if (data.index != null) {
message.index = data.index;
}
return message;
}
toObject() {
const data: {
id?: number;
index?: number;
} = {};
if (this.id != null) {
data.id = this.id;
}
if (this.index != null) {
data.index = this.index;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.id != 0)
writer.writeInt32(1, this.id);
if (this.index != 0)
writer.writeInt32(2, this.index);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): LianSuoIndexData {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new LianSuoIndexData();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.id = reader.readInt32();
break;
case 2:
message.index = reader.readInt32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): LianSuoIndexData {
return LianSuoIndexData.deserialize(bytes);
}
}
export class LianSuoData extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
stations?: LianSuoIndexData[];
switchs?: LianSuoIndexData[];
screenDoors?: LianSuoIndexData[];
signals?: LianSuoIndexData[];
sections?: LianSuoIndexData[];
floodGates?: LianSuoIndexData[];
spksSwitchs?: LianSuoIndexData[];
garageDoors?: LianSuoIndexData[];
carWashing?: LianSuoIndexData[];
esbButtons?: LianSuoIndexData[];
holdButtons?: LianSuoIndexData[];
unattengedButtons?: LianSuoIndexData[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("stations" in data && data.stations != undefined) {
this.stations = data.stations;
}
if ("switchs" in data && data.switchs != undefined) {
this.switchs = data.switchs;
}
if ("screenDoors" in data && data.screenDoors != undefined) {
this.screenDoors = data.screenDoors;
}
if ("signals" in data && data.signals != undefined) {
this.signals = data.signals;
}
if ("sections" in data && data.sections != undefined) {
this.sections = data.sections;
}
if ("floodGates" in data && data.floodGates != undefined) {
this.floodGates = data.floodGates;
}
if ("spksSwitchs" in data && data.spksSwitchs != undefined) {
this.spksSwitchs = data.spksSwitchs;
}
if ("garageDoors" in data && data.garageDoors != undefined) {
this.garageDoors = data.garageDoors;
}
if ("carWashing" in data && data.carWashing != undefined) {
this.carWashing = data.carWashing;
}
if ("esbButtons" in data && data.esbButtons != undefined) {
this.esbButtons = data.esbButtons;
}
if ("holdButtons" in data && data.holdButtons != undefined) {
this.holdButtons = data.holdButtons;
}
if ("unattengedButtons" in data && data.unattengedButtons != undefined) {
this.unattengedButtons = data.unattengedButtons;
}
}
}
get stations() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 1) as LianSuoIndexData[];
}
set stations(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 1, value);
}
get switchs() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 2) as LianSuoIndexData[];
}
set switchs(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
get screenDoors() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 3) as LianSuoIndexData[];
}
set screenDoors(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get signals() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 4) as LianSuoIndexData[];
}
set signals(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get sections() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 5) as LianSuoIndexData[];
}
set sections(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
get floodGates() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 6) as LianSuoIndexData[];
}
set floodGates(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 6, value);
}
get spksSwitchs() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 7) as LianSuoIndexData[];
}
set spksSwitchs(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 7, value);
}
get garageDoors() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 8) as LianSuoIndexData[];
}
set garageDoors(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 8, value);
}
get carWashing() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 9) as LianSuoIndexData[];
}
set carWashing(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 9, value);
}
get esbButtons() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 10) as LianSuoIndexData[];
}
set esbButtons(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 10, value);
}
get holdButtons() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 11) as LianSuoIndexData[];
}
set holdButtons(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 11, value);
}
get unattengedButtons() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 12) as LianSuoIndexData[];
}
set unattengedButtons(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 12, value);
}
static fromObject(data: {
stations?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
switchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
screenDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
signals?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
sections?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
floodGates?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
carWashing?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
}): LianSuoData {
const message = new LianSuoData({});
if (data.stations != null) {
message.stations = data.stations.map(item => LianSuoIndexData.fromObject(item));
}
if (data.switchs != null) {
message.switchs = data.switchs.map(item => LianSuoIndexData.fromObject(item));
}
if (data.screenDoors != null) {
message.screenDoors = data.screenDoors.map(item => LianSuoIndexData.fromObject(item));
}
if (data.signals != null) {
message.signals = data.signals.map(item => LianSuoIndexData.fromObject(item));
}
if (data.sections != null) {
message.sections = data.sections.map(item => LianSuoIndexData.fromObject(item));
}
if (data.floodGates != null) {
message.floodGates = data.floodGates.map(item => LianSuoIndexData.fromObject(item));
}
if (data.spksSwitchs != null) {
message.spksSwitchs = data.spksSwitchs.map(item => LianSuoIndexData.fromObject(item));
}
if (data.garageDoors != null) {
message.garageDoors = data.garageDoors.map(item => LianSuoIndexData.fromObject(item));
}
if (data.carWashing != null) {
message.carWashing = data.carWashing.map(item => LianSuoIndexData.fromObject(item));
}
if (data.esbButtons != null) {
message.esbButtons = data.esbButtons.map(item => LianSuoIndexData.fromObject(item));
}
if (data.holdButtons != null) {
message.holdButtons = data.holdButtons.map(item => LianSuoIndexData.fromObject(item));
}
if (data.unattengedButtons != null) {
message.unattengedButtons = data.unattengedButtons.map(item => LianSuoIndexData.fromObject(item));
}
return message;
}
toObject() {
const data: {
stations?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
switchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
screenDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
signals?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
sections?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
floodGates?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
carWashing?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
} = {};
if (this.stations != null) {
data.stations = this.stations.map((item: LianSuoIndexData) => item.toObject());
}
if (this.switchs != null) {
data.switchs = this.switchs.map((item: LianSuoIndexData) => item.toObject());
}
if (this.screenDoors != null) {
data.screenDoors = this.screenDoors.map((item: LianSuoIndexData) => item.toObject());
}
if (this.signals != null) {
data.signals = this.signals.map((item: LianSuoIndexData) => item.toObject());
}
if (this.sections != null) {
data.sections = this.sections.map((item: LianSuoIndexData) => item.toObject());
}
if (this.floodGates != null) {
data.floodGates = this.floodGates.map((item: LianSuoIndexData) => item.toObject());
}
if (this.spksSwitchs != null) {
data.spksSwitchs = this.spksSwitchs.map((item: LianSuoIndexData) => item.toObject());
}
if (this.garageDoors != null) {
data.garageDoors = this.garageDoors.map((item: LianSuoIndexData) => item.toObject());
}
if (this.carWashing != null) {
data.carWashing = this.carWashing.map((item: LianSuoIndexData) => item.toObject());
}
if (this.esbButtons != null) {
data.esbButtons = this.esbButtons.map((item: LianSuoIndexData) => item.toObject());
}
if (this.holdButtons != null) {
data.holdButtons = this.holdButtons.map((item: LianSuoIndexData) => item.toObject());
}
if (this.unattengedButtons != null) {
data.unattengedButtons = this.unattengedButtons.map((item: LianSuoIndexData) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.stations.length)
writer.writeRepeatedMessage(1, this.stations, (item: LianSuoIndexData) => item.serialize(writer));
if (this.switchs.length)
writer.writeRepeatedMessage(2, this.switchs, (item: LianSuoIndexData) => item.serialize(writer));
if (this.screenDoors.length)
writer.writeRepeatedMessage(3, this.screenDoors, (item: LianSuoIndexData) => item.serialize(writer));
if (this.signals.length)
writer.writeRepeatedMessage(4, this.signals, (item: LianSuoIndexData) => item.serialize(writer));
if (this.sections.length)
writer.writeRepeatedMessage(5, this.sections, (item: LianSuoIndexData) => item.serialize(writer));
if (this.floodGates.length)
writer.writeRepeatedMessage(6, this.floodGates, (item: LianSuoIndexData) => item.serialize(writer));
if (this.spksSwitchs.length)
writer.writeRepeatedMessage(7, this.spksSwitchs, (item: LianSuoIndexData) => item.serialize(writer));
if (this.garageDoors.length)
writer.writeRepeatedMessage(8, this.garageDoors, (item: LianSuoIndexData) => item.serialize(writer));
if (this.carWashing.length)
writer.writeRepeatedMessage(9, this.carWashing, (item: LianSuoIndexData) => item.serialize(writer));
if (this.esbButtons.length)
writer.writeRepeatedMessage(10, this.esbButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (this.holdButtons.length)
writer.writeRepeatedMessage(11, this.holdButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (this.unattengedButtons.length)
writer.writeRepeatedMessage(12, this.unattengedButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): LianSuoData {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new LianSuoData();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.stations, () => pb_1.Message.addToRepeatedWrapperField(message, 1, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 2:
reader.readMessage(message.switchs, () => pb_1.Message.addToRepeatedWrapperField(message, 2, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 3:
reader.readMessage(message.screenDoors, () => pb_1.Message.addToRepeatedWrapperField(message, 3, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 4:
reader.readMessage(message.signals, () => pb_1.Message.addToRepeatedWrapperField(message, 4, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 5:
reader.readMessage(message.sections, () => pb_1.Message.addToRepeatedWrapperField(message, 5, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 6:
reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 6, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 7:
reader.readMessage(message.spksSwitchs, () => pb_1.Message.addToRepeatedWrapperField(message, 7, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 8:
reader.readMessage(message.garageDoors, () => pb_1.Message.addToRepeatedWrapperField(message, 8, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 9:
reader.readMessage(message.carWashing, () => pb_1.Message.addToRepeatedWrapperField(message, 9, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 10:
reader.readMessage(message.esbButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 10, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 11:
reader.readMessage(message.holdButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 11, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 12:
reader.readMessage(message.unattengedButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 12, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): LianSuoData {
return LianSuoData.deserialize(bytes);
}
}
export class UnattengedButton extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
flip?: boolean;
refStand?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("flip" in data && data.flip != undefined) {
this.flip = data.flip;
}
if ("refStand" in data && data.refStand != undefined) {
this.refStand = data.refStand;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo;
}
set common(value: CommonInfo) {
pb_1.Message.setWrapperField(this, 1, value);
}
get has_common() {
return pb_1.Message.getField(this, 1) != null;
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get flip() {
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
}
set flip(value: boolean) {
pb_1.Message.setField(this, 3, value);
}
get refStand() {
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
}
set refStand(value: number) {
pb_1.Message.setField(this, 4, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
flip?: boolean;
refStand?: number;
}): UnattengedButton {
const message = new UnattengedButton({});
if (data.common != null) {
message.common = CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
if (data.flip != null) {
message.flip = data.flip;
}
if (data.refStand != null) {
message.refStand = data.refStand;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
flip?: boolean;
refStand?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
if (this.flip != null) {
data.flip = this.flip;
}
if (this.refStand != null) {
data.refStand = this.refStand;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.has_common)
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.flip != false)
writer.writeBool(3, this.flip);
if (this.refStand != 0)
writer.writeUint32(4, this.refStand);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UnattengedButton {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UnattengedButton();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
case 3:
message.flip = reader.readBool();
break;
case 4:
message.refStand = reader.readUint32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): UnattengedButton {
return UnattengedButton.deserialize(bytes);
}
}
export class HoldButton extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
flip?: boolean;
refStand?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("flip" in data && data.flip != undefined) {
this.flip = data.flip;
}
if ("refStand" in data && data.refStand != undefined) {
this.refStand = data.refStand;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo;
}
set common(value: CommonInfo) {
pb_1.Message.setWrapperField(this, 1, value);
}
get has_common() {
return pb_1.Message.getField(this, 1) != null;
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
}
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get flip() {
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
}
set flip(value: boolean) {
pb_1.Message.setField(this, 3, value);
}
get refStand() {
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
}
set refStand(value: number) {
pb_1.Message.setField(this, 4, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
flip?: boolean;
refStand?: number;
}): HoldButton {
const message = new HoldButton({});
if (data.common != null) {
message.common = CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
if (data.flip != null) {
message.flip = data.flip;
}
if (data.refStand != null) {
message.refStand = data.refStand;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
flip?: boolean;
refStand?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
if (this.flip != null) {
data.flip = this.flip;
}
if (this.refStand != null) {
data.refStand = this.refStand;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.has_common)
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.flip != false)
writer.writeBool(3, this.flip);
if (this.refStand != 0)
writer.writeUint32(4, this.refStand);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): HoldButton {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new HoldButton();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
case 3:
message.flip = reader.readBool();
break;
case 4:
message.refStand = reader.readUint32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): HoldButton {
return HoldButton.deserialize(bytes);
}
}
} }