From a474415b9df2309ff4a63beff5ad67055631faf3 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Fri, 29 Mar 2024 18:34:36 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=98=B2=E6=B7=B9=E9=97=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=BB=A7=E7=94=B5=E5=99=A8=E5=92=8C=E5=85=B3=E8=81=94?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../draw-app/dialogs/DeviceRelateRelayList.vue | 1 + .../draw-app/properties/RelateRelayConfig.vue | 1 + src/configs/UrlManage.ts | 2 +- .../ConcentrationDividingLineUtils.ts | 3 +++ .../RelayCabinetLayout/GeneraterCiCjConfig.ts | 4 ++++ .../RelayCabinetLayout/GeneraterCiQdConfig.ts | 3 +++ .../GeneraterRelayLayoutConfig.ts | 4 ++++ .../RelayCabinetLayout/RelayCabinetLayout.vue | 16 ++++++++++++++++ src/protos/stationLayoutGraphics.ts | 3 ++- 9 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/components/draw-app/dialogs/DeviceRelateRelayList.vue b/src/components/draw-app/dialogs/DeviceRelateRelayList.vue index 21a1f24..b49c731 100644 --- a/src/components/draw-app/dialogs/DeviceRelateRelayList.vue +++ b/src/components/draw-app/dialogs/DeviceRelateRelayList.vue @@ -68,6 +68,7 @@ const deviceTypeMap = { 10: '电源屏', 11: '车库门', 12: '洗车机', + 13: '防淹门', }; const columns: QTable['columns'] = [ { diff --git a/src/components/draw-app/properties/RelateRelayConfig.vue b/src/components/draw-app/properties/RelateRelayConfig.vue index 73635fd..fc53996 100644 --- a/src/components/draw-app/properties/RelateRelayConfig.vue +++ b/src/components/draw-app/properties/RelateRelayConfig.vue @@ -88,6 +88,7 @@ const optionsType = [ { label: '电源屏', value: graphicData.RelatedRef.DeviceType.PowerScreen }, { label: '车库门', value: graphicData.RelatedRef.DeviceType.GarageDoor }, { label: '洗车机', value: graphicData.RelatedRef.DeviceType.CarWashing }, + { label: '防淹门', value: graphicData.RelatedRef.DeviceType.FloodGate }, ]; const noShowType = [ diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index 62d1883..c4e0f4d 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -9,7 +9,7 @@ function getHost(): string { // return '192.168.3.7:9091'; // return '192.168.3.47:9091'; // return '192.168.3.37:9091'; - return '192.168.33.207:9091'; // 张骞 + //return '192.168.33.207:9091'; // 张骞 // return '192.168.33.93:9091'; // return '192.168.3.37:9091'; //卫志宏 // return 'test.joylink.club/bjrtsts-service'; // 测试 diff --git a/src/graphics/concentrationDividingLine/ConcentrationDividingLineUtils.ts b/src/graphics/concentrationDividingLine/ConcentrationDividingLineUtils.ts index 2146c9b..bbffbd0 100644 --- a/src/graphics/concentrationDividingLine/ConcentrationDividingLineUtils.ts +++ b/src/graphics/concentrationDividingLine/ConcentrationDividingLineUtils.ts @@ -16,6 +16,8 @@ import { GarageDoor } from '../garageDoor/GarageDoor'; import { CarWashing } from '../carWashing/CarWashing'; import { GarageDoorData } from 'src/drawApp/graphics/GarageDoorInteraction'; import { CarWashingData } from 'src/drawApp/graphics/CarWashingInteraction'; +import { FloodGate } from '../floodGate/FloodGate'; +import { FloodGateData } from 'src/drawApp/graphics/FloodGateInteraction'; //判断线段与线段有木有交点 export function isSegmentsIntersect( @@ -176,6 +178,7 @@ export function handleCentralizedStationsData( [Transponder.Type, new TransponderData()], [GarageDoor.Type, new GarageDoorData()], [CarWashing.Type, new CarWashingData()], + [FloodGate.Type, new FloodGateData()], ]); devices.forEach((device) => { const data = dataMap.get(device.type); diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts index cb5224d..8e4a655 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts @@ -698,6 +698,9 @@ const garageDoorCjList = [ }, ]; +//防淹门 +const floodGateCjList = garageDoorCjList; + //洗车机 const carWashingCjList = [ { @@ -870,4 +873,5 @@ export const ciCjMap = new Map([ [`${DeviceType.PowerScreen}+undefined`, powerScreenCjList], [`${DeviceType.GarageDoor}+undefined`, garageDoorCjList], [`${DeviceType.CarWashing}+undefined`, carWashingCjList], + [`${DeviceType.FloodGate}+undefined`, floodGateCjList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts index 0b60b11..4656973 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts @@ -103,6 +103,8 @@ const garageDoorQdList = [ }, ]; +const floodGateQdList = garageDoorQdList; + const carWashingQdList = [ { code: 'XCJ1', @@ -176,4 +178,5 @@ export const ciQdMap = new Map([ [`${DeviceType.ScreenDoor}+up`, upScreenDoorQdList], [`${DeviceType.GarageDoor}+undefined`, garageDoorQdList], [`${DeviceType.CarWashing}+undefined`, carWashingQdList], + [`${DeviceType.FloodGate}+undefined`, floodGateQdList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts index 77cd90b..622acb1 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts @@ -464,6 +464,9 @@ const garageDoorCombinations = [ }, ]; +//防淹门 +const floodGateCombinations = garageDoorCombinations; + //洗车机 const carWashingCombinations = [ { @@ -570,4 +573,5 @@ export const combinationsMap = new Map([ [`${DeviceType.PowerScreen}`, powerScreenCombinations], [`${DeviceType.GarageDoor}`, garageDoorCombinations], [`${DeviceType.CarWashing}`, carWashingCombinations], + [`${DeviceType.FloodGate}`, floodGateCombinations], ]); diff --git a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue index 39770dc..af3529c 100644 --- a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue +++ b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue @@ -752,6 +752,22 @@ function oneClickGeneraterRelayLayout() { ); } }); + //防淹门 + storage.floodGates.forEach((floodGate) => { + const deviceCombinations = combinationsMap.get( + `${DeviceType.FloodGate}` + ); + if ( + floodGate.centralizedStations.includes(concentrationStation) && + deviceCombinations + ) { + creatDeviceRelateRelays( + deviceCombinations, + DeviceType.FloodGate, + floodGate.code + ); + } + }); //洗车机 storage.carWashings.forEach((carWashing) => { const deviceCombinations = combinationsMap.get( diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index 50de0e4..3ff33e2 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -4636,7 +4636,8 @@ export namespace graphicData { Breakers = 9, PowerScreen = 10, GarageDoor = 11, - CarWashing = 12 + CarWashing = 12, + FloodGate = 13 } export enum DevicePort { A = 0, From b75bc9b9f0b9381a46f467f0ef089e07b08c5385 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 2 Apr 2024 10:47:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=88=97=E8=BD=A6=E9=A9=BE=E9=A9=B6?= =?UTF-8?q?=E5=8F=B0=E4=BA=A4=E4=BA=92=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Simulation.ts | 47 ++++ src/drawApp/graphics/TccButtonInteraction.ts | 17 +- src/drawApp/graphics/TccHandleInteraction.ts | 31 ++- src/drawApp/graphics/TccKeyInteraction.ts | 256 ++++++++++++++----- src/drawApp/tccScene.ts | 11 + src/graphics/tccKey/TccKey.ts | 11 + src/stores/tcc-store.ts | 1 + 7 files changed, 303 insertions(+), 71 deletions(-) diff --git a/src/api/Simulation.ts b/src/api/Simulation.ts index ab15288..92bfcf3 100644 --- a/src/api/Simulation.ts +++ b/src/api/Simulation.ts @@ -184,6 +184,53 @@ export async function ibpKeyOperation(params: IbpKeyOperationParams) { return await api.post(`${UriBase}/ibp/key/operation`, params); } +export interface TccButtonOperationParams { + buttonId: number; + down: boolean; + mapId: number; + simulationId: string; + tccId: number; +} +export async function tccButtonOperation(params: TccButtonOperationParams) { + return await api.post(`${UriBase}/tcc/btn/operation`, params); +} + +export interface TccKeyOperationParams { + simulationId: string; + mapId: number; + tccId: number; + val: boolean; + keyId: number; +} + +export async function tccKeyOperation(params: TccKeyOperationParams) { + return await api.post(`${UriBase}/tcc/key/operation`, params); +} + +export interface TccKeyDirOperationParams { + simulationId: string; + mapId: number; + tccId: number; + val: number; + keyId: number; +} + +export async function tccKeyDirOperation(params: TccKeyDirOperationParams) { + return await api.post(`${UriBase}/tcc/key/operation`, params); +} + +export interface TccHandleOperationParams { + simulationId: string; + mapId: number; + tccId: number; + val: number; + handleId: number; +} + +export async function tccHandleOperation(params: TccHandleOperationParams) { + return await api.post(`${UriBase}/tcc/handle/operation`, params); +} + export function checkMapData(data: { mapProto: string }) { return api.post(`${UriBase}/check/data`, data); } diff --git a/src/drawApp/graphics/TccButtonInteraction.ts b/src/drawApp/graphics/TccButtonInteraction.ts index a85f510..191ef9a 100644 --- a/src/drawApp/graphics/TccButtonInteraction.ts +++ b/src/drawApp/graphics/TccButtonInteraction.ts @@ -11,6 +11,8 @@ import { ITccButtonState, TccButton, } from 'src/graphics/tccButton/TccButton'; +import { tccButtonOperation } from 'src/api/Simulation'; +import { errorNotify } from 'src/utils/CommonNotify'; export class TccButtonData extends GraphicDataBase implements ITccButtonData { constructor(data?: tccGraphicData.TccButton) { @@ -112,11 +114,22 @@ export class TccButtonOperateInteraction extends GraphicInteractionPlugin(); - if (!tccButton) return; + if (!tccButton || !simulationId || !mapId) return; tccButton.states.down = !tccButton.states.down; tccButton.doRepaint(); - console.log(tccButton.states.down); + /* tccButtonOperation({ + simulationId, + mapId, + buttonId: tccButton.id, + tccId, + down: !tccButton.states.down, + }).catch((err) => { + errorNotify('操作失败', { message: err.origin.response.data.title }); + }); */ } } diff --git a/src/drawApp/graphics/TccHandleInteraction.ts b/src/drawApp/graphics/TccHandleInteraction.ts index 0b7dc02..9f60ad3 100644 --- a/src/drawApp/graphics/TccHandleInteraction.ts +++ b/src/drawApp/graphics/TccHandleInteraction.ts @@ -10,6 +10,9 @@ import { state } from 'src/protos/device_state'; import { GraphicInteractionPlugin, IGraphicScene, JlGraphic } from 'jl-graphic'; import { type FederatedMouseEvent, DisplayObject } from 'pixi.js'; import { useTccStore } from 'src/stores/tcc-store'; +import { useLineStore } from 'src/stores/line-store'; +import { tccHandleOperation } from 'src/api/Simulation'; +import { errorNotify } from 'src/utils/CommonNotify'; export class TccHandleData extends GraphicDataBase implements ITccHandleData { constructor(data?: tccGraphicData.TccHandle) { @@ -101,14 +104,14 @@ export class TccHandleInteraction extends GraphicInteractionPlugin { g._tccHandle.onmousedown = (e) => { this.onMouseDown(e); }; - g._tccHandle.onmouseup = () => { - this.isMouseDown = false; + g._tccHandle.onmouseup = (e) => { + this.onMouseUp(e); }; g.onmousemove = (e) => { this.onMouseMove(e); }; - g.onmouseleave = () => { - this.isMouseDown = false; + g.onmouseleave = (e) => { + this.onMouseMove(e); }; } unbind(g: TccHandle): void { @@ -132,6 +135,7 @@ export class TccHandleInteraction extends GraphicInteractionPlugin { if (!tccHandle) return; if ( this.isMouseDown && + useTccStore().canvasMouseDown && tccHandle._tccHandle.y > -145 && tccHandle._tccHandle.y < 145 ) { @@ -144,4 +148,23 @@ export class TccHandleInteraction extends GraphicInteractionPlugin { } } } + onMouseUp(e: FederatedMouseEvent) { + this.isMouseDown = false; + const simulationId = useLineStore().simulationId; + const mapId = useLineStore().mapId; + const tccId = useTccStore().tccId; + const target = e.target as DisplayObject; + const tccHandle = target.getGraphic(); + if (!tccHandle || !simulationId || !mapId) return; + tccHandle.doRepaint(); + /* tccHandleOperation({ + simulationId, + mapId, + handleId: tccHandle.id, + tccId, + val: tccHandle._tccHandle.y, + }).catch((err) => { + errorNotify('操作失败', { message: err.origin.response.data.title }); + }); */ + } } diff --git a/src/drawApp/graphics/TccKeyInteraction.ts b/src/drawApp/graphics/TccKeyInteraction.ts index 292c6fa..75a16aa 100644 --- a/src/drawApp/graphics/TccKeyInteraction.ts +++ b/src/drawApp/graphics/TccKeyInteraction.ts @@ -4,8 +4,17 @@ import { tccGraphicData } from 'src/protos/tccGraphics'; import { GraphicDataBase, GraphicStateBase } from './GraphicDataBase'; import { state } from 'src/protos/device_state'; import { GraphicInteractionPlugin, IGraphicScene, JlGraphic } from 'jl-graphic'; -import { type FederatedMouseEvent, DisplayObject, Point } from 'pixi.js'; +import { + type FederatedMouseEvent, + DisplayObject, + Point, + Sprite, +} from 'pixi.js'; import { useTccStore } from 'src/stores/tcc-store'; +import { threadId } from 'worker_threads'; +import { useLineStore } from 'src/stores/line-store'; +import { tccKeyDirOperation, tccKeyOperation } from 'src/api/Simulation'; +import { errorNotify } from 'src/utils/CommonNotify'; export class TccKeyData extends GraphicDataBase implements ITccKeyData { constructor(data?: tccGraphicData.TccKey) { @@ -80,13 +89,144 @@ export class TccKeyState extends GraphicStateBase implements ITccKeyState { } } -export class TccKeyInteraction extends GraphicInteractionPlugin { - static Name = 'TccKeyInteraction'; +export enum KeyRotationMethod { + jumpChange, + gradientChange, +} +export interface IKeyInteractionConfig { + gearPositionAmount?: number; + keyRotationMethod: KeyRotationMethod; + doAfterChangeRotation: (g: JlGraphic, rotation: number) => void; + doFinish: () => void; +} +export abstract class KeyInteraction< + G extends JlGraphic +> extends GraphicInteractionPlugin { isMouseDown = false; - changeOnce = false; + ratatingSprite: Sprite = new Sprite(); mouseDownBeginPos = new Point(); + mouseDownBeginRotation = 0; + keyInteractionConfig: IKeyInteractionConfig; + constructor( + name: string, + app: IGraphicScene, + keyInteractionConfig: IKeyInteractionConfig + ) { + super(name, app); + this.keyInteractionConfig = keyInteractionConfig; + } + totalBind(g: G): void { + g.onmousemove = (e) => { + this.onMousemove(e); + }; + g.onmouseup = (e) => { + e.stopPropagation(); + this.isMouseDown = false; + this.keyInteractionConfig.doFinish(); + }; + } + totalUnbind(g: G): void { + g.onmousemove = null; + g.onmouseup = null; + } + keyBind(g: Sprite): void { + this.ratatingSprite = g; + g.eventMode = 'static'; + g.cursor = 'pointer'; + g.onmousedown = (e) => { + this.onMouseDown(e); + }; + } + keyUnbind(g: Sprite): void { + g.eventMode = 'none'; + g.onmousedown = null; + } + onMouseDown(e: FederatedMouseEvent) { + const target = e.target as DisplayObject; + const g = target.getGraphic(); + if (!g) return; + this.isMouseDown = true; + this.mouseDownBeginPos = this.app.toCanvasCoordinates(e.global); + this.mouseDownBeginRotation = this.ratatingSprite.rotation; + } + onMousemove(e: FederatedMouseEvent) { + const target = e.target as DisplayObject; + const g = target.getGraphic(); + if (!g) return; + if (this.isMouseDown && useTccStore().canvasMouseDown) { + const mouseEndPos = this.app.toCanvasCoordinates(e.global); + const { angle, direction } = calculateAngleAndDirection( + this.mouseDownBeginPos, + g.position, + mouseEndPos + ); + if ( + this.keyInteractionConfig.keyRotationMethod == + KeyRotationMethod.jumpChange + ) { + if (direction == 'ssz') { + if (angle < 45) { + this.ratatingSprite.rotation = this.mouseDownBeginRotation; + } + if (angle >= 45 && angle < 90) { + this.ratatingSprite.rotation = + this.mouseDownBeginRotation + Math.PI / 4; + } else if ( + angle >= 90 && + this.mouseDownBeginRotation == -Math.PI / 4 + ) { + this.ratatingSprite.rotation = + this.mouseDownBeginRotation + Math.PI / 2; + } + this.keyInteractionConfig.doAfterChangeRotation( + g, + this.ratatingSprite.rotation + ); + } + if (direction == 'nsz') { + if (angle < 45) { + this.ratatingSprite.rotation = this.mouseDownBeginRotation; + } else if (angle >= 45 && angle < 90) { + this.ratatingSprite.rotation = + this.mouseDownBeginRotation - Math.PI / 4; + } else if ( + angle >= 90 && + this.mouseDownBeginRotation == Math.PI / 4 + ) { + this.ratatingSprite.rotation = + this.mouseDownBeginRotation - Math.PI / 2; + } + this.keyInteractionConfig.doAfterChangeRotation( + g, + this.ratatingSprite.rotation + ); + } + } else { + if (direction == 'ssz') { + this.ratatingSprite.rotation = + this.mouseDownBeginRotation + (angle / 180) * Math.PI; + } else { + this.ratatingSprite.rotation = + this.mouseDownBeginRotation - (angle / 180) * Math.PI; + } + } + } + } +} + +export class TccKeyInteraction extends KeyInteraction { + static Name = 'TccKeyInteraction'; constructor(app: IGraphicScene) { - super(TccKeyInteraction.Name, app); + super(TccKeyInteraction.Name, app, { + gearPositionAmount: 3, + keyRotationMethod: KeyRotationMethod.jumpChange, + doAfterChangeRotation: (g: JlGraphic, rotation: number) => { + this.changeState(g, rotation); + }, + doFinish: () => { + this.onFinish(); + }, + }); } static init(app: IGraphicScene) { return new TccKeyInteraction(app); @@ -103,20 +243,8 @@ export class TccKeyInteraction extends GraphicInteractionPlugin { ) { g._tccKey.on('_leftclick', this.onClick); } else { - g._tccKey.onmousedown = (e) => { - this.onMouseDown(e); - }; - g._tccKey.onmouseup = () => { - this.isMouseDown = false; - this.changeOnce = false; - }; - g.onmousemove = (e) => { - this.onMousemove(e); - }; - g.onmouseleave = () => { - this.isMouseDown = false; - this.changeOnce = false; - }; + super.totalBind(g); + super.keyBind(g._tccKey); } } unbind(g: TccKey): void { @@ -127,61 +255,59 @@ export class TccKeyInteraction extends GraphicInteractionPlugin { ) { g._tccKey.off('_leftclick', this.onClick); } else { - g._tccKey.onmousedown = null; - g._tccKey.onmouseup = null; - g.onmousemove = null; - g.onmouseleave = null; + super.totalUnbind(g); + super.keyUnbind(g._tccKey); } } onClick(e: FederatedMouseEvent): void { + const simulationId = useLineStore().simulationId; + const mapId = useLineStore().mapId; + const tccId = useTccStore().tccId; const target = e.target as DisplayObject; const tccKey = target.getGraphic(); - if (!tccKey) return; + if (!tccKey || !simulationId || !mapId) return; tccKey.state.position = tccKey?.state.position == 0 ? 1 : 0; tccKey.doRepaint(); + /* tccKeyOperation({ + simulationId, + mapId, + keyId: tccKey.id, + tccId, + val: !tccKey.state.position, + }).catch((err) => { + errorNotify('操作失败', { message: err.origin.response.data.title }); + }); */ } - onMouseDown(e: FederatedMouseEvent) { - const target = e.target as DisplayObject; - const tccKey = target.getGraphic(); - if (!tccKey) return; - this.isMouseDown = true; - this.mouseDownBeginPos = tccKey - .getGraphicApp() - .getScene('tcc') - .toCanvasCoordinates(e.global); - } - onMousemove(e: FederatedMouseEvent) { - const target = e.target as DisplayObject; - const tccKey = target.getGraphic(); - if (!tccKey) return; - if (this.isMouseDown) { - const mouseEndPos = tccKey - .getGraphicApp() - .getScene('tcc') - .toCanvasCoordinates(e.global); - const { angle, direction } = calculateAngleAndDirection( - this.mouseDownBeginPos, - tccKey.position, - mouseEndPos - ); - if ( - direction == 'ssz' && - ((angle > 45 && !this.changeOnce) || (angle > 90 && this.changeOnce)) && - (tccKey._tccKey.rotation == -Math.PI / 4 || - tccKey._tccKey.rotation == 0) - ) { - this.changeOnce = true; - tccKey._tccKey.rotation += Math.PI / 4; - } - if ( - direction == 'nsz' && - ((angle > 45 && !this.changeOnce) || (angle > 90 && this.changeOnce)) && - (tccKey._tccKey.rotation == Math.PI / 4 || tccKey._tccKey.rotation == 0) - ) { - this.changeOnce = true; - tccKey._tccKey.rotation -= Math.PI / 4; - } + changeState(g: JlGraphic, rotation: number) { + let position = 0; + switch (rotation) { + case Math.PI / 4: + position = 0; + break; + case -Math.PI / 4: + position = 1; + break; + default: + position = 2; + break; } + (g as TccKey).state.position = position; + g.doRepaint(); + } + onFinish() { + const simulationId = useLineStore().simulationId; + const mapId = useLineStore().mapId; + const tccId = useTccStore().tccId; + if (!simulationId || !mapId) return; + /* tccKeyDirOperation({ + simulationId, + mapId, + keyId: g.id, + tccId, + val: (g as TccKey).state.position, + }).catch((err) => { + errorNotify('操作失败', { message: err.origin.response.data.title }); + }); */ } } diff --git a/src/drawApp/tccScene.ts b/src/drawApp/tccScene.ts index c949bfb..c007eb9 100644 --- a/src/drawApp/tccScene.ts +++ b/src/drawApp/tccScene.ts @@ -53,6 +53,17 @@ export function initTccScene(lineApp: IGraphicApp, sceneName: string) { tccScene.on('postdataloaded', () => { handleSubscribe(tccScene); }); + const tccStore = useTccStore(); + tccScene.canvas.onmousedown = () => { + tccStore.canvasMouseDown = true; + }; + tccScene.canvas.onmouseup = () => { + tccStore.canvasMouseDown = false; + }; + lineApp.on('destroy', () => { + tccScene.canvas.onmousedown = null; + tccScene.canvas.onmouseup = null; + }); return tccScene; } diff --git a/src/graphics/tccKey/TccKey.ts b/src/graphics/tccKey/TccKey.ts index a87adbf..8a9a7d3 100644 --- a/src/graphics/tccKey/TccKey.ts +++ b/src/graphics/tccKey/TccKey.ts @@ -66,6 +66,17 @@ export class TccKey extends JlGraphic { this._tccKey.rotation = this.state.position == 0 ? Math.PI / 4 : -Math.PI / 4; } else { + switch (this.state.position) { + case 0: + this._tccKey.rotation = Math.PI / 4; + break; + case 1: + this._tccKey.rotation = -Math.PI / 4; + break; + default: + this._tccKey.rotation = 0; + break; + } this._tccKey.texture = this.tccKeyTextures.tccKnob; this._tccKey.scale.set(0.6); } diff --git a/src/stores/tcc-store.ts b/src/stores/tcc-store.ts index f28f759..1b7c1de 100644 --- a/src/stores/tcc-store.ts +++ b/src/stores/tcc-store.ts @@ -7,6 +7,7 @@ export const useTccStore = defineStore('tcc', { trainControlMapId: 0, tccId: 0, isTccDialogOpen: false, + canvasMouseDown: false, }), actions: { getTccScene() { From 5910740c653f69582abc3787e26ffac504e01ae9 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 2 Apr 2024 11:29:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B4=97=E8=BD=A6=E6=9C=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/CarWashingProperty.vue | 7 + src/drawApp/graphics/CarWashingInteraction.ts | 6 + src/graphics/carWashing/CarWashing.ts | 2 + .../carWashing/CarWashingDrawAssistant.ts | 1 + src/protos/stationLayoutGraphics.ts | 19342 +++++++++------- 5 files changed, 10794 insertions(+), 8564 deletions(-) diff --git a/src/components/draw-app/properties/CarWashingProperty.vue b/src/components/draw-app/properties/CarWashingProperty.vue index cf94636..f4e25b5 100644 --- a/src/components/draw-app/properties/CarWashingProperty.vue +++ b/src/components/draw-app/properties/CarWashingProperty.vue @@ -14,6 +14,13 @@ @blur="onUpdate" label="名称" /> + ; - Platforms?: ReturnType[]; - stations?: ReturnType[]; - train?: ReturnType[]; - signals?: ReturnType[]; - turnouts?: ReturnType[]; - section?: ReturnType[]; - polygons?: ReturnType[]; - trainWindows?: ReturnType[]; - axleCountings?: ReturnType[]; - separators?: ReturnType[]; - sectionLinks?: ReturnType[]; - axleCountingSections?: ReturnType[]; - logicSections?: ReturnType[]; - stopPositions?: ReturnType[]; - spksSwitchs?: ReturnType[]; - esbButtons?: ReturnType[]; - gateBoxs?: ReturnType[]; - transponders?: ReturnType[]; - slopes?: ReturnType[]; - slopeKiloMarker?: ReturnType[]; - curvatureKiloMarker?: ReturnType[]; - curvatures?: ReturnType[]; - trackSections?: ReturnType[]; - trackLogicSections?: ReturnType[]; - UniqueIdPrefix?: ReturnType; - kilometerConvertList?: ReturnType[]; - screenDoors?: ReturnType[]; - stationRelateDeviceList?: ReturnType[]; - sectionCodePointList?: ReturnType[]; - screenDoorConfig?: ReturnType; - beacons?: ReturnType[]; - generateAxleCountingConfig?: ReturnType; - departureTimers?: ReturnType[]; - autoReturnBoxs?: ReturnType[]; - concentrationDividingLines?: ReturnType[]; - otherLineList?: ReturnType[]; - ibpBoxs?: ReturnType[]; - pslBoxs?: ReturnType[]; - carWashings?: ReturnType[]; - garageDoors?: ReturnType[]; - floodGates?: ReturnType[]; - }): RtssGraphicStorage { - const message = new RtssGraphicStorage({}); - if (data.canvas != null) { - message.canvas = Canvas.fromObject(data.canvas); - } - 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.train != null) { - message.train = data.train.map(item => Train.fromObject(item)); - } - if (data.signals != null) { - message.signals = data.signals.map(item => Signal.fromObject(item)); - } - if (data.turnouts != null) { - message.turnouts = data.turnouts.map(item => Turnout.fromObject(item)); - } - 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)); - } - if (data.axleCountings != null) { - message.axleCountings = data.axleCountings.map(item => AxleCounting.fromObject(item)); - } - if (data.separators != null) { - message.separators = data.separators.map(item => Separator.fromObject(item)); - } - if (data.sectionLinks != null) { - message.sectionLinks = data.sectionLinks.map(item => SectionLink.fromObject(item)); - } - if (data.axleCountingSections != null) { - message.axleCountingSections = data.axleCountingSections.map(item => AxleCountingSection.fromObject(item)); - } - if (data.logicSections != null) { - message.logicSections = data.logicSections.map(item => LogicSection.fromObject(item)); - } - if (data.stopPositions != null) { - message.stopPositions = data.stopPositions.map(item => StopPosition.fromObject(item)); - } - if (data.spksSwitchs != null) { - message.spksSwitchs = data.spksSwitchs.map(item => SpksSwitch.fromObject(item)); - } - if (data.esbButtons != null) { - message.esbButtons = data.esbButtons.map(item => EsbButton.fromObject(item)); - } - if (data.gateBoxs != null) { - message.gateBoxs = data.gateBoxs.map(item => GatedBox.fromObject(item)); - } - 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.slopeKiloMarker != null) { - message.slopeKiloMarker = data.slopeKiloMarker.map(item => SlopeKiloMarker.fromObject(item)); - } - if (data.curvatureKiloMarker != null) { - message.curvatureKiloMarker = data.curvatureKiloMarker.map(item => CurvatureKiloMarker.fromObject(item)); - } - if (data.curvatures != null) { - message.curvatures = data.curvatures.map(item => Curvature.fromObject(item)); - } - if (data.trackSections != null) { - message.trackSections = data.trackSections.map(item => TrackSection.fromObject(item)); - } - if (data.trackLogicSections != null) { - message.trackLogicSections = data.trackLogicSections.map(item => TrackLogicSection.fromObject(item)); - } - if (data.UniqueIdPrefix != null) { - message.UniqueIdPrefix = UniqueIdOfStationLayout.fromObject(data.UniqueIdPrefix); - } - if (data.kilometerConvertList != null) { - message.kilometerConvertList = data.kilometerConvertList.map(item => KilometerConvert.fromObject(item)); - } - if (data.screenDoors != null) { - message.screenDoors = data.screenDoors.map(item => ScreenDoor.fromObject(item)); - } - if (data.stationRelateDeviceList != null) { - message.stationRelateDeviceList = data.stationRelateDeviceList.map(item => StationRelateDevice.fromObject(item)); - } - if (data.sectionCodePointList != null) { - message.sectionCodePointList = data.sectionCodePointList.map(item => SectionCodePoint.fromObject(item)); - } - if (data.screenDoorConfig != null) { - message.screenDoorConfig = ScreenDoorConfig.fromObject(data.screenDoorConfig); - } - if (data.beacons != null) { - message.beacons = data.beacons.map(item => Beacon.fromObject(item)); - } - if (data.generateAxleCountingConfig != null) { - message.generateAxleCountingConfig = GenerateAxleCountingConfig.fromObject(data.generateAxleCountingConfig); - } - if (data.departureTimers != null) { - message.departureTimers = data.departureTimers.map(item => DepartureTimer.fromObject(item)); - } - if (data.autoReturnBoxs != null) { - message.autoReturnBoxs = data.autoReturnBoxs.map(item => AutoReturnBox.fromObject(item)); - } - if (data.concentrationDividingLines != null) { - message.concentrationDividingLines = data.concentrationDividingLines.map(item => ConcentrationDividingLine.fromObject(item)); - } - if (data.otherLineList != null) { - message.otherLineList = data.otherLineList.map(item => OtherLine.fromObject(item)); - } - if (data.ibpBoxs != null) { - message.ibpBoxs = data.ibpBoxs.map(item => IbpBox.fromObject(item)); - } - if (data.pslBoxs != null) { - message.pslBoxs = data.pslBoxs.map(item => PslBox.fromObject(item)); - } - if (data.carWashings != null) { - message.carWashings = data.carWashings.map(item => CarWashing.fromObject(item)); - } - if (data.garageDoors != null) { - message.garageDoors = data.garageDoors.map(item => GarageDoor.fromObject(item)); - } - if (data.floodGates != null) { - message.floodGates = data.floodGates.map(item => GarageDoor.fromObject(item)); - } - return message; - } - toObject() { - const data: { - canvas?: ReturnType; - Platforms?: ReturnType[]; - stations?: ReturnType[]; - train?: ReturnType[]; - signals?: ReturnType[]; - turnouts?: ReturnType[]; - section?: ReturnType[]; - polygons?: ReturnType[]; - trainWindows?: ReturnType[]; - axleCountings?: ReturnType[]; - separators?: ReturnType[]; - sectionLinks?: ReturnType[]; - axleCountingSections?: ReturnType[]; - logicSections?: ReturnType[]; - stopPositions?: ReturnType[]; - spksSwitchs?: ReturnType[]; - esbButtons?: ReturnType[]; - gateBoxs?: ReturnType[]; - transponders?: ReturnType[]; - slopes?: ReturnType[]; - slopeKiloMarker?: ReturnType[]; - curvatureKiloMarker?: ReturnType[]; - curvatures?: ReturnType[]; - trackSections?: ReturnType[]; - trackLogicSections?: ReturnType[]; - UniqueIdPrefix?: ReturnType; - kilometerConvertList?: ReturnType[]; - screenDoors?: ReturnType[]; - stationRelateDeviceList?: ReturnType[]; - sectionCodePointList?: ReturnType[]; - screenDoorConfig?: ReturnType; - beacons?: ReturnType[]; - generateAxleCountingConfig?: ReturnType; - departureTimers?: ReturnType[]; - autoReturnBoxs?: ReturnType[]; - concentrationDividingLines?: ReturnType[]; - otherLineList?: ReturnType[]; - ibpBoxs?: ReturnType[]; - pslBoxs?: ReturnType[]; - carWashings?: ReturnType[]; - garageDoors?: ReturnType[]; - floodGates?: ReturnType[]; - } = {}; - if (this.canvas != null) { - data.canvas = this.canvas.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.train != null) { - data.train = this.train.map((item: Train) => item.toObject()); - } - if (this.signals != null) { - data.signals = this.signals.map((item: Signal) => item.toObject()); - } - if (this.turnouts != null) { - data.turnouts = this.turnouts.map((item: Turnout) => item.toObject()); - } - 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()); - } - if (this.axleCountings != null) { - data.axleCountings = this.axleCountings.map((item: AxleCounting) => item.toObject()); - } - if (this.separators != null) { - data.separators = this.separators.map((item: Separator) => item.toObject()); - } - if (this.sectionLinks != null) { - data.sectionLinks = this.sectionLinks.map((item: SectionLink) => item.toObject()); - } - if (this.axleCountingSections != null) { - data.axleCountingSections = this.axleCountingSections.map((item: AxleCountingSection) => item.toObject()); - } - if (this.logicSections != null) { - data.logicSections = this.logicSections.map((item: LogicSection) => item.toObject()); - } - if (this.stopPositions != null) { - data.stopPositions = this.stopPositions.map((item: StopPosition) => item.toObject()); - } - if (this.spksSwitchs != null) { - data.spksSwitchs = this.spksSwitchs.map((item: SpksSwitch) => item.toObject()); - } - if (this.esbButtons != null) { - data.esbButtons = this.esbButtons.map((item: EsbButton) => item.toObject()); - } - if (this.gateBoxs != null) { - data.gateBoxs = this.gateBoxs.map((item: GatedBox) => item.toObject()); - } - 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.slopeKiloMarker != null) { - data.slopeKiloMarker = this.slopeKiloMarker.map((item: SlopeKiloMarker) => item.toObject()); - } - if (this.curvatureKiloMarker != null) { - data.curvatureKiloMarker = this.curvatureKiloMarker.map((item: CurvatureKiloMarker) => item.toObject()); - } - if (this.curvatures != null) { - data.curvatures = this.curvatures.map((item: Curvature) => item.toObject()); - } - if (this.trackSections != null) { - data.trackSections = this.trackSections.map((item: TrackSection) => item.toObject()); - } - if (this.trackLogicSections != null) { - data.trackLogicSections = this.trackLogicSections.map((item: TrackLogicSection) => item.toObject()); - } - if (this.UniqueIdPrefix != null) { - data.UniqueIdPrefix = this.UniqueIdPrefix.toObject(); - } - if (this.kilometerConvertList != null) { - data.kilometerConvertList = this.kilometerConvertList.map((item: KilometerConvert) => item.toObject()); - } - if (this.screenDoors != null) { - data.screenDoors = this.screenDoors.map((item: ScreenDoor) => item.toObject()); - } - if (this.stationRelateDeviceList != null) { - data.stationRelateDeviceList = this.stationRelateDeviceList.map((item: StationRelateDevice) => item.toObject()); - } - if (this.sectionCodePointList != null) { - data.sectionCodePointList = this.sectionCodePointList.map((item: SectionCodePoint) => item.toObject()); - } - if (this.screenDoorConfig != null) { - data.screenDoorConfig = this.screenDoorConfig.toObject(); - } - if (this.beacons != null) { - data.beacons = this.beacons.map((item: Beacon) => item.toObject()); - } - if (this.generateAxleCountingConfig != null) { - data.generateAxleCountingConfig = this.generateAxleCountingConfig.toObject(); - } - if (this.departureTimers != null) { - data.departureTimers = this.departureTimers.map((item: DepartureTimer) => item.toObject()); - } - if (this.autoReturnBoxs != null) { - data.autoReturnBoxs = this.autoReturnBoxs.map((item: AutoReturnBox) => item.toObject()); - } - if (this.concentrationDividingLines != null) { - data.concentrationDividingLines = this.concentrationDividingLines.map((item: ConcentrationDividingLine) => item.toObject()); - } - if (this.otherLineList != null) { - data.otherLineList = this.otherLineList.map((item: OtherLine) => item.toObject()); - } - if (this.ibpBoxs != null) { - data.ibpBoxs = this.ibpBoxs.map((item: IbpBox) => item.toObject()); - } - if (this.pslBoxs != null) { - data.pslBoxs = this.pslBoxs.map((item: PslBox) => item.toObject()); - } - if (this.carWashings != null) { - data.carWashings = this.carWashings.map((item: CarWashing) => item.toObject()); - } - if (this.garageDoors != null) { - data.garageDoors = this.garageDoors.map((item: GarageDoor) => item.toObject()); - } - if (this.floodGates != null) { - data.floodGates = this.floodGates.map((item: GarageDoor) => 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_canvas) - writer.writeMessage(1, this.canvas, () => this.canvas.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.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) - writer.writeRepeatedMessage(13, this.axleCountings, (item: AxleCounting) => item.serialize(writer)); - if (this.separators.length) - writer.writeRepeatedMessage(14, this.separators, (item: Separator) => item.serialize(writer)); - if (this.sectionLinks.length) - writer.writeRepeatedMessage(15, this.sectionLinks, (item: SectionLink) => item.serialize(writer)); - if (this.axleCountingSections.length) - writer.writeRepeatedMessage(16, this.axleCountingSections, (item: AxleCountingSection) => item.serialize(writer)); - if (this.logicSections.length) - writer.writeRepeatedMessage(17, this.logicSections, (item: LogicSection) => item.serialize(writer)); - if (this.stopPositions.length) - writer.writeRepeatedMessage(18, this.stopPositions, (item: StopPosition) => item.serialize(writer)); - if (this.spksSwitchs.length) - writer.writeRepeatedMessage(19, this.spksSwitchs, (item: SpksSwitch) => item.serialize(writer)); - if (this.esbButtons.length) - writer.writeRepeatedMessage(20, this.esbButtons, (item: EsbButton) => item.serialize(writer)); - if (this.gateBoxs.length) - 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.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 (this.curvatures.length) - writer.writeRepeatedMessage(27, this.curvatures, (item: Curvature) => item.serialize(writer)); - if (this.trackSections.length) - writer.writeRepeatedMessage(28, this.trackSections, (item: TrackSection) => item.serialize(writer)); - if (this.trackLogicSections.length) - writer.writeRepeatedMessage(29, this.trackLogicSections, (item: TrackLogicSection) => item.serialize(writer)); - if (this.has_UniqueIdPrefix) - writer.writeMessage(31, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer)); - if (this.kilometerConvertList.length) - writer.writeRepeatedMessage(32, this.kilometerConvertList, (item: KilometerConvert) => item.serialize(writer)); - if (this.screenDoors.length) - writer.writeRepeatedMessage(33, this.screenDoors, (item: ScreenDoor) => item.serialize(writer)); - if (this.stationRelateDeviceList.length) - writer.writeRepeatedMessage(34, this.stationRelateDeviceList, (item: StationRelateDevice) => item.serialize(writer)); - if (this.sectionCodePointList.length) - writer.writeRepeatedMessage(35, this.sectionCodePointList, (item: SectionCodePoint) => item.serialize(writer)); - if (this.has_screenDoorConfig) - writer.writeMessage(36, this.screenDoorConfig, () => this.screenDoorConfig.serialize(writer)); - if (this.beacons.length) - writer.writeRepeatedMessage(37, this.beacons, (item: Beacon) => item.serialize(writer)); - if (this.has_generateAxleCountingConfig) - writer.writeMessage(38, this.generateAxleCountingConfig, () => this.generateAxleCountingConfig.serialize(writer)); - if (this.departureTimers.length) - writer.writeRepeatedMessage(39, this.departureTimers, (item: DepartureTimer) => item.serialize(writer)); - if (this.autoReturnBoxs.length) - writer.writeRepeatedMessage(40, this.autoReturnBoxs, (item: AutoReturnBox) => item.serialize(writer)); - if (this.concentrationDividingLines.length) - writer.writeRepeatedMessage(41, this.concentrationDividingLines, (item: ConcentrationDividingLine) => item.serialize(writer)); - if (this.otherLineList.length) - writer.writeRepeatedMessage(42, this.otherLineList, (item: OtherLine) => item.serialize(writer)); - if (this.ibpBoxs.length) - writer.writeRepeatedMessage(43, this.ibpBoxs, (item: IbpBox) => item.serialize(writer)); - if (this.pslBoxs.length) - writer.writeRepeatedMessage(44, this.pslBoxs, (item: PslBox) => item.serialize(writer)); - if (this.carWashings.length) - writer.writeRepeatedMessage(45, this.carWashings, (item: CarWashing) => item.serialize(writer)); - if (this.garageDoors.length) - writer.writeRepeatedMessage(46, this.garageDoors, (item: GarageDoor) => item.serialize(writer)); - if (this.floodGates.length) - writer.writeRepeatedMessage(47, this.floodGates, (item: GarageDoor) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RtssGraphicStorage { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RtssGraphicStorage(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.canvas, () => message.canvas = Canvas.deserialize(reader)); - 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 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; - case 9: - reader.readMessage(message.turnouts, () => pb_1.Message.addToRepeatedWrapperField(message, 9, Turnout.deserialize(reader), Turnout)); - break; - 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; - case 13: - reader.readMessage(message.axleCountings, () => pb_1.Message.addToRepeatedWrapperField(message, 13, AxleCounting.deserialize(reader), AxleCounting)); - break; - case 14: - reader.readMessage(message.separators, () => pb_1.Message.addToRepeatedWrapperField(message, 14, Separator.deserialize(reader), Separator)); - break; - case 15: - reader.readMessage(message.sectionLinks, () => pb_1.Message.addToRepeatedWrapperField(message, 15, SectionLink.deserialize(reader), SectionLink)); - break; - case 16: - reader.readMessage(message.axleCountingSections, () => pb_1.Message.addToRepeatedWrapperField(message, 16, AxleCountingSection.deserialize(reader), AxleCountingSection)); - break; - case 17: - reader.readMessage(message.logicSections, () => pb_1.Message.addToRepeatedWrapperField(message, 17, LogicSection.deserialize(reader), LogicSection)); - break; - case 18: - reader.readMessage(message.stopPositions, () => pb_1.Message.addToRepeatedWrapperField(message, 18, StopPosition.deserialize(reader), StopPosition)); - break; - case 19: - reader.readMessage(message.spksSwitchs, () => pb_1.Message.addToRepeatedWrapperField(message, 19, SpksSwitch.deserialize(reader), SpksSwitch)); - break; - case 20: - reader.readMessage(message.esbButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 20, EsbButton.deserialize(reader), EsbButton)); - break; - case 21: - reader.readMessage(message.gateBoxs, () => pb_1.Message.addToRepeatedWrapperField(message, 21, GatedBox.deserialize(reader), GatedBox)); - break; - 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 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; - case 27: - reader.readMessage(message.curvatures, () => pb_1.Message.addToRepeatedWrapperField(message, 27, Curvature.deserialize(reader), Curvature)); - break; - case 28: - reader.readMessage(message.trackSections, () => pb_1.Message.addToRepeatedWrapperField(message, 28, TrackSection.deserialize(reader), TrackSection)); - break; - case 29: - reader.readMessage(message.trackLogicSections, () => pb_1.Message.addToRepeatedWrapperField(message, 29, TrackLogicSection.deserialize(reader), TrackLogicSection)); - break; - case 31: - reader.readMessage(message.UniqueIdPrefix, () => message.UniqueIdPrefix = UniqueIdOfStationLayout.deserialize(reader)); - break; - case 32: - reader.readMessage(message.kilometerConvertList, () => pb_1.Message.addToRepeatedWrapperField(message, 32, KilometerConvert.deserialize(reader), KilometerConvert)); - break; - case 33: - reader.readMessage(message.screenDoors, () => pb_1.Message.addToRepeatedWrapperField(message, 33, ScreenDoor.deserialize(reader), ScreenDoor)); - break; - case 34: - reader.readMessage(message.stationRelateDeviceList, () => pb_1.Message.addToRepeatedWrapperField(message, 34, StationRelateDevice.deserialize(reader), StationRelateDevice)); - break; - case 35: - reader.readMessage(message.sectionCodePointList, () => pb_1.Message.addToRepeatedWrapperField(message, 35, SectionCodePoint.deserialize(reader), SectionCodePoint)); - break; - case 36: - reader.readMessage(message.screenDoorConfig, () => message.screenDoorConfig = ScreenDoorConfig.deserialize(reader)); - break; - case 37: - reader.readMessage(message.beacons, () => pb_1.Message.addToRepeatedWrapperField(message, 37, Beacon.deserialize(reader), Beacon)); - break; - case 38: - reader.readMessage(message.generateAxleCountingConfig, () => message.generateAxleCountingConfig = GenerateAxleCountingConfig.deserialize(reader)); - break; - case 39: - reader.readMessage(message.departureTimers, () => pb_1.Message.addToRepeatedWrapperField(message, 39, DepartureTimer.deserialize(reader), DepartureTimer)); - break; - case 40: - reader.readMessage(message.autoReturnBoxs, () => pb_1.Message.addToRepeatedWrapperField(message, 40, AutoReturnBox.deserialize(reader), AutoReturnBox)); - break; - case 41: - reader.readMessage(message.concentrationDividingLines, () => pb_1.Message.addToRepeatedWrapperField(message, 41, ConcentrationDividingLine.deserialize(reader), ConcentrationDividingLine)); - break; - case 42: - reader.readMessage(message.otherLineList, () => pb_1.Message.addToRepeatedWrapperField(message, 42, OtherLine.deserialize(reader), OtherLine)); - break; - case 43: - reader.readMessage(message.ibpBoxs, () => pb_1.Message.addToRepeatedWrapperField(message, 43, IbpBox.deserialize(reader), IbpBox)); - break; - case 44: - reader.readMessage(message.pslBoxs, () => pb_1.Message.addToRepeatedWrapperField(message, 44, PslBox.deserialize(reader), PslBox)); - break; - case 45: - reader.readMessage(message.carWashings, () => pb_1.Message.addToRepeatedWrapperField(message, 45, CarWashing.deserialize(reader), CarWashing)); - break; - case 46: - reader.readMessage(message.garageDoors, () => pb_1.Message.addToRepeatedWrapperField(message, 46, GarageDoor.deserialize(reader), GarageDoor)); - break; - case 47: - reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 47, GarageDoor.deserialize(reader), GarageDoor)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): RtssGraphicStorage { - return RtssGraphicStorage.deserialize(bytes); + if ('floodGates' in data && data.floodGates != undefined) { + this.floodGates = data.floodGates; } + } } - export class Canvas extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get canvas() { + return pb_1.Message.getWrapperField(this, Canvas, 1) as Canvas; + } + set canvas(value: Canvas) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_canvas() { + return pb_1.Message.getField(this, 1) != null; + } + get Platforms() { + return pb_1.Message.getRepeatedWrapperField( + this, + Platform, + 4 + ) as Platform[]; + } + set Platforms(value: Platform[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get stations() { + return pb_1.Message.getRepeatedWrapperField( + this, + Station, + 5 + ) as Station[]; + } + set stations(value: Station[]) { + pb_1.Message.setRepeatedWrapperField(this, 5, 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[]; + } + set signals(value: Signal[]) { + pb_1.Message.setRepeatedWrapperField(this, 8, value); + } + get turnouts() { + return pb_1.Message.getRepeatedWrapperField( + this, + Turnout, + 9 + ) as Turnout[]; + } + set turnouts(value: Turnout[]) { + pb_1.Message.setRepeatedWrapperField(this, 9, value); + } + get section() { + return pb_1.Message.getRepeatedWrapperField( + this, + Section, + 10 + ) as Section[]; + } + 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[]; + } + set trainWindows(value: TrainWindow[]) { + pb_1.Message.setRepeatedWrapperField(this, 12, value); + } + get axleCountings() { + return pb_1.Message.getRepeatedWrapperField( + this, + AxleCounting, + 13 + ) as AxleCounting[]; + } + set axleCountings(value: AxleCounting[]) { + pb_1.Message.setRepeatedWrapperField(this, 13, value); + } + get separators() { + return pb_1.Message.getRepeatedWrapperField( + this, + Separator, + 14 + ) as Separator[]; + } + set separators(value: Separator[]) { + pb_1.Message.setRepeatedWrapperField(this, 14, value); + } + get sectionLinks() { + return pb_1.Message.getRepeatedWrapperField( + this, + SectionLink, + 15 + ) as SectionLink[]; + } + set sectionLinks(value: SectionLink[]) { + pb_1.Message.setRepeatedWrapperField(this, 15, value); + } + get axleCountingSections() { + return pb_1.Message.getRepeatedWrapperField( + this, + AxleCountingSection, + 16 + ) as AxleCountingSection[]; + } + set axleCountingSections(value: AxleCountingSection[]) { + pb_1.Message.setRepeatedWrapperField(this, 16, value); + } + get logicSections() { + return pb_1.Message.getRepeatedWrapperField( + this, + LogicSection, + 17 + ) as LogicSection[]; + } + set logicSections(value: LogicSection[]) { + pb_1.Message.setRepeatedWrapperField(this, 17, value); + } + get stopPositions() { + return pb_1.Message.getRepeatedWrapperField( + this, + StopPosition, + 18 + ) as StopPosition[]; + } + set stopPositions(value: StopPosition[]) { + pb_1.Message.setRepeatedWrapperField(this, 18, value); + } + get spksSwitchs() { + return pb_1.Message.getRepeatedWrapperField( + this, + SpksSwitch, + 19 + ) as SpksSwitch[]; + } + set spksSwitchs(value: SpksSwitch[]) { + pb_1.Message.setRepeatedWrapperField(this, 19, value); + } + get esbButtons() { + return pb_1.Message.getRepeatedWrapperField( + this, + EsbButton, + 20 + ) as EsbButton[]; + } + set esbButtons(value: EsbButton[]) { + pb_1.Message.setRepeatedWrapperField(this, 20, value); + } + get gateBoxs() { + return pb_1.Message.getRepeatedWrapperField( + this, + GatedBox, + 21 + ) as GatedBox[]; + } + set gateBoxs(value: GatedBox[]) { + pb_1.Message.setRepeatedWrapperField(this, 21, value); + } + get transponders() { + return pb_1.Message.getRepeatedWrapperField( + this, + Transponder, + 22 + ) as Transponder[]; + } + 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 slopeKiloMarker() { + return pb_1.Message.getRepeatedWrapperField( + this, + SlopeKiloMarker, + 25 + ) as SlopeKiloMarker[]; + } + 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); + } + get curvatures() { + return pb_1.Message.getRepeatedWrapperField( + this, + Curvature, + 27 + ) as Curvature[]; + } + set curvatures(value: Curvature[]) { + pb_1.Message.setRepeatedWrapperField(this, 27, value); + } + get trackSections() { + return pb_1.Message.getRepeatedWrapperField( + this, + TrackSection, + 28 + ) as TrackSection[]; + } + set trackSections(value: TrackSection[]) { + pb_1.Message.setRepeatedWrapperField(this, 28, value); + } + get trackLogicSections() { + return pb_1.Message.getRepeatedWrapperField( + this, + TrackLogicSection, + 29 + ) as TrackLogicSection[]; + } + set trackLogicSections(value: TrackLogicSection[]) { + pb_1.Message.setRepeatedWrapperField(this, 29, value); + } + get UniqueIdPrefix() { + return pb_1.Message.getWrapperField( + this, + UniqueIdOfStationLayout, + 31 + ) as UniqueIdOfStationLayout; + } + set UniqueIdPrefix(value: UniqueIdOfStationLayout) { + pb_1.Message.setWrapperField(this, 31, value); + } + get has_UniqueIdPrefix() { + return pb_1.Message.getField(this, 31) != null; + } + get kilometerConvertList() { + return pb_1.Message.getRepeatedWrapperField( + this, + KilometerConvert, + 32 + ) as KilometerConvert[]; + } + set kilometerConvertList(value: KilometerConvert[]) { + pb_1.Message.setRepeatedWrapperField(this, 32, value); + } + get screenDoors() { + return pb_1.Message.getRepeatedWrapperField( + this, + ScreenDoor, + 33 + ) as ScreenDoor[]; + } + set screenDoors(value: ScreenDoor[]) { + pb_1.Message.setRepeatedWrapperField(this, 33, value); + } + get stationRelateDeviceList() { + return pb_1.Message.getRepeatedWrapperField( + this, + StationRelateDevice, + 34 + ) as StationRelateDevice[]; + } + set stationRelateDeviceList(value: StationRelateDevice[]) { + pb_1.Message.setRepeatedWrapperField(this, 34, value); + } + get sectionCodePointList() { + return pb_1.Message.getRepeatedWrapperField( + this, + SectionCodePoint, + 35 + ) as SectionCodePoint[]; + } + set sectionCodePointList(value: SectionCodePoint[]) { + pb_1.Message.setRepeatedWrapperField(this, 35, value); + } + get screenDoorConfig() { + return pb_1.Message.getWrapperField( + this, + ScreenDoorConfig, + 36 + ) as ScreenDoorConfig; + } + set screenDoorConfig(value: ScreenDoorConfig) { + pb_1.Message.setWrapperField(this, 36, value); + } + get has_screenDoorConfig() { + return pb_1.Message.getField(this, 36) != null; + } + get beacons() { + return pb_1.Message.getRepeatedWrapperField(this, Beacon, 37) as Beacon[]; + } + set beacons(value: Beacon[]) { + pb_1.Message.setRepeatedWrapperField(this, 37, value); + } + get generateAxleCountingConfig() { + return pb_1.Message.getWrapperField( + this, + GenerateAxleCountingConfig, + 38 + ) as GenerateAxleCountingConfig; + } + set generateAxleCountingConfig(value: GenerateAxleCountingConfig) { + pb_1.Message.setWrapperField(this, 38, value); + } + get has_generateAxleCountingConfig() { + return pb_1.Message.getField(this, 38) != null; + } + get departureTimers() { + return pb_1.Message.getRepeatedWrapperField( + this, + DepartureTimer, + 39 + ) as DepartureTimer[]; + } + set departureTimers(value: DepartureTimer[]) { + pb_1.Message.setRepeatedWrapperField(this, 39, value); + } + get autoReturnBoxs() { + return pb_1.Message.getRepeatedWrapperField( + this, + AutoReturnBox, + 40 + ) as AutoReturnBox[]; + } + set autoReturnBoxs(value: AutoReturnBox[]) { + pb_1.Message.setRepeatedWrapperField(this, 40, value); + } + get concentrationDividingLines() { + return pb_1.Message.getRepeatedWrapperField( + this, + ConcentrationDividingLine, + 41 + ) as ConcentrationDividingLine[]; + } + set concentrationDividingLines(value: ConcentrationDividingLine[]) { + pb_1.Message.setRepeatedWrapperField(this, 41, value); + } + get otherLineList() { + return pb_1.Message.getRepeatedWrapperField( + this, + OtherLine, + 42 + ) as OtherLine[]; + } + set otherLineList(value: OtherLine[]) { + pb_1.Message.setRepeatedWrapperField(this, 42, value); + } + get ibpBoxs() { + return pb_1.Message.getRepeatedWrapperField(this, IbpBox, 43) as IbpBox[]; + } + set ibpBoxs(value: IbpBox[]) { + pb_1.Message.setRepeatedWrapperField(this, 43, value); + } + get pslBoxs() { + return pb_1.Message.getRepeatedWrapperField(this, PslBox, 44) as PslBox[]; + } + set pslBoxs(value: PslBox[]) { + pb_1.Message.setRepeatedWrapperField(this, 44, value); + } + get carWashings() { + return pb_1.Message.getRepeatedWrapperField( + this, + CarWashing, + 45 + ) as CarWashing[]; + } + set carWashings(value: CarWashing[]) { + pb_1.Message.setRepeatedWrapperField(this, 45, value); + } + get garageDoors() { + return pb_1.Message.getRepeatedWrapperField( + this, + GarageDoor, + 46 + ) as GarageDoor[]; + } + set garageDoors(value: GarageDoor[]) { + pb_1.Message.setRepeatedWrapperField(this, 46, value); + } + get floodGates() { + return pb_1.Message.getRepeatedWrapperField( + this, + GarageDoor, + 47 + ) as GarageDoor[]; + } + set floodGates(value: GarageDoor[]) { + pb_1.Message.setRepeatedWrapperField(this, 47, value); + } + static fromObject(data: { + canvas?: ReturnType; + Platforms?: ReturnType[]; + stations?: ReturnType[]; + train?: ReturnType[]; + signals?: ReturnType[]; + turnouts?: ReturnType[]; + section?: ReturnType[]; + polygons?: ReturnType[]; + trainWindows?: ReturnType[]; + axleCountings?: ReturnType[]; + separators?: ReturnType[]; + sectionLinks?: ReturnType[]; + axleCountingSections?: ReturnType< + typeof AxleCountingSection.prototype.toObject + >[]; + logicSections?: ReturnType[]; + stopPositions?: ReturnType[]; + spksSwitchs?: ReturnType[]; + esbButtons?: ReturnType[]; + gateBoxs?: ReturnType[]; + transponders?: ReturnType[]; + slopes?: ReturnType[]; + slopeKiloMarker?: ReturnType[]; + curvatureKiloMarker?: ReturnType< + typeof CurvatureKiloMarker.prototype.toObject + >[]; + curvatures?: ReturnType[]; + trackSections?: ReturnType[]; + trackLogicSections?: ReturnType< + typeof TrackLogicSection.prototype.toObject + >[]; + UniqueIdPrefix?: ReturnType< + typeof UniqueIdOfStationLayout.prototype.toObject + >; + kilometerConvertList?: ReturnType< + typeof KilometerConvert.prototype.toObject + >[]; + screenDoors?: ReturnType[]; + stationRelateDeviceList?: ReturnType< + typeof StationRelateDevice.prototype.toObject + >[]; + sectionCodePointList?: ReturnType< + typeof SectionCodePoint.prototype.toObject + >[]; + screenDoorConfig?: ReturnType; + beacons?: ReturnType[]; + generateAxleCountingConfig?: ReturnType< + typeof GenerateAxleCountingConfig.prototype.toObject + >; + departureTimers?: ReturnType[]; + autoReturnBoxs?: ReturnType[]; + concentrationDividingLines?: ReturnType< + typeof ConcentrationDividingLine.prototype.toObject + >[]; + otherLineList?: ReturnType[]; + ibpBoxs?: ReturnType[]; + pslBoxs?: ReturnType[]; + carWashings?: ReturnType[]; + garageDoors?: ReturnType[]; + floodGates?: ReturnType[]; + }): RtssGraphicStorage { + const message = new RtssGraphicStorage({}); + if (data.canvas != null) { + message.canvas = Canvas.fromObject(data.canvas); + } + 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.train != null) { + message.train = data.train.map((item) => Train.fromObject(item)); + } + if (data.signals != null) { + message.signals = data.signals.map((item) => Signal.fromObject(item)); + } + if (data.turnouts != null) { + message.turnouts = data.turnouts.map((item) => + Turnout.fromObject(item) + ); + } + 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) + ); + } + if (data.axleCountings != null) { + message.axleCountings = data.axleCountings.map((item) => + AxleCounting.fromObject(item) + ); + } + if (data.separators != null) { + message.separators = data.separators.map((item) => + Separator.fromObject(item) + ); + } + if (data.sectionLinks != null) { + message.sectionLinks = data.sectionLinks.map((item) => + SectionLink.fromObject(item) + ); + } + if (data.axleCountingSections != null) { + message.axleCountingSections = data.axleCountingSections.map((item) => + AxleCountingSection.fromObject(item) + ); + } + if (data.logicSections != null) { + message.logicSections = data.logicSections.map((item) => + LogicSection.fromObject(item) + ); + } + if (data.stopPositions != null) { + message.stopPositions = data.stopPositions.map((item) => + StopPosition.fromObject(item) + ); + } + if (data.spksSwitchs != null) { + message.spksSwitchs = data.spksSwitchs.map((item) => + SpksSwitch.fromObject(item) + ); + } + if (data.esbButtons != null) { + message.esbButtons = data.esbButtons.map((item) => + EsbButton.fromObject(item) + ); + } + if (data.gateBoxs != null) { + message.gateBoxs = data.gateBoxs.map((item) => + GatedBox.fromObject(item) + ); + } + 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.slopeKiloMarker != null) { + message.slopeKiloMarker = data.slopeKiloMarker.map((item) => + SlopeKiloMarker.fromObject(item) + ); + } + if (data.curvatureKiloMarker != null) { + message.curvatureKiloMarker = data.curvatureKiloMarker.map((item) => + CurvatureKiloMarker.fromObject(item) + ); + } + if (data.curvatures != null) { + message.curvatures = data.curvatures.map((item) => + Curvature.fromObject(item) + ); + } + if (data.trackSections != null) { + message.trackSections = data.trackSections.map((item) => + TrackSection.fromObject(item) + ); + } + if (data.trackLogicSections != null) { + message.trackLogicSections = data.trackLogicSections.map((item) => + TrackLogicSection.fromObject(item) + ); + } + if (data.UniqueIdPrefix != null) { + message.UniqueIdPrefix = UniqueIdOfStationLayout.fromObject( + data.UniqueIdPrefix + ); + } + if (data.kilometerConvertList != null) { + message.kilometerConvertList = data.kilometerConvertList.map((item) => + KilometerConvert.fromObject(item) + ); + } + if (data.screenDoors != null) { + message.screenDoors = data.screenDoors.map((item) => + ScreenDoor.fromObject(item) + ); + } + if (data.stationRelateDeviceList != null) { + message.stationRelateDeviceList = data.stationRelateDeviceList.map( + (item) => StationRelateDevice.fromObject(item) + ); + } + if (data.sectionCodePointList != null) { + message.sectionCodePointList = data.sectionCodePointList.map((item) => + SectionCodePoint.fromObject(item) + ); + } + if (data.screenDoorConfig != null) { + message.screenDoorConfig = ScreenDoorConfig.fromObject( + data.screenDoorConfig + ); + } + if (data.beacons != null) { + message.beacons = data.beacons.map((item) => Beacon.fromObject(item)); + } + if (data.generateAxleCountingConfig != null) { + message.generateAxleCountingConfig = + GenerateAxleCountingConfig.fromObject( + data.generateAxleCountingConfig + ); + } + if (data.departureTimers != null) { + message.departureTimers = data.departureTimers.map((item) => + DepartureTimer.fromObject(item) + ); + } + if (data.autoReturnBoxs != null) { + message.autoReturnBoxs = data.autoReturnBoxs.map((item) => + AutoReturnBox.fromObject(item) + ); + } + if (data.concentrationDividingLines != null) { + message.concentrationDividingLines = + data.concentrationDividingLines.map((item) => + ConcentrationDividingLine.fromObject(item) + ); + } + if (data.otherLineList != null) { + message.otherLineList = data.otherLineList.map((item) => + OtherLine.fromObject(item) + ); + } + if (data.ibpBoxs != null) { + message.ibpBoxs = data.ibpBoxs.map((item) => IbpBox.fromObject(item)); + } + if (data.pslBoxs != null) { + message.pslBoxs = data.pslBoxs.map((item) => PslBox.fromObject(item)); + } + if (data.carWashings != null) { + message.carWashings = data.carWashings.map((item) => + CarWashing.fromObject(item) + ); + } + if (data.garageDoors != null) { + message.garageDoors = data.garageDoors.map((item) => + GarageDoor.fromObject(item) + ); + } + if (data.floodGates != null) { + message.floodGates = data.floodGates.map((item) => + GarageDoor.fromObject(item) + ); + } + return message; + } + toObject() { + const data: { + canvas?: ReturnType; + Platforms?: ReturnType[]; + stations?: ReturnType[]; + train?: ReturnType[]; + signals?: ReturnType[]; + turnouts?: ReturnType[]; + section?: ReturnType[]; + polygons?: ReturnType[]; + trainWindows?: ReturnType[]; + axleCountings?: ReturnType[]; + separators?: ReturnType[]; + sectionLinks?: ReturnType[]; + axleCountingSections?: ReturnType< + typeof AxleCountingSection.prototype.toObject + >[]; + logicSections?: ReturnType[]; + stopPositions?: ReturnType[]; + spksSwitchs?: ReturnType[]; + esbButtons?: ReturnType[]; + gateBoxs?: ReturnType[]; + transponders?: ReturnType[]; + slopes?: ReturnType[]; + slopeKiloMarker?: ReturnType< + typeof SlopeKiloMarker.prototype.toObject + >[]; + curvatureKiloMarker?: ReturnType< + typeof CurvatureKiloMarker.prototype.toObject + >[]; + curvatures?: ReturnType[]; + trackSections?: ReturnType[]; + trackLogicSections?: ReturnType< + typeof TrackLogicSection.prototype.toObject + >[]; + UniqueIdPrefix?: ReturnType< + typeof UniqueIdOfStationLayout.prototype.toObject + >; + kilometerConvertList?: ReturnType< + typeof KilometerConvert.prototype.toObject + >[]; + screenDoors?: ReturnType[]; + stationRelateDeviceList?: ReturnType< + typeof StationRelateDevice.prototype.toObject + >[]; + sectionCodePointList?: ReturnType< + typeof SectionCodePoint.prototype.toObject + >[]; + screenDoorConfig?: ReturnType< + typeof ScreenDoorConfig.prototype.toObject + >; + beacons?: ReturnType[]; + generateAxleCountingConfig?: ReturnType< + typeof GenerateAxleCountingConfig.prototype.toObject + >; + departureTimers?: ReturnType< + typeof DepartureTimer.prototype.toObject + >[]; + autoReturnBoxs?: ReturnType[]; + concentrationDividingLines?: ReturnType< + typeof ConcentrationDividingLine.prototype.toObject + >[]; + otherLineList?: ReturnType[]; + ibpBoxs?: ReturnType[]; + pslBoxs?: ReturnType[]; + carWashings?: ReturnType[]; + garageDoors?: ReturnType[]; + floodGates?: ReturnType[]; + } = {}; + if (this.canvas != null) { + data.canvas = this.canvas.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.train != null) { + data.train = this.train.map((item: Train) => item.toObject()); + } + if (this.signals != null) { + data.signals = this.signals.map((item: Signal) => item.toObject()); + } + if (this.turnouts != null) { + data.turnouts = this.turnouts.map((item: Turnout) => item.toObject()); + } + 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() + ); + } + if (this.axleCountings != null) { + data.axleCountings = this.axleCountings.map((item: AxleCounting) => + item.toObject() + ); + } + if (this.separators != null) { + data.separators = this.separators.map((item: Separator) => + item.toObject() + ); + } + if (this.sectionLinks != null) { + data.sectionLinks = this.sectionLinks.map((item: SectionLink) => + item.toObject() + ); + } + if (this.axleCountingSections != null) { + data.axleCountingSections = this.axleCountingSections.map( + (item: AxleCountingSection) => item.toObject() + ); + } + if (this.logicSections != null) { + data.logicSections = this.logicSections.map((item: LogicSection) => + item.toObject() + ); + } + if (this.stopPositions != null) { + data.stopPositions = this.stopPositions.map((item: StopPosition) => + item.toObject() + ); + } + if (this.spksSwitchs != null) { + data.spksSwitchs = this.spksSwitchs.map((item: SpksSwitch) => + item.toObject() + ); + } + if (this.esbButtons != null) { + data.esbButtons = this.esbButtons.map((item: EsbButton) => + item.toObject() + ); + } + if (this.gateBoxs != null) { + data.gateBoxs = this.gateBoxs.map((item: GatedBox) => item.toObject()); + } + 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.slopeKiloMarker != null) { + data.slopeKiloMarker = this.slopeKiloMarker.map( + (item: SlopeKiloMarker) => item.toObject() + ); + } + if (this.curvatureKiloMarker != null) { + data.curvatureKiloMarker = this.curvatureKiloMarker.map( + (item: CurvatureKiloMarker) => item.toObject() + ); + } + if (this.curvatures != null) { + data.curvatures = this.curvatures.map((item: Curvature) => + item.toObject() + ); + } + if (this.trackSections != null) { + data.trackSections = this.trackSections.map((item: TrackSection) => + item.toObject() + ); + } + if (this.trackLogicSections != null) { + data.trackLogicSections = this.trackLogicSections.map( + (item: TrackLogicSection) => item.toObject() + ); + } + if (this.UniqueIdPrefix != null) { + data.UniqueIdPrefix = this.UniqueIdPrefix.toObject(); + } + if (this.kilometerConvertList != null) { + data.kilometerConvertList = this.kilometerConvertList.map( + (item: KilometerConvert) => item.toObject() + ); + } + if (this.screenDoors != null) { + data.screenDoors = this.screenDoors.map((item: ScreenDoor) => + item.toObject() + ); + } + if (this.stationRelateDeviceList != null) { + data.stationRelateDeviceList = this.stationRelateDeviceList.map( + (item: StationRelateDevice) => item.toObject() + ); + } + if (this.sectionCodePointList != null) { + data.sectionCodePointList = this.sectionCodePointList.map( + (item: SectionCodePoint) => item.toObject() + ); + } + if (this.screenDoorConfig != null) { + data.screenDoorConfig = this.screenDoorConfig.toObject(); + } + if (this.beacons != null) { + data.beacons = this.beacons.map((item: Beacon) => item.toObject()); + } + if (this.generateAxleCountingConfig != null) { + data.generateAxleCountingConfig = + this.generateAxleCountingConfig.toObject(); + } + if (this.departureTimers != null) { + data.departureTimers = this.departureTimers.map( + (item: DepartureTimer) => item.toObject() + ); + } + if (this.autoReturnBoxs != null) { + data.autoReturnBoxs = this.autoReturnBoxs.map((item: AutoReturnBox) => + item.toObject() + ); + } + if (this.concentrationDividingLines != null) { + data.concentrationDividingLines = this.concentrationDividingLines.map( + (item: ConcentrationDividingLine) => item.toObject() + ); + } + if (this.otherLineList != null) { + data.otherLineList = this.otherLineList.map((item: OtherLine) => + item.toObject() + ); + } + if (this.ibpBoxs != null) { + data.ibpBoxs = this.ibpBoxs.map((item: IbpBox) => item.toObject()); + } + if (this.pslBoxs != null) { + data.pslBoxs = this.pslBoxs.map((item: PslBox) => item.toObject()); + } + if (this.carWashings != null) { + data.carWashings = this.carWashings.map((item: CarWashing) => + item.toObject() + ); + } + if (this.garageDoors != null) { + data.garageDoors = this.garageDoors.map((item: GarageDoor) => + item.toObject() + ); + } + if (this.floodGates != null) { + data.floodGates = this.floodGates.map((item: GarageDoor) => + 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_canvas) + writer.writeMessage(1, this.canvas, () => + this.canvas.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.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) + writer.writeRepeatedMessage( + 13, + this.axleCountings, + (item: AxleCounting) => item.serialize(writer) + ); + if (this.separators.length) + writer.writeRepeatedMessage(14, this.separators, (item: Separator) => + item.serialize(writer) + ); + if (this.sectionLinks.length) + writer.writeRepeatedMessage( + 15, + this.sectionLinks, + (item: SectionLink) => item.serialize(writer) + ); + if (this.axleCountingSections.length) + writer.writeRepeatedMessage( + 16, + this.axleCountingSections, + (item: AxleCountingSection) => item.serialize(writer) + ); + if (this.logicSections.length) + writer.writeRepeatedMessage( + 17, + this.logicSections, + (item: LogicSection) => item.serialize(writer) + ); + if (this.stopPositions.length) + writer.writeRepeatedMessage( + 18, + this.stopPositions, + (item: StopPosition) => item.serialize(writer) + ); + if (this.spksSwitchs.length) + writer.writeRepeatedMessage(19, this.spksSwitchs, (item: SpksSwitch) => + item.serialize(writer) + ); + if (this.esbButtons.length) + writer.writeRepeatedMessage(20, this.esbButtons, (item: EsbButton) => + item.serialize(writer) + ); + if (this.gateBoxs.length) + 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.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 (this.curvatures.length) + writer.writeRepeatedMessage(27, this.curvatures, (item: Curvature) => + item.serialize(writer) + ); + if (this.trackSections.length) + writer.writeRepeatedMessage( + 28, + this.trackSections, + (item: TrackSection) => item.serialize(writer) + ); + if (this.trackLogicSections.length) + writer.writeRepeatedMessage( + 29, + this.trackLogicSections, + (item: TrackLogicSection) => item.serialize(writer) + ); + if (this.has_UniqueIdPrefix) + writer.writeMessage(31, this.UniqueIdPrefix, () => + this.UniqueIdPrefix.serialize(writer) + ); + if (this.kilometerConvertList.length) + writer.writeRepeatedMessage( + 32, + this.kilometerConvertList, + (item: KilometerConvert) => item.serialize(writer) + ); + if (this.screenDoors.length) + writer.writeRepeatedMessage(33, this.screenDoors, (item: ScreenDoor) => + item.serialize(writer) + ); + if (this.stationRelateDeviceList.length) + writer.writeRepeatedMessage( + 34, + this.stationRelateDeviceList, + (item: StationRelateDevice) => item.serialize(writer) + ); + if (this.sectionCodePointList.length) + writer.writeRepeatedMessage( + 35, + this.sectionCodePointList, + (item: SectionCodePoint) => item.serialize(writer) + ); + if (this.has_screenDoorConfig) + writer.writeMessage(36, this.screenDoorConfig, () => + this.screenDoorConfig.serialize(writer) + ); + if (this.beacons.length) + writer.writeRepeatedMessage(37, this.beacons, (item: Beacon) => + item.serialize(writer) + ); + if (this.has_generateAxleCountingConfig) + writer.writeMessage(38, this.generateAxleCountingConfig, () => + this.generateAxleCountingConfig.serialize(writer) + ); + if (this.departureTimers.length) + writer.writeRepeatedMessage( + 39, + this.departureTimers, + (item: DepartureTimer) => item.serialize(writer) + ); + if (this.autoReturnBoxs.length) + writer.writeRepeatedMessage( + 40, + this.autoReturnBoxs, + (item: AutoReturnBox) => item.serialize(writer) + ); + if (this.concentrationDividingLines.length) + writer.writeRepeatedMessage( + 41, + this.concentrationDividingLines, + (item: ConcentrationDividingLine) => item.serialize(writer) + ); + if (this.otherLineList.length) + writer.writeRepeatedMessage(42, this.otherLineList, (item: OtherLine) => + item.serialize(writer) + ); + if (this.ibpBoxs.length) + writer.writeRepeatedMessage(43, this.ibpBoxs, (item: IbpBox) => + item.serialize(writer) + ); + if (this.pslBoxs.length) + writer.writeRepeatedMessage(44, this.pslBoxs, (item: PslBox) => + item.serialize(writer) + ); + if (this.carWashings.length) + writer.writeRepeatedMessage(45, this.carWashings, (item: CarWashing) => + item.serialize(writer) + ); + if (this.garageDoors.length) + writer.writeRepeatedMessage(46, this.garageDoors, (item: GarageDoor) => + item.serialize(writer) + ); + if (this.floodGates.length) + writer.writeRepeatedMessage(47, this.floodGates, (item: GarageDoor) => + item.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): RtssGraphicStorage { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new RtssGraphicStorage(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.canvas, + () => (message.canvas = Canvas.deserialize(reader)) + ); + 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 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; + case 9: + reader.readMessage(message.turnouts, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 9, + Turnout.deserialize(reader), + Turnout + ) + ); + break; + 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; + case 13: + reader.readMessage(message.axleCountings, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 13, + AxleCounting.deserialize(reader), + AxleCounting + ) + ); + break; + case 14: + reader.readMessage(message.separators, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 14, + Separator.deserialize(reader), + Separator + ) + ); + break; + case 15: + reader.readMessage(message.sectionLinks, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 15, + SectionLink.deserialize(reader), + SectionLink + ) + ); + break; + case 16: + reader.readMessage(message.axleCountingSections, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 16, + AxleCountingSection.deserialize(reader), + AxleCountingSection + ) + ); + break; + case 17: + reader.readMessage(message.logicSections, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 17, + LogicSection.deserialize(reader), + LogicSection + ) + ); + break; + case 18: + reader.readMessage(message.stopPositions, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 18, + StopPosition.deserialize(reader), + StopPosition + ) + ); + break; + case 19: + reader.readMessage(message.spksSwitchs, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 19, + SpksSwitch.deserialize(reader), + SpksSwitch + ) + ); + break; + case 20: + reader.readMessage(message.esbButtons, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 20, + EsbButton.deserialize(reader), + EsbButton + ) + ); + break; + case 21: + reader.readMessage(message.gateBoxs, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 21, + GatedBox.deserialize(reader), + GatedBox + ) + ); + break; + 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 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; + case 27: + reader.readMessage(message.curvatures, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 27, + Curvature.deserialize(reader), + Curvature + ) + ); + break; + case 28: + reader.readMessage(message.trackSections, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 28, + TrackSection.deserialize(reader), + TrackSection + ) + ); + break; + case 29: + reader.readMessage(message.trackLogicSections, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 29, + TrackLogicSection.deserialize(reader), + TrackLogicSection + ) + ); + break; + case 31: + reader.readMessage( + message.UniqueIdPrefix, + () => + (message.UniqueIdPrefix = + UniqueIdOfStationLayout.deserialize(reader)) + ); + break; + case 32: + reader.readMessage(message.kilometerConvertList, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 32, + KilometerConvert.deserialize(reader), + KilometerConvert + ) + ); + break; + case 33: + reader.readMessage(message.screenDoors, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 33, + ScreenDoor.deserialize(reader), + ScreenDoor + ) + ); + break; + case 34: + reader.readMessage(message.stationRelateDeviceList, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 34, + StationRelateDevice.deserialize(reader), + StationRelateDevice + ) + ); + break; + case 35: + reader.readMessage(message.sectionCodePointList, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 35, + SectionCodePoint.deserialize(reader), + SectionCodePoint + ) + ); + break; + case 36: + reader.readMessage( + message.screenDoorConfig, + () => + (message.screenDoorConfig = + ScreenDoorConfig.deserialize(reader)) + ); + break; + case 37: + reader.readMessage(message.beacons, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 37, + Beacon.deserialize(reader), + Beacon + ) + ); + break; + case 38: + reader.readMessage( + message.generateAxleCountingConfig, + () => + (message.generateAxleCountingConfig = + GenerateAxleCountingConfig.deserialize(reader)) + ); + break; + case 39: + reader.readMessage(message.departureTimers, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 39, + DepartureTimer.deserialize(reader), + DepartureTimer + ) + ); + break; + case 40: + reader.readMessage(message.autoReturnBoxs, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 40, + AutoReturnBox.deserialize(reader), + AutoReturnBox + ) + ); + break; + case 41: + reader.readMessage(message.concentrationDividingLines, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 41, + ConcentrationDividingLine.deserialize(reader), + ConcentrationDividingLine + ) + ); + break; + case 42: + reader.readMessage(message.otherLineList, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 42, + OtherLine.deserialize(reader), + OtherLine + ) + ); + break; + case 43: + reader.readMessage(message.ibpBoxs, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 43, + IbpBox.deserialize(reader), + IbpBox + ) + ); + break; + case 44: + reader.readMessage(message.pslBoxs, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 44, + PslBox.deserialize(reader), + PslBox + ) + ); + break; + case 45: + reader.readMessage(message.carWashings, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 45, + CarWashing.deserialize(reader), + CarWashing + ) + ); + break; + case 46: + reader.readMessage(message.garageDoors, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 46, + GarageDoor.deserialize(reader), + GarageDoor + ) + ); + break; + case 47: + reader.readMessage(message.floodGates, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 47, + GarageDoor.deserialize(reader), + GarageDoor + ) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RtssGraphicStorage { + return RtssGraphicStorage.deserialize(bytes); + } + } + export class Canvas extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { width?: number; height?: number; backgroundColor?: string; viewportTransform?: Transform; gridBackground?: Grid; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("width" in data && data.width != undefined) { - this.width = data.width; - } - if ("height" in data && data.height != undefined) { - this.height = data.height; - } - if ("backgroundColor" in data && data.backgroundColor != undefined) { - this.backgroundColor = data.backgroundColor; - } - if ("viewportTransform" in data && data.viewportTransform != undefined) { - this.viewportTransform = data.viewportTransform; - } - if ("gridBackground" in data && data.gridBackground != undefined) { - this.gridBackground = data.gridBackground; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('width' in data && data.width != undefined) { + this.width = data.width; } - get width() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + if ('height' in data && data.height != undefined) { + this.height = data.height; } - set width(value: number) { - pb_1.Message.setField(this, 1, value); + if ('backgroundColor' in data && data.backgroundColor != undefined) { + this.backgroundColor = data.backgroundColor; } - get height() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + if ( + 'viewportTransform' in data && + data.viewportTransform != undefined + ) { + this.viewportTransform = data.viewportTransform; } - set height(value: number) { - pb_1.Message.setField(this, 2, value); - } - get backgroundColor() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set backgroundColor(value: string) { - pb_1.Message.setField(this, 3, value); - } - get viewportTransform() { - return pb_1.Message.getWrapperField(this, Transform, 4) as Transform; - } - set viewportTransform(value: Transform) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_viewportTransform() { - return pb_1.Message.getField(this, 4) != null; - } - get gridBackground() { - return pb_1.Message.getWrapperField(this, Grid, 5) as Grid; - } - set gridBackground(value: Grid) { - pb_1.Message.setWrapperField(this, 5, value); - } - get has_gridBackground() { - return pb_1.Message.getField(this, 5) != null; - } - static fromObject(data: { - width?: number; - height?: number; - backgroundColor?: string; - viewportTransform?: ReturnType; - gridBackground?: ReturnType; - }): Canvas { - const message = new Canvas({}); - if (data.width != null) { - message.width = data.width; - } - if (data.height != null) { - message.height = data.height; - } - if (data.backgroundColor != null) { - message.backgroundColor = data.backgroundColor; - } - if (data.viewportTransform != null) { - message.viewportTransform = Transform.fromObject(data.viewportTransform); - } - if (data.gridBackground != null) { - message.gridBackground = Grid.fromObject(data.gridBackground); - } - return message; - } - toObject() { - const data: { - width?: number; - height?: number; - backgroundColor?: string; - viewportTransform?: ReturnType; - gridBackground?: ReturnType; - } = {}; - if (this.width != null) { - data.width = this.width; - } - if (this.height != null) { - data.height = this.height; - } - if (this.backgroundColor != null) { - data.backgroundColor = this.backgroundColor; - } - if (this.viewportTransform != null) { - data.viewportTransform = this.viewportTransform.toObject(); - } - if (this.gridBackground != null) { - data.gridBackground = this.gridBackground.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.width != 0) - writer.writeInt32(1, this.width); - if (this.height != 0) - writer.writeInt32(2, this.height); - if (this.backgroundColor.length) - writer.writeString(3, this.backgroundColor); - if (this.has_viewportTransform) - writer.writeMessage(4, this.viewportTransform, () => this.viewportTransform.serialize(writer)); - if (this.has_gridBackground) - writer.writeMessage(5, this.gridBackground, () => this.gridBackground.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Canvas { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Canvas(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.width = reader.readInt32(); - break; - case 2: - message.height = reader.readInt32(); - break; - case 3: - message.backgroundColor = reader.readString(); - break; - case 4: - reader.readMessage(message.viewportTransform, () => message.viewportTransform = Transform.deserialize(reader)); - break; - case 5: - reader.readMessage(message.gridBackground, () => message.gridBackground = Grid.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Canvas { - return Canvas.deserialize(bytes); + if ('gridBackground' in data && data.gridBackground != undefined) { + this.gridBackground = data.gridBackground; } + } } - export class Grid extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get width() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set width(value: number) { + pb_1.Message.setField(this, 1, value); + } + get height() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set height(value: number) { + pb_1.Message.setField(this, 2, value); + } + get backgroundColor() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set backgroundColor(value: string) { + pb_1.Message.setField(this, 3, value); + } + get viewportTransform() { + return pb_1.Message.getWrapperField(this, Transform, 4) as Transform; + } + set viewportTransform(value: Transform) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_viewportTransform() { + return pb_1.Message.getField(this, 4) != null; + } + get gridBackground() { + return pb_1.Message.getWrapperField(this, Grid, 5) as Grid; + } + set gridBackground(value: Grid) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_gridBackground() { + return pb_1.Message.getField(this, 5) != null; + } + static fromObject(data: { + width?: number; + height?: number; + backgroundColor?: string; + viewportTransform?: ReturnType; + gridBackground?: ReturnType; + }): Canvas { + const message = new Canvas({}); + if (data.width != null) { + message.width = data.width; + } + if (data.height != null) { + message.height = data.height; + } + if (data.backgroundColor != null) { + message.backgroundColor = data.backgroundColor; + } + if (data.viewportTransform != null) { + message.viewportTransform = Transform.fromObject( + data.viewportTransform + ); + } + if (data.gridBackground != null) { + message.gridBackground = Grid.fromObject(data.gridBackground); + } + return message; + } + toObject() { + const data: { + width?: number; + height?: number; + backgroundColor?: string; + viewportTransform?: ReturnType; + gridBackground?: ReturnType; + } = {}; + if (this.width != null) { + data.width = this.width; + } + if (this.height != null) { + data.height = this.height; + } + if (this.backgroundColor != null) { + data.backgroundColor = this.backgroundColor; + } + if (this.viewportTransform != null) { + data.viewportTransform = this.viewportTransform.toObject(); + } + if (this.gridBackground != null) { + data.gridBackground = this.gridBackground.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.width != 0) writer.writeInt32(1, this.width); + if (this.height != 0) writer.writeInt32(2, this.height); + if (this.backgroundColor.length) + writer.writeString(3, this.backgroundColor); + if (this.has_viewportTransform) + writer.writeMessage(4, this.viewportTransform, () => + this.viewportTransform.serialize(writer) + ); + if (this.has_gridBackground) + writer.writeMessage(5, this.gridBackground, () => + this.gridBackground.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Canvas { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Canvas(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.width = reader.readInt32(); + break; + case 2: + message.height = reader.readInt32(); + break; + case 3: + message.backgroundColor = reader.readString(); + break; + case 4: + reader.readMessage( + message.viewportTransform, + () => (message.viewportTransform = Transform.deserialize(reader)) + ); + break; + case 5: + reader.readMessage( + message.gridBackground, + () => (message.gridBackground = Grid.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Canvas { + return Canvas.deserialize(bytes); + } + } + export class Grid extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { hasGrid?: boolean; lineColor?: string; space?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("hasGrid" in data && data.hasGrid != undefined) { - this.hasGrid = data.hasGrid; - } - if ("lineColor" in data && data.lineColor != undefined) { - this.lineColor = data.lineColor; - } - if ("space" in data && data.space != undefined) { - this.space = data.space; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('hasGrid' in data && data.hasGrid != undefined) { + this.hasGrid = data.hasGrid; } - get hasGrid() { - return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; + if ('lineColor' in data && data.lineColor != undefined) { + this.lineColor = data.lineColor; } - set hasGrid(value: boolean) { - pb_1.Message.setField(this, 1, value); - } - get lineColor() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set lineColor(value: string) { - pb_1.Message.setField(this, 2, value); - } - get space() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set space(value: number) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - hasGrid?: boolean; - lineColor?: string; - space?: number; - }): Grid { - const message = new Grid({}); - if (data.hasGrid != null) { - message.hasGrid = data.hasGrid; - } - if (data.lineColor != null) { - message.lineColor = data.lineColor; - } - if (data.space != null) { - message.space = data.space; - } - return message; - } - toObject() { - const data: { - hasGrid?: boolean; - lineColor?: string; - space?: number; - } = {}; - if (this.hasGrid != null) { - data.hasGrid = this.hasGrid; - } - if (this.lineColor != null) { - data.lineColor = this.lineColor; - } - if (this.space != null) { - data.space = this.space; - } - 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.hasGrid != false) - writer.writeBool(1, this.hasGrid); - if (this.lineColor.length) - writer.writeString(2, this.lineColor); - if (this.space != 0) - writer.writeInt32(3, this.space); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Grid { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Grid(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.hasGrid = reader.readBool(); - break; - case 2: - message.lineColor = reader.readString(); - break; - case 3: - message.space = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Grid { - return Grid.deserialize(bytes); + if ('space' in data && data.space != undefined) { + this.space = data.space; } + } } - export class Point extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get hasGrid() { + return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; + } + set hasGrid(value: boolean) { + pb_1.Message.setField(this, 1, value); + } + get lineColor() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set lineColor(value: string) { + pb_1.Message.setField(this, 2, value); + } + get space() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set space(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + hasGrid?: boolean; + lineColor?: string; + space?: number; + }): Grid { + const message = new Grid({}); + if (data.hasGrid != null) { + message.hasGrid = data.hasGrid; + } + if (data.lineColor != null) { + message.lineColor = data.lineColor; + } + if (data.space != null) { + message.space = data.space; + } + return message; + } + toObject() { + const data: { + hasGrid?: boolean; + lineColor?: string; + space?: number; + } = {}; + if (this.hasGrid != null) { + data.hasGrid = this.hasGrid; + } + if (this.lineColor != null) { + data.lineColor = this.lineColor; + } + if (this.space != null) { + data.space = this.space; + } + 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.hasGrid != false) writer.writeBool(1, this.hasGrid); + if (this.lineColor.length) writer.writeString(2, this.lineColor); + if (this.space != 0) writer.writeInt32(3, this.space); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Grid { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Grid(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.hasGrid = reader.readBool(); + break; + case 2: + message.lineColor = reader.readString(); + break; + case 3: + message.space = reader.readInt32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Grid { + return Grid.deserialize(bytes); + } + } + export class Point extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { x?: number; y?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("x" in data && data.x != undefined) { - this.x = data.x; - } - if ("y" in data && data.y != undefined) { - this.y = data.y; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('x' in data && data.x != undefined) { + this.x = data.x; } - get x() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set x(value: number) { - pb_1.Message.setField(this, 1, value); - } - get y() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set y(value: number) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - x?: number; - y?: number; - }): Point { - const message = new Point({}); - if (data.x != null) { - message.x = data.x; - } - if (data.y != null) { - message.y = data.y; - } - return message; - } - toObject() { - const data: { - x?: number; - y?: number; - } = {}; - if (this.x != null) { - data.x = this.x; - } - if (this.y != null) { - data.y = this.y; - } - 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.x != 0) - writer.writeFloat(1, this.x); - if (this.y != 0) - writer.writeFloat(2, this.y); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Point { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Point(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.x = reader.readFloat(); - break; - case 2: - message.y = reader.readFloat(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Point { - return Point.deserialize(bytes); + if ('y' in data && data.y != undefined) { + this.y = data.y; } + } } - export class Transform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get x() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set x(value: number) { + pb_1.Message.setField(this, 1, value); + } + get y() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set y(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { x?: number; y?: number }): Point { + const message = new Point({}); + if (data.x != null) { + message.x = data.x; + } + if (data.y != null) { + message.y = data.y; + } + return message; + } + toObject() { + const data: { + x?: number; + y?: number; + } = {}; + if (this.x != null) { + data.x = this.x; + } + if (this.y != null) { + data.y = this.y; + } + 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.x != 0) writer.writeFloat(1, this.x); + if (this.y != 0) writer.writeFloat(2, this.y); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Point { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Point(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.x = reader.readFloat(); + break; + case 2: + message.y = reader.readFloat(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Point { + return Point.deserialize(bytes); + } + } + export class Transform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { position?: Point; scale?: Point; rotation?: number; skew?: 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 ("position" in data && data.position != undefined) { - this.position = data.position; - } - if ("scale" in data && data.scale != undefined) { - this.scale = data.scale; - } - if ("rotation" in data && data.rotation != undefined) { - this.rotation = data.rotation; - } - if ("skew" in data && data.skew != undefined) { - this.skew = data.skew; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('position' in data && data.position != undefined) { + this.position = data.position; } - get position() { - return pb_1.Message.getWrapperField(this, Point, 1) as Point; + if ('scale' in data && data.scale != undefined) { + this.scale = data.scale; } - set position(value: Point) { - pb_1.Message.setWrapperField(this, 1, value); + if ('rotation' in data && data.rotation != undefined) { + this.rotation = data.rotation; } - get has_position() { - return pb_1.Message.getField(this, 1) != null; - } - get scale() { - return pb_1.Message.getWrapperField(this, Point, 2) as Point; - } - set scale(value: Point) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_scale() { - return pb_1.Message.getField(this, 2) != null; - } - get rotation() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set rotation(value: number) { - pb_1.Message.setField(this, 3, value); - } - get skew() { - return pb_1.Message.getWrapperField(this, Point, 4) as Point; - } - set skew(value: Point) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_skew() { - return pb_1.Message.getField(this, 4) != null; - } - static fromObject(data: { - position?: ReturnType; - scale?: ReturnType; - rotation?: number; - skew?: ReturnType; - }): Transform { - const message = new Transform({}); - if (data.position != null) { - message.position = Point.fromObject(data.position); - } - if (data.scale != null) { - message.scale = Point.fromObject(data.scale); - } - if (data.rotation != null) { - message.rotation = data.rotation; - } - if (data.skew != null) { - message.skew = Point.fromObject(data.skew); - } - return message; - } - toObject() { - const data: { - position?: ReturnType; - scale?: ReturnType; - rotation?: number; - skew?: ReturnType; - } = {}; - if (this.position != null) { - data.position = this.position.toObject(); - } - if (this.scale != null) { - data.scale = this.scale.toObject(); - } - if (this.rotation != null) { - data.rotation = this.rotation; - } - if (this.skew != null) { - data.skew = this.skew.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_position) - writer.writeMessage(1, this.position, () => this.position.serialize(writer)); - if (this.has_scale) - writer.writeMessage(2, this.scale, () => this.scale.serialize(writer)); - if (this.rotation != 0) - writer.writeFloat(3, this.rotation); - if (this.has_skew) - writer.writeMessage(4, this.skew, () => this.skew.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transform { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Transform(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.position, () => message.position = Point.deserialize(reader)); - break; - case 2: - reader.readMessage(message.scale, () => message.scale = Point.deserialize(reader)); - break; - case 3: - message.rotation = reader.readFloat(); - break; - case 4: - reader.readMessage(message.skew, () => message.skew = Point.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Transform { - return Transform.deserialize(bytes); + if ('skew' in data && data.skew != undefined) { + this.skew = data.skew; } + } } - export class ChildTransform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get position() { + return pb_1.Message.getWrapperField(this, Point, 1) as Point; + } + set position(value: Point) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_position() { + return pb_1.Message.getField(this, 1) != null; + } + get scale() { + return pb_1.Message.getWrapperField(this, Point, 2) as Point; + } + set scale(value: Point) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_scale() { + return pb_1.Message.getField(this, 2) != null; + } + get rotation() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set rotation(value: number) { + pb_1.Message.setField(this, 3, value); + } + get skew() { + return pb_1.Message.getWrapperField(this, Point, 4) as Point; + } + set skew(value: Point) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_skew() { + return pb_1.Message.getField(this, 4) != null; + } + static fromObject(data: { + position?: ReturnType; + scale?: ReturnType; + rotation?: number; + skew?: ReturnType; + }): Transform { + const message = new Transform({}); + if (data.position != null) { + message.position = Point.fromObject(data.position); + } + if (data.scale != null) { + message.scale = Point.fromObject(data.scale); + } + if (data.rotation != null) { + message.rotation = data.rotation; + } + if (data.skew != null) { + message.skew = Point.fromObject(data.skew); + } + return message; + } + toObject() { + const data: { + position?: ReturnType; + scale?: ReturnType; + rotation?: number; + skew?: ReturnType; + } = {}; + if (this.position != null) { + data.position = this.position.toObject(); + } + if (this.scale != null) { + data.scale = this.scale.toObject(); + } + if (this.rotation != null) { + data.rotation = this.rotation; + } + if (this.skew != null) { + data.skew = this.skew.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_position) + writer.writeMessage(1, this.position, () => + this.position.serialize(writer) + ); + if (this.has_scale) + writer.writeMessage(2, this.scale, () => this.scale.serialize(writer)); + if (this.rotation != 0) writer.writeFloat(3, this.rotation); + if (this.has_skew) + writer.writeMessage(4, this.skew, () => this.skew.serialize(writer)); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transform { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Transform(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.position, + () => (message.position = Point.deserialize(reader)) + ); + break; + case 2: + reader.readMessage( + message.scale, + () => (message.scale = Point.deserialize(reader)) + ); + break; + case 3: + message.rotation = reader.readFloat(); + break; + case 4: + reader.readMessage( + message.skew, + () => (message.skew = Point.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Transform { + return Transform.deserialize(bytes); + } + } + export class ChildTransform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { name?: string; transform?: Transform; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("transform" in data && data.transform != undefined) { - this.transform = data.transform; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('name' in data && data.name != undefined) { + this.name = data.name; } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get transform() { - return pb_1.Message.getWrapperField(this, Transform, 2) as Transform; - } - set transform(value: Transform) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_transform() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - name?: string; - transform?: ReturnType; - }): ChildTransform { - const message = new ChildTransform({}); - if (data.name != null) { - message.name = data.name; - } - if (data.transform != null) { - message.transform = Transform.fromObject(data.transform); - } - return message; - } - toObject() { - const data: { - name?: string; - transform?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.transform != null) { - data.transform = this.transform.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.name.length) - writer.writeString(1, this.name); - if (this.has_transform) - writer.writeMessage(2, this.transform, () => this.transform.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ChildTransform { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ChildTransform(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.transform, () => message.transform = Transform.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ChildTransform { - return ChildTransform.deserialize(bytes); + if ('transform' in data && data.transform != undefined) { + this.transform = data.transform; } + } } - export class CommonInfo extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get name() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get transform() { + return pb_1.Message.getWrapperField(this, Transform, 2) as Transform; + } + set transform(value: Transform) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_transform() { + return pb_1.Message.getField(this, 2) != null; + } + static fromObject(data: { + name?: string; + transform?: ReturnType; + }): ChildTransform { + const message = new ChildTransform({}); + if (data.name != null) { + message.name = data.name; + } + if (data.transform != null) { + message.transform = Transform.fromObject(data.transform); + } + return message; + } + toObject() { + const data: { + name?: string; + transform?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.transform != null) { + data.transform = this.transform.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.name.length) writer.writeString(1, this.name); + if (this.has_transform) + writer.writeMessage(2, this.transform, () => + this.transform.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ChildTransform { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new ChildTransform(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage( + message.transform, + () => (message.transform = Transform.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ChildTransform { + return ChildTransform.deserialize(bytes); + } + } + export class CommonInfo extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { graphicType?: string; transform?: Transform; childTransforms?: ChildTransform[]; id?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("graphicType" in data && data.graphicType != undefined) { - this.graphicType = data.graphicType; - } - if ("transform" in data && data.transform != undefined) { - this.transform = data.transform; - } - if ("childTransforms" in data && data.childTransforms != undefined) { - this.childTransforms = data.childTransforms; - } - if ("id" in data && data.id != undefined) { - this.id = data.id; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('graphicType' in data && data.graphicType != undefined) { + this.graphicType = data.graphicType; } - get graphicType() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('transform' in data && data.transform != undefined) { + this.transform = data.transform; } - set graphicType(value: string) { - pb_1.Message.setField(this, 2, value); + if ('childTransforms' in data && data.childTransforms != undefined) { + this.childTransforms = data.childTransforms; } - get transform() { - return pb_1.Message.getWrapperField(this, Transform, 3) as Transform; - } - set transform(value: Transform) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_transform() { - return pb_1.Message.getField(this, 3) != null; - } - get childTransforms() { - return pb_1.Message.getRepeatedWrapperField(this, ChildTransform, 4) as ChildTransform[]; - } - set childTransforms(value: ChildTransform[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set id(value: number) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - graphicType?: string; - transform?: ReturnType; - childTransforms?: ReturnType[]; - id?: number; - }): CommonInfo { - const message = new CommonInfo({}); - if (data.graphicType != null) { - message.graphicType = data.graphicType; - } - if (data.transform != null) { - message.transform = Transform.fromObject(data.transform); - } - if (data.childTransforms != null) { - message.childTransforms = data.childTransforms.map(item => ChildTransform.fromObject(item)); - } - if (data.id != null) { - message.id = data.id; - } - return message; - } - toObject() { - const data: { - graphicType?: string; - transform?: ReturnType; - childTransforms?: ReturnType[]; - id?: number; - } = {}; - if (this.graphicType != null) { - data.graphicType = this.graphicType; - } - if (this.transform != null) { - data.transform = this.transform.toObject(); - } - if (this.childTransforms != null) { - data.childTransforms = this.childTransforms.map((item: ChildTransform) => item.toObject()); - } - if (this.id != null) { - data.id = this.id; - } - 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.graphicType.length) - writer.writeString(2, this.graphicType); - if (this.has_transform) - writer.writeMessage(3, this.transform, () => this.transform.serialize(writer)); - if (this.childTransforms.length) - writer.writeRepeatedMessage(4, this.childTransforms, (item: ChildTransform) => item.serialize(writer)); - if (this.id != 0) - writer.writeUint32(5, this.id); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CommonInfo { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CommonInfo(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 2: - message.graphicType = reader.readString(); - break; - case 3: - reader.readMessage(message.transform, () => message.transform = Transform.deserialize(reader)); - break; - case 4: - reader.readMessage(message.childTransforms, () => pb_1.Message.addToRepeatedWrapperField(message, 4, ChildTransform.deserialize(reader), ChildTransform)); - break; - case 5: - message.id = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): CommonInfo { - return CommonInfo.deserialize(bytes); + if ('id' in data && data.id != undefined) { + this.id = data.id; } + } } - export class Polygon extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get graphicType() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set graphicType(value: string) { + pb_1.Message.setField(this, 2, value); + } + get transform() { + return pb_1.Message.getWrapperField(this, Transform, 3) as Transform; + } + set transform(value: Transform) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_transform() { + return pb_1.Message.getField(this, 3) != null; + } + get childTransforms() { + return pb_1.Message.getRepeatedWrapperField( + this, + ChildTransform, + 4 + ) as ChildTransform[]; + } + set childTransforms(value: ChildTransform[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get id() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set id(value: number) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + graphicType?: string; + transform?: ReturnType; + childTransforms?: ReturnType[]; + id?: number; + }): CommonInfo { + const message = new CommonInfo({}); + if (data.graphicType != null) { + message.graphicType = data.graphicType; + } + if (data.transform != null) { + message.transform = Transform.fromObject(data.transform); + } + if (data.childTransforms != null) { + message.childTransforms = data.childTransforms.map((item) => + ChildTransform.fromObject(item) + ); + } + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + graphicType?: string; + transform?: ReturnType; + childTransforms?: ReturnType< + typeof ChildTransform.prototype.toObject + >[]; + id?: number; + } = {}; + if (this.graphicType != null) { + data.graphicType = this.graphicType; + } + if (this.transform != null) { + data.transform = this.transform.toObject(); + } + if (this.childTransforms != null) { + data.childTransforms = this.childTransforms.map( + (item: ChildTransform) => item.toObject() + ); + } + if (this.id != null) { + data.id = this.id; + } + 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.graphicType.length) writer.writeString(2, this.graphicType); + if (this.has_transform) + writer.writeMessage(3, this.transform, () => + this.transform.serialize(writer) + ); + if (this.childTransforms.length) + writer.writeRepeatedMessage( + 4, + this.childTransforms, + (item: ChildTransform) => item.serialize(writer) + ); + if (this.id != 0) writer.writeUint32(5, this.id); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CommonInfo { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new CommonInfo(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 2: + message.graphicType = reader.readString(); + break; + case 3: + reader.readMessage( + message.transform, + () => (message.transform = Transform.deserialize(reader)) + ); + break; + case 4: + reader.readMessage(message.childTransforms, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 4, + ChildTransform.deserialize(reader), + ChildTransform + ) + ); + break; + case 5: + message.id = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CommonInfo { + return CommonInfo.deserialize(bytes); + } + } + export class Polygon extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; polygonType?: Polygon.PolygonType; points?: Point[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], 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 ("polygonType" in data && data.polygonType != undefined) { - this.polygonType = data.polygonType; - } - if ("points" in data && data.points != undefined) { - this.points = data.points; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('polygonType' in data && data.polygonType != undefined) { + this.polygonType = data.polygonType; } - 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 polygonType() { - return pb_1.Message.getFieldWithDefault(this, 3, Polygon.PolygonType.ConcentrationDividingLine) as Polygon.PolygonType; - } - set polygonType(value: Polygon.PolygonType) { - pb_1.Message.setField(this, 3, value); - } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 4) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - polygonType?: Polygon.PolygonType; - 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.polygonType != null) { - message.polygonType = data.polygonType; - } - if (data.points != null) { - message.points = data.points.map(item => Point.fromObject(item)); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - polygonType?: Polygon.PolygonType; - points?: ReturnType[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.polygonType != null) { - data.polygonType = this.polygonType; - } - 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.polygonType != Polygon.PolygonType.ConcentrationDividingLine) - writer.writeEnum(3, this.polygonType); - if (this.points.length) - writer.writeRepeatedMessage(4, 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.polygonType = reader.readEnum(); - break; - case 4: - reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 4, Point.deserialize(reader), Point)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Polygon { - return Polygon.deserialize(bytes); + if ('points' in data && data.points != undefined) { + this.points = data.points; } + } } - export namespace Polygon { - export enum PolygonType { - ConcentrationDividingLine = 0 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class ConcentrationDividingLine extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 polygonType() { + return pb_1.Message.getFieldWithDefault( + this, + 3, + Polygon.PolygonType.ConcentrationDividingLine + ) as Polygon.PolygonType; + } + set polygonType(value: Polygon.PolygonType) { + pb_1.Message.setField(this, 3, value); + } + get points() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 4) as Point[]; + } + set points(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + polygonType?: Polygon.PolygonType; + 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.polygonType != null) { + message.polygonType = data.polygonType; + } + if (data.points != null) { + message.points = data.points.map((item) => Point.fromObject(item)); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + polygonType?: Polygon.PolygonType; + points?: ReturnType[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.polygonType != null) { + data.polygonType = this.polygonType; + } + 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.polygonType != Polygon.PolygonType.ConcentrationDividingLine) + writer.writeEnum(3, this.polygonType); + if (this.points.length) + writer.writeRepeatedMessage(4, 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.polygonType = reader.readEnum(); + break; + case 4: + reader.readMessage(message.points, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 4, + 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 namespace Polygon { + export enum PolygonType { + ConcentrationDividingLine = 0, + } + } + export class ConcentrationDividingLine extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; points?: Point[]; @@ -1931,814 +2845,987 @@ export namespace graphicData { isOtherLineConcentrationDividingLine?: boolean; refLeftStationId?: number; refRightStationId?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 6], 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 ("nodeConWithSecs" in data && data.nodeConWithSecs != undefined) { - this.nodeConWithSecs = data.nodeConWithSecs; - } - if ("isOtherLineConcentrationDividingLine" in data && data.isOtherLineConcentrationDividingLine != undefined) { - this.isOtherLineConcentrationDividingLine = data.isOtherLineConcentrationDividingLine; - } - if ("refLeftStationId" in data && data.refLeftStationId != undefined) { - this.refLeftStationId = data.refLeftStationId; - } - if ("refRightStationId" in data && data.refRightStationId != undefined) { - this.refRightStationId = data.refRightStationId; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3, 6], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('points' in data && data.points != undefined) { + this.points = data.points; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('nodeConWithSecs' in data && data.nodeConWithSecs != undefined) { + this.nodeConWithSecs = data.nodeConWithSecs; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ( + 'isOtherLineConcentrationDividingLine' in data && + data.isOtherLineConcentrationDividingLine != undefined + ) { + this.isOtherLineConcentrationDividingLine = + data.isOtherLineConcentrationDividingLine; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); + if ('refLeftStationId' in data && data.refLeftStationId != undefined) { + this.refLeftStationId = data.refLeftStationId; } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - get nodeConWithSecs() { - return pb_1.Message.getRepeatedWrapperField(this, NodeConWithSec, 6) as NodeConWithSec[]; - } - set nodeConWithSecs(value: NodeConWithSec[]) { - pb_1.Message.setRepeatedWrapperField(this, 6, value); - } - get isOtherLineConcentrationDividingLine() { - return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean; - } - set isOtherLineConcentrationDividingLine(value: boolean) { - pb_1.Message.setField(this, 7, value); - } - get refLeftStationId() { - return pb_1.Message.getFieldWithDefault(this, 8, 0) as number; - } - set refLeftStationId(value: number) { - pb_1.Message.setField(this, 8, value); - } - get refRightStationId() { - return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; - } - set refRightStationId(value: number) { - pb_1.Message.setField(this, 9, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - nodeConWithSecs?: ReturnType[]; - isOtherLineConcentrationDividingLine?: boolean; - refLeftStationId?: number; - refRightStationId?: number; - }): ConcentrationDividingLine { - const message = new ConcentrationDividingLine({}); - 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.nodeConWithSecs != null) { - message.nodeConWithSecs = data.nodeConWithSecs.map(item => NodeConWithSec.fromObject(item)); - } - if (data.isOtherLineConcentrationDividingLine != null) { - message.isOtherLineConcentrationDividingLine = data.isOtherLineConcentrationDividingLine; - } - if (data.refLeftStationId != null) { - message.refLeftStationId = data.refLeftStationId; - } - if (data.refRightStationId != null) { - message.refRightStationId = data.refRightStationId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - nodeConWithSecs?: ReturnType[]; - isOtherLineConcentrationDividingLine?: boolean; - refLeftStationId?: number; - refRightStationId?: number; - } = {}; - 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.nodeConWithSecs != null) { - data.nodeConWithSecs = this.nodeConWithSecs.map((item: NodeConWithSec) => item.toObject()); - } - if (this.isOtherLineConcentrationDividingLine != null) { - data.isOtherLineConcentrationDividingLine = this.isOtherLineConcentrationDividingLine; - } - if (this.refLeftStationId != null) { - data.refLeftStationId = this.refLeftStationId; - } - if (this.refRightStationId != null) { - data.refRightStationId = this.refRightStationId; - } - 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.nodeConWithSecs.length) - writer.writeRepeatedMessage(6, this.nodeConWithSecs, (item: NodeConWithSec) => item.serialize(writer)); - if (this.isOtherLineConcentrationDividingLine != false) - writer.writeBool(7, this.isOtherLineConcentrationDividingLine); - if (this.refLeftStationId != 0) - writer.writeUint32(8, this.refLeftStationId); - if (this.refRightStationId != 0) - writer.writeUint32(9, this.refRightStationId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ConcentrationDividingLine { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ConcentrationDividingLine(); - 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 6: - reader.readMessage(message.nodeConWithSecs, () => pb_1.Message.addToRepeatedWrapperField(message, 6, NodeConWithSec.deserialize(reader), NodeConWithSec)); - break; - case 7: - message.isOtherLineConcentrationDividingLine = reader.readBool(); - break; - case 8: - message.refLeftStationId = reader.readUint32(); - break; - case 9: - message.refRightStationId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ConcentrationDividingLine { - return ConcentrationDividingLine.deserialize(bytes); + if ( + 'refRightStationId' in data && + data.refRightStationId != undefined + ) { + this.refRightStationId = data.refRightStationId; } + } } - export class NodeConWithSec extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 nodeConWithSecs() { + return pb_1.Message.getRepeatedWrapperField( + this, + NodeConWithSec, + 6 + ) as NodeConWithSec[]; + } + set nodeConWithSecs(value: NodeConWithSec[]) { + pb_1.Message.setRepeatedWrapperField(this, 6, value); + } + get isOtherLineConcentrationDividingLine() { + return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean; + } + set isOtherLineConcentrationDividingLine(value: boolean) { + pb_1.Message.setField(this, 7, value); + } + get refLeftStationId() { + return pb_1.Message.getFieldWithDefault(this, 8, 0) as number; + } + set refLeftStationId(value: number) { + pb_1.Message.setField(this, 8, value); + } + get refRightStationId() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set refRightStationId(value: number) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + nodeConWithSecs?: ReturnType[]; + isOtherLineConcentrationDividingLine?: boolean; + refLeftStationId?: number; + refRightStationId?: number; + }): ConcentrationDividingLine { + const message = new ConcentrationDividingLine({}); + 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.nodeConWithSecs != null) { + message.nodeConWithSecs = data.nodeConWithSecs.map((item) => + NodeConWithSec.fromObject(item) + ); + } + if (data.isOtherLineConcentrationDividingLine != null) { + message.isOtherLineConcentrationDividingLine = + data.isOtherLineConcentrationDividingLine; + } + if (data.refLeftStationId != null) { + message.refLeftStationId = data.refLeftStationId; + } + if (data.refRightStationId != null) { + message.refRightStationId = data.refRightStationId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + nodeConWithSecs?: ReturnType< + typeof NodeConWithSec.prototype.toObject + >[]; + isOtherLineConcentrationDividingLine?: boolean; + refLeftStationId?: number; + refRightStationId?: number; + } = {}; + 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.nodeConWithSecs != null) { + data.nodeConWithSecs = this.nodeConWithSecs.map( + (item: NodeConWithSec) => item.toObject() + ); + } + if (this.isOtherLineConcentrationDividingLine != null) { + data.isOtherLineConcentrationDividingLine = + this.isOtherLineConcentrationDividingLine; + } + if (this.refLeftStationId != null) { + data.refLeftStationId = this.refLeftStationId; + } + if (this.refRightStationId != null) { + data.refRightStationId = this.refRightStationId; + } + 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.nodeConWithSecs.length) + writer.writeRepeatedMessage( + 6, + this.nodeConWithSecs, + (item: NodeConWithSec) => item.serialize(writer) + ); + if (this.isOtherLineConcentrationDividingLine != false) + writer.writeBool(7, this.isOtherLineConcentrationDividingLine); + if (this.refLeftStationId != 0) + writer.writeUint32(8, this.refLeftStationId); + if (this.refRightStationId != 0) + writer.writeUint32(9, this.refRightStationId); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): ConcentrationDividingLine { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new ConcentrationDividingLine(); + 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 6: + reader.readMessage(message.nodeConWithSecs, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 6, + NodeConWithSec.deserialize(reader), + NodeConWithSec + ) + ); + break; + case 7: + message.isOtherLineConcentrationDividingLine = reader.readBool(); + break; + case 8: + message.refLeftStationId = reader.readUint32(); + break; + case 9: + message.refRightStationId = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ConcentrationDividingLine { + return ConcentrationDividingLine.deserialize(bytes); + } + } + export class NodeConWithSec extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { leftSection?: RelatedRef; rightSection?: RelatedRef; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("leftSection" in data && data.leftSection != undefined) { - this.leftSection = data.leftSection; - } - if ("rightSection" in data && data.rightSection != undefined) { - this.rightSection = data.rightSection; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('leftSection' in data && data.leftSection != undefined) { + this.leftSection = data.leftSection; } - get leftSection() { - return pb_1.Message.getWrapperField(this, RelatedRef, 1) as RelatedRef; - } - set leftSection(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_leftSection() { - return pb_1.Message.getField(this, 1) != null; - } - get rightSection() { - return pb_1.Message.getWrapperField(this, RelatedRef, 2) as RelatedRef; - } - set rightSection(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_rightSection() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - leftSection?: ReturnType; - rightSection?: ReturnType; - }): NodeConWithSec { - const message = new NodeConWithSec({}); - if (data.leftSection != null) { - message.leftSection = RelatedRef.fromObject(data.leftSection); - } - if (data.rightSection != null) { - message.rightSection = RelatedRef.fromObject(data.rightSection); - } - return message; - } - toObject() { - const data: { - leftSection?: ReturnType; - rightSection?: ReturnType; - } = {}; - if (this.leftSection != null) { - data.leftSection = this.leftSection.toObject(); - } - if (this.rightSection != null) { - data.rightSection = this.rightSection.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_leftSection) - writer.writeMessage(1, this.leftSection, () => this.leftSection.serialize(writer)); - if (this.has_rightSection) - writer.writeMessage(2, this.rightSection, () => this.rightSection.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NodeConWithSec { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NodeConWithSec(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.leftSection, () => message.leftSection = RelatedRef.deserialize(reader)); - break; - case 2: - reader.readMessage(message.rightSection, () => message.rightSection = RelatedRef.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): NodeConWithSec { - return NodeConWithSec.deserialize(bytes); + if ('rightSection' in data && data.rightSection != undefined) { + this.rightSection = data.rightSection; } + } } - export class Platform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get leftSection() { + return pb_1.Message.getWrapperField(this, RelatedRef, 1) as RelatedRef; + } + set leftSection(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_leftSection() { + return pb_1.Message.getField(this, 1) != null; + } + get rightSection() { + return pb_1.Message.getWrapperField(this, RelatedRef, 2) as RelatedRef; + } + set rightSection(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_rightSection() { + return pb_1.Message.getField(this, 2) != null; + } + static fromObject(data: { + leftSection?: ReturnType; + rightSection?: ReturnType; + }): NodeConWithSec { + const message = new NodeConWithSec({}); + if (data.leftSection != null) { + message.leftSection = RelatedRef.fromObject(data.leftSection); + } + if (data.rightSection != null) { + message.rightSection = RelatedRef.fromObject(data.rightSection); + } + return message; + } + toObject() { + const data: { + leftSection?: ReturnType; + rightSection?: ReturnType; + } = {}; + if (this.leftSection != null) { + data.leftSection = this.leftSection.toObject(); + } + if (this.rightSection != null) { + data.rightSection = this.rightSection.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_leftSection) + writer.writeMessage(1, this.leftSection, () => + this.leftSection.serialize(writer) + ); + if (this.has_rightSection) + writer.writeMessage(2, this.rightSection, () => + this.rightSection.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NodeConWithSec { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new NodeConWithSec(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.leftSection, + () => (message.leftSection = RelatedRef.deserialize(reader)) + ); + break; + case 2: + reader.readMessage( + message.rightSection, + () => (message.rightSection = RelatedRef.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): NodeConWithSec { + return NodeConWithSec.deserialize(bytes); + } + } + export class Platform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; refEsbRelayCode?: string; type?: Platform.TypeOfPlatform; refStationId?: number; refSectionId?: number; - }) { - 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 ("refEsbRelayCode" in data && data.refEsbRelayCode != undefined) { - this.refEsbRelayCode = data.refEsbRelayCode; - } - if ("type" in data && data.type != undefined) { - this.type = data.type; - } - if ("refStationId" in data && data.refStationId != undefined) { - this.refStationId = data.refStationId; - } - if ("refSectionId" in data && data.refSectionId != undefined) { - this.refSectionId = data.refSectionId; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('refEsbRelayCode' in data && data.refEsbRelayCode != undefined) { + this.refEsbRelayCode = data.refEsbRelayCode; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('type' in data && data.type != undefined) { + this.type = data.type; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('refStationId' in data && data.refStationId != undefined) { + this.refStationId = data.refStationId; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get refEsbRelayCode() { - return pb_1.Message.getFieldWithDefault(this, 11, "") as string; - } - set refEsbRelayCode(value: string) { - pb_1.Message.setField(this, 11, value); - } - get type() { - return pb_1.Message.getFieldWithDefault(this, 12, Platform.TypeOfPlatform.Unknown) as Platform.TypeOfPlatform; - } - set type(value: Platform.TypeOfPlatform) { - pb_1.Message.setField(this, 12, value); - } - get refStationId() { - return pb_1.Message.getFieldWithDefault(this, 13, 0) as number; - } - set refStationId(value: number) { - pb_1.Message.setField(this, 13, value); - } - get refSectionId() { - return pb_1.Message.getFieldWithDefault(this, 14, 0) as number; - } - set refSectionId(value: number) { - pb_1.Message.setField(this, 14, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - refEsbRelayCode?: string; - type?: Platform.TypeOfPlatform; - refStationId?: number; - refSectionId?: number; - }): Platform { - const message = new Platform({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.refEsbRelayCode != null) { - message.refEsbRelayCode = data.refEsbRelayCode; - } - if (data.type != null) { - message.type = data.type; - } - if (data.refStationId != null) { - message.refStationId = data.refStationId; - } - if (data.refSectionId != null) { - message.refSectionId = data.refSectionId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - refEsbRelayCode?: string; - type?: Platform.TypeOfPlatform; - refStationId?: number; - refSectionId?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.refEsbRelayCode != null) { - data.refEsbRelayCode = this.refEsbRelayCode; - } - if (this.type != null) { - data.type = this.type; - } - if (this.refStationId != null) { - data.refStationId = this.refStationId; - } - if (this.refSectionId != null) { - data.refSectionId = this.refSectionId; - } - 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.refEsbRelayCode.length) - writer.writeString(11, this.refEsbRelayCode); - if (this.type != Platform.TypeOfPlatform.Unknown) - writer.writeEnum(12, this.type); - if (this.refStationId != 0) - writer.writeUint32(13, this.refStationId); - if (this.refSectionId != 0) - writer.writeUint32(14, this.refSectionId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Platform { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Platform(); - 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 11: - message.refEsbRelayCode = reader.readString(); - break; - case 12: - message.type = reader.readEnum(); - break; - case 13: - message.refStationId = reader.readUint32(); - break; - case 14: - message.refSectionId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Platform { - return Platform.deserialize(bytes); + if ('refSectionId' in data && data.refSectionId != undefined) { + this.refSectionId = data.refSectionId; } + } } - export namespace Platform { - export enum TypeOfPlatform { - Unknown = 0, - up = 1, - down = 2 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class ScreenDoor extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 refEsbRelayCode() { + return pb_1.Message.getFieldWithDefault(this, 11, '') as string; + } + set refEsbRelayCode(value: string) { + pb_1.Message.setField(this, 11, value); + } + get type() { + return pb_1.Message.getFieldWithDefault( + this, + 12, + Platform.TypeOfPlatform.Unknown + ) as Platform.TypeOfPlatform; + } + set type(value: Platform.TypeOfPlatform) { + pb_1.Message.setField(this, 12, value); + } + get refStationId() { + return pb_1.Message.getFieldWithDefault(this, 13, 0) as number; + } + set refStationId(value: number) { + pb_1.Message.setField(this, 13, value); + } + get refSectionId() { + return pb_1.Message.getFieldWithDefault(this, 14, 0) as number; + } + set refSectionId(value: number) { + pb_1.Message.setField(this, 14, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + refEsbRelayCode?: string; + type?: Platform.TypeOfPlatform; + refStationId?: number; + refSectionId?: number; + }): Platform { + const message = new Platform({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.refEsbRelayCode != null) { + message.refEsbRelayCode = data.refEsbRelayCode; + } + if (data.type != null) { + message.type = data.type; + } + if (data.refStationId != null) { + message.refStationId = data.refStationId; + } + if (data.refSectionId != null) { + message.refSectionId = data.refSectionId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + refEsbRelayCode?: string; + type?: Platform.TypeOfPlatform; + refStationId?: number; + refSectionId?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.refEsbRelayCode != null) { + data.refEsbRelayCode = this.refEsbRelayCode; + } + if (this.type != null) { + data.type = this.type; + } + if (this.refStationId != null) { + data.refStationId = this.refStationId; + } + if (this.refSectionId != null) { + data.refSectionId = this.refSectionId; + } + 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.refEsbRelayCode.length) + writer.writeString(11, this.refEsbRelayCode); + if (this.type != Platform.TypeOfPlatform.Unknown) + writer.writeEnum(12, this.type); + if (this.refStationId != 0) writer.writeUint32(13, this.refStationId); + if (this.refSectionId != 0) writer.writeUint32(14, this.refSectionId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Platform { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Platform(); + 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 11: + message.refEsbRelayCode = reader.readString(); + break; + case 12: + message.type = reader.readEnum(); + break; + case 13: + message.refStationId = reader.readUint32(); + break; + case 14: + message.refSectionId = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Platform { + return Platform.deserialize(bytes); + } + } + export namespace Platform { + export enum TypeOfPlatform { + Unknown = 0, + up = 1, + down = 2, + } + } + export class ScreenDoor extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; refPlatformId?: number; - }) { - 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 ("refPlatformId" in data && data.refPlatformId != undefined) { - this.refPlatformId = data.refPlatformId; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - 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 refPlatformId() { - return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; - } - set refPlatformId(value: number) { - pb_1.Message.setField(this, 6, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - refPlatformId?: number; - }): ScreenDoor { - const message = new ScreenDoor({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.refPlatformId != null) { - message.refPlatformId = data.refPlatformId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - refPlatformId?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.refPlatformId != null) { - data.refPlatformId = this.refPlatformId; - } - 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.refPlatformId != 0) - writer.writeUint32(6, this.refPlatformId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoor { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScreenDoor(); - 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 6: - message.refPlatformId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ScreenDoor { - return ScreenDoor.deserialize(bytes); + if ('refPlatformId' in data && data.refPlatformId != undefined) { + this.refPlatformId = data.refPlatformId; } + } } - export class ScreenDoorConfig extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 refPlatformId() { + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; + } + set refPlatformId(value: number) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + refPlatformId?: number; + }): ScreenDoor { + const message = new ScreenDoor({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.refPlatformId != null) { + message.refPlatformId = data.refPlatformId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + refPlatformId?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.refPlatformId != null) { + data.refPlatformId = this.refPlatformId; + } + 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.refPlatformId != 0) writer.writeUint32(6, this.refPlatformId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoor { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new ScreenDoor(); + 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 6: + message.refPlatformId = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ScreenDoor { + return ScreenDoor.deserialize(bytes); + } + } + export class ScreenDoorConfig extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { sonDoorAmount?: number; screenDoorGroupList?: ScreenDoorGroup[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("sonDoorAmount" in data && data.sonDoorAmount != undefined) { - this.sonDoorAmount = data.sonDoorAmount; - } - if ("screenDoorGroupList" in data && data.screenDoorGroupList != undefined) { - this.screenDoorGroupList = data.screenDoorGroupList; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [2], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('sonDoorAmount' in data && data.sonDoorAmount != undefined) { + this.sonDoorAmount = data.sonDoorAmount; } - get sonDoorAmount() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set sonDoorAmount(value: number) { - pb_1.Message.setField(this, 1, value); - } - get screenDoorGroupList() { - return pb_1.Message.getRepeatedWrapperField(this, ScreenDoorGroup, 2) as ScreenDoorGroup[]; - } - set screenDoorGroupList(value: ScreenDoorGroup[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - static fromObject(data: { - sonDoorAmount?: number; - screenDoorGroupList?: ReturnType[]; - }): ScreenDoorConfig { - const message = new ScreenDoorConfig({}); - if (data.sonDoorAmount != null) { - message.sonDoorAmount = data.sonDoorAmount; - } - if (data.screenDoorGroupList != null) { - message.screenDoorGroupList = data.screenDoorGroupList.map(item => ScreenDoorGroup.fromObject(item)); - } - return message; - } - toObject() { - const data: { - sonDoorAmount?: number; - screenDoorGroupList?: ReturnType[]; - } = {}; - if (this.sonDoorAmount != null) { - data.sonDoorAmount = this.sonDoorAmount; - } - if (this.screenDoorGroupList != null) { - data.screenDoorGroupList = this.screenDoorGroupList.map((item: ScreenDoorGroup) => 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.sonDoorAmount != 0) - writer.writeInt32(1, this.sonDoorAmount); - if (this.screenDoorGroupList.length) - writer.writeRepeatedMessage(2, this.screenDoorGroupList, (item: ScreenDoorGroup) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoorConfig { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScreenDoorConfig(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.sonDoorAmount = reader.readInt32(); - break; - case 2: - reader.readMessage(message.screenDoorGroupList, () => pb_1.Message.addToRepeatedWrapperField(message, 2, ScreenDoorGroup.deserialize(reader), ScreenDoorGroup)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ScreenDoorConfig { - return ScreenDoorConfig.deserialize(bytes); + if ( + 'screenDoorGroupList' in data && + data.screenDoorGroupList != undefined + ) { + this.screenDoorGroupList = data.screenDoorGroupList; } + } } - export class ScreenDoorGroup extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get sonDoorAmount() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set sonDoorAmount(value: number) { + pb_1.Message.setField(this, 1, value); + } + get screenDoorGroupList() { + return pb_1.Message.getRepeatedWrapperField( + this, + ScreenDoorGroup, + 2 + ) as ScreenDoorGroup[]; + } + set screenDoorGroupList(value: ScreenDoorGroup[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + static fromObject(data: { + sonDoorAmount?: number; + screenDoorGroupList?: ReturnType< + typeof ScreenDoorGroup.prototype.toObject + >[]; + }): ScreenDoorConfig { + const message = new ScreenDoorConfig({}); + if (data.sonDoorAmount != null) { + message.sonDoorAmount = data.sonDoorAmount; + } + if (data.screenDoorGroupList != null) { + message.screenDoorGroupList = data.screenDoorGroupList.map((item) => + ScreenDoorGroup.fromObject(item) + ); + } + return message; + } + toObject() { + const data: { + sonDoorAmount?: number; + screenDoorGroupList?: ReturnType< + typeof ScreenDoorGroup.prototype.toObject + >[]; + } = {}; + if (this.sonDoorAmount != null) { + data.sonDoorAmount = this.sonDoorAmount; + } + if (this.screenDoorGroupList != null) { + data.screenDoorGroupList = this.screenDoorGroupList.map( + (item: ScreenDoorGroup) => 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.sonDoorAmount != 0) writer.writeInt32(1, this.sonDoorAmount); + if (this.screenDoorGroupList.length) + writer.writeRepeatedMessage( + 2, + this.screenDoorGroupList, + (item: ScreenDoorGroup) => item.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): ScreenDoorConfig { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new ScreenDoorConfig(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.sonDoorAmount = reader.readInt32(); + break; + case 2: + reader.readMessage(message.screenDoorGroupList, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 2, + ScreenDoorGroup.deserialize(reader), + ScreenDoorGroup + ) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ScreenDoorConfig { + return ScreenDoorConfig.deserialize(bytes); + } + } + export class ScreenDoorGroup extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { trainGroupAmount?: number; startSmallDoor?: number; endSmallDoor?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("trainGroupAmount" in data && data.trainGroupAmount != undefined) { - this.trainGroupAmount = data.trainGroupAmount; - } - if ("startSmallDoor" in data && data.startSmallDoor != undefined) { - this.startSmallDoor = data.startSmallDoor; - } - if ("endSmallDoor" in data && data.endSmallDoor != undefined) { - this.endSmallDoor = data.endSmallDoor; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('trainGroupAmount' in data && data.trainGroupAmount != undefined) { + this.trainGroupAmount = data.trainGroupAmount; } - get trainGroupAmount() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + if ('startSmallDoor' in data && data.startSmallDoor != undefined) { + this.startSmallDoor = data.startSmallDoor; } - set trainGroupAmount(value: number) { - pb_1.Message.setField(this, 1, value); - } - get startSmallDoor() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set startSmallDoor(value: number) { - pb_1.Message.setField(this, 2, value); - } - get endSmallDoor() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set endSmallDoor(value: number) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - trainGroupAmount?: number; - startSmallDoor?: number; - endSmallDoor?: number; - }): ScreenDoorGroup { - const message = new ScreenDoorGroup({}); - if (data.trainGroupAmount != null) { - message.trainGroupAmount = data.trainGroupAmount; - } - if (data.startSmallDoor != null) { - message.startSmallDoor = data.startSmallDoor; - } - if (data.endSmallDoor != null) { - message.endSmallDoor = data.endSmallDoor; - } - return message; - } - toObject() { - const data: { - trainGroupAmount?: number; - startSmallDoor?: number; - endSmallDoor?: number; - } = {}; - if (this.trainGroupAmount != null) { - data.trainGroupAmount = this.trainGroupAmount; - } - if (this.startSmallDoor != null) { - data.startSmallDoor = this.startSmallDoor; - } - if (this.endSmallDoor != null) { - data.endSmallDoor = this.endSmallDoor; - } - 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.trainGroupAmount != 0) - writer.writeInt32(1, this.trainGroupAmount); - if (this.startSmallDoor != 0) - writer.writeInt32(2, this.startSmallDoor); - if (this.endSmallDoor != 0) - writer.writeInt32(3, this.endSmallDoor); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoorGroup { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScreenDoorGroup(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.trainGroupAmount = reader.readInt32(); - break; - case 2: - message.startSmallDoor = reader.readInt32(); - break; - case 3: - message.endSmallDoor = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ScreenDoorGroup { - return ScreenDoorGroup.deserialize(bytes); + if ('endSmallDoor' in data && data.endSmallDoor != undefined) { + this.endSmallDoor = data.endSmallDoor; } + } } - export class Station extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get trainGroupAmount() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set trainGroupAmount(value: number) { + pb_1.Message.setField(this, 1, value); + } + get startSmallDoor() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set startSmallDoor(value: number) { + pb_1.Message.setField(this, 2, value); + } + get endSmallDoor() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set endSmallDoor(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + trainGroupAmount?: number; + startSmallDoor?: number; + endSmallDoor?: number; + }): ScreenDoorGroup { + const message = new ScreenDoorGroup({}); + if (data.trainGroupAmount != null) { + message.trainGroupAmount = data.trainGroupAmount; + } + if (data.startSmallDoor != null) { + message.startSmallDoor = data.startSmallDoor; + } + if (data.endSmallDoor != null) { + message.endSmallDoor = data.endSmallDoor; + } + return message; + } + toObject() { + const data: { + trainGroupAmount?: number; + startSmallDoor?: number; + endSmallDoor?: number; + } = {}; + if (this.trainGroupAmount != null) { + data.trainGroupAmount = this.trainGroupAmount; + } + if (this.startSmallDoor != null) { + data.startSmallDoor = this.startSmallDoor; + } + if (this.endSmallDoor != null) { + data.endSmallDoor = this.endSmallDoor; + } + 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.trainGroupAmount != 0) + writer.writeInt32(1, this.trainGroupAmount); + if (this.startSmallDoor != 0) writer.writeInt32(2, this.startSmallDoor); + if (this.endSmallDoor != 0) writer.writeInt32(3, this.endSmallDoor); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoorGroup { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new ScreenDoorGroup(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.trainGroupAmount = reader.readInt32(); + break; + case 2: + message.startSmallDoor = reader.readInt32(); + break; + case 3: + message.endSmallDoor = reader.readInt32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ScreenDoorGroup { + return ScreenDoorGroup.deserialize(bytes); + } + } + export class Station extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; concentrationStations?: boolean; @@ -2747,632 +3834,754 @@ export namespace graphicData { stationNameAcronym?: string; depots?: boolean; manageStations?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [13], 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 ("concentrationStations" in data && data.concentrationStations != undefined) { - this.concentrationStations = data.concentrationStations; - } - if ("kilometerSystem" in data && data.kilometerSystem != undefined) { - this.kilometerSystem = data.kilometerSystem; - } - if ("stationName" in data && data.stationName != undefined) { - this.stationName = data.stationName; - } - if ("stationNameAcronym" in data && data.stationNameAcronym != undefined) { - this.stationNameAcronym = data.stationNameAcronym; - } - if ("depots" in data && data.depots != undefined) { - this.depots = data.depots; - } - if ("manageStations" in data && data.manageStations != undefined) { - this.manageStations = data.manageStations; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [13], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ( + 'concentrationStations' in data && + data.concentrationStations != undefined + ) { + this.concentrationStations = data.concentrationStations; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('stationName' in data && data.stationName != undefined) { + this.stationName = data.stationName; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); + if ( + 'stationNameAcronym' in data && + data.stationNameAcronym != undefined + ) { + this.stationNameAcronym = data.stationNameAcronym; } - get concentrationStations() { - return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; + if ('depots' in data && data.depots != undefined) { + this.depots = data.depots; } - set concentrationStations(value: boolean) { - pb_1.Message.setField(this, 4, value); - } - get kilometerSystem() { - return pb_1.Message.getWrapperField(this, KilometerSystem, 6) as KilometerSystem; - } - set kilometerSystem(value: KilometerSystem) { - pb_1.Message.setWrapperField(this, 6, value); - } - get has_kilometerSystem() { - return pb_1.Message.getField(this, 6) != null; - } - get stationName() { - return pb_1.Message.getFieldWithDefault(this, 9, "") as string; - } - set stationName(value: string) { - pb_1.Message.setField(this, 9, value); - } - get stationNameAcronym() { - return pb_1.Message.getFieldWithDefault(this, 10, "") as string; - } - set stationNameAcronym(value: string) { - pb_1.Message.setField(this, 10, value); - } - get depots() { - return pb_1.Message.getFieldWithDefault(this, 11, false) as boolean; - } - set depots(value: boolean) { - pb_1.Message.setField(this, 11, value); - } - get manageStations() { - return pb_1.Message.getFieldWithDefault(this, 13, []) as number[]; - } - set manageStations(value: number[]) { - pb_1.Message.setField(this, 13, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - concentrationStations?: boolean; - kilometerSystem?: ReturnType; - stationName?: string; - stationNameAcronym?: string; - depots?: boolean; - manageStations?: number[]; - }): Station { - const message = new Station({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.concentrationStations != null) { - message.concentrationStations = data.concentrationStations; - } - if (data.kilometerSystem != null) { - message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); - } - if (data.stationName != null) { - message.stationName = data.stationName; - } - if (data.stationNameAcronym != null) { - message.stationNameAcronym = data.stationNameAcronym; - } - if (data.depots != null) { - message.depots = data.depots; - } - if (data.manageStations != null) { - message.manageStations = data.manageStations; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - concentrationStations?: boolean; - kilometerSystem?: ReturnType; - stationName?: string; - stationNameAcronym?: string; - depots?: boolean; - manageStations?: number[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.concentrationStations != null) { - data.concentrationStations = this.concentrationStations; - } - if (this.kilometerSystem != null) { - data.kilometerSystem = this.kilometerSystem.toObject(); - } - if (this.stationName != null) { - data.stationName = this.stationName; - } - if (this.stationNameAcronym != null) { - data.stationNameAcronym = this.stationNameAcronym; - } - if (this.depots != null) { - data.depots = this.depots; - } - if (this.manageStations != null) { - data.manageStations = this.manageStations; - } - 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.concentrationStations != false) - writer.writeBool(4, this.concentrationStations); - if (this.has_kilometerSystem) - writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); - if (this.stationName.length) - writer.writeString(9, this.stationName); - if (this.stationNameAcronym.length) - writer.writeString(10, this.stationNameAcronym); - if (this.depots != false) - writer.writeBool(11, this.depots); - if (this.manageStations.length) - writer.writePackedUint32(13, this.manageStations); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Station { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Station(); - 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: - message.concentrationStations = reader.readBool(); - break; - case 6: - reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); - break; - case 9: - message.stationName = reader.readString(); - break; - case 10: - message.stationNameAcronym = reader.readString(); - break; - case 11: - message.depots = reader.readBool(); - break; - case 13: - message.manageStations = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Station { - return Station.deserialize(bytes); + if ('manageStations' in data && data.manageStations != undefined) { + this.manageStations = data.manageStations; } + } } - export class TrainWindow extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 concentrationStations() { + return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; + } + set concentrationStations(value: boolean) { + pb_1.Message.setField(this, 4, value); + } + get kilometerSystem() { + return pb_1.Message.getWrapperField( + this, + KilometerSystem, + 6 + ) as KilometerSystem; + } + set kilometerSystem(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 6, value); + } + get has_kilometerSystem() { + return pb_1.Message.getField(this, 6) != null; + } + get stationName() { + return pb_1.Message.getFieldWithDefault(this, 9, '') as string; + } + set stationName(value: string) { + pb_1.Message.setField(this, 9, value); + } + get stationNameAcronym() { + return pb_1.Message.getFieldWithDefault(this, 10, '') as string; + } + set stationNameAcronym(value: string) { + pb_1.Message.setField(this, 10, value); + } + get depots() { + return pb_1.Message.getFieldWithDefault(this, 11, false) as boolean; + } + set depots(value: boolean) { + pb_1.Message.setField(this, 11, value); + } + get manageStations() { + return pb_1.Message.getFieldWithDefault(this, 13, []) as number[]; + } + set manageStations(value: number[]) { + pb_1.Message.setField(this, 13, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + concentrationStations?: boolean; + kilometerSystem?: ReturnType; + stationName?: string; + stationNameAcronym?: string; + depots?: boolean; + manageStations?: number[]; + }): Station { + const message = new Station({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.concentrationStations != null) { + message.concentrationStations = data.concentrationStations; + } + if (data.kilometerSystem != null) { + message.kilometerSystem = KilometerSystem.fromObject( + data.kilometerSystem + ); + } + if (data.stationName != null) { + message.stationName = data.stationName; + } + if (data.stationNameAcronym != null) { + message.stationNameAcronym = data.stationNameAcronym; + } + if (data.depots != null) { + message.depots = data.depots; + } + if (data.manageStations != null) { + message.manageStations = data.manageStations; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + concentrationStations?: boolean; + kilometerSystem?: ReturnType; + stationName?: string; + stationNameAcronym?: string; + depots?: boolean; + manageStations?: number[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.concentrationStations != null) { + data.concentrationStations = this.concentrationStations; + } + if (this.kilometerSystem != null) { + data.kilometerSystem = this.kilometerSystem.toObject(); + } + if (this.stationName != null) { + data.stationName = this.stationName; + } + if (this.stationNameAcronym != null) { + data.stationNameAcronym = this.stationNameAcronym; + } + if (this.depots != null) { + data.depots = this.depots; + } + if (this.manageStations != null) { + data.manageStations = this.manageStations; + } + 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.concentrationStations != false) + writer.writeBool(4, this.concentrationStations); + if (this.has_kilometerSystem) + writer.writeMessage(6, this.kilometerSystem, () => + this.kilometerSystem.serialize(writer) + ); + if (this.stationName.length) writer.writeString(9, this.stationName); + if (this.stationNameAcronym.length) + writer.writeString(10, this.stationNameAcronym); + if (this.depots != false) writer.writeBool(11, this.depots); + if (this.manageStations.length) + writer.writePackedUint32(13, this.manageStations); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Station { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Station(); + 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: + message.concentrationStations = reader.readBool(); + break; + case 6: + reader.readMessage( + message.kilometerSystem, + () => + (message.kilometerSystem = KilometerSystem.deserialize(reader)) + ); + break; + case 9: + message.stationName = reader.readString(); + break; + case 10: + message.stationNameAcronym = reader.readString(); + break; + case 11: + message.depots = reader.readBool(); + break; + case 13: + message.manageStations = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Station { + return Station.deserialize(bytes); + } + } + export class TrainWindow extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; sectionId?: number; - }) { - 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 ("sectionId" in data && data.sectionId != undefined) { - this.sectionId = data.sectionId; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - 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 sectionId() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set sectionId(value: number) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - sectionId?: number; - }): TrainWindow { - const message = new TrainWindow({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.sectionId != null) { - message.sectionId = data.sectionId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - sectionId?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.sectionId != null) { - data.sectionId = this.sectionId; - } - 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.sectionId != 0) - writer.writeInt32(3, this.sectionId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainWindow { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainWindow(); - 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.sectionId = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): TrainWindow { - return TrainWindow.deserialize(bytes); + if ('sectionId' in data && data.sectionId != undefined) { + this.sectionId = data.sectionId; } + } } - export class AxleCounting extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 sectionId() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set sectionId(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + sectionId?: number; + }): TrainWindow { + const message = new TrainWindow({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.sectionId != null) { + message.sectionId = data.sectionId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + sectionId?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.sectionId != null) { + data.sectionId = this.sectionId; + } + 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.sectionId != 0) writer.writeInt32(3, this.sectionId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainWindow { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new TrainWindow(); + 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.sectionId = reader.readInt32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TrainWindow { + return TrainWindow.deserialize(bytes); + } + } + export class AxleCounting extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; kilometerSystem?: KilometerSystem; axleCountingRef?: RelatedRef[]; type?: AxleCounting.TypeDetectionPoint; centralizedStations?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 9], 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; - } - if ("axleCountingRef" in data && data.axleCountingRef != undefined) { - this.axleCountingRef = data.axleCountingRef; - } - if ("type" in data && data.type != undefined) { - this.type = data.type; - } - if ("centralizedStations" in data && data.centralizedStations != undefined) { - this.centralizedStations = data.centralizedStations; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4, 9], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('axleCountingRef' in data && data.axleCountingRef != undefined) { + this.axleCountingRef = data.axleCountingRef; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('type' in data && data.type != undefined) { + this.type = data.type; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get kilometerSystem() { - return pb_1.Message.getWrapperField(this, KilometerSystem, 3) as KilometerSystem; - } - set kilometerSystem(value: KilometerSystem) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_kilometerSystem() { - return pb_1.Message.getField(this, 3) != null; - } - get axleCountingRef() { - return pb_1.Message.getRepeatedWrapperField(this, RelatedRef, 4) as RelatedRef[]; - } - set axleCountingRef(value: RelatedRef[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - get type() { - return pb_1.Message.getFieldWithDefault(this, 7, AxleCounting.TypeDetectionPoint.AxleCounting) as AxleCounting.TypeDetectionPoint; - } - set type(value: AxleCounting.TypeDetectionPoint) { - pb_1.Message.setField(this, 7, value); - } - get centralizedStations() { - return pb_1.Message.getFieldWithDefault(this, 9, []) as number[]; - } - set centralizedStations(value: number[]) { - pb_1.Message.setField(this, 9, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - kilometerSystem?: ReturnType; - axleCountingRef?: ReturnType[]; - type?: AxleCounting.TypeDetectionPoint; - centralizedStations?: number[]; - }): AxleCounting { - const message = new AxleCounting({}); - 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); - } - if (data.axleCountingRef != null) { - message.axleCountingRef = data.axleCountingRef.map(item => RelatedRef.fromObject(item)); - } - if (data.type != null) { - message.type = data.type; - } - if (data.centralizedStations != null) { - message.centralizedStations = data.centralizedStations; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - kilometerSystem?: ReturnType; - axleCountingRef?: ReturnType[]; - type?: AxleCounting.TypeDetectionPoint; - centralizedStations?: number[]; - } = {}; - 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(); - } - if (this.axleCountingRef != null) { - data.axleCountingRef = this.axleCountingRef.map((item: RelatedRef) => item.toObject()); - } - if (this.type != null) { - data.type = this.type; - } - if (this.centralizedStations != null) { - data.centralizedStations = this.centralizedStations; - } - 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(3, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); - if (this.axleCountingRef.length) - writer.writeRepeatedMessage(4, this.axleCountingRef, (item: RelatedRef) => item.serialize(writer)); - if (this.type != AxleCounting.TypeDetectionPoint.AxleCounting) - writer.writeEnum(7, this.type); - if (this.centralizedStations.length) - writer.writePackedUint32(9, this.centralizedStations); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AxleCounting { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AxleCounting(); - 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.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); - break; - case 4: - reader.readMessage(message.axleCountingRef, () => pb_1.Message.addToRepeatedWrapperField(message, 4, RelatedRef.deserialize(reader), RelatedRef)); - break; - case 7: - message.type = reader.readEnum(); - break; - case 9: - message.centralizedStations = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AxleCounting { - return AxleCounting.deserialize(bytes); + if ( + 'centralizedStations' in data && + data.centralizedStations != undefined + ) { + this.centralizedStations = data.centralizedStations; } + } } - export namespace AxleCounting { - export enum TypeDetectionPoint { - AxleCounting = 0, - SectionBoundary = 1 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class GenerateAxleCountingConfig extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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, + 3 + ) as KilometerSystem; + } + set kilometerSystem(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_kilometerSystem() { + return pb_1.Message.getField(this, 3) != null; + } + get axleCountingRef() { + return pb_1.Message.getRepeatedWrapperField( + this, + RelatedRef, + 4 + ) as RelatedRef[]; + } + set axleCountingRef(value: RelatedRef[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get type() { + return pb_1.Message.getFieldWithDefault( + this, + 7, + AxleCounting.TypeDetectionPoint.AxleCounting + ) as AxleCounting.TypeDetectionPoint; + } + set type(value: AxleCounting.TypeDetectionPoint) { + pb_1.Message.setField(this, 7, value); + } + get centralizedStations() { + return pb_1.Message.getFieldWithDefault(this, 9, []) as number[]; + } + set centralizedStations(value: number[]) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + axleCountingRef?: ReturnType[]; + type?: AxleCounting.TypeDetectionPoint; + centralizedStations?: number[]; + }): AxleCounting { + const message = new AxleCounting({}); + 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 + ); + } + if (data.axleCountingRef != null) { + message.axleCountingRef = data.axleCountingRef.map((item) => + RelatedRef.fromObject(item) + ); + } + if (data.type != null) { + message.type = data.type; + } + if (data.centralizedStations != null) { + message.centralizedStations = data.centralizedStations; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + axleCountingRef?: ReturnType[]; + type?: AxleCounting.TypeDetectionPoint; + centralizedStations?: number[]; + } = {}; + 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(); + } + if (this.axleCountingRef != null) { + data.axleCountingRef = this.axleCountingRef.map((item: RelatedRef) => + item.toObject() + ); + } + if (this.type != null) { + data.type = this.type; + } + if (this.centralizedStations != null) { + data.centralizedStations = this.centralizedStations; + } + 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(3, this.kilometerSystem, () => + this.kilometerSystem.serialize(writer) + ); + if (this.axleCountingRef.length) + writer.writeRepeatedMessage( + 4, + this.axleCountingRef, + (item: RelatedRef) => item.serialize(writer) + ); + if (this.type != AxleCounting.TypeDetectionPoint.AxleCounting) + writer.writeEnum(7, this.type); + if (this.centralizedStations.length) + writer.writePackedUint32(9, this.centralizedStations); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AxleCounting { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new AxleCounting(); + 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.kilometerSystem, + () => + (message.kilometerSystem = KilometerSystem.deserialize(reader)) + ); + break; + case 4: + reader.readMessage(message.axleCountingRef, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 4, + RelatedRef.deserialize(reader), + RelatedRef + ) + ); + break; + case 7: + message.type = reader.readEnum(); + break; + case 9: + message.centralizedStations = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AxleCounting { + return AxleCounting.deserialize(bytes); + } + } + export namespace AxleCounting { + export enum TypeDetectionPoint { + AxleCounting = 0, + SectionBoundary = 1, + } + } + export class GenerateAxleCountingConfig extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { bbConnect?: number[]; noGenerateGroup?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("bbConnect" in data && data.bbConnect != undefined) { - this.bbConnect = data.bbConnect; - } - if ("noGenerateGroup" in data && data.noGenerateGroup != undefined) { - this.noGenerateGroup = data.noGenerateGroup; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3, 4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('bbConnect' in data && data.bbConnect != undefined) { + this.bbConnect = data.bbConnect; } - get bbConnect() { - return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; - } - set bbConnect(value: number[]) { - pb_1.Message.setField(this, 3, value); - } - get noGenerateGroup() { - return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; - } - set noGenerateGroup(value: number[]) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - bbConnect?: number[]; - noGenerateGroup?: number[]; - }): GenerateAxleCountingConfig { - const message = new GenerateAxleCountingConfig({}); - if (data.bbConnect != null) { - message.bbConnect = data.bbConnect; - } - if (data.noGenerateGroup != null) { - message.noGenerateGroup = data.noGenerateGroup; - } - return message; - } - toObject() { - const data: { - bbConnect?: number[]; - noGenerateGroup?: number[]; - } = {}; - if (this.bbConnect != null) { - data.bbConnect = this.bbConnect; - } - if (this.noGenerateGroup != null) { - data.noGenerateGroup = this.noGenerateGroup; - } - 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.bbConnect.length) - writer.writePackedUint32(3, this.bbConnect); - if (this.noGenerateGroup.length) - writer.writePackedUint32(4, this.noGenerateGroup); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenerateAxleCountingConfig { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenerateAxleCountingConfig(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 3: - message.bbConnect = reader.readPackedUint32(); - break; - case 4: - message.noGenerateGroup = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): GenerateAxleCountingConfig { - return GenerateAxleCountingConfig.deserialize(bytes); + if ('noGenerateGroup' in data && data.noGenerateGroup != undefined) { + this.noGenerateGroup = data.noGenerateGroup; } + } } - export class Turnout extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get bbConnect() { + return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; + } + set bbConnect(value: number[]) { + pb_1.Message.setField(this, 3, value); + } + get noGenerateGroup() { + return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; + } + set noGenerateGroup(value: number[]) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + bbConnect?: number[]; + noGenerateGroup?: number[]; + }): GenerateAxleCountingConfig { + const message = new GenerateAxleCountingConfig({}); + if (data.bbConnect != null) { + message.bbConnect = data.bbConnect; + } + if (data.noGenerateGroup != null) { + message.noGenerateGroup = data.noGenerateGroup; + } + return message; + } + toObject() { + const data: { + bbConnect?: number[]; + noGenerateGroup?: number[]; + } = {}; + if (this.bbConnect != null) { + data.bbConnect = this.bbConnect; + } + if (this.noGenerateGroup != null) { + data.noGenerateGroup = this.noGenerateGroup; + } + 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.bbConnect.length) writer.writePackedUint32(3, this.bbConnect); + if (this.noGenerateGroup.length) + writer.writePackedUint32(4, this.noGenerateGroup); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): GenerateAxleCountingConfig { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new GenerateAxleCountingConfig(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 3: + message.bbConnect = reader.readPackedUint32(); + break; + case 4: + message.noGenerateGroup = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GenerateAxleCountingConfig { + return GenerateAxleCountingConfig.deserialize(bytes); + } + } + export class Turnout extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; pointA?: Point[]; @@ -3387,496 +4596,598 @@ export namespace graphicData { paTrackSectionId?: number; pbTrackSectionId?: number; pcTrackSectionId?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 7, 8, 13, 20], 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 ("pointA" in data && data.pointA != undefined) { - this.pointA = data.pointA; - } - if ("pointB" in data && data.pointB != undefined) { - this.pointB = data.pointB; - } - if ("pointC" in data && data.pointC != undefined) { - this.pointC = data.pointC; - } - if ("paRef" in data && data.paRef != undefined) { - this.paRef = data.paRef; - } - if ("pbRef" in data && data.pbRef != undefined) { - this.pbRef = data.pbRef; - } - if ("pcRef" in data && data.pcRef != undefined) { - this.pcRef = data.pcRef; - } - if ("kilometerSystem" in data && data.kilometerSystem != undefined) { - this.kilometerSystem = data.kilometerSystem; - } - if ("switchMachineType" in data && data.switchMachineType != undefined) { - this.switchMachineType = data.switchMachineType; - } - if ("centralizedStations" in data && data.centralizedStations != undefined) { - this.centralizedStations = data.centralizedStations; - } - if ("paTrackSectionId" in data && data.paTrackSectionId != undefined) { - this.paTrackSectionId = data.paTrackSectionId; - } - if ("pbTrackSectionId" in data && data.pbTrackSectionId != undefined) { - this.pbTrackSectionId = data.pbTrackSectionId; - } - if ("pcTrackSectionId" in data && data.pcTrackSectionId != undefined) { - this.pcTrackSectionId = data.pcTrackSectionId; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [6, 7, 8, 13, 20], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('pointA' in data && data.pointA != undefined) { + this.pointA = data.pointA; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('pointB' in data && data.pointB != undefined) { + this.pointB = data.pointB; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('pointC' in data && data.pointC != undefined) { + this.pointC = data.pointC; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); + if ('paRef' in data && data.paRef != undefined) { + this.paRef = data.paRef; } - get pointA() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 6) as Point[]; + if ('pbRef' in data && data.pbRef != undefined) { + this.pbRef = data.pbRef; } - set pointA(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 6, value); + if ('pcRef' in data && data.pcRef != undefined) { + this.pcRef = data.pcRef; } - get pointB() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 7) as Point[]; + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } - set pointB(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 7, value); + if ( + 'switchMachineType' in data && + data.switchMachineType != undefined + ) { + this.switchMachineType = data.switchMachineType; } - get pointC() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 8) as Point[]; + if ( + 'centralizedStations' in data && + data.centralizedStations != undefined + ) { + this.centralizedStations = data.centralizedStations; } - set pointC(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 8, value); + if ('paTrackSectionId' in data && data.paTrackSectionId != undefined) { + this.paTrackSectionId = data.paTrackSectionId; } - get paRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 9) as RelatedRef; + if ('pbTrackSectionId' in data && data.pbTrackSectionId != undefined) { + this.pbTrackSectionId = data.pbTrackSectionId; } - set paRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 9, value); - } - get has_paRef() { - return pb_1.Message.getField(this, 9) != null; - } - get pbRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 10) as RelatedRef; - } - set pbRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 10, value); - } - get has_pbRef() { - return pb_1.Message.getField(this, 10) != null; - } - get pcRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 11) as RelatedRef; - } - set pcRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 11, value); - } - get has_pcRef() { - return pb_1.Message.getField(this, 11) != null; - } - get kilometerSystem() { - return pb_1.Message.getRepeatedWrapperField(this, KilometerSystem, 13) as KilometerSystem[]; - } - set kilometerSystem(value: KilometerSystem[]) { - pb_1.Message.setRepeatedWrapperField(this, 13, value); - } - get switchMachineType() { - return pb_1.Message.getFieldWithDefault(this, 18, Turnout.SwitchMachineType.Unknown) as Turnout.SwitchMachineType; - } - set switchMachineType(value: Turnout.SwitchMachineType) { - pb_1.Message.setField(this, 18, value); - } - get centralizedStations() { - return pb_1.Message.getFieldWithDefault(this, 20, []) as number[]; - } - set centralizedStations(value: number[]) { - pb_1.Message.setField(this, 20, value); - } - get paTrackSectionId() { - return pb_1.Message.getFieldWithDefault(this, 21, 0) as number; - } - set paTrackSectionId(value: number) { - pb_1.Message.setField(this, 21, value); - } - get pbTrackSectionId() { - return pb_1.Message.getFieldWithDefault(this, 22, 0) as number; - } - set pbTrackSectionId(value: number) { - pb_1.Message.setField(this, 22, value); - } - get pcTrackSectionId() { - return pb_1.Message.getFieldWithDefault(this, 23, 0) as number; - } - set pcTrackSectionId(value: number) { - pb_1.Message.setField(this, 23, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - pointA?: ReturnType[]; - pointB?: ReturnType[]; - pointC?: ReturnType[]; - paRef?: ReturnType; - pbRef?: ReturnType; - pcRef?: ReturnType; - kilometerSystem?: ReturnType[]; - switchMachineType?: Turnout.SwitchMachineType; - centralizedStations?: number[]; - paTrackSectionId?: number; - pbTrackSectionId?: number; - pcTrackSectionId?: number; - }): Turnout { - const message = new Turnout({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.pointA != null) { - message.pointA = data.pointA.map(item => Point.fromObject(item)); - } - if (data.pointB != null) { - message.pointB = data.pointB.map(item => Point.fromObject(item)); - } - if (data.pointC != null) { - message.pointC = data.pointC.map(item => Point.fromObject(item)); - } - if (data.paRef != null) { - message.paRef = RelatedRef.fromObject(data.paRef); - } - if (data.pbRef != null) { - message.pbRef = RelatedRef.fromObject(data.pbRef); - } - if (data.pcRef != null) { - message.pcRef = RelatedRef.fromObject(data.pcRef); - } - if (data.kilometerSystem != null) { - message.kilometerSystem = data.kilometerSystem.map(item => KilometerSystem.fromObject(item)); - } - if (data.switchMachineType != null) { - message.switchMachineType = data.switchMachineType; - } - if (data.centralizedStations != null) { - message.centralizedStations = data.centralizedStations; - } - if (data.paTrackSectionId != null) { - message.paTrackSectionId = data.paTrackSectionId; - } - if (data.pbTrackSectionId != null) { - message.pbTrackSectionId = data.pbTrackSectionId; - } - if (data.pcTrackSectionId != null) { - message.pcTrackSectionId = data.pcTrackSectionId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - pointA?: ReturnType[]; - pointB?: ReturnType[]; - pointC?: ReturnType[]; - paRef?: ReturnType; - pbRef?: ReturnType; - pcRef?: ReturnType; - kilometerSystem?: ReturnType[]; - switchMachineType?: Turnout.SwitchMachineType; - centralizedStations?: number[]; - paTrackSectionId?: number; - pbTrackSectionId?: number; - pcTrackSectionId?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.pointA != null) { - data.pointA = this.pointA.map((item: Point) => item.toObject()); - } - if (this.pointB != null) { - data.pointB = this.pointB.map((item: Point) => item.toObject()); - } - if (this.pointC != null) { - data.pointC = this.pointC.map((item: Point) => item.toObject()); - } - if (this.paRef != null) { - data.paRef = this.paRef.toObject(); - } - if (this.pbRef != null) { - data.pbRef = this.pbRef.toObject(); - } - if (this.pcRef != null) { - data.pcRef = this.pcRef.toObject(); - } - if (this.kilometerSystem != null) { - data.kilometerSystem = this.kilometerSystem.map((item: KilometerSystem) => item.toObject()); - } - if (this.switchMachineType != null) { - data.switchMachineType = this.switchMachineType; - } - if (this.centralizedStations != null) { - data.centralizedStations = this.centralizedStations; - } - if (this.paTrackSectionId != null) { - data.paTrackSectionId = this.paTrackSectionId; - } - if (this.pbTrackSectionId != null) { - data.pbTrackSectionId = this.pbTrackSectionId; - } - if (this.pcTrackSectionId != null) { - data.pcTrackSectionId = this.pcTrackSectionId; - } - 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.pointA.length) - writer.writeRepeatedMessage(6, this.pointA, (item: Point) => item.serialize(writer)); - if (this.pointB.length) - writer.writeRepeatedMessage(7, this.pointB, (item: Point) => item.serialize(writer)); - if (this.pointC.length) - writer.writeRepeatedMessage(8, this.pointC, (item: Point) => item.serialize(writer)); - if (this.has_paRef) - writer.writeMessage(9, this.paRef, () => this.paRef.serialize(writer)); - if (this.has_pbRef) - writer.writeMessage(10, this.pbRef, () => this.pbRef.serialize(writer)); - if (this.has_pcRef) - writer.writeMessage(11, this.pcRef, () => this.pcRef.serialize(writer)); - if (this.kilometerSystem.length) - writer.writeRepeatedMessage(13, this.kilometerSystem, (item: KilometerSystem) => item.serialize(writer)); - if (this.switchMachineType != Turnout.SwitchMachineType.Unknown) - writer.writeEnum(18, this.switchMachineType); - if (this.centralizedStations.length) - writer.writePackedUint32(20, this.centralizedStations); - if (this.paTrackSectionId != 0) - writer.writeUint32(21, this.paTrackSectionId); - if (this.pbTrackSectionId != 0) - writer.writeUint32(22, this.pbTrackSectionId); - if (this.pcTrackSectionId != 0) - writer.writeUint32(23, this.pcTrackSectionId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Turnout { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Turnout(); - 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 6: - reader.readMessage(message.pointA, () => pb_1.Message.addToRepeatedWrapperField(message, 6, Point.deserialize(reader), Point)); - break; - case 7: - reader.readMessage(message.pointB, () => pb_1.Message.addToRepeatedWrapperField(message, 7, Point.deserialize(reader), Point)); - break; - case 8: - reader.readMessage(message.pointC, () => pb_1.Message.addToRepeatedWrapperField(message, 8, Point.deserialize(reader), Point)); - break; - case 9: - reader.readMessage(message.paRef, () => message.paRef = RelatedRef.deserialize(reader)); - break; - case 10: - reader.readMessage(message.pbRef, () => message.pbRef = RelatedRef.deserialize(reader)); - break; - case 11: - reader.readMessage(message.pcRef, () => message.pcRef = RelatedRef.deserialize(reader)); - break; - case 13: - reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 13, KilometerSystem.deserialize(reader), KilometerSystem)); - break; - case 18: - message.switchMachineType = reader.readEnum(); - break; - case 20: - message.centralizedStations = reader.readPackedUint32(); - break; - case 21: - message.paTrackSectionId = reader.readUint32(); - break; - case 22: - message.pbTrackSectionId = reader.readUint32(); - break; - case 23: - message.pcTrackSectionId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Turnout { - return Turnout.deserialize(bytes); + if ('pcTrackSectionId' in data && data.pcTrackSectionId != undefined) { + this.pcTrackSectionId = data.pcTrackSectionId; } + } } - export namespace Turnout { - export enum SwitchMachineType { - Unknown = 0, - ZDJ9_Single = 1, - ZDJ9_Double = 2 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class KilometerSystem extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 pointA() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 6) as Point[]; + } + set pointA(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 6, value); + } + get pointB() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 7) as Point[]; + } + set pointB(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 7, value); + } + get pointC() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 8) as Point[]; + } + set pointC(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 8, value); + } + get paRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 9) as RelatedRef; + } + set paRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 9, value); + } + get has_paRef() { + return pb_1.Message.getField(this, 9) != null; + } + get pbRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 10) as RelatedRef; + } + set pbRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 10, value); + } + get has_pbRef() { + return pb_1.Message.getField(this, 10) != null; + } + get pcRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 11) as RelatedRef; + } + set pcRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 11, value); + } + get has_pcRef() { + return pb_1.Message.getField(this, 11) != null; + } + get kilometerSystem() { + return pb_1.Message.getRepeatedWrapperField( + this, + KilometerSystem, + 13 + ) as KilometerSystem[]; + } + set kilometerSystem(value: KilometerSystem[]) { + pb_1.Message.setRepeatedWrapperField(this, 13, value); + } + get switchMachineType() { + return pb_1.Message.getFieldWithDefault( + this, + 18, + Turnout.SwitchMachineType.Unknown + ) as Turnout.SwitchMachineType; + } + set switchMachineType(value: Turnout.SwitchMachineType) { + pb_1.Message.setField(this, 18, value); + } + get centralizedStations() { + return pb_1.Message.getFieldWithDefault(this, 20, []) as number[]; + } + set centralizedStations(value: number[]) { + pb_1.Message.setField(this, 20, value); + } + get paTrackSectionId() { + return pb_1.Message.getFieldWithDefault(this, 21, 0) as number; + } + set paTrackSectionId(value: number) { + pb_1.Message.setField(this, 21, value); + } + get pbTrackSectionId() { + return pb_1.Message.getFieldWithDefault(this, 22, 0) as number; + } + set pbTrackSectionId(value: number) { + pb_1.Message.setField(this, 22, value); + } + get pcTrackSectionId() { + return pb_1.Message.getFieldWithDefault(this, 23, 0) as number; + } + set pcTrackSectionId(value: number) { + pb_1.Message.setField(this, 23, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + pointA?: ReturnType[]; + pointB?: ReturnType[]; + pointC?: ReturnType[]; + paRef?: ReturnType; + pbRef?: ReturnType; + pcRef?: ReturnType; + kilometerSystem?: ReturnType[]; + switchMachineType?: Turnout.SwitchMachineType; + centralizedStations?: number[]; + paTrackSectionId?: number; + pbTrackSectionId?: number; + pcTrackSectionId?: number; + }): Turnout { + const message = new Turnout({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.pointA != null) { + message.pointA = data.pointA.map((item) => Point.fromObject(item)); + } + if (data.pointB != null) { + message.pointB = data.pointB.map((item) => Point.fromObject(item)); + } + if (data.pointC != null) { + message.pointC = data.pointC.map((item) => Point.fromObject(item)); + } + if (data.paRef != null) { + message.paRef = RelatedRef.fromObject(data.paRef); + } + if (data.pbRef != null) { + message.pbRef = RelatedRef.fromObject(data.pbRef); + } + if (data.pcRef != null) { + message.pcRef = RelatedRef.fromObject(data.pcRef); + } + if (data.kilometerSystem != null) { + message.kilometerSystem = data.kilometerSystem.map((item) => + KilometerSystem.fromObject(item) + ); + } + if (data.switchMachineType != null) { + message.switchMachineType = data.switchMachineType; + } + if (data.centralizedStations != null) { + message.centralizedStations = data.centralizedStations; + } + if (data.paTrackSectionId != null) { + message.paTrackSectionId = data.paTrackSectionId; + } + if (data.pbTrackSectionId != null) { + message.pbTrackSectionId = data.pbTrackSectionId; + } + if (data.pcTrackSectionId != null) { + message.pcTrackSectionId = data.pcTrackSectionId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + pointA?: ReturnType[]; + pointB?: ReturnType[]; + pointC?: ReturnType[]; + paRef?: ReturnType; + pbRef?: ReturnType; + pcRef?: ReturnType; + kilometerSystem?: ReturnType< + typeof KilometerSystem.prototype.toObject + >[]; + switchMachineType?: Turnout.SwitchMachineType; + centralizedStations?: number[]; + paTrackSectionId?: number; + pbTrackSectionId?: number; + pcTrackSectionId?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.pointA != null) { + data.pointA = this.pointA.map((item: Point) => item.toObject()); + } + if (this.pointB != null) { + data.pointB = this.pointB.map((item: Point) => item.toObject()); + } + if (this.pointC != null) { + data.pointC = this.pointC.map((item: Point) => item.toObject()); + } + if (this.paRef != null) { + data.paRef = this.paRef.toObject(); + } + if (this.pbRef != null) { + data.pbRef = this.pbRef.toObject(); + } + if (this.pcRef != null) { + data.pcRef = this.pcRef.toObject(); + } + if (this.kilometerSystem != null) { + data.kilometerSystem = this.kilometerSystem.map( + (item: KilometerSystem) => item.toObject() + ); + } + if (this.switchMachineType != null) { + data.switchMachineType = this.switchMachineType; + } + if (this.centralizedStations != null) { + data.centralizedStations = this.centralizedStations; + } + if (this.paTrackSectionId != null) { + data.paTrackSectionId = this.paTrackSectionId; + } + if (this.pbTrackSectionId != null) { + data.pbTrackSectionId = this.pbTrackSectionId; + } + if (this.pcTrackSectionId != null) { + data.pcTrackSectionId = this.pcTrackSectionId; + } + 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.pointA.length) + writer.writeRepeatedMessage(6, this.pointA, (item: Point) => + item.serialize(writer) + ); + if (this.pointB.length) + writer.writeRepeatedMessage(7, this.pointB, (item: Point) => + item.serialize(writer) + ); + if (this.pointC.length) + writer.writeRepeatedMessage(8, this.pointC, (item: Point) => + item.serialize(writer) + ); + if (this.has_paRef) + writer.writeMessage(9, this.paRef, () => this.paRef.serialize(writer)); + if (this.has_pbRef) + writer.writeMessage(10, this.pbRef, () => this.pbRef.serialize(writer)); + if (this.has_pcRef) + writer.writeMessage(11, this.pcRef, () => this.pcRef.serialize(writer)); + if (this.kilometerSystem.length) + writer.writeRepeatedMessage( + 13, + this.kilometerSystem, + (item: KilometerSystem) => item.serialize(writer) + ); + if (this.switchMachineType != Turnout.SwitchMachineType.Unknown) + writer.writeEnum(18, this.switchMachineType); + if (this.centralizedStations.length) + writer.writePackedUint32(20, this.centralizedStations); + if (this.paTrackSectionId != 0) + writer.writeUint32(21, this.paTrackSectionId); + if (this.pbTrackSectionId != 0) + writer.writeUint32(22, this.pbTrackSectionId); + if (this.pcTrackSectionId != 0) + writer.writeUint32(23, this.pcTrackSectionId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Turnout { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Turnout(); + 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 6: + reader.readMessage(message.pointA, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 6, + Point.deserialize(reader), + Point + ) + ); + break; + case 7: + reader.readMessage(message.pointB, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 7, + Point.deserialize(reader), + Point + ) + ); + break; + case 8: + reader.readMessage(message.pointC, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 8, + Point.deserialize(reader), + Point + ) + ); + break; + case 9: + reader.readMessage( + message.paRef, + () => (message.paRef = RelatedRef.deserialize(reader)) + ); + break; + case 10: + reader.readMessage( + message.pbRef, + () => (message.pbRef = RelatedRef.deserialize(reader)) + ); + break; + case 11: + reader.readMessage( + message.pcRef, + () => (message.pcRef = RelatedRef.deserialize(reader)) + ); + break; + case 13: + reader.readMessage(message.kilometerSystem, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 13, + KilometerSystem.deserialize(reader), + KilometerSystem + ) + ); + break; + case 18: + message.switchMachineType = reader.readEnum(); + break; + case 20: + message.centralizedStations = reader.readPackedUint32(); + break; + case 21: + message.paTrackSectionId = reader.readUint32(); + break; + case 22: + message.pbTrackSectionId = reader.readUint32(); + break; + case 23: + message.pcTrackSectionId = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Turnout { + return Turnout.deserialize(bytes); + } + } + export namespace Turnout { + export enum SwitchMachineType { + Unknown = 0, + ZDJ9_Single = 1, + ZDJ9_Double = 2, + } + } + export class KilometerSystem extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { kilometer?: number; coordinateSystem?: string; direction?: KilometerSystem.Direction; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("kilometer" in data && data.kilometer != undefined) { - this.kilometer = data.kilometer; - } - if ("coordinateSystem" in data && data.coordinateSystem != undefined) { - this.coordinateSystem = data.coordinateSystem; - } - if ("direction" in data && data.direction != undefined) { - this.direction = data.direction; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('kilometer' in data && data.kilometer != undefined) { + this.kilometer = data.kilometer; } - get kilometer() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + if ('coordinateSystem' in data && data.coordinateSystem != undefined) { + this.coordinateSystem = data.coordinateSystem; } - set kilometer(value: number) { - pb_1.Message.setField(this, 1, value); - } - get coordinateSystem() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set coordinateSystem(value: string) { - pb_1.Message.setField(this, 2, value); - } - get direction() { - return pb_1.Message.getFieldWithDefault(this, 3, KilometerSystem.Direction.LEFT) as KilometerSystem.Direction; - } - set direction(value: KilometerSystem.Direction) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - kilometer?: number; - coordinateSystem?: string; - direction?: KilometerSystem.Direction; - }): KilometerSystem { - const message = new KilometerSystem({}); - if (data.kilometer != null) { - message.kilometer = data.kilometer; - } - 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?: KilometerSystem.Direction; - } = {}; - if (this.kilometer != null) { - data.kilometer = this.kilometer; - } - if (this.coordinateSystem != null) { - data.coordinateSystem = this.coordinateSystem; - } - if (this.direction != null) { - data.direction = this.direction; - } - 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.kilometer != 0) - writer.writeInt64(1, this.kilometer); - if (this.coordinateSystem.length) - writer.writeString(2, this.coordinateSystem); - if (this.direction != KilometerSystem.Direction.LEFT) - writer.writeEnum(3, this.direction); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): KilometerSystem { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new KilometerSystem(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.kilometer = reader.readInt64(); - break; - case 2: - message.coordinateSystem = reader.readString(); - break; - case 3: - message.direction = reader.readEnum(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): KilometerSystem { - return KilometerSystem.deserialize(bytes); + if ('direction' in data && data.direction != undefined) { + this.direction = data.direction; } + } } - export namespace KilometerSystem { - export enum Direction { - LEFT = 0, - RIGHT = 1 - } + get kilometer() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } - export class Signal extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + set kilometer(value: number) { + pb_1.Message.setField(this, 1, value); + } + get coordinateSystem() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set coordinateSystem(value: string) { + pb_1.Message.setField(this, 2, value); + } + get direction() { + return pb_1.Message.getFieldWithDefault( + this, + 3, + KilometerSystem.Direction.LEFT + ) as KilometerSystem.Direction; + } + set direction(value: KilometerSystem.Direction) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + kilometer?: number; + coordinateSystem?: string; + direction?: KilometerSystem.Direction; + }): KilometerSystem { + const message = new KilometerSystem({}); + if (data.kilometer != null) { + message.kilometer = data.kilometer; + } + 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?: KilometerSystem.Direction; + } = {}; + if (this.kilometer != null) { + data.kilometer = this.kilometer; + } + if (this.coordinateSystem != null) { + data.coordinateSystem = this.coordinateSystem; + } + if (this.direction != null) { + data.direction = this.direction; + } + 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.kilometer != 0) writer.writeInt64(1, this.kilometer); + if (this.coordinateSystem.length) + writer.writeString(2, this.coordinateSystem); + if (this.direction != KilometerSystem.Direction.LEFT) + writer.writeEnum(3, this.direction); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): KilometerSystem { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new KilometerSystem(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.kilometer = reader.readInt64(); + break; + case 2: + message.coordinateSystem = reader.readString(); + break; + case 3: + message.direction = reader.readEnum(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): KilometerSystem { + return KilometerSystem.deserialize(bytes); + } + } + export namespace KilometerSystem { + export enum Direction { + LEFT = 0, + RIGHT = 1, + } + } + export class Signal extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; mirror?: boolean; @@ -3885,247 +5196,290 @@ export namespace graphicData { mt?: Signal.Model; direction?: Direction; centralizedStations?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [13], 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 ("mirror" in data && data.mirror != undefined) { - this.mirror = data.mirror; - } - if ("kilometerSystem" in data && data.kilometerSystem != undefined) { - this.kilometerSystem = data.kilometerSystem; - } - if ("refDev" in data && data.refDev != undefined) { - this.refDev = data.refDev; - } - if ("mt" in data && data.mt != undefined) { - this.mt = data.mt; - } - if ("direction" in data && data.direction != undefined) { - this.direction = data.direction; - } - if ("centralizedStations" in data && data.centralizedStations != undefined) { - this.centralizedStations = data.centralizedStations; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [13], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('mirror' in data && data.mirror != undefined) { + this.mirror = data.mirror; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('refDev' in data && data.refDev != undefined) { + this.refDev = data.refDev; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); + if ('mt' in data && data.mt != undefined) { + this.mt = data.mt; } - get mirror() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + if ('direction' in data && data.direction != undefined) { + this.direction = data.direction; } - set mirror(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get kilometerSystem() { - return pb_1.Message.getWrapperField(this, KilometerSystem, 6) as KilometerSystem; - } - set kilometerSystem(value: KilometerSystem) { - pb_1.Message.setWrapperField(this, 6, value); - } - get has_kilometerSystem() { - return pb_1.Message.getField(this, 6) != null; - } - 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; - } - get mt() { - return pb_1.Message.getFieldWithDefault(this, 10, Signal.Model.HL) as Signal.Model; - } - set mt(value: Signal.Model) { - pb_1.Message.setField(this, 10, value); - } - get direction() { - return pb_1.Message.getFieldWithDefault(this, 12, Direction.UP) as Direction; - } - set direction(value: Direction) { - pb_1.Message.setField(this, 12, value); - } - get centralizedStations() { - return pb_1.Message.getFieldWithDefault(this, 13, []) as number[]; - } - set centralizedStations(value: number[]) { - pb_1.Message.setField(this, 13, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - mirror?: boolean; - kilometerSystem?: ReturnType; - refDev?: ReturnType; - mt?: Signal.Model; - direction?: Direction; - centralizedStations?: number[]; - }): Signal { - const message = new Signal({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.mirror != null) { - message.mirror = data.mirror; - } - if (data.kilometerSystem != null) { - message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); - } - if (data.refDev != null) { - message.refDev = RelatedRef.fromObject(data.refDev); - } - if (data.mt != null) { - message.mt = data.mt; - } - if (data.direction != null) { - message.direction = data.direction; - } - if (data.centralizedStations != null) { - message.centralizedStations = data.centralizedStations; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - mirror?: boolean; - kilometerSystem?: ReturnType; - refDev?: ReturnType; - mt?: Signal.Model; - direction?: Direction; - centralizedStations?: number[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.mirror != null) { - data.mirror = this.mirror; - } - if (this.kilometerSystem != null) { - data.kilometerSystem = this.kilometerSystem.toObject(); - } - if (this.refDev != null) { - data.refDev = this.refDev.toObject(); - } - if (this.mt != null) { - data.mt = this.mt; - } - if (this.direction != null) { - data.direction = this.direction; - } - if (this.centralizedStations != null) { - data.centralizedStations = this.centralizedStations; - } - 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.mirror != false) - writer.writeBool(3, this.mirror); - if (this.has_kilometerSystem) - writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); - if (this.has_refDev) - writer.writeMessage(8, this.refDev, () => this.refDev.serialize(writer)); - if (this.mt != Signal.Model.HL) - writer.writeEnum(10, this.mt); - if (this.direction != Direction.UP) - writer.writeEnum(12, this.direction); - if (this.centralizedStations.length) - writer.writePackedUint32(13, this.centralizedStations); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signal { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Signal(); - 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.mirror = reader.readBool(); - break; - case 6: - reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); - break; - case 8: - reader.readMessage(message.refDev, () => message.refDev = RelatedRef.deserialize(reader)); - break; - case 10: - message.mt = reader.readEnum(); - break; - case 12: - message.direction = reader.readEnum(); - break; - case 13: - message.centralizedStations = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Signal { - return Signal.deserialize(bytes); + if ( + 'centralizedStations' in data && + data.centralizedStations != undefined + ) { + this.centralizedStations = data.centralizedStations; } + } } - export namespace Signal { - export enum Model { - HL = 0, - HLU_FU = 1, - HLU_DU_YY = 2, - HLU_YY = 3, - HLU_FL_DU_YY = 4, - HLU_DU = 5, - AB = 6, - HBU_DU = 7 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class Section extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 mirror() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set mirror(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get kilometerSystem() { + return pb_1.Message.getWrapperField( + this, + KilometerSystem, + 6 + ) as KilometerSystem; + } + set kilometerSystem(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 6, value); + } + get has_kilometerSystem() { + return pb_1.Message.getField(this, 6) != null; + } + 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; + } + get mt() { + return pb_1.Message.getFieldWithDefault( + this, + 10, + Signal.Model.HL + ) as Signal.Model; + } + set mt(value: Signal.Model) { + pb_1.Message.setField(this, 10, value); + } + get direction() { + return pb_1.Message.getFieldWithDefault( + this, + 12, + Direction.UP + ) as Direction; + } + set direction(value: Direction) { + pb_1.Message.setField(this, 12, value); + } + get centralizedStations() { + return pb_1.Message.getFieldWithDefault(this, 13, []) as number[]; + } + set centralizedStations(value: number[]) { + pb_1.Message.setField(this, 13, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + mirror?: boolean; + kilometerSystem?: ReturnType; + refDev?: ReturnType; + mt?: Signal.Model; + direction?: Direction; + centralizedStations?: number[]; + }): Signal { + const message = new Signal({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.mirror != null) { + message.mirror = data.mirror; + } + if (data.kilometerSystem != null) { + message.kilometerSystem = KilometerSystem.fromObject( + data.kilometerSystem + ); + } + if (data.refDev != null) { + message.refDev = RelatedRef.fromObject(data.refDev); + } + if (data.mt != null) { + message.mt = data.mt; + } + if (data.direction != null) { + message.direction = data.direction; + } + if (data.centralizedStations != null) { + message.centralizedStations = data.centralizedStations; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + mirror?: boolean; + kilometerSystem?: ReturnType; + refDev?: ReturnType; + mt?: Signal.Model; + direction?: Direction; + centralizedStations?: number[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.mirror != null) { + data.mirror = this.mirror; + } + if (this.kilometerSystem != null) { + data.kilometerSystem = this.kilometerSystem.toObject(); + } + if (this.refDev != null) { + data.refDev = this.refDev.toObject(); + } + if (this.mt != null) { + data.mt = this.mt; + } + if (this.direction != null) { + data.direction = this.direction; + } + if (this.centralizedStations != null) { + data.centralizedStations = this.centralizedStations; + } + 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.mirror != false) writer.writeBool(3, this.mirror); + if (this.has_kilometerSystem) + writer.writeMessage(6, this.kilometerSystem, () => + this.kilometerSystem.serialize(writer) + ); + if (this.has_refDev) + writer.writeMessage(8, this.refDev, () => + this.refDev.serialize(writer) + ); + if (this.mt != Signal.Model.HL) writer.writeEnum(10, this.mt); + if (this.direction != Direction.UP) writer.writeEnum(12, this.direction); + if (this.centralizedStations.length) + writer.writePackedUint32(13, this.centralizedStations); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signal { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Signal(); + 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.mirror = reader.readBool(); + break; + case 6: + reader.readMessage( + message.kilometerSystem, + () => + (message.kilometerSystem = KilometerSystem.deserialize(reader)) + ); + break; + case 8: + reader.readMessage( + message.refDev, + () => (message.refDev = RelatedRef.deserialize(reader)) + ); + break; + case 10: + message.mt = reader.readEnum(); + break; + case 12: + message.direction = reader.readEnum(); + break; + case 13: + message.centralizedStations = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Signal { + return Signal.deserialize(bytes); + } + } + export namespace Signal { + export enum Model { + HL = 0, + HLU_FU = 1, + HLU_DU_YY = 2, + HLU_YY = 3, + HLU_FL_DU_YY = 4, + HLU_DU = 5, + AB = 6, + HBU_DU = 7, + } + } + export class Section extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; points?: Point[]; @@ -4140,720 +5494,813 @@ export namespace graphicData { axleCountings?: number[]; trackSectionId?: number; centralizedStations?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 17, 19], 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 ("paRef" in data && data.paRef != undefined) { - this.paRef = data.paRef; - } - if ("pbRef" in data && data.pbRef != undefined) { - this.pbRef = data.pbRef; - } - if ("sectionType" in data && data.sectionType != undefined) { - this.sectionType = data.sectionType; - } - if ("isCurve" in data && data.isCurve != undefined) { - this.isCurve = data.isCurve; - } - if ("segmentsCount" in data && data.segmentsCount != undefined) { - this.segmentsCount = data.segmentsCount; - } - if ("normalRunningDirection" in data && data.normalRunningDirection != undefined) { - this.normalRunningDirection = data.normalRunningDirection; - } - if ("isTurnBackZone" in data && data.isTurnBackZone != undefined) { - this.isTurnBackZone = data.isTurnBackZone; - } - if ("direction" in data && data.direction != undefined) { - this.direction = data.direction; - } - if ("axleCountings" in data && data.axleCountings != undefined) { - this.axleCountings = data.axleCountings; - } - if ("trackSectionId" in data && data.trackSectionId != undefined) { - this.trackSectionId = data.trackSectionId; - } - if ("centralizedStations" in data && data.centralizedStations != undefined) { - this.centralizedStations = data.centralizedStations; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3, 17, 19], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('points' in data && data.points != undefined) { + this.points = data.points; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('paRef' in data && data.paRef != undefined) { + this.paRef = data.paRef; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('pbRef' in data && data.pbRef != undefined) { + this.pbRef = data.pbRef; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); + if ('sectionType' in data && data.sectionType != undefined) { + this.sectionType = data.sectionType; } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; + if ('isCurve' in data && data.isCurve != undefined) { + this.isCurve = data.isCurve; } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); + if ('segmentsCount' in data && data.segmentsCount != undefined) { + this.segmentsCount = data.segmentsCount; } - get paRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 4) as RelatedRef; + if ( + 'normalRunningDirection' in data && + data.normalRunningDirection != undefined + ) { + this.normalRunningDirection = data.normalRunningDirection; } - set paRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 4, value); + if ('isTurnBackZone' in data && data.isTurnBackZone != undefined) { + this.isTurnBackZone = data.isTurnBackZone; } - get has_paRef() { - return pb_1.Message.getField(this, 4) != null; + if ('direction' in data && data.direction != undefined) { + this.direction = data.direction; } - get pbRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 5) as RelatedRef; + if ('axleCountings' in data && data.axleCountings != undefined) { + this.axleCountings = data.axleCountings; } - set pbRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 5, value); + if ('trackSectionId' in data && data.trackSectionId != undefined) { + this.trackSectionId = data.trackSectionId; } - get has_pbRef() { - return pb_1.Message.getField(this, 5) != null; - } - get sectionType() { - return pb_1.Message.getFieldWithDefault(this, 6, Section.SectionType.Physical) as Section.SectionType; - } - set sectionType(value: Section.SectionType) { - pb_1.Message.setField(this, 6, value); - } - get isCurve() { - return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; - } - set isCurve(value: boolean) { - pb_1.Message.setField(this, 10, value); - } - get segmentsCount() { - return pb_1.Message.getFieldWithDefault(this, 12, 0) as number; - } - set segmentsCount(value: number) { - pb_1.Message.setField(this, 12, value); - } - get normalRunningDirection() { - return pb_1.Message.getFieldWithDefault(this, 14, Section.RunningDirection.AtoB) as Section.RunningDirection; - } - set normalRunningDirection(value: Section.RunningDirection) { - pb_1.Message.setField(this, 14, value); - } - get isTurnBackZone() { - return pb_1.Message.getFieldWithDefault(this, 15, false) as boolean; - } - set isTurnBackZone(value: boolean) { - pb_1.Message.setField(this, 15, value); - } - get direction() { - return pb_1.Message.getFieldWithDefault(this, 16, Direction.UP) as Direction; - } - set direction(value: Direction) { - pb_1.Message.setField(this, 16, value); - } - get axleCountings() { - return pb_1.Message.getFieldWithDefault(this, 17, []) as number[]; - } - set axleCountings(value: number[]) { - pb_1.Message.setField(this, 17, value); - } - get trackSectionId() { - return pb_1.Message.getFieldWithDefault(this, 18, 0) as number; - } - set trackSectionId(value: number) { - pb_1.Message.setField(this, 18, value); - } - get centralizedStations() { - return pb_1.Message.getFieldWithDefault(this, 19, []) as number[]; - } - set centralizedStations(value: number[]) { - pb_1.Message.setField(this, 19, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - paRef?: ReturnType; - pbRef?: ReturnType; - sectionType?: Section.SectionType; - isCurve?: boolean; - segmentsCount?: number; - normalRunningDirection?: Section.RunningDirection; - isTurnBackZone?: boolean; - direction?: Direction; - axleCountings?: number[]; - trackSectionId?: number; - centralizedStations?: number[]; - }): Section { - const message = new Section({}); - 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.paRef != null) { - message.paRef = RelatedRef.fromObject(data.paRef); - } - if (data.pbRef != null) { - message.pbRef = RelatedRef.fromObject(data.pbRef); - } - if (data.sectionType != null) { - message.sectionType = data.sectionType; - } - if (data.isCurve != null) { - message.isCurve = data.isCurve; - } - if (data.segmentsCount != null) { - message.segmentsCount = data.segmentsCount; - } - if (data.normalRunningDirection != null) { - message.normalRunningDirection = data.normalRunningDirection; - } - if (data.isTurnBackZone != null) { - message.isTurnBackZone = data.isTurnBackZone; - } - if (data.direction != null) { - message.direction = data.direction; - } - if (data.axleCountings != null) { - message.axleCountings = data.axleCountings; - } - if (data.trackSectionId != null) { - message.trackSectionId = data.trackSectionId; - } - if (data.centralizedStations != null) { - message.centralizedStations = data.centralizedStations; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - paRef?: ReturnType; - pbRef?: ReturnType; - sectionType?: Section.SectionType; - isCurve?: boolean; - segmentsCount?: number; - normalRunningDirection?: Section.RunningDirection; - isTurnBackZone?: boolean; - direction?: Direction; - axleCountings?: number[]; - trackSectionId?: number; - centralizedStations?: number[]; - } = {}; - 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.paRef != null) { - data.paRef = this.paRef.toObject(); - } - if (this.pbRef != null) { - data.pbRef = this.pbRef.toObject(); - } - if (this.sectionType != null) { - data.sectionType = this.sectionType; - } - if (this.isCurve != null) { - data.isCurve = this.isCurve; - } - if (this.segmentsCount != null) { - data.segmentsCount = this.segmentsCount; - } - if (this.normalRunningDirection != null) { - data.normalRunningDirection = this.normalRunningDirection; - } - if (this.isTurnBackZone != null) { - data.isTurnBackZone = this.isTurnBackZone; - } - if (this.direction != null) { - data.direction = this.direction; - } - if (this.axleCountings != null) { - data.axleCountings = this.axleCountings; - } - if (this.trackSectionId != null) { - data.trackSectionId = this.trackSectionId; - } - if (this.centralizedStations != null) { - data.centralizedStations = this.centralizedStations; - } - 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.has_paRef) - writer.writeMessage(4, this.paRef, () => this.paRef.serialize(writer)); - if (this.has_pbRef) - writer.writeMessage(5, this.pbRef, () => this.pbRef.serialize(writer)); - if (this.sectionType != Section.SectionType.Physical) - writer.writeEnum(6, this.sectionType); - if (this.isCurve != false) - writer.writeBool(10, this.isCurve); - if (this.segmentsCount != 0) - writer.writeInt32(12, this.segmentsCount); - if (this.normalRunningDirection != Section.RunningDirection.AtoB) - writer.writeEnum(14, this.normalRunningDirection); - if (this.isTurnBackZone != false) - writer.writeBool(15, this.isTurnBackZone); - if (this.direction != Direction.UP) - writer.writeEnum(16, this.direction); - if (this.axleCountings.length) - writer.writePackedUint32(17, this.axleCountings); - if (this.trackSectionId != 0) - writer.writeUint32(18, this.trackSectionId); - if (this.centralizedStations.length) - writer.writePackedUint32(19, this.centralizedStations); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Section { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Section(); - 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: - reader.readMessage(message.paRef, () => message.paRef = RelatedRef.deserialize(reader)); - break; - case 5: - reader.readMessage(message.pbRef, () => message.pbRef = RelatedRef.deserialize(reader)); - break; - case 6: - message.sectionType = reader.readEnum(); - break; - case 10: - message.isCurve = reader.readBool(); - break; - case 12: - message.segmentsCount = reader.readInt32(); - break; - case 14: - message.normalRunningDirection = reader.readEnum(); - break; - case 15: - message.isTurnBackZone = reader.readBool(); - break; - case 16: - message.direction = reader.readEnum(); - break; - case 17: - message.axleCountings = reader.readPackedUint32(); - break; - case 18: - message.trackSectionId = reader.readUint32(); - break; - case 19: - message.centralizedStations = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Section { - return Section.deserialize(bytes); + if ( + 'centralizedStations' in data && + data.centralizedStations != undefined + ) { + this.centralizedStations = data.centralizedStations; } + } } - export namespace Section { - export enum SectionType { - Physical = 0, - TurnoutPhysical = 2 - } - export enum RunningDirection { - AtoB = 0, - BtoA = 1, - BOTH = 2 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class RelatedRef extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 paRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 4) as RelatedRef; + } + set paRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_paRef() { + return pb_1.Message.getField(this, 4) != null; + } + get pbRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 5) as RelatedRef; + } + set pbRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_pbRef() { + return pb_1.Message.getField(this, 5) != null; + } + get sectionType() { + return pb_1.Message.getFieldWithDefault( + this, + 6, + Section.SectionType.Physical + ) as Section.SectionType; + } + set sectionType(value: Section.SectionType) { + pb_1.Message.setField(this, 6, value); + } + get isCurve() { + return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; + } + set isCurve(value: boolean) { + pb_1.Message.setField(this, 10, value); + } + get segmentsCount() { + return pb_1.Message.getFieldWithDefault(this, 12, 0) as number; + } + set segmentsCount(value: number) { + pb_1.Message.setField(this, 12, value); + } + get normalRunningDirection() { + return pb_1.Message.getFieldWithDefault( + this, + 14, + Section.RunningDirection.AtoB + ) as Section.RunningDirection; + } + set normalRunningDirection(value: Section.RunningDirection) { + pb_1.Message.setField(this, 14, value); + } + get isTurnBackZone() { + return pb_1.Message.getFieldWithDefault(this, 15, false) as boolean; + } + set isTurnBackZone(value: boolean) { + pb_1.Message.setField(this, 15, value); + } + get direction() { + return pb_1.Message.getFieldWithDefault( + this, + 16, + Direction.UP + ) as Direction; + } + set direction(value: Direction) { + pb_1.Message.setField(this, 16, value); + } + get axleCountings() { + return pb_1.Message.getFieldWithDefault(this, 17, []) as number[]; + } + set axleCountings(value: number[]) { + pb_1.Message.setField(this, 17, value); + } + get trackSectionId() { + return pb_1.Message.getFieldWithDefault(this, 18, 0) as number; + } + set trackSectionId(value: number) { + pb_1.Message.setField(this, 18, value); + } + get centralizedStations() { + return pb_1.Message.getFieldWithDefault(this, 19, []) as number[]; + } + set centralizedStations(value: number[]) { + pb_1.Message.setField(this, 19, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + paRef?: ReturnType; + pbRef?: ReturnType; + sectionType?: Section.SectionType; + isCurve?: boolean; + segmentsCount?: number; + normalRunningDirection?: Section.RunningDirection; + isTurnBackZone?: boolean; + direction?: Direction; + axleCountings?: number[]; + trackSectionId?: number; + centralizedStations?: number[]; + }): Section { + const message = new Section({}); + 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.paRef != null) { + message.paRef = RelatedRef.fromObject(data.paRef); + } + if (data.pbRef != null) { + message.pbRef = RelatedRef.fromObject(data.pbRef); + } + if (data.sectionType != null) { + message.sectionType = data.sectionType; + } + if (data.isCurve != null) { + message.isCurve = data.isCurve; + } + if (data.segmentsCount != null) { + message.segmentsCount = data.segmentsCount; + } + if (data.normalRunningDirection != null) { + message.normalRunningDirection = data.normalRunningDirection; + } + if (data.isTurnBackZone != null) { + message.isTurnBackZone = data.isTurnBackZone; + } + if (data.direction != null) { + message.direction = data.direction; + } + if (data.axleCountings != null) { + message.axleCountings = data.axleCountings; + } + if (data.trackSectionId != null) { + message.trackSectionId = data.trackSectionId; + } + if (data.centralizedStations != null) { + message.centralizedStations = data.centralizedStations; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + paRef?: ReturnType; + pbRef?: ReturnType; + sectionType?: Section.SectionType; + isCurve?: boolean; + segmentsCount?: number; + normalRunningDirection?: Section.RunningDirection; + isTurnBackZone?: boolean; + direction?: Direction; + axleCountings?: number[]; + trackSectionId?: number; + centralizedStations?: number[]; + } = {}; + 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.paRef != null) { + data.paRef = this.paRef.toObject(); + } + if (this.pbRef != null) { + data.pbRef = this.pbRef.toObject(); + } + if (this.sectionType != null) { + data.sectionType = this.sectionType; + } + if (this.isCurve != null) { + data.isCurve = this.isCurve; + } + if (this.segmentsCount != null) { + data.segmentsCount = this.segmentsCount; + } + if (this.normalRunningDirection != null) { + data.normalRunningDirection = this.normalRunningDirection; + } + if (this.isTurnBackZone != null) { + data.isTurnBackZone = this.isTurnBackZone; + } + if (this.direction != null) { + data.direction = this.direction; + } + if (this.axleCountings != null) { + data.axleCountings = this.axleCountings; + } + if (this.trackSectionId != null) { + data.trackSectionId = this.trackSectionId; + } + if (this.centralizedStations != null) { + data.centralizedStations = this.centralizedStations; + } + 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.has_paRef) + writer.writeMessage(4, this.paRef, () => this.paRef.serialize(writer)); + if (this.has_pbRef) + writer.writeMessage(5, this.pbRef, () => this.pbRef.serialize(writer)); + if (this.sectionType != Section.SectionType.Physical) + writer.writeEnum(6, this.sectionType); + if (this.isCurve != false) writer.writeBool(10, this.isCurve); + if (this.segmentsCount != 0) writer.writeInt32(12, this.segmentsCount); + if (this.normalRunningDirection != Section.RunningDirection.AtoB) + writer.writeEnum(14, this.normalRunningDirection); + if (this.isTurnBackZone != false) + writer.writeBool(15, this.isTurnBackZone); + if (this.direction != Direction.UP) writer.writeEnum(16, this.direction); + if (this.axleCountings.length) + writer.writePackedUint32(17, this.axleCountings); + if (this.trackSectionId != 0) writer.writeUint32(18, this.trackSectionId); + if (this.centralizedStations.length) + writer.writePackedUint32(19, this.centralizedStations); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Section { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Section(); + 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: + reader.readMessage( + message.paRef, + () => (message.paRef = RelatedRef.deserialize(reader)) + ); + break; + case 5: + reader.readMessage( + message.pbRef, + () => (message.pbRef = RelatedRef.deserialize(reader)) + ); + break; + case 6: + message.sectionType = reader.readEnum(); + break; + case 10: + message.isCurve = reader.readBool(); + break; + case 12: + message.segmentsCount = reader.readInt32(); + break; + case 14: + message.normalRunningDirection = reader.readEnum(); + break; + case 15: + message.isTurnBackZone = reader.readBool(); + break; + case 16: + message.direction = reader.readEnum(); + break; + case 17: + message.axleCountings = reader.readPackedUint32(); + break; + case 18: + message.trackSectionId = reader.readUint32(); + break; + case 19: + message.centralizedStations = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Section { + return Section.deserialize(bytes); + } + } + export namespace Section { + export enum SectionType { + Physical = 0, + TurnoutPhysical = 2, + } + export enum RunningDirection { + AtoB = 0, + BtoA = 1, + BOTH = 2, + } + } + export class RelatedRef extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { deviceType?: RelatedRef.DeviceType; devicePort?: RelatedRef.DevicePort; id?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("deviceType" in data && data.deviceType != undefined) { - this.deviceType = data.deviceType; - } - if ("devicePort" in data && data.devicePort != undefined) { - this.devicePort = data.devicePort; - } - if ("id" in data && data.id != undefined) { - this.id = data.id; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('deviceType' in data && data.deviceType != undefined) { + this.deviceType = data.deviceType; } - get deviceType() { - return pb_1.Message.getFieldWithDefault(this, 1, RelatedRef.DeviceType.Section) as RelatedRef.DeviceType; + if ('devicePort' in data && data.devicePort != undefined) { + this.devicePort = data.devicePort; } - set deviceType(value: RelatedRef.DeviceType) { - pb_1.Message.setField(this, 1, value); - } - get devicePort() { - return pb_1.Message.getFieldWithDefault(this, 3, RelatedRef.DevicePort.A) as RelatedRef.DevicePort; - } - set devicePort(value: RelatedRef.DevicePort) { - pb_1.Message.setField(this, 3, value); - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set id(value: number) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - deviceType?: RelatedRef.DeviceType; - devicePort?: RelatedRef.DevicePort; - id?: number; - }): RelatedRef { - const message = new RelatedRef({}); - if (data.deviceType != null) { - message.deviceType = data.deviceType; - } - if (data.devicePort != null) { - message.devicePort = data.devicePort; - } - if (data.id != null) { - message.id = data.id; - } - return message; - } - toObject() { - const data: { - deviceType?: RelatedRef.DeviceType; - devicePort?: RelatedRef.DevicePort; - id?: number; - } = {}; - if (this.deviceType != null) { - data.deviceType = this.deviceType; - } - if (this.devicePort != null) { - data.devicePort = this.devicePort; - } - if (this.id != null) { - data.id = this.id; - } - 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.deviceType != RelatedRef.DeviceType.Section) - writer.writeEnum(1, this.deviceType); - if (this.devicePort != RelatedRef.DevicePort.A) - writer.writeEnum(3, this.devicePort); - if (this.id != 0) - writer.writeUint32(4, this.id); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RelatedRef { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RelatedRef(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.deviceType = reader.readEnum(); - break; - case 3: - message.devicePort = reader.readEnum(); - break; - case 4: - message.id = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): RelatedRef { - return RelatedRef.deserialize(bytes); + if ('id' in data && data.id != undefined) { + this.id = data.id; } + } } - export namespace RelatedRef { - export enum DeviceType { - Section = 0, - Turnout = 1, - TrainWindow = 2, - AxleCounting = 3, - SectionLink = 4, - signal = 5, - station = 6, - ScreenDoor = 7, - SignalFaultAlarm = 8, - Breakers = 9, - PowerScreen = 10, - GarageDoor = 11, - CarWashing = 12, - FloodGate = 13 - } - export enum DevicePort { - A = 0, - B = 1, - C = 2 - } + get deviceType() { + return pb_1.Message.getFieldWithDefault( + this, + 1, + RelatedRef.DeviceType.Section + ) as RelatedRef.DeviceType; } - export class TurnoutPosRef extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + set deviceType(value: RelatedRef.DeviceType) { + pb_1.Message.setField(this, 1, value); + } + get devicePort() { + return pb_1.Message.getFieldWithDefault( + this, + 3, + RelatedRef.DevicePort.A + ) as RelatedRef.DevicePort; + } + set devicePort(value: RelatedRef.DevicePort) { + pb_1.Message.setField(this, 3, value); + } + get id() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set id(value: number) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + deviceType?: RelatedRef.DeviceType; + devicePort?: RelatedRef.DevicePort; + id?: number; + }): RelatedRef { + const message = new RelatedRef({}); + if (data.deviceType != null) { + message.deviceType = data.deviceType; + } + if (data.devicePort != null) { + message.devicePort = data.devicePort; + } + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + deviceType?: RelatedRef.DeviceType; + devicePort?: RelatedRef.DevicePort; + id?: number; + } = {}; + if (this.deviceType != null) { + data.deviceType = this.deviceType; + } + if (this.devicePort != null) { + data.devicePort = this.devicePort; + } + if (this.id != null) { + data.id = this.id; + } + 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.deviceType != RelatedRef.DeviceType.Section) + writer.writeEnum(1, this.deviceType); + if (this.devicePort != RelatedRef.DevicePort.A) + writer.writeEnum(3, this.devicePort); + if (this.id != 0) writer.writeUint32(4, this.id); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RelatedRef { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new RelatedRef(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.deviceType = reader.readEnum(); + break; + case 3: + message.devicePort = reader.readEnum(); + break; + case 4: + message.id = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RelatedRef { + return RelatedRef.deserialize(bytes); + } + } + export namespace RelatedRef { + export enum DeviceType { + Section = 0, + Turnout = 1, + TrainWindow = 2, + AxleCounting = 3, + SectionLink = 4, + signal = 5, + station = 6, + ScreenDoor = 7, + SignalFaultAlarm = 8, + Breakers = 9, + PowerScreen = 10, + GarageDoor = 11, + CarWashing = 12, + } + export enum DevicePort { + A = 0, + B = 1, + C = 2, + } + } + export class TurnoutPosRef extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { position?: number; id?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("position" in data && data.position != undefined) { - this.position = data.position; - } - if ("id" in data && data.id != undefined) { - this.id = data.id; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('position' in data && data.position != undefined) { + this.position = data.position; } - get position() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set position(value: number) { - pb_1.Message.setField(this, 2, value); - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set id(value: number) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - position?: number; - id?: number; - }): TurnoutPosRef { - const message = new TurnoutPosRef({}); - if (data.position != null) { - message.position = data.position; - } - if (data.id != null) { - message.id = data.id; - } - return message; - } - toObject() { - const data: { - position?: number; - id?: number; - } = {}; - if (this.position != null) { - data.position = this.position; - } - if (this.id != null) { - data.id = this.id; - } - 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.position != 0) - writer.writeInt32(2, this.position); - if (this.id != 0) - writer.writeUint32(3, this.id); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TurnoutPosRef { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TurnoutPosRef(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 2: - message.position = reader.readInt32(); - break; - case 3: - message.id = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): TurnoutPosRef { - return TurnoutPosRef.deserialize(bytes); + if ('id' in data && data.id != undefined) { + this.id = data.id; } + } } - export class Separator extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get position() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set position(value: number) { + pb_1.Message.setField(this, 2, value); + } + get id() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set id(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { position?: number; id?: number }): TurnoutPosRef { + const message = new TurnoutPosRef({}); + if (data.position != null) { + message.position = data.position; + } + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + position?: number; + id?: number; + } = {}; + if (this.position != null) { + data.position = this.position; + } + if (this.id != null) { + data.id = this.id; + } + 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.position != 0) writer.writeInt32(2, this.position); + if (this.id != 0) writer.writeUint32(3, this.id); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TurnoutPosRef { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new TurnoutPosRef(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 2: + message.position = reader.readInt32(); + break; + case 3: + message.id = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TurnoutPosRef { + return TurnoutPosRef.deserialize(bytes); + } + } + export class Separator extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; separatorType?: 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; - } - if ("separatorType" in data && data.separatorType != undefined) { - this.separatorType = data.separatorType; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - 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 separatorType() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set separatorType(value: string) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - separatorType?: string; - }): Separator { - const message = new Separator({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.separatorType != null) { - message.separatorType = data.separatorType; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - separatorType?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.separatorType != null) { - data.separatorType = this.separatorType; - } - 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.separatorType.length) - writer.writeString(3, this.separatorType); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Separator { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Separator(); - 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.separatorType = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Separator { - return Separator.deserialize(bytes); + if ('separatorType' in data && data.separatorType != undefined) { + this.separatorType = data.separatorType; } + } } - export class Transponder extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 separatorType() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set separatorType(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + separatorType?: string; + }): Separator { + const message = new Separator({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.separatorType != null) { + message.separatorType = data.separatorType; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + separatorType?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.separatorType != null) { + data.separatorType = this.separatorType; + } + 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.separatorType.length) writer.writeString(3, this.separatorType); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Separator { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Separator(); + 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.separatorType = reader.readString(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Separator { + return Separator.deserialize(bytes); + } + } + export class Transponder extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; kilometerSystem?: KilometerSystem; @@ -4863,362 +6310,422 @@ export namespace graphicData { fixedTelegram?: string; fixedUserTelegram?: string; originalCode?: string; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [10], 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; - } - if ("TransponderRef" in data && data.TransponderRef != undefined) { - this.TransponderRef = data.TransponderRef; - } - if ("type" in data && data.type != undefined) { - this.type = data.type; - } - if ("centralizedStations" in data && data.centralizedStations != undefined) { - this.centralizedStations = data.centralizedStations; - } - if ("fixedTelegram" in data && data.fixedTelegram != undefined) { - this.fixedTelegram = data.fixedTelegram; - } - if ("fixedUserTelegram" in data && data.fixedUserTelegram != undefined) { - this.fixedUserTelegram = data.fixedUserTelegram; - } - if ("originalCode" in data && data.originalCode != undefined) { - this.originalCode = data.originalCode; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [10], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('TransponderRef' in data && data.TransponderRef != undefined) { + this.TransponderRef = data.TransponderRef; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('type' in data && data.type != undefined) { + this.type = data.type; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); + if ( + 'centralizedStations' in data && + data.centralizedStations != undefined + ) { + this.centralizedStations = data.centralizedStations; } - get kilometerSystem() { - return pb_1.Message.getWrapperField(this, KilometerSystem, 5) as KilometerSystem; + if ('fixedTelegram' in data && data.fixedTelegram != undefined) { + this.fixedTelegram = data.fixedTelegram; } - set kilometerSystem(value: KilometerSystem) { - pb_1.Message.setWrapperField(this, 5, value); + if ( + 'fixedUserTelegram' in data && + data.fixedUserTelegram != undefined + ) { + this.fixedUserTelegram = data.fixedUserTelegram; } - get has_kilometerSystem() { - return pb_1.Message.getField(this, 5) != null; - } - get TransponderRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 6) as RelatedRef; - } - set TransponderRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 6, value); - } - get has_TransponderRef() { - return pb_1.Message.getField(this, 6) != null; - } - get type() { - return pb_1.Message.getFieldWithDefault(this, 9, Transponder.TransponderTypeEnum.FB) as Transponder.TransponderTypeEnum; - } - set type(value: Transponder.TransponderTypeEnum) { - pb_1.Message.setField(this, 9, value); - } - get centralizedStations() { - return pb_1.Message.getFieldWithDefault(this, 10, []) as number[]; - } - set centralizedStations(value: number[]) { - pb_1.Message.setField(this, 10, value); - } - get fixedTelegram() { - return pb_1.Message.getFieldWithDefault(this, 11, "") as string; - } - set fixedTelegram(value: string) { - pb_1.Message.setField(this, 11, value); - } - get fixedUserTelegram() { - return pb_1.Message.getFieldWithDefault(this, 12, "") as string; - } - set fixedUserTelegram(value: string) { - pb_1.Message.setField(this, 12, value); - } - get originalCode() { - return pb_1.Message.getFieldWithDefault(this, 13, "") as string; - } - set originalCode(value: string) { - pb_1.Message.setField(this, 13, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - kilometerSystem?: ReturnType; - TransponderRef?: ReturnType; - type?: Transponder.TransponderTypeEnum; - centralizedStations?: number[]; - fixedTelegram?: string; - fixedUserTelegram?: string; - originalCode?: string; - }): Transponder { - const message = new Transponder({}); - 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); - } - if (data.TransponderRef != null) { - message.TransponderRef = RelatedRef.fromObject(data.TransponderRef); - } - if (data.type != null) { - message.type = data.type; - } - if (data.centralizedStations != null) { - message.centralizedStations = data.centralizedStations; - } - if (data.fixedTelegram != null) { - message.fixedTelegram = data.fixedTelegram; - } - if (data.fixedUserTelegram != null) { - message.fixedUserTelegram = data.fixedUserTelegram; - } - if (data.originalCode != null) { - message.originalCode = data.originalCode; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - kilometerSystem?: ReturnType; - TransponderRef?: ReturnType; - type?: Transponder.TransponderTypeEnum; - centralizedStations?: number[]; - fixedTelegram?: string; - fixedUserTelegram?: string; - originalCode?: string; - } = {}; - 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(); - } - if (this.TransponderRef != null) { - data.TransponderRef = this.TransponderRef.toObject(); - } - if (this.type != null) { - data.type = this.type; - } - if (this.centralizedStations != null) { - data.centralizedStations = this.centralizedStations; - } - if (this.fixedTelegram != null) { - data.fixedTelegram = this.fixedTelegram; - } - if (this.fixedUserTelegram != null) { - data.fixedUserTelegram = this.fixedUserTelegram; - } - if (this.originalCode != null) { - data.originalCode = this.originalCode; - } - 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(5, this.kilometerSystem, () => this.kilometerSystem.serialize(writer)); - if (this.has_TransponderRef) - writer.writeMessage(6, this.TransponderRef, () => this.TransponderRef.serialize(writer)); - if (this.type != Transponder.TransponderTypeEnum.FB) - writer.writeEnum(9, this.type); - if (this.centralizedStations.length) - writer.writePackedUint32(10, this.centralizedStations); - if (this.fixedTelegram.length) - writer.writeString(11, this.fixedTelegram); - if (this.fixedUserTelegram.length) - writer.writeString(12, this.fixedUserTelegram); - if (this.originalCode.length) - writer.writeString(13, this.originalCode); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transponder { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Transponder(); - 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 5: - reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader)); - break; - case 6: - reader.readMessage(message.TransponderRef, () => message.TransponderRef = RelatedRef.deserialize(reader)); - break; - case 9: - message.type = reader.readEnum(); - break; - case 10: - message.centralizedStations = reader.readPackedUint32(); - break; - case 11: - message.fixedTelegram = reader.readString(); - break; - case 12: - message.fixedUserTelegram = reader.readString(); - break; - case 13: - message.originalCode = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Transponder { - return Transponder.deserialize(bytes); + if ('originalCode' in data && data.originalCode != undefined) { + this.originalCode = data.originalCode; } + } } - export namespace Transponder { - export enum TransponderTypeEnum { - FB = 0, - WB = 1, - DB = 2, - VB = 3, - IB = 4 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class SimpleRef extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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, + 5 + ) as KilometerSystem; + } + set kilometerSystem(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_kilometerSystem() { + return pb_1.Message.getField(this, 5) != null; + } + get TransponderRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 6) as RelatedRef; + } + set TransponderRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 6, value); + } + get has_TransponderRef() { + return pb_1.Message.getField(this, 6) != null; + } + get type() { + return pb_1.Message.getFieldWithDefault( + this, + 9, + Transponder.TransponderTypeEnum.FB + ) as Transponder.TransponderTypeEnum; + } + set type(value: Transponder.TransponderTypeEnum) { + pb_1.Message.setField(this, 9, value); + } + get centralizedStations() { + return pb_1.Message.getFieldWithDefault(this, 10, []) as number[]; + } + set centralizedStations(value: number[]) { + pb_1.Message.setField(this, 10, value); + } + get fixedTelegram() { + return pb_1.Message.getFieldWithDefault(this, 11, '') as string; + } + set fixedTelegram(value: string) { + pb_1.Message.setField(this, 11, value); + } + get fixedUserTelegram() { + return pb_1.Message.getFieldWithDefault(this, 12, '') as string; + } + set fixedUserTelegram(value: string) { + pb_1.Message.setField(this, 12, value); + } + get originalCode() { + return pb_1.Message.getFieldWithDefault(this, 13, '') as string; + } + set originalCode(value: string) { + pb_1.Message.setField(this, 13, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + TransponderRef?: ReturnType; + type?: Transponder.TransponderTypeEnum; + centralizedStations?: number[]; + fixedTelegram?: string; + fixedUserTelegram?: string; + originalCode?: string; + }): Transponder { + const message = new Transponder({}); + 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 + ); + } + if (data.TransponderRef != null) { + message.TransponderRef = RelatedRef.fromObject(data.TransponderRef); + } + if (data.type != null) { + message.type = data.type; + } + if (data.centralizedStations != null) { + message.centralizedStations = data.centralizedStations; + } + if (data.fixedTelegram != null) { + message.fixedTelegram = data.fixedTelegram; + } + if (data.fixedUserTelegram != null) { + message.fixedUserTelegram = data.fixedUserTelegram; + } + if (data.originalCode != null) { + message.originalCode = data.originalCode; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType; + TransponderRef?: ReturnType; + type?: Transponder.TransponderTypeEnum; + centralizedStations?: number[]; + fixedTelegram?: string; + fixedUserTelegram?: string; + originalCode?: string; + } = {}; + 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(); + } + if (this.TransponderRef != null) { + data.TransponderRef = this.TransponderRef.toObject(); + } + if (this.type != null) { + data.type = this.type; + } + if (this.centralizedStations != null) { + data.centralizedStations = this.centralizedStations; + } + if (this.fixedTelegram != null) { + data.fixedTelegram = this.fixedTelegram; + } + if (this.fixedUserTelegram != null) { + data.fixedUserTelegram = this.fixedUserTelegram; + } + if (this.originalCode != null) { + data.originalCode = this.originalCode; + } + 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(5, this.kilometerSystem, () => + this.kilometerSystem.serialize(writer) + ); + if (this.has_TransponderRef) + writer.writeMessage(6, this.TransponderRef, () => + this.TransponderRef.serialize(writer) + ); + if (this.type != Transponder.TransponderTypeEnum.FB) + writer.writeEnum(9, this.type); + if (this.centralizedStations.length) + writer.writePackedUint32(10, this.centralizedStations); + if (this.fixedTelegram.length) writer.writeString(11, this.fixedTelegram); + if (this.fixedUserTelegram.length) + writer.writeString(12, this.fixedUserTelegram); + if (this.originalCode.length) writer.writeString(13, this.originalCode); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transponder { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Transponder(); + 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 5: + reader.readMessage( + message.kilometerSystem, + () => + (message.kilometerSystem = KilometerSystem.deserialize(reader)) + ); + break; + case 6: + reader.readMessage( + message.TransponderRef, + () => (message.TransponderRef = RelatedRef.deserialize(reader)) + ); + break; + case 9: + message.type = reader.readEnum(); + break; + case 10: + message.centralizedStations = reader.readPackedUint32(); + break; + case 11: + message.fixedTelegram = reader.readString(); + break; + case 12: + message.fixedUserTelegram = reader.readString(); + break; + case 13: + message.originalCode = reader.readString(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Transponder { + return Transponder.deserialize(bytes); + } + } + export namespace Transponder { + export enum TransponderTypeEnum { + FB = 0, + WB = 1, + DB = 2, + VB = 3, + IB = 4, + } + } + export class SimpleRef extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { deviceType?: SimpleRef.DeviceType; id?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("deviceType" in data && data.deviceType != undefined) { - this.deviceType = data.deviceType; - } - if ("id" in data && data.id != undefined) { - this.id = data.id; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('deviceType' in data && data.deviceType != undefined) { + this.deviceType = data.deviceType; } - get deviceType() { - return pb_1.Message.getFieldWithDefault(this, 1, SimpleRef.DeviceType.Turnout) as SimpleRef.DeviceType; - } - set deviceType(value: SimpleRef.DeviceType) { - pb_1.Message.setField(this, 1, value); - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set id(value: number) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - deviceType?: SimpleRef.DeviceType; - id?: number; - }): SimpleRef { - const message = new SimpleRef({}); - if (data.deviceType != null) { - message.deviceType = data.deviceType; - } - if (data.id != null) { - message.id = data.id; - } - return message; - } - toObject() { - const data: { - deviceType?: SimpleRef.DeviceType; - id?: number; - } = {}; - if (this.deviceType != null) { - data.deviceType = this.deviceType; - } - if (this.id != null) { - data.id = this.id; - } - 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.deviceType != SimpleRef.DeviceType.Turnout) - writer.writeEnum(1, this.deviceType); - if (this.id != 0) - writer.writeUint32(3, this.id); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SimpleRef { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SimpleRef(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.deviceType = reader.readEnum(); - break; - case 3: - message.id = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): SimpleRef { - return SimpleRef.deserialize(bytes); + if ('id' in data && data.id != undefined) { + this.id = data.id; } + } } - export namespace SimpleRef { - export enum DeviceType { - Turnout = 0, - AxleCounting = 1 - } + get deviceType() { + return pb_1.Message.getFieldWithDefault( + this, + 1, + SimpleRef.DeviceType.Turnout + ) as SimpleRef.DeviceType; } - export class SectionLink extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + set deviceType(value: SimpleRef.DeviceType) { + pb_1.Message.setField(this, 1, value); + } + get id() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set id(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + deviceType?: SimpleRef.DeviceType; + id?: number; + }): SimpleRef { + const message = new SimpleRef({}); + if (data.deviceType != null) { + message.deviceType = data.deviceType; + } + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + deviceType?: SimpleRef.DeviceType; + id?: number; + } = {}; + if (this.deviceType != null) { + data.deviceType = this.deviceType; + } + if (this.id != null) { + data.id = this.id; + } + 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.deviceType != SimpleRef.DeviceType.Turnout) + writer.writeEnum(1, this.deviceType); + if (this.id != 0) writer.writeUint32(3, this.id); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SimpleRef { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new SimpleRef(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.deviceType = reader.readEnum(); + break; + case 3: + message.id = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SimpleRef { + return SimpleRef.deserialize(bytes); + } + } + export namespace SimpleRef { + export enum DeviceType { + Turnout = 0, + AxleCounting = 1, + } + } + export class SectionLink extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; points?: Point[]; @@ -5227,594 +6734,713 @@ export namespace graphicData { bSimRef?: SimpleRef; aRef?: RelatedRef; bRef?: RelatedRef; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], 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 ("up" in data && data.up != undefined) { - this.up = data.up; - } - if ("aSimRef" in data && data.aSimRef != undefined) { - this.aSimRef = data.aSimRef; - } - if ("bSimRef" in data && data.bSimRef != undefined) { - this.bSimRef = data.bSimRef; - } - if ("aRef" in data && data.aRef != undefined) { - this.aRef = data.aRef; - } - if ("bRef" in data && data.bRef != undefined) { - this.bRef = data.bRef; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('points' in data && data.points != undefined) { + this.points = data.points; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('up' in data && data.up != undefined) { + this.up = data.up; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('aSimRef' in data && data.aSimRef != undefined) { + this.aSimRef = data.aSimRef; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); + if ('bSimRef' in data && data.bSimRef != undefined) { + this.bSimRef = data.bSimRef; } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; + if ('aRef' in data && data.aRef != undefined) { + this.aRef = data.aRef; } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - get up() { - return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; - } - set up(value: boolean) { - pb_1.Message.setField(this, 4, value); - } - get aSimRef() { - return pb_1.Message.getWrapperField(this, SimpleRef, 5) as SimpleRef; - } - set aSimRef(value: SimpleRef) { - pb_1.Message.setWrapperField(this, 5, value); - } - get has_aSimRef() { - return pb_1.Message.getField(this, 5) != null; - } - get bSimRef() { - return pb_1.Message.getWrapperField(this, SimpleRef, 6) as SimpleRef; - } - set bSimRef(value: SimpleRef) { - pb_1.Message.setWrapperField(this, 6, value); - } - get has_bSimRef() { - return pb_1.Message.getField(this, 6) != null; - } - get aRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 7) as RelatedRef; - } - set aRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 7, value); - } - get has_aRef() { - return pb_1.Message.getField(this, 7) != null; - } - get bRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 8) as RelatedRef; - } - set bRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 8, value); - } - get has_bRef() { - return pb_1.Message.getField(this, 8) != null; - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - up?: boolean; - aSimRef?: ReturnType; - bSimRef?: ReturnType; - aRef?: ReturnType; - bRef?: ReturnType; - }): SectionLink { - const message = new SectionLink({}); - 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.up != null) { - message.up = data.up; - } - if (data.aSimRef != null) { - message.aSimRef = SimpleRef.fromObject(data.aSimRef); - } - if (data.bSimRef != null) { - message.bSimRef = SimpleRef.fromObject(data.bSimRef); - } - if (data.aRef != null) { - message.aRef = RelatedRef.fromObject(data.aRef); - } - if (data.bRef != null) { - message.bRef = RelatedRef.fromObject(data.bRef); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - up?: boolean; - aSimRef?: ReturnType; - bSimRef?: ReturnType; - aRef?: ReturnType; - bRef?: ReturnType; - } = {}; - 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.up != null) { - data.up = this.up; - } - if (this.aSimRef != null) { - data.aSimRef = this.aSimRef.toObject(); - } - if (this.bSimRef != null) { - data.bSimRef = this.bSimRef.toObject(); - } - if (this.aRef != null) { - data.aRef = this.aRef.toObject(); - } - if (this.bRef != null) { - data.bRef = this.bRef.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.points.length) - writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer)); - if (this.up != false) - writer.writeBool(4, this.up); - if (this.has_aSimRef) - writer.writeMessage(5, this.aSimRef, () => this.aSimRef.serialize(writer)); - if (this.has_bSimRef) - writer.writeMessage(6, this.bSimRef, () => this.bSimRef.serialize(writer)); - if (this.has_aRef) - writer.writeMessage(7, this.aRef, () => this.aRef.serialize(writer)); - if (this.has_bRef) - writer.writeMessage(8, this.bRef, () => this.bRef.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SectionLink { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SectionLink(); - 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.up = reader.readBool(); - break; - case 5: - reader.readMessage(message.aSimRef, () => message.aSimRef = SimpleRef.deserialize(reader)); - break; - case 6: - reader.readMessage(message.bSimRef, () => message.bSimRef = SimpleRef.deserialize(reader)); - break; - case 7: - reader.readMessage(message.aRef, () => message.aRef = RelatedRef.deserialize(reader)); - break; - case 8: - reader.readMessage(message.bRef, () => message.bRef = RelatedRef.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): SectionLink { - return SectionLink.deserialize(bytes); + if ('bRef' in data && data.bRef != undefined) { + this.bRef = data.bRef; } + } } - export class AxleCountingSection extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 up() { + return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; + } + set up(value: boolean) { + pb_1.Message.setField(this, 4, value); + } + get aSimRef() { + return pb_1.Message.getWrapperField(this, SimpleRef, 5) as SimpleRef; + } + set aSimRef(value: SimpleRef) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_aSimRef() { + return pb_1.Message.getField(this, 5) != null; + } + get bSimRef() { + return pb_1.Message.getWrapperField(this, SimpleRef, 6) as SimpleRef; + } + set bSimRef(value: SimpleRef) { + pb_1.Message.setWrapperField(this, 6, value); + } + get has_bSimRef() { + return pb_1.Message.getField(this, 6) != null; + } + get aRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 7) as RelatedRef; + } + set aRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 7, value); + } + get has_aRef() { + return pb_1.Message.getField(this, 7) != null; + } + get bRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 8) as RelatedRef; + } + set bRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 8, value); + } + get has_bRef() { + return pb_1.Message.getField(this, 8) != null; + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + up?: boolean; + aSimRef?: ReturnType; + bSimRef?: ReturnType; + aRef?: ReturnType; + bRef?: ReturnType; + }): SectionLink { + const message = new SectionLink({}); + 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.up != null) { + message.up = data.up; + } + if (data.aSimRef != null) { + message.aSimRef = SimpleRef.fromObject(data.aSimRef); + } + if (data.bSimRef != null) { + message.bSimRef = SimpleRef.fromObject(data.bSimRef); + } + if (data.aRef != null) { + message.aRef = RelatedRef.fromObject(data.aRef); + } + if (data.bRef != null) { + message.bRef = RelatedRef.fromObject(data.bRef); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + up?: boolean; + aSimRef?: ReturnType; + bSimRef?: ReturnType; + aRef?: ReturnType; + bRef?: ReturnType; + } = {}; + 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.up != null) { + data.up = this.up; + } + if (this.aSimRef != null) { + data.aSimRef = this.aSimRef.toObject(); + } + if (this.bSimRef != null) { + data.bSimRef = this.bSimRef.toObject(); + } + if (this.aRef != null) { + data.aRef = this.aRef.toObject(); + } + if (this.bRef != null) { + data.bRef = this.bRef.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.points.length) + writer.writeRepeatedMessage(3, this.points, (item: Point) => + item.serialize(writer) + ); + if (this.up != false) writer.writeBool(4, this.up); + if (this.has_aSimRef) + writer.writeMessage(5, this.aSimRef, () => + this.aSimRef.serialize(writer) + ); + if (this.has_bSimRef) + writer.writeMessage(6, this.bSimRef, () => + this.bSimRef.serialize(writer) + ); + if (this.has_aRef) + writer.writeMessage(7, this.aRef, () => this.aRef.serialize(writer)); + if (this.has_bRef) + writer.writeMessage(8, this.bRef, () => this.bRef.serialize(writer)); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SectionLink { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new SectionLink(); + 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.up = reader.readBool(); + break; + case 5: + reader.readMessage( + message.aSimRef, + () => (message.aSimRef = SimpleRef.deserialize(reader)) + ); + break; + case 6: + reader.readMessage( + message.bSimRef, + () => (message.bSimRef = SimpleRef.deserialize(reader)) + ); + break; + case 7: + reader.readMessage( + message.aRef, + () => (message.aRef = RelatedRef.deserialize(reader)) + ); + break; + case 8: + reader.readMessage( + message.bRef, + () => (message.bRef = RelatedRef.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SectionLink { + return SectionLink.deserialize(bytes); + } + } + export class AxleCountingSection extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; points?: Point[]; paRef?: RelatedRef; pbRef?: RelatedRef; turnoutPos?: TurnoutPosRef[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 6], 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 ("paRef" in data && data.paRef != undefined) { - this.paRef = data.paRef; - } - if ("pbRef" in data && data.pbRef != undefined) { - this.pbRef = data.pbRef; - } - if ("turnoutPos" in data && data.turnoutPos != undefined) { - this.turnoutPos = data.turnoutPos; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3, 6], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('points' in data && data.points != undefined) { + this.points = data.points; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('paRef' in data && data.paRef != undefined) { + this.paRef = data.paRef; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('pbRef' in data && data.pbRef != undefined) { + this.pbRef = data.pbRef; } - 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 paRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 4) as RelatedRef; - } - set paRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_paRef() { - return pb_1.Message.getField(this, 4) != null; - } - get pbRef() { - return pb_1.Message.getWrapperField(this, RelatedRef, 5) as RelatedRef; - } - set pbRef(value: RelatedRef) { - pb_1.Message.setWrapperField(this, 5, value); - } - get has_pbRef() { - return pb_1.Message.getField(this, 5) != null; - } - get turnoutPos() { - return pb_1.Message.getRepeatedWrapperField(this, TurnoutPosRef, 6) as TurnoutPosRef[]; - } - set turnoutPos(value: TurnoutPosRef[]) { - pb_1.Message.setRepeatedWrapperField(this, 6, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - paRef?: ReturnType; - pbRef?: ReturnType; - turnoutPos?: ReturnType[]; - }): AxleCountingSection { - const message = new AxleCountingSection({}); - 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.paRef != null) { - message.paRef = RelatedRef.fromObject(data.paRef); - } - if (data.pbRef != null) { - message.pbRef = RelatedRef.fromObject(data.pbRef); - } - if (data.turnoutPos != null) { - message.turnoutPos = data.turnoutPos.map(item => TurnoutPosRef.fromObject(item)); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - paRef?: ReturnType; - pbRef?: ReturnType; - turnoutPos?: ReturnType[]; - } = {}; - 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.paRef != null) { - data.paRef = this.paRef.toObject(); - } - if (this.pbRef != null) { - data.pbRef = this.pbRef.toObject(); - } - if (this.turnoutPos != null) { - data.turnoutPos = this.turnoutPos.map((item: TurnoutPosRef) => 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.points.length) - writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer)); - if (this.has_paRef) - writer.writeMessage(4, this.paRef, () => this.paRef.serialize(writer)); - if (this.has_pbRef) - writer.writeMessage(5, this.pbRef, () => this.pbRef.serialize(writer)); - if (this.turnoutPos.length) - writer.writeRepeatedMessage(6, this.turnoutPos, (item: TurnoutPosRef) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AxleCountingSection { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AxleCountingSection(); - 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: - reader.readMessage(message.paRef, () => message.paRef = RelatedRef.deserialize(reader)); - break; - case 5: - reader.readMessage(message.pbRef, () => message.pbRef = RelatedRef.deserialize(reader)); - break; - case 6: - reader.readMessage(message.turnoutPos, () => pb_1.Message.addToRepeatedWrapperField(message, 6, TurnoutPosRef.deserialize(reader), TurnoutPosRef)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AxleCountingSection { - return AxleCountingSection.deserialize(bytes); + if ('turnoutPos' in data && data.turnoutPos != undefined) { + this.turnoutPos = data.turnoutPos; } + } } - export class LogicSection extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 paRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 4) as RelatedRef; + } + set paRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_paRef() { + return pb_1.Message.getField(this, 4) != null; + } + get pbRef() { + return pb_1.Message.getWrapperField(this, RelatedRef, 5) as RelatedRef; + } + set pbRef(value: RelatedRef) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_pbRef() { + return pb_1.Message.getField(this, 5) != null; + } + get turnoutPos() { + return pb_1.Message.getRepeatedWrapperField( + this, + TurnoutPosRef, + 6 + ) as TurnoutPosRef[]; + } + set turnoutPos(value: TurnoutPosRef[]) { + pb_1.Message.setRepeatedWrapperField(this, 6, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + paRef?: ReturnType; + pbRef?: ReturnType; + turnoutPos?: ReturnType[]; + }): AxleCountingSection { + const message = new AxleCountingSection({}); + 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.paRef != null) { + message.paRef = RelatedRef.fromObject(data.paRef); + } + if (data.pbRef != null) { + message.pbRef = RelatedRef.fromObject(data.pbRef); + } + if (data.turnoutPos != null) { + message.turnoutPos = data.turnoutPos.map((item) => + TurnoutPosRef.fromObject(item) + ); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + paRef?: ReturnType; + pbRef?: ReturnType; + turnoutPos?: ReturnType[]; + } = {}; + 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.paRef != null) { + data.paRef = this.paRef.toObject(); + } + if (this.pbRef != null) { + data.pbRef = this.pbRef.toObject(); + } + if (this.turnoutPos != null) { + data.turnoutPos = this.turnoutPos.map((item: TurnoutPosRef) => + 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.points.length) + writer.writeRepeatedMessage(3, this.points, (item: Point) => + item.serialize(writer) + ); + if (this.has_paRef) + writer.writeMessage(4, this.paRef, () => this.paRef.serialize(writer)); + if (this.has_pbRef) + writer.writeMessage(5, this.pbRef, () => this.pbRef.serialize(writer)); + if (this.turnoutPos.length) + writer.writeRepeatedMessage(6, this.turnoutPos, (item: TurnoutPosRef) => + item.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): AxleCountingSection { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new AxleCountingSection(); + 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: + reader.readMessage( + message.paRef, + () => (message.paRef = RelatedRef.deserialize(reader)) + ); + break; + case 5: + reader.readMessage( + message.pbRef, + () => (message.pbRef = RelatedRef.deserialize(reader)) + ); + break; + case 6: + reader.readMessage(message.turnoutPos, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 6, + TurnoutPosRef.deserialize(reader), + TurnoutPosRef + ) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AxleCountingSection { + return AxleCountingSection.deserialize(bytes); + } + } + export class LogicSection extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; points?: Point[]; axleSectionId?: number; turnoutId?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], 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 ("axleSectionId" in data && data.axleSectionId != undefined) { - this.axleSectionId = data.axleSectionId; - } - if ("turnoutId" in data && data.turnoutId != undefined) { - this.turnoutId = data.turnoutId; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('points' in data && data.points != undefined) { + this.points = data.points; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('axleSectionId' in data && data.axleSectionId != undefined) { + this.axleSectionId = data.axleSectionId; } - 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 axleSectionId() { - return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; - } - set axleSectionId(value: number) { - pb_1.Message.setField(this, 7, value); - } - get turnoutId() { - return pb_1.Message.getFieldWithDefault(this, 8, 0) as number; - } - set turnoutId(value: number) { - pb_1.Message.setField(this, 8, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - axleSectionId?: number; - turnoutId?: number; - }): LogicSection { - const message = new LogicSection({}); - 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.axleSectionId != null) { - message.axleSectionId = data.axleSectionId; - } - if (data.turnoutId != null) { - message.turnoutId = data.turnoutId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - axleSectionId?: number; - turnoutId?: number; - } = {}; - 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.axleSectionId != null) { - data.axleSectionId = this.axleSectionId; - } - if (this.turnoutId != null) { - data.turnoutId = this.turnoutId; - } - 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.axleSectionId != 0) - writer.writeUint32(7, this.axleSectionId); - if (this.turnoutId != 0) - writer.writeUint32(8, this.turnoutId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): LogicSection { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new LogicSection(); - 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 7: - message.axleSectionId = reader.readUint32(); - break; - case 8: - message.turnoutId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): LogicSection { - return LogicSection.deserialize(bytes); + if ('turnoutId' in data && data.turnoutId != undefined) { + this.turnoutId = data.turnoutId; } + } } - export class TrackSection extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 axleSectionId() { + return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; + } + set axleSectionId(value: number) { + pb_1.Message.setField(this, 7, value); + } + get turnoutId() { + return pb_1.Message.getFieldWithDefault(this, 8, 0) as number; + } + set turnoutId(value: number) { + pb_1.Message.setField(this, 8, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + axleSectionId?: number; + turnoutId?: number; + }): LogicSection { + const message = new LogicSection({}); + 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.axleSectionId != null) { + message.axleSectionId = data.axleSectionId; + } + if (data.turnoutId != null) { + message.turnoutId = data.turnoutId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + axleSectionId?: number; + turnoutId?: number; + } = {}; + 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.axleSectionId != null) { + data.axleSectionId = this.axleSectionId; + } + if (this.turnoutId != null) { + data.turnoutId = this.turnoutId; + } + 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.axleSectionId != 0) writer.writeUint32(7, this.axleSectionId); + if (this.turnoutId != 0) writer.writeUint32(8, this.turnoutId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): LogicSection { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new LogicSection(); + 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 7: + message.axleSectionId = reader.readUint32(); + break; + case 8: + message.turnoutId = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): LogicSection { + return LogicSection.deserialize(bytes); + } + } + export class TrackSection extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; points?: Point[]; code?: string; @@ -5823,3373 +7449,3961 @@ export namespace graphicData { isCurve?: boolean; segmentsCount?: number; trackLogicSection?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 10], 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 ("code" in data && data.code != undefined) { - this.code = data.code; - } - if ("type" in data && data.type != undefined) { - this.type = data.type; - } - if ("destinationCode" in data && data.destinationCode != undefined) { - this.destinationCode = data.destinationCode; - } - if ("isCurve" in data && data.isCurve != undefined) { - this.isCurve = data.isCurve; - } - if ("segmentsCount" in data && data.segmentsCount != undefined) { - this.segmentsCount = data.segmentsCount; - } - if ("trackLogicSection" in data && data.trackLogicSection != undefined) { - this.trackLogicSection = data.trackLogicSection; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [2, 10], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('points' in data && data.points != undefined) { + this.points = data.points; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('code' in data && data.code != undefined) { + this.code = data.code; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('type' in data && data.type != undefined) { + this.type = data.type; } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 2) as Point[]; + if ('destinationCode' in data && data.destinationCode != undefined) { + this.destinationCode = data.destinationCode; } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); + if ('isCurve' in data && data.isCurve != undefined) { + this.isCurve = data.isCurve; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + if ('segmentsCount' in data && data.segmentsCount != undefined) { + this.segmentsCount = data.segmentsCount; } - set code(value: string) { - pb_1.Message.setField(this, 3, value); - } - get type() { - return pb_1.Message.getFieldWithDefault(this, 5, TrackSection.TrackSectionType.NORMAL) as TrackSection.TrackSectionType; - } - set type(value: TrackSection.TrackSectionType) { - pb_1.Message.setField(this, 5, value); - } - get destinationCode() { - return pb_1.Message.getFieldWithDefault(this, 6, "") as string; - } - set destinationCode(value: string) { - pb_1.Message.setField(this, 6, value); - } - get isCurve() { - return pb_1.Message.getFieldWithDefault(this, 8, false) as boolean; - } - set isCurve(value: boolean) { - pb_1.Message.setField(this, 8, value); - } - get segmentsCount() { - return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; - } - set segmentsCount(value: number) { - pb_1.Message.setField(this, 9, value); - } - get trackLogicSection() { - return pb_1.Message.getFieldWithDefault(this, 10, []) as number[]; - } - set trackLogicSection(value: number[]) { - pb_1.Message.setField(this, 10, value); - } - static fromObject(data: { - common?: ReturnType; - points?: ReturnType[]; - code?: string; - type?: TrackSection.TrackSectionType; - destinationCode?: string; - isCurve?: boolean; - segmentsCount?: number; - trackLogicSection?: number[]; - }): TrackSection { - const message = new TrackSection({}); - 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.code != null) { - message.code = data.code; - } - if (data.type != null) { - message.type = data.type; - } - if (data.destinationCode != null) { - message.destinationCode = data.destinationCode; - } - if (data.isCurve != null) { - message.isCurve = data.isCurve; - } - if (data.segmentsCount != null) { - message.segmentsCount = data.segmentsCount; - } - if (data.trackLogicSection != null) { - message.trackLogicSection = data.trackLogicSection; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - points?: ReturnType[]; - code?: string; - type?: TrackSection.TrackSectionType; - destinationCode?: string; - isCurve?: boolean; - segmentsCount?: number; - trackLogicSection?: number[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - if (this.code != null) { - data.code = this.code; - } - if (this.type != null) { - data.type = this.type; - } - if (this.destinationCode != null) { - data.destinationCode = this.destinationCode; - } - if (this.isCurve != null) { - data.isCurve = this.isCurve; - } - if (this.segmentsCount != null) { - data.segmentsCount = this.segmentsCount; - } - if (this.trackLogicSection != null) { - data.trackLogicSection = this.trackLogicSection; - } - 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.code.length) - writer.writeString(3, this.code); - if (this.type != TrackSection.TrackSectionType.NORMAL) - writer.writeEnum(5, this.type); - if (this.destinationCode.length) - writer.writeString(6, this.destinationCode); - if (this.isCurve != false) - writer.writeBool(8, this.isCurve); - if (this.segmentsCount != 0) - writer.writeInt32(9, this.segmentsCount); - if (this.trackLogicSection.length) - writer.writePackedUint32(10, this.trackLogicSection); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrackSection { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrackSection(); - 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.code = reader.readString(); - break; - case 5: - message.type = reader.readEnum(); - break; - case 6: - message.destinationCode = reader.readString(); - break; - case 8: - message.isCurve = reader.readBool(); - break; - case 9: - message.segmentsCount = reader.readInt32(); - break; - case 10: - message.trackLogicSection = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): TrackSection { - return TrackSection.deserialize(bytes); + if ( + 'trackLogicSection' in data && + data.trackLogicSection != undefined + ) { + this.trackLogicSection = data.trackLogicSection; } + } } - export namespace TrackSection { - export enum TrackSectionType { - NORMAL = 0, - FORK = 1 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class TrackLogicSection extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 code() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set code(value: string) { + pb_1.Message.setField(this, 3, value); + } + get type() { + return pb_1.Message.getFieldWithDefault( + this, + 5, + TrackSection.TrackSectionType.NORMAL + ) as TrackSection.TrackSectionType; + } + set type(value: TrackSection.TrackSectionType) { + pb_1.Message.setField(this, 5, value); + } + get destinationCode() { + return pb_1.Message.getFieldWithDefault(this, 6, '') as string; + } + set destinationCode(value: string) { + pb_1.Message.setField(this, 6, value); + } + get isCurve() { + return pb_1.Message.getFieldWithDefault(this, 8, false) as boolean; + } + set isCurve(value: boolean) { + pb_1.Message.setField(this, 8, value); + } + get segmentsCount() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set segmentsCount(value: number) { + pb_1.Message.setField(this, 9, value); + } + get trackLogicSection() { + return pb_1.Message.getFieldWithDefault(this, 10, []) as number[]; + } + set trackLogicSection(value: number[]) { + pb_1.Message.setField(this, 10, value); + } + static fromObject(data: { + common?: ReturnType; + points?: ReturnType[]; + code?: string; + type?: TrackSection.TrackSectionType; + destinationCode?: string; + isCurve?: boolean; + segmentsCount?: number; + trackLogicSection?: number[]; + }): TrackSection { + const message = new TrackSection({}); + 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.code != null) { + message.code = data.code; + } + if (data.type != null) { + message.type = data.type; + } + if (data.destinationCode != null) { + message.destinationCode = data.destinationCode; + } + if (data.isCurve != null) { + message.isCurve = data.isCurve; + } + if (data.segmentsCount != null) { + message.segmentsCount = data.segmentsCount; + } + if (data.trackLogicSection != null) { + message.trackLogicSection = data.trackLogicSection; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + points?: ReturnType[]; + code?: string; + type?: TrackSection.TrackSectionType; + destinationCode?: string; + isCurve?: boolean; + segmentsCount?: number; + trackLogicSection?: number[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + if (this.code != null) { + data.code = this.code; + } + if (this.type != null) { + data.type = this.type; + } + if (this.destinationCode != null) { + data.destinationCode = this.destinationCode; + } + if (this.isCurve != null) { + data.isCurve = this.isCurve; + } + if (this.segmentsCount != null) { + data.segmentsCount = this.segmentsCount; + } + if (this.trackLogicSection != null) { + data.trackLogicSection = this.trackLogicSection; + } + 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.code.length) writer.writeString(3, this.code); + if (this.type != TrackSection.TrackSectionType.NORMAL) + writer.writeEnum(5, this.type); + if (this.destinationCode.length) + writer.writeString(6, this.destinationCode); + if (this.isCurve != false) writer.writeBool(8, this.isCurve); + if (this.segmentsCount != 0) writer.writeInt32(9, this.segmentsCount); + if (this.trackLogicSection.length) + writer.writePackedUint32(10, this.trackLogicSection); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrackSection { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new TrackSection(); + 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.code = reader.readString(); + break; + case 5: + message.type = reader.readEnum(); + break; + case 6: + message.destinationCode = reader.readString(); + break; + case 8: + message.isCurve = reader.readBool(); + break; + case 9: + message.segmentsCount = reader.readInt32(); + break; + case 10: + message.trackLogicSection = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TrackSection { + return TrackSection.deserialize(bytes); + } + } + export namespace TrackSection { + export enum TrackSectionType { + NORMAL = 0, + FORK = 1, + } + } + export class TrackLogicSection extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; points?: Point[]; code?: string; length?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], 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 ("code" in data && data.code != undefined) { - this.code = data.code; - } - if ("length" in data && data.length != undefined) { - this.length = data.length; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [2], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('points' in data && data.points != undefined) { + this.points = data.points; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('code' in data && data.code != undefined) { + this.code = data.code; } - 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 code() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 3, value); - } - get length() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set length(value: number) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - points?: ReturnType[]; - code?: string; - length?: number; - }): TrackLogicSection { - const message = new TrackLogicSection({}); - 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.code != null) { - message.code = data.code; - } - if (data.length != null) { - message.length = data.length; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - points?: ReturnType[]; - code?: string; - length?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - if (this.code != null) { - data.code = this.code; - } - if (this.length != null) { - data.length = this.length; - } - 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.code.length) - writer.writeString(3, this.code); - if (this.length != 0) - writer.writeInt32(4, this.length); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrackLogicSection { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrackLogicSection(); - 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.code = reader.readString(); - break; - case 4: - message.length = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): TrackLogicSection { - return TrackLogicSection.deserialize(bytes); + if ('length' in data && data.length != undefined) { + this.length = data.length; } + } } - export class StopPosition extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 code() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set code(value: string) { + pb_1.Message.setField(this, 3, value); + } + get length() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set length(value: number) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + points?: ReturnType[]; + code?: string; + length?: number; + }): TrackLogicSection { + const message = new TrackLogicSection({}); + 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.code != null) { + message.code = data.code; + } + if (data.length != null) { + message.length = data.length; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + points?: ReturnType[]; + code?: string; + length?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + if (this.code != null) { + data.code = this.code; + } + if (this.length != null) { + data.length = this.length; + } + 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.code.length) writer.writeString(3, this.code); + if (this.length != 0) writer.writeInt32(4, this.length); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): TrackLogicSection { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new TrackLogicSection(); + 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.code = reader.readString(); + break; + case 4: + message.length = reader.readInt32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TrackLogicSection { + return TrackLogicSection.deserialize(bytes); + } + } + export class StopPosition extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; flip?: boolean; coachNum?: StopPosition.CoachNum; kilometerSystem?: KilometerSystem; refDev?: RelatedRef; - }) { - 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 ("flip" in data && data.flip != undefined) { - this.flip = data.flip; - } - if ("coachNum" in data && data.coachNum != undefined) { - this.coachNum = data.coachNum; - } - if ("kilometerSystem" in data && data.kilometerSystem != undefined) { - this.kilometerSystem = data.kilometerSystem; - } - if ("refDev" in data && data.refDev != undefined) { - this.refDev = data.refDev; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('flip' in data && data.flip != undefined) { + this.flip = data.flip; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('coachNum' in data && data.coachNum != undefined) { + this.coachNum = data.coachNum; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get flip() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set flip(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get coachNum() { - return pb_1.Message.getFieldWithDefault(this, 4, StopPosition.CoachNum.Four) as StopPosition.CoachNum; - } - set coachNum(value: StopPosition.CoachNum) { - pb_1.Message.setField(this, 4, value); - } - get kilometerSystem() { - return pb_1.Message.getWrapperField(this, KilometerSystem, 6) as KilometerSystem; - } - set kilometerSystem(value: KilometerSystem) { - pb_1.Message.setWrapperField(this, 6, value); - } - 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; - flip?: boolean; - coachNum?: StopPosition.CoachNum; - kilometerSystem?: ReturnType; - refDev?: ReturnType; - }): StopPosition { - const message = new StopPosition({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.flip != null) { - message.flip = data.flip; - } - if (data.coachNum != null) { - message.coachNum = data.coachNum; - } - if (data.kilometerSystem != null) { - message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem); - } - if (data.refDev != null) { - message.refDev = RelatedRef.fromObject(data.refDev); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - flip?: boolean; - coachNum?: StopPosition.CoachNum; - kilometerSystem?: ReturnType; - refDev?: ReturnType; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.flip != null) { - data.flip = this.flip; - } - if (this.coachNum != null) { - data.coachNum = this.coachNum; - } - if (this.kilometerSystem != null) { - data.kilometerSystem = this.kilometerSystem.toObject(); - } - if (this.refDev != null) { - data.refDev = this.refDev.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.flip != false) - writer.writeBool(3, this.flip); - if (this.coachNum != StopPosition.CoachNum.Four) - writer.writeEnum(4, this.coachNum); - 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(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StopPosition { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StopPosition(); - 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.flip = reader.readBool(); - break; - case 4: - message.coachNum = reader.readEnum(); - break; - 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(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): StopPosition { - return StopPosition.deserialize(bytes); + if ('refDev' in data && data.refDev != undefined) { + this.refDev = data.refDev; } + } } - export namespace StopPosition { - export enum CoachNum { - Four = 0, - Six = 1, - Eight = 2 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class SpksSwitch extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 flip() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set flip(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get coachNum() { + return pb_1.Message.getFieldWithDefault( + this, + 4, + StopPosition.CoachNum.Four + ) as StopPosition.CoachNum; + } + set coachNum(value: StopPosition.CoachNum) { + pb_1.Message.setField(this, 4, value); + } + get kilometerSystem() { + return pb_1.Message.getWrapperField( + this, + KilometerSystem, + 6 + ) as KilometerSystem; + } + set kilometerSystem(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 6, value); + } + 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; + flip?: boolean; + coachNum?: StopPosition.CoachNum; + kilometerSystem?: ReturnType; + refDev?: ReturnType; + }): StopPosition { + const message = new StopPosition({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.flip != null) { + message.flip = data.flip; + } + if (data.coachNum != null) { + message.coachNum = data.coachNum; + } + if (data.kilometerSystem != null) { + message.kilometerSystem = KilometerSystem.fromObject( + data.kilometerSystem + ); + } + if (data.refDev != null) { + message.refDev = RelatedRef.fromObject(data.refDev); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + flip?: boolean; + coachNum?: StopPosition.CoachNum; + kilometerSystem?: ReturnType; + refDev?: ReturnType; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.flip != null) { + data.flip = this.flip; + } + if (this.coachNum != null) { + data.coachNum = this.coachNum; + } + if (this.kilometerSystem != null) { + data.kilometerSystem = this.kilometerSystem.toObject(); + } + if (this.refDev != null) { + data.refDev = this.refDev.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.flip != false) writer.writeBool(3, this.flip); + if (this.coachNum != StopPosition.CoachNum.Four) + writer.writeEnum(4, this.coachNum); + 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(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StopPosition { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new StopPosition(); + 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.flip = reader.readBool(); + break; + case 4: + message.coachNum = reader.readEnum(); + break; + 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(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): StopPosition { + return StopPosition.deserialize(bytes); + } + } + export namespace StopPosition { + export enum CoachNum { + Four = 0, + Six = 1, + Eight = 2, + } + } + export class SpksSwitch extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; flip?: boolean; refSections?: number[]; refStand?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [8], 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 ("flip" in data && data.flip != undefined) { - this.flip = data.flip; - } - if ("refSections" in data && data.refSections != undefined) { - this.refSections = data.refSections; - } - if ("refStand" in data && data.refStand != undefined) { - this.refStand = data.refStand; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [8], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('flip' in data && data.flip != undefined) { + this.flip = data.flip; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('refSections' in data && data.refSections != undefined) { + this.refSections = data.refSections; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get flip() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set flip(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get refSections() { - return pb_1.Message.getFieldWithDefault(this, 8, []) as number[]; - } - set refSections(value: number[]) { - pb_1.Message.setField(this, 8, value); - } - get refStand() { - return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; - } - set refStand(value: number) { - pb_1.Message.setField(this, 9, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - flip?: boolean; - refSections?: number[]; - refStand?: number; - }): SpksSwitch { - const message = new SpksSwitch({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.flip != null) { - message.flip = data.flip; - } - if (data.refSections != null) { - message.refSections = data.refSections; - } - if (data.refStand != null) { - message.refStand = data.refStand; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - flip?: boolean; - refSections?: number[]; - refStand?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.flip != null) { - data.flip = this.flip; - } - if (this.refSections != null) { - data.refSections = this.refSections; - } - if (this.refStand != null) { - data.refStand = this.refStand; - } - 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.flip != false) - writer.writeBool(3, this.flip); - if (this.refSections.length) - writer.writePackedUint32(8, this.refSections); - if (this.refStand != 0) - writer.writeUint32(9, this.refStand); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SpksSwitch { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SpksSwitch(); - 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.flip = reader.readBool(); - break; - case 8: - message.refSections = reader.readPackedUint32(); - break; - case 9: - message.refStand = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): SpksSwitch { - return SpksSwitch.deserialize(bytes); + if ('refStand' in data && data.refStand != undefined) { + this.refStand = data.refStand; } + } } - export class EsbButton extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 flip() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set flip(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get refSections() { + return pb_1.Message.getFieldWithDefault(this, 8, []) as number[]; + } + set refSections(value: number[]) { + pb_1.Message.setField(this, 8, value); + } + get refStand() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set refStand(value: number) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + flip?: boolean; + refSections?: number[]; + refStand?: number; + }): SpksSwitch { + const message = new SpksSwitch({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.flip != null) { + message.flip = data.flip; + } + if (data.refSections != null) { + message.refSections = data.refSections; + } + if (data.refStand != null) { + message.refStand = data.refStand; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + flip?: boolean; + refSections?: number[]; + refStand?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.flip != null) { + data.flip = this.flip; + } + if (this.refSections != null) { + data.refSections = this.refSections; + } + if (this.refStand != null) { + data.refStand = this.refStand; + } + 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.flip != false) writer.writeBool(3, this.flip); + if (this.refSections.length) + writer.writePackedUint32(8, this.refSections); + if (this.refStand != 0) writer.writeUint32(9, this.refStand); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SpksSwitch { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new SpksSwitch(); + 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.flip = reader.readBool(); + break; + case 8: + message.refSections = reader.readPackedUint32(); + break; + case 9: + message.refStand = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SpksSwitch { + return SpksSwitch.deserialize(bytes); + } + } + export class EsbButton extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; flip?: boolean; refStand?: number; - }) { - 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 ("flip" in data && data.flip != undefined) { - this.flip = data.flip; - } - if ("refStand" in data && data.refStand != undefined) { - this.refStand = data.refStand; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('flip' in data && data.flip != undefined) { + this.flip = data.flip; } - 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 flip() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set flip(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get refStand() { - return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; - } - set refStand(value: number) { - pb_1.Message.setField(this, 7, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - flip?: boolean; - refStand?: number; - }): EsbButton { - const message = new EsbButton({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.flip != null) { - message.flip = data.flip; - } - if (data.refStand != null) { - message.refStand = data.refStand; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - flip?: boolean; - refStand?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.flip != null) { - data.flip = this.flip; - } - if (this.refStand != null) { - data.refStand = this.refStand; - } - 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.flip != false) - writer.writeBool(3, this.flip); - if (this.refStand != 0) - writer.writeUint32(7, this.refStand); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EsbButton { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EsbButton(); - 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.flip = reader.readBool(); - break; - case 7: - message.refStand = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): EsbButton { - return EsbButton.deserialize(bytes); + if ('refStand' in data && data.refStand != undefined) { + this.refStand = data.refStand; } + } } - export class GatedBox extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 flip() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set flip(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get refStand() { + return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; + } + set refStand(value: number) { + pb_1.Message.setField(this, 7, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + flip?: boolean; + refStand?: number; + }): EsbButton { + const message = new EsbButton({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.flip != null) { + message.flip = data.flip; + } + if (data.refStand != null) { + message.refStand = data.refStand; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + flip?: boolean; + refStand?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.flip != null) { + data.flip = this.flip; + } + if (this.refStand != null) { + data.refStand = this.refStand; + } + 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.flip != false) writer.writeBool(3, this.flip); + if (this.refStand != 0) writer.writeUint32(7, this.refStand); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EsbButton { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new EsbButton(); + 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.flip = reader.readBool(); + break; + case 7: + message.refStand = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EsbButton { + return EsbButton.deserialize(bytes); + } + } + export class GatedBox extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; flip?: boolean; refGatedBoxMapCode?: string; refScreenDoor?: number; - }) { - 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 ("flip" in data && data.flip != undefined) { - this.flip = data.flip; - } - if ("refGatedBoxMapCode" in data && data.refGatedBoxMapCode != undefined) { - this.refGatedBoxMapCode = data.refGatedBoxMapCode; - } - if ("refScreenDoor" in data && data.refScreenDoor != undefined) { - this.refScreenDoor = data.refScreenDoor; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('flip' in data && data.flip != undefined) { + this.flip = data.flip; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ( + 'refGatedBoxMapCode' in data && + data.refGatedBoxMapCode != undefined + ) { + this.refGatedBoxMapCode = data.refGatedBoxMapCode; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get flip() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set flip(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get refGatedBoxMapCode() { - return pb_1.Message.getFieldWithDefault(this, 6, "") as string; - } - set refGatedBoxMapCode(value: string) { - pb_1.Message.setField(this, 6, value); - } - get refScreenDoor() { - return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; - } - set refScreenDoor(value: number) { - pb_1.Message.setField(this, 7, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - flip?: boolean; - refGatedBoxMapCode?: string; - refScreenDoor?: number; - }): GatedBox { - const message = new GatedBox({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.flip != null) { - message.flip = data.flip; - } - if (data.refGatedBoxMapCode != null) { - message.refGatedBoxMapCode = data.refGatedBoxMapCode; - } - if (data.refScreenDoor != null) { - message.refScreenDoor = data.refScreenDoor; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - flip?: boolean; - refGatedBoxMapCode?: string; - refScreenDoor?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.flip != null) { - data.flip = this.flip; - } - if (this.refGatedBoxMapCode != null) { - data.refGatedBoxMapCode = this.refGatedBoxMapCode; - } - if (this.refScreenDoor != null) { - data.refScreenDoor = this.refScreenDoor; - } - 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.flip != false) - writer.writeBool(3, this.flip); - if (this.refGatedBoxMapCode.length) - writer.writeString(6, this.refGatedBoxMapCode); - if (this.refScreenDoor != 0) - writer.writeUint32(7, this.refScreenDoor); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GatedBox { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GatedBox(); - 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.flip = reader.readBool(); - break; - case 6: - message.refGatedBoxMapCode = reader.readString(); - break; - case 7: - message.refScreenDoor = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): GatedBox { - return GatedBox.deserialize(bytes); + if ('refScreenDoor' in data && data.refScreenDoor != undefined) { + this.refScreenDoor = data.refScreenDoor; } + } } - export class IbpBox extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 flip() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set flip(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get refGatedBoxMapCode() { + return pb_1.Message.getFieldWithDefault(this, 6, '') as string; + } + set refGatedBoxMapCode(value: string) { + pb_1.Message.setField(this, 6, value); + } + get refScreenDoor() { + return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; + } + set refScreenDoor(value: number) { + pb_1.Message.setField(this, 7, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + flip?: boolean; + refGatedBoxMapCode?: string; + refScreenDoor?: number; + }): GatedBox { + const message = new GatedBox({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.flip != null) { + message.flip = data.flip; + } + if (data.refGatedBoxMapCode != null) { + message.refGatedBoxMapCode = data.refGatedBoxMapCode; + } + if (data.refScreenDoor != null) { + message.refScreenDoor = data.refScreenDoor; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + flip?: boolean; + refGatedBoxMapCode?: string; + refScreenDoor?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.flip != null) { + data.flip = this.flip; + } + if (this.refGatedBoxMapCode != null) { + data.refGatedBoxMapCode = this.refGatedBoxMapCode; + } + if (this.refScreenDoor != null) { + data.refScreenDoor = this.refScreenDoor; + } + 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.flip != false) writer.writeBool(3, this.flip); + if (this.refGatedBoxMapCode.length) + writer.writeString(6, this.refGatedBoxMapCode); + if (this.refScreenDoor != 0) writer.writeUint32(7, this.refScreenDoor); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GatedBox { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new GatedBox(); + 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.flip = reader.readBool(); + break; + case 6: + message.refGatedBoxMapCode = reader.readString(); + break; + case 7: + message.refScreenDoor = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GatedBox { + return GatedBox.deserialize(bytes); + } + } + export class IbpBox extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; refIbpMapCode?: string; refStationId?: number; - }) { - 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 ("refIbpMapCode" in data && data.refIbpMapCode != undefined) { - this.refIbpMapCode = data.refIbpMapCode; - } - if ("refStationId" in data && data.refStationId != undefined) { - this.refStationId = data.refStationId; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('refIbpMapCode' in data && data.refIbpMapCode != undefined) { + this.refIbpMapCode = data.refIbpMapCode; } - 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 refIbpMapCode() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set refIbpMapCode(value: string) { - pb_1.Message.setField(this, 3, value); - } - get refStationId() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set refStationId(value: number) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - refIbpMapCode?: string; - refStationId?: number; - }): IbpBox { - const message = new IbpBox({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.refIbpMapCode != null) { - message.refIbpMapCode = data.refIbpMapCode; - } - if (data.refStationId != null) { - message.refStationId = data.refStationId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - refIbpMapCode?: string; - refStationId?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.refIbpMapCode != null) { - data.refIbpMapCode = this.refIbpMapCode; - } - if (this.refStationId != null) { - data.refStationId = this.refStationId; - } - 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.refIbpMapCode.length) - writer.writeString(3, this.refIbpMapCode); - if (this.refStationId != 0) - writer.writeUint32(4, this.refStationId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IbpBox { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IbpBox(); - 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.refIbpMapCode = reader.readString(); - break; - case 4: - message.refStationId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): IbpBox { - return IbpBox.deserialize(bytes); + if ('refStationId' in data && data.refStationId != undefined) { + this.refStationId = data.refStationId; } + } } - export class PslBox extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 refIbpMapCode() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set refIbpMapCode(value: string) { + pb_1.Message.setField(this, 3, value); + } + get refStationId() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set refStationId(value: number) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + refIbpMapCode?: string; + refStationId?: number; + }): IbpBox { + const message = new IbpBox({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.refIbpMapCode != null) { + message.refIbpMapCode = data.refIbpMapCode; + } + if (data.refStationId != null) { + message.refStationId = data.refStationId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + refIbpMapCode?: string; + refStationId?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.refIbpMapCode != null) { + data.refIbpMapCode = this.refIbpMapCode; + } + if (this.refStationId != null) { + data.refStationId = this.refStationId; + } + 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.refIbpMapCode.length) writer.writeString(3, this.refIbpMapCode); + if (this.refStationId != 0) writer.writeUint32(4, this.refStationId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IbpBox { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new IbpBox(); + 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.refIbpMapCode = reader.readString(); + break; + case 4: + message.refStationId = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): IbpBox { + return IbpBox.deserialize(bytes); + } + } + export class PslBox extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; refPslMapCode?: string; refPlatformId?: number; - }) { - 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 ("refPslMapCode" in data && data.refPslMapCode != undefined) { - this.refPslMapCode = data.refPslMapCode; - } - if ("refPlatformId" in data && data.refPlatformId != undefined) { - this.refPlatformId = data.refPlatformId; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('refPslMapCode' in data && data.refPslMapCode != undefined) { + this.refPslMapCode = data.refPslMapCode; } - 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 refPslMapCode() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set refPslMapCode(value: string) { - pb_1.Message.setField(this, 3, value); - } - get refPlatformId() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set refPlatformId(value: number) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - refPslMapCode?: string; - refPlatformId?: number; - }): PslBox { - const message = new PslBox({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.refPslMapCode != null) { - message.refPslMapCode = data.refPslMapCode; - } - if (data.refPlatformId != null) { - message.refPlatformId = data.refPlatformId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - refPslMapCode?: string; - refPlatformId?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.refPslMapCode != null) { - data.refPslMapCode = this.refPslMapCode; - } - if (this.refPlatformId != null) { - data.refPlatformId = this.refPlatformId; - } - 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.refPslMapCode.length) - writer.writeString(3, this.refPslMapCode); - if (this.refPlatformId != 0) - writer.writeUint32(4, this.refPlatformId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PslBox { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PslBox(); - 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.refPslMapCode = reader.readString(); - break; - case 4: - message.refPlatformId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): PslBox { - return PslBox.deserialize(bytes); + if ('refPlatformId' in data && data.refPlatformId != undefined) { + this.refPlatformId = data.refPlatformId; } + } } - export class SlopeKiloMarker extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 refPslMapCode() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set refPslMapCode(value: string) { + pb_1.Message.setField(this, 3, value); + } + get refPlatformId() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set refPlatformId(value: number) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + refPslMapCode?: string; + refPlatformId?: number; + }): PslBox { + const message = new PslBox({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.refPslMapCode != null) { + message.refPslMapCode = data.refPslMapCode; + } + if (data.refPlatformId != null) { + message.refPlatformId = data.refPlatformId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + refPslMapCode?: string; + refPlatformId?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.refPslMapCode != null) { + data.refPslMapCode = this.refPslMapCode; + } + if (this.refPlatformId != null) { + data.refPlatformId = this.refPlatformId; + } + 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.refPslMapCode.length) writer.writeString(3, this.refPslMapCode); + if (this.refPlatformId != 0) writer.writeUint32(4, this.refPlatformId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PslBox { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new PslBox(); + 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.refPslMapCode = reader.readString(); + break; + case 4: + message.refPlatformId = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): PslBox { + return PslBox.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, [4], 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; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - 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.getRepeatedWrapperField(this, KilometerSystem, 4) as KilometerSystem[]; - } - set kilometerSystem(value: KilometerSystem[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - 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 = data.kilometerSystem.map(item => KilometerSystem.fromObject(item)); - } - 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.map((item: KilometerSystem) => 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.kilometerSystem.length) - writer.writeRepeatedMessage(4, this.kilometerSystem, (item: KilometerSystem) => item.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, () => pb_1.Message.addToRepeatedWrapperField(message, 4, KilometerSystem.deserialize(reader), KilometerSystem)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): SlopeKiloMarker { - return SlopeKiloMarker.deserialize(bytes); + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } + } } - export class CurvatureKiloMarker extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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.getRepeatedWrapperField( + this, + KilometerSystem, + 4 + ) as KilometerSystem[]; + } + set kilometerSystem(value: KilometerSystem[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + 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 = data.kilometerSystem.map((item) => + KilometerSystem.fromObject(item) + ); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType< + typeof KilometerSystem.prototype.toObject + >[]; + } = {}; + 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.map( + (item: KilometerSystem) => 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.kilometerSystem.length) + writer.writeRepeatedMessage( + 4, + this.kilometerSystem, + (item: KilometerSystem) => item.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, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 4, + KilometerSystem.deserialize(reader), + KilometerSystem + ) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SlopeKiloMarker { + return SlopeKiloMarker.deserialize(bytes); + } + } + export class CurvatureKiloMarker 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, [4], 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; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - 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.getRepeatedWrapperField(this, KilometerSystem, 4) as KilometerSystem[]; - } - set kilometerSystem(value: KilometerSystem[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - kilometerSystem?: ReturnType[]; - }): CurvatureKiloMarker { - const message = new CurvatureKiloMarker({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.kilometerSystem != null) { - message.kilometerSystem = data.kilometerSystem.map(item => KilometerSystem.fromObject(item)); - } - 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.map((item: KilometerSystem) => 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.kilometerSystem.length) - writer.writeRepeatedMessage(4, this.kilometerSystem, (item: KilometerSystem) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - 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; - 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, () => pb_1.Message.addToRepeatedWrapperField(message, 4, KilometerSystem.deserialize(reader), KilometerSystem)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): CurvatureKiloMarker { - return CurvatureKiloMarker.deserialize(bytes); + if ('kilometerSystem' in data && data.kilometerSystem != undefined) { + this.kilometerSystem = data.kilometerSystem; } + } } - export class GarageDoor extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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.getRepeatedWrapperField( + this, + KilometerSystem, + 4 + ) as KilometerSystem[]; + } + set kilometerSystem(value: KilometerSystem[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType[]; + }): CurvatureKiloMarker { + const message = new CurvatureKiloMarker({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.kilometerSystem != null) { + message.kilometerSystem = data.kilometerSystem.map((item) => + KilometerSystem.fromObject(item) + ); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + kilometerSystem?: ReturnType< + typeof KilometerSystem.prototype.toObject + >[]; + } = {}; + 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.map( + (item: KilometerSystem) => 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.kilometerSystem.length) + writer.writeRepeatedMessage( + 4, + this.kilometerSystem, + (item: KilometerSystem) => item.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + 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; + 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, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 4, + KilometerSystem.deserialize(reader), + KilometerSystem + ) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CurvatureKiloMarker { + return CurvatureKiloMarker.deserialize(bytes); + } + } + export class GarageDoor extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; linkSection?: number; centralizedStations?: number[]; refPslMapCode?: string; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], 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 ("linkSection" in data && data.linkSection != undefined) { - this.linkSection = data.linkSection; - } - if ("centralizedStations" in data && data.centralizedStations != undefined) { - this.centralizedStations = data.centralizedStations; - } - if ("refPslMapCode" in data && data.refPslMapCode != undefined) { - this.refPslMapCode = data.refPslMapCode; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('linkSection' in data && data.linkSection != undefined) { + this.linkSection = data.linkSection; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ( + 'centralizedStations' in data && + data.centralizedStations != undefined + ) { + this.centralizedStations = data.centralizedStations; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get linkSection() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set linkSection(value: number) { - pb_1.Message.setField(this, 3, value); - } - get centralizedStations() { - return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; - } - set centralizedStations(value: number[]) { - pb_1.Message.setField(this, 4, value); - } - get refPslMapCode() { - return pb_1.Message.getFieldWithDefault(this, 5, "") as string; - } - set refPslMapCode(value: string) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - linkSection?: number; - centralizedStations?: number[]; - refPslMapCode?: string; - }): GarageDoor { - const message = new GarageDoor({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.linkSection != null) { - message.linkSection = data.linkSection; - } - if (data.centralizedStations != null) { - message.centralizedStations = data.centralizedStations; - } - if (data.refPslMapCode != null) { - message.refPslMapCode = data.refPslMapCode; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - linkSection?: number; - centralizedStations?: number[]; - refPslMapCode?: string; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.linkSection != null) { - data.linkSection = this.linkSection; - } - if (this.centralizedStations != null) { - data.centralizedStations = this.centralizedStations; - } - if (this.refPslMapCode != null) { - data.refPslMapCode = this.refPslMapCode; - } - 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.linkSection != 0) - writer.writeUint32(3, this.linkSection); - if (this.centralizedStations.length) - writer.writePackedUint32(4, this.centralizedStations); - if (this.refPslMapCode.length) - writer.writeString(5, this.refPslMapCode); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GarageDoor { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GarageDoor(); - 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.linkSection = reader.readUint32(); - break; - case 4: - message.centralizedStations = reader.readPackedUint32(); - break; - case 5: - message.refPslMapCode = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): GarageDoor { - return GarageDoor.deserialize(bytes); + if ('refPslMapCode' in data && data.refPslMapCode != undefined) { + this.refPslMapCode = data.refPslMapCode; } + } } - export class CarWashing extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 linkSection() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set linkSection(value: number) { + pb_1.Message.setField(this, 3, value); + } + get centralizedStations() { + return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; + } + set centralizedStations(value: number[]) { + pb_1.Message.setField(this, 4, value); + } + get refPslMapCode() { + return pb_1.Message.getFieldWithDefault(this, 5, '') as string; + } + set refPslMapCode(value: string) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + linkSection?: number; + centralizedStations?: number[]; + refPslMapCode?: string; + }): GarageDoor { + const message = new GarageDoor({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.linkSection != null) { + message.linkSection = data.linkSection; + } + if (data.centralizedStations != null) { + message.centralizedStations = data.centralizedStations; + } + if (data.refPslMapCode != null) { + message.refPslMapCode = data.refPslMapCode; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + linkSection?: number; + centralizedStations?: number[]; + refPslMapCode?: string; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.linkSection != null) { + data.linkSection = this.linkSection; + } + if (this.centralizedStations != null) { + data.centralizedStations = this.centralizedStations; + } + if (this.refPslMapCode != null) { + data.refPslMapCode = this.refPslMapCode; + } + 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.linkSection != 0) writer.writeUint32(3, this.linkSection); + if (this.centralizedStations.length) + writer.writePackedUint32(4, this.centralizedStations); + if (this.refPslMapCode.length) writer.writeString(5, this.refPslMapCode); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GarageDoor { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new GarageDoor(); + 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.linkSection = reader.readUint32(); + break; + case 4: + message.centralizedStations = reader.readPackedUint32(); + break; + case 5: + message.refPslMapCode = reader.readString(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GarageDoor { + return GarageDoor.deserialize(bytes); + } + } + export class CarWashing extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; linkSection?: number; centralizedStations?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], 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 ("linkSection" in data && data.linkSection != undefined) { - this.linkSection = data.linkSection; - } - if ("centralizedStations" in data && data.centralizedStations != undefined) { - this.centralizedStations = data.centralizedStations; - } - } + duanNum?: number; + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('linkSection' in data && data.linkSection != undefined) { + this.linkSection = data.linkSection; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ( + 'centralizedStations' in data && + data.centralizedStations != undefined + ) { + this.centralizedStations = data.centralizedStations; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get linkSection() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set linkSection(value: number) { - pb_1.Message.setField(this, 3, value); - } - get centralizedStations() { - return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; - } - set centralizedStations(value: number[]) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - linkSection?: number; - centralizedStations?: number[]; - }): CarWashing { - const message = new CarWashing({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.linkSection != null) { - message.linkSection = data.linkSection; - } - if (data.centralizedStations != null) { - message.centralizedStations = data.centralizedStations; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - linkSection?: number; - centralizedStations?: number[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.linkSection != null) { - data.linkSection = this.linkSection; - } - if (this.centralizedStations != null) { - data.centralizedStations = this.centralizedStations; - } - 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.linkSection != 0) - writer.writeUint32(3, this.linkSection); - if (this.centralizedStations.length) - writer.writePackedUint32(4, this.centralizedStations); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CarWashing { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CarWashing(); - 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.linkSection = reader.readUint32(); - break; - case 4: - message.centralizedStations = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): CarWashing { - return CarWashing.deserialize(bytes); + if ('duanNum' in data && data.duanNum != undefined) { + this.duanNum = data.duanNum; } + } } - export class Beacon extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 linkSection() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set linkSection(value: number) { + pb_1.Message.setField(this, 3, value); + } + get centralizedStations() { + return pb_1.Message.getFieldWithDefault(this, 4, []) as number[]; + } + set centralizedStations(value: number[]) { + pb_1.Message.setField(this, 4, value); + } + get duanNum() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set duanNum(value: number) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + linkSection?: number; + centralizedStations?: number[]; + duanNum?: number; + }): CarWashing { + const message = new CarWashing({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.linkSection != null) { + message.linkSection = data.linkSection; + } + if (data.centralizedStations != null) { + message.centralizedStations = data.centralizedStations; + } + if (data.duanNum != null) { + message.duanNum = data.duanNum; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + linkSection?: number; + centralizedStations?: number[]; + duanNum?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.linkSection != null) { + data.linkSection = this.linkSection; + } + if (this.centralizedStations != null) { + data.centralizedStations = this.centralizedStations; + } + if (this.duanNum != null) { + data.duanNum = this.duanNum; + } + 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.linkSection != 0) writer.writeUint32(3, this.linkSection); + if (this.centralizedStations.length) + writer.writePackedUint32(4, this.centralizedStations); + if (this.duanNum != 0) writer.writeUint32(5, this.duanNum); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CarWashing { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new CarWashing(); + 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.linkSection = reader.readUint32(); + break; + case 4: + message.centralizedStations = reader.readPackedUint32(); + break; + case 5: + message.duanNum = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CarWashing { + return CarWashing.deserialize(bytes); + } + } + export class Beacon extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; type?: Beacon.BeaconType; flip?: boolean; - }) { - 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 ("type" in data && data.type != undefined) { - this.type = data.type; - } - if ("flip" in data && data.flip != undefined) { - this.flip = data.flip; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('type' in data && data.type != undefined) { + this.type = data.type; } - 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 type() { - return pb_1.Message.getFieldWithDefault(this, 3, Beacon.BeaconType.Static) as Beacon.BeaconType; - } - set type(value: Beacon.BeaconType) { - pb_1.Message.setField(this, 3, value); - } - get flip() { - return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; - } - set flip(value: boolean) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - type?: Beacon.BeaconType; - flip?: boolean; - }): Beacon { - const message = new Beacon({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.type != null) { - message.type = data.type; - } - if (data.flip != null) { - message.flip = data.flip; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - type?: Beacon.BeaconType; - flip?: boolean; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.type != null) { - data.type = this.type; - } - if (this.flip != null) { - data.flip = this.flip; - } - 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.type != Beacon.BeaconType.Static) - writer.writeEnum(3, this.type); - if (this.flip != false) - writer.writeBool(4, this.flip); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Beacon { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Beacon(); - 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.type = reader.readEnum(); - break; - case 4: - message.flip = reader.readBool(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Beacon { - return Beacon.deserialize(bytes); + if ('flip' in data && data.flip != undefined) { + this.flip = data.flip; } + } } - export namespace Beacon { - export enum BeaconType { - Static = 0, - Dynamic = 1 - } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; } - export class Slope extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 type() { + return pb_1.Message.getFieldWithDefault( + this, + 3, + Beacon.BeaconType.Static + ) as Beacon.BeaconType; + } + set type(value: Beacon.BeaconType) { + pb_1.Message.setField(this, 3, value); + } + get flip() { + return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; + } + set flip(value: boolean) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + type?: Beacon.BeaconType; + flip?: boolean; + }): Beacon { + const message = new Beacon({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.type != null) { + message.type = data.type; + } + if (data.flip != null) { + message.flip = data.flip; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + type?: Beacon.BeaconType; + flip?: boolean; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.type != null) { + data.type = this.type; + } + if (this.flip != null) { + data.flip = this.flip; + } + 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.type != Beacon.BeaconType.Static) writer.writeEnum(3, this.type); + if (this.flip != false) writer.writeBool(4, this.flip); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Beacon { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Beacon(); + 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.type = reader.readEnum(); + break; + case 4: + message.flip = reader.readBool(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Beacon { + return Beacon.deserialize(bytes); + } + } + export namespace Beacon { + export enum BeaconType { + Static = 0, + Dynamic = 1, + } + } + export class Slope extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; points?: Point[]; slopeNumber?: number; refDeviceId?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 5], 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 ("slopeNumber" in data && data.slopeNumber != undefined) { - this.slopeNumber = data.slopeNumber; - } - if ("refDeviceId" in data && data.refDeviceId != undefined) { - this.refDeviceId = data.refDeviceId; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [2, 5], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('points' in data && data.points != undefined) { + this.points = data.points; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('slopeNumber' in data && data.slopeNumber != undefined) { + this.slopeNumber = data.slopeNumber; } - 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 slopeNumber() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set slopeNumber(value: number) { - pb_1.Message.setField(this, 3, value); - } - get refDeviceId() { - return pb_1.Message.getFieldWithDefault(this, 5, []) as number[]; - } - set refDeviceId(value: number[]) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - common?: ReturnType; - points?: ReturnType[]; - slopeNumber?: number; - refDeviceId?: number[]; - }): Slope { - const message = new Slope({}); - 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.slopeNumber != null) { - message.slopeNumber = data.slopeNumber; - } - if (data.refDeviceId != null) { - message.refDeviceId = data.refDeviceId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - points?: ReturnType[]; - slopeNumber?: number; - refDeviceId?: number[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - if (this.slopeNumber != null) { - data.slopeNumber = this.slopeNumber; - } - 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.points.length) - writer.writeRepeatedMessage(2, this.points, (item: Point) => item.serialize(writer)); - if (this.slopeNumber != 0) - writer.writeSint32(3, this.slopeNumber); - if (this.refDeviceId.length) - writer.writePackedUint32(5, 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: - reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Point.deserialize(reader), Point)); - break; - case 3: - message.slopeNumber = reader.readSint32(); - break; - case 5: - message.refDeviceId = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Slope { - return Slope.deserialize(bytes); + if ('refDeviceId' in data && data.refDeviceId != undefined) { + this.refDeviceId = data.refDeviceId; } + } } - export class Curvature extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 slopeNumber() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set slopeNumber(value: number) { + pb_1.Message.setField(this, 3, value); + } + get refDeviceId() { + return pb_1.Message.getFieldWithDefault(this, 5, []) as number[]; + } + set refDeviceId(value: number[]) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + points?: ReturnType[]; + slopeNumber?: number; + refDeviceId?: number[]; + }): Slope { + const message = new Slope({}); + 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.slopeNumber != null) { + message.slopeNumber = data.slopeNumber; + } + if (data.refDeviceId != null) { + message.refDeviceId = data.refDeviceId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + points?: ReturnType[]; + slopeNumber?: number; + refDeviceId?: number[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + if (this.slopeNumber != null) { + data.slopeNumber = this.slopeNumber; + } + 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.points.length) + writer.writeRepeatedMessage(2, this.points, (item: Point) => + item.serialize(writer) + ); + if (this.slopeNumber != 0) writer.writeSint32(3, this.slopeNumber); + if (this.refDeviceId.length) + writer.writePackedUint32(5, 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: + reader.readMessage(message.points, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 2, + Point.deserialize(reader), + Point + ) + ); + break; + case 3: + message.slopeNumber = reader.readSint32(); + break; + case 5: + message.refDeviceId = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Slope { + return Slope.deserialize(bytes); + } + } + export class Curvature extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; points?: Point[]; curvatureNumber?: number; refDeviceId?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 5], 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 ("curvatureNumber" in data && data.curvatureNumber != undefined) { - this.curvatureNumber = data.curvatureNumber; - } - if ("refDeviceId" in data && data.refDeviceId != undefined) { - this.refDeviceId = data.refDeviceId; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [2, 5], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('points' in data && data.points != undefined) { + this.points = data.points; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('curvatureNumber' in data && data.curvatureNumber != undefined) { + this.curvatureNumber = data.curvatureNumber; } - 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 curvatureNumber() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set curvatureNumber(value: number) { - pb_1.Message.setField(this, 3, value); - } - get refDeviceId() { - return pb_1.Message.getFieldWithDefault(this, 5, []) as number[]; - } - set refDeviceId(value: number[]) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - common?: ReturnType; - points?: ReturnType[]; - curvatureNumber?: number; - refDeviceId?: number[]; - }): Curvature { - const message = new Curvature({}); - 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.curvatureNumber != null) { - message.curvatureNumber = data.curvatureNumber; - } - if (data.refDeviceId != null) { - message.refDeviceId = data.refDeviceId; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - points?: ReturnType[]; - curvatureNumber?: number; - refDeviceId?: number[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - if (this.curvatureNumber != null) { - data.curvatureNumber = this.curvatureNumber; - } - 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.points.length) - writer.writeRepeatedMessage(2, this.points, (item: Point) => item.serialize(writer)); - if (this.curvatureNumber != 0) - writer.writeSint32(3, this.curvatureNumber); - if (this.refDeviceId.length) - writer.writePackedUint32(5, this.refDeviceId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Curvature { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Curvature(); - 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.curvatureNumber = reader.readSint32(); - break; - case 5: - message.refDeviceId = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Curvature { - return Curvature.deserialize(bytes); + if ('refDeviceId' in data && data.refDeviceId != undefined) { + this.refDeviceId = data.refDeviceId; } + } } - export class DepartureTimer extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 curvatureNumber() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set curvatureNumber(value: number) { + pb_1.Message.setField(this, 3, value); + } + get refDeviceId() { + return pb_1.Message.getFieldWithDefault(this, 5, []) as number[]; + } + set refDeviceId(value: number[]) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + points?: ReturnType[]; + curvatureNumber?: number; + refDeviceId?: number[]; + }): Curvature { + const message = new Curvature({}); + 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.curvatureNumber != null) { + message.curvatureNumber = data.curvatureNumber; + } + if (data.refDeviceId != null) { + message.refDeviceId = data.refDeviceId; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + points?: ReturnType[]; + curvatureNumber?: number; + refDeviceId?: number[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + if (this.curvatureNumber != null) { + data.curvatureNumber = this.curvatureNumber; + } + 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.points.length) + writer.writeRepeatedMessage(2, this.points, (item: Point) => + item.serialize(writer) + ); + if (this.curvatureNumber != 0) + writer.writeSint32(3, this.curvatureNumber); + if (this.refDeviceId.length) + writer.writePackedUint32(5, this.refDeviceId); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Curvature { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Curvature(); + 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.curvatureNumber = reader.readSint32(); + break; + case 5: + message.refDeviceId = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Curvature { + return Curvature.deserialize(bytes); + } + } + export class DepartureTimer extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; runDirection?: string; refStand?: number; - }) { - 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 ("runDirection" in data && data.runDirection != undefined) { - this.runDirection = data.runDirection; - } - if ("refStand" in data && data.refStand != undefined) { - this.refStand = data.refStand; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('runDirection' in data && data.runDirection != undefined) { + this.runDirection = data.runDirection; } - 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 runDirection() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set runDirection(value: string) { - pb_1.Message.setField(this, 4, value); - } - get refStand() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set refStand(value: number) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - runDirection?: string; - refStand?: number; - }): DepartureTimer { - const message = new DepartureTimer({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.runDirection != null) { - message.runDirection = data.runDirection; - } - if (data.refStand != null) { - message.refStand = data.refStand; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - runDirection?: string; - refStand?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.runDirection != null) { - data.runDirection = this.runDirection; - } - if (this.refStand != null) { - data.refStand = this.refStand; - } - 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.runDirection.length) - writer.writeString(4, this.runDirection); - if (this.refStand != 0) - writer.writeUint32(5, this.refStand); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DepartureTimer { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DepartureTimer(); - 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: - message.runDirection = reader.readString(); - break; - case 5: - message.refStand = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): DepartureTimer { - return DepartureTimer.deserialize(bytes); + if ('refStand' in data && data.refStand != undefined) { + this.refStand = data.refStand; } + } } - export class AutoReturnBox extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 runDirection() { + return pb_1.Message.getFieldWithDefault(this, 4, '') as string; + } + set runDirection(value: string) { + pb_1.Message.setField(this, 4, value); + } + get refStand() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set refStand(value: number) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + runDirection?: string; + refStand?: number; + }): DepartureTimer { + const message = new DepartureTimer({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.runDirection != null) { + message.runDirection = data.runDirection; + } + if (data.refStand != null) { + message.refStand = data.refStand; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + runDirection?: string; + refStand?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.runDirection != null) { + data.runDirection = this.runDirection; + } + if (this.refStand != null) { + data.refStand = this.refStand; + } + 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.runDirection.length) writer.writeString(4, this.runDirection); + if (this.refStand != 0) writer.writeUint32(5, this.refStand); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DepartureTimer { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new DepartureTimer(); + 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: + message.runDirection = reader.readString(); + break; + case 5: + message.refStand = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DepartureTimer { + return DepartureTimer.deserialize(bytes); + } + } + export class AutoReturnBox extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; flip?: boolean; index?: number; refStand?: number; - }) { - 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 ("flip" in data && data.flip != undefined) { - this.flip = data.flip; - } - if ("index" in data && data.index != undefined) { - this.index = data.index; - } - if ("refStand" in data && data.refStand != undefined) { - this.refStand = data.refStand; - } - } + } + ) { + 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; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('flip' in data && data.flip != undefined) { + this.flip = data.flip; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('index' in data && data.index != undefined) { + this.index = data.index; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get flip() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set flip(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get index() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set index(value: number) { - pb_1.Message.setField(this, 4, value); - } - get refStand() { - return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; - } - set refStand(value: number) { - pb_1.Message.setField(this, 6, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - flip?: boolean; - index?: number; - refStand?: number; - }): AutoReturnBox { - const message = new AutoReturnBox({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.flip != null) { - message.flip = data.flip; - } - if (data.index != null) { - message.index = data.index; - } - if (data.refStand != null) { - message.refStand = data.refStand; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - flip?: boolean; - index?: number; - refStand?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.flip != null) { - data.flip = this.flip; - } - if (this.index != null) { - data.index = this.index; - } - if (this.refStand != null) { - data.refStand = this.refStand; - } - 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.flip != false) - writer.writeBool(3, this.flip); - if (this.index != 0) - writer.writeInt32(4, this.index); - if (this.refStand != 0) - writer.writeUint32(6, this.refStand); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AutoReturnBox { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AutoReturnBox(); - 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.flip = reader.readBool(); - break; - case 4: - message.index = reader.readInt32(); - break; - case 6: - message.refStand = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AutoReturnBox { - return AutoReturnBox.deserialize(bytes); + if ('refStand' in data && data.refStand != undefined) { + this.refStand = data.refStand; } + } } - export class UniqueIdOfStationLayout extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + 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 flip() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set flip(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + get index() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set index(value: number) { + pb_1.Message.setField(this, 4, value); + } + get refStand() { + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; + } + set refStand(value: number) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + flip?: boolean; + index?: number; + refStand?: number; + }): AutoReturnBox { + const message = new AutoReturnBox({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.flip != null) { + message.flip = data.flip; + } + if (data.index != null) { + message.index = data.index; + } + if (data.refStand != null) { + message.refStand = data.refStand; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + flip?: boolean; + index?: number; + refStand?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.flip != null) { + data.flip = this.flip; + } + if (this.index != null) { + data.index = this.index; + } + if (this.refStand != null) { + data.refStand = this.refStand; + } + 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.flip != false) writer.writeBool(3, this.flip); + if (this.index != 0) writer.writeInt32(4, this.index); + if (this.refStand != 0) writer.writeUint32(6, this.refStand); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AutoReturnBox { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new AutoReturnBox(); + 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.flip = reader.readBool(); + break; + case 4: + message.index = reader.readInt32(); + break; + case 6: + message.refStand = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): AutoReturnBox { + return AutoReturnBox.deserialize(bytes); + } + } + export class UniqueIdOfStationLayout extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { city?: string; lineId?: string; mainCoordinateSystem?: 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 ("city" in data && data.city != undefined) { - this.city = data.city; - } - if ("lineId" in data && data.lineId != undefined) { - this.lineId = data.lineId; - } - if ("mainCoordinateSystem" in data && data.mainCoordinateSystem != undefined) { - this.mainCoordinateSystem = data.mainCoordinateSystem; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('city' in data && data.city != undefined) { + this.city = data.city; } - get city() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + if ('lineId' in data && data.lineId != undefined) { + this.lineId = data.lineId; } - set city(value: string) { - pb_1.Message.setField(this, 1, value); - } - get lineId() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set lineId(value: string) { - pb_1.Message.setField(this, 2, value); - } - get mainCoordinateSystem() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set mainCoordinateSystem(value: string) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - city?: string; - lineId?: string; - mainCoordinateSystem?: string; - }): UniqueIdOfStationLayout { - const message = new UniqueIdOfStationLayout({}); - if (data.city != null) { - message.city = data.city; - } - if (data.lineId != null) { - message.lineId = data.lineId; - } - if (data.mainCoordinateSystem != null) { - message.mainCoordinateSystem = data.mainCoordinateSystem; - } - return message; - } - toObject() { - const data: { - city?: string; - lineId?: string; - mainCoordinateSystem?: string; - } = {}; - if (this.city != null) { - data.city = this.city; - } - if (this.lineId != null) { - data.lineId = this.lineId; - } - if (this.mainCoordinateSystem != null) { - data.mainCoordinateSystem = this.mainCoordinateSystem; - } - 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.city.length) - writer.writeString(1, this.city); - if (this.lineId.length) - writer.writeString(2, this.lineId); - if (this.mainCoordinateSystem.length) - writer.writeString(3, this.mainCoordinateSystem); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UniqueIdOfStationLayout { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UniqueIdOfStationLayout(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.city = reader.readString(); - break; - case 2: - message.lineId = reader.readString(); - break; - case 3: - message.mainCoordinateSystem = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): UniqueIdOfStationLayout { - return UniqueIdOfStationLayout.deserialize(bytes); + if ( + 'mainCoordinateSystem' in data && + data.mainCoordinateSystem != undefined + ) { + this.mainCoordinateSystem = data.mainCoordinateSystem; } + } } - export class KilometerConvert extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get city() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string; + } + set city(value: string) { + pb_1.Message.setField(this, 1, value); + } + get lineId() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set lineId(value: string) { + pb_1.Message.setField(this, 2, value); + } + get mainCoordinateSystem() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set mainCoordinateSystem(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + city?: string; + lineId?: string; + mainCoordinateSystem?: string; + }): UniqueIdOfStationLayout { + const message = new UniqueIdOfStationLayout({}); + if (data.city != null) { + message.city = data.city; + } + if (data.lineId != null) { + message.lineId = data.lineId; + } + if (data.mainCoordinateSystem != null) { + message.mainCoordinateSystem = data.mainCoordinateSystem; + } + return message; + } + toObject() { + const data: { + city?: string; + lineId?: string; + mainCoordinateSystem?: string; + } = {}; + if (this.city != null) { + data.city = this.city; + } + if (this.lineId != null) { + data.lineId = this.lineId; + } + if (this.mainCoordinateSystem != null) { + data.mainCoordinateSystem = this.mainCoordinateSystem; + } + 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.city.length) writer.writeString(1, this.city); + if (this.lineId.length) writer.writeString(2, this.lineId); + if (this.mainCoordinateSystem.length) + writer.writeString(3, this.mainCoordinateSystem); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): UniqueIdOfStationLayout { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new UniqueIdOfStationLayout(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.city = reader.readString(); + break; + case 2: + message.lineId = reader.readString(); + break; + case 3: + message.mainCoordinateSystem = reader.readString(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): UniqueIdOfStationLayout { + return UniqueIdOfStationLayout.deserialize(bytes); + } + } + export class KilometerConvert extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { kmA?: KilometerSystem; kmB?: KilometerSystem; sameTrend?: boolean; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("kmA" in data && data.kmA != undefined) { - this.kmA = data.kmA; - } - if ("kmB" in data && data.kmB != undefined) { - this.kmB = data.kmB; - } - if ("sameTrend" in data && data.sameTrend != undefined) { - this.sameTrend = data.sameTrend; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('kmA' in data && data.kmA != undefined) { + this.kmA = data.kmA; } - get kmA() { - return pb_1.Message.getWrapperField(this, KilometerSystem, 1) as KilometerSystem; + if ('kmB' in data && data.kmB != undefined) { + this.kmB = data.kmB; } - set kmA(value: KilometerSystem) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_kmA() { - return pb_1.Message.getField(this, 1) != null; - } - get kmB() { - return pb_1.Message.getWrapperField(this, KilometerSystem, 2) as KilometerSystem; - } - set kmB(value: KilometerSystem) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_kmB() { - return pb_1.Message.getField(this, 2) != null; - } - get sameTrend() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set sameTrend(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - kmA?: ReturnType; - kmB?: ReturnType; - sameTrend?: boolean; - }): KilometerConvert { - const message = new KilometerConvert({}); - if (data.kmA != null) { - message.kmA = KilometerSystem.fromObject(data.kmA); - } - if (data.kmB != null) { - message.kmB = KilometerSystem.fromObject(data.kmB); - } - if (data.sameTrend != null) { - message.sameTrend = data.sameTrend; - } - return message; - } - toObject() { - const data: { - kmA?: ReturnType; - kmB?: ReturnType; - sameTrend?: boolean; - } = {}; - if (this.kmA != null) { - data.kmA = this.kmA.toObject(); - } - if (this.kmB != null) { - data.kmB = this.kmB.toObject(); - } - if (this.sameTrend != null) { - data.sameTrend = this.sameTrend; - } - 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_kmA) - writer.writeMessage(1, this.kmA, () => this.kmA.serialize(writer)); - if (this.has_kmB) - writer.writeMessage(2, this.kmB, () => this.kmB.serialize(writer)); - if (this.sameTrend != false) - writer.writeBool(3, this.sameTrend); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): KilometerConvert { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new KilometerConvert(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.kmA, () => message.kmA = KilometerSystem.deserialize(reader)); - break; - case 2: - reader.readMessage(message.kmB, () => message.kmB = KilometerSystem.deserialize(reader)); - break; - case 3: - message.sameTrend = reader.readBool(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): KilometerConvert { - return KilometerConvert.deserialize(bytes); + if ('sameTrend' in data && data.sameTrend != undefined) { + this.sameTrend = data.sameTrend; } + } } - export class StationRelateDevice extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get kmA() { + return pb_1.Message.getWrapperField( + this, + KilometerSystem, + 1 + ) as KilometerSystem; + } + set kmA(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_kmA() { + return pb_1.Message.getField(this, 1) != null; + } + get kmB() { + return pb_1.Message.getWrapperField( + this, + KilometerSystem, + 2 + ) as KilometerSystem; + } + set kmB(value: KilometerSystem) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_kmB() { + return pb_1.Message.getField(this, 2) != null; + } + get sameTrend() { + return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; + } + set sameTrend(value: boolean) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + kmA?: ReturnType; + kmB?: ReturnType; + sameTrend?: boolean; + }): KilometerConvert { + const message = new KilometerConvert({}); + if (data.kmA != null) { + message.kmA = KilometerSystem.fromObject(data.kmA); + } + if (data.kmB != null) { + message.kmB = KilometerSystem.fromObject(data.kmB); + } + if (data.sameTrend != null) { + message.sameTrend = data.sameTrend; + } + return message; + } + toObject() { + const data: { + kmA?: ReturnType; + kmB?: ReturnType; + sameTrend?: boolean; + } = {}; + if (this.kmA != null) { + data.kmA = this.kmA.toObject(); + } + if (this.kmB != null) { + data.kmB = this.kmB.toObject(); + } + if (this.sameTrend != null) { + data.sameTrend = this.sameTrend; + } + 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_kmA) + writer.writeMessage(1, this.kmA, () => this.kmA.serialize(writer)); + if (this.has_kmB) + writer.writeMessage(2, this.kmB, () => this.kmB.serialize(writer)); + if (this.sameTrend != false) writer.writeBool(3, this.sameTrend); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): KilometerConvert { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new KilometerConvert(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.kmA, + () => (message.kmA = KilometerSystem.deserialize(reader)) + ); + break; + case 2: + reader.readMessage( + message.kmB, + () => (message.kmB = KilometerSystem.deserialize(reader)) + ); + break; + case 3: + message.sameTrend = reader.readBool(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): KilometerConvert { + return KilometerConvert.deserialize(bytes); + } + } + export class StationRelateDevice extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { code?: string; combinationtypes?: DeviceCombinationtype[]; deviceType?: RelatedRef.DeviceType; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("code" in data && data.code != undefined) { - this.code = data.code; - } - if ("combinationtypes" in data && data.combinationtypes != undefined) { - this.combinationtypes = data.combinationtypes; - } - if ("deviceType" in data && data.deviceType != undefined) { - this.deviceType = data.deviceType; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [2], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('code' in data && data.code != undefined) { + this.code = data.code; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + if ('combinationtypes' in data && data.combinationtypes != undefined) { + this.combinationtypes = data.combinationtypes; } - set code(value: string) { - pb_1.Message.setField(this, 1, value); - } - get combinationtypes() { - return pb_1.Message.getRepeatedWrapperField(this, DeviceCombinationtype, 2) as DeviceCombinationtype[]; - } - set combinationtypes(value: DeviceCombinationtype[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - get deviceType() { - return pb_1.Message.getFieldWithDefault(this, 3, RelatedRef.DeviceType.Section) as RelatedRef.DeviceType; - } - set deviceType(value: RelatedRef.DeviceType) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - code?: string; - combinationtypes?: ReturnType[]; - deviceType?: RelatedRef.DeviceType; - }): StationRelateDevice { - const message = new StationRelateDevice({}); - if (data.code != null) { - message.code = data.code; - } - if (data.combinationtypes != null) { - message.combinationtypes = data.combinationtypes.map(item => DeviceCombinationtype.fromObject(item)); - } - if (data.deviceType != null) { - message.deviceType = data.deviceType; - } - return message; - } - toObject() { - const data: { - code?: string; - combinationtypes?: ReturnType[]; - deviceType?: RelatedRef.DeviceType; - } = {}; - if (this.code != null) { - data.code = this.code; - } - if (this.combinationtypes != null) { - data.combinationtypes = this.combinationtypes.map((item: DeviceCombinationtype) => item.toObject()); - } - if (this.deviceType != null) { - data.deviceType = this.deviceType; - } - 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.code.length) - writer.writeString(1, this.code); - if (this.combinationtypes.length) - writer.writeRepeatedMessage(2, this.combinationtypes, (item: DeviceCombinationtype) => item.serialize(writer)); - if (this.deviceType != RelatedRef.DeviceType.Section) - writer.writeEnum(3, this.deviceType); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StationRelateDevice { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StationRelateDevice(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.code = reader.readString(); - break; - case 2: - reader.readMessage(message.combinationtypes, () => pb_1.Message.addToRepeatedWrapperField(message, 2, DeviceCombinationtype.deserialize(reader), DeviceCombinationtype)); - break; - case 3: - message.deviceType = reader.readEnum(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): StationRelateDevice { - return StationRelateDevice.deserialize(bytes); + if ('deviceType' in data && data.deviceType != undefined) { + this.deviceType = data.deviceType; } + } } - export class DeviceCombinationtype extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get code() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string; + } + set code(value: string) { + pb_1.Message.setField(this, 1, value); + } + get combinationtypes() { + return pb_1.Message.getRepeatedWrapperField( + this, + DeviceCombinationtype, + 2 + ) as DeviceCombinationtype[]; + } + set combinationtypes(value: DeviceCombinationtype[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get deviceType() { + return pb_1.Message.getFieldWithDefault( + this, + 3, + RelatedRef.DeviceType.Section + ) as RelatedRef.DeviceType; + } + set deviceType(value: RelatedRef.DeviceType) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + code?: string; + combinationtypes?: ReturnType< + typeof DeviceCombinationtype.prototype.toObject + >[]; + deviceType?: RelatedRef.DeviceType; + }): StationRelateDevice { + const message = new StationRelateDevice({}); + if (data.code != null) { + message.code = data.code; + } + if (data.combinationtypes != null) { + message.combinationtypes = data.combinationtypes.map((item) => + DeviceCombinationtype.fromObject(item) + ); + } + if (data.deviceType != null) { + message.deviceType = data.deviceType; + } + return message; + } + toObject() { + const data: { + code?: string; + combinationtypes?: ReturnType< + typeof DeviceCombinationtype.prototype.toObject + >[]; + deviceType?: RelatedRef.DeviceType; + } = {}; + if (this.code != null) { + data.code = this.code; + } + if (this.combinationtypes != null) { + data.combinationtypes = this.combinationtypes.map( + (item: DeviceCombinationtype) => item.toObject() + ); + } + if (this.deviceType != null) { + data.deviceType = this.deviceType; + } + 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.code.length) writer.writeString(1, this.code); + if (this.combinationtypes.length) + writer.writeRepeatedMessage( + 2, + this.combinationtypes, + (item: DeviceCombinationtype) => item.serialize(writer) + ); + if (this.deviceType != RelatedRef.DeviceType.Section) + writer.writeEnum(3, this.deviceType); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): StationRelateDevice { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new StationRelateDevice(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.code = reader.readString(); + break; + case 2: + reader.readMessage(message.combinationtypes, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 2, + DeviceCombinationtype.deserialize(reader), + DeviceCombinationtype + ) + ); + break; + case 3: + message.deviceType = reader.readEnum(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): StationRelateDevice { + return StationRelateDevice.deserialize(bytes); + } + } + export class DeviceCombinationtype extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { code?: string; refDevices?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("code" in data && data.code != undefined) { - this.code = data.code; - } - if ("refDevices" in data && data.refDevices != undefined) { - this.refDevices = data.refDevices; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('code' in data && data.code != undefined) { + this.code = data.code; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 1, value); - } - get refDevices() { - return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; - } - set refDevices(value: number[]) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - code?: string; - refDevices?: number[]; - }): DeviceCombinationtype { - const message = new DeviceCombinationtype({}); - if (data.code != null) { - message.code = data.code; - } - if (data.refDevices != null) { - message.refDevices = data.refDevices; - } - return message; - } - toObject() { - const data: { - code?: string; - refDevices?: number[]; - } = {}; - if (this.code != null) { - data.code = this.code; - } - if (this.refDevices != null) { - data.refDevices = this.refDevices; - } - 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.code.length) - writer.writeString(1, this.code); - if (this.refDevices.length) - writer.writePackedUint32(3, this.refDevices); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DeviceCombinationtype { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeviceCombinationtype(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.code = reader.readString(); - break; - case 3: - message.refDevices = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): DeviceCombinationtype { - return DeviceCombinationtype.deserialize(bytes); + if ('refDevices' in data && data.refDevices != undefined) { + this.refDevices = data.refDevices; } + } } - export class SectionCodePoint extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get code() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string; + } + set code(value: string) { + pb_1.Message.setField(this, 1, value); + } + get refDevices() { + return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; + } + set refDevices(value: number[]) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + code?: string; + refDevices?: number[]; + }): DeviceCombinationtype { + const message = new DeviceCombinationtype({}); + if (data.code != null) { + message.code = data.code; + } + if (data.refDevices != null) { + message.refDevices = data.refDevices; + } + return message; + } + toObject() { + const data: { + code?: string; + refDevices?: number[]; + } = {}; + if (this.code != null) { + data.code = this.code; + } + if (this.refDevices != null) { + data.refDevices = this.refDevices; + } + 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.code.length) writer.writeString(1, this.code); + if (this.refDevices.length) writer.writePackedUint32(3, this.refDevices); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): DeviceCombinationtype { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new DeviceCombinationtype(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.code = reader.readString(); + break; + case 3: + message.refDevices = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DeviceCombinationtype { + return DeviceCombinationtype.deserialize(bytes); + } + } + export class SectionCodePoint extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { sectionIds?: number[]; centralizedStation?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("sectionIds" in data && data.sectionIds != undefined) { - this.sectionIds = data.sectionIds; - } - if ("centralizedStation" in data && data.centralizedStation != undefined) { - this.centralizedStation = data.centralizedStation; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('sectionIds' in data && data.sectionIds != undefined) { + this.sectionIds = data.sectionIds; } - get sectionIds() { - return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; - } - set sectionIds(value: number[]) { - pb_1.Message.setField(this, 3, value); - } - get centralizedStation() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set centralizedStation(value: number) { - pb_1.Message.setField(this, 4, value); - } - static fromObject(data: { - sectionIds?: number[]; - centralizedStation?: number; - }): SectionCodePoint { - const message = new SectionCodePoint({}); - if (data.sectionIds != null) { - message.sectionIds = data.sectionIds; - } - if (data.centralizedStation != null) { - message.centralizedStation = data.centralizedStation; - } - return message; - } - toObject() { - const data: { - sectionIds?: number[]; - centralizedStation?: number; - } = {}; - if (this.sectionIds != null) { - data.sectionIds = this.sectionIds; - } - if (this.centralizedStation != null) { - data.centralizedStation = this.centralizedStation; - } - 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.sectionIds.length) - writer.writePackedUint32(3, this.sectionIds); - if (this.centralizedStation != 0) - writer.writeUint32(4, this.centralizedStation); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SectionCodePoint { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SectionCodePoint(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 3: - message.sectionIds = reader.readPackedUint32(); - break; - case 4: - message.centralizedStation = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): SectionCodePoint { - return SectionCodePoint.deserialize(bytes); + if ( + 'centralizedStation' in data && + data.centralizedStation != undefined + ) { + this.centralizedStation = data.centralizedStation; } + } } - export class Train extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get sectionIds() { + return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; + } + set sectionIds(value: number[]) { + pb_1.Message.setField(this, 3, value); + } + get centralizedStation() { + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; + } + set centralizedStation(value: number) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + sectionIds?: number[]; + centralizedStation?: number; + }): SectionCodePoint { + const message = new SectionCodePoint({}); + if (data.sectionIds != null) { + message.sectionIds = data.sectionIds; + } + if (data.centralizedStation != null) { + message.centralizedStation = data.centralizedStation; + } + return message; + } + toObject() { + const data: { + sectionIds?: number[]; + centralizedStation?: number; + } = {}; + if (this.sectionIds != null) { + data.sectionIds = this.sectionIds; + } + if (this.centralizedStation != null) { + data.centralizedStation = this.centralizedStation; + } + 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.sectionIds.length) writer.writePackedUint32(3, this.sectionIds); + if (this.centralizedStation != 0) + writer.writeUint32(4, this.centralizedStation); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): SectionCodePoint { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new SectionCodePoint(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 3: + message.sectionIds = reader.readPackedUint32(); + break; + case 4: + message.centralizedStation = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SectionCodePoint { + return SectionCodePoint.deserialize(bytes); + } + } + export class Train extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { trainModel?: Train.TrainModel; carriageLength?: number; totalLength?: number; trainSets?: string; dynamicConfig?: dependency_1.common.TrainDynamicConfig; trainControlMapId?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("trainModel" in data && data.trainModel != undefined) { - this.trainModel = data.trainModel; - } - if ("carriageLength" in data && data.carriageLength != undefined) { - this.carriageLength = data.carriageLength; - } - if ("totalLength" in data && data.totalLength != undefined) { - this.totalLength = data.totalLength; - } - if ("trainSets" in data && data.trainSets != undefined) { - this.trainSets = data.trainSets; - } - if ("dynamicConfig" in data && data.dynamicConfig != undefined) { - this.dynamicConfig = data.dynamicConfig; - } - if ("trainControlMapId" in data && data.trainControlMapId != undefined) { - this.trainControlMapId = data.trainControlMapId; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('trainModel' in data && data.trainModel != undefined) { + this.trainModel = data.trainModel; } - get trainModel() { - return pb_1.Message.getFieldWithDefault(this, 1, Train.TrainModel.A) as Train.TrainModel; + if ('carriageLength' in data && data.carriageLength != undefined) { + this.carriageLength = data.carriageLength; } - set trainModel(value: Train.TrainModel) { - pb_1.Message.setField(this, 1, value); + if ('totalLength' in data && data.totalLength != undefined) { + this.totalLength = data.totalLength; } - get carriageLength() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + if ('trainSets' in data && data.trainSets != undefined) { + this.trainSets = data.trainSets; } - set carriageLength(value: number) { - pb_1.Message.setField(this, 2, value); + if ('dynamicConfig' in data && data.dynamicConfig != undefined) { + this.dynamicConfig = data.dynamicConfig; } - get totalLength() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set totalLength(value: number) { - pb_1.Message.setField(this, 3, value); - } - get trainSets() { - return pb_1.Message.getFieldWithDefault(this, 6, "") as string; - } - set trainSets(value: string) { - pb_1.Message.setField(this, 6, value); - } - get dynamicConfig() { - return pb_1.Message.getWrapperField(this, dependency_1.common.TrainDynamicConfig, 7) as dependency_1.common.TrainDynamicConfig; - } - set dynamicConfig(value: dependency_1.common.TrainDynamicConfig) { - pb_1.Message.setWrapperField(this, 7, value); - } - get has_dynamicConfig() { - return pb_1.Message.getField(this, 7) != null; - } - get trainControlMapId() { - return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; - } - set trainControlMapId(value: number) { - pb_1.Message.setField(this, 9, value); - } - static fromObject(data: { - trainModel?: Train.TrainModel; - carriageLength?: number; - totalLength?: number; - trainSets?: string; - dynamicConfig?: ReturnType; - trainControlMapId?: number; - }): Train { - const message = new Train({}); - if (data.trainModel != null) { - message.trainModel = data.trainModel; - } - if (data.carriageLength != null) { - message.carriageLength = data.carriageLength; - } - if (data.totalLength != null) { - message.totalLength = data.totalLength; - } - if (data.trainSets != null) { - message.trainSets = data.trainSets; - } - if (data.dynamicConfig != null) { - message.dynamicConfig = dependency_1.common.TrainDynamicConfig.fromObject(data.dynamicConfig); - } - if (data.trainControlMapId != null) { - message.trainControlMapId = data.trainControlMapId; - } - return message; - } - toObject() { - const data: { - trainModel?: Train.TrainModel; - carriageLength?: number; - totalLength?: number; - trainSets?: string; - dynamicConfig?: ReturnType; - trainControlMapId?: number; - } = {}; - if (this.trainModel != null) { - data.trainModel = this.trainModel; - } - if (this.carriageLength != null) { - data.carriageLength = this.carriageLength; - } - if (this.totalLength != null) { - data.totalLength = this.totalLength; - } - if (this.trainSets != null) { - data.trainSets = this.trainSets; - } - if (this.dynamicConfig != null) { - data.dynamicConfig = this.dynamicConfig.toObject(); - } - if (this.trainControlMapId != null) { - data.trainControlMapId = this.trainControlMapId; - } - 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.trainModel != Train.TrainModel.A) - writer.writeEnum(1, this.trainModel); - if (this.carriageLength != 0) - writer.writeInt32(2, this.carriageLength); - if (this.totalLength != 0) - writer.writeInt32(3, this.totalLength); - if (this.trainSets.length) - writer.writeString(6, this.trainSets); - if (this.has_dynamicConfig) - writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer)); - if (this.trainControlMapId != 0) - writer.writeInt32(9, this.trainControlMapId); - 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: - message.trainModel = reader.readEnum(); - break; - case 2: - message.carriageLength = reader.readInt32(); - break; - case 3: - message.totalLength = reader.readInt32(); - break; - case 6: - message.trainSets = reader.readString(); - break; - case 7: - reader.readMessage(message.dynamicConfig, () => message.dynamicConfig = dependency_1.common.TrainDynamicConfig.deserialize(reader)); - break; - case 9: - message.trainControlMapId = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Train { - return Train.deserialize(bytes); + if ( + 'trainControlMapId' in data && + data.trainControlMapId != undefined + ) { + this.trainControlMapId = data.trainControlMapId; } + } } - export namespace Train { - export enum TrainModel { - A = 0, - B = 1, - C = 2, - D = 3 - } + get trainModel() { + return pb_1.Message.getFieldWithDefault( + this, + 1, + Train.TrainModel.A + ) as Train.TrainModel; } - export class OtherLine extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + set trainModel(value: Train.TrainModel) { + pb_1.Message.setField(this, 1, value); + } + get carriageLength() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set carriageLength(value: number) { + pb_1.Message.setField(this, 2, value); + } + get totalLength() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set totalLength(value: number) { + pb_1.Message.setField(this, 3, value); + } + get trainSets() { + return pb_1.Message.getFieldWithDefault(this, 6, '') as string; + } + set trainSets(value: string) { + pb_1.Message.setField(this, 6, value); + } + get dynamicConfig() { + return pb_1.Message.getWrapperField( + this, + dependency_1.common.TrainDynamicConfig, + 7 + ) as dependency_1.common.TrainDynamicConfig; + } + set dynamicConfig(value: dependency_1.common.TrainDynamicConfig) { + pb_1.Message.setWrapperField(this, 7, value); + } + get has_dynamicConfig() { + return pb_1.Message.getField(this, 7) != null; + } + get trainControlMapId() { + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; + } + set trainControlMapId(value: number) { + pb_1.Message.setField(this, 9, value); + } + static fromObject(data: { + trainModel?: Train.TrainModel; + carriageLength?: number; + totalLength?: number; + trainSets?: string; + dynamicConfig?: ReturnType< + typeof dependency_1.common.TrainDynamicConfig.prototype.toObject + >; + trainControlMapId?: number; + }): Train { + const message = new Train({}); + if (data.trainModel != null) { + message.trainModel = data.trainModel; + } + if (data.carriageLength != null) { + message.carriageLength = data.carriageLength; + } + if (data.totalLength != null) { + message.totalLength = data.totalLength; + } + if (data.trainSets != null) { + message.trainSets = data.trainSets; + } + if (data.dynamicConfig != null) { + message.dynamicConfig = + dependency_1.common.TrainDynamicConfig.fromObject(data.dynamicConfig); + } + if (data.trainControlMapId != null) { + message.trainControlMapId = data.trainControlMapId; + } + return message; + } + toObject() { + const data: { + trainModel?: Train.TrainModel; + carriageLength?: number; + totalLength?: number; + trainSets?: string; + dynamicConfig?: ReturnType< + typeof dependency_1.common.TrainDynamicConfig.prototype.toObject + >; + trainControlMapId?: number; + } = {}; + if (this.trainModel != null) { + data.trainModel = this.trainModel; + } + if (this.carriageLength != null) { + data.carriageLength = this.carriageLength; + } + if (this.totalLength != null) { + data.totalLength = this.totalLength; + } + if (this.trainSets != null) { + data.trainSets = this.trainSets; + } + if (this.dynamicConfig != null) { + data.dynamicConfig = this.dynamicConfig.toObject(); + } + if (this.trainControlMapId != null) { + data.trainControlMapId = this.trainControlMapId; + } + 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.trainModel != Train.TrainModel.A) + writer.writeEnum(1, this.trainModel); + if (this.carriageLength != 0) writer.writeInt32(2, this.carriageLength); + if (this.totalLength != 0) writer.writeInt32(3, this.totalLength); + if (this.trainSets.length) writer.writeString(6, this.trainSets); + if (this.has_dynamicConfig) + writer.writeMessage(7, this.dynamicConfig, () => + this.dynamicConfig.serialize(writer) + ); + if (this.trainControlMapId != 0) + writer.writeInt32(9, this.trainControlMapId); + 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: + message.trainModel = reader.readEnum(); + break; + case 2: + message.carriageLength = reader.readInt32(); + break; + case 3: + message.totalLength = reader.readInt32(); + break; + case 6: + message.trainSets = reader.readString(); + break; + case 7: + reader.readMessage( + message.dynamicConfig, + () => + (message.dynamicConfig = + dependency_1.common.TrainDynamicConfig.deserialize(reader)) + ); + break; + case 9: + message.trainControlMapId = reader.readInt32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Train { + return Train.deserialize(bytes); + } + } + export namespace Train { + export enum TrainModel { + A = 0, + B = 1, + C = 2, + D = 3, + } + } + export class OtherLine extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { name?: string; ids?: number[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("ids" in data && data.ids != undefined) { - this.ids = data.ids; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('name' in data && data.name != undefined) { + this.name = data.name; } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get ids() { - return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; - } - set ids(value: number[]) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - name?: string; - ids?: number[]; - }): OtherLine { - const message = new OtherLine({}); - if (data.name != null) { - message.name = data.name; - } - if (data.ids != null) { - message.ids = data.ids; - } - return message; - } - toObject() { - const data: { - name?: string; - ids?: number[]; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.ids != null) { - data.ids = this.ids; - } - 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.name.length) - writer.writeString(1, this.name); - if (this.ids.length) - writer.writePackedUint32(3, this.ids); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OtherLine { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new OtherLine(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 3: - message.ids = reader.readPackedUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): OtherLine { - return OtherLine.deserialize(bytes); + if ('ids' in data && data.ids != undefined) { + this.ids = data.ids; } + } } + get name() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get ids() { + return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; + } + set ids(value: number[]) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { name?: string; ids?: number[] }): OtherLine { + const message = new OtherLine({}); + if (data.name != null) { + message.name = data.name; + } + if (data.ids != null) { + message.ids = data.ids; + } + return message; + } + toObject() { + const data: { + name?: string; + ids?: number[]; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.ids != null) { + data.ids = this.ids; + } + 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.name.length) writer.writeString(1, this.name); + if (this.ids.length) writer.writePackedUint32(3, this.ids); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OtherLine { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new OtherLine(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 3: + message.ids = reader.readPackedUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): OtherLine { + return OtherLine.deserialize(bytes); + } + } } From d3e57cc444c8a19f2c785f3e5fb9577e9a26f943 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 2 Apr 2024 11:33:17 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rts-sim-testing-message | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index f566f96..e64115a 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit f566f96c40882d7691c57de3f5c9989cde85b82c +Subproject commit e64115ada314a096debd061cf54ee774f1091aa7