各设备增加索引

This commit is contained in:
fan 2023-07-14 17:53:29 +08:00
parent d52c6e3732
commit 48a4874a94
19 changed files with 192 additions and 384 deletions

@ -1 +1 @@
Subproject commit 31212079c61ac18638a6b93fda81388f4ad5a733 Subproject commit 5ead82f5bfc0fe13025cfc89d4a825c4a3105565

View File

@ -7,9 +7,6 @@
</q-card-section> </q-card-section>
<q-separator inset></q-separator> <q-separator inset></q-separator>
<q-card-section> <q-card-section>
<template v-if="drawStore.drawGraphicType === Link.Type">
<link-template></link-template>
</template>
<template v-if="drawStore.drawGraphicType === Rect.Type"> <template v-if="drawStore.drawGraphicType === Rect.Type">
<rect-template></rect-template> <rect-template></rect-template>
</template> </template>
@ -42,9 +39,6 @@
</template> </template>
<template v-else-if="drawStore.selectedGraphics.length === 1"> <template v-else-if="drawStore.selectedGraphics.length === 1">
<q-card-section> <q-card-section>
<link-property
v-if="drawStore.selectedGraphicType === Link.Type"
></link-property>
<rect-property <rect-property
v-if="drawStore.selectedGraphicType === Rect.Type" v-if="drawStore.selectedGraphicType === Rect.Type"
></rect-property> ></rect-property>
@ -94,13 +88,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import LinkTemplate from './templates/LinkTemplate.vue';
import RectTemplate from './templates/RectTemplate.vue'; import RectTemplate from './templates/RectTemplate.vue';
import PlatformTemplate from './templates/PlatformTemplate.vue'; import PlatformTemplate from './templates/PlatformTemplate.vue';
import StationTemplate from './templates/StationTemplate.vue'; import StationTemplate from './templates/StationTemplate.vue';
// import TrainTemplate from './templates/TrainTemplate.vue'; // import TrainTemplate from './templates/TrainTemplate.vue';
import CanvasProperty from './properties/CanvasProperty.vue'; import CanvasProperty from './properties/CanvasProperty.vue';
import LinkProperty from './properties/LinkProperty.vue';
import RectProperty from './properties/RectProperty.vue'; import RectProperty from './properties/RectProperty.vue';
import PlatformProperty from './properties/PlatformProperty.vue'; import PlatformProperty from './properties/PlatformProperty.vue';
import StationProperty from './properties/StationProperty.vue'; import StationProperty from './properties/StationProperty.vue';

View File

@ -1,96 +0,0 @@
<template>
<q-form>
<q-input outlined readonly v-model="linkModel.id" label="id" hint="" />
<q-input
outlined
v-model.number="linkModel.lineWidth"
type="number"
@blur="onUpdate"
label="线宽"
lazy-rules
:rules="[(val) => (val && val > 0) || '画布宽必须大于0']"
/>
<q-input
outlined
v-model="linkModel.lineColor"
@blur="onUpdate"
label="线色"
lazy-rules
:rules="[(val) => (val && val.length > 0) || '线色不能为空']"
>
<template v-slot:append>
<q-icon name="colorize" class="cursor-pointer">
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
<q-color
v-model="linkModel.lineColor"
@change="
(val) => {
linkModel.lineColor = val;
onUpdate();
}
"
/>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<!-- <q-btn-toggle
disable
v-model="linkModel.curve"
:options="[
{ label: '直线', value: false },
{ label: '曲线', value: true },
]"
/> -->
<q-input
v-if="linkModel.curve"
outlined
v-model.number="linkModel.segmentsCount"
type="number"
@blur="onUpdate"
label="曲线分段数量"
lazy-rules
:rules="[(val) => (val && val > 0) || '曲线分段数量必须大于0']"
/>
</q-form>
</template>
<script setup lang="ts">
import { LinkData } from 'src/drawApp/graphics/LinkInteraction';
import { Link } from 'src/graphics/link/Link';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive, watch } from 'vue';
const drawStore = useDrawStore();
const linkModel = reactive(new LinkData());
drawStore.$subscribe;
watch(
() => drawStore.selectedGraphic,
(val) => {
if (val && val.type == Link.Type) {
// console.log('link');
linkModel.copyFrom(val.saveData() as LinkData);
}
}
);
onMounted(() => {
// console.log('link mounted');
const link = drawStore.selectedGraphic as Link;
if (link) {
linkModel.copyFrom(link.saveData());
}
});
function onUpdate() {
console.log('link 属性更新');
const link = drawStore.selectedGraphic as Link;
if (link) {
drawStore.getDrawApp().updateGraphicAndRecord(link, linkModel);
}
}
</script>

View File

@ -1,6 +1,20 @@
<template> <template>
<q-form> <q-form>
<q-input outlined readonly v-model="platformModel.id" label="id" hint="" /> <q-input outlined readonly v-model="platformModel.id" label="id" hint="" />
<q-input
outlined
v-model.number="platformModel.index"
type="number"
@blur="onUpdate"
label="索引"
/>
<q-input
outlined
v-model.number="platformModel.refStationIndex"
type="number"
@blur="onUpdate"
label="对应车站索引"
/>
<q-select <q-select
outlined outlined
@blur="onUpdate" @blur="onUpdate"

View File

@ -12,7 +12,7 @@
v-model.number="sectionLinkModel.index" v-model.number="sectionLinkModel.index"
type="number" type="number"
@blur="onUpdate" @blur="onUpdate"
label="编号" label="索引"
/> />
<q-checkbox <q-checkbox
v-model="sectionLinkModel.up" v-model="sectionLinkModel.up"

View File

@ -7,6 +7,13 @@
@blur="onUpdate" @blur="onUpdate"
label="编号" label="编号"
/> />
<q-input
outlined
v-model.number="signalModel.index"
type="number"
@blur="onUpdate"
label="索引"
/>
<q-select <q-select
outlined outlined
style="margin-top: 10px" style="margin-top: 10px"

View File

@ -10,6 +10,13 @@
lazy-rules lazy-rules
autogrow autogrow
/> />
<q-input
outlined
v-model.number="stationModel.index"
type="number"
@blur="onUpdate"
label="索引"
/>
<q-select <q-select
outlined outlined
style="margin-top: 10px" style="margin-top: 10px"

View File

@ -7,6 +7,13 @@
@blur="onUpdate" @blur="onUpdate"
label="编号" label="编号"
/> />
<q-input
outlined
v-model.number="turnoutModel.index"
type="number"
@blur="onUpdate"
label="索引"
/>
<q-select <q-select
outlined outlined
style="margin-top: 10px" style="margin-top: 10px"

View File

@ -1,96 +0,0 @@
<template>
<q-form>
<q-input
outlined
v-model.number="template.lineWidth"
type="number"
@blur="onUpdate"
label="线宽 *"
lazy-rules
:rules="[(val) => (val && val > 0) || '线宽必须大于0']"
/>
<q-input
outlined
v-model="template.lineColor"
@blur="onUpdate"
label="线色 *"
lazy-rules
:rules="[(val) => (val && val.length > 0) || '线色不能为空']"
>
<template v-slot:append>
<q-icon name="colorize" class="cursor-pointer">
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
<q-color
v-model="template.lineColor"
@change="
(val) => {
template.lineColor = val;
onUpdate();
}
"
/>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-btn-toggle
v-model="template.curve"
@update:model-value="onUpdate"
:options="[
{ label: '直线', value: false },
{ label: '曲线', value: true },
]"
/>
<q-input
v-if="template.curve"
outlined
v-model.number="template.segmentsCount"
type="number"
@blur="onUpdate"
label="曲线分段数量 *"
lazy-rules
:rules="[(val) => (val && val > 0) || '曲线分段数量必须大于0']"
/>
</q-form>
</template>
<script setup lang="ts">
import { LinkTemplate } from 'src/graphics/link/Link';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive } from 'vue';
const drawStore = useDrawStore();
const template = reactive({
lineWidth: 1,
lineColor: '#0000ff',
curve: false,
segmentsCount: 10,
});
onMounted(() => {
const type = drawStore.drawGraphicType;
if (type) {
const gt = drawStore.drawGraphicTemplate;
if (gt) {
const lt = gt as LinkTemplate;
template.lineWidth = lt.lineWidth;
template.lineColor = lt.lineColor;
template.curve = lt.curve;
template.segmentsCount = lt.segmentsCount;
}
}
});
function onUpdate() {
const gt = drawStore.drawGraphicTemplate as LinkTemplate;
if (gt) {
gt.lineWidth = template.lineWidth;
gt.lineColor = template.lineColor;
gt.curve = template.curve;
gt.segmentsCount = template.segmentsCount;
}
}
</script>

View File

@ -1,182 +0,0 @@
import * as pb_1 from 'google-protobuf';
import { IPointData, DisplayObject, FederatedMouseEvent } from 'pixi.js';
import { ILinkData, Link } from 'src/graphics/link/Link';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { GraphicDataBase } from './GraphicDataBase';
import { ContextMenu } from 'src/jl-graphic/ui/ContextMenu';
import { MenuItemOptions } from 'src/jl-graphic/ui/Menu';
import {
GraphicApp,
GraphicInteractionPlugin,
JlGraphic,
} from 'src/jl-graphic';
import {
addWayPoint,
clearWayPoint,
getWaypointRangeIndex,
PolylineEditPlugin,
removeLineWayPoint,
} from 'src/jl-graphic/plugins/GraphicEditPlugin';
export class LinkData extends GraphicDataBase implements ILinkData {
constructor(data?: graphicData.Link) {
let link;
if (!data) {
link = new graphicData.Link({
common: GraphicDataBase.defaultCommonInfo(Link.Type),
});
} else {
link = data;
}
super(link);
}
public get data(): graphicData.Link {
return this.getData<graphicData.Link>();
}
get code(): string {
return this.data.code;
}
set code(v: string) {
this.data.code = v;
}
get curve(): boolean {
return this.data.curve;
}
set curve(v: boolean) {
this.data.curve = v;
}
get curveNumber(): number {
return this.data.curve ? 1 : 0;
}
set curveNumber(v: number) {
this.data.curve = v === 0 ? false : true;
}
get segmentsCount(): number {
return this.data.segmentsCount;
}
set segmentsCount(v: number) {
this.data.segmentsCount = v;
}
get points(): IPointData[] {
return this.data.points;
}
set points(points: IPointData[]) {
this.data.points = points.map(
(p) => new graphicData.Point({ x: p.x, y: p.y })
);
}
get lineWidth(): number {
return this.data.lineWidth;
}
set lineWidth(v: number) {
this.data.lineWidth = v;
}
get lineColor(): string {
return this.data.lineColor;
}
set lineColor(v: string) {
this.data.lineColor = v;
}
clone(): LinkData {
return new LinkData(this.data.cloneMessage());
}
copyFrom(data: LinkData): void {
pb_1.Message.copyInto(data.data, this.data);
}
eq(other: LinkData): boolean {
return pb_1.Message.equals(this.data, other.data);
}
}
export const addWaypointConfig: MenuItemOptions = {
name: '添加路径点',
};
export const removeWaypointConfig: MenuItemOptions = {
name: '移除路径点',
};
export const clearWaypointsConfig: MenuItemOptions = {
name: '清除所有路径点',
};
const LinkEditMenu: ContextMenu = ContextMenu.init({
name: '轨道编辑菜单',
groups: [
{
items: [addWaypointConfig, clearWaypointsConfig],
},
],
});
const EpEditMenu: ContextMenu = ContextMenu.init({
name: '轨道编辑菜单2',
groups: [
{
items: [removeWaypointConfig, clearWaypointsConfig],
},
],
});
export class DrawLinkPlugin extends GraphicInteractionPlugin<Link> {
static Name = 'link_draw_right_menu';
constructor(app: GraphicApp) {
super(DrawLinkPlugin.Name, app);
app.registerMenu(LinkEditMenu);
app.registerMenu(EpEditMenu);
}
static init(app: GraphicApp) {
return new DrawLinkPlugin(app);
}
filter(...grahpics: JlGraphic[]): Link[] | undefined {
return grahpics.filter((g) => g.type === Link.Type).map((g) => g as Link);
}
bind(g: Link): void {
g.on('_rightclick', this.onContextMenu, this);
g.on('selected', this.onSelected, this);
}
unbind(g: Link): void {
g.off('_rightclick', this.onContextMenu, this);
g.off('selected', this.onSelected, this);
}
onSelected(g: DisplayObject) {
const polylineEditPlugin = g.assistantAppendMap.get(
PolylineEditPlugin.Name
) as PolylineEditPlugin;
const link = g.getGraphic() as Link;
polylineEditPlugin.editedPoints.forEach((ep, index) => {
ep.on('rightclick', (e: FederatedMouseEvent) => {
this.app.registerMenu(EpEditMenu);
removeWaypointConfig.handler = () => {
removeLineWayPoint(link, index);
};
clearWaypointsConfig.handler = () => {
clearWayPoint(link, false);
};
EpEditMenu.open(e.global);
});
});
}
onContextMenu(e: FederatedMouseEvent) {
const target = e.target as DisplayObject;
const link = target.getGraphic() as Link;
this.app.updateSelected(link);
addWaypointConfig.handler = () => {
const linePoints = link.linePoints;
const p = link.screenToLocalPoint(e.global);
const { start, end } = getWaypointRangeIndex(
linePoints,
false,
p,
link.datas.lineWidth
);
addWayPoint(link, false, start, end, p);
};
clearWaypointsConfig.handler = () => {
clearWayPoint(link, false);
};
LinkEditMenu.open(e.global);
}
}

View File

@ -51,6 +51,18 @@ export class PlatformData extends GraphicDataBase implements IPlatformData {
set direction(v: string) { set direction(v: string) {
this.data.direction = v; this.data.direction = v;
} }
get index(): number {
return this.data.index;
}
set index(v: number) {
this.data.index = v;
}
get refStationIndex(): number {
return this.data.refStationIndex;
}
set refStationIndex(v: number) {
this.data.refStationIndex = v;
}
clone(): PlatformData { clone(): PlatformData {
return new PlatformData(this.data.cloneMessage()); return new PlatformData(this.data.cloneMessage());

View File

@ -50,6 +50,12 @@ export class SignalData extends GraphicDataBase implements ISignalData {
set kilometerSystem(v: KilometerSystem) { set kilometerSystem(v: KilometerSystem) {
this.data.kilometerSystem = new graphicData.KilometerSystem(v); this.data.kilometerSystem = new graphicData.KilometerSystem(v);
} }
get index(): number {
return this.data.index;
}
set index(v: number) {
this.data.index = v;
}
clone(): SignalData { clone(): SignalData {
return new SignalData(this.data.cloneMessage()); return new SignalData(this.data.cloneMessage());
} }

View File

@ -57,6 +57,12 @@ export class StationData extends GraphicDataBase implements IStationData {
set concentrationStations(v: boolean) { set concentrationStations(v: boolean) {
this.data.concentrationStations = v; this.data.concentrationStations = v;
} }
get index(): number {
return this.data.index;
}
set index(v: number) {
this.data.index = v;
}
clone(): StationData { clone(): StationData {
return new StationData(this.data.cloneMessage()); return new StationData(this.data.cloneMessage());
} }

View File

@ -86,6 +86,12 @@ export class TurnoutData extends GraphicDataBase implements ITurnoutData {
(v) => new graphicData.KilometerSystem(v) (v) => new graphicData.KilometerSystem(v)
); );
} }
get index(): number {
return this.data.index;
}
set index(v: number) {
this.data.index = v;
}
clone(): TurnoutData { clone(): TurnoutData {
return new TurnoutData(this.data.cloneMessage()); return new TurnoutData(this.data.cloneMessage());
} }

View File

@ -17,6 +17,10 @@ export interface IPlatformData extends GraphicData {
set hasdoor(v: boolean); set hasdoor(v: boolean);
get direction(): string; // 屏蔽门上下 get direction(): string; // 屏蔽门上下
set direction(v: string); set direction(v: string);
get index(): number;
set index(v: number);
get refStationIndex(): number;
set refStationIndex(v: number);
clone(): IPlatformData; clone(): IPlatformData;
copyFrom(data: IPlatformData): void; copyFrom(data: IPlatformData): void;
eq(other: IPlatformData): boolean; eq(other: IPlatformData): boolean;

View File

@ -24,6 +24,8 @@ export interface ISignalData extends GraphicData {
set mirror(v: boolean); set mirror(v: boolean);
get kilometerSystem(): KilometerSystem; get kilometerSystem(): KilometerSystem;
set kilometerSystem(v: KilometerSystem); set kilometerSystem(v: KilometerSystem);
get index(): number;
set index(v: number);
clone(): ISignalData; clone(): ISignalData;
copyFrom(data: ISignalData): void; copyFrom(data: ISignalData): void;
eq(other: ISignalData): boolean; eq(other: ISignalData): boolean;

View File

@ -17,6 +17,8 @@ export interface IStationData extends GraphicData {
set hasControl(v: boolean); set hasControl(v: boolean);
get concentrationStations(): boolean; ////是否集中站 get concentrationStations(): boolean; ////是否集中站
set concentrationStations(v: boolean); set concentrationStations(v: boolean);
get index(): number;
set index(v: number);
clone(): IStationData; clone(): IStationData;
copyFrom(data: IStationData): void; copyFrom(data: IStationData): void;
eq(other: IStationData): boolean; eq(other: IStationData): boolean;

View File

@ -35,6 +35,8 @@ export interface ITurnoutData extends GraphicData {
set pcRef(ref: IRelatedRefData | undefined); set pcRef(ref: IRelatedRefData | undefined);
get kilometerSystem(): KilometerSystem[]; get kilometerSystem(): KilometerSystem[];
set kilometerSystem(v: KilometerSystem[]); set kilometerSystem(v: KilometerSystem[]);
get index(): number;
set index(v: number);
clone(): ITurnoutData; clone(): ITurnoutData;
copyFrom(data: ITurnoutData): void; copyFrom(data: ITurnoutData): void;
eq(other: ITurnoutData): boolean; eq(other: ITurnoutData): boolean;

View File

@ -941,6 +941,8 @@ export namespace graphicData {
code?: string; code?: string;
hasdoor?: boolean; hasdoor?: boolean;
direction?: string; direction?: string;
index?: number;
refStationIndex?: number;
}) { }) {
super(); 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, [], this.#one_of_decls);
@ -957,6 +959,12 @@ export namespace graphicData {
if ("direction" in data && data.direction != undefined) { if ("direction" in data && data.direction != undefined) {
this.direction = data.direction; this.direction = data.direction;
} }
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
if ("refStationIndex" in data && data.refStationIndex != undefined) {
this.refStationIndex = data.refStationIndex;
}
} }
} }
get common() { get common() {
@ -986,11 +994,25 @@ export namespace graphicData {
set direction(value: string) { set direction(value: string) {
pb_1.Message.setField(this, 4, value); pb_1.Message.setField(this, 4, value);
} }
get index() {
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
}
set index(value: number) {
pb_1.Message.setField(this, 5, value);
}
get refStationIndex() {
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
}
set refStationIndex(value: number) {
pb_1.Message.setField(this, 6, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
hasdoor?: boolean; hasdoor?: boolean;
direction?: string; direction?: string;
index?: number;
refStationIndex?: number;
}): Platform { }): Platform {
const message = new Platform({}); const message = new Platform({});
if (data.common != null) { if (data.common != null) {
@ -1005,6 +1027,12 @@ export namespace graphicData {
if (data.direction != null) { if (data.direction != null) {
message.direction = data.direction; message.direction = data.direction;
} }
if (data.index != null) {
message.index = data.index;
}
if (data.refStationIndex != null) {
message.refStationIndex = data.refStationIndex;
}
return message; return message;
} }
toObject() { toObject() {
@ -1013,6 +1041,8 @@ export namespace graphicData {
code?: string; code?: string;
hasdoor?: boolean; hasdoor?: boolean;
direction?: string; direction?: string;
index?: number;
refStationIndex?: number;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -1026,6 +1056,12 @@ export namespace graphicData {
if (this.direction != null) { if (this.direction != null) {
data.direction = this.direction; data.direction = this.direction;
} }
if (this.index != null) {
data.index = this.index;
}
if (this.refStationIndex != null) {
data.refStationIndex = this.refStationIndex;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -1040,6 +1076,10 @@ export namespace graphicData {
writer.writeBool(3, this.hasdoor); writer.writeBool(3, this.hasdoor);
if (this.direction.length) if (this.direction.length)
writer.writeString(4, this.direction); writer.writeString(4, this.direction);
if (this.index != 0)
writer.writeInt32(5, this.index);
if (this.refStationIndex != 0)
writer.writeInt32(6, this.refStationIndex);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1061,6 +1101,12 @@ export namespace graphicData {
case 4: case 4:
message.direction = reader.readString(); message.direction = reader.readString();
break; break;
case 5:
message.index = reader.readInt32();
break;
case 6:
message.refStationIndex = reader.readInt32();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -1081,6 +1127,7 @@ export namespace graphicData {
hasControl?: boolean; hasControl?: boolean;
concentrationStations?: boolean; concentrationStations?: boolean;
kilometerSystem?: KilometerSystem; kilometerSystem?: KilometerSystem;
index?: number;
}) { }) {
super(); 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, [], this.#one_of_decls);
@ -1100,6 +1147,9 @@ export namespace graphicData {
if ("kilometerSystem" in data && data.kilometerSystem != undefined) { if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem; this.kilometerSystem = data.kilometerSystem;
} }
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
} }
} }
get common() { get common() {
@ -1138,12 +1188,19 @@ export namespace graphicData {
get has_kilometerSystem() { get has_kilometerSystem() {
return pb_1.Message.getField(this, 6) != null; return pb_1.Message.getField(this, 6) != null;
} }
get index() {
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
}
set index(value: number) {
pb_1.Message.setField(this, 7, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
hasControl?: boolean; hasControl?: boolean;
concentrationStations?: boolean; concentrationStations?: boolean;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number;
}): Station { }): Station {
const message = new Station({}); const message = new Station({});
if (data.common != null) { if (data.common != null) {
@ -1161,6 +1218,9 @@ export namespace graphicData {
if (data.kilometerSystem != null) { if (data.kilometerSystem != null) {
message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
} }
if (data.index != null) {
message.index = data.index;
}
return message; return message;
} }
toObject() { toObject() {
@ -1170,6 +1230,7 @@ export namespace graphicData {
hasControl?: boolean; hasControl?: boolean;
concentrationStations?: boolean; concentrationStations?: boolean;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -1186,6 +1247,9 @@ export namespace graphicData {
if (this.kilometerSystem != null) { if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.toObject(); data.kilometerSystem = this.kilometerSystem.toObject();
} }
if (this.index != null) {
data.index = this.index;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -1202,6 +1266,8 @@ export namespace graphicData {
writer.writeBool(4, this.concentrationStations); writer.writeBool(4, this.concentrationStations);
if (this.has_kilometerSystem) if (this.has_kilometerSystem)
writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
if (this.index != 0)
writer.writeInt32(7, this.index);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1226,6 +1292,9 @@ export namespace graphicData {
case 6: case 6:
reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader));
break; break;
case 7:
message.index = reader.readInt32();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -1531,6 +1600,7 @@ export namespace graphicData {
pbRef?: RelatedRef; pbRef?: RelatedRef;
pcRef?: RelatedRef; pcRef?: RelatedRef;
kilometerSystem?: KilometerSystem[]; kilometerSystem?: KilometerSystem[];
index?: number;
}) { }) {
super(); 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], this.#one_of_decls);
@ -1562,6 +1632,9 @@ export namespace graphicData {
if ("kilometerSystem" in data && data.kilometerSystem != undefined) { if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem; this.kilometerSystem = data.kilometerSystem;
} }
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
} }
} }
get common() { get common() {
@ -1630,6 +1703,12 @@ export namespace graphicData {
set kilometerSystem(value: KilometerSystem[]) { set kilometerSystem(value: KilometerSystem[]) {
pb_1.Message.setRepeatedWrapperField(this, 13, value); pb_1.Message.setRepeatedWrapperField(this, 13, value);
} }
get index() {
return pb_1.Message.getFieldWithDefault(this, 14, 0) as number;
}
set index(value: number) {
pb_1.Message.setField(this, 14, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
@ -1640,6 +1719,7 @@ export namespace graphicData {
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>[]; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>[];
index?: number;
}): Turnout { }): Turnout {
const message = new Turnout({}); const message = new Turnout({});
if (data.common != null) { if (data.common != null) {
@ -1669,6 +1749,9 @@ export namespace graphicData {
if (data.kilometerSystem != null) { if (data.kilometerSystem != null) {
message.kilometerSystem = data.kilometerSystem.map(item => KilometerSystem.fromObject(item)); message.kilometerSystem = data.kilometerSystem.map(item => KilometerSystem.fromObject(item));
} }
if (data.index != null) {
message.index = data.index;
}
return message; return message;
} }
toObject() { toObject() {
@ -1682,6 +1765,7 @@ export namespace graphicData {
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>; pcRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>[]; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>[];
index?: number;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -1710,6 +1794,9 @@ export namespace graphicData {
if (this.kilometerSystem != null) { if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.map((item: KilometerSystem) => item.toObject()); data.kilometerSystem = this.kilometerSystem.map((item: KilometerSystem) => item.toObject());
} }
if (this.index != null) {
data.index = this.index;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -1734,6 +1821,8 @@ export namespace graphicData {
writer.writeMessage(11, this.pcRef, () => this.pcRef.serialize(writer)); writer.writeMessage(11, this.pcRef, () => this.pcRef.serialize(writer));
if (this.kilometerSystem.length) if (this.kilometerSystem.length)
writer.writeRepeatedMessage(13, this.kilometerSystem, (item: KilometerSystem) => item.serialize(writer)); writer.writeRepeatedMessage(13, this.kilometerSystem, (item: KilometerSystem) => item.serialize(writer));
if (this.index != 0)
writer.writeInt32(14, this.index);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -1770,6 +1859,9 @@ export namespace graphicData {
case 13: case 13:
reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 13, KilometerSystem.deserialize(reader), KilometerSystem)); reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 13, KilometerSystem.deserialize(reader), KilometerSystem));
break; break;
case 14:
message.index = reader.readInt32();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -1879,6 +1971,7 @@ export namespace graphicData {
code?: string; code?: string;
mirror?: boolean; mirror?: boolean;
kilometerSystem?: KilometerSystem; kilometerSystem?: KilometerSystem;
index?: number;
}) { }) {
super(); 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, [], this.#one_of_decls);
@ -1895,6 +1988,9 @@ export namespace graphicData {
if ("kilometerSystem" in data && data.kilometerSystem != undefined) { if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem; this.kilometerSystem = data.kilometerSystem;
} }
if ("index" in data && data.index != undefined) {
this.index = data.index;
}
} }
} }
get common() { get common() {
@ -1927,11 +2023,18 @@ export namespace graphicData {
get has_kilometerSystem() { get has_kilometerSystem() {
return pb_1.Message.getField(this, 6) != null; return pb_1.Message.getField(this, 6) != null;
} }
get index() {
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
}
set index(value: number) {
pb_1.Message.setField(this, 7, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
mirror?: boolean; mirror?: boolean;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number;
}): Signal { }): Signal {
const message = new Signal({}); const message = new Signal({});
if (data.common != null) { if (data.common != null) {
@ -1946,6 +2049,9 @@ export namespace graphicData {
if (data.kilometerSystem != null) { if (data.kilometerSystem != null) {
message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
} }
if (data.index != null) {
message.index = data.index;
}
return message; return message;
} }
toObject() { toObject() {
@ -1954,6 +2060,7 @@ export namespace graphicData {
code?: string; code?: string;
mirror?: boolean; mirror?: boolean;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>; kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
index?: number;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -1967,6 +2074,9 @@ export namespace graphicData {
if (this.kilometerSystem != null) { if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.toObject(); data.kilometerSystem = this.kilometerSystem.toObject();
} }
if (this.index != null) {
data.index = this.index;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -1981,6 +2091,8 @@ export namespace graphicData {
writer.writeBool(3, this.mirror); writer.writeBool(3, this.mirror);
if (this.has_kilometerSystem) if (this.has_kilometerSystem)
writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
if (this.index != 0)
writer.writeInt32(7, this.index);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -2002,6 +2114,9 @@ export namespace graphicData {
case 6: case 6:
reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader));
break; break;
case 7:
message.index = reader.readInt32();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }