proto同步

This commit is contained in:
fan 2024-08-29 16:55:59 +08:00
parent 3c856ec37c
commit f61ee0610c
3 changed files with 93 additions and 47 deletions

@ -1 +1 @@
Subproject commit 67d7d79c5a50880b61be05d98184209422f15f1b
Subproject commit 4e345938106b1967c6b8b70db04d2d8933074611

View File

@ -25,8 +25,6 @@ export namespace common {
idlingD?: number;
stopSign?: number;
slide?: number;
trainLoad?: number;
maxSpeed?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -82,12 +80,6 @@ export namespace common {
if ("slide" in data && data.slide != undefined) {
this.slide = data.slide;
}
if ("trainLoad" in data && data.trainLoad != undefined) {
this.trainLoad = data.trainLoad;
}
if ("maxSpeed" in data && data.maxSpeed != undefined) {
this.maxSpeed = data.maxSpeed;
}
}
}
get davisParamA() {
@ -192,18 +184,6 @@ export namespace common {
set slide(value: number) {
pb_1.Message.setField(this, 18, value);
}
get trainLoad() {
return pb_1.Message.getFieldWithDefault(this, 19, 0) as number;
}
set trainLoad(value: number) {
pb_1.Message.setField(this, 19, value);
}
get maxSpeed() {
return pb_1.Message.getFieldWithDefault(this, 20, 0) as number;
}
set maxSpeed(value: number) {
pb_1.Message.setField(this, 20, value);
}
static fromObject(data: {
davisParamA?: number;
davisParamB?: number;
@ -222,8 +202,6 @@ export namespace common {
idlingD?: number;
stopSign?: number;
slide?: number;
trainLoad?: number;
maxSpeed?: number;
}): TrainDynamicConfig {
const message = new TrainDynamicConfig({});
if (data.davisParamA != null) {
@ -277,12 +255,6 @@ export namespace common {
if (data.slide != null) {
message.slide = data.slide;
}
if (data.trainLoad != null) {
message.trainLoad = data.trainLoad;
}
if (data.maxSpeed != null) {
message.maxSpeed = data.maxSpeed;
}
return message;
}
toObject() {
@ -304,8 +276,6 @@ export namespace common {
idlingD?: number;
stopSign?: number;
slide?: number;
trainLoad?: number;
maxSpeed?: number;
} = {};
if (this.davisParamA != null) {
data.davisParamA = this.davisParamA;
@ -358,12 +328,6 @@ export namespace common {
if (this.slide != null) {
data.slide = this.slide;
}
if (this.trainLoad != null) {
data.trainLoad = this.trainLoad;
}
if (this.maxSpeed != null) {
data.maxSpeed = this.maxSpeed;
}
return data;
}
serialize(): Uint8Array;
@ -404,10 +368,6 @@ export namespace common {
writer.writeInt32(17, this.stopSign);
if (this.slide != 0)
writer.writeFloat(18, this.slide);
if (this.trainLoad != 0)
writer.writeInt32(19, this.trainLoad);
if (this.maxSpeed != 0)
writer.writeFloat(20, this.maxSpeed);
if (!w)
return writer.getResultBuffer();
}
@ -468,12 +428,6 @@ export namespace common {
case 18:
message.slide = reader.readFloat();
break;
case 19:
message.trainLoad = reader.readInt32();
break;
case 20:
message.maxSpeed = reader.readFloat();
break;
default: reader.skipField();
}
}

View File

@ -9084,6 +9084,10 @@ export namespace graphicData {
trainSets?: string;
dynamicConfig?: dependency_1.common.TrainDynamicConfig;
trainControlMapId?: number;
trainLoad?: number;
trainMaxSpeed?: number;
trainMaxAcc?: number;
trainMaxBrake?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -9106,6 +9110,18 @@ export namespace graphicData {
if ("trainControlMapId" in data && data.trainControlMapId != undefined) {
this.trainControlMapId = data.trainControlMapId;
}
if ("trainLoad" in data && data.trainLoad != undefined) {
this.trainLoad = data.trainLoad;
}
if ("trainMaxSpeed" in data && data.trainMaxSpeed != undefined) {
this.trainMaxSpeed = data.trainMaxSpeed;
}
if ("trainMaxAcc" in data && data.trainMaxAcc != undefined) {
this.trainMaxAcc = data.trainMaxAcc;
}
if ("trainMaxBrake" in data && data.trainMaxBrake != undefined) {
this.trainMaxBrake = data.trainMaxBrake;
}
}
}
get trainModel() {
@ -9147,6 +9163,30 @@ export namespace graphicData {
set trainControlMapId(value: number) {
pb_1.Message.setField(this, 9, value);
}
get trainLoad() {
return pb_1.Message.getFieldWithDefault(this, 10, 0) as number;
}
set trainLoad(value: number) {
pb_1.Message.setField(this, 10, value);
}
get trainMaxSpeed() {
return pb_1.Message.getFieldWithDefault(this, 11, 0) as number;
}
set trainMaxSpeed(value: number) {
pb_1.Message.setField(this, 11, value);
}
get trainMaxAcc() {
return pb_1.Message.getFieldWithDefault(this, 12, 0) as number;
}
set trainMaxAcc(value: number) {
pb_1.Message.setField(this, 12, value);
}
get trainMaxBrake() {
return pb_1.Message.getFieldWithDefault(this, 13, 0) as number;
}
set trainMaxBrake(value: number) {
pb_1.Message.setField(this, 13, value);
}
static fromObject(data: {
trainModel?: Train.TrainModel;
carriageLength?: number;
@ -9154,6 +9194,10 @@ export namespace graphicData {
trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
trainControlMapId?: number;
trainLoad?: number;
trainMaxSpeed?: number;
trainMaxAcc?: number;
trainMaxBrake?: number;
}): Train {
const message = new Train({});
if (data.trainModel != null) {
@ -9174,6 +9218,18 @@ export namespace graphicData {
if (data.trainControlMapId != null) {
message.trainControlMapId = data.trainControlMapId;
}
if (data.trainLoad != null) {
message.trainLoad = data.trainLoad;
}
if (data.trainMaxSpeed != null) {
message.trainMaxSpeed = data.trainMaxSpeed;
}
if (data.trainMaxAcc != null) {
message.trainMaxAcc = data.trainMaxAcc;
}
if (data.trainMaxBrake != null) {
message.trainMaxBrake = data.trainMaxBrake;
}
return message;
}
toObject() {
@ -9184,6 +9240,10 @@ export namespace graphicData {
trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
trainControlMapId?: number;
trainLoad?: number;
trainMaxSpeed?: number;
trainMaxAcc?: number;
trainMaxBrake?: number;
} = {};
if (this.trainModel != null) {
data.trainModel = this.trainModel;
@ -9203,6 +9263,18 @@ export namespace graphicData {
if (this.trainControlMapId != null) {
data.trainControlMapId = this.trainControlMapId;
}
if (this.trainLoad != null) {
data.trainLoad = this.trainLoad;
}
if (this.trainMaxSpeed != null) {
data.trainMaxSpeed = this.trainMaxSpeed;
}
if (this.trainMaxAcc != null) {
data.trainMaxAcc = this.trainMaxAcc;
}
if (this.trainMaxBrake != null) {
data.trainMaxBrake = this.trainMaxBrake;
}
return data;
}
serialize(): Uint8Array;
@ -9221,6 +9293,14 @@ export namespace graphicData {
writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer));
if (this.trainControlMapId != 0)
writer.writeInt32(9, this.trainControlMapId);
if (this.trainLoad != 0)
writer.writeInt32(10, this.trainLoad);
if (this.trainMaxSpeed != 0)
writer.writeFloat(11, this.trainMaxSpeed);
if (this.trainMaxAcc != 0)
writer.writeFloat(12, this.trainMaxAcc);
if (this.trainMaxBrake != 0)
writer.writeFloat(13, this.trainMaxBrake);
if (!w)
return writer.getResultBuffer();
}
@ -9248,6 +9328,18 @@ export namespace graphicData {
case 9:
message.trainControlMapId = reader.readInt32();
break;
case 10:
message.trainLoad = reader.readInt32();
break;
case 11:
message.trainMaxSpeed = reader.readFloat();
break;
case 12:
message.trainMaxAcc = reader.readFloat();
break;
case 13:
message.trainMaxBrake = reader.readFloat();
break;
default: reader.skipField();
}
}