From e6b0557b1bfaf7ddecded852532c2add81bf1e14 Mon Sep 17 00:00:00 2001 From: fan Date: Mon, 29 Jan 2024 13:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BD=A6=E8=AE=BE=E7=BD=AE=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=B0=83=E6=95=B4&=E7=8A=B6=E6=80=81=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bj-rtss-message | 2 +- .../draw-app/dialogs/SetTrainParam.vue | 298 ++++++++++++------ src/components/line-app/infos/TrainInfo.vue | 238 ++++++++------ src/drawApp/graphics/TrainInteraction.ts | 36 +++ src/graphics/train/Train.ts | 12 + src/protos/common_data.ts | 69 ++++ src/protos/device_state.ts | 115 +++++++ 7 files changed, 585 insertions(+), 185 deletions(-) diff --git a/bj-rtss-message b/bj-rtss-message index 11e81fe..099d395 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 11e81fe6e710fea687f038f64a7199f0ead6a23e +Subproject commit 099d39589833465c09f01d83cd31d3f063b43089 diff --git a/src/components/draw-app/dialogs/SetTrainParam.vue b/src/components/draw-app/dialogs/SetTrainParam.vue index 998dbd7..446a72c 100644 --- a/src/components/draw-app/dialogs/SetTrainParam.vue +++ b/src/components/draw-app/dialogs/SetTrainParam.vue @@ -4,54 +4,100 @@ seamless title="列车设置" v-model="showTrainParamOperation" - :width="900" + :width="1000" :height="722" > - +
1端
-
-
- +
雷达
+
+
+
+ +
+
+ +
+
+ +
-
- +
+
速传
+
+
+
+ +
+
+ +
-
- -
-
- -
-
- +
+
加速度计
+
+
+
+ +
+
+ +
+
+ +
@@ -59,45 +105,91 @@
2端
-
-
- +
雷达
+
+
+
+ +
+
+ +
+
+ +
-
- +
+
速传
+
+
+
+ +
+
+ +
-
- -
-
- -
-
- +
+
加速度计
+
+
+
+ +
+
+ +
+
+ +
@@ -106,7 +198,7 @@
基本参数
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
故障
-
+
-
+
-
+
-
+
-
+
- + diff --git a/src/drawApp/graphics/TrainInteraction.ts b/src/drawApp/graphics/TrainInteraction.ts index ce1cbc8..fd37d92 100644 --- a/src/drawApp/graphics/TrainInteraction.ts +++ b/src/drawApp/graphics/TrainInteraction.ts @@ -534,6 +534,42 @@ export class TrainState extends GraphicStateBase implements ITrainState { set bRadarCheckTime(v: number) { this.states.trainEndsB.radarCheckTime = v; } + get aAccEnable(): boolean { + return this.states.trainEndsA.accEnable; + } + set aAccEnable(v: boolean) { + this.states.trainEndsA.accEnable = v; + } + get aAccCheckTime(): number { + return this.states.trainEndsA.accCheckTime; + } + set aAccCheckTime(v: number) { + this.states.trainEndsA.accCheckTime = v; + } + get aAccCheckSpeedDiff(): number { + return +this.states.trainEndsA.accCheckSpeedDiff; + } + set aAccCheckSpeedDiff(v: number) { + this.states.trainEndsA.accCheckSpeedDiff = v + ''; + } + get bAccEnable(): boolean { + return this.states.trainEndsB.accEnable; + } + set bAccEnable(v: boolean) { + this.states.trainEndsB.accEnable = v; + } + get bAccCheckTime(): number { + return this.states.trainEndsB.accCheckTime; + } + set bAccCheckTime(v: number) { + this.states.trainEndsB.accCheckTime = v; + } + get bAccCheckSpeedDiff(): number { + return +this.states.trainEndsB.accCheckSpeedDiff; + } + set bAccCheckSpeedDiff(v: number) { + this.states.trainEndsB.accCheckSpeedDiff = v + ''; + } clone(): TrainState { return new TrainState(this.states.cloneMessage()); } diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index 8ae0d27..8a3a513 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -193,6 +193,18 @@ export interface ITrainState extends GraphicState { set bRadarCheckSpeedDiff(v: number); get bRadarCheckTime(): number; set bRadarCheckTime(v: number); + get aAccEnable(): boolean; + set aAccEnable(v: boolean); + get aAccCheckSpeedDiff(): number; + set aAccCheckSpeedDiff(v: number); + get aAccCheckTime(): number; + set aAccCheckTime(v: number); + get bAccEnable(): boolean; + set bAccEnable(v: boolean); + get bAccCheckSpeedDiff(): number; + set bAccCheckSpeedDiff(v: number); + get bAccCheckTime(): number; + set bAccCheckTime(v: number); } interface bodyWH { width: number; // 宽 diff --git a/src/protos/common_data.ts b/src/protos/common_data.ts index 89e5a48..430157e 100644 --- a/src/protos/common_data.ts +++ b/src/protos/common_data.ts @@ -356,6 +356,9 @@ export namespace common { radarEnable?: boolean; radarCheckSpeedDiff?: number; radarCheckTime?: number; + accEnable?: boolean; + accCheckSpeedDiff?: number; + accCheckTime?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -375,6 +378,15 @@ export namespace common { if ("radarCheckTime" in data && data.radarCheckTime != undefined) { this.radarCheckTime = data.radarCheckTime; } + if ("accEnable" in data && data.accEnable != undefined) { + this.accEnable = data.accEnable; + } + if ("accCheckSpeedDiff" in data && data.accCheckSpeedDiff != undefined) { + this.accCheckSpeedDiff = data.accCheckSpeedDiff; + } + if ("accCheckTime" in data && data.accCheckTime != undefined) { + this.accCheckTime = data.accCheckTime; + } } } get speedSensorEnableA() { @@ -407,12 +419,33 @@ export namespace common { set radarCheckTime(value: number) { pb_1.Message.setField(this, 5, value); } + get accEnable() { + return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; + } + set accEnable(value: boolean) { + pb_1.Message.setField(this, 6, value); + } + get accCheckSpeedDiff() { + return pb_1.Message.getFieldWithDefault(this, 7, 0) as number; + } + set accCheckSpeedDiff(value: number) { + pb_1.Message.setField(this, 7, value); + } + get accCheckTime() { + return pb_1.Message.getFieldWithDefault(this, 8, 0) as number; + } + set accCheckTime(value: number) { + pb_1.Message.setField(this, 8, value); + } static fromObject(data: { speedSensorEnableA?: boolean; speedSensorEnableB?: boolean; radarEnable?: boolean; radarCheckSpeedDiff?: number; radarCheckTime?: number; + accEnable?: boolean; + accCheckSpeedDiff?: number; + accCheckTime?: number; }): TrainEndsState { const message = new TrainEndsState({}); if (data.speedSensorEnableA != null) { @@ -430,6 +463,15 @@ export namespace common { if (data.radarCheckTime != null) { message.radarCheckTime = data.radarCheckTime; } + if (data.accEnable != null) { + message.accEnable = data.accEnable; + } + if (data.accCheckSpeedDiff != null) { + message.accCheckSpeedDiff = data.accCheckSpeedDiff; + } + if (data.accCheckTime != null) { + message.accCheckTime = data.accCheckTime; + } return message; } toObject() { @@ -439,6 +481,9 @@ export namespace common { radarEnable?: boolean; radarCheckSpeedDiff?: number; radarCheckTime?: number; + accEnable?: boolean; + accCheckSpeedDiff?: number; + accCheckTime?: number; } = {}; if (this.speedSensorEnableA != null) { data.speedSensorEnableA = this.speedSensorEnableA; @@ -455,6 +500,15 @@ export namespace common { if (this.radarCheckTime != null) { data.radarCheckTime = this.radarCheckTime; } + if (this.accEnable != null) { + data.accEnable = this.accEnable; + } + if (this.accCheckSpeedDiff != null) { + data.accCheckSpeedDiff = this.accCheckSpeedDiff; + } + if (this.accCheckTime != null) { + data.accCheckTime = this.accCheckTime; + } return data; } serialize(): Uint8Array; @@ -471,6 +525,12 @@ export namespace common { writer.writeFloat(4, this.radarCheckSpeedDiff); if (this.radarCheckTime != 0) writer.writeInt32(5, this.radarCheckTime); + if (this.accEnable != false) + writer.writeBool(6, this.accEnable); + if (this.accCheckSpeedDiff != 0) + writer.writeFloat(7, this.accCheckSpeedDiff); + if (this.accCheckTime != 0) + writer.writeInt32(8, this.accCheckTime); if (!w) return writer.getResultBuffer(); } @@ -495,6 +555,15 @@ export namespace common { case 5: message.radarCheckTime = reader.readInt32(); break; + case 6: + message.accEnable = reader.readBool(); + break; + case 7: + message.accCheckSpeedDiff = reader.readFloat(); + break; + case 8: + message.accCheckTime = reader.readInt32(); + break; default: reader.skipField(); } } diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index 67c2283..10a8ab8 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -1536,6 +1536,7 @@ export namespace state { tailRadarSpeed?: number; udpInterruption?: boolean; acceleration?: number; + Displacement?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6], this.#one_of_decls); @@ -1606,6 +1607,9 @@ export namespace state { if ("acceleration" in data && data.acceleration != undefined) { this.acceleration = data.acceleration; } + if ("Displacement" in data && data.Displacement != undefined) { + this.Displacement = data.Displacement; + } } } get heartbeat() { @@ -1740,6 +1744,12 @@ export namespace state { set acceleration(value: number) { pb_1.Message.setField(this, 22, value); } + get Displacement() { + return pb_1.Message.getFieldWithDefault(this, 23, 0) as number; + } + set Displacement(value: number) { + pb_1.Message.setField(this, 23, value); + } static fromObject(data: { heartbeat?: number; headLinkId?: string; @@ -1763,6 +1773,7 @@ export namespace state { tailRadarSpeed?: number; udpInterruption?: boolean; acceleration?: number; + Displacement?: number; }): TrainDynamicState { const message = new TrainDynamicState({}); if (data.heartbeat != null) { @@ -1831,6 +1842,9 @@ export namespace state { if (data.acceleration != null) { message.acceleration = data.acceleration; } + if (data.Displacement != null) { + message.Displacement = data.Displacement; + } return message; } toObject() { @@ -1857,6 +1871,7 @@ export namespace state { tailRadarSpeed?: number; udpInterruption?: boolean; acceleration?: number; + Displacement?: number; } = {}; if (this.heartbeat != null) { data.heartbeat = this.heartbeat; @@ -1924,6 +1939,9 @@ export namespace state { if (this.acceleration != null) { data.acceleration = this.acceleration; } + if (this.Displacement != null) { + data.Displacement = this.Displacement; + } return data; } serialize(): Uint8Array; @@ -1974,6 +1992,8 @@ export namespace state { writer.writeBool(21, this.udpInterruption); if (this.acceleration != 0) writer.writeFloat(22, this.acceleration); + if (this.Displacement != 0) + writer.writeInt32(23, this.Displacement); if (!w) return writer.getResultBuffer(); } @@ -2049,6 +2069,9 @@ export namespace state { case 22: message.acceleration = reader.readFloat(); break; + case 23: + message.Displacement = reader.readInt32(); + break; default: reader.skipField(); } } @@ -2770,6 +2793,7 @@ export namespace state { trainDynamicConfig?: TrainDynamicConfigMqtt; trainEndsA?: TrainEndsStateMqtt; trainEndsB?: TrainEndsStateMqtt; + Displacement?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [20], this.#one_of_decls); @@ -2966,6 +2990,9 @@ export namespace state { if ("trainEndsB" in data && data.trainEndsB != undefined) { this.trainEndsB = data.trainEndsB; } + if ("Displacement" in data && data.Displacement != undefined) { + this.Displacement = data.Displacement; + } } } get id() { @@ -3361,6 +3388,12 @@ export namespace state { get has_trainEndsB() { return pb_1.Message.getField(this, 64) != null; } + get Displacement() { + return pb_1.Message.getFieldWithDefault(this, 65, 0) as number; + } + set Displacement(value: number) { + pb_1.Message.setField(this, 65, value); + } static fromObject(data: { id?: string; up?: boolean; @@ -3426,6 +3459,7 @@ export namespace state { trainDynamicConfig?: ReturnType; trainEndsA?: ReturnType; trainEndsB?: ReturnType; + Displacement?: number; }): TrainMapState { const message = new TrainMapState({}); if (data.id != null) { @@ -3620,6 +3654,9 @@ export namespace state { if (data.trainEndsB != null) { message.trainEndsB = TrainEndsStateMqtt.fromObject(data.trainEndsB); } + if (data.Displacement != null) { + message.Displacement = data.Displacement; + } return message; } toObject() { @@ -3688,6 +3725,7 @@ export namespace state { trainDynamicConfig?: ReturnType; trainEndsA?: ReturnType; trainEndsB?: ReturnType; + Displacement?: number; } = {}; if (this.id != null) { data.id = this.id; @@ -3881,6 +3919,9 @@ export namespace state { if (this.trainEndsB != null) { data.trainEndsB = this.trainEndsB.toObject(); } + if (this.Displacement != null) { + data.Displacement = this.Displacement; + } return data; } serialize(): Uint8Array; @@ -4015,6 +4056,8 @@ export namespace state { writer.writeMessage(63, this.trainEndsA, () => this.trainEndsA.serialize(writer)); if (this.has_trainEndsB) writer.writeMessage(64, this.trainEndsB, () => this.trainEndsB.serialize(writer)); + if (this.Displacement != 0) + writer.writeInt32(65, this.Displacement); if (!w) return writer.getResultBuffer(); } @@ -4216,6 +4259,9 @@ export namespace state { case 64: reader.readMessage(message.trainEndsB, () => message.trainEndsB = TrainEndsStateMqtt.deserialize(reader)); break; + case 65: + message.Displacement = reader.readInt32(); + break; default: reader.skipField(); } } @@ -4579,6 +4625,9 @@ export namespace state { radarEnable?: boolean; radarCheckSpeedDiff?: string; radarCheckTime?: number; + accEnable?: boolean; + accCheckSpeedDiff?: string; + accCheckTime?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -4598,6 +4647,15 @@ export namespace state { if ("radarCheckTime" in data && data.radarCheckTime != undefined) { this.radarCheckTime = data.radarCheckTime; } + if ("accEnable" in data && data.accEnable != undefined) { + this.accEnable = data.accEnable; + } + if ("accCheckSpeedDiff" in data && data.accCheckSpeedDiff != undefined) { + this.accCheckSpeedDiff = data.accCheckSpeedDiff; + } + if ("accCheckTime" in data && data.accCheckTime != undefined) { + this.accCheckTime = data.accCheckTime; + } } } get speedSensorEnableA() { @@ -4630,12 +4688,33 @@ export namespace state { set radarCheckTime(value: number) { pb_1.Message.setField(this, 5, value); } + get accEnable() { + return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; + } + set accEnable(value: boolean) { + pb_1.Message.setField(this, 6, value); + } + get accCheckSpeedDiff() { + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; + } + set accCheckSpeedDiff(value: string) { + pb_1.Message.setField(this, 7, value); + } + get accCheckTime() { + return pb_1.Message.getFieldWithDefault(this, 8, 0) as number; + } + set accCheckTime(value: number) { + pb_1.Message.setField(this, 8, value); + } static fromObject(data: { speedSensorEnableA?: boolean; speedSensorEnableB?: boolean; radarEnable?: boolean; radarCheckSpeedDiff?: string; radarCheckTime?: number; + accEnable?: boolean; + accCheckSpeedDiff?: string; + accCheckTime?: number; }): TrainEndsStateMqtt { const message = new TrainEndsStateMqtt({}); if (data.speedSensorEnableA != null) { @@ -4653,6 +4732,15 @@ export namespace state { if (data.radarCheckTime != null) { message.radarCheckTime = data.radarCheckTime; } + if (data.accEnable != null) { + message.accEnable = data.accEnable; + } + if (data.accCheckSpeedDiff != null) { + message.accCheckSpeedDiff = data.accCheckSpeedDiff; + } + if (data.accCheckTime != null) { + message.accCheckTime = data.accCheckTime; + } return message; } toObject() { @@ -4662,6 +4750,9 @@ export namespace state { radarEnable?: boolean; radarCheckSpeedDiff?: string; radarCheckTime?: number; + accEnable?: boolean; + accCheckSpeedDiff?: string; + accCheckTime?: number; } = {}; if (this.speedSensorEnableA != null) { data.speedSensorEnableA = this.speedSensorEnableA; @@ -4678,6 +4769,15 @@ export namespace state { if (this.radarCheckTime != null) { data.radarCheckTime = this.radarCheckTime; } + if (this.accEnable != null) { + data.accEnable = this.accEnable; + } + if (this.accCheckSpeedDiff != null) { + data.accCheckSpeedDiff = this.accCheckSpeedDiff; + } + if (this.accCheckTime != null) { + data.accCheckTime = this.accCheckTime; + } return data; } serialize(): Uint8Array; @@ -4694,6 +4794,12 @@ export namespace state { writer.writeString(4, this.radarCheckSpeedDiff); if (this.radarCheckTime != 0) writer.writeInt32(5, this.radarCheckTime); + if (this.accEnable != false) + writer.writeBool(6, this.accEnable); + if (this.accCheckSpeedDiff.length) + writer.writeString(7, this.accCheckSpeedDiff); + if (this.accCheckTime != 0) + writer.writeInt32(8, this.accCheckTime); if (!w) return writer.getResultBuffer(); } @@ -4718,6 +4824,15 @@ export namespace state { case 5: message.radarCheckTime = reader.readInt32(); break; + case 6: + message.accEnable = reader.readBool(); + break; + case 7: + message.accCheckSpeedDiff = reader.readString(); + break; + case 8: + message.accCheckTime = reader.readInt32(); + break; default: reader.skipField(); } }