消息同步

This commit is contained in:
Yuan 2023-08-02 10:25:06 +08:00
parent 5f02a5cc59
commit 6163a8b17b
2 changed files with 24 additions and 1 deletions

@ -1 +1 @@
Subproject commit a2b81799c6d9a31a38801f3a356ae3a619abbb5c
Subproject commit f0da7c7c5c5a9fc8781d0d612a84e3a97f8c0f81

View File

@ -554,6 +554,7 @@ export namespace state {
headRadarSpeed?: number;
tailRadarSpeed?: number;
trainLength?: number;
show?: boolean;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], this.#one_of_decls);
@ -627,6 +628,9 @@ export namespace state {
if ("trainLength" in data && data.trainLength != undefined) {
this.trainLength = data.trainLength;
}
if ("show" in data && data.show != undefined) {
this.show = data.show;
}
}
}
get id() {
@ -767,6 +771,12 @@ export namespace state {
set trainLength(value: number) {
pb_1.Message.setField(this, 23, value);
}
get show() {
return pb_1.Message.getFieldWithDefault(this, 24, false) as boolean;
}
set show(value: boolean) {
pb_1.Message.setField(this, 24, value);
}
static fromObject(data: {
id?: string;
up?: boolean;
@ -791,6 +801,7 @@ export namespace state {
headRadarSpeed?: number;
tailRadarSpeed?: number;
trainLength?: number;
show?: boolean;
}): TrainState {
const message = new TrainState({});
if (data.id != null) {
@ -862,6 +873,9 @@ export namespace state {
if (data.trainLength != null) {
message.trainLength = data.trainLength;
}
if (data.show != null) {
message.show = data.show;
}
return message;
}
toObject() {
@ -889,6 +903,7 @@ export namespace state {
headRadarSpeed?: number;
tailRadarSpeed?: number;
trainLength?: number;
show?: boolean;
} = {};
if (this.id != null) {
data.id = this.id;
@ -959,6 +974,9 @@ export namespace state {
if (this.trainLength != null) {
data.trainLength = this.trainLength;
}
if (this.show != null) {
data.show = this.show;
}
return data;
}
serialize(): Uint8Array;
@ -1011,6 +1029,8 @@ export namespace state {
writer.writeInt32(22, this.tailRadarSpeed);
if (this.trainLength != 0)
writer.writeInt64(23, this.trainLength);
if (this.show != false)
writer.writeBool(24, this.show);
if (!w)
return writer.getResultBuffer();
}
@ -1089,6 +1109,9 @@ export namespace state {
case 23:
message.trainLength = reader.readInt64();
break;
case 24:
message.show = reader.readBool();
break;
default: reader.skipField();
}
}