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]; 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 @@ + + + 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[] | {