From 3c856ec37c053d5caad5cb1125a5bef2004cf880 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 29 Aug 2024 16:14:30 +0800 Subject: [PATCH] =?UTF-8?q?protoc=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rts-sim-testing-message | 2 +- src/protos/common_data.ts | 23 +++++++++++++++++++ src/protos/device_state.ts | 46 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 939b7a2..67d7d79 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 939b7a2604a29cb3d486199cc9491af49f81a2f3 +Subproject commit 67d7d79c5a50880b61be05d98184209422f15f1b diff --git a/src/protos/common_data.ts b/src/protos/common_data.ts index 47810d5..f1f5c9d 100644 --- a/src/protos/common_data.ts +++ b/src/protos/common_data.ts @@ -26,6 +26,7 @@ export namespace common { stopSign?: number; slide?: number; trainLoad?: number; + maxSpeed?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -84,6 +85,9 @@ export namespace common { if ("trainLoad" in data && data.trainLoad != undefined) { this.trainLoad = data.trainLoad; } + if ("maxSpeed" in data && data.maxSpeed != undefined) { + this.maxSpeed = data.maxSpeed; + } } } get davisParamA() { @@ -194,6 +198,12 @@ export namespace common { 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; @@ -213,6 +223,7 @@ export namespace common { stopSign?: number; slide?: number; trainLoad?: number; + maxSpeed?: number; }): TrainDynamicConfig { const message = new TrainDynamicConfig({}); if (data.davisParamA != null) { @@ -269,6 +280,9 @@ export namespace common { if (data.trainLoad != null) { message.trainLoad = data.trainLoad; } + if (data.maxSpeed != null) { + message.maxSpeed = data.maxSpeed; + } return message; } toObject() { @@ -291,6 +305,7 @@ export namespace common { stopSign?: number; slide?: number; trainLoad?: number; + maxSpeed?: number; } = {}; if (this.davisParamA != null) { data.davisParamA = this.davisParamA; @@ -346,6 +361,9 @@ export namespace common { if (this.trainLoad != null) { data.trainLoad = this.trainLoad; } + if (this.maxSpeed != null) { + data.maxSpeed = this.maxSpeed; + } return data; } serialize(): Uint8Array; @@ -388,6 +406,8 @@ export namespace common { 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(); } @@ -451,6 +471,9 @@ export namespace common { case 19: message.trainLoad = reader.readInt32(); break; + case 20: + message.maxSpeed = reader.readFloat(); + break; default: reader.skipField(); } } diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index a491e92..5c3c44c 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -3388,6 +3388,8 @@ export namespace state { lightDir2?: boolean; lightDriverActive?: boolean; trainConnInitComplate?: boolean; + atoCloseRightDoor?: boolean; + lightAtoSend?: boolean; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -3626,6 +3628,12 @@ export namespace state { if ("trainConnInitComplate" in data && data.trainConnInitComplate != undefined) { this.trainConnInitComplate = data.trainConnInitComplate; } + if ("atoCloseRightDoor" in data && data.atoCloseRightDoor != undefined) { + this.atoCloseRightDoor = data.atoCloseRightDoor; + } + if ("lightAtoSend" in data && data.lightAtoSend != undefined) { + this.lightAtoSend = data.lightAtoSend; + } } } get lifeSignal() { @@ -4096,6 +4104,18 @@ export namespace state { set trainConnInitComplate(value: boolean) { pb_1.Message.setField(this, 82, value); } + get atoCloseRightDoor() { + return pb_1.Message.getFieldWithDefault(this, 83, false) as boolean; + } + set atoCloseRightDoor(value: boolean) { + pb_1.Message.setField(this, 83, value); + } + get lightAtoSend() { + return pb_1.Message.getFieldWithDefault(this, 84, false) as boolean; + } + set lightAtoSend(value: boolean) { + pb_1.Message.setField(this, 84, value); + } static fromObject(data: { lifeSignal?: number; tc1Active?: boolean; @@ -4175,6 +4195,8 @@ export namespace state { lightDir2?: boolean; lightDriverActive?: boolean; trainConnInitComplate?: boolean; + atoCloseRightDoor?: boolean; + lightAtoSend?: boolean; }): TrainVobcState { const message = new TrainVobcState({}); if (data.lifeSignal != null) { @@ -4411,6 +4433,12 @@ export namespace state { if (data.trainConnInitComplate != null) { message.trainConnInitComplate = data.trainConnInitComplate; } + if (data.atoCloseRightDoor != null) { + message.atoCloseRightDoor = data.atoCloseRightDoor; + } + if (data.lightAtoSend != null) { + message.lightAtoSend = data.lightAtoSend; + } return message; } toObject() { @@ -4493,6 +4521,8 @@ export namespace state { lightDir2?: boolean; lightDriverActive?: boolean; trainConnInitComplate?: boolean; + atoCloseRightDoor?: boolean; + lightAtoSend?: boolean; } = {}; if (this.lifeSignal != null) { data.lifeSignal = this.lifeSignal; @@ -4728,6 +4758,12 @@ export namespace state { if (this.trainConnInitComplate != null) { data.trainConnInitComplate = this.trainConnInitComplate; } + if (this.atoCloseRightDoor != null) { + data.atoCloseRightDoor = this.atoCloseRightDoor; + } + if (this.lightAtoSend != null) { + data.lightAtoSend = this.lightAtoSend; + } return data; } serialize(): Uint8Array; @@ -4890,6 +4926,10 @@ export namespace state { writer.writeBool(81, this.lightDriverActive); if (this.trainConnInitComplate != false) writer.writeBool(82, this.trainConnInitComplate); + if (this.atoCloseRightDoor != false) + writer.writeBool(83, this.atoCloseRightDoor); + if (this.lightAtoSend != false) + writer.writeBool(84, this.lightAtoSend); if (!w) return writer.getResultBuffer(); } @@ -5133,6 +5173,12 @@ export namespace state { case 82: message.trainConnInitComplate = reader.readBool(); break; + case 83: + message.atoCloseRightDoor = reader.readBool(); + break; + case 84: + message.lightAtoSend = reader.readBool(); + break; default: reader.skipField(); } }