From 0244b6775aeef0af70c6bc9e471ecedf79575e2f Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 19 Jul 2023 10:17:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=97=E8=BD=A6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/LineLayout.vue | 29 +++++++++- src/pages/TrainPage.vue | 110 +++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 src/pages/TrainPage.vue diff --git a/src/layouts/LineLayout.vue b/src/layouts/LineLayout.vue index c29e9ae..a3408b2 100644 --- a/src/layouts/LineLayout.vue +++ b/src/layouts/LineLayout.vue @@ -7,6 +7,16 @@ + + +
@@ -14,11 +24,13 @@ diff --git a/src/pages/TrainPage.vue b/src/pages/TrainPage.vue new file mode 100644 index 0000000..2c4aed8 --- /dev/null +++ b/src/pages/TrainPage.vue @@ -0,0 +1,110 @@ + + + From 16d38a4a6cef8ed9db9c3609b6fe49a288733a41 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 19 Jul 2023 10:18:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=90=8C=E6=AD=A5proto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/protos/device_state.ts | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index 7e7b2a4..a32a9ad 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -327,6 +327,73 @@ export namespace state { return SwitchState.deserialize(bytes); } } + export class SignalState extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + id?: string; + }) { + 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; + } + } + } + get id() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set id(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + id?: string; + }): SignalState { + const message = new SignalState({}); + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + id?: string; + } = {}; + if (this.id != null) { + data.id = this.id; + } + 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.length) + writer.writeString(1, this.id); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SignalState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SignalState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.id = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SignalState { + return SignalState.deserialize(bytes); + } + } export class TrainState extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { From cad30db0a7518eeccc3318f692b481b9f2ce00c9 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 19 Jul 2023 10:42:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/lineApp.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drawApp/lineApp.ts b/src/drawApp/lineApp.ts index e2807da..ad73bdd 100644 --- a/src/drawApp/lineApp.ts +++ b/src/drawApp/lineApp.ts @@ -109,6 +109,7 @@ const showType = [ Turnout.Type, Signal.Type, Separator.Type, + Train.Type, ]; const physicShowType = [...showType, Section.Type]; const linkShowType = [...showType, SectionLink.Type, AxleCounting.Type];