Merge branch 'master' of git.code.tencent.com:beijing-rtss-test/bj-rtss-client

This commit is contained in:
Yuan 2023-09-21 17:23:36 +08:00
commit 3fa8c54334
27 changed files with 547 additions and 40 deletions

@ -1 +1 @@
Subproject commit 473f7da13f142c51c774149002e5b8752b0e6825
Subproject commit 0413df374c5d01759e53bee16490866a17882f5f

View File

@ -23,6 +23,7 @@ export async function destroySimulation(data: { simulationId: string }) {
/**
*
* @param simulationId 仿id
* @param mapId id
* @param up
* @param id
* @param devicePort
@ -31,6 +32,7 @@ export async function destroySimulation(data: { simulationId: string }) {
*/
export async function addTrain(data: {
simulationId: string;
mapId: number;
up: boolean;
id: string;
devicePort?: string;
@ -47,6 +49,7 @@ export async function addTrain(data: {
*/
export async function removeTrain(data: {
simulationId: string;
mapId: number;
trainId: string;
}) {
const response = await api.post(`${UriBase}/train/remove`, data);
@ -55,6 +58,7 @@ export async function removeTrain(data: {
export async function setSwitchPosition(data: {
simulationId: string;
mapId: number;
switchIndex: string;
turnNormal: boolean;
turnReverse: boolean;

View File

@ -124,6 +124,9 @@
></TrackLogicSectionProperty>
</q-card-section>
</template>
<template v-else-if="drawStore.selectedGraphics.length > 1">
<multiple-select-property></multiple-select-property>
</template>
</q-card>
</div>
</template>
@ -184,6 +187,7 @@ import TrackSectionProperty from './properties/TrackSectionProperty.vue';
import { TrackSection } from 'src/graphics/trackSection/TrackSection';
import TrackLogicSectionProperty from './properties/TrackLogicSectionProperty.vue';
import { TrackLogicSection } from 'src/graphics/trackLogicSection/TrackLogicSection';
import MultipleSelectProperty from './properties/multipleSelectProperty.vue';
const drawStore = useDrawStore();
</script>

View File

@ -33,6 +33,21 @@
:options="optionsDirection"
label="方向"
/>
<q-field class="q-mt-lg" outlined label="所属集中站" stack-label>
<template #control>
<q-chip
color="primary"
text-color="white"
v-for="(name, index) in platformModel.centralizedStations"
:key="index"
removable
@remove="removeStation(index)"
square
>{{ name }}</q-chip
>
<q-btn round color="primary" size="xs" icon="add" @click="addStation" />
</template>
</q-field>
</q-form>
</template>
@ -40,11 +55,9 @@
import { PlatformData } from 'src/drawApp/graphics/PlatformInteraction';
import { useFormData } from 'src/components/DrawAppFormUtils';
import { useDrawStore } from 'src/stores/draw-store';
import { useQuasar } from 'quasar';
const { data: platformModel, onUpdate } = useFormData(
new PlatformData(),
useDrawStore().getDrawApp()
);
const $q = useQuasar();
const optionsDoor = [
{ label: '是', value: true },
@ -54,4 +67,26 @@ const optionsDirection = [
{ label: '向上', value: 'up' },
{ label: '向下', value: 'down' },
];
const { data: platformModel, onUpdate } = useFormData(
new PlatformData(),
useDrawStore().getDrawApp()
);
function removeStation(index: number) {
platformModel.centralizedStations.splice(index, 1);
}
function addStation() {
$q.dialog({
message: '添加设备的集中站',
prompt: {
model: '',
type: 'text', // optional
},
cancel: true,
}).onOk((data: string) => {
platformModel.centralizedStations.push(data);
});
}
</script>

View File

@ -95,6 +95,21 @@
>
</template>
</q-field>
<q-field class="q-mt-lg" outlined label="所属集中站" stack-label>
<template #control>
<q-chip
color="primary"
text-color="white"
v-for="(name, index) in sectionModel.centralizedStations"
:key="index"
removable
@remove="removeStation(index)"
square
>{{ name }}</q-chip
>
<q-btn round color="primary" size="xs" icon="add" @click="addStation" />
</template>
</q-field>
</q-form>
</template>
@ -105,11 +120,12 @@ import { Section } from 'src/graphics/section/Section';
import { Turnout } from 'src/graphics/turnout/Turnout';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { useDrawStore } from 'src/stores/draw-store';
import { useQuasar } from 'quasar';
import { computed } from 'vue';
import { useFormData } from 'src/components/DrawAppFormUtils';
const drawStore = useDrawStore();
const $q = useQuasar();
const { data: sectionModel, onUpdate } = useFormData(
new SectionData(),
drawStore.getDrawApp()
@ -163,4 +179,21 @@ const axleCountingRelations = computed(() => {
(relation) => relation.getOtherGraphic<AxleCounting>(section).datas.code
);
});
function removeStation(index: number) {
sectionModel.centralizedStations.splice(index, 1);
}
function addStation() {
$q.dialog({
message: '添加设备的集中站',
prompt: {
model: '',
type: 'text', // optional
},
cancel: true,
}).onOk((data: string) => {
sectionModel.centralizedStations.push(data);
});
}
</script>

View File

@ -72,6 +72,21 @@
@update:model-value="onUpdate"
label="关联设备端口:"
></q-select>
<q-field class="q-mt-lg" outlined label="所属集中站" stack-label>
<template #control>
<q-chip
color="primary"
text-color="white"
v-for="(name, index) in signalModel.centralizedStations"
:key="index"
removable
@remove="removeStation(index)"
square
>{{ name }}</q-chip
>
<q-btn round color="primary" size="xs" icon="add" @click="addStation" />
</template>
</q-field>
</q-form>
</template>
@ -82,9 +97,11 @@ import { Section } from 'src/graphics/section/Section';
import { Turnout } from 'src/graphics/turnout/Turnout';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { useDrawStore } from 'src/stores/draw-store';
import { useQuasar } from 'quasar';
import { computed } from 'vue';
const drawStore = useDrawStore();
const $q = useQuasar();
const { data: signalModel, onUpdate } = useFormData(
new SignalData(),
drawStore.getDrawApp()
@ -124,4 +141,21 @@ const directionOptions = [
{ label: '左行', value: 0 },
{ label: '右行', value: 1 },
];
function removeStation(index: number) {
signalModel.centralizedStations.splice(index, 1);
}
function addStation() {
$q.dialog({
message: '添加设备的集中站',
prompt: {
model: '',
type: 'text', // optional
},
cancel: true,
}).onOk((data: string) => {
signalModel.centralizedStations.push(data);
});
}
</script>

View File

@ -85,6 +85,21 @@
>
</template>
</q-field>
<q-field class="q-mt-lg" outlined label="所属集中站" stack-label>
<template #control>
<q-chip
color="primary"
text-color="white"
v-for="(name, index) in transponderModel.centralizedStations"
:key="index"
removable
@remove="removeStation(index)"
square
>{{ name }}</q-chip
>
<q-btn round color="primary" size="xs" icon="add" @click="addStation" />
</template>
</q-field>
</q-form>
</template>
@ -98,9 +113,11 @@ import {
} from 'src/graphics/transponder/Transponder';
import { Turnout } from 'src/graphics/turnout/Turnout';
import { useDrawStore } from 'src/stores/draw-store';
import { useQuasar } from 'quasar';
import { computed } from 'vue';
const drawStore = useDrawStore();
const $q = useQuasar();
const { data: transponderModel, onUpdate } = useFormData(
new TransponderData(),
drawStore.getDrawApp()
@ -125,6 +142,23 @@ const directionOptions = [
{ label: '右行', value: 1 },
];
function removeStation(index: number) {
transponderModel.centralizedStations.splice(index, 1);
}
function addStation() {
$q.dialog({
message: '添加设备的集中站',
prompt: {
model: '',
type: 'text', // optional
},
cancel: true,
}).onOk((data: string) => {
transponderModel.centralizedStations.push(data);
});
}
const sectionRelations = computed(() => {
const transponder = drawStore.selectedGraphic as Transponder;

View File

@ -105,6 +105,21 @@
>
</template>
</q-field>
<q-field class="q-mt-lg" outlined label="所属集中站" stack-label>
<template #control>
<q-chip
color="primary"
text-color="white"
v-for="(name, index) in turnoutModel.centralizedStations"
:key="index"
removable
@remove="removeStation(index)"
square
>{{ name }}</q-chip
>
<q-btn round color="primary" size="xs" icon="add" @click="addStation" />
</template>
</q-field>
</q-form>
</template>
@ -114,10 +129,12 @@ import { Section } from 'src/graphics/section/Section';
import { Turnout } from 'src/graphics/turnout/Turnout';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { useDrawStore } from 'src/stores/draw-store';
import { useQuasar } from 'quasar';
import { computed } from 'vue';
import { useFormData } from 'src/components/DrawAppFormUtils';
const drawStore = useDrawStore();
const $q = useQuasar();
const CoordinateSystemOptions = [
{ label: '车辆段', value: 'DEPOT' },
{ label: '停车场', value: 'PARKING_LOT' },
@ -150,6 +167,23 @@ const switchMachineTypeOptions = [
},
];
function removeStation(index: number) {
turnoutModel.centralizedStations.splice(index, 1);
}
function addStation() {
$q.dialog({
message: '添加设备的集中站',
prompt: {
model: '',
type: 'text', // optional
},
cancel: true,
}).onOk((data: string) => {
turnoutModel.centralizedStations.push(data);
});
}
const sectionRelations = computed(() => {
const turnout = drawStore.selectedGraphic as Turnout;

View File

@ -0,0 +1,134 @@
<template>
<div class="q-gutter-sm" style="padding: 16px">
<q-input
outlined
bottom-slots
v-model="stationName"
label="集中站"
counter
maxlength="12"
>
<template v-slot:append>
<q-btn
label="添加集中站"
color="primary"
@click="addCentralizedStation"
></q-btn>
</template>
</q-input>
<q-btn
label="清空集中站"
color="primary"
@click="clearCentralizedStation"
></q-btn>
</div>
</template>
<script setup lang="ts">
import { useDrawStore } from 'src/stores/draw-store';
import { ref } from 'vue';
import { useQuasar } from 'quasar';
import { Section } from 'src/graphics/section/Section';
import { SectionData } from 'src/drawApp/graphics/SectionInteraction';
import { Signal } from 'src/graphics/signal/Signal';
import { SignalData } from 'src/drawApp/graphics/SignalInteraction';
import { Turnout } from 'src/graphics/turnout/Turnout';
import { TurnoutData } from 'src/drawApp/graphics/TurnoutInteraction';
import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting';
import { AxleCountingData } from 'src/drawApp/graphics/AxleCountingInteraction';
import { Platform } from 'src/graphics/platform/Platform';
import { PlatformData } from 'src/drawApp/graphics/PlatformInteraction';
import { Transponder } from 'src/graphics/transponder/Transponder';
import { TransponderData } from 'src/drawApp/graphics/TransponderInteraction';
const stationName = ref('');
const drawStore = useDrawStore();
const $q = useQuasar();
function addCentralizedStation() {
const devices = drawStore.selectedGraphics;
if (devices && devices.length && stationName.value) {
$q.dialog({
message: `确定为选中设备添加集中站【${stationName.value}】吗?`,
cancel: true,
}).onOk(() => {
devices.forEach((device) => {
if (device.type === Section.Type) {
const data = new SectionData();
data.copyFrom(device.saveData());
data.centralizedStations.push(stationName.value);
device.updateData(data);
} else if (device.type === Signal.Type) {
const data = new SignalData();
data.copyFrom(device.saveData());
data.centralizedStations.push(stationName.value);
device.updateData(data);
} else if (device.type === Turnout.Type) {
const data = new TurnoutData();
data.copyFrom(device.saveData());
data.centralizedStations.push(stationName.value);
device.updateData(data);
} else if (device.type === AxleCounting.Type) {
const data = new AxleCountingData();
data.copyFrom(device.saveData());
data.centralizedStations.push(stationName.value);
device.updateData(data);
} else if (device.type === Platform.Type) {
const data = new PlatformData();
data.copyFrom(device.saveData());
data.centralizedStations.push(stationName.value);
device.updateData(data);
} else if (device.type === Transponder.Type) {
const data = new TransponderData();
data.copyFrom(device.saveData());
data.centralizedStations.push(stationName.value);
device.updateData(data);
}
});
stationName.value = '';
});
}
}
function clearCentralizedStation() {
const devices = drawStore.selectedGraphics;
if (devices && devices.length) {
$q.dialog({ message: '确定清空选中设备的集中站吗?', cancel: true }).onOk(
() => {
devices.forEach((device) => {
if (device.type === Section.Type) {
const data = new SectionData();
data.copyFrom(device.saveData());
data.centralizedStations.push(stationName.value);
device.updateData(data);
} else if (device.type === Signal.Type) {
const data = new SignalData();
data.copyFrom(device.saveData());
data.centralizedStations = [];
device.updateData(data);
} else if (device.type === Turnout.Type) {
const data = new TurnoutData();
data.copyFrom(device.saveData());
data.centralizedStations = [];
device.updateData(data);
} else if (device.type === AxleCounting.Type) {
const data = new AxleCountingData();
data.copyFrom(device.saveData());
data.centralizedStations = [];
device.updateData(data);
} else if (device.type === Platform.Type) {
const data = new PlatformData();
data.copyFrom(device.saveData());
data.centralizedStations = [];
device.updateData(data);
} else if (device.type === Transponder.Type) {
const data = new TransponderData();
data.copyFrom(device.saveData());
data.centralizedStations = [];
device.updateData(data);
}
});
}
);
}
}
</script>

View File

@ -83,6 +83,7 @@ function submitState() {
if (lineStore.simulationId) {
setSwitchPosition({
simulationId: lineStore.simulationId,
mapId: lineStore.mapId as number,
switchIndex: turnoutState.value.index + '',
turnNormal: turnoutState.value.normal,
turnReverse: turnoutState.value.reverse,

View File

@ -224,7 +224,7 @@ export function initCommonDrawApp(app: IDrawApp) {
DefaultCanvasMenu.open(e.global);
});
app.on('destroy', async () => {
UniqueIdPrefix = new graphicData.UniqueIdType();
UniqueIdPrefix = new graphicData.UniqueIdOfStationLayout();
});
}
@ -399,11 +399,13 @@ export function saveDrawToServer(base64: string) {
}
//UniqueId
let UniqueIdPrefix = new graphicData.UniqueIdType();
let UniqueIdPrefix = new graphicData.UniqueIdOfStationLayout();
export function loadUniqueIdPrefix() {
return UniqueIdPrefix;
}
export function setUniqueIdPrefix(newUniqueIdPrefix: graphicData.UniqueIdType) {
export function setUniqueIdPrefix(
newUniqueIdPrefix: graphicData.UniqueIdOfStationLayout
) {
UniqueIdPrefix = newUniqueIdPrefix;
}

View File

@ -59,6 +59,12 @@ export class AxleCountingData
set type(type: graphicData.AxleCounting.TypeDetectionPoint) {
this.data.type = type;
}
get centralizedStations(): string[] {
return this.data.centralizedStations;
}
set centralizedStations(v: string[]) {
this.data.centralizedStations;
}
clone(): AxleCountingData {
return new AxleCountingData(this.data.cloneMessage());
}

View File

@ -64,6 +64,12 @@ export class PlatformData extends GraphicDataBase implements IPlatformData {
set refStationIndex(v: number) {
this.data.refStationIndex = v;
}
get centralizedStations(): string[] {
return this.data.centralizedStations;
}
set centralizedStations(v: string[]) {
this.data.centralizedStations = v;
}
clone(): PlatformData {
return new PlatformData(this.data.cloneMessage());

View File

@ -95,6 +95,12 @@ export class SectionData extends GraphicDataBase implements ISectionData {
set segmentsCount(v: number) {
this.data.segmentsCount = v;
}
get centralizedStations(): string[] {
return this.data.centralizedStations;
}
set centralizedStations(v: string[]) {
this.data.centralizedStations = v;
}
clone(): SectionData {
return new SectionData(this.data.cloneMessage());
}
@ -164,6 +170,7 @@ export class SectionOperateInteraction extends GraphicInteractionPlugin<Section>
if (!section) return;
this.app.updateSelected(section);
const simulationId = useLineStore().simulationId || '';
const mapId = useLineStore().mapId as number;
addTrainConfig.handler = () => {
const relations =
section.relationManage.getRelationsOfGraphicAndOtherType(
@ -195,6 +202,7 @@ export class SectionOperateInteraction extends GraphicInteractionPlugin<Section>
}).onOk((data: { offset: number; dir: 1 | 0; trainLength: string }) => {
const params = {
simulationId,
mapId,
up: !!data.dir,
id: section.datas.index + '',
headOffset: data.offset,

View File

@ -67,6 +67,12 @@ export class SignalData extends GraphicDataBase implements ISignalData {
set refDev(v: graphicData.RelatedRef) {
this.data.refDev = v;
}
get centralizedStations(): string[] {
return this.data.centralizedStations;
}
set centralizedStations(v: string[]) {
this.data.centralizedStations = v;
}
clone(): SignalData {
return new SignalData(this.data.cloneMessage());
}

View File

@ -174,9 +174,11 @@ export class TrainOperateInteraction extends GraphicInteractionPlugin<Train> {
this.app.updateSelected(train);
const lineStore = useLineStore();
const simulationId = lineStore.simulationId || '';
const mapId = lineStore.mapId as number;
removeTrainConfig.handler = () => {
removeTrain({
simulationId,
mapId,
trainId: train.code,
})
.then(() => {

View File

@ -59,6 +59,12 @@ export class TransponderData
set TransponderRef(v: graphicData.RelatedRef) {
this.data.TransponderRef = v;
}
get centralizedStations(): string[] {
return this.data.centralizedStations;
}
set centralizedStations(v: string[]) {
this.data.centralizedStations = v;
}
clone(): TransponderData {
return new TransponderData(this.data.cloneMessage());
}

View File

@ -92,9 +92,11 @@ export class TurnoutOperationPlugin extends GraphicInteractionPlugin<Turnout> {
if (!turnout) return;
this.app.updateSelected(turnout);
const simulationId = useLineStore().simulationId || '';
const mapId = useLineStore().mapId as number;
const setPosition = async (normal: boolean) => {
setSwitchPosition({
simulationId,
mapId,
switchIndex: turnout.datas.index + '',
turnNormal: normal,
turnReverse: !normal,
@ -150,6 +152,7 @@ export class TurnoutOperationPlugin extends GraphicInteractionPlugin<Turnout> {
}).onOk((data: { offset: number; dir: 1 | 0 }) => {
addTrain({
simulationId,
mapId,
up: !!data.dir,
id: turnout.datas.index + '',
devicePort: port,
@ -270,6 +273,12 @@ export class TurnoutData extends GraphicDataBase implements ITurnoutData {
set switchMachineType(v: graphicData.Turnout.SwitchMachineType) {
this.data.switchMachineType = v;
}
get centralizedStations(): string[] {
return this.data.centralizedStations;
}
set centralizedStations(v: string[]) {
this.data.centralizedStations = v;
}
clone(): TurnoutData {
return new TurnoutData(this.data.cloneMessage());
}

View File

@ -229,6 +229,7 @@ export function initLineScene(lineApp: IGraphicApp) {
function handleSubscribe(lineScene: IGraphicScene, lineApp: IGraphicApp) {
const lineStore = useLineStore();
const simulationId = lineStore.simulationId;
const mapId = lineStore.mapId;
const app = lineScene;
lineApp?.enableWsMassaging({
@ -238,7 +239,7 @@ function handleSubscribe(lineScene: IGraphicScene, lineApp: IGraphicApp) {
});
app.subscribe({
// destination: `/simulation/${simulationId}/devices/status`,
destination: `simulation-${simulationId}-devices-status`,
destination: `simulation-${simulationId}_${mapId}-devices-status`,
messageConverter: (message: Uint8Array) => {
// console.log('收到消息', message);
const states: GraphicState[] = [];

View File

@ -25,6 +25,8 @@ export interface IAxleCountingData extends GraphicData {
set index(v: number);
get type(): TypeDetectionPoint; // 计轴、区段边界
set type(v: TypeDetectionPoint);
get centralizedStations(): string[];
set centralizedStations(v: string[]);
clone(): IAxleCountingData;
copyFrom(data: IAxleCountingData): void;
eq(other: IAxleCountingData): boolean;

View File

@ -21,6 +21,8 @@ export interface IPlatformData extends GraphicData {
set index(v: number);
get refStationIndex(): number;
set refStationIndex(v: number);
get centralizedStations(): string[];
set centralizedStations(v: string[]);
clone(): IPlatformData;
copyFrom(data: IPlatformData): void;
eq(other: IPlatformData): boolean;

View File

@ -54,6 +54,8 @@ export interface ISectionData extends GraphicData {
set isCurve(v: boolean);
get segmentsCount(): number; // 曲线分段数
set segmentsCount(v: number);
get centralizedStations(): string[];
set centralizedStations(v: string[]);
clone(): ISectionData;
copyFrom(data: ISectionData): void;
eq(other: ISectionData): boolean;

View File

@ -44,6 +44,8 @@ export interface ISignalData extends GraphicData {
set index(v: number);
get refDev(): IRelatedRefData;
set refDev(v: IRelatedRefData);
get centralizedStations(): string[];
set centralizedStations(v: string[]);
clone(): ISignalData;
copyFrom(data: ISignalData): void;
eq(other: ISignalData): boolean;

View File

@ -27,6 +27,8 @@ export interface ITransponderData extends GraphicData {
set kilometerSystem(v: KilometerSystem);
get TransponderRef(): IRelatedRefData;
set TransponderRef(v: IRelatedRefData);
get centralizedStations(): string[];
set centralizedStations(v: string[]);
clone(): ITransponderData;
copyFrom(data: ITransponderData): void;
eq(other: ITransponderData): boolean;

View File

@ -47,6 +47,8 @@ export interface ITurnoutData extends GraphicData {
set pcTrackSectionId(v: string);
get switchMachineType(): graphicData.Turnout.SwitchMachineType;
set switchMachineType(v: graphicData.Turnout.SwitchMachineType);
get centralizedStations(): string[];
set centralizedStations(v: string[]);
clone(): ITurnoutData;
copyFrom(data: ITurnoutData): void;
eq(other: ITurnoutData): boolean;

View File

@ -126,11 +126,7 @@
</q-card-section>
<q-card-actions align="right">
<q-btn
color="primary"
label="提交"
@click="saveUniqueIdPrefix(stationName)"
/>
<q-btn color="primary" label="提交" @click="saveUniqueIdPrefix()" />
<q-btn label="取消" v-close-popup />
</q-card-actions>
</q-card>
@ -217,6 +213,7 @@ watch(
.queryStore.queryById(searchId.value);
drawStore.getDrawApp().makeGraphicCenterShow(device);
drawStore.getDrawApp().updateSelected(device);
searchId.value = '';
}
} catch (err) {
$q.notify({
@ -365,7 +362,8 @@ const UniqueIdPrefix = ref();
function openUniqueIdPrefixDialog() {
uniqueIdPrefixDialog.value = true;
UniqueIdPrefix.value = loadUniqueIdPrefix() ?? new graphicData.UniqueIdType();
UniqueIdPrefix.value =
loadUniqueIdPrefix() ?? new graphicData.UniqueIdOfStationLayout();
}
function saveUniqueIdPrefix() {

View File

@ -36,7 +36,7 @@ export namespace graphicData {
curvatures?: Curvature[];
trackSections?: TrackSection[];
trackLogicSections?: TrackLogicSection[];
UniqueIdPrefix?: UniqueIdType;
UniqueIdPrefix?: UniqueIdOfStationLayout;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], this.#one_of_decls);
@ -266,13 +266,13 @@ export namespace graphicData {
pb_1.Message.setRepeatedWrapperField(this, 29, value);
}
get UniqueIdPrefix() {
return pb_1.Message.getWrapperField(this, UniqueIdType, 30) as UniqueIdType;
return pb_1.Message.getWrapperField(this, UniqueIdOfStationLayout, 31) as UniqueIdOfStationLayout;
}
set UniqueIdPrefix(value: UniqueIdType) {
pb_1.Message.setWrapperField(this, 30, value);
set UniqueIdPrefix(value: UniqueIdOfStationLayout) {
pb_1.Message.setWrapperField(this, 31, value);
}
get has_UniqueIdPrefix() {
return pb_1.Message.getField(this, 30) != null;
return pb_1.Message.getField(this, 31) != null;
}
static fromObject(data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
@ -299,7 +299,7 @@ export namespace graphicData {
curvatures?: ReturnType<typeof Curvature.prototype.toObject>[];
trackSections?: ReturnType<typeof TrackSection.prototype.toObject>[];
trackLogicSections?: ReturnType<typeof TrackLogicSection.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>;
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
}): RtssGraphicStorage {
const message = new RtssGraphicStorage({});
if (data.canvas != null) {
@ -375,7 +375,7 @@ export namespace graphicData {
message.trackLogicSections = data.trackLogicSections.map(item => TrackLogicSection.fromObject(item));
}
if (data.UniqueIdPrefix != null) {
message.UniqueIdPrefix = UniqueIdType.fromObject(data.UniqueIdPrefix);
message.UniqueIdPrefix = UniqueIdOfStationLayout.fromObject(data.UniqueIdPrefix);
}
return message;
}
@ -405,7 +405,7 @@ export namespace graphicData {
curvatures?: ReturnType<typeof Curvature.prototype.toObject>[];
trackSections?: ReturnType<typeof TrackSection.prototype.toObject>[];
trackLogicSections?: ReturnType<typeof TrackLogicSection.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>;
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@ -537,7 +537,7 @@ export namespace graphicData {
if (this.trackLogicSections.length)
writer.writeRepeatedMessage(29, this.trackLogicSections, (item: TrackLogicSection) => item.serialize(writer));
if (this.has_UniqueIdPrefix)
writer.writeMessage(30, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer));
writer.writeMessage(31, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -619,8 +619,8 @@ export namespace graphicData {
case 29:
reader.readMessage(message.trackLogicSections, () => pb_1.Message.addToRepeatedWrapperField(message, 29, TrackLogicSection.deserialize(reader), TrackLogicSection));
break;
case 30:
reader.readMessage(message.UniqueIdPrefix, () => message.UniqueIdPrefix = UniqueIdType.deserialize(reader));
case 31:
reader.readMessage(message.UniqueIdPrefix, () => message.UniqueIdPrefix = UniqueIdOfStationLayout.deserialize(reader));
break;
default: reader.skipField();
}
@ -1249,9 +1249,10 @@ export namespace graphicData {
direction?: string;
index?: number;
refStationIndex?: number;
centralizedStations?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -1271,6 +1272,9 @@ export namespace graphicData {
if ("refStationIndex" in data && data.refStationIndex != undefined) {
this.refStationIndex = data.refStationIndex;
}
if ("centralizedStations" in data && data.centralizedStations != undefined) {
this.centralizedStations = data.centralizedStations;
}
}
}
get common() {
@ -1312,6 +1316,12 @@ export namespace graphicData {
set refStationIndex(value: number) {
pb_1.Message.setField(this, 6, value);
}
get centralizedStations() {
return pb_1.Message.getFieldWithDefault(this, 7, []) as string[];
}
set centralizedStations(value: string[]) {
pb_1.Message.setField(this, 7, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -1319,6 +1329,7 @@ export namespace graphicData {
direction?: string;
index?: number;
refStationIndex?: number;
centralizedStations?: string[];
}): Platform {
const message = new Platform({});
if (data.common != null) {
@ -1339,6 +1350,9 @@ export namespace graphicData {
if (data.refStationIndex != null) {
message.refStationIndex = data.refStationIndex;
}
if (data.centralizedStations != null) {
message.centralizedStations = data.centralizedStations;
}
return message;
}
toObject() {
@ -1349,6 +1363,7 @@ export namespace graphicData {
direction?: string;
index?: number;
refStationIndex?: number;
centralizedStations?: string[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -1368,6 +1383,9 @@ export namespace graphicData {
if (this.refStationIndex != null) {
data.refStationIndex = this.refStationIndex;
}
if (this.centralizedStations != null) {
data.centralizedStations = this.centralizedStations;
}
return data;
}
serialize(): Uint8Array;
@ -1386,6 +1404,8 @@ export namespace graphicData {
writer.writeInt32(5, this.index);
if (this.refStationIndex != 0)
writer.writeInt32(6, this.refStationIndex);
if (this.centralizedStations.length)
writer.writeRepeatedString(7, this.centralizedStations);
if (!w)
return writer.getResultBuffer();
}
@ -1413,6 +1433,9 @@ export namespace graphicData {
case 6:
message.refStationIndex = reader.readInt32();
break;
case 7:
pb_1.Message.addToRepeatedField(message, 7, reader.readString());
break;
default: reader.skipField();
}
}
@ -1715,9 +1738,10 @@ export namespace graphicData {
axleCountingRef?: RelatedRef[];
index?: number;
type?: AxleCounting.TypeDetectionPoint;
centralizedStations?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 8], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -1737,6 +1761,9 @@ export namespace graphicData {
if ("type" in data && data.type != undefined) {
this.type = data.type;
}
if ("centralizedStations" in data && data.centralizedStations != undefined) {
this.centralizedStations = data.centralizedStations;
}
}
}
get common() {
@ -1781,6 +1808,12 @@ export namespace graphicData {
set type(value: AxleCounting.TypeDetectionPoint) {
pb_1.Message.setField(this, 7, value);
}
get centralizedStations() {
return pb_1.Message.getFieldWithDefault(this, 8, []) as string[];
}
set centralizedStations(value: string[]) {
pb_1.Message.setField(this, 8, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -1788,6 +1821,7 @@ export namespace graphicData {
axleCountingRef?: ReturnType<typeof RelatedRef.prototype.toObject>[];
index?: number;
type?: AxleCounting.TypeDetectionPoint;
centralizedStations?: string[];
}): AxleCounting {
const message = new AxleCounting({});
if (data.common != null) {
@ -1808,6 +1842,9 @@ export namespace graphicData {
if (data.type != null) {
message.type = data.type;
}
if (data.centralizedStations != null) {
message.centralizedStations = data.centralizedStations;
}
return message;
}
toObject() {
@ -1818,6 +1855,7 @@ export namespace graphicData {
axleCountingRef?: ReturnType<typeof RelatedRef.prototype.toObject>[];
index?: number;
type?: AxleCounting.TypeDetectionPoint;
centralizedStations?: string[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -1837,6 +1875,9 @@ export namespace graphicData {
if (this.type != null) {
data.type = this.type;
}
if (this.centralizedStations != null) {
data.centralizedStations = this.centralizedStations;
}
return data;
}
serialize(): Uint8Array;
@ -1855,6 +1896,8 @@ export namespace graphicData {
writer.writeInt32(5, this.index);
if (this.type != AxleCounting.TypeDetectionPoint.AxleCounting)
writer.writeEnum(7, this.type);
if (this.centralizedStations.length)
writer.writeRepeatedString(8, this.centralizedStations);
if (!w)
return writer.getResultBuffer();
}
@ -1882,6 +1925,9 @@ export namespace graphicData {
case 7:
message.type = reader.readEnum();
break;
case 8:
pb_1.Message.addToRepeatedField(message, 8, reader.readString());
break;
default: reader.skipField();
}
}
@ -1917,9 +1963,10 @@ export namespace graphicData {
pbTrackSectionId?: string;
pcTrackSectionId?: string;
switchMachineType?: Turnout.SwitchMachineType;
centralizedStations?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 7, 8, 13], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 7, 8, 13, 19], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -1963,6 +2010,9 @@ export namespace graphicData {
if ("switchMachineType" in data && data.switchMachineType != undefined) {
this.switchMachineType = data.switchMachineType;
}
if ("centralizedStations" in data && data.centralizedStations != undefined) {
this.centralizedStations = data.centralizedStations;
}
}
}
get common() {
@ -2061,6 +2111,12 @@ export namespace graphicData {
set switchMachineType(value: Turnout.SwitchMachineType) {
pb_1.Message.setField(this, 18, value);
}
get centralizedStations() {
return pb_1.Message.getFieldWithDefault(this, 19, []) as string[];
}
set centralizedStations(value: string[]) {
pb_1.Message.setField(this, 19, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -2076,6 +2132,7 @@ export namespace graphicData {
pbTrackSectionId?: string;
pcTrackSectionId?: string;
switchMachineType?: Turnout.SwitchMachineType;
centralizedStations?: string[];
}): Turnout {
const message = new Turnout({});
if (data.common != null) {
@ -2120,6 +2177,9 @@ export namespace graphicData {
if (data.switchMachineType != null) {
message.switchMachineType = data.switchMachineType;
}
if (data.centralizedStations != null) {
message.centralizedStations = data.centralizedStations;
}
return message;
}
toObject() {
@ -2138,6 +2198,7 @@ export namespace graphicData {
pbTrackSectionId?: string;
pcTrackSectionId?: string;
switchMachineType?: Turnout.SwitchMachineType;
centralizedStations?: string[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -2181,6 +2242,9 @@ export namespace graphicData {
if (this.switchMachineType != null) {
data.switchMachineType = this.switchMachineType;
}
if (this.centralizedStations != null) {
data.centralizedStations = this.centralizedStations;
}
return data;
}
serialize(): Uint8Array;
@ -2215,6 +2279,8 @@ export namespace graphicData {
writer.writeString(17, this.pcTrackSectionId);
if (this.switchMachineType != Turnout.SwitchMachineType.Unknown)
writer.writeEnum(18, this.switchMachineType);
if (this.centralizedStations.length)
writer.writeRepeatedString(19, this.centralizedStations);
if (!w)
return writer.getResultBuffer();
}
@ -2266,6 +2332,9 @@ export namespace graphicData {
case 18:
message.switchMachineType = reader.readEnum();
break;
case 19:
pb_1.Message.addToRepeatedField(message, 19, reader.readString());
break;
default: reader.skipField();
}
}
@ -2407,9 +2476,10 @@ export namespace graphicData {
kilometerSystem?: KilometerSystem;
index?: number;
refDev?: RelatedRef;
centralizedStations?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [9], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -2429,6 +2499,9 @@ export namespace graphicData {
if ("refDev" in data && data.refDev != undefined) {
this.refDev = data.refDev;
}
if ("centralizedStations" in data && data.centralizedStations != undefined) {
this.centralizedStations = data.centralizedStations;
}
}
}
get common() {
@ -2476,6 +2549,12 @@ export namespace graphicData {
get has_refDev() {
return pb_1.Message.getField(this, 8) != null;
}
get centralizedStations() {
return pb_1.Message.getFieldWithDefault(this, 9, []) as string[];
}
set centralizedStations(value: string[]) {
pb_1.Message.setField(this, 9, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -2483,6 +2562,7 @@ export namespace graphicData {
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number;
refDev?: ReturnType<typeof RelatedRef.prototype.toObject>;
centralizedStations?: string[];
}): Signal {
const message = new Signal({});
if (data.common != null) {
@ -2503,6 +2583,9 @@ export namespace graphicData {
if (data.refDev != null) {
message.refDev = RelatedRef.fromObject(data.refDev);
}
if (data.centralizedStations != null) {
message.centralizedStations = data.centralizedStations;
}
return message;
}
toObject() {
@ -2513,6 +2596,7 @@ export namespace graphicData {
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number;
refDev?: ReturnType<typeof RelatedRef.prototype.toObject>;
centralizedStations?: string[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -2532,6 +2616,9 @@ export namespace graphicData {
if (this.refDev != null) {
data.refDev = this.refDev.toObject();
}
if (this.centralizedStations != null) {
data.centralizedStations = this.centralizedStations;
}
return data;
}
serialize(): Uint8Array;
@ -2550,6 +2637,8 @@ export namespace graphicData {
writer.writeInt32(7, this.index);
if (this.has_refDev)
writer.writeMessage(8, this.refDev, () => this.refDev.serialize(writer));
if (this.centralizedStations.length)
writer.writeRepeatedString(9, this.centralizedStations);
if (!w)
return writer.getResultBuffer();
}
@ -2577,6 +2666,9 @@ export namespace graphicData {
case 8:
reader.readMessage(message.refDev, () => message.refDev = RelatedRef.deserialize(reader));
break;
case 9:
pb_1.Message.addToRepeatedField(message, 9, reader.readString());
break;
default: reader.skipField();
}
}
@ -2603,9 +2695,10 @@ export namespace graphicData {
trackSectionId?: string;
isCurve?: boolean;
segmentsCount?: number;
centralizedStations?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 7], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 7, 13], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -2640,6 +2733,9 @@ export namespace graphicData {
if ("segmentsCount" in data && data.segmentsCount != undefined) {
this.segmentsCount = data.segmentsCount;
}
if ("centralizedStations" in data && data.centralizedStations != undefined) {
this.centralizedStations = data.centralizedStations;
}
}
}
get common() {
@ -2717,6 +2813,12 @@ export namespace graphicData {
set segmentsCount(value: number) {
pb_1.Message.setField(this, 12, value);
}
get centralizedStations() {
return pb_1.Message.getFieldWithDefault(this, 13, []) as string[];
}
set centralizedStations(value: string[]) {
pb_1.Message.setField(this, 13, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -2729,6 +2831,7 @@ export namespace graphicData {
trackSectionId?: string;
isCurve?: boolean;
segmentsCount?: number;
centralizedStations?: string[];
}): Section {
const message = new Section({});
if (data.common != null) {
@ -2764,6 +2867,9 @@ export namespace graphicData {
if (data.segmentsCount != null) {
message.segmentsCount = data.segmentsCount;
}
if (data.centralizedStations != null) {
message.centralizedStations = data.centralizedStations;
}
return message;
}
toObject() {
@ -2779,6 +2885,7 @@ export namespace graphicData {
trackSectionId?: string;
isCurve?: boolean;
segmentsCount?: number;
centralizedStations?: string[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -2813,6 +2920,9 @@ export namespace graphicData {
if (this.segmentsCount != null) {
data.segmentsCount = this.segmentsCount;
}
if (this.centralizedStations != null) {
data.centralizedStations = this.centralizedStations;
}
return data;
}
serialize(): Uint8Array;
@ -2841,6 +2951,8 @@ export namespace graphicData {
writer.writeBool(10, this.isCurve);
if (this.segmentsCount != 0)
writer.writeInt32(12, this.segmentsCount);
if (this.centralizedStations.length)
writer.writeRepeatedString(13, this.centralizedStations);
if (!w)
return writer.getResultBuffer();
}
@ -2883,6 +2995,9 @@ export namespace graphicData {
case 12:
message.segmentsCount = reader.readInt32();
break;
case 13:
pb_1.Message.addToRepeatedField(message, 13, reader.readString());
break;
default: reader.skipField();
}
}
@ -3243,9 +3358,10 @@ export namespace graphicData {
index?: number;
kilometerSystem?: KilometerSystem;
TransponderRef?: RelatedRef;
centralizedStations?: string[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -3265,6 +3381,9 @@ export namespace graphicData {
if ("TransponderRef" in data && data.TransponderRef != undefined) {
this.TransponderRef = data.TransponderRef;
}
if ("centralizedStations" in data && data.centralizedStations != undefined) {
this.centralizedStations = data.centralizedStations;
}
}
}
get common() {
@ -3312,6 +3431,12 @@ export namespace graphicData {
get has_TransponderRef() {
return pb_1.Message.getField(this, 6) != null;
}
get centralizedStations() {
return pb_1.Message.getFieldWithDefault(this, 7, []) as string[];
}
set centralizedStations(value: string[]) {
pb_1.Message.setField(this, 7, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -3319,6 +3444,7 @@ export namespace graphicData {
index?: number;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
TransponderRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
centralizedStations?: string[];
}): Transponder {
const message = new Transponder({});
if (data.common != null) {
@ -3339,6 +3465,9 @@ export namespace graphicData {
if (data.TransponderRef != null) {
message.TransponderRef = RelatedRef.fromObject(data.TransponderRef);
}
if (data.centralizedStations != null) {
message.centralizedStations = data.centralizedStations;
}
return message;
}
toObject() {
@ -3349,6 +3478,7 @@ export namespace graphicData {
index?: number;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
TransponderRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
centralizedStations?: string[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -3368,6 +3498,9 @@ export namespace graphicData {
if (this.TransponderRef != null) {
data.TransponderRef = this.TransponderRef.toObject();
}
if (this.centralizedStations != null) {
data.centralizedStations = this.centralizedStations;
}
return data;
}
serialize(): Uint8Array;
@ -3386,6 +3519,8 @@ export namespace graphicData {
writer.writeMessage(5, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
if (this.has_TransponderRef)
writer.writeMessage(6, this.TransponderRef, () => this.TransponderRef.serialize(writer));
if (this.centralizedStations.length)
writer.writeRepeatedString(7, this.centralizedStations);
if (!w)
return writer.getResultBuffer();
}
@ -3413,6 +3548,9 @@ export namespace graphicData {
case 6:
reader.readMessage(message.TransponderRef, () => message.TransponderRef = RelatedRef.deserialize(reader));
break;
case 7:
pb_1.Message.addToRepeatedField(message, 7, reader.readString());
break;
default: reader.skipField();
}
}
@ -6131,7 +6269,7 @@ export namespace graphicData {
}
}
}
export class UniqueIdType extends pb_1.Message {
export class UniqueIdOfStationLayout extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
city?: string;
@ -6163,8 +6301,8 @@ export namespace graphicData {
static fromObject(data: {
city?: string;
lineId?: string;
}): UniqueIdType {
const message = new UniqueIdType({});
}): UniqueIdOfStationLayout {
const message = new UniqueIdOfStationLayout({});
if (data.city != null) {
message.city = data.city;
}
@ -6197,8 +6335,8 @@ export namespace graphicData {
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UniqueIdType {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UniqueIdType();
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UniqueIdOfStationLayout {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UniqueIdOfStationLayout();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
@ -6217,8 +6355,8 @@ export namespace graphicData {
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): UniqueIdType {
return UniqueIdType.deserialize(bytes);
static deserializeBinary(bytes: Uint8Array): UniqueIdOfStationLayout {
return UniqueIdOfStationLayout.deserialize(bytes);
}
}
}