diff --git a/bj-rtss-message b/bj-rtss-message index c87d9f5..86bf1f0 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit c87d9f5a4108c8b01ac16aff151d7b1a385156a0 +Subproject commit 86bf1f0c76ade5866afd8063e8f263ca9eda55a5 diff --git a/graphic-pixi b/graphic-pixi index 7aff26f..75f2f22 160000 --- a/graphic-pixi +++ b/graphic-pixi @@ -1 +1 @@ -Subproject commit 7aff26f0d3dba72592e7eaf8a0ab1637ebc18e4c +Subproject commit 75f2f2266c8af0acf52cc9775c096c911407cc13 diff --git a/src/components/draw-app/DrawProperties.vue b/src/components/draw-app/DrawProperties.vue index b1b628b..eda9a2e 100644 --- a/src/components/draw-app/DrawProperties.vue +++ b/src/components/draw-app/DrawProperties.vue @@ -96,6 +96,9 @@ + @@ -143,6 +146,8 @@ import GatedBoxProperty from './properties/GatedBoxProperty.vue'; import { GatedBox } from 'src/graphics/gatedBox/GatedBox'; import EsbButtonProperty from './properties/EsbButtonProperty.vue'; import { EsbButton } from 'src/graphics/esbButton/EsbButton'; +import KiloMarkerProperty from './properties/KiloMarkerProperty.vue'; +import { SlopeKiloMarker } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; const drawStore = useDrawStore(); diff --git a/src/components/draw-app/properties/KiloMarkerProperty.vue b/src/components/draw-app/properties/KiloMarkerProperty.vue new file mode 100644 index 0000000..e36730f --- /dev/null +++ b/src/components/draw-app/properties/KiloMarkerProperty.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/drawApp/graphics/SlopeKiloMarkerInteraction.ts b/src/drawApp/graphics/SlopeKiloMarkerInteraction.ts new file mode 100644 index 0000000..aadb4f7 --- /dev/null +++ b/src/drawApp/graphics/SlopeKiloMarkerInteraction.ts @@ -0,0 +1,57 @@ +import * as pb_1 from 'google-protobuf'; +import { + ISlopeKiloMarkerData, + SlopeKiloMarker, +} from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; +import { GraphicDataBase } from './GraphicDataBase'; +import { graphicData } from 'src/protos/stationLayoutGraphics'; + +export class SlopeKiloMarkerData + extends GraphicDataBase + implements ISlopeKiloMarkerData +{ + constructor(data?: graphicData.SlopeKiloMarker) { + let platform; + if (!data) { + platform = new graphicData.SlopeKiloMarker({ + common: GraphicDataBase.defaultCommonInfo(SlopeKiloMarker.Type), + }); + } else { + platform = data; + } + super(platform); + } + + public get data(): graphicData.SlopeKiloMarker { + return this.getData(); + } + + get code(): string { + return this.data.code; + } + set code(v: string) { + this.data.code = v; + } + get direction(): graphicData.Direction { + return this.data.direction; + } + set direction(v: graphicData.Direction) { + this.data.direction = v; + } + get kilometerSystem(): graphicData.KilometerSystem { + return this.data.kilometerSystem; + } + set kilometerSystem(v: graphicData.KilometerSystem) { + this.data.kilometerSystem = v; + } + + clone(): SlopeKiloMarkerData { + return new SlopeKiloMarkerData(this.data.cloneMessage()); + } + copyFrom(data: SlopeKiloMarkerData): void { + pb_1.Message.copyInto(data.data, this.data); + } + eq(other: SlopeKiloMarkerData): boolean { + return pb_1.Message.equals(this.data, other.data); + } +} diff --git a/src/drawApp/index.ts b/src/drawApp/index.ts index d84d487..56d74f5 100644 --- a/src/drawApp/index.ts +++ b/src/drawApp/index.ts @@ -111,6 +111,12 @@ import { TransponderTemplate, } from 'src/graphics/transponder/Transponder'; import { TransponderData } from './graphics/TransponderInteraction'; +import { SlopeKiloMarkerDrawAssistant } from 'src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant'; +import { + SlopeKiloMarker, + SlopeKiloMarkerTemplate, +} from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; +import { SlopeKiloMarkerData } from './graphics/SlopeKiloMarkerInteraction'; // export function fromStoragePoint(p: graphicData.Point): Point { // return new Point(p.x, p.y); @@ -248,6 +254,7 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { | GatedBoxDraw | EsbButtonDraw | TransponderDraw + | SlopeKiloMarkerDrawAssistant )[] = []; if (draftType === 'Line') { drawAssistants = [ @@ -293,6 +300,10 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData())), new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData())), new EsbButtonDraw(app, new EsbButtonTemplate(new EsbButtonData())), + new SlopeKiloMarkerDrawAssistant( + app, + new SlopeKiloMarkerTemplate(new SlopeKiloMarkerData()) + ), ]; DrawSignalInteraction.init(app); DrawStopPositionInteraction.init(app); @@ -505,6 +516,11 @@ export function saveDrawDatas(app: JlDrawApp) { } else if (Transponder.Type === g.type) { const transponderData = (g as Transponder).saveData(); storage.transponders.push((transponderData as TransponderData).data); + } else if (SlopeKiloMarker.Type === g.type) { + const slopeKiloMarkerData = (g as SlopeKiloMarker).saveData(); + storage.slopeKiloMarker.push( + (slopeKiloMarkerData as SlopeKiloMarkerData).data + ); } }); const base64 = fromUint8Array(storage.serialize()); @@ -588,6 +604,9 @@ export async function loadDrawDatas(app: GraphicApp) { storage.transponders.forEach((transponder) => { datas.push(new TransponderData(transponder)); }); + storage.slopeKiloMarker.forEach((slopeKiloMarker) => { + datas.push(new SlopeKiloMarkerData(slopeKiloMarker)); + }); await app.loadGraphic(datas); } else { app.loadGraphic([]); diff --git a/src/drawApp/lineApp.ts b/src/drawApp/lineApp.ts index 2716b3d..a0b48dd 100644 --- a/src/drawApp/lineApp.ts +++ b/src/drawApp/lineApp.ts @@ -87,6 +87,8 @@ import { TransponderTemplate, } from 'src/graphics/transponder/Transponder'; import { TransponderData } from './graphics/TransponderInteraction'; +import { SlopeKiloMarkerTemplate } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; +import { SlopeKiloMarkerData } from './graphics/SlopeKiloMarkerInteraction'; let lineApp: GraphicApp | null = null; @@ -165,6 +167,7 @@ export function initLineApp(dom: HTMLElement): GraphicApp { new GatedBoxTemplate(new GatedBoxData()), new EsbButtonTemplate(new EsbButtonData()), new TransponderTemplate(new TransponderData()), + new SlopeKiloMarkerTemplate(new SlopeKiloMarkerData()), ]; lineApp.registerGraphicTemplates(...graphicTemplate); lineApp.setOptions({ diff --git a/src/graphics/kilometerMarker/KilometerMarker.ts b/src/graphics/kilometerMarker/KilometerMarker.ts new file mode 100644 index 0000000..031531a --- /dev/null +++ b/src/graphics/kilometerMarker/KilometerMarker.ts @@ -0,0 +1,10 @@ +import { Graphics } from 'pixi.js'; + +export class KilometerMarker extends Graphics { + constructor() { + super(); + } + paint() { + this.clear().lineStyle(1, '#fff').moveTo(0, -50).lineTo(0, 50); + } +} diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index a4f8072..643cd4d 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -199,7 +199,6 @@ export class SectionDraw extends GraphicDrawAssistant< g.position.set(turnout.datas.pointC[0].x, turnout.datas.pointC[0].y); g.loadData(turnoutPhysicalSectionData); this.storeGraphic(g); - console.log(g); g.loadRelations(); }); } diff --git a/src/graphics/slopeKiloMarker/SlopeKiloMarker.ts b/src/graphics/slopeKiloMarker/SlopeKiloMarker.ts new file mode 100644 index 0000000..407b4cb --- /dev/null +++ b/src/graphics/slopeKiloMarker/SlopeKiloMarker.ts @@ -0,0 +1,46 @@ +import { GraphicData, JlGraphic, JlGraphicTemplate } from 'src/jl-graphic'; +import { KilometerMarker } from '../kilometerMarker/KilometerMarker'; +import { KilometerSystem } from '../signal/Signal'; +import { graphicData } from 'src/protos/stationLayoutGraphics'; + +export interface ISlopeKiloMarkerData extends GraphicData { + get code(): string; // 编号 + set code(v: string); + get direction(): graphicData.Direction; + set direction(v: graphicData.Direction); + get kilometerSystem(): KilometerSystem; + set kilometerSystem(v: KilometerSystem); + clone(): ISlopeKiloMarkerData; + copyFrom(data: ISlopeKiloMarkerData): void; + eq(other: ISlopeKiloMarkerData): boolean; +} + +export class SlopeKiloMarker extends JlGraphic { + static Type = 'SlopeKiloMarker'; + graphic: KilometerMarker; + + constructor() { + super(SlopeKiloMarker.Type); + this.graphic = new KilometerMarker(); + this.addChild(this.graphic); + } + get datas(): ISlopeKiloMarkerData { + return this.getDatas(); + } + doRepaint(): void { + this.graphic.paint(); + } +} + +export class SlopeKiloMarkerTemplate extends JlGraphicTemplate { + constructor(dataTemplate: ISlopeKiloMarkerData) { + super(SlopeKiloMarker.Type, { + dataTemplate, + }); + } + new(): SlopeKiloMarker { + const slopeKiloMarker = new SlopeKiloMarker(); + slopeKiloMarker.loadData(this.datas); + return slopeKiloMarker; + } +} diff --git a/src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant.ts b/src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant.ts new file mode 100644 index 0000000..a3e20ef --- /dev/null +++ b/src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant.ts @@ -0,0 +1,82 @@ +import { + GraphicApp, + GraphicDrawAssistant, + GraphicInteractionPlugin, + JlDrawApp, + JlGraphic, + linePoint, +} from 'src/jl-graphic'; +import { + ISlopeKiloMarkerData, + SlopeKiloMarker, + SlopeKiloMarkerTemplate, +} from './SlopeKiloMarker'; +import { FederatedMouseEvent, IHitArea, Point } from 'pixi.js'; + +export class KilometerMarkerHitArea implements IHitArea { + kiloMarker: SlopeKiloMarker; + constructor(kiloMarker: SlopeKiloMarker) { + this.kiloMarker = kiloMarker; + } + contains(x: number, y: number): boolean { + const { position } = this.kiloMarker.transform; + return linePoint( + this.kiloMarker.canvasToLocalPoint({ x: position.x, y: position.y - 50 }), + this.kiloMarker.canvasToLocalPoint({ x: position.x, y: position.y + 50 }), + { x, y }, + 2 + ); + } +} + +export class SlopeKiloMarkerDrawAssistant extends GraphicDrawAssistant< + SlopeKiloMarkerTemplate, + ISlopeKiloMarkerData +> { + slopeKiloMarker: SlopeKiloMarker; + + constructor(app: JlDrawApp, template: SlopeKiloMarkerTemplate) { + super(app, template, 'sym_o_golf_course', '坡度公里标'); + this.slopeKiloMarker = this.graphicTemplate.new(); + SlopeKiloMarkerInteractionPlugin.init(app); + } + + onLeftDown(e: FederatedMouseEvent): void { + this.container.position.copyFrom(this.toCanvasCoordinates(e.global)); + this.createAndStore(true); + } + + redraw(cp: Point): void { + this.slopeKiloMarker.position.copyFrom(cp); + } + prepareData(data: ISlopeKiloMarkerData): boolean { + data.transform = this.container.saveTransform(); + return true; + } +} + +export class SlopeKiloMarkerInteractionPlugin extends GraphicInteractionPlugin { + static Name = 'SlopeKiloMarkerInteraction'; + + constructor(app: GraphicApp) { + super(SlopeKiloMarkerInteractionPlugin.Name, app); + } + static init(app: GraphicApp) { + return new SlopeKiloMarkerInteractionPlugin(app); + } + filter(...grahpics: JlGraphic[]): SlopeKiloMarker[] | undefined { + return grahpics.filter( + (g): g is SlopeKiloMarker => g instanceof SlopeKiloMarker + ); + } + bind(g: SlopeKiloMarker): void { + g.graphic.eventMode = 'static'; + g.graphic.cursor = 'pointer'; + g.graphic.selectable = true; + g.graphic.draggable = false; + g.graphic.hitArea = new KilometerMarkerHitArea(g); + } + unbind(g: SlopeKiloMarker): void { + console.log(g); + } +} diff --git a/src/jl-graphic/app/JlGraphicApp.ts b/src/jl-graphic/app/JlGraphicApp.ts index 7dd0a46..804ad45 100644 --- a/src/jl-graphic/app/JlGraphicApp.ts +++ b/src/jl-graphic/app/JlGraphicApp.ts @@ -537,13 +537,18 @@ export class GraphicApp extends EventEmitter { state.code, state.graphicType ); - if (!g) { - const template = this.getGraphicTemplatesByType(state.graphicType); - const g = template.new(); - g.loadState(state); - this.addGraphics(g); - } else if (g.updateStates(state)) { - g.repaint(); + try { + if (!g) { + const template = this.getGraphicTemplatesByType(state.graphicType); + const g = template.new(); + g.loadState(state); + this.addGraphics(g); + } else if (g.updateStates(state)) { + g.repaint(); + } + } catch (err) { + console.error('图形状态处理异常', g, state, err); + // throw err; } }); } diff --git a/src/jl-graphic/message/BasicMessageClient.ts b/src/jl-graphic/message/BasicMessageClient.ts index 9d3690e..557c61b 100644 --- a/src/jl-graphic/message/BasicMessageClient.ts +++ b/src/jl-graphic/message/BasicMessageClient.ts @@ -127,8 +127,8 @@ export class SubscriptionClient { trySubscribe(): void { if (this.mc.connected) { - this.unsubscriptor = this.mc.subscribe(this.destination, () => { - this.handleMessage; + this.unsubscriptor = this.mc.subscribe(this.destination, (data) => { + this.handleMessage(data); }); } } diff --git a/src/jl-graphic/plugins/KeyboardPlugin.ts b/src/jl-graphic/plugins/KeyboardPlugin.ts index 31cd104..da562c1 100644 --- a/src/jl-graphic/plugins/KeyboardPlugin.ts +++ b/src/jl-graphic/plugins/KeyboardPlugin.ts @@ -84,7 +84,7 @@ export class JlGraphicAppKeyboardPlugin { // console.log('Mousedown Event', node.nodeName, node.nodeType, node.nodeValue) }; const keydownHandle = (e: KeyboardEvent) => { - console.debug(e.key, e.code, e.keyCode); + // console.debug(e.key, e.code, e.keyCode); if (target && target == this.app.dom.getElementsByTagName('canvas')[0]) { const listenerMap = this.getKeyListener(e); listenerMap?.forEach((listener) => { diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index 80411d6..c43b038 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -5,6 +5,10 @@ * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace graphicData { + export enum Direction { + LEFT = 0, + RIGHT = 1 + } export class RtssGraphicStorage extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -25,9 +29,12 @@ export namespace graphicData { esbButtons?: EsbButton[]; gateBoxs?: GatedBox[]; transponders?: Transponder[]; + slopes?: Slope[]; + CalculateLink?: CalculateLink[]; + slopeKiloMarker?: SlopeKiloMarker[]; }) { 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], this.#one_of_decls); + 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], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("canvas" in data && data.canvas != undefined) { this.canvas = data.canvas; @@ -80,6 +87,15 @@ export namespace graphicData { if ("transponders" in data && data.transponders != undefined) { this.transponders = data.transponders; } + if ("slopes" in data && data.slopes != undefined) { + this.slopes = data.slopes; + } + if ("CalculateLink" in data && data.CalculateLink != undefined) { + this.CalculateLink = data.CalculateLink; + } + if ("slopeKiloMarker" in data && data.slopeKiloMarker != undefined) { + this.slopeKiloMarker = data.slopeKiloMarker; + } } } get canvas() { @@ -187,6 +203,24 @@ export namespace graphicData { set transponders(value: Transponder[]) { pb_1.Message.setRepeatedWrapperField(this, 22, value); } + get slopes() { + return pb_1.Message.getRepeatedWrapperField(this, Slope, 23) as Slope[]; + } + set slopes(value: Slope[]) { + pb_1.Message.setRepeatedWrapperField(this, 23, value); + } + get CalculateLink() { + return pb_1.Message.getRepeatedWrapperField(this, CalculateLink, 24) as CalculateLink[]; + } + set CalculateLink(value: CalculateLink[]) { + pb_1.Message.setRepeatedWrapperField(this, 24, value); + } + get slopeKiloMarker() { + return pb_1.Message.getRepeatedWrapperField(this, SlopeKiloMarker, 25) as SlopeKiloMarker[]; + } + set slopeKiloMarker(value: SlopeKiloMarker[]) { + pb_1.Message.setRepeatedWrapperField(this, 25, value); + } static fromObject(data: { canvas?: ReturnType; Platforms?: ReturnType[]; @@ -205,6 +239,9 @@ export namespace graphicData { esbButtons?: ReturnType[]; gateBoxs?: ReturnType[]; transponders?: ReturnType[]; + slopes?: ReturnType[]; + CalculateLink?: ReturnType[]; + slopeKiloMarker?: ReturnType[]; }): RtssGraphicStorage { const message = new RtssGraphicStorage({}); if (data.canvas != null) { @@ -258,6 +295,15 @@ export namespace graphicData { if (data.transponders != null) { message.transponders = data.transponders.map(item => Transponder.fromObject(item)); } + if (data.slopes != null) { + message.slopes = data.slopes.map(item => Slope.fromObject(item)); + } + if (data.CalculateLink != null) { + message.CalculateLink = data.CalculateLink.map(item => CalculateLink.fromObject(item)); + } + if (data.slopeKiloMarker != null) { + message.slopeKiloMarker = data.slopeKiloMarker.map(item => SlopeKiloMarker.fromObject(item)); + } return message; } toObject() { @@ -279,6 +325,9 @@ export namespace graphicData { esbButtons?: ReturnType[]; gateBoxs?: ReturnType[]; transponders?: ReturnType[]; + slopes?: ReturnType[]; + CalculateLink?: ReturnType[]; + slopeKiloMarker?: ReturnType[]; } = {}; if (this.canvas != null) { data.canvas = this.canvas.toObject(); @@ -331,6 +380,15 @@ export namespace graphicData { if (this.transponders != null) { data.transponders = this.transponders.map((item: Transponder) => item.toObject()); } + if (this.slopes != null) { + data.slopes = this.slopes.map((item: Slope) => item.toObject()); + } + if (this.CalculateLink != null) { + data.CalculateLink = this.CalculateLink.map((item: CalculateLink) => item.toObject()); + } + if (this.slopeKiloMarker != null) { + data.slopeKiloMarker = this.slopeKiloMarker.map((item: SlopeKiloMarker) => item.toObject()); + } return data; } serialize(): Uint8Array; @@ -371,6 +429,12 @@ export namespace graphicData { writer.writeRepeatedMessage(21, this.gateBoxs, (item: GatedBox) => item.serialize(writer)); if (this.transponders.length) writer.writeRepeatedMessage(22, this.transponders, (item: Transponder) => item.serialize(writer)); + if (this.slopes.length) + writer.writeRepeatedMessage(23, this.slopes, (item: Slope) => item.serialize(writer)); + if (this.CalculateLink.length) + writer.writeRepeatedMessage(24, this.CalculateLink, (item: CalculateLink) => item.serialize(writer)); + if (this.slopeKiloMarker.length) + writer.writeRepeatedMessage(25, this.slopeKiloMarker, (item: SlopeKiloMarker) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -431,6 +495,15 @@ export namespace graphicData { case 22: reader.readMessage(message.transponders, () => pb_1.Message.addToRepeatedWrapperField(message, 22, Transponder.deserialize(reader), Transponder)); break; + case 23: + reader.readMessage(message.slopes, () => pb_1.Message.addToRepeatedWrapperField(message, 23, Slope.deserialize(reader), Slope)); + break; + case 24: + reader.readMessage(message.CalculateLink, () => pb_1.Message.addToRepeatedWrapperField(message, 24, CalculateLink.deserialize(reader), CalculateLink)); + break; + case 25: + reader.readMessage(message.slopeKiloMarker, () => pb_1.Message.addToRepeatedWrapperField(message, 25, SlopeKiloMarker.deserialize(reader), SlopeKiloMarker)); + break; default: reader.skipField(); } } @@ -1994,6 +2067,7 @@ export namespace graphicData { constructor(data?: any[] | { kilometer?: number; coordinateSystem?: string; + direction?: Direction; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -2004,6 +2078,9 @@ export namespace graphicData { if ("coordinateSystem" in data && data.coordinateSystem != undefined) { this.coordinateSystem = data.coordinateSystem; } + if ("direction" in data && data.direction != undefined) { + this.direction = data.direction; + } } } get kilometer() { @@ -2018,9 +2095,16 @@ export namespace graphicData { set coordinateSystem(value: string) { pb_1.Message.setField(this, 2, value); } + get direction() { + return pb_1.Message.getFieldWithDefault(this, 3, Direction.LEFT) as Direction; + } + set direction(value: Direction) { + pb_1.Message.setField(this, 3, value); + } static fromObject(data: { kilometer?: number; coordinateSystem?: string; + direction?: Direction; }): KilometerSystem { const message = new KilometerSystem({}); if (data.kilometer != null) { @@ -2029,12 +2113,16 @@ export namespace graphicData { if (data.coordinateSystem != null) { message.coordinateSystem = data.coordinateSystem; } + if (data.direction != null) { + message.direction = data.direction; + } return message; } toObject() { const data: { kilometer?: number; coordinateSystem?: string; + direction?: Direction; } = {}; if (this.kilometer != null) { data.kilometer = this.kilometer; @@ -2042,6 +2130,9 @@ export namespace graphicData { if (this.coordinateSystem != null) { data.coordinateSystem = this.coordinateSystem; } + if (this.direction != null) { + data.direction = this.direction; + } return data; } serialize(): Uint8Array; @@ -2052,6 +2143,8 @@ export namespace graphicData { writer.writeInt64(1, this.kilometer); if (this.coordinateSystem.length) writer.writeString(2, this.coordinateSystem); + if (this.direction != Direction.LEFT) + writer.writeEnum(3, this.direction); if (!w) return writer.getResultBuffer(); } @@ -2067,6 +2160,9 @@ export namespace graphicData { case 2: message.coordinateSystem = reader.readString(); break; + case 3: + message.direction = reader.readEnum(); + break; default: reader.skipField(); } } @@ -2087,6 +2183,7 @@ export namespace graphicData { mirror?: boolean; kilometerSystem?: KilometerSystem; index?: number; + refDev?: RelatedRef; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -2106,6 +2203,9 @@ export namespace graphicData { if ("index" in data && data.index != undefined) { this.index = data.index; } + if ("refDev" in data && data.refDev != undefined) { + this.refDev = data.refDev; + } } } get common() { @@ -2144,12 +2244,22 @@ export namespace graphicData { set index(value: number) { pb_1.Message.setField(this, 7, value); } + get refDev() { + return pb_1.Message.getWrapperField(this, RelatedRef, 8) as RelatedRef; + } + set refDev(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 8, value); + } + get has_refDev() { + return pb_1.Message.getField(this, 8) != null; + } static fromObject(data: { common?: ReturnType; code?: string; mirror?: boolean; kilometerSystem?: ReturnType; index?: number; + refDev?: ReturnType; }): Signal { const message = new Signal({}); if (data.common != null) { @@ -2167,6 +2277,9 @@ export namespace graphicData { if (data.index != null) { message.index = data.index; } + if (data.refDev != null) { + message.refDev = RelatedRef.fromObject(data.refDev); + } return message; } toObject() { @@ -2176,6 +2289,7 @@ export namespace graphicData { mirror?: boolean; kilometerSystem?: ReturnType; index?: number; + refDev?: ReturnType; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -2192,6 +2306,9 @@ export namespace graphicData { if (this.index != null) { data.index = this.index; } + if (this.refDev != null) { + data.refDev = this.refDev.toObject(); + } return data; } serialize(): Uint8Array; @@ -2208,6 +2325,8 @@ export namespace graphicData { writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); if (this.index != 0) writer.writeInt32(7, this.index); + if (this.has_refDev) + writer.writeMessage(8, this.refDev, () => this.refDev.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -2232,6 +2351,9 @@ export namespace graphicData { case 7: message.index = reader.readInt32(); break; + case 8: + reader.readMessage(message.refDev, () => message.refDev = RelatedRef.deserialize(reader)); + break; default: reader.skipField(); } } @@ -3755,6 +3877,7 @@ export namespace graphicData { coachNum?: StopPosition.CoachNum; index?: number; kilometerSystem?: KilometerSystem; + refDev?: RelatedRef; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -3777,6 +3900,9 @@ export namespace graphicData { if ("kilometerSystem" in data && data.kilometerSystem != undefined) { this.kilometerSystem = data.kilometerSystem; } + if ("refDev" in data && data.refDev != undefined) { + this.refDev = data.refDev; + } } } get common() { @@ -3821,6 +3947,15 @@ export namespace graphicData { get has_kilometerSystem() { return pb_1.Message.getField(this, 6) != null; } + get refDev() { + return pb_1.Message.getWrapperField(this, RelatedRef, 7) as RelatedRef; + } + set refDev(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 7, value); + } + get has_refDev() { + return pb_1.Message.getField(this, 7) != null; + } static fromObject(data: { common?: ReturnType; code?: string; @@ -3828,6 +3963,7 @@ export namespace graphicData { coachNum?: StopPosition.CoachNum; index?: number; kilometerSystem?: ReturnType; + refDev?: ReturnType; }): StopPosition { const message = new StopPosition({}); if (data.common != null) { @@ -3848,6 +3984,9 @@ export namespace graphicData { if (data.kilometerSystem != null) { message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); } + if (data.refDev != null) { + message.refDev = RelatedRef.fromObject(data.refDev); + } return message; } toObject() { @@ -3858,6 +3997,7 @@ export namespace graphicData { coachNum?: StopPosition.CoachNum; index?: number; kilometerSystem?: ReturnType; + refDev?: ReturnType; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -3877,6 +4017,9 @@ export namespace graphicData { if (this.kilometerSystem != null) { data.kilometerSystem = this.kilometerSystem.toObject(); } + if (this.refDev != null) { + data.refDev = this.refDev.toObject(); + } return data; } serialize(): Uint8Array; @@ -3895,6 +4038,8 @@ export namespace graphicData { writer.writeInt32(5, this.index); if (this.has_kilometerSystem) writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); + if (this.has_refDev) + writer.writeMessage(7, this.refDev, () => this.refDev.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -3922,6 +4067,9 @@ export namespace graphicData { case 6: reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); break; + case 7: + reader.readMessage(message.refDev, () => message.refDev = RelatedRef.deserialize(reader)); + break; default: reader.skipField(); } } @@ -4426,4 +4574,733 @@ export namespace graphicData { return GatedBox.deserialize(bytes); } } + export class SlopeKiloMarker extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common?: CommonInfo; + code?: string; + kilometerSystem?: KilometerSystem; + }) { + 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 ("kilometerSystem" in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; + } + } + } + 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 kilometerSystem() { + return pb_1.Message.getWrapperField(this, KilometerSystem, 4) as KilometerSystem; + } + set kilometerSystem(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_kilometerSystem() { + return pb_1.Message.getField(this, 4) != null; + } + static fromObject(data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + }): SlopeKiloMarker { + const message = new SlopeKiloMarker({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.kilometerSystem != null) { + message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.kilometerSystem != null) { + data.kilometerSystem = this.kilometerSystem.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.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.has_kilometerSystem) + writer.writeMessage(4, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SlopeKiloMarker { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SlopeKiloMarker(); + 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 4: + reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SlopeKiloMarker { + return SlopeKiloMarker.deserialize(bytes); + } + } + export class turningRadiusKiloMarker extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common?: CommonInfo; + code?: string; + kilometerSystem?: KilometerSystem; + }) { + 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 ("kilometerSystem" in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; + } + } + } + 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 kilometerSystem() { + return pb_1.Message.getWrapperField(this, KilometerSystem, 4) as KilometerSystem; + } + set kilometerSystem(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_kilometerSystem() { + return pb_1.Message.getField(this, 4) != null; + } + static fromObject(data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + }): turningRadiusKiloMarker { + const message = new turningRadiusKiloMarker({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.kilometerSystem != null) { + message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.kilometerSystem != null) { + data.kilometerSystem = this.kilometerSystem.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.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.has_kilometerSystem) + writer.writeMessage(4, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): turningRadiusKiloMarker { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new turningRadiusKiloMarker(); + 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 4: + reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): turningRadiusKiloMarker { + return turningRadiusKiloMarker.deserialize(bytes); + } + } + export class Slope extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common?: CommonInfo; + code?: string; + points?: Point[]; + slopeNumber?: string; + slopeDirection?: string; + slopeLong?: number; + refDeviceId?: string[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 7], 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 ("points" in data && data.points != undefined) { + this.points = data.points; + } + if ("slopeNumber" in data && data.slopeNumber != undefined) { + this.slopeNumber = data.slopeNumber; + } + if ("slopeDirection" in data && data.slopeDirection != undefined) { + this.slopeDirection = data.slopeDirection; + } + if ("slopeLong" in data && data.slopeLong != undefined) { + this.slopeLong = data.slopeLong; + } + if ("refDeviceId" in data && data.refDeviceId != undefined) { + this.refDeviceId = data.refDeviceId; + } + } + } + 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 points() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; + } + set points(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + get slopeNumber() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set slopeNumber(value: string) { + pb_1.Message.setField(this, 4, value); + } + get slopeDirection() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set slopeDirection(value: string) { + pb_1.Message.setField(this, 5, value); + } + get slopeLong() { + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; + } + set slopeLong(value: number) { + pb_1.Message.setField(this, 6, value); + } + get refDeviceId() { + return pb_1.Message.getFieldWithDefault(this, 7, []) as string[]; + } + set refDeviceId(value: string[]) { + pb_1.Message.setField(this, 7, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + slopeNumber?: string; + slopeDirection?: string; + slopeLong?: number; + refDeviceId?: string[]; + }): Slope { + const message = new Slope({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.points != null) { + message.points = data.points.map(item => Point.fromObject(item)); + } + if (data.slopeNumber != null) { + message.slopeNumber = data.slopeNumber; + } + if (data.slopeDirection != null) { + message.slopeDirection = data.slopeDirection; + } + if (data.slopeLong != null) { + message.slopeLong = data.slopeLong; + } + if (data.refDeviceId != null) { + message.refDeviceId = data.refDeviceId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + slopeNumber?: string; + slopeDirection?: string; + slopeLong?: number; + refDeviceId?: string[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + if (this.slopeNumber != null) { + data.slopeNumber = this.slopeNumber; + } + if (this.slopeDirection != null) { + data.slopeDirection = this.slopeDirection; + } + if (this.slopeLong != null) { + data.slopeLong = this.slopeLong; + } + if (this.refDeviceId != null) { + data.refDeviceId = this.refDeviceId; + } + 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.points.length) + writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer)); + if (this.slopeNumber.length) + writer.writeString(4, this.slopeNumber); + if (this.slopeDirection.length) + writer.writeString(5, this.slopeDirection); + if (this.slopeLong != 0) + writer.writeInt64(6, this.slopeLong); + if (this.refDeviceId.length) + writer.writeRepeatedString(7, this.refDeviceId); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Slope { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Slope(); + 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: + reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point)); + break; + case 4: + message.slopeNumber = reader.readString(); + break; + case 5: + message.slopeDirection = reader.readString(); + break; + case 6: + message.slopeLong = reader.readInt64(); + break; + case 7: + pb_1.Message.addToRepeatedField(message, 7, reader.readString()); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Slope { + return Slope.deserialize(bytes); + } + } + export class CalculateLink extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common?: CommonInfo; + points?: Point[]; + length?: number; + aRelatedRef?: RelatedRef; + bRelatedRef?: RelatedRef; + devicePositions?: CalculateLink.DevicePosition[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 6], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("points" in data && data.points != undefined) { + this.points = data.points; + } + if ("length" in data && data.length != undefined) { + this.length = data.length; + } + if ("aRelatedRef" in data && data.aRelatedRef != undefined) { + this.aRelatedRef = data.aRelatedRef; + } + if ("bRelatedRef" in data && data.bRelatedRef != undefined) { + this.bRelatedRef = data.bRelatedRef; + } + if ("devicePositions" in data && data.devicePositions != undefined) { + this.devicePositions = data.devicePositions; + } + } + } + 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 points() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 2) as Point[]; + } + set points(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get length() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set length(value: number) { + pb_1.Message.setField(this, 3, value); + } + get aRelatedRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 4) as RelatedRef; + } + set aRelatedRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_aRelatedRef() { + return pb_1.Message.getField(this, 4) != null; + } + get bRelatedRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 5) as RelatedRef; + } + set bRelatedRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_bRelatedRef() { + return pb_1.Message.getField(this, 5) != null; + } + get devicePositions() { + return pb_1.Message.getRepeatedWrapperField(this, CalculateLink.DevicePosition, 6) as CalculateLink.DevicePosition[]; + } + set devicePositions(value: CalculateLink.DevicePosition[]) { + pb_1.Message.setRepeatedWrapperField(this, 6, value); + } + static fromObject(data: { + common?: ReturnType; + points?: ReturnType[]; + length?: number; + aRelatedRef?: ReturnType; + bRelatedRef?: ReturnType; + devicePositions?: ReturnType[]; + }): CalculateLink { + const message = new CalculateLink({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.points != null) { + message.points = data.points.map(item => Point.fromObject(item)); + } + if (data.length != null) { + message.length = data.length; + } + if (data.aRelatedRef != null) { + message.aRelatedRef = RelatedRef.fromObject(data.aRelatedRef); + } + if (data.bRelatedRef != null) { + message.bRelatedRef = RelatedRef.fromObject(data.bRelatedRef); + } + if (data.devicePositions != null) { + message.devicePositions = data.devicePositions.map(item => CalculateLink.DevicePosition.fromObject(item)); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + points?: ReturnType[]; + length?: number; + aRelatedRef?: ReturnType; + bRelatedRef?: ReturnType; + devicePositions?: ReturnType[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + if (this.length != null) { + data.length = this.length; + } + if (this.aRelatedRef != null) { + data.aRelatedRef = this.aRelatedRef.toObject(); + } + if (this.bRelatedRef != null) { + data.bRelatedRef = this.bRelatedRef.toObject(); + } + if (this.devicePositions != null) { + data.devicePositions = this.devicePositions.map((item: CalculateLink.DevicePosition) => 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.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.points.length) + writer.writeRepeatedMessage(2, this.points, (item: Point) => item.serialize(writer)); + if (this.length != 0) + writer.writeInt32(3, this.length); + if (this.has_aRelatedRef) + writer.writeMessage(4, this.aRelatedRef, () => this.aRelatedRef.serialize(writer)); + if (this.has_bRelatedRef) + writer.writeMessage(5, this.bRelatedRef, () => this.bRelatedRef.serialize(writer)); + if (this.devicePositions.length) + writer.writeRepeatedMessage(6, this.devicePositions, (item: CalculateLink.DevicePosition) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CalculateLink { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CalculateLink(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Point.deserialize(reader), Point)); + break; + case 3: + message.length = reader.readInt32(); + break; + case 4: + reader.readMessage(message.aRelatedRef, () => message.aRelatedRef = RelatedRef.deserialize(reader)); + break; + case 5: + reader.readMessage(message.bRelatedRef, () => message.bRelatedRef = RelatedRef.deserialize(reader)); + break; + case 6: + reader.readMessage(message.devicePositions, () => pb_1.Message.addToRepeatedWrapperField(message, 6, CalculateLink.DevicePosition.deserialize(reader), CalculateLink.DevicePosition)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CalculateLink { + return CalculateLink.deserialize(bytes); + } + } + export namespace CalculateLink { + export class DevicePosition extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + offset?: number; + deviceId?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("offset" in data && data.offset != undefined) { + this.offset = data.offset; + } + if ("deviceId" in data && data.deviceId != undefined) { + this.deviceId = data.deviceId; + } + } + } + get offset() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set offset(value: number) { + pb_1.Message.setField(this, 1, value); + } + get deviceId() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set deviceId(value: string) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + offset?: number; + deviceId?: string; + }): DevicePosition { + const message = new DevicePosition({}); + if (data.offset != null) { + message.offset = data.offset; + } + if (data.deviceId != null) { + message.deviceId = data.deviceId; + } + return message; + } + toObject() { + const data: { + offset?: number; + deviceId?: string; + } = {}; + if (this.offset != null) { + data.offset = this.offset; + } + if (this.deviceId != null) { + data.deviceId = this.deviceId; + } + 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.offset != 0) + writer.writeInt32(1, this.offset); + if (this.deviceId.length) + writer.writeString(2, this.deviceId); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DevicePosition { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DevicePosition(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.offset = reader.readInt32(); + break; + case 2: + message.deviceId = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DevicePosition { + return DevicePosition.deserialize(bytes); + } + } + } }