四道岔共点关系处理

This commit is contained in:
Yuan 2023-06-29 17:33:19 +08:00
parent 9df36d7706
commit 10a2c9de27
5 changed files with 291 additions and 137 deletions

View File

@ -6,6 +6,7 @@ import {
JlGraphic,
JlGraphicTemplate,
VectorText,
angleOfIncludedAngle,
distance2,
} from 'src/jl-graphic';
import { Section, SectionPort } from '../section/Section';
@ -208,9 +209,11 @@ export class Turnout extends JlGraphic {
});
/** 道岔和道岔 */
this.getPortPoints().forEach((thisPort, i) => {
let params: GraphicRelationParam[] = [],
deflection = 180;
this.queryStore.queryByType<Turnout>(Turnout.Type).forEach((turnout) => {
if (turnout.id === this.id) return;
this.getPortPoints().forEach((thisPort, i) => {
turnout.getPortPoints().forEach((otherPort, j) => {
if (
distance2(
@ -218,7 +221,18 @@ export class Turnout extends JlGraphic {
turnout.localToCanvasPoint(otherPort[otherPort.length - 1])
) <= epsilon
) {
this.relationManage.addRelation(
const angle = angleOfIncludedAngle(
this.localToCanvasPoint(thisPort[thisPort.length - 1]) /* 交点 */,
thisPort[thisPort.length - 2]
? this.localToCanvasPoint(thisPort[thisPort.length - 2])
: this.position,
otherPort[otherPort.length - 2]
? turnout.localToCanvasPoint(otherPort[otherPort.length - 2])
: turnout.position
);
if (180 - Math.abs(angle) <= deflection) {
deflection = 180 - Math.abs(angle);
params = [
new GraphicRelationParam(
this,
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i]
@ -226,11 +240,15 @@ export class Turnout extends JlGraphic {
new GraphicRelationParam(
turnout,
[TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][j]
)
);
),
];
}
}
});
});
if (params.length === 2) {
this.relationManage.addRelation(params[0], params[1]);
}
});
}

View File

@ -12,11 +12,12 @@ export namespace state {
id?: string;
code?: string;
type?: dependency_1.graphicData.Section.SectionType;
kilometerCode?: string[];
kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
children?: Section[];
convertKilometer?: number[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 6], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
@ -27,12 +28,15 @@ export namespace state {
if ("type" in data && data.type != undefined) {
this.type = data.type;
}
if ("kilometerCode" in data && data.kilometerCode != undefined) {
this.kilometerCode = data.kilometerCode;
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem;
}
if ("children" in data && data.children != undefined) {
this.children = data.children;
}
if ("convertKilometer" in data && data.convertKilometer != undefined) {
this.convertKilometer = data.convertKilometer;
}
}
}
get id() {
@ -53,11 +57,11 @@ export namespace state {
set type(value: dependency_1.graphicData.Section.SectionType) {
pb_1.Message.setField(this, 3, value);
}
get kilometerCode() {
return pb_1.Message.getFieldWithDefault(this, 4, []) as string[];
get kilometerSystem() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 4) as dependency_1.graphicData.KilometerSystem[];
}
set kilometerCode(value: string[]) {
pb_1.Message.setField(this, 4, value);
set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get children() {
return pb_1.Message.getRepeatedWrapperField(this, Section, 5) as Section[];
@ -65,12 +69,19 @@ export namespace state {
set children(value: Section[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
get convertKilometer() {
return pb_1.Message.getFieldWithDefault(this, 6, []) as number[];
}
set convertKilometer(value: number[]) {
pb_1.Message.setField(this, 6, value);
}
static fromObject(data: {
id?: string;
code?: string;
type?: dependency_1.graphicData.Section.SectionType;
kilometerCode?: string[];
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[];
convertKilometer?: number[];
}): Section {
const message = new Section({});
if (data.id != null) {
@ -82,12 +93,15 @@ export namespace state {
if (data.type != null) {
message.type = data.type;
}
if (data.kilometerCode != null) {
message.kilometerCode = data.kilometerCode;
if (data.kilometerSystem != null) {
message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
}
if (data.children != null) {
message.children = data.children.map(item => Section.fromObject(item));
}
if (data.convertKilometer != null) {
message.convertKilometer = data.convertKilometer;
}
return message;
}
toObject() {
@ -95,8 +109,9 @@ export namespace state {
id?: string;
code?: string;
type?: dependency_1.graphicData.Section.SectionType;
kilometerCode?: string[];
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[];
convertKilometer?: number[];
} = {};
if (this.id != null) {
data.id = this.id;
@ -107,12 +122,15 @@ export namespace state {
if (this.type != null) {
data.type = this.type;
}
if (this.kilometerCode != null) {
data.kilometerCode = this.kilometerCode;
if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
}
if (this.children != null) {
data.children = this.children.map((item: Section) => item.toObject());
}
if (this.convertKilometer != null) {
data.convertKilometer = this.convertKilometer;
}
return data;
}
serialize(): Uint8Array;
@ -125,10 +143,12 @@ export namespace state {
writer.writeString(2, this.code);
if (this.type != dependency_1.graphicData.Section.SectionType.Physical)
writer.writeEnum(3, this.type);
if (this.kilometerCode.length)
writer.writeRepeatedString(4, this.kilometerCode);
if (this.kilometerSystem.length)
writer.writeRepeatedMessage(4, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.children.length)
writer.writeRepeatedMessage(5, this.children, (item: Section) => item.serialize(writer));
if (this.convertKilometer.length)
writer.writePackedInt64(6, this.convertKilometer);
if (!w)
return writer.getResultBuffer();
}
@ -148,11 +168,14 @@ export namespace state {
message.type = reader.readEnum();
break;
case 4:
pb_1.Message.addToRepeatedField(message, 4, reader.readString());
reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem));
break;
case 5:
reader.readMessage(message.children, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Section.deserialize(reader), Section));
break;
case 6:
message.convertKilometer = reader.readPackedInt64();
break;
default: reader.skipField();
}
}
@ -170,12 +193,11 @@ export namespace state {
constructor(data?: any[] | {
id?: string;
code?: string;
paSection?: Section;
pbSection?: Section;
pcSection?: Section;
kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
convertKilometer?: number[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
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 ("id" in data && data.id != undefined) {
this.id = data.id;
@ -183,14 +205,11 @@ export namespace state {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("paSection" in data && data.paSection != undefined) {
this.paSection = data.paSection;
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem;
}
if ("pbSection" in data && data.pbSection != undefined) {
this.pbSection = data.pbSection;
}
if ("pcSection" in data && data.pcSection != undefined) {
this.pcSection = data.pcSection;
if ("convertKilometer" in data && data.convertKilometer != undefined) {
this.convertKilometer = data.convertKilometer;
}
}
}
@ -206,39 +225,23 @@ export namespace state {
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get paSection() {
return pb_1.Message.getWrapperField(this, Section, 3) as Section;
get kilometerSystem() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 3) as dependency_1.graphicData.KilometerSystem[];
}
set paSection(value: Section) {
pb_1.Message.setWrapperField(this, 3, value);
set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get has_paSection() {
return pb_1.Message.getField(this, 3) != null;
get convertKilometer() {
return pb_1.Message.getFieldWithDefault(this, 4, []) as number[];
}
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;
set convertKilometer(value: number[]) {
pb_1.Message.setField(this, 4, value);
}
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>;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
convertKilometer?: number[];
}): Switch {
const message = new Switch({});
if (data.id != null) {
@ -247,14 +250,11 @@ export namespace state {
if (data.code != null) {
message.code = data.code;
}
if (data.paSection != null) {
message.paSection = Section.fromObject(data.paSection);
if (data.kilometerSystem != null) {
message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
}
if (data.pbSection != null) {
message.pbSection = Section.fromObject(data.pbSection);
}
if (data.pcSection != null) {
message.pcSection = Section.fromObject(data.pcSection);
if (data.convertKilometer != null) {
message.convertKilometer = data.convertKilometer;
}
return message;
}
@ -262,9 +262,8 @@ export namespace state {
const data: {
id?: string;
code?: string;
paSection?: ReturnType<typeof Section.prototype.toObject>;
pbSection?: ReturnType<typeof Section.prototype.toObject>;
pcSection?: ReturnType<typeof Section.prototype.toObject>;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
convertKilometer?: number[];
} = {};
if (this.id != null) {
data.id = this.id;
@ -272,14 +271,11 @@ export namespace state {
if (this.code != null) {
data.code = this.code;
}
if (this.paSection != null) {
data.paSection = this.paSection.toObject();
if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
}
if (this.pbSection != null) {
data.pbSection = this.pbSection.toObject();
}
if (this.pcSection != null) {
data.pcSection = this.pcSection.toObject();
if (this.convertKilometer != null) {
data.convertKilometer = this.convertKilometer;
}
return data;
}
@ -291,12 +287,10 @@ export namespace state {
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 (this.kilometerSystem.length)
writer.writeRepeatedMessage(3, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.convertKilometer.length)
writer.writePackedInt64(4, this.convertKilometer);
if (!w)
return writer.getResultBuffer();
}
@ -313,13 +307,10 @@ export namespace state {
message.code = reader.readString();
break;
case 3:
reader.readMessage(message.paSection, () => message.paSection = Section.deserialize(reader));
reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem));
break;
case 4:
reader.readMessage(message.pbSection, () => message.pbSection = Section.deserialize(reader));
break;
case 5:
reader.readMessage(message.pcSection, () => message.pcSection = Section.deserialize(reader));
message.convertKilometer = reader.readPackedInt64();
break;
default: reader.skipField();
}

View File

@ -25,9 +25,10 @@ export namespace graphicData {
polygons?: Polygon[];
trainWindows?: TrainWindow[];
axleCountings?: AxleCounting[];
separators?: Separator[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
@ -80,6 +81,9 @@ export namespace graphicData {
if ("axleCountings" in data && data.axleCountings != undefined) {
this.axleCountings = data.axleCountings;
}
if ("separators" in data && data.separators != undefined) {
this.separators = data.separators;
}
}
}
get canvas() {
@ -187,6 +191,12 @@ export namespace graphicData {
set axleCountings(value: AxleCounting[]) {
pb_1.Message.setRepeatedWrapperField(this, 17, value);
}
get separators() {
return pb_1.Message.getRepeatedWrapperField(this, Separator, 18) as Separator[];
}
set separators(value: Separator[]) {
pb_1.Message.setRepeatedWrapperField(this, 18, value);
}
static fromObject(data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
links?: ReturnType<typeof Link.prototype.toObject>[];
@ -205,6 +215,7 @@ export namespace graphicData {
polygons?: ReturnType<typeof Polygon.prototype.toObject>[];
trainWindows?: ReturnType<typeof TrainWindow.prototype.toObject>[];
axleCountings?: ReturnType<typeof AxleCounting.prototype.toObject>[];
separators?: ReturnType<typeof Separator.prototype.toObject>[];
}): RtssGraphicStorage {
const message = new RtssGraphicStorage({});
if (data.canvas != null) {
@ -258,6 +269,9 @@ export namespace graphicData {
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));
}
return message;
}
toObject() {
@ -279,6 +293,7 @@ export namespace graphicData {
polygons?: ReturnType<typeof Polygon.prototype.toObject>[];
trainWindows?: ReturnType<typeof TrainWindow.prototype.toObject>[];
axleCountings?: ReturnType<typeof AxleCounting.prototype.toObject>[];
separators?: ReturnType<typeof Separator.prototype.toObject>[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@ -331,6 +346,9 @@ export namespace graphicData {
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());
}
return data;
}
serialize(): Uint8Array;
@ -371,6 +389,8 @@ export namespace graphicData {
writer.writeRepeatedMessage(16, this.trainWindows, (item: TrainWindow) => item.serialize(writer));
if (this.axleCountings.length)
writer.writeRepeatedMessage(17, this.axleCountings, (item: AxleCounting) => item.serialize(writer));
if (this.separators.length)
writer.writeRepeatedMessage(18, this.separators, (item: Separator) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -431,6 +451,9 @@ export namespace graphicData {
case 17:
reader.readMessage(message.axleCountings, () => pb_1.Message.addToRepeatedWrapperField(message, 17, AxleCounting.deserialize(reader), AxleCounting));
break;
case 18:
reader.readMessage(message.separators, () => pb_1.Message.addToRepeatedWrapperField(message, 18, Separator.deserialize(reader), Separator));
break;
default: reader.skipField();
}
}
@ -1799,7 +1822,7 @@ export namespace graphicData {
code?: string;
hasControl?: boolean;
concentrationStations?: boolean;
kilometerCode?: string;
kilometerSystem?: KilometerSystem;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -1816,8 +1839,8 @@ export namespace graphicData {
if ("concentrationStations" in data && data.concentrationStations != undefined) {
this.concentrationStations = data.concentrationStations;
}
if ("kilometerCode" in data && data.kilometerCode != undefined) {
this.kilometerCode = data.kilometerCode;
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem;
}
}
}
@ -1848,18 +1871,21 @@ export namespace graphicData {
set concentrationStations(value: boolean) {
pb_1.Message.setField(this, 4, value);
}
get kilometerCode() {
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
get kilometerSystem() {
return pb_1.Message.getWrapperField(this, KilometerSystem, 6) as KilometerSystem;
}
set kilometerCode(value: string) {
pb_1.Message.setField(this, 5, value);
set kilometerSystem(value: KilometerSystem) {
pb_1.Message.setWrapperField(this, 6, value);
}
get has_kilometerSystem() {
return pb_1.Message.getField(this, 6) != null;
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
hasControl?: boolean;
concentrationStations?: boolean;
kilometerCode?: string;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
}): Station {
const message = new Station({});
if (data.common != null) {
@ -1874,8 +1900,8 @@ export namespace graphicData {
if (data.concentrationStations != null) {
message.concentrationStations = data.concentrationStations;
}
if (data.kilometerCode != null) {
message.kilometerCode = data.kilometerCode;
if (data.kilometerSystem != null) {
message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
}
return message;
}
@ -1885,7 +1911,7 @@ export namespace graphicData {
code?: string;
hasControl?: boolean;
concentrationStations?: boolean;
kilometerCode?: string;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -1899,8 +1925,8 @@ export namespace graphicData {
if (this.concentrationStations != null) {
data.concentrationStations = this.concentrationStations;
}
if (this.kilometerCode != null) {
data.kilometerCode = this.kilometerCode;
if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.toObject();
}
return data;
}
@ -1916,8 +1942,8 @@ export namespace graphicData {
writer.writeBool(3, this.hasControl);
if (this.concentrationStations != false)
writer.writeBool(4, this.concentrationStations);
if (this.kilometerCode.length)
writer.writeString(5, this.kilometerCode);
if (this.has_kilometerSystem)
writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -1939,8 +1965,8 @@ export namespace graphicData {
case 4:
message.concentrationStations = reader.readBool();
break;
case 5:
message.kilometerCode = reader.readString();
case 6:
reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader));
break;
default: reader.skipField();
}
@ -2214,7 +2240,7 @@ export namespace graphicData {
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
kilometerCode?: string;
kilometerSystem?: KilometerSystem;
axleCountingRef?: RelatedRef[];
}) {
super();
@ -2226,8 +2252,8 @@ export namespace graphicData {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("kilometerCode" in data && data.kilometerCode != undefined) {
this.kilometerCode = data.kilometerCode;
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem;
}
if ("axleCountingRef" in data && data.axleCountingRef != undefined) {
this.axleCountingRef = data.axleCountingRef;
@ -2249,11 +2275,14 @@ export namespace graphicData {
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get kilometerCode() {
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
get kilometerSystem() {
return pb_1.Message.getWrapperField(this, KilometerSystem, 3) as KilometerSystem;
}
set kilometerCode(value: string) {
pb_1.Message.setField(this, 3, value);
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[];
@ -2264,7 +2293,7 @@ export namespace graphicData {
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
kilometerCode?: string;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
axleCountingRef?: ReturnType<typeof RelatedRef.prototype.toObject>[];
}): AxleCounting {
const message = new AxleCounting({});
@ -2274,8 +2303,8 @@ export namespace graphicData {
if (data.code != null) {
message.code = data.code;
}
if (data.kilometerCode != null) {
message.kilometerCode = data.kilometerCode;
if (data.kilometerSystem != null) {
message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
}
if (data.axleCountingRef != null) {
message.axleCountingRef = data.axleCountingRef.map(item => RelatedRef.fromObject(item));
@ -2286,7 +2315,7 @@ export namespace graphicData {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
kilometerCode?: string;
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
axleCountingRef?: ReturnType<typeof RelatedRef.prototype.toObject>[];
} = {};
if (this.common != null) {
@ -2295,8 +2324,8 @@ export namespace graphicData {
if (this.code != null) {
data.code = this.code;
}
if (this.kilometerCode != null) {
data.kilometerCode = this.kilometerCode;
if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.toObject();
}
if (this.axleCountingRef != null) {
data.axleCountingRef = this.axleCountingRef.map((item: RelatedRef) => item.toObject());
@ -2311,8 +2340,8 @@ export namespace graphicData {
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.kilometerCode.length)
writer.writeString(3, this.kilometerCode);
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 (!w)
@ -2331,7 +2360,7 @@ export namespace graphicData {
message.code = reader.readString();
break;
case 3:
message.kilometerCode = reader.readString();
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));
@ -3955,4 +3984,120 @@ export namespace graphicData {
C = 2
}
}
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;
}
}
}
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<typeof CommonInfo.prototype.toObject>;
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<typeof CommonInfo.prototype.toObject>;
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);
}
}
}

View File

@ -469,7 +469,7 @@ export namespace state {
groupId?: string;
destinationId?: number;
show?: boolean;
kilometerCode?: string;
kilometerCode?: number;
dir?: number;
}) {
super();
@ -529,9 +529,9 @@ export namespace state {
pb_1.Message.setField(this, 5, value);
}
get kilometerCode() {
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
}
set kilometerCode(value: string) {
set kilometerCode(value: number) {
pb_1.Message.setField(this, 6, value);
}
get dir() {
@ -546,7 +546,7 @@ export namespace state {
groupId?: string;
destinationId?: number;
show?: boolean;
kilometerCode?: string;
kilometerCode?: number;
dir?: number;
}): WsLineNetTrainOffsetMessage {
const message = new WsLineNetTrainOffsetMessage({});
@ -580,7 +580,7 @@ export namespace state {
groupId?: string;
destinationId?: number;
show?: boolean;
kilometerCode?: string;
kilometerCode?: number;
dir?: number;
} = {};
if (this.lineId != null) {
@ -620,8 +620,8 @@ export namespace state {
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.kilometerCode != 0)
writer.writeInt64(6, this.kilometerCode);
if (this.dir != 0)
writer.writeInt32(7, this.dir);
if (!w)
@ -649,7 +649,7 @@ export namespace state {
message.show = reader.readBool();
break;
case 6:
message.kilometerCode = reader.readString();
message.kilometerCode = reader.readInt64();
break;
case 7:
message.dir = reader.readInt32();

@ -1 +1 @@
Subproject commit 0e4f2bd6fbb5eae436685260e622ec7796ae479a
Subproject commit c92fd31a301d06b5bfe5426d3da65203c82e84fb