diff --git a/bj-rtss-message b/bj-rtss-message index c1a9978..649dd84 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit c1a99789fe12482085d30eaa66e0e881ffc99c00 +Subproject commit 649dd846204bcd9a99706f247665dabfe1bc97d0 diff --git a/graphic-pixi b/graphic-pixi index c89d1ee..83eab6c 160000 --- a/graphic-pixi +++ b/graphic-pixi @@ -1 +1 @@ -Subproject commit c89d1eecea3f3c91c4bf52457f1aa51c41171636 +Subproject commit 83eab6c5b3d7a25adced20ad2e6179d3154c05fb diff --git a/src/drawApp/graphics/SectionLinkInteraction.ts b/src/drawApp/graphics/SectionLinkInteraction.ts index 346bc50..fab7332 100644 --- a/src/drawApp/graphics/SectionLinkInteraction.ts +++ b/src/drawApp/graphics/SectionLinkInteraction.ts @@ -69,6 +69,12 @@ export class SectionLinkData set bRef(v: graphicData.RelatedRef) { this.data.bRef = v; } + get index(): number { + return this.data.index; + } + set index(v: number) { + this.data.index = v; + } clone(): SectionLinkData { return new SectionLinkData(this.data.cloneMessage()); diff --git a/src/drawApp/index.ts b/src/drawApp/index.ts index 32ba6a1..34d5673 100644 --- a/src/drawApp/index.ts +++ b/src/drawApp/index.ts @@ -452,6 +452,7 @@ export async function loadDrawDatas(app: GraphicApp) { datas.push(new SeparatorData(separator)); }); storage.sectionLinks.forEach((sectionLink) => { + sectionLink.index = parseInt(sectionLink.code); datas.push(new SectionLinkData(sectionLink)); }); storage.axleCountingSections.forEach((axleCountingSection) => { diff --git a/src/graphics/sectionLink/SectionLink.ts b/src/graphics/sectionLink/SectionLink.ts index b25baeb..7f5801b 100644 --- a/src/graphics/sectionLink/SectionLink.ts +++ b/src/graphics/sectionLink/SectionLink.ts @@ -5,9 +5,9 @@ import { JlGraphicTemplate, VectorText, IChildTransform, + GraphicRelationParam, getNormalVector, movePointAlongNormal, - GraphicRelationParam, } from 'src/jl-graphic'; import { ILineGraphic } from 'src/jl-graphic/plugins/GraphicEditPlugin'; import { @@ -31,6 +31,8 @@ export interface ISectionLinkData extends GraphicData { set aRef(v: IRelatedRefData); get bRef(): IRelatedRefData; set bRef(v: IRelatedRefData); + get index(): number; + set index(v: number); clone(): ISectionLinkData; copyFrom(data: ISectionLinkData): void; eq(other: ISectionLinkData): boolean; diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index 6301baa..d108664 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -758,4 +758,123 @@ export namespace state { return AllDevicesStatus.deserialize(bytes); } } + export class PushedDevicesStatus extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + all?: boolean; + varStatus?: VariationStatus; + allStatus?: AllDevicesStatus; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("all" in data && data.all != undefined) { + this.all = data.all; + } + if ("varStatus" in data && data.varStatus != undefined) { + this.varStatus = data.varStatus; + } + if ("allStatus" in data && data.allStatus != undefined) { + this.allStatus = data.allStatus; + } + } + } + get all() { + return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; + } + set all(value: boolean) { + pb_1.Message.setField(this, 1, value); + } + get varStatus() { + return pb_1.Message.getWrapperField(this, VariationStatus, 2) as VariationStatus; + } + set varStatus(value: VariationStatus) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_varStatus() { + return pb_1.Message.getField(this, 2) != null; + } + get allStatus() { + return pb_1.Message.getWrapperField(this, AllDevicesStatus, 3) as AllDevicesStatus; + } + set allStatus(value: AllDevicesStatus) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_allStatus() { + return pb_1.Message.getField(this, 3) != null; + } + static fromObject(data: { + all?: boolean; + varStatus?: ReturnType; + allStatus?: ReturnType; + }): PushedDevicesStatus { + const message = new PushedDevicesStatus({}); + if (data.all != null) { + message.all = data.all; + } + if (data.varStatus != null) { + message.varStatus = VariationStatus.fromObject(data.varStatus); + } + if (data.allStatus != null) { + message.allStatus = AllDevicesStatus.fromObject(data.allStatus); + } + return message; + } + toObject() { + const data: { + all?: boolean; + varStatus?: ReturnType; + allStatus?: ReturnType; + } = {}; + if (this.all != null) { + data.all = this.all; + } + if (this.varStatus != null) { + data.varStatus = this.varStatus.toObject(); + } + if (this.allStatus != null) { + data.allStatus = this.allStatus.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.all != false) + writer.writeBool(1, this.all); + if (this.has_varStatus) + writer.writeMessage(2, this.varStatus, () => this.varStatus.serialize(writer)); + if (this.has_allStatus) + writer.writeMessage(3, this.allStatus, () => this.allStatus.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PushedDevicesStatus { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PushedDevicesStatus(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.all = reader.readBool(); + break; + case 2: + reader.readMessage(message.varStatus, () => message.varStatus = VariationStatus.deserialize(reader)); + break; + case 3: + reader.readMessage(message.allStatus, () => message.allStatus = AllDevicesStatus.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): PushedDevicesStatus { + return PushedDevicesStatus.deserialize(bytes); + } + } } diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index 6ce2ec6..f24f9c1 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -9,16 +9,11 @@ export namespace graphicData { #one_of_decls: number[][] = []; constructor(data?: any[] | { canvas?: Canvas; - links?: Link[]; - iscsFans?: IscsFan[]; Platforms?: Platform[]; stations?: Station[]; - rects?: Rect[]; - train?: Train[]; signals?: Signal[]; turnouts?: Turnout[]; section?: Section[]; - polygons?: Polygon[]; trainWindows?: TrainWindow[]; axleCountings?: AxleCounting[]; separators?: Separator[]; @@ -27,29 +22,17 @@ export namespace graphicData { logicSections?: LogicSection[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], 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], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("canvas" in data && data.canvas != undefined) { this.canvas = data.canvas; } - if ("links" in data && data.links != undefined) { - this.links = data.links; - } - if ("iscsFans" in data && data.iscsFans != undefined) { - this.iscsFans = data.iscsFans; - } if ("Platforms" in data && data.Platforms != undefined) { this.Platforms = data.Platforms; } if ("stations" in data && data.stations != undefined) { this.stations = data.stations; } - if ("rects" in data && data.rects != undefined) { - this.rects = data.rects; - } - if ("train" in data && data.train != undefined) { - this.train = data.train; - } if ("signals" in data && data.signals != undefined) { this.signals = data.signals; } @@ -59,9 +42,6 @@ export namespace graphicData { if ("section" in data && data.section != undefined) { this.section = data.section; } - if ("polygons" in data && data.polygons != undefined) { - this.polygons = data.polygons; - } if ("trainWindows" in data && data.trainWindows != undefined) { this.trainWindows = data.trainWindows; } @@ -91,18 +71,6 @@ export namespace graphicData { get has_canvas() { return pb_1.Message.getField(this, 1) != null; } - get links() { - return pb_1.Message.getRepeatedWrapperField(this, Link, 2) as Link[]; - } - set links(value: Link[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - get iscsFans() { - return pb_1.Message.getRepeatedWrapperField(this, IscsFan, 3) as IscsFan[]; - } - set iscsFans(value: IscsFan[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } get Platforms() { return pb_1.Message.getRepeatedWrapperField(this, Platform, 4) as Platform[]; } @@ -115,18 +83,6 @@ export namespace graphicData { set stations(value: Station[]) { pb_1.Message.setRepeatedWrapperField(this, 5, value); } - get rects() { - return pb_1.Message.getRepeatedWrapperField(this, Rect, 6) as Rect[]; - } - set rects(value: Rect[]) { - pb_1.Message.setRepeatedWrapperField(this, 6, value); - } - get train() { - return pb_1.Message.getRepeatedWrapperField(this, Train, 7) as Train[]; - } - set train(value: Train[]) { - pb_1.Message.setRepeatedWrapperField(this, 7, value); - } get signals() { return pb_1.Message.getRepeatedWrapperField(this, Signal, 8) as Signal[]; } @@ -145,12 +101,6 @@ export namespace graphicData { set section(value: Section[]) { pb_1.Message.setRepeatedWrapperField(this, 10, value); } - get polygons() { - return pb_1.Message.getRepeatedWrapperField(this, Polygon, 11) as Polygon[]; - } - set polygons(value: Polygon[]) { - pb_1.Message.setRepeatedWrapperField(this, 11, value); - } get trainWindows() { return pb_1.Message.getRepeatedWrapperField(this, TrainWindow, 12) as TrainWindow[]; } @@ -189,16 +139,11 @@ export namespace graphicData { } static fromObject(data: { canvas?: ReturnType; - links?: ReturnType[]; - iscsFans?: ReturnType[]; Platforms?: ReturnType[]; stations?: ReturnType[]; - rects?: ReturnType[]; - train?: ReturnType[]; signals?: ReturnType[]; turnouts?: ReturnType[]; section?: ReturnType[]; - polygons?: ReturnType[]; trainWindows?: ReturnType[]; axleCountings?: ReturnType[]; separators?: ReturnType[]; @@ -210,24 +155,12 @@ export namespace graphicData { if (data.canvas != null) { message.canvas = Canvas.fromObject(data.canvas); } - if (data.links != null) { - message.links = data.links.map(item => Link.fromObject(item)); - } - if (data.iscsFans != null) { - message.iscsFans = data.iscsFans.map(item => IscsFan.fromObject(item)); - } if (data.Platforms != null) { message.Platforms = data.Platforms.map(item => Platform.fromObject(item)); } if (data.stations != null) { message.stations = data.stations.map(item => Station.fromObject(item)); } - if (data.rects != null) { - message.rects = data.rects.map(item => Rect.fromObject(item)); - } - if (data.train != null) { - message.train = data.train.map(item => Train.fromObject(item)); - } if (data.signals != null) { message.signals = data.signals.map(item => Signal.fromObject(item)); } @@ -237,9 +170,6 @@ export namespace graphicData { if (data.section != null) { message.section = data.section.map(item => Section.fromObject(item)); } - if (data.polygons != null) { - message.polygons = data.polygons.map(item => Polygon.fromObject(item)); - } if (data.trainWindows != null) { message.trainWindows = data.trainWindows.map(item => TrainWindow.fromObject(item)); } @@ -263,16 +193,11 @@ export namespace graphicData { toObject() { const data: { canvas?: ReturnType; - links?: ReturnType[]; - iscsFans?: ReturnType[]; Platforms?: ReturnType[]; stations?: ReturnType[]; - rects?: ReturnType[]; - train?: ReturnType[]; signals?: ReturnType[]; turnouts?: ReturnType[]; section?: ReturnType[]; - polygons?: ReturnType[]; trainWindows?: ReturnType[]; axleCountings?: ReturnType[]; separators?: ReturnType[]; @@ -283,24 +208,12 @@ export namespace graphicData { if (this.canvas != null) { data.canvas = this.canvas.toObject(); } - if (this.links != null) { - data.links = this.links.map((item: Link) => item.toObject()); - } - if (this.iscsFans != null) { - data.iscsFans = this.iscsFans.map((item: IscsFan) => item.toObject()); - } if (this.Platforms != null) { data.Platforms = this.Platforms.map((item: Platform) => item.toObject()); } if (this.stations != null) { data.stations = this.stations.map((item: Station) => item.toObject()); } - if (this.rects != null) { - data.rects = this.rects.map((item: Rect) => item.toObject()); - } - if (this.train != null) { - data.train = this.train.map((item: Train) => item.toObject()); - } if (this.signals != null) { data.signals = this.signals.map((item: Signal) => item.toObject()); } @@ -310,9 +223,6 @@ export namespace graphicData { if (this.section != null) { data.section = this.section.map((item: Section) => item.toObject()); } - if (this.polygons != null) { - data.polygons = this.polygons.map((item: Polygon) => item.toObject()); - } if (this.trainWindows != null) { data.trainWindows = this.trainWindows.map((item: TrainWindow) => item.toObject()); } @@ -339,26 +249,16 @@ export namespace graphicData { const writer = w || new pb_1.BinaryWriter(); if (this.has_canvas) writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer)); - if (this.links.length) - writer.writeRepeatedMessage(2, this.links, (item: Link) => item.serialize(writer)); - if (this.iscsFans.length) - writer.writeRepeatedMessage(3, this.iscsFans, (item: IscsFan) => item.serialize(writer)); if (this.Platforms.length) writer.writeRepeatedMessage(4, this.Platforms, (item: Platform) => item.serialize(writer)); if (this.stations.length) writer.writeRepeatedMessage(5, this.stations, (item: Station) => item.serialize(writer)); - if (this.rects.length) - writer.writeRepeatedMessage(6, this.rects, (item: Rect) => item.serialize(writer)); - if (this.train.length) - writer.writeRepeatedMessage(7, this.train, (item: Train) => item.serialize(writer)); if (this.signals.length) writer.writeRepeatedMessage(8, this.signals, (item: Signal) => item.serialize(writer)); if (this.turnouts.length) writer.writeRepeatedMessage(9, this.turnouts, (item: Turnout) => item.serialize(writer)); if (this.section.length) writer.writeRepeatedMessage(10, this.section, (item: Section) => item.serialize(writer)); - if (this.polygons.length) - writer.writeRepeatedMessage(11, this.polygons, (item: Polygon) => item.serialize(writer)); if (this.trainWindows.length) writer.writeRepeatedMessage(12, this.trainWindows, (item: TrainWindow) => item.serialize(writer)); if (this.axleCountings.length) @@ -383,24 +283,12 @@ export namespace graphicData { case 1: reader.readMessage(message.canvas, () => message.canvas = Canvas.deserialize(reader)); break; - case 2: - reader.readMessage(message.links, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Link.deserialize(reader), Link)); - break; - case 3: - reader.readMessage(message.iscsFans, () => pb_1.Message.addToRepeatedWrapperField(message, 3, IscsFan.deserialize(reader), IscsFan)); - break; case 4: reader.readMessage(message.Platforms, () => pb_1.Message.addToRepeatedWrapperField(message, 4, Platform.deserialize(reader), Platform)); break; case 5: reader.readMessage(message.stations, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Station.deserialize(reader), Station)); break; - case 6: - reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 6, Rect.deserialize(reader), Rect)); - break; - case 7: - reader.readMessage(message.train, () => pb_1.Message.addToRepeatedWrapperField(message, 7, Train.deserialize(reader), Train)); - break; case 8: reader.readMessage(message.signals, () => pb_1.Message.addToRepeatedWrapperField(message, 8, Signal.deserialize(reader), Signal)); break; @@ -410,9 +298,6 @@ export namespace graphicData { case 10: reader.readMessage(message.section, () => pb_1.Message.addToRepeatedWrapperField(message, 10, Section.deserialize(reader), Section)); break; - case 11: - reader.readMessage(message.polygons, () => pb_1.Message.addToRepeatedWrapperField(message, 11, Polygon.deserialize(reader), Polygon)); - break; case 12: reader.readMessage(message.trainWindows, () => pb_1.Message.addToRepeatedWrapperField(message, 12, TrainWindow.deserialize(reader), TrainWindow)); break; @@ -1049,610 +934,6 @@ export namespace graphicData { return CommonInfo.deserialize(bytes); } } - export class Link extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - common?: CommonInfo; - code?: string; - curve?: boolean; - segmentsCount?: number; - lineWidth?: number; - lineColor?: string; - points?: Point[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("common" in data && data.common != undefined) { - this.common = data.common; - } - if ("code" in data && data.code != undefined) { - this.code = data.code; - } - if ("curve" in data && data.curve != undefined) { - this.curve = data.curve; - } - if ("segmentsCount" in data && data.segmentsCount != undefined) { - this.segmentsCount = data.segmentsCount; - } - if ("lineWidth" in data && data.lineWidth != undefined) { - this.lineWidth = data.lineWidth; - } - if ("lineColor" in data && data.lineColor != undefined) { - this.lineColor = data.lineColor; - } - if ("points" in data && data.points != undefined) { - this.points = data.points; - } - } - } - 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 curve() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set curve(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get segmentsCount() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set segmentsCount(value: number) { - pb_1.Message.setField(this, 4, value); - } - get lineWidth() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set lineWidth(value: number) { - pb_1.Message.setField(this, 5, value); - } - get lineColor() { - return pb_1.Message.getFieldWithDefault(this, 6, "") as string; - } - set lineColor(value: string) { - pb_1.Message.setField(this, 6, value); - } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 7) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 7, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - curve?: boolean; - segmentsCount?: number; - lineWidth?: number; - lineColor?: string; - points?: ReturnType[]; - }): Link { - const message = new Link({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.curve != null) { - message.curve = data.curve; - } - if (data.segmentsCount != null) { - message.segmentsCount = data.segmentsCount; - } - if (data.lineWidth != null) { - message.lineWidth = data.lineWidth; - } - if (data.lineColor != null) { - message.lineColor = data.lineColor; - } - if (data.points != null) { - message.points = data.points.map(item => Point.fromObject(item)); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - curve?: boolean; - segmentsCount?: number; - lineWidth?: number; - lineColor?: string; - points?: ReturnType[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.curve != null) { - data.curve = this.curve; - } - if (this.segmentsCount != null) { - data.segmentsCount = this.segmentsCount; - } - if (this.lineWidth != null) { - data.lineWidth = this.lineWidth; - } - if (this.lineColor != null) { - data.lineColor = this.lineColor; - } - if (this.points != null) { - data.points = this.points.map((item: Point) => 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.code.length) - writer.writeString(2, this.code); - if (this.curve != false) - writer.writeBool(3, this.curve); - if (this.segmentsCount != 0) - writer.writeInt32(4, this.segmentsCount); - if (this.lineWidth != 0) - writer.writeInt32(5, this.lineWidth); - if (this.lineColor.length) - writer.writeString(6, this.lineColor); - if (this.points.length) - writer.writeRepeatedMessage(7, this.points, (item: Point) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Link { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Link(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.curve = reader.readBool(); - break; - case 4: - message.segmentsCount = reader.readInt32(); - break; - case 5: - message.lineWidth = reader.readInt32(); - break; - case 6: - message.lineColor = reader.readString(); - break; - case 7: - reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 7, Point.deserialize(reader), Point)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Link { - return Link.deserialize(bytes); - } - } - export class Rect extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - common?: CommonInfo; - code?: string; - lineWidth?: number; - lineColor?: string; - width?: number; - height?: number; - radius?: number; - point?: Point; - }) { - 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 ("lineWidth" in data && data.lineWidth != undefined) { - this.lineWidth = data.lineWidth; - } - if ("lineColor" in data && data.lineColor != undefined) { - this.lineColor = data.lineColor; - } - if ("width" in data && data.width != undefined) { - this.width = data.width; - } - if ("height" in data && data.height != undefined) { - this.height = data.height; - } - if ("radius" in data && data.radius != undefined) { - this.radius = data.radius; - } - if ("point" in data && data.point != undefined) { - this.point = data.point; - } - } - } - 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 lineWidth() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set lineWidth(value: number) { - pb_1.Message.setField(this, 3, value); - } - get lineColor() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set lineColor(value: string) { - pb_1.Message.setField(this, 4, value); - } - get width() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set width(value: number) { - pb_1.Message.setField(this, 5, value); - } - get height() { - return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; - } - set height(value: number) { - pb_1.Message.setField(this, 6, value); - } - get radius() { - return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; - } - set radius(value: number) { - pb_1.Message.setField(this, 7, value); - } - get point() { - return pb_1.Message.getWrapperField(this, Point, 8) as Point; - } - set point(value: Point) { - pb_1.Message.setWrapperField(this, 8, value); - } - get has_point() { - return pb_1.Message.getField(this, 8) != null; - } - static fromObject(data: { - common?: ReturnType; - code?: string; - lineWidth?: number; - lineColor?: string; - width?: number; - height?: number; - radius?: number; - point?: ReturnType; - }): Rect { - const message = new Rect({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.lineWidth != null) { - message.lineWidth = data.lineWidth; - } - if (data.lineColor != null) { - message.lineColor = data.lineColor; - } - if (data.width != null) { - message.width = data.width; - } - if (data.height != null) { - message.height = data.height; - } - if (data.radius != null) { - message.radius = data.radius; - } - if (data.point != null) { - message.point = Point.fromObject(data.point); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - lineWidth?: number; - lineColor?: string; - width?: number; - height?: number; - radius?: number; - point?: ReturnType; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.lineWidth != null) { - data.lineWidth = this.lineWidth; - } - if (this.lineColor != null) { - data.lineColor = this.lineColor; - } - if (this.width != null) { - data.width = this.width; - } - if (this.height != null) { - data.height = this.height; - } - if (this.radius != null) { - data.radius = this.radius; - } - if (this.point != null) { - data.point = this.point.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.lineWidth != 0) - writer.writeInt32(3, this.lineWidth); - if (this.lineColor.length) - writer.writeString(4, this.lineColor); - if (this.width != 0) - writer.writeFloat(5, this.width); - if (this.height != 0) - writer.writeFloat(6, this.height); - if (this.radius != 0) - writer.writeInt32(7, this.radius); - if (this.has_point) - writer.writeMessage(8, this.point, () => this.point.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Rect { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Rect(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.lineWidth = reader.readInt32(); - break; - case 4: - message.lineColor = reader.readString(); - break; - case 5: - message.width = reader.readFloat(); - break; - case 6: - message.height = reader.readFloat(); - break; - case 7: - message.radius = reader.readInt32(); - break; - case 8: - reader.readMessage(message.point, () => message.point = Point.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Rect { - return Rect.deserialize(bytes); - } - } - export class Polygon extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - common?: CommonInfo; - code?: string; - lineWidth?: number; - lineColor?: string; - points?: Point[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [5], 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 ("lineWidth" in data && data.lineWidth != undefined) { - this.lineWidth = data.lineWidth; - } - if ("lineColor" in data && data.lineColor != undefined) { - this.lineColor = data.lineColor; - } - if ("points" in data && data.points != undefined) { - this.points = data.points; - } - } - } - 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 lineWidth() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set lineWidth(value: number) { - pb_1.Message.setField(this, 3, value); - } - get lineColor() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set lineColor(value: string) { - pb_1.Message.setField(this, 4, value); - } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 5) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 5, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - lineWidth?: number; - lineColor?: string; - points?: ReturnType[]; - }): Polygon { - const message = new Polygon({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.lineWidth != null) { - message.lineWidth = data.lineWidth; - } - if (data.lineColor != null) { - message.lineColor = data.lineColor; - } - if (data.points != null) { - message.points = data.points.map(item => Point.fromObject(item)); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - lineWidth?: number; - lineColor?: string; - points?: ReturnType[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.lineWidth != null) { - data.lineWidth = this.lineWidth; - } - if (this.lineColor != null) { - data.lineColor = this.lineColor; - } - if (this.points != null) { - data.points = this.points.map((item: Point) => 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.code.length) - writer.writeString(2, this.code); - if (this.lineWidth != 0) - writer.writeInt32(3, this.lineWidth); - if (this.lineColor.length) - writer.writeString(4, this.lineColor); - if (this.points.length) - writer.writeRepeatedMessage(5, this.points, (item: Point) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Polygon { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Polygon(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.lineWidth = reader.readInt32(); - break; - case 4: - message.lineColor = reader.readString(); - break; - case 5: - reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Point.deserialize(reader), Point)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Polygon { - return Polygon.deserialize(bytes); - } - } export class Platform extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -2238,192 +1519,6 @@ export namespace graphicData { return AxleCounting.deserialize(bytes); } } - export class Train extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - common?: CommonInfo; - code?: 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 ("common" in data && data.common != undefined) { - this.common = data.common; - } - if ("code" in data && data.code != undefined) { - this.code = data.code; - } - } - } - 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); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - }): Train { - const message = new Train({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - 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 (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Train { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Train(); - 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; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Train { - return Train.deserialize(bytes); - } - } - export class IscsFan extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - common?: CommonInfo; - code?: 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 ("common" in data && data.common != undefined) { - this.common = data.common; - } - if ("code" in data && data.code != undefined) { - this.code = data.code; - } - } - } - 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); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - }): IscsFan { - const message = new IscsFan({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - 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 (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IscsFan { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IscsFan(); - 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; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): IscsFan { - return IscsFan.deserialize(bytes); - } - } export class Turnout extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -3718,6 +2813,7 @@ export namespace graphicData { bSimRef?: SimpleRef; aRef?: RelatedRef; bRef?: RelatedRef; + index?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); @@ -3746,6 +2842,9 @@ export namespace graphicData { if ("bRef" in data && data.bRef != undefined) { this.bRef = data.bRef; } + if ("index" in data && data.index != undefined) { + this.index = data.index; + } } } get common() { @@ -3811,6 +2910,12 @@ export namespace graphicData { get has_bRef() { return pb_1.Message.getField(this, 8) != null; } + get index() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set index(value: number) { + pb_1.Message.setField(this, 9, value); + } static fromObject(data: { common?: ReturnType; code?: string; @@ -3820,6 +2925,7 @@ export namespace graphicData { bSimRef?: ReturnType; aRef?: ReturnType; bRef?: ReturnType; + index?: number; }): SectionLink { const message = new SectionLink({}); if (data.common != null) { @@ -3846,6 +2952,9 @@ export namespace graphicData { if (data.bRef != null) { message.bRef = RelatedRef.fromObject(data.bRef); } + if (data.index != null) { + message.index = data.index; + } return message; } toObject() { @@ -3858,6 +2967,7 @@ export namespace graphicData { bSimRef?: ReturnType; aRef?: ReturnType; bRef?: ReturnType; + index?: number; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -3883,6 +2993,9 @@ export namespace graphicData { if (this.bRef != null) { data.bRef = this.bRef.toObject(); } + if (this.index != null) { + data.index = this.index; + } return data; } serialize(): Uint8Array; @@ -3905,6 +3018,8 @@ export namespace graphicData { writer.writeMessage(7, this.aRef, () => this.aRef.serialize(writer)); if (this.has_bRef) writer.writeMessage(8, this.bRef, () => this.bRef.serialize(writer)); + if (this.index != 0) + writer.writeInt32(9, this.index); if (!w) return writer.getResultBuffer(); } @@ -3938,6 +3053,9 @@ export namespace graphicData { case 8: reader.readMessage(message.bRef, () => message.bRef = RelatedRef.deserialize(reader)); break; + case 9: + message.index = reader.readInt32(); + break; default: reader.skipField(); } }