proto同步

This commit is contained in:
fan 2024-09-14 15:31:17 +08:00
parent 5453c9828e
commit 05faded0a3
3 changed files with 435 additions and 2 deletions

@ -1 +1 @@
Subproject commit d5735a58f40f7e013e4a4789e47b46e6f3f99adc
Subproject commit 62dc244c9214c0f8095a54cd6e745cc1105b0c3c

View File

@ -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<typeof dependency_1.iscsGraphicData.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof dependency_1.iscsGraphicData.Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof dependency_1.iscsGraphicData.IscsText.prototype.toObject>[];
}): 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<typeof dependency_1.iscsGraphicData.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof dependency_1.iscsGraphicData.Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof dependency_1.iscsGraphicData.IscsText.prototype.toObject>[];
} = {};
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<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
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<typeof dependency_1.iscsGraphicData.CommonInfo.prototype.toObject>;
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
}
}
}

View File

@ -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<typeof Canvas.prototype.toObject>;
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
}): 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<typeof Canvas.prototype.toObject>;
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
} = {};
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<typeof CommonInfo.prototype.toObject>;
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<typeof CommonInfo.prototype.toObject>;
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);
}
}
}