proto同步数据

This commit is contained in:
fan 2024-08-12 16:05:39 +08:00
parent 73fc258109
commit 21d4c0aa8f
3 changed files with 139 additions and 26 deletions

@ -1 +1 @@
Subproject commit 2f5d8c3cfdf06ced1a0b0a50f47f9353c441e196 Subproject commit 74bea4e9955524f7254876c90af08d963f666585

View File

@ -263,6 +263,96 @@ export namespace state {
return SectionState.deserialize(bytes); return SectionState.deserialize(bytes);
} }
} }
export class AxleCountingSectionState extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
id?: number;
occupied?: boolean;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
}
if ("occupied" in data && data.occupied != undefined) {
this.occupied = data.occupied;
}
}
}
get id() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set id(value: number) {
pb_1.Message.setField(this, 1, value);
}
get occupied() {
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
}
set occupied(value: boolean) {
pb_1.Message.setField(this, 2, value);
}
static fromObject(data: {
id?: number;
occupied?: boolean;
}): AxleCountingSectionState {
const message = new AxleCountingSectionState({});
if (data.id != null) {
message.id = data.id;
}
if (data.occupied != null) {
message.occupied = data.occupied;
}
return message;
}
toObject() {
const data: {
id?: number;
occupied?: boolean;
} = {};
if (this.id != null) {
data.id = this.id;
}
if (this.occupied != null) {
data.occupied = this.occupied;
}
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 != 0)
writer.writeUint32(1, this.id);
if (this.occupied != false)
writer.writeBool(2, this.occupied);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AxleCountingSectionState {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AxleCountingSectionState();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.id = reader.readUint32();
break;
case 2:
message.occupied = reader.readBool();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): AxleCountingSectionState {
return AxleCountingSectionState.deserialize(bytes);
}
}
export class SwitchState extends pb_1.Message { export class SwitchState extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
@ -9549,9 +9639,10 @@ export namespace state {
ckmStates?: CkmState[]; ckmStates?: CkmState[];
fymStates?: CkmState[]; fymStates?: CkmState[];
xcjStates?: XcjState[]; xcjStates?: XcjState[];
axleCountingSection?: AxleCountingSectionState[];
}) { }) {
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, 14, 15, 16], 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, 14, 15, 16, 17], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("trainState" in data && data.trainState != undefined) { if ("trainState" in data && data.trainState != undefined) {
this.trainState = data.trainState; this.trainState = data.trainState;
@ -9601,6 +9692,9 @@ export namespace state {
if ("xcjStates" in data && data.xcjStates != undefined) { if ("xcjStates" in data && data.xcjStates != undefined) {
this.xcjStates = data.xcjStates; this.xcjStates = data.xcjStates;
} }
if ("axleCountingSection" in data && data.axleCountingSection != undefined) {
this.axleCountingSection = data.axleCountingSection;
}
} }
} }
get trainState() { get trainState() {
@ -9702,6 +9796,12 @@ export namespace state {
set xcjStates(value: XcjState[]) { set xcjStates(value: XcjState[]) {
pb_1.Message.setRepeatedWrapperField(this, 16, value); pb_1.Message.setRepeatedWrapperField(this, 16, value);
} }
get axleCountingSection() {
return pb_1.Message.getRepeatedWrapperField(this, AxleCountingSectionState, 17) as AxleCountingSectionState[];
}
set axleCountingSection(value: AxleCountingSectionState[]) {
pb_1.Message.setRepeatedWrapperField(this, 17, value);
}
static fromObject(data: { static fromObject(data: {
trainState?: ReturnType<typeof TrainMapState.prototype.toObject>[]; trainState?: ReturnType<typeof TrainMapState.prototype.toObject>[];
switchState?: ReturnType<typeof SwitchState.prototype.toObject>[]; switchState?: ReturnType<typeof SwitchState.prototype.toObject>[];
@ -9719,6 +9819,7 @@ export namespace state {
ckmStates?: ReturnType<typeof CkmState.prototype.toObject>[]; ckmStates?: ReturnType<typeof CkmState.prototype.toObject>[];
fymStates?: ReturnType<typeof CkmState.prototype.toObject>[]; fymStates?: ReturnType<typeof CkmState.prototype.toObject>[];
xcjStates?: ReturnType<typeof XcjState.prototype.toObject>[]; xcjStates?: ReturnType<typeof XcjState.prototype.toObject>[];
axleCountingSection?: ReturnType<typeof AxleCountingSectionState.prototype.toObject>[];
}): AllDevicesStatus { }): AllDevicesStatus {
const message = new AllDevicesStatus({}); const message = new AllDevicesStatus({});
if (data.trainState != null) { if (data.trainState != null) {
@ -9769,6 +9870,9 @@ export namespace state {
if (data.xcjStates != null) { if (data.xcjStates != null) {
message.xcjStates = data.xcjStates.map(item => XcjState.fromObject(item)); message.xcjStates = data.xcjStates.map(item => XcjState.fromObject(item));
} }
if (data.axleCountingSection != null) {
message.axleCountingSection = data.axleCountingSection.map(item => AxleCountingSectionState.fromObject(item));
}
return message; return message;
} }
toObject() { toObject() {
@ -9789,6 +9893,7 @@ export namespace state {
ckmStates?: ReturnType<typeof CkmState.prototype.toObject>[]; ckmStates?: ReturnType<typeof CkmState.prototype.toObject>[];
fymStates?: ReturnType<typeof CkmState.prototype.toObject>[]; fymStates?: ReturnType<typeof CkmState.prototype.toObject>[];
xcjStates?: ReturnType<typeof XcjState.prototype.toObject>[]; xcjStates?: ReturnType<typeof XcjState.prototype.toObject>[];
axleCountingSection?: ReturnType<typeof AxleCountingSectionState.prototype.toObject>[];
} = {}; } = {};
if (this.trainState != null) { if (this.trainState != null) {
data.trainState = this.trainState.map((item: TrainMapState) => item.toObject()); data.trainState = this.trainState.map((item: TrainMapState) => item.toObject());
@ -9838,6 +9943,9 @@ export namespace state {
if (this.xcjStates != null) { if (this.xcjStates != null) {
data.xcjStates = this.xcjStates.map((item: XcjState) => item.toObject()); data.xcjStates = this.xcjStates.map((item: XcjState) => item.toObject());
} }
if (this.axleCountingSection != null) {
data.axleCountingSection = this.axleCountingSection.map((item: AxleCountingSectionState) => item.toObject());
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -9876,6 +9984,8 @@ export namespace state {
writer.writeRepeatedMessage(15, this.fymStates, (item: CkmState) => item.serialize(writer)); writer.writeRepeatedMessage(15, this.fymStates, (item: CkmState) => item.serialize(writer));
if (this.xcjStates.length) if (this.xcjStates.length)
writer.writeRepeatedMessage(16, this.xcjStates, (item: XcjState) => item.serialize(writer)); writer.writeRepeatedMessage(16, this.xcjStates, (item: XcjState) => item.serialize(writer));
if (this.axleCountingSection.length)
writer.writeRepeatedMessage(17, this.axleCountingSection, (item: AxleCountingSectionState) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -9933,6 +10043,9 @@ export namespace state {
case 16: case 16:
reader.readMessage(message.xcjStates, () => pb_1.Message.addToRepeatedWrapperField(message, 16, XcjState.deserialize(reader), XcjState)); reader.readMessage(message.xcjStates, () => pb_1.Message.addToRepeatedWrapperField(message, 16, XcjState.deserialize(reader), XcjState));
break; break;
case 17:
reader.readMessage(message.axleCountingSection, () => pb_1.Message.addToRepeatedWrapperField(message, 17, AxleCountingSectionState.deserialize(reader), AxleCountingSectionState));
break;
default: reader.skipField(); default: reader.skipField();
} }
} }

View File

@ -9432,7 +9432,6 @@ export namespace graphicData {
switchs?: LianSuoIndexData[]; switchs?: LianSuoIndexData[];
screenDoors?: LianSuoIndexData[]; screenDoors?: LianSuoIndexData[];
signals?: LianSuoIndexData[]; signals?: LianSuoIndexData[];
sections?: LianSuoIndexData[];
floodGates?: LianSuoIndexData[]; floodGates?: LianSuoIndexData[];
spksSwitchs?: LianSuoIndexData[]; spksSwitchs?: LianSuoIndexData[];
garageDoors?: LianSuoIndexData[]; garageDoors?: LianSuoIndexData[];
@ -9440,9 +9439,10 @@ export namespace graphicData {
esbButtons?: LianSuoIndexData[]; esbButtons?: LianSuoIndexData[];
holdButtons?: LianSuoIndexData[]; holdButtons?: LianSuoIndexData[];
unattengedButtons?: LianSuoIndexData[]; unattengedButtons?: LianSuoIndexData[];
acSections?: LianSuoIndexData[];
}) { }) {
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], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 3, 4, 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 ("stations" in data && data.stations != undefined) { if ("stations" in data && data.stations != undefined) {
this.stations = data.stations; this.stations = data.stations;
@ -9456,9 +9456,6 @@ export namespace graphicData {
if ("signals" in data && data.signals != undefined) { if ("signals" in data && data.signals != undefined) {
this.signals = data.signals; this.signals = data.signals;
} }
if ("sections" in data && data.sections != undefined) {
this.sections = data.sections;
}
if ("floodGates" in data && data.floodGates != undefined) { if ("floodGates" in data && data.floodGates != undefined) {
this.floodGates = data.floodGates; this.floodGates = data.floodGates;
} }
@ -9480,6 +9477,9 @@ export namespace graphicData {
if ("unattengedButtons" in data && data.unattengedButtons != undefined) { if ("unattengedButtons" in data && data.unattengedButtons != undefined) {
this.unattengedButtons = data.unattengedButtons; this.unattengedButtons = data.unattengedButtons;
} }
if ("acSections" in data && data.acSections != undefined) {
this.acSections = data.acSections;
}
} }
} }
get stations() { get stations() {
@ -9506,12 +9506,6 @@ export namespace graphicData {
set signals(value: LianSuoIndexData[]) { set signals(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value); pb_1.Message.setRepeatedWrapperField(this, 4, value);
} }
get sections() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 5) as LianSuoIndexData[];
}
set sections(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
get floodGates() { get floodGates() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 6) as LianSuoIndexData[]; return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 6) as LianSuoIndexData[];
} }
@ -9554,12 +9548,17 @@ export namespace graphicData {
set unattengedButtons(value: LianSuoIndexData[]) { set unattengedButtons(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 12, value); pb_1.Message.setRepeatedWrapperField(this, 12, value);
} }
get acSections() {
return pb_1.Message.getRepeatedWrapperField(this, LianSuoIndexData, 13) as LianSuoIndexData[];
}
set acSections(value: LianSuoIndexData[]) {
pb_1.Message.setRepeatedWrapperField(this, 13, value);
}
static fromObject(data: { static fromObject(data: {
stations?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; stations?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
switchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; switchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
screenDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; screenDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
signals?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; signals?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
sections?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
floodGates?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; floodGates?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
@ -9567,6 +9566,7 @@ export namespace graphicData {
esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
acSections?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
}): LianSuoData { }): LianSuoData {
const message = new LianSuoData({}); const message = new LianSuoData({});
if (data.stations != null) { if (data.stations != null) {
@ -9581,9 +9581,6 @@ export namespace graphicData {
if (data.signals != null) { if (data.signals != null) {
message.signals = data.signals.map(item => LianSuoIndexData.fromObject(item)); message.signals = data.signals.map(item => LianSuoIndexData.fromObject(item));
} }
if (data.sections != null) {
message.sections = data.sections.map(item => LianSuoIndexData.fromObject(item));
}
if (data.floodGates != null) { if (data.floodGates != null) {
message.floodGates = data.floodGates.map(item => LianSuoIndexData.fromObject(item)); message.floodGates = data.floodGates.map(item => LianSuoIndexData.fromObject(item));
} }
@ -9605,6 +9602,9 @@ export namespace graphicData {
if (data.unattengedButtons != null) { if (data.unattengedButtons != null) {
message.unattengedButtons = data.unattengedButtons.map(item => LianSuoIndexData.fromObject(item)); message.unattengedButtons = data.unattengedButtons.map(item => LianSuoIndexData.fromObject(item));
} }
if (data.acSections != null) {
message.acSections = data.acSections.map(item => LianSuoIndexData.fromObject(item));
}
return message; return message;
} }
toObject() { toObject() {
@ -9613,7 +9613,6 @@ export namespace graphicData {
switchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; switchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
screenDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; screenDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
signals?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; signals?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
sections?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
floodGates?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; floodGates?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; spksSwitchs?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; garageDoors?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
@ -9621,6 +9620,7 @@ export namespace graphicData {
esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; esbButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; holdButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[]; unattengedButtons?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
acSections?: ReturnType<typeof LianSuoIndexData.prototype.toObject>[];
} = {}; } = {};
if (this.stations != null) { if (this.stations != null) {
data.stations = this.stations.map((item: LianSuoIndexData) => item.toObject()); data.stations = this.stations.map((item: LianSuoIndexData) => item.toObject());
@ -9634,9 +9634,6 @@ export namespace graphicData {
if (this.signals != null) { if (this.signals != null) {
data.signals = this.signals.map((item: LianSuoIndexData) => item.toObject()); data.signals = this.signals.map((item: LianSuoIndexData) => item.toObject());
} }
if (this.sections != null) {
data.sections = this.sections.map((item: LianSuoIndexData) => item.toObject());
}
if (this.floodGates != null) { if (this.floodGates != null) {
data.floodGates = this.floodGates.map((item: LianSuoIndexData) => item.toObject()); data.floodGates = this.floodGates.map((item: LianSuoIndexData) => item.toObject());
} }
@ -9658,6 +9655,9 @@ export namespace graphicData {
if (this.unattengedButtons != null) { if (this.unattengedButtons != null) {
data.unattengedButtons = this.unattengedButtons.map((item: LianSuoIndexData) => item.toObject()); data.unattengedButtons = this.unattengedButtons.map((item: LianSuoIndexData) => item.toObject());
} }
if (this.acSections != null) {
data.acSections = this.acSections.map((item: LianSuoIndexData) => item.toObject());
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -9672,8 +9672,6 @@ export namespace graphicData {
writer.writeRepeatedMessage(3, this.screenDoors, (item: LianSuoIndexData) => item.serialize(writer)); writer.writeRepeatedMessage(3, this.screenDoors, (item: LianSuoIndexData) => item.serialize(writer));
if (this.signals.length) if (this.signals.length)
writer.writeRepeatedMessage(4, this.signals, (item: LianSuoIndexData) => item.serialize(writer)); writer.writeRepeatedMessage(4, this.signals, (item: LianSuoIndexData) => item.serialize(writer));
if (this.sections.length)
writer.writeRepeatedMessage(5, this.sections, (item: LianSuoIndexData) => item.serialize(writer));
if (this.floodGates.length) if (this.floodGates.length)
writer.writeRepeatedMessage(6, this.floodGates, (item: LianSuoIndexData) => item.serialize(writer)); writer.writeRepeatedMessage(6, this.floodGates, (item: LianSuoIndexData) => item.serialize(writer));
if (this.spksSwitchs.length) if (this.spksSwitchs.length)
@ -9688,6 +9686,8 @@ export namespace graphicData {
writer.writeRepeatedMessage(11, this.holdButtons, (item: LianSuoIndexData) => item.serialize(writer)); writer.writeRepeatedMessage(11, this.holdButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (this.unattengedButtons.length) if (this.unattengedButtons.length)
writer.writeRepeatedMessage(12, this.unattengedButtons, (item: LianSuoIndexData) => item.serialize(writer)); writer.writeRepeatedMessage(12, this.unattengedButtons, (item: LianSuoIndexData) => item.serialize(writer));
if (this.acSections.length)
writer.writeRepeatedMessage(13, this.acSections, (item: LianSuoIndexData) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -9709,9 +9709,6 @@ export namespace graphicData {
case 4: case 4:
reader.readMessage(message.signals, () => pb_1.Message.addToRepeatedWrapperField(message, 4, LianSuoIndexData.deserialize(reader), LianSuoIndexData)); reader.readMessage(message.signals, () => pb_1.Message.addToRepeatedWrapperField(message, 4, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break; break;
case 5:
reader.readMessage(message.sections, () => pb_1.Message.addToRepeatedWrapperField(message, 5, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
case 6: case 6:
reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 6, LianSuoIndexData.deserialize(reader), LianSuoIndexData)); reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 6, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break; break;
@ -9733,6 +9730,9 @@ export namespace graphicData {
case 12: case 12:
reader.readMessage(message.unattengedButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 12, LianSuoIndexData.deserialize(reader), LianSuoIndexData)); reader.readMessage(message.unattengedButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 12, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break; break;
case 13:
reader.readMessage(message.acSections, () => pb_1.Message.addToRepeatedWrapperField(message, 13, LianSuoIndexData.deserialize(reader), LianSuoIndexData));
break;
default: reader.skipField(); default: reader.skipField();
} }
} }