From 05faded0a3c59f19cf9e05def8ed4ddcb78cf8bd Mon Sep 17 00:00:00 2001 From: fan Date: Sat, 14 Sep 2024 15:31:17 +0800 Subject: [PATCH] =?UTF-8?q?proto=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtss-proto-msg | 2 +- src/protos/fire_alarm_graphic_data.ts | 248 ++++++++++++++++++++++++++ src/protos/iscs_graphic_data.ts | 187 ++++++++++++++++++- 3 files changed, 435 insertions(+), 2 deletions(-) create mode 100644 src/protos/fire_alarm_graphic_data.ts diff --git a/rtss-proto-msg b/rtss-proto-msg index d5735a5..62dc244 160000 --- a/rtss-proto-msg +++ b/rtss-proto-msg @@ -1 +1 @@ -Subproject commit d5735a58f40f7e013e4a4789e47b46e6f3f99adc +Subproject commit 62dc244c9214c0f8095a54cd6e745cc1105b0c3c diff --git a/src/protos/fire_alarm_graphic_data.ts b/src/protos/fire_alarm_graphic_data.ts new file mode 100644 index 0000000..e4f0cb5 --- /dev/null +++ b/src/protos/fire_alarm_graphic_data.ts @@ -0,0 +1,248 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 5.27.4 + * source: fire_alarm_graphic_data.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./iscs_graphic_data"; +import * as pb_1 from "google-protobuf"; +export namespace FireAlarmGraphicData { + export class CCTVGraphicStorage extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + canvas?: dependency_1.iscsGraphicData.Canvas; + arrows?: dependency_1.iscsGraphicData.Arrow[]; + iscsTexts?: dependency_1.iscsGraphicData.IscsText[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("canvas" in data && data.canvas != undefined) { + this.canvas = data.canvas; + } + if ("arrows" in data && data.arrows != undefined) { + this.arrows = data.arrows; + } + if ("iscsTexts" in data && data.iscsTexts != undefined) { + this.iscsTexts = data.iscsTexts; + } + } + } + get canvas() { + return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.Canvas, 1) as dependency_1.iscsGraphicData.Canvas; + } + set canvas(value: dependency_1.iscsGraphicData.Canvas) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_canvas() { + return pb_1.Message.getField(this, 1) != null; + } + get arrows() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.iscsGraphicData.Arrow, 2) as dependency_1.iscsGraphicData.Arrow[]; + } + set arrows(value: dependency_1.iscsGraphicData.Arrow[]) { + pb_1.Message.setRepeatedWrapperField(this, 2, value); + } + get iscsTexts() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.iscsGraphicData.IscsText, 3) as dependency_1.iscsGraphicData.IscsText[]; + } + set iscsTexts(value: dependency_1.iscsGraphicData.IscsText[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + canvas?: ReturnType; + arrows?: ReturnType[]; + iscsTexts?: ReturnType[]; + }): CCTVGraphicStorage { + const message = new CCTVGraphicStorage({}); + if (data.canvas != null) { + message.canvas = dependency_1.iscsGraphicData.Canvas.fromObject(data.canvas); + } + if (data.arrows != null) { + message.arrows = data.arrows.map(item => dependency_1.iscsGraphicData.Arrow.fromObject(item)); + } + if (data.iscsTexts != null) { + message.iscsTexts = data.iscsTexts.map(item => dependency_1.iscsGraphicData.IscsText.fromObject(item)); + } + return message; + } + toObject() { + const data: { + canvas?: ReturnType; + arrows?: ReturnType[]; + iscsTexts?: ReturnType[]; + } = {}; + if (this.canvas != null) { + data.canvas = this.canvas.toObject(); + } + if (this.arrows != null) { + data.arrows = this.arrows.map((item: dependency_1.iscsGraphicData.Arrow) => item.toObject()); + } + if (this.iscsTexts != null) { + data.iscsTexts = this.iscsTexts.map((item: dependency_1.iscsGraphicData.IscsText) => item.toObject()); + } + 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.has_canvas) + writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer)); + if (this.arrows.length) + writer.writeRepeatedMessage(2, this.arrows, (item: dependency_1.iscsGraphicData.Arrow) => item.serialize(writer)); + if (this.iscsTexts.length) + writer.writeRepeatedMessage(3, this.iscsTexts, (item: dependency_1.iscsGraphicData.IscsText) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CCTVGraphicStorage { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CCTVGraphicStorage(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.canvas, () => message.canvas = dependency_1.iscsGraphicData.Canvas.deserialize(reader)); + break; + case 2: + reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_1.iscsGraphicData.Arrow.deserialize(reader), dependency_1.iscsGraphicData.Arrow)); + break; + case 3: + reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.iscsGraphicData.IscsText.deserialize(reader), dependency_1.iscsGraphicData.IscsText)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CCTVGraphicStorage { + return CCTVGraphicStorage.deserialize(bytes); + } + } + export class CCTVButton extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common?: dependency_1.iscsGraphicData.CommonInfo; + code?: string; + buttonType?: CCTVButton.ButtonType; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("buttonType" in data && data.buttonType != undefined) { + this.buttonType = data.buttonType; + } + } + } + get common() { + return pb_1.Message.getWrapperField(this, dependency_1.iscsGraphicData.CommonInfo, 1) as dependency_1.iscsGraphicData.CommonInfo; + } + set common(value: dependency_1.iscsGraphicData.CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get buttonType() { + return pb_1.Message.getFieldWithDefault(this, 3, CCTVButton.ButtonType.rect) as CCTVButton.ButtonType; + } + set buttonType(value: CCTVButton.ButtonType) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + buttonType?: CCTVButton.ButtonType; + }): CCTVButton { + const message = new CCTVButton({}); + if (data.common != null) { + message.common = dependency_1.iscsGraphicData.CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.buttonType != null) { + message.buttonType = data.buttonType; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + buttonType?: CCTVButton.ButtonType; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.buttonType != null) { + data.buttonType = this.buttonType; + } + 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.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.buttonType != CCTVButton.ButtonType.rect) + writer.writeEnum(3, this.buttonType); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CCTVButton { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CCTVButton(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = dependency_1.iscsGraphicData.CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.buttonType = reader.readEnum(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CCTVButton { + return CCTVButton.deserialize(bytes); + } + } + export namespace CCTVButton { + export enum ButtonType { + rect = 0, + monitor = 1, + semicircle = 2 + } + } +} diff --git a/src/protos/iscs_graphic_data.ts b/src/protos/iscs_graphic_data.ts index 49436ec..fb25bbf 100644 --- a/src/protos/iscs_graphic_data.ts +++ b/src/protos/iscs_graphic_data.ts @@ -11,9 +11,10 @@ export namespace iscsGraphicData { canvas?: Canvas; UniqueIdPrefix?: UniqueIdOfStationLayout; arrows?: Arrow[]; + iscsTexts?: IscsText[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("canvas" in data && data.canvas != undefined) { this.canvas = data.canvas; @@ -24,6 +25,9 @@ export namespace iscsGraphicData { if ("arrows" in data && data.arrows != undefined) { this.arrows = data.arrows; } + if ("iscsTexts" in data && data.iscsTexts != undefined) { + this.iscsTexts = data.iscsTexts; + } } } get canvas() { @@ -50,10 +54,17 @@ export namespace iscsGraphicData { set arrows(value: Arrow[]) { pb_1.Message.setRepeatedWrapperField(this, 3, value); } + get iscsTexts() { + return pb_1.Message.getRepeatedWrapperField(this, IscsText, 4) as IscsText[]; + } + set iscsTexts(value: IscsText[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } static fromObject(data: { canvas?: ReturnType; UniqueIdPrefix?: ReturnType; arrows?: ReturnType[]; + iscsTexts?: ReturnType[]; }): IscsGraphicStorage { const message = new IscsGraphicStorage({}); if (data.canvas != null) { @@ -65,6 +76,9 @@ export namespace iscsGraphicData { if (data.arrows != null) { message.arrows = data.arrows.map(item => Arrow.fromObject(item)); } + if (data.iscsTexts != null) { + message.iscsTexts = data.iscsTexts.map(item => IscsText.fromObject(item)); + } return message; } toObject() { @@ -72,6 +86,7 @@ export namespace iscsGraphicData { canvas?: ReturnType; UniqueIdPrefix?: ReturnType; arrows?: ReturnType[]; + iscsTexts?: ReturnType[]; } = {}; if (this.canvas != null) { data.canvas = this.canvas.toObject(); @@ -82,6 +97,9 @@ export namespace iscsGraphicData { if (this.arrows != null) { data.arrows = this.arrows.map((item: Arrow) => item.toObject()); } + if (this.iscsTexts != null) { + data.iscsTexts = this.iscsTexts.map((item: IscsText) => item.toObject()); + } return data; } serialize(): Uint8Array; @@ -94,6 +112,8 @@ export namespace iscsGraphicData { writer.writeMessage(2, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer)); if (this.arrows.length) writer.writeRepeatedMessage(3, this.arrows, (item: Arrow) => item.serialize(writer)); + if (this.iscsTexts.length) + writer.writeRepeatedMessage(4, this.iscsTexts, (item: IscsText) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -112,6 +132,9 @@ export namespace iscsGraphicData { case 3: reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Arrow.deserialize(reader), Arrow)); break; + case 4: + reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 4, IscsText.deserialize(reader), IscsText)); + break; default: reader.skipField(); } } @@ -1098,4 +1121,166 @@ export namespace iscsGraphicData { return Arrow.deserialize(bytes); } } + export class IscsText extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common?: CommonInfo; + code?: string; + content?: string; + color?: string; + fontSize?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common" in data && data.common != undefined) { + this.common = data.common; + } + if ("code" in data && data.code != undefined) { + this.code = data.code; + } + if ("content" in data && data.content != undefined) { + this.content = data.content; + } + if ("color" in data && data.color != undefined) { + this.color = data.color; + } + if ("fontSize" in data && data.fontSize != undefined) { + this.fontSize = data.fontSize; + } + } + } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + } + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get content() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set content(value: string) { + pb_1.Message.setField(this, 3, value); + } + get color() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set color(value: string) { + pb_1.Message.setField(this, 4, value); + } + get fontSize() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set fontSize(value: number) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + content?: string; + color?: string; + fontSize?: number; + }): IscsText { + const message = new IscsText({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.content != null) { + message.content = data.content; + } + if (data.color != null) { + message.color = data.color; + } + if (data.fontSize != null) { + message.fontSize = data.fontSize; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + content?: string; + color?: string; + fontSize?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.content != null) { + data.content = this.content; + } + if (this.color != null) { + data.color = this.color; + } + if (this.fontSize != null) { + data.fontSize = this.fontSize; + } + 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.has_common) + writer.writeMessage(1, this.common, () => this.common.serialize(writer)); + if (this.code.length) + writer.writeString(2, this.code); + if (this.content.length) + writer.writeString(3, this.content); + if (this.color.length) + writer.writeString(4, this.color); + if (this.fontSize != 0) + writer.writeInt32(5, this.fontSize); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IscsText { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IscsText(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.content = reader.readString(); + break; + case 4: + message.color = reader.readString(); + break; + case 5: + message.fontSize = reader.readInt32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): IscsText { + return IscsText.deserialize(bytes); + } + } }