代码调整
This commit is contained in:
parent
153b1ec567
commit
d328f89463
@ -1,6 +1,10 @@
|
|||||||
import * as pb_1 from 'google-protobuf';
|
import * as pb_1 from 'google-protobuf';
|
||||||
import { IPointData } from 'pixi.js';
|
import { IPointData } from 'pixi.js';
|
||||||
import { IPathLineData, PathLine } from 'src/graphics/pathLine/PathLine';
|
import {
|
||||||
|
IPathLineData,
|
||||||
|
PathLine,
|
||||||
|
KilometerPoint,
|
||||||
|
} from 'src/graphics/pathLine/PathLine';
|
||||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||||
import { GraphicDataBase } from './GraphicDataBase';
|
import { GraphicDataBase } from './GraphicDataBase';
|
||||||
|
|
||||||
@ -35,6 +39,18 @@ export class PathLineData extends GraphicDataBase implements IPathLineData {
|
|||||||
(p) => new graphicData.Point({ x: p.x, y: p.y })
|
(p) => new graphicData.Point({ x: p.x, y: p.y })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
get kilometerPoints(): KilometerPoint[] {
|
||||||
|
return this.data.kilometerPoints;
|
||||||
|
}
|
||||||
|
set kilometerPoints(kilometerPoints: KilometerPoint[]) {
|
||||||
|
this.data.kilometerPoints = kilometerPoints.map(
|
||||||
|
(p) =>
|
||||||
|
new graphicData.KilometerPoint({
|
||||||
|
point: new graphicData.Point({ x: p.point.x, y: p.point.y }),
|
||||||
|
kilometer: p.kilometer,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
clone(): PathLineData {
|
clone(): PathLineData {
|
||||||
return new PathLineData(this.data.cloneMessage());
|
return new PathLineData(this.data.cloneMessage());
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,19 @@ import { Graphics, IPointData } from 'pixi.js';
|
|||||||
import { RunLine } from '../runLine/RunLine';
|
import { RunLine } from '../runLine/RunLine';
|
||||||
import { getDrawApp } from 'src/drawApp';
|
import { getDrawApp } from 'src/drawApp';
|
||||||
|
|
||||||
|
export interface KilometerPoint {
|
||||||
|
get point(): IPointData;
|
||||||
|
set point(point: IPointData);
|
||||||
|
get kilometer(): number;
|
||||||
|
set kilometer(kilometer: number);
|
||||||
|
}
|
||||||
export interface IPathLineData extends GraphicData {
|
export interface IPathLineData extends GraphicData {
|
||||||
get code(): string;
|
get code(): string;
|
||||||
set code(v: string);
|
set code(v: string);
|
||||||
get points(): IPointData[]; // 线坐标点
|
get points(): IPointData[]; // 线坐标点
|
||||||
set points(points: IPointData[]);
|
set points(points: IPointData[]);
|
||||||
|
get kilometerPoints(): KilometerPoint[];
|
||||||
|
set kilometerPoints(kilometerPoints: KilometerPoint[]);
|
||||||
clone(): IPathLineData;
|
clone(): IPathLineData;
|
||||||
copyFrom(data: IPathLineData): void;
|
copyFrom(data: IPathLineData): void;
|
||||||
eq(other: IPathLineData): boolean;
|
eq(other: IPathLineData): boolean;
|
||||||
@ -76,6 +84,9 @@ export class PathLine extends JlGraphic {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
generatePathLineKilometerPoints(stas: string[]) {
|
||||||
|
// this.datas.points.forEach()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PathLineTemplate extends JlGraphicTemplate<PathLine> {
|
export class PathLineTemplate extends JlGraphicTemplate<PathLine> {
|
||||||
|
@ -261,6 +261,22 @@ export class RunLine extends JlGraphic {
|
|||||||
});
|
});
|
||||||
this.datas.containSta = containSta;
|
this.datas.containSta = containSta;
|
||||||
}
|
}
|
||||||
|
generatePathLineKilometerPoints(): void {
|
||||||
|
const app = getDrawApp();
|
||||||
|
if (!app) return;
|
||||||
|
if (this.datas.upPathLineId) {
|
||||||
|
const pathLine = app.queryStore.queryById(
|
||||||
|
this.datas.upPathLineId
|
||||||
|
) as PathLine;
|
||||||
|
pathLine.generatePathLineKilometerPoints(this.datas.containSta);
|
||||||
|
}
|
||||||
|
if (this.datas.downPathLineId) {
|
||||||
|
const pathLine = app.queryStore.queryById(
|
||||||
|
this.datas.downPathLineId
|
||||||
|
) as PathLine;
|
||||||
|
pathLine.generatePathLineKilometerPoints(this.datas.containSta);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RunLineTemplate extends JlGraphicTemplate<RunLine> {
|
export class RunLineTemplate extends JlGraphicTemplate<RunLine> {
|
||||||
|
359
src/protos/device_info.ts
Normal file
359
src/protos/device_info.ts
Normal file
@ -0,0 +1,359 @@
|
|||||||
|
/**
|
||||||
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
|
* compiler version: 4.23.1
|
||||||
|
* source: device_info.proto
|
||||||
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
|
import * as dependency_1 from "./stationLayoutGraphics";
|
||||||
|
import * as pb_1 from "google-protobuf";
|
||||||
|
export namespace state {
|
||||||
|
export class Section extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
id?: string;
|
||||||
|
code?: string;
|
||||||
|
type?: dependency_1.graphicData.Section.SectionType;
|
||||||
|
paKilometerCode?: string;
|
||||||
|
pbKilometerCode?: string;
|
||||||
|
children?: Section[];
|
||||||
|
}) {
|
||||||
|
super();
|
||||||
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6], this.#one_of_decls);
|
||||||
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
|
if ("id" in data && data.id != undefined) {
|
||||||
|
this.id = data.id;
|
||||||
|
}
|
||||||
|
if ("code" in data && data.code != undefined) {
|
||||||
|
this.code = data.code;
|
||||||
|
}
|
||||||
|
if ("type" in data && data.type != undefined) {
|
||||||
|
this.type = data.type;
|
||||||
|
}
|
||||||
|
if ("paKilometerCode" in data && data.paKilometerCode != undefined) {
|
||||||
|
this.paKilometerCode = data.paKilometerCode;
|
||||||
|
}
|
||||||
|
if ("pbKilometerCode" in data && data.pbKilometerCode != undefined) {
|
||||||
|
this.pbKilometerCode = data.pbKilometerCode;
|
||||||
|
}
|
||||||
|
if ("children" in data && data.children != undefined) {
|
||||||
|
this.children = data.children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get id() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||||
|
}
|
||||||
|
set id(value: string) {
|
||||||
|
pb_1.Message.setField(this, 1, value);
|
||||||
|
}
|
||||||
|
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, dependency_1.graphicData.Section.SectionType.Physical) as dependency_1.graphicData.Section.SectionType;
|
||||||
|
}
|
||||||
|
set type(value: dependency_1.graphicData.Section.SectionType) {
|
||||||
|
pb_1.Message.setField(this, 3, value);
|
||||||
|
}
|
||||||
|
get paKilometerCode() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
||||||
|
}
|
||||||
|
set paKilometerCode(value: string) {
|
||||||
|
pb_1.Message.setField(this, 4, value);
|
||||||
|
}
|
||||||
|
get pbKilometerCode() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
|
||||||
|
}
|
||||||
|
set pbKilometerCode(value: string) {
|
||||||
|
pb_1.Message.setField(this, 5, value);
|
||||||
|
}
|
||||||
|
get children() {
|
||||||
|
return pb_1.Message.getRepeatedWrapperField(this, Section, 6) as Section[];
|
||||||
|
}
|
||||||
|
set children(value: Section[]) {
|
||||||
|
pb_1.Message.setRepeatedWrapperField(this, 6, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
id?: string;
|
||||||
|
code?: string;
|
||||||
|
type?: dependency_1.graphicData.Section.SectionType;
|
||||||
|
paKilometerCode?: string;
|
||||||
|
pbKilometerCode?: string;
|
||||||
|
children?: ReturnType<typeof Section.prototype.toObject>[];
|
||||||
|
}): Section {
|
||||||
|
const message = new Section({});
|
||||||
|
if (data.id != null) {
|
||||||
|
message.id = data.id;
|
||||||
|
}
|
||||||
|
if (data.code != null) {
|
||||||
|
message.code = data.code;
|
||||||
|
}
|
||||||
|
if (data.type != null) {
|
||||||
|
message.type = data.type;
|
||||||
|
}
|
||||||
|
if (data.paKilometerCode != null) {
|
||||||
|
message.paKilometerCode = data.paKilometerCode;
|
||||||
|
}
|
||||||
|
if (data.pbKilometerCode != null) {
|
||||||
|
message.pbKilometerCode = data.pbKilometerCode;
|
||||||
|
}
|
||||||
|
if (data.children != null) {
|
||||||
|
message.children = data.children.map(item => Section.fromObject(item));
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
id?: string;
|
||||||
|
code?: string;
|
||||||
|
type?: dependency_1.graphicData.Section.SectionType;
|
||||||
|
paKilometerCode?: string;
|
||||||
|
pbKilometerCode?: string;
|
||||||
|
children?: ReturnType<typeof Section.prototype.toObject>[];
|
||||||
|
} = {};
|
||||||
|
if (this.id != null) {
|
||||||
|
data.id = this.id;
|
||||||
|
}
|
||||||
|
if (this.code != null) {
|
||||||
|
data.code = this.code;
|
||||||
|
}
|
||||||
|
if (this.type != null) {
|
||||||
|
data.type = this.type;
|
||||||
|
}
|
||||||
|
if (this.paKilometerCode != null) {
|
||||||
|
data.paKilometerCode = this.paKilometerCode;
|
||||||
|
}
|
||||||
|
if (this.pbKilometerCode != null) {
|
||||||
|
data.pbKilometerCode = this.pbKilometerCode;
|
||||||
|
}
|
||||||
|
if (this.children != null) {
|
||||||
|
data.children = this.children.map((item: Section) => 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.id.length)
|
||||||
|
writer.writeString(1, this.id);
|
||||||
|
if (this.code.length)
|
||||||
|
writer.writeString(2, this.code);
|
||||||
|
if (this.type != dependency_1.graphicData.Section.SectionType.Physical)
|
||||||
|
writer.writeEnum(3, this.type);
|
||||||
|
if (this.paKilometerCode.length)
|
||||||
|
writer.writeString(4, this.paKilometerCode);
|
||||||
|
if (this.pbKilometerCode.length)
|
||||||
|
writer.writeString(5, this.pbKilometerCode);
|
||||||
|
if (this.children.length)
|
||||||
|
writer.writeRepeatedMessage(6, this.children, (item: Section) => item.serialize(writer));
|
||||||
|
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:
|
||||||
|
message.id = reader.readString();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
message.code = reader.readString();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
message.type = reader.readEnum();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
message.paKilometerCode = reader.readString();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
message.pbKilometerCode = reader.readString();
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
reader.readMessage(message.children, () => pb_1.Message.addToRepeatedWrapperField(message, 6, Section.deserialize(reader), Section));
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Section {
|
||||||
|
return Section.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class Switch extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
id?: string;
|
||||||
|
code?: string;
|
||||||
|
paSection?: Section;
|
||||||
|
pbSection?: Section;
|
||||||
|
pcSection?: Section;
|
||||||
|
}) {
|
||||||
|
super();
|
||||||
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||||
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
|
if ("id" in data && data.id != undefined) {
|
||||||
|
this.id = data.id;
|
||||||
|
}
|
||||||
|
if ("code" in data && data.code != undefined) {
|
||||||
|
this.code = data.code;
|
||||||
|
}
|
||||||
|
if ("paSection" in data && data.paSection != undefined) {
|
||||||
|
this.paSection = data.paSection;
|
||||||
|
}
|
||||||
|
if ("pbSection" in data && data.pbSection != undefined) {
|
||||||
|
this.pbSection = data.pbSection;
|
||||||
|
}
|
||||||
|
if ("pcSection" in data && data.pcSection != undefined) {
|
||||||
|
this.pcSection = data.pcSection;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get id() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||||
|
}
|
||||||
|
set id(value: string) {
|
||||||
|
pb_1.Message.setField(this, 1, value);
|
||||||
|
}
|
||||||
|
get code() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||||
|
}
|
||||||
|
set code(value: string) {
|
||||||
|
pb_1.Message.setField(this, 2, value);
|
||||||
|
}
|
||||||
|
get paSection() {
|
||||||
|
return pb_1.Message.getWrapperField(this, Section, 3) as Section;
|
||||||
|
}
|
||||||
|
set paSection(value: Section) {
|
||||||
|
pb_1.Message.setWrapperField(this, 3, value);
|
||||||
|
}
|
||||||
|
get has_paSection() {
|
||||||
|
return pb_1.Message.getField(this, 3) != null;
|
||||||
|
}
|
||||||
|
get pbSection() {
|
||||||
|
return pb_1.Message.getWrapperField(this, Section, 4) as Section;
|
||||||
|
}
|
||||||
|
set pbSection(value: Section) {
|
||||||
|
pb_1.Message.setWrapperField(this, 4, value);
|
||||||
|
}
|
||||||
|
get has_pbSection() {
|
||||||
|
return pb_1.Message.getField(this, 4) != null;
|
||||||
|
}
|
||||||
|
get pcSection() {
|
||||||
|
return pb_1.Message.getWrapperField(this, Section, 5) as Section;
|
||||||
|
}
|
||||||
|
set pcSection(value: Section) {
|
||||||
|
pb_1.Message.setWrapperField(this, 5, value);
|
||||||
|
}
|
||||||
|
get has_pcSection() {
|
||||||
|
return pb_1.Message.getField(this, 5) != null;
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
id?: string;
|
||||||
|
code?: string;
|
||||||
|
paSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
pbSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
pcSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
}): Switch {
|
||||||
|
const message = new Switch({});
|
||||||
|
if (data.id != null) {
|
||||||
|
message.id = data.id;
|
||||||
|
}
|
||||||
|
if (data.code != null) {
|
||||||
|
message.code = data.code;
|
||||||
|
}
|
||||||
|
if (data.paSection != null) {
|
||||||
|
message.paSection = Section.fromObject(data.paSection);
|
||||||
|
}
|
||||||
|
if (data.pbSection != null) {
|
||||||
|
message.pbSection = Section.fromObject(data.pbSection);
|
||||||
|
}
|
||||||
|
if (data.pcSection != null) {
|
||||||
|
message.pcSection = Section.fromObject(data.pcSection);
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
id?: string;
|
||||||
|
code?: string;
|
||||||
|
paSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
pbSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
pcSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
} = {};
|
||||||
|
if (this.id != null) {
|
||||||
|
data.id = this.id;
|
||||||
|
}
|
||||||
|
if (this.code != null) {
|
||||||
|
data.code = this.code;
|
||||||
|
}
|
||||||
|
if (this.paSection != null) {
|
||||||
|
data.paSection = this.paSection.toObject();
|
||||||
|
}
|
||||||
|
if (this.pbSection != null) {
|
||||||
|
data.pbSection = this.pbSection.toObject();
|
||||||
|
}
|
||||||
|
if (this.pcSection != null) {
|
||||||
|
data.pcSection = this.pcSection.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.id.length)
|
||||||
|
writer.writeString(1, this.id);
|
||||||
|
if (this.code.length)
|
||||||
|
writer.writeString(2, this.code);
|
||||||
|
if (this.has_paSection)
|
||||||
|
writer.writeMessage(3, this.paSection, () => this.paSection.serialize(writer));
|
||||||
|
if (this.has_pbSection)
|
||||||
|
writer.writeMessage(4, this.pbSection, () => this.pbSection.serialize(writer));
|
||||||
|
if (this.has_pcSection)
|
||||||
|
writer.writeMessage(5, this.pcSection, () => this.pcSection.serialize(writer));
|
||||||
|
if (!w)
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
}
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Switch {
|
||||||
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Switch();
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup())
|
||||||
|
break;
|
||||||
|
switch (reader.getFieldNumber()) {
|
||||||
|
case 1:
|
||||||
|
message.id = reader.readString();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
message.code = reader.readString();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
reader.readMessage(message.paSection, () => message.paSection = Section.deserialize(reader));
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
reader.readMessage(message.pbSection, () => message.pbSection = Section.deserialize(reader));
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
reader.readMessage(message.pcSection, () => message.pcSection = Section.deserialize(reader));
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Switch {
|
||||||
|
return Switch.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,20 @@
|
|||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
export namespace state {
|
export namespace state {
|
||||||
|
export enum DeviceType {
|
||||||
|
UNKNOW = 0,
|
||||||
|
RTU = 1,
|
||||||
|
STATION = 2,
|
||||||
|
SIGNAL = 3,
|
||||||
|
SWITCH = 4,
|
||||||
|
TRACK = 5,
|
||||||
|
ENTRY = 6,
|
||||||
|
PLATFORM = 7,
|
||||||
|
SCADA = 8,
|
||||||
|
WATERPROOF_DOOR = 9,
|
||||||
|
WORK_AREA = 10,
|
||||||
|
GAMA = 11
|
||||||
|
}
|
||||||
export class Rtu extends pb_1.Message {
|
export class Rtu extends pb_1.Message {
|
||||||
#one_of_decls: number[][] = [];
|
#one_of_decls: number[][] = [];
|
||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
@ -4472,623 +4486,4 @@ export namespace state {
|
|||||||
return OccNccFepNetwork.deserialize(bytes);
|
return OccNccFepNetwork.deserialize(bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class Train extends pb_1.Message {
|
|
||||||
#one_of_decls: number[][] = [];
|
|
||||||
constructor(data?: any[] | {
|
|
||||||
trainId?: string;
|
|
||||||
globalId?: string;
|
|
||||||
groupId?: string;
|
|
||||||
localSubId?: number;
|
|
||||||
trainType?: number;
|
|
||||||
speed?: number;
|
|
||||||
direction?: number;
|
|
||||||
destinationId?: number;
|
|
||||||
stationId?: number;
|
|
||||||
sideId?: number;
|
|
||||||
trackName?: string;
|
|
||||||
recordType?: boolean;
|
|
||||||
recordTime?: number;
|
|
||||||
driverId?: string;
|
|
||||||
routeId?: number;
|
|
||||||
mode?: number;
|
|
||||||
nccWindow?: number;
|
|
||||||
nccWindowOffset?: number;
|
|
||||||
rate?: number;
|
|
||||||
devType?: number;
|
|
||||||
devName?: string;
|
|
||||||
blockFlag?: number;
|
|
||||||
show?: boolean;
|
|
||||||
lineId?: number;
|
|
||||||
trainIndex?: 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 ("trainId" in data && data.trainId != undefined) {
|
|
||||||
this.trainId = data.trainId;
|
|
||||||
}
|
|
||||||
if ("globalId" in data && data.globalId != undefined) {
|
|
||||||
this.globalId = data.globalId;
|
|
||||||
}
|
|
||||||
if ("groupId" in data && data.groupId != undefined) {
|
|
||||||
this.groupId = data.groupId;
|
|
||||||
}
|
|
||||||
if ("localSubId" in data && data.localSubId != undefined) {
|
|
||||||
this.localSubId = data.localSubId;
|
|
||||||
}
|
|
||||||
if ("trainType" in data && data.trainType != undefined) {
|
|
||||||
this.trainType = data.trainType;
|
|
||||||
}
|
|
||||||
if ("speed" in data && data.speed != undefined) {
|
|
||||||
this.speed = data.speed;
|
|
||||||
}
|
|
||||||
if ("direction" in data && data.direction != undefined) {
|
|
||||||
this.direction = data.direction;
|
|
||||||
}
|
|
||||||
if ("destinationId" in data && data.destinationId != undefined) {
|
|
||||||
this.destinationId = data.destinationId;
|
|
||||||
}
|
|
||||||
if ("stationId" in data && data.stationId != undefined) {
|
|
||||||
this.stationId = data.stationId;
|
|
||||||
}
|
|
||||||
if ("sideId" in data && data.sideId != undefined) {
|
|
||||||
this.sideId = data.sideId;
|
|
||||||
}
|
|
||||||
if ("trackName" in data && data.trackName != undefined) {
|
|
||||||
this.trackName = data.trackName;
|
|
||||||
}
|
|
||||||
if ("recordType" in data && data.recordType != undefined) {
|
|
||||||
this.recordType = data.recordType;
|
|
||||||
}
|
|
||||||
if ("recordTime" in data && data.recordTime != undefined) {
|
|
||||||
this.recordTime = data.recordTime;
|
|
||||||
}
|
|
||||||
if ("driverId" in data && data.driverId != undefined) {
|
|
||||||
this.driverId = data.driverId;
|
|
||||||
}
|
|
||||||
if ("routeId" in data && data.routeId != undefined) {
|
|
||||||
this.routeId = data.routeId;
|
|
||||||
}
|
|
||||||
if ("mode" in data && data.mode != undefined) {
|
|
||||||
this.mode = data.mode;
|
|
||||||
}
|
|
||||||
if ("nccWindow" in data && data.nccWindow != undefined) {
|
|
||||||
this.nccWindow = data.nccWindow;
|
|
||||||
}
|
|
||||||
if ("nccWindowOffset" in data && data.nccWindowOffset != undefined) {
|
|
||||||
this.nccWindowOffset = data.nccWindowOffset;
|
|
||||||
}
|
|
||||||
if ("rate" in data && data.rate != undefined) {
|
|
||||||
this.rate = data.rate;
|
|
||||||
}
|
|
||||||
if ("devType" in data && data.devType != undefined) {
|
|
||||||
this.devType = data.devType;
|
|
||||||
}
|
|
||||||
if ("devName" in data && data.devName != undefined) {
|
|
||||||
this.devName = data.devName;
|
|
||||||
}
|
|
||||||
if ("blockFlag" in data && data.blockFlag != undefined) {
|
|
||||||
this.blockFlag = data.blockFlag;
|
|
||||||
}
|
|
||||||
if ("show" in data && data.show != undefined) {
|
|
||||||
this.show = data.show;
|
|
||||||
}
|
|
||||||
if ("lineId" in data && data.lineId != undefined) {
|
|
||||||
this.lineId = data.lineId;
|
|
||||||
}
|
|
||||||
if ("trainIndex" in data && data.trainIndex != undefined) {
|
|
||||||
this.trainIndex = data.trainIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
get trainId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
|
||||||
}
|
|
||||||
set trainId(value: string) {
|
|
||||||
pb_1.Message.setField(this, 1, value);
|
|
||||||
}
|
|
||||||
get globalId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
|
||||||
}
|
|
||||||
set globalId(value: string) {
|
|
||||||
pb_1.Message.setField(this, 2, value);
|
|
||||||
}
|
|
||||||
get groupId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
|
||||||
}
|
|
||||||
set groupId(value: string) {
|
|
||||||
pb_1.Message.setField(this, 3, value);
|
|
||||||
}
|
|
||||||
get localSubId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
|
|
||||||
}
|
|
||||||
set localSubId(value: number) {
|
|
||||||
pb_1.Message.setField(this, 4, value);
|
|
||||||
}
|
|
||||||
get trainType() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
|
|
||||||
}
|
|
||||||
set trainType(value: number) {
|
|
||||||
pb_1.Message.setField(this, 5, value);
|
|
||||||
}
|
|
||||||
get speed() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
|
|
||||||
}
|
|
||||||
set speed(value: number) {
|
|
||||||
pb_1.Message.setField(this, 6, value);
|
|
||||||
}
|
|
||||||
get direction() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
|
|
||||||
}
|
|
||||||
set direction(value: number) {
|
|
||||||
pb_1.Message.setField(this, 7, value);
|
|
||||||
}
|
|
||||||
get destinationId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 8, 0) as number;
|
|
||||||
}
|
|
||||||
set destinationId(value: number) {
|
|
||||||
pb_1.Message.setField(this, 8, value);
|
|
||||||
}
|
|
||||||
get stationId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 9, 0) as number;
|
|
||||||
}
|
|
||||||
set stationId(value: number) {
|
|
||||||
pb_1.Message.setField(this, 9, value);
|
|
||||||
}
|
|
||||||
get sideId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 10, 0) as number;
|
|
||||||
}
|
|
||||||
set sideId(value: number) {
|
|
||||||
pb_1.Message.setField(this, 10, value);
|
|
||||||
}
|
|
||||||
get trackName() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 11, "") as string;
|
|
||||||
}
|
|
||||||
set trackName(value: string) {
|
|
||||||
pb_1.Message.setField(this, 11, value);
|
|
||||||
}
|
|
||||||
get recordType() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 12, false) as boolean;
|
|
||||||
}
|
|
||||||
set recordType(value: boolean) {
|
|
||||||
pb_1.Message.setField(this, 12, value);
|
|
||||||
}
|
|
||||||
get recordTime() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 13, 0) as number;
|
|
||||||
}
|
|
||||||
set recordTime(value: number) {
|
|
||||||
pb_1.Message.setField(this, 13, value);
|
|
||||||
}
|
|
||||||
get driverId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 14, "") as string;
|
|
||||||
}
|
|
||||||
set driverId(value: string) {
|
|
||||||
pb_1.Message.setField(this, 14, value);
|
|
||||||
}
|
|
||||||
get routeId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 15, 0) as number;
|
|
||||||
}
|
|
||||||
set routeId(value: number) {
|
|
||||||
pb_1.Message.setField(this, 15, value);
|
|
||||||
}
|
|
||||||
get mode() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 16, 0) as number;
|
|
||||||
}
|
|
||||||
set mode(value: number) {
|
|
||||||
pb_1.Message.setField(this, 16, value);
|
|
||||||
}
|
|
||||||
get nccWindow() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 17, 0) as number;
|
|
||||||
}
|
|
||||||
set nccWindow(value: number) {
|
|
||||||
pb_1.Message.setField(this, 17, value);
|
|
||||||
}
|
|
||||||
get nccWindowOffset() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 18, 0) as number;
|
|
||||||
}
|
|
||||||
set nccWindowOffset(value: number) {
|
|
||||||
pb_1.Message.setField(this, 18, value);
|
|
||||||
}
|
|
||||||
get rate() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 19, 0) as number;
|
|
||||||
}
|
|
||||||
set rate(value: number) {
|
|
||||||
pb_1.Message.setField(this, 19, value);
|
|
||||||
}
|
|
||||||
get devType() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 20, 0) as number;
|
|
||||||
}
|
|
||||||
set devType(value: number) {
|
|
||||||
pb_1.Message.setField(this, 20, value);
|
|
||||||
}
|
|
||||||
get devName() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 21, "") as string;
|
|
||||||
}
|
|
||||||
set devName(value: string) {
|
|
||||||
pb_1.Message.setField(this, 21, value);
|
|
||||||
}
|
|
||||||
get blockFlag() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 22, 0) as number;
|
|
||||||
}
|
|
||||||
set blockFlag(value: number) {
|
|
||||||
pb_1.Message.setField(this, 22, value);
|
|
||||||
}
|
|
||||||
get show() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 23, false) as boolean;
|
|
||||||
}
|
|
||||||
set show(value: boolean) {
|
|
||||||
pb_1.Message.setField(this, 23, value);
|
|
||||||
}
|
|
||||||
get lineId() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 24, 0) as number;
|
|
||||||
}
|
|
||||||
set lineId(value: number) {
|
|
||||||
pb_1.Message.setField(this, 24, value);
|
|
||||||
}
|
|
||||||
get trainIndex() {
|
|
||||||
return pb_1.Message.getFieldWithDefault(this, 25, "") as string;
|
|
||||||
}
|
|
||||||
set trainIndex(value: string) {
|
|
||||||
pb_1.Message.setField(this, 25, value);
|
|
||||||
}
|
|
||||||
static fromObject(data: {
|
|
||||||
trainId?: string;
|
|
||||||
globalId?: string;
|
|
||||||
groupId?: string;
|
|
||||||
localSubId?: number;
|
|
||||||
trainType?: number;
|
|
||||||
speed?: number;
|
|
||||||
direction?: number;
|
|
||||||
destinationId?: number;
|
|
||||||
stationId?: number;
|
|
||||||
sideId?: number;
|
|
||||||
trackName?: string;
|
|
||||||
recordType?: boolean;
|
|
||||||
recordTime?: number;
|
|
||||||
driverId?: string;
|
|
||||||
routeId?: number;
|
|
||||||
mode?: number;
|
|
||||||
nccWindow?: number;
|
|
||||||
nccWindowOffset?: number;
|
|
||||||
rate?: number;
|
|
||||||
devType?: number;
|
|
||||||
devName?: string;
|
|
||||||
blockFlag?: number;
|
|
||||||
show?: boolean;
|
|
||||||
lineId?: number;
|
|
||||||
trainIndex?: string;
|
|
||||||
}): Train {
|
|
||||||
const message = new Train({});
|
|
||||||
if (data.trainId != null) {
|
|
||||||
message.trainId = data.trainId;
|
|
||||||
}
|
|
||||||
if (data.globalId != null) {
|
|
||||||
message.globalId = data.globalId;
|
|
||||||
}
|
|
||||||
if (data.groupId != null) {
|
|
||||||
message.groupId = data.groupId;
|
|
||||||
}
|
|
||||||
if (data.localSubId != null) {
|
|
||||||
message.localSubId = data.localSubId;
|
|
||||||
}
|
|
||||||
if (data.trainType != null) {
|
|
||||||
message.trainType = data.trainType;
|
|
||||||
}
|
|
||||||
if (data.speed != null) {
|
|
||||||
message.speed = data.speed;
|
|
||||||
}
|
|
||||||
if (data.direction != null) {
|
|
||||||
message.direction = data.direction;
|
|
||||||
}
|
|
||||||
if (data.destinationId != null) {
|
|
||||||
message.destinationId = data.destinationId;
|
|
||||||
}
|
|
||||||
if (data.stationId != null) {
|
|
||||||
message.stationId = data.stationId;
|
|
||||||
}
|
|
||||||
if (data.sideId != null) {
|
|
||||||
message.sideId = data.sideId;
|
|
||||||
}
|
|
||||||
if (data.trackName != null) {
|
|
||||||
message.trackName = data.trackName;
|
|
||||||
}
|
|
||||||
if (data.recordType != null) {
|
|
||||||
message.recordType = data.recordType;
|
|
||||||
}
|
|
||||||
if (data.recordTime != null) {
|
|
||||||
message.recordTime = data.recordTime;
|
|
||||||
}
|
|
||||||
if (data.driverId != null) {
|
|
||||||
message.driverId = data.driverId;
|
|
||||||
}
|
|
||||||
if (data.routeId != null) {
|
|
||||||
message.routeId = data.routeId;
|
|
||||||
}
|
|
||||||
if (data.mode != null) {
|
|
||||||
message.mode = data.mode;
|
|
||||||
}
|
|
||||||
if (data.nccWindow != null) {
|
|
||||||
message.nccWindow = data.nccWindow;
|
|
||||||
}
|
|
||||||
if (data.nccWindowOffset != null) {
|
|
||||||
message.nccWindowOffset = data.nccWindowOffset;
|
|
||||||
}
|
|
||||||
if (data.rate != null) {
|
|
||||||
message.rate = data.rate;
|
|
||||||
}
|
|
||||||
if (data.devType != null) {
|
|
||||||
message.devType = data.devType;
|
|
||||||
}
|
|
||||||
if (data.devName != null) {
|
|
||||||
message.devName = data.devName;
|
|
||||||
}
|
|
||||||
if (data.blockFlag != null) {
|
|
||||||
message.blockFlag = data.blockFlag;
|
|
||||||
}
|
|
||||||
if (data.show != null) {
|
|
||||||
message.show = data.show;
|
|
||||||
}
|
|
||||||
if (data.lineId != null) {
|
|
||||||
message.lineId = data.lineId;
|
|
||||||
}
|
|
||||||
if (data.trainIndex != null) {
|
|
||||||
message.trainIndex = data.trainIndex;
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
toObject() {
|
|
||||||
const data: {
|
|
||||||
trainId?: string;
|
|
||||||
globalId?: string;
|
|
||||||
groupId?: string;
|
|
||||||
localSubId?: number;
|
|
||||||
trainType?: number;
|
|
||||||
speed?: number;
|
|
||||||
direction?: number;
|
|
||||||
destinationId?: number;
|
|
||||||
stationId?: number;
|
|
||||||
sideId?: number;
|
|
||||||
trackName?: string;
|
|
||||||
recordType?: boolean;
|
|
||||||
recordTime?: number;
|
|
||||||
driverId?: string;
|
|
||||||
routeId?: number;
|
|
||||||
mode?: number;
|
|
||||||
nccWindow?: number;
|
|
||||||
nccWindowOffset?: number;
|
|
||||||
rate?: number;
|
|
||||||
devType?: number;
|
|
||||||
devName?: string;
|
|
||||||
blockFlag?: number;
|
|
||||||
show?: boolean;
|
|
||||||
lineId?: number;
|
|
||||||
trainIndex?: string;
|
|
||||||
} = {};
|
|
||||||
if (this.trainId != null) {
|
|
||||||
data.trainId = this.trainId;
|
|
||||||
}
|
|
||||||
if (this.globalId != null) {
|
|
||||||
data.globalId = this.globalId;
|
|
||||||
}
|
|
||||||
if (this.groupId != null) {
|
|
||||||
data.groupId = this.groupId;
|
|
||||||
}
|
|
||||||
if (this.localSubId != null) {
|
|
||||||
data.localSubId = this.localSubId;
|
|
||||||
}
|
|
||||||
if (this.trainType != null) {
|
|
||||||
data.trainType = this.trainType;
|
|
||||||
}
|
|
||||||
if (this.speed != null) {
|
|
||||||
data.speed = this.speed;
|
|
||||||
}
|
|
||||||
if (this.direction != null) {
|
|
||||||
data.direction = this.direction;
|
|
||||||
}
|
|
||||||
if (this.destinationId != null) {
|
|
||||||
data.destinationId = this.destinationId;
|
|
||||||
}
|
|
||||||
if (this.stationId != null) {
|
|
||||||
data.stationId = this.stationId;
|
|
||||||
}
|
|
||||||
if (this.sideId != null) {
|
|
||||||
data.sideId = this.sideId;
|
|
||||||
}
|
|
||||||
if (this.trackName != null) {
|
|
||||||
data.trackName = this.trackName;
|
|
||||||
}
|
|
||||||
if (this.recordType != null) {
|
|
||||||
data.recordType = this.recordType;
|
|
||||||
}
|
|
||||||
if (this.recordTime != null) {
|
|
||||||
data.recordTime = this.recordTime;
|
|
||||||
}
|
|
||||||
if (this.driverId != null) {
|
|
||||||
data.driverId = this.driverId;
|
|
||||||
}
|
|
||||||
if (this.routeId != null) {
|
|
||||||
data.routeId = this.routeId;
|
|
||||||
}
|
|
||||||
if (this.mode != null) {
|
|
||||||
data.mode = this.mode;
|
|
||||||
}
|
|
||||||
if (this.nccWindow != null) {
|
|
||||||
data.nccWindow = this.nccWindow;
|
|
||||||
}
|
|
||||||
if (this.nccWindowOffset != null) {
|
|
||||||
data.nccWindowOffset = this.nccWindowOffset;
|
|
||||||
}
|
|
||||||
if (this.rate != null) {
|
|
||||||
data.rate = this.rate;
|
|
||||||
}
|
|
||||||
if (this.devType != null) {
|
|
||||||
data.devType = this.devType;
|
|
||||||
}
|
|
||||||
if (this.devName != null) {
|
|
||||||
data.devName = this.devName;
|
|
||||||
}
|
|
||||||
if (this.blockFlag != null) {
|
|
||||||
data.blockFlag = this.blockFlag;
|
|
||||||
}
|
|
||||||
if (this.show != null) {
|
|
||||||
data.show = this.show;
|
|
||||||
}
|
|
||||||
if (this.lineId != null) {
|
|
||||||
data.lineId = this.lineId;
|
|
||||||
}
|
|
||||||
if (this.trainIndex != null) {
|
|
||||||
data.trainIndex = this.trainIndex;
|
|
||||||
}
|
|
||||||
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.trainId.length)
|
|
||||||
writer.writeString(1, this.trainId);
|
|
||||||
if (this.globalId.length)
|
|
||||||
writer.writeString(2, this.globalId);
|
|
||||||
if (this.groupId.length)
|
|
||||||
writer.writeString(3, this.groupId);
|
|
||||||
if (this.localSubId != 0)
|
|
||||||
writer.writeInt32(4, this.localSubId);
|
|
||||||
if (this.trainType != 0)
|
|
||||||
writer.writeInt32(5, this.trainType);
|
|
||||||
if (this.speed != 0)
|
|
||||||
writer.writeFloat(6, this.speed);
|
|
||||||
if (this.direction != 0)
|
|
||||||
writer.writeInt32(7, this.direction);
|
|
||||||
if (this.destinationId != 0)
|
|
||||||
writer.writeInt32(8, this.destinationId);
|
|
||||||
if (this.stationId != 0)
|
|
||||||
writer.writeInt32(9, this.stationId);
|
|
||||||
if (this.sideId != 0)
|
|
||||||
writer.writeInt32(10, this.sideId);
|
|
||||||
if (this.trackName.length)
|
|
||||||
writer.writeString(11, this.trackName);
|
|
||||||
if (this.recordType != false)
|
|
||||||
writer.writeBool(12, this.recordType);
|
|
||||||
if (this.recordTime != 0)
|
|
||||||
writer.writeInt64(13, this.recordTime);
|
|
||||||
if (this.driverId.length)
|
|
||||||
writer.writeString(14, this.driverId);
|
|
||||||
if (this.routeId != 0)
|
|
||||||
writer.writeInt32(15, this.routeId);
|
|
||||||
if (this.mode != 0)
|
|
||||||
writer.writeInt32(16, this.mode);
|
|
||||||
if (this.nccWindow != 0)
|
|
||||||
writer.writeInt32(17, this.nccWindow);
|
|
||||||
if (this.nccWindowOffset != 0)
|
|
||||||
writer.writeInt32(18, this.nccWindowOffset);
|
|
||||||
if (this.rate != 0)
|
|
||||||
writer.writeInt32(19, this.rate);
|
|
||||||
if (this.devType != 0)
|
|
||||||
writer.writeInt32(20, this.devType);
|
|
||||||
if (this.devName.length)
|
|
||||||
writer.writeString(21, this.devName);
|
|
||||||
if (this.blockFlag != 0)
|
|
||||||
writer.writeInt32(22, this.blockFlag);
|
|
||||||
if (this.show != false)
|
|
||||||
writer.writeBool(23, this.show);
|
|
||||||
if (this.lineId != 0)
|
|
||||||
writer.writeInt32(24, this.lineId);
|
|
||||||
if (this.trainIndex.length)
|
|
||||||
writer.writeString(25, this.trainIndex);
|
|
||||||
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.trainId = reader.readString();
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
message.globalId = reader.readString();
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
message.groupId = reader.readString();
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
message.localSubId = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
message.trainType = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
message.speed = reader.readFloat();
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
message.direction = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
message.destinationId = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
message.stationId = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
message.sideId = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
message.trackName = reader.readString();
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
message.recordType = reader.readBool();
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
message.recordTime = reader.readInt64();
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
message.driverId = reader.readString();
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
message.routeId = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 16:
|
|
||||||
message.mode = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 17:
|
|
||||||
message.nccWindow = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 18:
|
|
||||||
message.nccWindowOffset = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 19:
|
|
||||||
message.rate = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
message.devType = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 21:
|
|
||||||
message.devName = reader.readString();
|
|
||||||
break;
|
|
||||||
case 22:
|
|
||||||
message.blockFlag = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 23:
|
|
||||||
message.show = reader.readBool();
|
|
||||||
break;
|
|
||||||
case 24:
|
|
||||||
message.lineId = reader.readInt32();
|
|
||||||
break;
|
|
||||||
case 25:
|
|
||||||
message.trainIndex = reader.readString();
|
|
||||||
break;
|
|
||||||
default: reader.skipField();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
serializeBinary(): Uint8Array {
|
|
||||||
return this.serialize();
|
|
||||||
}
|
|
||||||
static deserializeBinary(bytes: Uint8Array): Train {
|
|
||||||
return Train.deserialize(bytes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
219
src/protos/section_status.ts
Normal file
219
src/protos/section_status.ts
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
/**
|
||||||
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
|
* compiler version: 4.23.1
|
||||||
|
* source: section_status.proto
|
||||||
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
|
import * as pb_1 from "google-protobuf";
|
||||||
|
export namespace state {
|
||||||
|
export class Section extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
code?: string;
|
||||||
|
leftSection?: Section;
|
||||||
|
rightSection?: Section;
|
||||||
|
axleCounter?: boolean;
|
||||||
|
logicList?: Section[];
|
||||||
|
leftKilometerCode?: string;
|
||||||
|
rightKilometerCode?: string;
|
||||||
|
}) {
|
||||||
|
super();
|
||||||
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [5], this.#one_of_decls);
|
||||||
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
|
if ("code" in data && data.code != undefined) {
|
||||||
|
this.code = data.code;
|
||||||
|
}
|
||||||
|
if ("leftSection" in data && data.leftSection != undefined) {
|
||||||
|
this.leftSection = data.leftSection;
|
||||||
|
}
|
||||||
|
if ("rightSection" in data && data.rightSection != undefined) {
|
||||||
|
this.rightSection = data.rightSection;
|
||||||
|
}
|
||||||
|
if ("axleCounter" in data && data.axleCounter != undefined) {
|
||||||
|
this.axleCounter = data.axleCounter;
|
||||||
|
}
|
||||||
|
if ("logicList" in data && data.logicList != undefined) {
|
||||||
|
this.logicList = data.logicList;
|
||||||
|
}
|
||||||
|
if ("leftKilometerCode" in data && data.leftKilometerCode != undefined) {
|
||||||
|
this.leftKilometerCode = data.leftKilometerCode;
|
||||||
|
}
|
||||||
|
if ("rightKilometerCode" in data && data.rightKilometerCode != undefined) {
|
||||||
|
this.rightKilometerCode = data.rightKilometerCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get code() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||||
|
}
|
||||||
|
set code(value: string) {
|
||||||
|
pb_1.Message.setField(this, 1, value);
|
||||||
|
}
|
||||||
|
get leftSection() {
|
||||||
|
return pb_1.Message.getWrapperField(this, Section, 2) as Section;
|
||||||
|
}
|
||||||
|
set leftSection(value: Section) {
|
||||||
|
pb_1.Message.setWrapperField(this, 2, value);
|
||||||
|
}
|
||||||
|
get has_leftSection() {
|
||||||
|
return pb_1.Message.getField(this, 2) != null;
|
||||||
|
}
|
||||||
|
get rightSection() {
|
||||||
|
return pb_1.Message.getWrapperField(this, Section, 3) as Section;
|
||||||
|
}
|
||||||
|
set rightSection(value: Section) {
|
||||||
|
pb_1.Message.setWrapperField(this, 3, value);
|
||||||
|
}
|
||||||
|
get has_rightSection() {
|
||||||
|
return pb_1.Message.getField(this, 3) != null;
|
||||||
|
}
|
||||||
|
get axleCounter() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
|
||||||
|
}
|
||||||
|
set axleCounter(value: boolean) {
|
||||||
|
pb_1.Message.setField(this, 4, value);
|
||||||
|
}
|
||||||
|
get logicList() {
|
||||||
|
return pb_1.Message.getRepeatedWrapperField(this, Section, 5) as Section[];
|
||||||
|
}
|
||||||
|
set logicList(value: Section[]) {
|
||||||
|
pb_1.Message.setRepeatedWrapperField(this, 5, value);
|
||||||
|
}
|
||||||
|
get leftKilometerCode() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
||||||
|
}
|
||||||
|
set leftKilometerCode(value: string) {
|
||||||
|
pb_1.Message.setField(this, 6, value);
|
||||||
|
}
|
||||||
|
get rightKilometerCode() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
|
||||||
|
}
|
||||||
|
set rightKilometerCode(value: string) {
|
||||||
|
pb_1.Message.setField(this, 7, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
code?: string;
|
||||||
|
leftSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
rightSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
axleCounter?: boolean;
|
||||||
|
logicList?: ReturnType<typeof Section.prototype.toObject>[];
|
||||||
|
leftKilometerCode?: string;
|
||||||
|
rightKilometerCode?: string;
|
||||||
|
}): Section {
|
||||||
|
const message = new Section({});
|
||||||
|
if (data.code != null) {
|
||||||
|
message.code = data.code;
|
||||||
|
}
|
||||||
|
if (data.leftSection != null) {
|
||||||
|
message.leftSection = Section.fromObject(data.leftSection);
|
||||||
|
}
|
||||||
|
if (data.rightSection != null) {
|
||||||
|
message.rightSection = Section.fromObject(data.rightSection);
|
||||||
|
}
|
||||||
|
if (data.axleCounter != null) {
|
||||||
|
message.axleCounter = data.axleCounter;
|
||||||
|
}
|
||||||
|
if (data.logicList != null) {
|
||||||
|
message.logicList = data.logicList.map(item => Section.fromObject(item));
|
||||||
|
}
|
||||||
|
if (data.leftKilometerCode != null) {
|
||||||
|
message.leftKilometerCode = data.leftKilometerCode;
|
||||||
|
}
|
||||||
|
if (data.rightKilometerCode != null) {
|
||||||
|
message.rightKilometerCode = data.rightKilometerCode;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
code?: string;
|
||||||
|
leftSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
rightSection?: ReturnType<typeof Section.prototype.toObject>;
|
||||||
|
axleCounter?: boolean;
|
||||||
|
logicList?: ReturnType<typeof Section.prototype.toObject>[];
|
||||||
|
leftKilometerCode?: string;
|
||||||
|
rightKilometerCode?: string;
|
||||||
|
} = {};
|
||||||
|
if (this.code != null) {
|
||||||
|
data.code = this.code;
|
||||||
|
}
|
||||||
|
if (this.leftSection != null) {
|
||||||
|
data.leftSection = this.leftSection.toObject();
|
||||||
|
}
|
||||||
|
if (this.rightSection != null) {
|
||||||
|
data.rightSection = this.rightSection.toObject();
|
||||||
|
}
|
||||||
|
if (this.axleCounter != null) {
|
||||||
|
data.axleCounter = this.axleCounter;
|
||||||
|
}
|
||||||
|
if (this.logicList != null) {
|
||||||
|
data.logicList = this.logicList.map((item: Section) => item.toObject());
|
||||||
|
}
|
||||||
|
if (this.leftKilometerCode != null) {
|
||||||
|
data.leftKilometerCode = this.leftKilometerCode;
|
||||||
|
}
|
||||||
|
if (this.rightKilometerCode != null) {
|
||||||
|
data.rightKilometerCode = this.rightKilometerCode;
|
||||||
|
}
|
||||||
|
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.has_leftSection)
|
||||||
|
writer.writeMessage(2, this.leftSection, () => this.leftSection.serialize(writer));
|
||||||
|
if (this.has_rightSection)
|
||||||
|
writer.writeMessage(3, this.rightSection, () => this.rightSection.serialize(writer));
|
||||||
|
if (this.axleCounter != false)
|
||||||
|
writer.writeBool(4, this.axleCounter);
|
||||||
|
if (this.logicList.length)
|
||||||
|
writer.writeRepeatedMessage(5, this.logicList, (item: Section) => item.serialize(writer));
|
||||||
|
if (this.leftKilometerCode.length)
|
||||||
|
writer.writeString(6, this.leftKilometerCode);
|
||||||
|
if (this.rightKilometerCode.length)
|
||||||
|
writer.writeString(7, this.rightKilometerCode);
|
||||||
|
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:
|
||||||
|
message.code = reader.readString();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
reader.readMessage(message.leftSection, () => message.leftSection = Section.deserialize(reader));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
reader.readMessage(message.rightSection, () => message.rightSection = Section.deserialize(reader));
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
message.axleCounter = reader.readBool();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
reader.readMessage(message.logicList, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Section.deserialize(reader), Section));
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
message.leftKilometerCode = reader.readString();
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
message.rightKilometerCode = reader.readString();
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Section {
|
||||||
|
return Section.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3037,9 +3037,11 @@ export namespace graphicData {
|
|||||||
points?: Point[];
|
points?: Point[];
|
||||||
paRef?: RelatedRef;
|
paRef?: RelatedRef;
|
||||||
pbRef?: RelatedRef;
|
pbRef?: RelatedRef;
|
||||||
|
sectionType?: Section.SectionType;
|
||||||
|
children?: string[];
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 7], this.#one_of_decls);
|
||||||
if (!Array.isArray(data) && typeof data == "object") {
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
if ("common" in data && data.common != undefined) {
|
if ("common" in data && data.common != undefined) {
|
||||||
this.common = data.common;
|
this.common = data.common;
|
||||||
@ -3056,6 +3058,12 @@ export namespace graphicData {
|
|||||||
if ("pbRef" in data && data.pbRef != undefined) {
|
if ("pbRef" in data && data.pbRef != undefined) {
|
||||||
this.pbRef = data.pbRef;
|
this.pbRef = data.pbRef;
|
||||||
}
|
}
|
||||||
|
if ("sectionType" in data && data.sectionType != undefined) {
|
||||||
|
this.sectionType = data.sectionType;
|
||||||
|
}
|
||||||
|
if ("children" in data && data.children != undefined) {
|
||||||
|
this.children = data.children;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get common() {
|
get common() {
|
||||||
@ -3097,12 +3105,26 @@ export namespace graphicData {
|
|||||||
get has_pbRef() {
|
get has_pbRef() {
|
||||||
return pb_1.Message.getField(this, 5) != null;
|
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 children() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 7, []) as string[];
|
||||||
|
}
|
||||||
|
set children(value: string[]) {
|
||||||
|
pb_1.Message.setField(this, 7, value);
|
||||||
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||||
paRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
paRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||||
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||||
|
sectionType?: Section.SectionType;
|
||||||
|
children?: string[];
|
||||||
}): Section {
|
}): Section {
|
||||||
const message = new Section({});
|
const message = new Section({});
|
||||||
if (data.common != null) {
|
if (data.common != null) {
|
||||||
@ -3120,6 +3142,12 @@ export namespace graphicData {
|
|||||||
if (data.pbRef != null) {
|
if (data.pbRef != null) {
|
||||||
message.pbRef = RelatedRef.fromObject(data.pbRef);
|
message.pbRef = RelatedRef.fromObject(data.pbRef);
|
||||||
}
|
}
|
||||||
|
if (data.sectionType != null) {
|
||||||
|
message.sectionType = data.sectionType;
|
||||||
|
}
|
||||||
|
if (data.children != null) {
|
||||||
|
message.children = data.children;
|
||||||
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
@ -3129,6 +3157,8 @@ export namespace graphicData {
|
|||||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||||
paRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
paRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||||
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||||
|
sectionType?: Section.SectionType;
|
||||||
|
children?: string[];
|
||||||
} = {};
|
} = {};
|
||||||
if (this.common != null) {
|
if (this.common != null) {
|
||||||
data.common = this.common.toObject();
|
data.common = this.common.toObject();
|
||||||
@ -3145,6 +3175,12 @@ export namespace graphicData {
|
|||||||
if (this.pbRef != null) {
|
if (this.pbRef != null) {
|
||||||
data.pbRef = this.pbRef.toObject();
|
data.pbRef = this.pbRef.toObject();
|
||||||
}
|
}
|
||||||
|
if (this.sectionType != null) {
|
||||||
|
data.sectionType = this.sectionType;
|
||||||
|
}
|
||||||
|
if (this.children != null) {
|
||||||
|
data.children = this.children;
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
serialize(): Uint8Array;
|
serialize(): Uint8Array;
|
||||||
@ -3161,6 +3197,10 @@ export namespace graphicData {
|
|||||||
writer.writeMessage(4, this.paRef, () => this.paRef.serialize(writer));
|
writer.writeMessage(4, this.paRef, () => this.paRef.serialize(writer));
|
||||||
if (this.has_pbRef)
|
if (this.has_pbRef)
|
||||||
writer.writeMessage(5, this.pbRef, () => this.pbRef.serialize(writer));
|
writer.writeMessage(5, this.pbRef, () => this.pbRef.serialize(writer));
|
||||||
|
if (this.sectionType != Section.SectionType.Physical)
|
||||||
|
writer.writeEnum(6, this.sectionType);
|
||||||
|
if (this.children.length)
|
||||||
|
writer.writeRepeatedString(7, this.children);
|
||||||
if (!w)
|
if (!w)
|
||||||
return writer.getResultBuffer();
|
return writer.getResultBuffer();
|
||||||
}
|
}
|
||||||
@ -3185,6 +3225,12 @@ export namespace graphicData {
|
|||||||
case 5:
|
case 5:
|
||||||
reader.readMessage(message.pbRef, () => message.pbRef = RelatedRef.deserialize(reader));
|
reader.readMessage(message.pbRef, () => message.pbRef = RelatedRef.deserialize(reader));
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
message.sectionType = reader.readEnum();
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
pb_1.Message.addToRepeatedField(message, 7, reader.readString());
|
||||||
|
break;
|
||||||
default: reader.skipField();
|
default: reader.skipField();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3197,15 +3243,117 @@ export namespace graphicData {
|
|||||||
return Section.deserialize(bytes);
|
return Section.deserialize(bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export namespace Section {
|
||||||
|
export enum SectionType {
|
||||||
|
Physical = 0,
|
||||||
|
Logic = 1,
|
||||||
|
TurnoutPhysical = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class KilometerPoint extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
point?: Point;
|
||||||
|
kilometer?: 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 ("point" in data && data.point != undefined) {
|
||||||
|
this.point = data.point;
|
||||||
|
}
|
||||||
|
if ("kilometer" in data && data.kilometer != undefined) {
|
||||||
|
this.kilometer = data.kilometer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get point() {
|
||||||
|
return pb_1.Message.getWrapperField(this, Point, 1) as Point;
|
||||||
|
}
|
||||||
|
set point(value: Point) {
|
||||||
|
pb_1.Message.setWrapperField(this, 1, value);
|
||||||
|
}
|
||||||
|
get has_point() {
|
||||||
|
return pb_1.Message.getField(this, 1) != null;
|
||||||
|
}
|
||||||
|
get kilometer() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||||
|
}
|
||||||
|
set kilometer(value: number) {
|
||||||
|
pb_1.Message.setField(this, 2, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
point?: ReturnType<typeof Point.prototype.toObject>;
|
||||||
|
kilometer?: number;
|
||||||
|
}): KilometerPoint {
|
||||||
|
const message = new KilometerPoint({});
|
||||||
|
if (data.point != null) {
|
||||||
|
message.point = Point.fromObject(data.point);
|
||||||
|
}
|
||||||
|
if (data.kilometer != null) {
|
||||||
|
message.kilometer = data.kilometer;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
point?: ReturnType<typeof Point.prototype.toObject>;
|
||||||
|
kilometer?: number;
|
||||||
|
} = {};
|
||||||
|
if (this.point != null) {
|
||||||
|
data.point = this.point.toObject();
|
||||||
|
}
|
||||||
|
if (this.kilometer != null) {
|
||||||
|
data.kilometer = this.kilometer;
|
||||||
|
}
|
||||||
|
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_point)
|
||||||
|
writer.writeMessage(1, this.point, () => this.point.serialize(writer));
|
||||||
|
if (this.kilometer != 0)
|
||||||
|
writer.writeFloat(2, this.kilometer);
|
||||||
|
if (!w)
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
}
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): KilometerPoint {
|
||||||
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new KilometerPoint();
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup())
|
||||||
|
break;
|
||||||
|
switch (reader.getFieldNumber()) {
|
||||||
|
case 1:
|
||||||
|
reader.readMessage(message.point, () => message.point = Point.deserialize(reader));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
message.kilometer = reader.readFloat();
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): KilometerPoint {
|
||||||
|
return KilometerPoint.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
export class PathLine extends pb_1.Message {
|
export class PathLine extends pb_1.Message {
|
||||||
#one_of_decls: number[][] = [];
|
#one_of_decls: number[][] = [];
|
||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
common?: CommonInfo;
|
common?: CommonInfo;
|
||||||
code?: string;
|
code?: string;
|
||||||
points?: Point[];
|
points?: Point[];
|
||||||
|
isUp?: boolean;
|
||||||
|
kilometerPoints?: KilometerPoint[];
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 5], this.#one_of_decls);
|
||||||
if (!Array.isArray(data) && typeof data == "object") {
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
if ("common" in data && data.common != undefined) {
|
if ("common" in data && data.common != undefined) {
|
||||||
this.common = data.common;
|
this.common = data.common;
|
||||||
@ -3216,6 +3364,12 @@ export namespace graphicData {
|
|||||||
if ("points" in data && data.points != undefined) {
|
if ("points" in data && data.points != undefined) {
|
||||||
this.points = data.points;
|
this.points = data.points;
|
||||||
}
|
}
|
||||||
|
if ("isUp" in data && data.isUp != undefined) {
|
||||||
|
this.isUp = data.isUp;
|
||||||
|
}
|
||||||
|
if ("kilometerPoints" in data && data.kilometerPoints != undefined) {
|
||||||
|
this.kilometerPoints = data.kilometerPoints;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get common() {
|
get common() {
|
||||||
@ -3239,10 +3393,24 @@ export namespace graphicData {
|
|||||||
set points(value: Point[]) {
|
set points(value: Point[]) {
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||||
}
|
}
|
||||||
|
get isUp() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
|
||||||
|
}
|
||||||
|
set isUp(value: boolean) {
|
||||||
|
pb_1.Message.setField(this, 4, value);
|
||||||
|
}
|
||||||
|
get kilometerPoints() {
|
||||||
|
return pb_1.Message.getRepeatedWrapperField(this, KilometerPoint, 5) as KilometerPoint[];
|
||||||
|
}
|
||||||
|
set kilometerPoints(value: KilometerPoint[]) {
|
||||||
|
pb_1.Message.setRepeatedWrapperField(this, 5, value);
|
||||||
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||||
|
isUp?: boolean;
|
||||||
|
kilometerPoints?: ReturnType<typeof KilometerPoint.prototype.toObject>[];
|
||||||
}): PathLine {
|
}): PathLine {
|
||||||
const message = new PathLine({});
|
const message = new PathLine({});
|
||||||
if (data.common != null) {
|
if (data.common != null) {
|
||||||
@ -3254,6 +3422,12 @@ export namespace graphicData {
|
|||||||
if (data.points != null) {
|
if (data.points != null) {
|
||||||
message.points = data.points.map(item => Point.fromObject(item));
|
message.points = data.points.map(item => Point.fromObject(item));
|
||||||
}
|
}
|
||||||
|
if (data.isUp != null) {
|
||||||
|
message.isUp = data.isUp;
|
||||||
|
}
|
||||||
|
if (data.kilometerPoints != null) {
|
||||||
|
message.kilometerPoints = data.kilometerPoints.map(item => KilometerPoint.fromObject(item));
|
||||||
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
@ -3261,6 +3435,8 @@ export namespace graphicData {
|
|||||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||||
|
isUp?: boolean;
|
||||||
|
kilometerPoints?: ReturnType<typeof KilometerPoint.prototype.toObject>[];
|
||||||
} = {};
|
} = {};
|
||||||
if (this.common != null) {
|
if (this.common != null) {
|
||||||
data.common = this.common.toObject();
|
data.common = this.common.toObject();
|
||||||
@ -3271,6 +3447,12 @@ export namespace graphicData {
|
|||||||
if (this.points != null) {
|
if (this.points != null) {
|
||||||
data.points = this.points.map((item: Point) => item.toObject());
|
data.points = this.points.map((item: Point) => item.toObject());
|
||||||
}
|
}
|
||||||
|
if (this.isUp != null) {
|
||||||
|
data.isUp = this.isUp;
|
||||||
|
}
|
||||||
|
if (this.kilometerPoints != null) {
|
||||||
|
data.kilometerPoints = this.kilometerPoints.map((item: KilometerPoint) => item.toObject());
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
serialize(): Uint8Array;
|
serialize(): Uint8Array;
|
||||||
@ -3283,6 +3465,10 @@ export namespace graphicData {
|
|||||||
writer.writeString(2, this.code);
|
writer.writeString(2, this.code);
|
||||||
if (this.points.length)
|
if (this.points.length)
|
||||||
writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer));
|
writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer));
|
||||||
|
if (this.isUp != false)
|
||||||
|
writer.writeBool(4, this.isUp);
|
||||||
|
if (this.kilometerPoints.length)
|
||||||
|
writer.writeRepeatedMessage(5, this.kilometerPoints, (item: KilometerPoint) => item.serialize(writer));
|
||||||
if (!w)
|
if (!w)
|
||||||
return writer.getResultBuffer();
|
return writer.getResultBuffer();
|
||||||
}
|
}
|
||||||
@ -3301,6 +3487,12 @@ export namespace graphicData {
|
|||||||
case 3:
|
case 3:
|
||||||
reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point));
|
reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point));
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
message.isUp = reader.readBool();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
reader.readMessage(message.kilometerPoints, () => pb_1.Message.addToRepeatedWrapperField(message, 5, KilometerPoint.deserialize(reader), KilometerPoint));
|
||||||
|
break;
|
||||||
default: reader.skipField();
|
default: reader.skipField();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1457
src/protos/train.ts
Normal file
1457
src/protos/train.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,8 @@
|
|||||||
* source: ws_message.proto
|
* source: ws_message.proto
|
||||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
import * as dependency_1 from "./device_status";
|
import * as dependency_1 from "./device_status";
|
||||||
import * as dependency_2 from "./LineNetTrainOffsetDiagram";
|
import * as dependency_2 from "./train";
|
||||||
|
import * as dependency_3 from "./LineNetTrainOffsetDiagram";
|
||||||
import * as pb_1 from "google-protobuf";
|
import * as pb_1 from "google-protobuf";
|
||||||
export namespace state {
|
export namespace state {
|
||||||
export class WsLineMessage extends pb_1.Message {
|
export class WsLineMessage extends pb_1.Message {
|
||||||
@ -21,12 +22,11 @@ export namespace state {
|
|||||||
waterProofDoor?: dependency_1.state.WaterProofDoor[];
|
waterProofDoor?: dependency_1.state.WaterProofDoor[];
|
||||||
workArea?: dependency_1.state.WorkArea[];
|
workArea?: dependency_1.state.WorkArea[];
|
||||||
gama?: dependency_1.state.Gama[];
|
gama?: dependency_1.state.Gama[];
|
||||||
trainMode?: dependency_1.state.TrainMode[];
|
|
||||||
netWork?: dependency_1.state.OccNccFepNetwork[];
|
netWork?: dependency_1.state.OccNccFepNetwork[];
|
||||||
train?: dependency_1.state.Train[];
|
train?: dependency_2.train.TrainInfo[];
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], this.#one_of_decls);
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], this.#one_of_decls);
|
||||||
if (!Array.isArray(data) && typeof data == "object") {
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
if ("rtu" in data && data.rtu != undefined) {
|
if ("rtu" in data && data.rtu != undefined) {
|
||||||
this.rtu = data.rtu;
|
this.rtu = data.rtu;
|
||||||
@ -61,9 +61,6 @@ export namespace state {
|
|||||||
if ("gama" in data && data.gama != undefined) {
|
if ("gama" in data && data.gama != undefined) {
|
||||||
this.gama = data.gama;
|
this.gama = data.gama;
|
||||||
}
|
}
|
||||||
if ("trainMode" in data && data.trainMode != undefined) {
|
|
||||||
this.trainMode = data.trainMode;
|
|
||||||
}
|
|
||||||
if ("netWork" in data && data.netWork != undefined) {
|
if ("netWork" in data && data.netWork != undefined) {
|
||||||
this.netWork = data.netWork;
|
this.netWork = data.netWork;
|
||||||
}
|
}
|
||||||
@ -138,23 +135,17 @@ export namespace state {
|
|||||||
set gama(value: dependency_1.state.Gama[]) {
|
set gama(value: dependency_1.state.Gama[]) {
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 11, value);
|
pb_1.Message.setRepeatedWrapperField(this, 11, value);
|
||||||
}
|
}
|
||||||
get trainMode() {
|
|
||||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.TrainMode, 12) as dependency_1.state.TrainMode[];
|
|
||||||
}
|
|
||||||
set trainMode(value: dependency_1.state.TrainMode[]) {
|
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 12, value);
|
|
||||||
}
|
|
||||||
get netWork() {
|
get netWork() {
|
||||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.OccNccFepNetwork, 13) as dependency_1.state.OccNccFepNetwork[];
|
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.OccNccFepNetwork, 12) as dependency_1.state.OccNccFepNetwork[];
|
||||||
}
|
}
|
||||||
set netWork(value: dependency_1.state.OccNccFepNetwork[]) {
|
set netWork(value: dependency_1.state.OccNccFepNetwork[]) {
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 13, value);
|
pb_1.Message.setRepeatedWrapperField(this, 12, value);
|
||||||
}
|
}
|
||||||
get train() {
|
get train() {
|
||||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Train, 14) as dependency_1.state.Train[];
|
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.train.TrainInfo, 13) as dependency_2.train.TrainInfo[];
|
||||||
}
|
}
|
||||||
set train(value: dependency_1.state.Train[]) {
|
set train(value: dependency_2.train.TrainInfo[]) {
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 14, value);
|
pb_1.Message.setRepeatedWrapperField(this, 13, value);
|
||||||
}
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
rtu?: ReturnType<typeof dependency_1.state.Rtu.prototype.toObject>[];
|
rtu?: ReturnType<typeof dependency_1.state.Rtu.prototype.toObject>[];
|
||||||
@ -168,9 +159,8 @@ export namespace state {
|
|||||||
waterProofDoor?: ReturnType<typeof dependency_1.state.WaterProofDoor.prototype.toObject>[];
|
waterProofDoor?: ReturnType<typeof dependency_1.state.WaterProofDoor.prototype.toObject>[];
|
||||||
workArea?: ReturnType<typeof dependency_1.state.WorkArea.prototype.toObject>[];
|
workArea?: ReturnType<typeof dependency_1.state.WorkArea.prototype.toObject>[];
|
||||||
gama?: ReturnType<typeof dependency_1.state.Gama.prototype.toObject>[];
|
gama?: ReturnType<typeof dependency_1.state.Gama.prototype.toObject>[];
|
||||||
trainMode?: ReturnType<typeof dependency_1.state.TrainMode.prototype.toObject>[];
|
|
||||||
netWork?: ReturnType<typeof dependency_1.state.OccNccFepNetwork.prototype.toObject>[];
|
netWork?: ReturnType<typeof dependency_1.state.OccNccFepNetwork.prototype.toObject>[];
|
||||||
train?: ReturnType<typeof dependency_1.state.Train.prototype.toObject>[];
|
train?: ReturnType<typeof dependency_2.train.TrainInfo.prototype.toObject>[];
|
||||||
}): WsLineMessage {
|
}): WsLineMessage {
|
||||||
const message = new WsLineMessage({});
|
const message = new WsLineMessage({});
|
||||||
if (data.rtu != null) {
|
if (data.rtu != null) {
|
||||||
@ -206,14 +196,11 @@ export namespace state {
|
|||||||
if (data.gama != null) {
|
if (data.gama != null) {
|
||||||
message.gama = data.gama.map(item => dependency_1.state.Gama.fromObject(item));
|
message.gama = data.gama.map(item => dependency_1.state.Gama.fromObject(item));
|
||||||
}
|
}
|
||||||
if (data.trainMode != null) {
|
|
||||||
message.trainMode = data.trainMode.map(item => dependency_1.state.TrainMode.fromObject(item));
|
|
||||||
}
|
|
||||||
if (data.netWork != null) {
|
if (data.netWork != null) {
|
||||||
message.netWork = data.netWork.map(item => dependency_1.state.OccNccFepNetwork.fromObject(item));
|
message.netWork = data.netWork.map(item => dependency_1.state.OccNccFepNetwork.fromObject(item));
|
||||||
}
|
}
|
||||||
if (data.train != null) {
|
if (data.train != null) {
|
||||||
message.train = data.train.map(item => dependency_1.state.Train.fromObject(item));
|
message.train = data.train.map(item => dependency_2.train.TrainInfo.fromObject(item));
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
@ -230,9 +217,8 @@ export namespace state {
|
|||||||
waterProofDoor?: ReturnType<typeof dependency_1.state.WaterProofDoor.prototype.toObject>[];
|
waterProofDoor?: ReturnType<typeof dependency_1.state.WaterProofDoor.prototype.toObject>[];
|
||||||
workArea?: ReturnType<typeof dependency_1.state.WorkArea.prototype.toObject>[];
|
workArea?: ReturnType<typeof dependency_1.state.WorkArea.prototype.toObject>[];
|
||||||
gama?: ReturnType<typeof dependency_1.state.Gama.prototype.toObject>[];
|
gama?: ReturnType<typeof dependency_1.state.Gama.prototype.toObject>[];
|
||||||
trainMode?: ReturnType<typeof dependency_1.state.TrainMode.prototype.toObject>[];
|
|
||||||
netWork?: ReturnType<typeof dependency_1.state.OccNccFepNetwork.prototype.toObject>[];
|
netWork?: ReturnType<typeof dependency_1.state.OccNccFepNetwork.prototype.toObject>[];
|
||||||
train?: ReturnType<typeof dependency_1.state.Train.prototype.toObject>[];
|
train?: ReturnType<typeof dependency_2.train.TrainInfo.prototype.toObject>[];
|
||||||
} = {};
|
} = {};
|
||||||
if (this.rtu != null) {
|
if (this.rtu != null) {
|
||||||
data.rtu = this.rtu.map((item: dependency_1.state.Rtu) => item.toObject());
|
data.rtu = this.rtu.map((item: dependency_1.state.Rtu) => item.toObject());
|
||||||
@ -267,14 +253,11 @@ export namespace state {
|
|||||||
if (this.gama != null) {
|
if (this.gama != null) {
|
||||||
data.gama = this.gama.map((item: dependency_1.state.Gama) => item.toObject());
|
data.gama = this.gama.map((item: dependency_1.state.Gama) => item.toObject());
|
||||||
}
|
}
|
||||||
if (this.trainMode != null) {
|
|
||||||
data.trainMode = this.trainMode.map((item: dependency_1.state.TrainMode) => item.toObject());
|
|
||||||
}
|
|
||||||
if (this.netWork != null) {
|
if (this.netWork != null) {
|
||||||
data.netWork = this.netWork.map((item: dependency_1.state.OccNccFepNetwork) => item.toObject());
|
data.netWork = this.netWork.map((item: dependency_1.state.OccNccFepNetwork) => item.toObject());
|
||||||
}
|
}
|
||||||
if (this.train != null) {
|
if (this.train != null) {
|
||||||
data.train = this.train.map((item: dependency_1.state.Train) => item.toObject());
|
data.train = this.train.map((item: dependency_2.train.TrainInfo) => item.toObject());
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -304,12 +287,10 @@ export namespace state {
|
|||||||
writer.writeRepeatedMessage(10, this.workArea, (item: dependency_1.state.WorkArea) => item.serialize(writer));
|
writer.writeRepeatedMessage(10, this.workArea, (item: dependency_1.state.WorkArea) => item.serialize(writer));
|
||||||
if (this.gama.length)
|
if (this.gama.length)
|
||||||
writer.writeRepeatedMessage(11, this.gama, (item: dependency_1.state.Gama) => item.serialize(writer));
|
writer.writeRepeatedMessage(11, this.gama, (item: dependency_1.state.Gama) => item.serialize(writer));
|
||||||
if (this.trainMode.length)
|
|
||||||
writer.writeRepeatedMessage(12, this.trainMode, (item: dependency_1.state.TrainMode) => item.serialize(writer));
|
|
||||||
if (this.netWork.length)
|
if (this.netWork.length)
|
||||||
writer.writeRepeatedMessage(13, this.netWork, (item: dependency_1.state.OccNccFepNetwork) => item.serialize(writer));
|
writer.writeRepeatedMessage(12, this.netWork, (item: dependency_1.state.OccNccFepNetwork) => item.serialize(writer));
|
||||||
if (this.train.length)
|
if (this.train.length)
|
||||||
writer.writeRepeatedMessage(14, this.train, (item: dependency_1.state.Train) => item.serialize(writer));
|
writer.writeRepeatedMessage(13, this.train, (item: dependency_2.train.TrainInfo) => item.serialize(writer));
|
||||||
if (!w)
|
if (!w)
|
||||||
return writer.getResultBuffer();
|
return writer.getResultBuffer();
|
||||||
}
|
}
|
||||||
@ -353,13 +334,10 @@ export namespace state {
|
|||||||
reader.readMessage(message.gama, () => pb_1.Message.addToRepeatedWrapperField(message, 11, dependency_1.state.Gama.deserialize(reader), dependency_1.state.Gama));
|
reader.readMessage(message.gama, () => pb_1.Message.addToRepeatedWrapperField(message, 11, dependency_1.state.Gama.deserialize(reader), dependency_1.state.Gama));
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
reader.readMessage(message.trainMode, () => pb_1.Message.addToRepeatedWrapperField(message, 12, dependency_1.state.TrainMode.deserialize(reader), dependency_1.state.TrainMode));
|
reader.readMessage(message.netWork, () => pb_1.Message.addToRepeatedWrapperField(message, 12, dependency_1.state.OccNccFepNetwork.deserialize(reader), dependency_1.state.OccNccFepNetwork));
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
reader.readMessage(message.netWork, () => pb_1.Message.addToRepeatedWrapperField(message, 13, dependency_1.state.OccNccFepNetwork.deserialize(reader), dependency_1.state.OccNccFepNetwork));
|
reader.readMessage(message.train, () => pb_1.Message.addToRepeatedWrapperField(message, 13, dependency_2.train.TrainInfo.deserialize(reader), dependency_2.train.TrainInfo));
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
reader.readMessage(message.train, () => pb_1.Message.addToRepeatedWrapperField(message, 14, dependency_1.state.Train.deserialize(reader), dependency_1.state.Train));
|
|
||||||
break;
|
break;
|
||||||
default: reader.skipField();
|
default: reader.skipField();
|
||||||
}
|
}
|
||||||
@ -376,55 +354,37 @@ export namespace state {
|
|||||||
export class WsLineNetMessage extends pb_1.Message {
|
export class WsLineNetMessage extends pb_1.Message {
|
||||||
#one_of_decls: number[][] = [];
|
#one_of_decls: number[][] = [];
|
||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
diagram?: dependency_2.diagram.LineNetTrainOffsetDiagram[];
|
offset?: WsLineNetTrainOffsetMessage[];
|
||||||
train?: dependency_1.state.Train[];
|
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2], this.#one_of_decls);
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
||||||
if (!Array.isArray(data) && typeof data == "object") {
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
if ("diagram" in data && data.diagram != undefined) {
|
if ("offset" in data && data.offset != undefined) {
|
||||||
this.diagram = data.diagram;
|
this.offset = data.offset;
|
||||||
}
|
|
||||||
if ("train" in data && data.train != undefined) {
|
|
||||||
this.train = data.train;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get diagram() {
|
get offset() {
|
||||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.diagram.LineNetTrainOffsetDiagram, 1) as dependency_2.diagram.LineNetTrainOffsetDiagram[];
|
return pb_1.Message.getRepeatedWrapperField(this, WsLineNetTrainOffsetMessage, 1) as WsLineNetTrainOffsetMessage[];
|
||||||
}
|
}
|
||||||
set diagram(value: dependency_2.diagram.LineNetTrainOffsetDiagram[]) {
|
set offset(value: WsLineNetTrainOffsetMessage[]) {
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||||
}
|
}
|
||||||
get train() {
|
|
||||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Train, 2) as dependency_1.state.Train[];
|
|
||||||
}
|
|
||||||
set train(value: dependency_1.state.Train[]) {
|
|
||||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
|
||||||
}
|
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
diagram?: ReturnType<typeof dependency_2.diagram.LineNetTrainOffsetDiagram.prototype.toObject>[];
|
offset?: ReturnType<typeof WsLineNetTrainOffsetMessage.prototype.toObject>[];
|
||||||
train?: ReturnType<typeof dependency_1.state.Train.prototype.toObject>[];
|
|
||||||
}): WsLineNetMessage {
|
}): WsLineNetMessage {
|
||||||
const message = new WsLineNetMessage({});
|
const message = new WsLineNetMessage({});
|
||||||
if (data.diagram != null) {
|
if (data.offset != null) {
|
||||||
message.diagram = data.diagram.map(item => dependency_2.diagram.LineNetTrainOffsetDiagram.fromObject(item));
|
message.offset = data.offset.map(item => WsLineNetTrainOffsetMessage.fromObject(item));
|
||||||
}
|
|
||||||
if (data.train != null) {
|
|
||||||
message.train = data.train.map(item => dependency_1.state.Train.fromObject(item));
|
|
||||||
}
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
const data: {
|
const data: {
|
||||||
diagram?: ReturnType<typeof dependency_2.diagram.LineNetTrainOffsetDiagram.prototype.toObject>[];
|
offset?: ReturnType<typeof WsLineNetTrainOffsetMessage.prototype.toObject>[];
|
||||||
train?: ReturnType<typeof dependency_1.state.Train.prototype.toObject>[];
|
|
||||||
} = {};
|
} = {};
|
||||||
if (this.diagram != null) {
|
if (this.offset != null) {
|
||||||
data.diagram = this.diagram.map((item: dependency_2.diagram.LineNetTrainOffsetDiagram) => item.toObject());
|
data.offset = this.offset.map((item: WsLineNetTrainOffsetMessage) => item.toObject());
|
||||||
}
|
|
||||||
if (this.train != null) {
|
|
||||||
data.train = this.train.map((item: dependency_1.state.Train) => item.toObject());
|
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -432,10 +392,8 @@ export namespace state {
|
|||||||
serialize(w: pb_1.BinaryWriter): void;
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||||
const writer = w || new pb_1.BinaryWriter();
|
const writer = w || new pb_1.BinaryWriter();
|
||||||
if (this.diagram.length)
|
if (this.offset.length)
|
||||||
writer.writeRepeatedMessage(1, this.diagram, (item: dependency_2.diagram.LineNetTrainOffsetDiagram) => item.serialize(writer));
|
writer.writeRepeatedMessage(1, this.offset, (item: WsLineNetTrainOffsetMessage) => item.serialize(writer));
|
||||||
if (this.train.length)
|
|
||||||
writer.writeRepeatedMessage(2, this.train, (item: dependency_1.state.Train) => item.serialize(writer));
|
|
||||||
if (!w)
|
if (!w)
|
||||||
return writer.getResultBuffer();
|
return writer.getResultBuffer();
|
||||||
}
|
}
|
||||||
@ -446,10 +404,7 @@ export namespace state {
|
|||||||
break;
|
break;
|
||||||
switch (reader.getFieldNumber()) {
|
switch (reader.getFieldNumber()) {
|
||||||
case 1:
|
case 1:
|
||||||
reader.readMessage(message.diagram, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.diagram.LineNetTrainOffsetDiagram.deserialize(reader), dependency_2.diagram.LineNetTrainOffsetDiagram));
|
reader.readMessage(message.offset, () => pb_1.Message.addToRepeatedWrapperField(message, 1, WsLineNetTrainOffsetMessage.deserialize(reader), WsLineNetTrainOffsetMessage));
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
reader.readMessage(message.train, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_1.state.Train.deserialize(reader), dependency_1.state.Train));
|
|
||||||
break;
|
break;
|
||||||
default: reader.skipField();
|
default: reader.skipField();
|
||||||
}
|
}
|
||||||
@ -463,4 +418,209 @@ export namespace state {
|
|||||||
return WsLineNetMessage.deserialize(bytes);
|
return WsLineNetMessage.deserialize(bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export class WsLineNetTrainOffsetMessage extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
lineId?: number;
|
||||||
|
trainIndex?: string;
|
||||||
|
groupId?: string;
|
||||||
|
destinationId?: number;
|
||||||
|
show?: boolean;
|
||||||
|
kilometerCode?: string;
|
||||||
|
dir?: 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 ("lineId" in data && data.lineId != undefined) {
|
||||||
|
this.lineId = data.lineId;
|
||||||
|
}
|
||||||
|
if ("trainIndex" in data && data.trainIndex != undefined) {
|
||||||
|
this.trainIndex = data.trainIndex;
|
||||||
|
}
|
||||||
|
if ("groupId" in data && data.groupId != undefined) {
|
||||||
|
this.groupId = data.groupId;
|
||||||
|
}
|
||||||
|
if ("destinationId" in data && data.destinationId != undefined) {
|
||||||
|
this.destinationId = data.destinationId;
|
||||||
|
}
|
||||||
|
if ("show" in data && data.show != undefined) {
|
||||||
|
this.show = data.show;
|
||||||
|
}
|
||||||
|
if ("kilometerCode" in data && data.kilometerCode != undefined) {
|
||||||
|
this.kilometerCode = data.kilometerCode;
|
||||||
|
}
|
||||||
|
if ("dir" in data && data.dir != undefined) {
|
||||||
|
this.dir = data.dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get lineId() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||||
|
}
|
||||||
|
set lineId(value: number) {
|
||||||
|
pb_1.Message.setField(this, 1, value);
|
||||||
|
}
|
||||||
|
get trainIndex() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||||
|
}
|
||||||
|
set trainIndex(value: string) {
|
||||||
|
pb_1.Message.setField(this, 2, value);
|
||||||
|
}
|
||||||
|
get groupId() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||||
|
}
|
||||||
|
set groupId(value: string) {
|
||||||
|
pb_1.Message.setField(this, 3, value);
|
||||||
|
}
|
||||||
|
get destinationId() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
|
||||||
|
}
|
||||||
|
set destinationId(value: number) {
|
||||||
|
pb_1.Message.setField(this, 4, value);
|
||||||
|
}
|
||||||
|
get show() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
|
||||||
|
}
|
||||||
|
set show(value: boolean) {
|
||||||
|
pb_1.Message.setField(this, 5, value);
|
||||||
|
}
|
||||||
|
get kilometerCode() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
||||||
|
}
|
||||||
|
set kilometerCode(value: string) {
|
||||||
|
pb_1.Message.setField(this, 6, value);
|
||||||
|
}
|
||||||
|
get dir() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
|
||||||
|
}
|
||||||
|
set dir(value: number) {
|
||||||
|
pb_1.Message.setField(this, 7, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
lineId?: number;
|
||||||
|
trainIndex?: string;
|
||||||
|
groupId?: string;
|
||||||
|
destinationId?: number;
|
||||||
|
show?: boolean;
|
||||||
|
kilometerCode?: string;
|
||||||
|
dir?: number;
|
||||||
|
}): WsLineNetTrainOffsetMessage {
|
||||||
|
const message = new WsLineNetTrainOffsetMessage({});
|
||||||
|
if (data.lineId != null) {
|
||||||
|
message.lineId = data.lineId;
|
||||||
|
}
|
||||||
|
if (data.trainIndex != null) {
|
||||||
|
message.trainIndex = data.trainIndex;
|
||||||
|
}
|
||||||
|
if (data.groupId != null) {
|
||||||
|
message.groupId = data.groupId;
|
||||||
|
}
|
||||||
|
if (data.destinationId != null) {
|
||||||
|
message.destinationId = data.destinationId;
|
||||||
|
}
|
||||||
|
if (data.show != null) {
|
||||||
|
message.show = data.show;
|
||||||
|
}
|
||||||
|
if (data.kilometerCode != null) {
|
||||||
|
message.kilometerCode = data.kilometerCode;
|
||||||
|
}
|
||||||
|
if (data.dir != null) {
|
||||||
|
message.dir = data.dir;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
lineId?: number;
|
||||||
|
trainIndex?: string;
|
||||||
|
groupId?: string;
|
||||||
|
destinationId?: number;
|
||||||
|
show?: boolean;
|
||||||
|
kilometerCode?: string;
|
||||||
|
dir?: number;
|
||||||
|
} = {};
|
||||||
|
if (this.lineId != null) {
|
||||||
|
data.lineId = this.lineId;
|
||||||
|
}
|
||||||
|
if (this.trainIndex != null) {
|
||||||
|
data.trainIndex = this.trainIndex;
|
||||||
|
}
|
||||||
|
if (this.groupId != null) {
|
||||||
|
data.groupId = this.groupId;
|
||||||
|
}
|
||||||
|
if (this.destinationId != null) {
|
||||||
|
data.destinationId = this.destinationId;
|
||||||
|
}
|
||||||
|
if (this.show != null) {
|
||||||
|
data.show = this.show;
|
||||||
|
}
|
||||||
|
if (this.kilometerCode != null) {
|
||||||
|
data.kilometerCode = this.kilometerCode;
|
||||||
|
}
|
||||||
|
if (this.dir != null) {
|
||||||
|
data.dir = this.dir;
|
||||||
|
}
|
||||||
|
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.lineId != 0)
|
||||||
|
writer.writeInt32(1, this.lineId);
|
||||||
|
if (this.trainIndex.length)
|
||||||
|
writer.writeString(2, this.trainIndex);
|
||||||
|
if (this.groupId.length)
|
||||||
|
writer.writeString(3, this.groupId);
|
||||||
|
if (this.destinationId != 0)
|
||||||
|
writer.writeInt32(4, this.destinationId);
|
||||||
|
if (this.show != false)
|
||||||
|
writer.writeBool(5, this.show);
|
||||||
|
if (this.kilometerCode.length)
|
||||||
|
writer.writeString(6, this.kilometerCode);
|
||||||
|
if (this.dir != 0)
|
||||||
|
writer.writeInt32(7, this.dir);
|
||||||
|
if (!w)
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
}
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): WsLineNetTrainOffsetMessage {
|
||||||
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new WsLineNetTrainOffsetMessage();
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup())
|
||||||
|
break;
|
||||||
|
switch (reader.getFieldNumber()) {
|
||||||
|
case 1:
|
||||||
|
message.lineId = reader.readInt32();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
message.trainIndex = reader.readString();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
message.groupId = reader.readString();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
message.destinationId = reader.readInt32();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
message.show = reader.readBool();
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
message.kilometerCode = reader.readString();
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
message.dir = reader.readInt32();
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): WsLineNetTrainOffsetMessage {
|
||||||
|
return WsLineNetTrainOffsetMessage.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 8a7b2a4a3f2bfc441f7bb69696ac37d13d702ed6
|
Subproject commit fbedbb7457cc4ceafb79bc3fc1a88ab28d9fd928
|
Loading…
Reference in New Issue
Block a user