From 306f3abf97cb993ddfb865cff54ee3a1cbfef578 Mon Sep 17 00:00:00 2001 From: Yuan Date: Mon, 7 Aug 2023 16:21:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B2=E5=BA=A6=E5=85=AC=E9=87=8C=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bj-rtss-message | 2 +- src/components/draw-app/DrawProperties.vue | 11 +- .../CurvatureKiloMarkerProperty.vue | 134 ++++++++++++++++++ ...operty.vue => SlopeKiloMarkerProperty.vue} | 0 .../CurvatureKiloMarkerInteraction.ts | 52 +++++++ .../graphics/SlopeKiloMarkerInteraction.ts | 8 +- src/drawApp/index.ts | 20 +++ .../CurvatureKiloMarker.ts | 50 +++++++ .../CurvatureKiloMarkerDrawAssistant.ts | 102 +++++++++++++ .../kilometerMarker/KilometerMarker.ts | 16 +++ .../slopeKiloMarker/SlopeKiloMarker.ts | 29 ++-- .../SlopeKiloMarkerDrawAssistant.ts | 11 +- src/protos/stationLayoutGraphics.ts | 62 ++++++-- 13 files changed, 454 insertions(+), 43 deletions(-) create mode 100644 src/components/draw-app/properties/CurvatureKiloMarkerProperty.vue rename src/components/draw-app/properties/{KiloMarkerProperty.vue => SlopeKiloMarkerProperty.vue} (100%) create mode 100644 src/drawApp/graphics/CurvatureKiloMarkerInteraction.ts create mode 100644 src/graphics/curvatureKiloMarker/CurvatureKiloMarker.ts create mode 100644 src/graphics/curvatureKiloMarker/CurvatureKiloMarkerDrawAssistant.ts diff --git a/bj-rtss-message b/bj-rtss-message index 76917f9..c592e91 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 76917f9e01f4044559ac9c73aada199027da1db4 +Subproject commit c592e915a2a94767e60fba01e08fc4be570b35fb diff --git a/src/components/draw-app/DrawProperties.vue b/src/components/draw-app/DrawProperties.vue index 570548a..0bfa597 100644 --- a/src/components/draw-app/DrawProperties.vue +++ b/src/components/draw-app/DrawProperties.vue @@ -96,9 +96,14 @@ - + @@ -149,10 +154,12 @@ 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 SlopeKiloMarkerProperty from './properties/SlopeKiloMarkerProperty.vue'; +import CurvatureKiloMarkerProperty from './properties/CurvatureKiloMarkerProperty.vue'; import { SlopeKiloMarker } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; import { Slope } from 'src/graphics/slope/Slope'; import SlopeProperty from './properties/SlopeProperty.vue'; +import { CurvatureKiloMarker } from 'src/graphics/curvatureKiloMarker/CurvatureKiloMarker'; const drawStore = useDrawStore(); diff --git a/src/components/draw-app/properties/CurvatureKiloMarkerProperty.vue b/src/components/draw-app/properties/CurvatureKiloMarkerProperty.vue new file mode 100644 index 0000000..e0c038d --- /dev/null +++ b/src/components/draw-app/properties/CurvatureKiloMarkerProperty.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/components/draw-app/properties/KiloMarkerProperty.vue b/src/components/draw-app/properties/SlopeKiloMarkerProperty.vue similarity index 100% rename from src/components/draw-app/properties/KiloMarkerProperty.vue rename to src/components/draw-app/properties/SlopeKiloMarkerProperty.vue diff --git a/src/drawApp/graphics/CurvatureKiloMarkerInteraction.ts b/src/drawApp/graphics/CurvatureKiloMarkerInteraction.ts new file mode 100644 index 0000000..12f43db --- /dev/null +++ b/src/drawApp/graphics/CurvatureKiloMarkerInteraction.ts @@ -0,0 +1,52 @@ +import * as pb_1 from 'google-protobuf'; +import { GraphicDataBase } from './GraphicDataBase'; +import { graphicData } from 'src/protos/stationLayoutGraphics'; +import { KilometerSystem } from 'src/graphics/signal/Signal'; +import { IKiloMarkerData } from 'src/graphics/kilometerMarker/KilometerMarker'; +import { CurvatureKiloMarker } from 'src/graphics/curvatureKiloMarker/CurvatureKiloMarker'; + +export class CurvatureKiloMarkerData + extends GraphicDataBase + implements IKiloMarkerData +{ + constructor(data?: graphicData.CurvatureKiloMarker) { + let platform; + if (!data) { + platform = new graphicData.CurvatureKiloMarker({ + common: GraphicDataBase.defaultCommonInfo(CurvatureKiloMarker.Type), + }); + } else { + platform = data; + } + super(platform); + } + + public get data(): graphicData.CurvatureKiloMarker { + return this.getData(); + } + + get code(): string { + return this.data.code; + } + set code(v: string) { + this.data.code = v; + } + get kilometerSystem(): KilometerSystem[] { + return this.data.kilometerSystem; + } + set kilometerSystem(value: KilometerSystem[]) { + this.data.kilometerSystem = value.map( + (v) => new graphicData.KilometerSystem(v) + ); + } + + clone(): CurvatureKiloMarkerData { + return new CurvatureKiloMarkerData(this.data.cloneMessage()); + } + copyFrom(data: CurvatureKiloMarkerData): void { + pb_1.Message.copyInto(data.data, this.data); + } + eq(other: CurvatureKiloMarkerData): boolean { + return pb_1.Message.equals(this.data, other.data); + } +} diff --git a/src/drawApp/graphics/SlopeKiloMarkerInteraction.ts b/src/drawApp/graphics/SlopeKiloMarkerInteraction.ts index 0ea33e4..76f0aca 100644 --- a/src/drawApp/graphics/SlopeKiloMarkerInteraction.ts +++ b/src/drawApp/graphics/SlopeKiloMarkerInteraction.ts @@ -1,15 +1,13 @@ import * as pb_1 from 'google-protobuf'; -import { - ISlopeKiloMarkerData, - SlopeKiloMarker, -} from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; +import { SlopeKiloMarker } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; import { GraphicDataBase } from './GraphicDataBase'; import { graphicData } from 'src/protos/stationLayoutGraphics'; import { KilometerSystem } from 'src/graphics/signal/Signal'; +import { IKiloMarkerData } from 'src/graphics/kilometerMarker/KilometerMarker'; export class SlopeKiloMarkerData extends GraphicDataBase - implements ISlopeKiloMarkerData + implements IKiloMarkerData { constructor(data?: graphicData.SlopeKiloMarker) { let platform; diff --git a/src/drawApp/index.ts b/src/drawApp/index.ts index 20871a1..72376ca 100644 --- a/src/drawApp/index.ts +++ b/src/drawApp/index.ts @@ -121,6 +121,12 @@ import { SlopeDraw } from 'src/graphics/slope/SlopeAssistant'; import { SlopeData } from './graphics/SlopeInteraction'; import { Slope, SlopeTemplate } from 'src/graphics/slope/Slope'; import { useLineStore } from 'src/stores/line-store'; +import { + CurvatureKiloMarker, + CurvatureKiloMarkerTemplate, +} from 'src/graphics/curvatureKiloMarker/CurvatureKiloMarker'; +import { CurvatureKiloMarkerDrawAssistant } from 'src/graphics/curvatureKiloMarker/CurvatureKiloMarkerDrawAssistant'; +import { CurvatureKiloMarkerData } from './graphics/CurvatureKiloMarkerInteraction'; // export function fromStoragePoint(p: graphicData.Point): Point { // return new Point(p.x, p.y); @@ -210,6 +216,7 @@ const showType = [ TrainWindow.Type, SlopeKiloMarker.Type, Slope.Type, + CurvatureKiloMarker.Type, ]; export const drawLayerList = [ // 图层列表 @@ -257,6 +264,7 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { | TransponderDraw | SlopeKiloMarkerDrawAssistant | SlopeDraw + | CurvatureKiloMarkerDrawAssistant )[] = []; if (draftType === 'Line') { drawAssistants = [ @@ -307,6 +315,10 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { new SlopeKiloMarkerTemplate(new SlopeKiloMarkerData()) ), new SlopeDraw(app, new SlopeTemplate(new SlopeData())), + new CurvatureKiloMarkerDrawAssistant( + app, + new CurvatureKiloMarkerTemplate(new CurvatureKiloMarkerData()) + ), ]; DrawSignalInteraction.init(app); DrawStopPositionInteraction.init(app); @@ -475,6 +487,11 @@ export function saveDrawDatas(app: JlDrawApp) { } else if (Slope.Type === g.type) { const slopeData = (g as Slope).saveData(); storage.slopes.push((slopeData as SlopeData).data); + } else if (CurvatureKiloMarker.Type === g.type) { + const curvatureKiloMarkerData = (g as CurvatureKiloMarker).saveData(); + storage.curvatureKiloMarker.push( + (curvatureKiloMarkerData as CurvatureKiloMarkerData).data + ); } }); const base64 = fromUint8Array(storage.serialize()); @@ -561,6 +578,9 @@ export async function loadDrawDatas(app: GraphicApp) { storage.slopeKiloMarker.forEach((slopeKiloMarker) => { datas.push(new SlopeKiloMarkerData(slopeKiloMarker)); }); + storage.curvatureKiloMarker.forEach((curvatureKiloMarker) => { + datas.push(new CurvatureKiloMarkerData(curvatureKiloMarker)); + }); storage.slopes.forEach((slope) => { datas.push(new SlopeData(slope)); }); diff --git a/src/graphics/curvatureKiloMarker/CurvatureKiloMarker.ts b/src/graphics/curvatureKiloMarker/CurvatureKiloMarker.ts new file mode 100644 index 0000000..3835f84 --- /dev/null +++ b/src/graphics/curvatureKiloMarker/CurvatureKiloMarker.ts @@ -0,0 +1,50 @@ +import { JlGraphic, JlGraphicTemplate } from 'src/jl-graphic'; +import { + IKiloMarkerData, + KiloMarkerConsts, + KilometerMarker, +} from '../kilometerMarker/KilometerMarker'; + +export class CurvatureKiloMarker extends JlGraphic { + static Type = 'CurvatureKiloMarker'; + graphic: KilometerMarker; + size = KiloMarkerConsts.size; + + constructor() { + super(CurvatureKiloMarker.Type); + this.graphic = new KilometerMarker(); + this.addChild(this.graphic); + } + get datas(): IKiloMarkerData { + return this.getDatas(); + } + doRepaint(): void { + this.graphic.paint(); + } + + getPoint(position: 'up' | 'down' | 'mid') { + const p = this.transform.position.clone(); + if (position === 'up') { + p.y -= this.size; + return p; + } else if (position === 'down') { + p.y += this.size; + return p; + } else if (position === 'mid') { + return p; + } + } +} + +export class CurvatureKiloMarkerTemplate extends JlGraphicTemplate { + constructor(dataTemplate: IKiloMarkerData) { + super(CurvatureKiloMarker.Type, { + dataTemplate, + }); + } + new(): CurvatureKiloMarker { + const curvatureKiloMarker = new CurvatureKiloMarker(); + curvatureKiloMarker.loadData(this.datas); + return curvatureKiloMarker; + } +} diff --git a/src/graphics/curvatureKiloMarker/CurvatureKiloMarkerDrawAssistant.ts b/src/graphics/curvatureKiloMarker/CurvatureKiloMarkerDrawAssistant.ts new file mode 100644 index 0000000..79416f4 --- /dev/null +++ b/src/graphics/curvatureKiloMarker/CurvatureKiloMarkerDrawAssistant.ts @@ -0,0 +1,102 @@ +import { + GraphicApp, + GraphicDrawAssistant, + GraphicInteractionPlugin, + JlDrawApp, + JlGraphic, + linePoint, +} from 'src/jl-graphic'; +import { FederatedMouseEvent, IHitArea, Point } from 'pixi.js'; +import { IKiloMarkerData } from '../kilometerMarker/KilometerMarker'; +import { + CurvatureKiloMarker, + CurvatureKiloMarkerTemplate, +} from './CurvatureKiloMarker'; + +export class KilometerMarkerHitArea implements IHitArea { + kiloMarker: CurvatureKiloMarker; + constructor(kiloMarker: CurvatureKiloMarker) { + 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 CurvatureKiloMarkerDrawAssistant extends GraphicDrawAssistant< + CurvatureKiloMarkerTemplate, + IKiloMarkerData +> { + curvatureKiloMarker: CurvatureKiloMarker; + + constructor(app: JlDrawApp, template: CurvatureKiloMarkerTemplate) { + super(app, template, 'sym_o_golf_course', '曲度公里标'); + this.curvatureKiloMarker = this.graphicTemplate.new(); + this.container.addChild(this.curvatureKiloMarker); + CurvatureKiloMarkerInteractionPlugin.init(app); + } + + onLeftDown(e: FederatedMouseEvent): void { + this.createAndStore(true); + } + + redraw(cp: Point): void { + const list = this.app.queryStore.queryByType( + CurvatureKiloMarker.Type + ); + const ys = list.reduce((prev, curr, i) => { + const currentY = curr.datas.transform.position.y; + if (!prev.includes(currentY)) { + return [currentY, ...prev]; + } else { + return prev; + } + }, []); + if (list.length) { + const matchY = ys.find( + (y) => Math.abs(cp.y - y) <= this.curvatureKiloMarker.size + ); + if (matchY) { + this.container.position.set(cp.x, matchY); + return; + } + } + this.container.position.set(cp.x, cp.y); + } + prepareData(data: IKiloMarkerData): boolean { + data.transform = this.container.saveTransform(); + return true; + } +} + +export class CurvatureKiloMarkerInteractionPlugin extends GraphicInteractionPlugin { + static Name = 'CurvatureKiloMarkerInteraction'; + + constructor(app: GraphicApp) { + super(CurvatureKiloMarkerInteractionPlugin.Name, app); + } + static init(app: GraphicApp) { + return new CurvatureKiloMarkerInteractionPlugin(app); + } + filter(...grahpics: JlGraphic[]): CurvatureKiloMarker[] | undefined { + return grahpics.filter( + (g): g is CurvatureKiloMarker => g instanceof CurvatureKiloMarker + ); + } + bind(g: CurvatureKiloMarker): 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: CurvatureKiloMarker): void { + console.log(g); + } +} diff --git a/src/graphics/kilometerMarker/KilometerMarker.ts b/src/graphics/kilometerMarker/KilometerMarker.ts index 8693ac1..7475229 100644 --- a/src/graphics/kilometerMarker/KilometerMarker.ts +++ b/src/graphics/kilometerMarker/KilometerMarker.ts @@ -1,4 +1,20 @@ import { Graphics } from 'pixi.js'; +import { KilometerSystem } from '../signal/Signal'; +import { GraphicData } from 'src/jl-graphic'; + +export const KiloMarkerConsts = { + size: 50, +}; + +export interface IKiloMarkerData extends GraphicData { + get code(): string; // 编号 + set code(v: string); + get kilometerSystem(): KilometerSystem[]; + set kilometerSystem(v: KilometerSystem[]); + clone(): IKiloMarkerData; + copyFrom(data: IKiloMarkerData): void; + eq(other: IKiloMarkerData): boolean; +} export class KilometerMarker extends Graphics { constructor() { diff --git a/src/graphics/slopeKiloMarker/SlopeKiloMarker.ts b/src/graphics/slopeKiloMarker/SlopeKiloMarker.ts index 60ad388..3aa5e86 100644 --- a/src/graphics/slopeKiloMarker/SlopeKiloMarker.ts +++ b/src/graphics/slopeKiloMarker/SlopeKiloMarker.ts @@ -1,20 +1,9 @@ -import { GraphicData, JlGraphic, JlGraphicTemplate } from 'src/jl-graphic'; -import { KilometerMarker } from '../kilometerMarker/KilometerMarker'; -import { KilometerSystem } from '../signal/Signal'; - -export const KiloMarkerConsts = { - size: 50, -}; - -export interface ISlopeKiloMarkerData extends GraphicData { - get code(): string; // 编号 - set code(v: string); - get kilometerSystem(): KilometerSystem[]; - set kilometerSystem(v: KilometerSystem[]); - clone(): ISlopeKiloMarkerData; - copyFrom(data: ISlopeKiloMarkerData): void; - eq(other: ISlopeKiloMarkerData): boolean; -} +import { JlGraphic, JlGraphicTemplate } from 'src/jl-graphic'; +import { + IKiloMarkerData, + KiloMarkerConsts, + KilometerMarker, +} from '../kilometerMarker/KilometerMarker'; export class SlopeKiloMarker extends JlGraphic { static Type = 'SlopeKiloMarker'; @@ -26,8 +15,8 @@ export class SlopeKiloMarker extends JlGraphic { this.graphic = new KilometerMarker(); this.addChild(this.graphic); } - get datas(): ISlopeKiloMarkerData { - return this.getDatas(); + get datas(): IKiloMarkerData { + return this.getDatas(); } doRepaint(): void { this.graphic.paint(); @@ -48,7 +37,7 @@ export class SlopeKiloMarker extends JlGraphic { } export class SlopeKiloMarkerTemplate extends JlGraphicTemplate { - constructor(dataTemplate: ISlopeKiloMarkerData) { + constructor(dataTemplate: IKiloMarkerData) { super(SlopeKiloMarker.Type, { dataTemplate, }); diff --git a/src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant.ts b/src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant.ts index d007a49..d66c192 100644 --- a/src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant.ts +++ b/src/graphics/slopeKiloMarker/SlopeKiloMarkerDrawAssistant.ts @@ -6,12 +6,9 @@ import { JlGraphic, linePoint, } from 'src/jl-graphic'; -import { - ISlopeKiloMarkerData, - SlopeKiloMarker, - SlopeKiloMarkerTemplate, -} from './SlopeKiloMarker'; +import { SlopeKiloMarker, SlopeKiloMarkerTemplate } from './SlopeKiloMarker'; import { FederatedMouseEvent, IHitArea, Point } from 'pixi.js'; +import { IKiloMarkerData } from '../kilometerMarker/KilometerMarker'; export class KilometerMarkerHitArea implements IHitArea { kiloMarker: SlopeKiloMarker; @@ -31,7 +28,7 @@ export class KilometerMarkerHitArea implements IHitArea { export class SlopeKiloMarkerDrawAssistant extends GraphicDrawAssistant< SlopeKiloMarkerTemplate, - ISlopeKiloMarkerData + IKiloMarkerData > { slopeKiloMarker: SlopeKiloMarker; @@ -69,7 +66,7 @@ export class SlopeKiloMarkerDrawAssistant extends GraphicDrawAssistant< } this.container.position.set(cp.x, cp.y); } - prepareData(data: ISlopeKiloMarkerData): boolean { + prepareData(data: IKiloMarkerData): boolean { data.transform = this.container.saveTransform(); return true; } diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index c78ab15..4c5e906 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -32,9 +32,10 @@ export namespace graphicData { slopes?: Slope[]; CalculateLink?: CalculateLink[]; slopeKiloMarker?: SlopeKiloMarker[]; + curvatureKiloMarker?: CurvatureKiloMarker[]; }) { 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], 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, 26], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("canvas" in data && data.canvas != undefined) { this.canvas = data.canvas; @@ -96,6 +97,9 @@ export namespace graphicData { if ("slopeKiloMarker" in data && data.slopeKiloMarker != undefined) { this.slopeKiloMarker = data.slopeKiloMarker; } + if ("curvatureKiloMarker" in data && data.curvatureKiloMarker != undefined) { + this.curvatureKiloMarker = data.curvatureKiloMarker; + } } } get canvas() { @@ -221,6 +225,12 @@ export namespace graphicData { set slopeKiloMarker(value: SlopeKiloMarker[]) { pb_1.Message.setRepeatedWrapperField(this, 25, value); } + get curvatureKiloMarker() { + return pb_1.Message.getRepeatedWrapperField(this, CurvatureKiloMarker, 26) as CurvatureKiloMarker[]; + } + set curvatureKiloMarker(value: CurvatureKiloMarker[]) { + pb_1.Message.setRepeatedWrapperField(this, 26, value); + } static fromObject(data: { canvas?: ReturnType; Platforms?: ReturnType[]; @@ -242,6 +252,7 @@ export namespace graphicData { slopes?: ReturnType[]; CalculateLink?: ReturnType[]; slopeKiloMarker?: ReturnType[]; + curvatureKiloMarker?: ReturnType[]; }): RtssGraphicStorage { const message = new RtssGraphicStorage({}); if (data.canvas != null) { @@ -304,6 +315,9 @@ export namespace graphicData { if (data.slopeKiloMarker != null) { message.slopeKiloMarker = data.slopeKiloMarker.map(item => SlopeKiloMarker.fromObject(item)); } + if (data.curvatureKiloMarker != null) { + message.curvatureKiloMarker = data.curvatureKiloMarker.map(item => CurvatureKiloMarker.fromObject(item)); + } return message; } toObject() { @@ -328,6 +342,7 @@ export namespace graphicData { slopes?: ReturnType[]; CalculateLink?: ReturnType[]; slopeKiloMarker?: ReturnType[]; + curvatureKiloMarker?: ReturnType[]; } = {}; if (this.canvas != null) { data.canvas = this.canvas.toObject(); @@ -389,6 +404,9 @@ export namespace graphicData { if (this.slopeKiloMarker != null) { data.slopeKiloMarker = this.slopeKiloMarker.map((item: SlopeKiloMarker) => item.toObject()); } + if (this.curvatureKiloMarker != null) { + data.curvatureKiloMarker = this.curvatureKiloMarker.map((item: CurvatureKiloMarker) => item.toObject()); + } return data; } serialize(): Uint8Array; @@ -435,6 +453,8 @@ export namespace graphicData { 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 (this.curvatureKiloMarker.length) + writer.writeRepeatedMessage(26, this.curvatureKiloMarker, (item: CurvatureKiloMarker) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -504,6 +524,9 @@ export namespace graphicData { case 25: reader.readMessage(message.slopeKiloMarker, () => pb_1.Message.addToRepeatedWrapperField(message, 25, SlopeKiloMarker.deserialize(reader), SlopeKiloMarker)); break; + case 26: + reader.readMessage(message.curvatureKiloMarker, () => pb_1.Message.addToRepeatedWrapperField(message, 26, CurvatureKiloMarker.deserialize(reader), CurvatureKiloMarker)); + break; default: reader.skipField(); } } @@ -4716,7 +4739,7 @@ export namespace graphicData { return SlopeKiloMarker.deserialize(bytes); } } - export class TurningRadiusKiloMarker extends pb_1.Message { + export class CurvatureKiloMarker extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { common?: CommonInfo; @@ -4762,8 +4785,8 @@ export namespace graphicData { common?: ReturnType; code?: string; kilometerSystem?: ReturnType[]; - }): TurningRadiusKiloMarker { - const message = new TurningRadiusKiloMarker({}); + }): CurvatureKiloMarker { + const message = new CurvatureKiloMarker({}); if (data.common != null) { message.common = CommonInfo.fromObject(data.common); } @@ -4805,8 +4828,8 @@ export namespace graphicData { 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(); + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CurvatureKiloMarker { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CurvatureKiloMarker(); while (reader.nextField()) { if (reader.isEndGroup()) break; @@ -4828,8 +4851,8 @@ export namespace graphicData { serializeBinary(): Uint8Array { return this.serialize(); } - static deserializeBinary(bytes: Uint8Array): TurningRadiusKiloMarker { - return TurningRadiusKiloMarker.deserialize(bytes); + static deserializeBinary(bytes: Uint8Array): CurvatureKiloMarker { + return CurvatureKiloMarker.deserialize(bytes); } } export class Slope extends pb_1.Message { @@ -4980,6 +5003,7 @@ export namespace graphicData { aRelatedRef?: RelatedRef; bRelatedRef?: RelatedRef; devicePositions?: CalculateLink.DevicePosition[]; + index?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 6], this.#one_of_decls); @@ -5002,6 +5026,9 @@ export namespace graphicData { if ("devicePositions" in data && data.devicePositions != undefined) { this.devicePositions = data.devicePositions; } + if ("index" in data && data.index != undefined) { + this.index = data.index; + } } } get common() { @@ -5049,6 +5076,12 @@ export namespace graphicData { set devicePositions(value: CalculateLink.DevicePosition[]) { pb_1.Message.setRepeatedWrapperField(this, 6, value); } + 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: { common?: ReturnType; points?: ReturnType[]; @@ -5056,6 +5089,7 @@ export namespace graphicData { aRelatedRef?: ReturnType; bRelatedRef?: ReturnType; devicePositions?: ReturnType[]; + index?: number; }): CalculateLink { const message = new CalculateLink({}); if (data.common != null) { @@ -5076,6 +5110,9 @@ export namespace graphicData { if (data.devicePositions != null) { message.devicePositions = data.devicePositions.map(item => CalculateLink.DevicePosition.fromObject(item)); } + if (data.index != null) { + message.index = data.index; + } return message; } toObject() { @@ -5086,6 +5123,7 @@ export namespace graphicData { aRelatedRef?: ReturnType; bRelatedRef?: ReturnType; devicePositions?: ReturnType[]; + index?: number; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -5105,6 +5143,9 @@ export namespace graphicData { if (this.devicePositions != null) { data.devicePositions = this.devicePositions.map((item: CalculateLink.DevicePosition) => item.toObject()); } + if (this.index != null) { + data.index = this.index; + } return data; } serialize(): Uint8Array; @@ -5123,6 +5164,8 @@ export namespace graphicData { 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 (this.index != 0) + writer.writeInt32(7, this.index); if (!w) return writer.getResultBuffer(); } @@ -5150,6 +5193,9 @@ export namespace graphicData { case 6: reader.readMessage(message.devicePositions, () => pb_1.Message.addToRepeatedWrapperField(message, 6, CalculateLink.DevicePosition.deserialize(reader), CalculateLink.DevicePosition)); break; + case 7: + message.index = reader.readInt32(); + break; default: reader.skipField(); } }