rts-sim-testing-client/src/protos/pslGraphics.ts
2023-10-18 14:42:00 +08:00

710 lines
30 KiB
TypeScript

/**
* Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.23.1
* source: pslGraphics.proto
* git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./stationLayoutGraphics";
import * as pb_1 from "google-protobuf";
export namespace pslGraphicData {
export enum PslElementColor {
red = 0,
green = 1,
blue = 2
}
export class PslGraphicStorage extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
canvas?: dependency_1.graphicData.Canvas;
pslLights?: PslLight[];
pslButtons?: PslButton[];
pslKeys?: PslKey[];
pslTexts?: PslText[];
gatedRelateDeviceList?: dependency_1.graphicData.DeviceCombinationtype[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
}
if ("pslLights" in data && data.pslLights != undefined) {
this.pslLights = data.pslLights;
}
if ("pslButtons" in data && data.pslButtons != undefined) {
this.pslButtons = data.pslButtons;
}
if ("pslKeys" in data && data.pslKeys != undefined) {
this.pslKeys = data.pslKeys;
}
if ("pslTexts" in data && data.pslTexts != undefined) {
this.pslTexts = data.pslTexts;
}
if ("gatedRelateDeviceList" in data && data.gatedRelateDeviceList != undefined) {
this.gatedRelateDeviceList = data.gatedRelateDeviceList;
}
}
}
get canvas() {
return pb_1.Message.getWrapperField(this, dependency_1.graphicData.Canvas, 1) as dependency_1.graphicData.Canvas;
}
set canvas(value: dependency_1.graphicData.Canvas) {
pb_1.Message.setWrapperField(this, 1, value);
}
get has_canvas() {
return pb_1.Message.getField(this, 1) != null;
}
get pslLights() {
return pb_1.Message.getRepeatedWrapperField(this, PslLight, 2) as PslLight[];
}
set pslLights(value: PslLight[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
get pslButtons() {
return pb_1.Message.getRepeatedWrapperField(this, PslButton, 3) as PslButton[];
}
set pslButtons(value: PslButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get pslKeys() {
return pb_1.Message.getRepeatedWrapperField(this, PslKey, 4) as PslKey[];
}
set pslKeys(value: PslKey[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get pslTexts() {
return pb_1.Message.getRepeatedWrapperField(this, PslText, 5) as PslText[];
}
set pslTexts(value: PslText[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
get gatedRelateDeviceList() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.DeviceCombinationtype, 6) as dependency_1.graphicData.DeviceCombinationtype[];
}
set gatedRelateDeviceList(value: dependency_1.graphicData.DeviceCombinationtype[]) {
pb_1.Message.setRepeatedWrapperField(this, 6, value);
}
static fromObject(data: {
canvas?: ReturnType<typeof dependency_1.graphicData.Canvas.prototype.toObject>;
pslLights?: ReturnType<typeof PslLight.prototype.toObject>[];
pslButtons?: ReturnType<typeof PslButton.prototype.toObject>[];
pslKeys?: ReturnType<typeof PslKey.prototype.toObject>[];
pslTexts?: ReturnType<typeof PslText.prototype.toObject>[];
gatedRelateDeviceList?: ReturnType<typeof dependency_1.graphicData.DeviceCombinationtype.prototype.toObject>[];
}): PslGraphicStorage {
const message = new PslGraphicStorage({});
if (data.canvas != null) {
message.canvas = dependency_1.graphicData.Canvas.fromObject(data.canvas);
}
if (data.pslLights != null) {
message.pslLights = data.pslLights.map(item => PslLight.fromObject(item));
}
if (data.pslButtons != null) {
message.pslButtons = data.pslButtons.map(item => PslButton.fromObject(item));
}
if (data.pslKeys != null) {
message.pslKeys = data.pslKeys.map(item => PslKey.fromObject(item));
}
if (data.pslTexts != null) {
message.pslTexts = data.pslTexts.map(item => PslText.fromObject(item));
}
if (data.gatedRelateDeviceList != null) {
message.gatedRelateDeviceList = data.gatedRelateDeviceList.map(item => dependency_1.graphicData.DeviceCombinationtype.fromObject(item));
}
return message;
}
toObject() {
const data: {
canvas?: ReturnType<typeof dependency_1.graphicData.Canvas.prototype.toObject>;
pslLights?: ReturnType<typeof PslLight.prototype.toObject>[];
pslButtons?: ReturnType<typeof PslButton.prototype.toObject>[];
pslKeys?: ReturnType<typeof PslKey.prototype.toObject>[];
pslTexts?: ReturnType<typeof PslText.prototype.toObject>[];
gatedRelateDeviceList?: ReturnType<typeof dependency_1.graphicData.DeviceCombinationtype.prototype.toObject>[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
}
if (this.pslLights != null) {
data.pslLights = this.pslLights.map((item: PslLight) => item.toObject());
}
if (this.pslButtons != null) {
data.pslButtons = this.pslButtons.map((item: PslButton) => item.toObject());
}
if (this.pslKeys != null) {
data.pslKeys = this.pslKeys.map((item: PslKey) => item.toObject());
}
if (this.pslTexts != null) {
data.pslTexts = this.pslTexts.map((item: PslText) => item.toObject());
}
if (this.gatedRelateDeviceList != null) {
data.gatedRelateDeviceList = this.gatedRelateDeviceList.map((item: dependency_1.graphicData.DeviceCombinationtype) => 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.pslLights.length)
writer.writeRepeatedMessage(2, this.pslLights, (item: PslLight) => item.serialize(writer));
if (this.pslButtons.length)
writer.writeRepeatedMessage(3, this.pslButtons, (item: PslButton) => item.serialize(writer));
if (this.pslKeys.length)
writer.writeRepeatedMessage(4, this.pslKeys, (item: PslKey) => item.serialize(writer));
if (this.pslTexts.length)
writer.writeRepeatedMessage(5, this.pslTexts, (item: PslText) => item.serialize(writer));
if (this.gatedRelateDeviceList.length)
writer.writeRepeatedMessage(6, this.gatedRelateDeviceList, (item: dependency_1.graphicData.DeviceCombinationtype) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PslGraphicStorage {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PslGraphicStorage();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.canvas, () => message.canvas = dependency_1.graphicData.Canvas.deserialize(reader));
break;
case 2:
reader.readMessage(message.pslLights, () => pb_1.Message.addToRepeatedWrapperField(message, 2, PslLight.deserialize(reader), PslLight));
break;
case 3:
reader.readMessage(message.pslButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 3, PslButton.deserialize(reader), PslButton));
break;
case 4:
reader.readMessage(message.pslKeys, () => pb_1.Message.addToRepeatedWrapperField(message, 4, PslKey.deserialize(reader), PslKey));
break;
case 5:
reader.readMessage(message.pslTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 5, PslText.deserialize(reader), PslText));
break;
case 6:
reader.readMessage(message.gatedRelateDeviceList, () => pb_1.Message.addToRepeatedWrapperField(message, 6, dependency_1.graphicData.DeviceCombinationtype.deserialize(reader), dependency_1.graphicData.DeviceCombinationtype));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): PslGraphicStorage {
return PslGraphicStorage.deserialize(bytes);
}
}
export class PslLight extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.graphicData.CommonInfo;
code?: string;
lightColor?: PslElementColor;
}) {
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 ("lightColor" in data && data.lightColor != undefined) {
this.lightColor = data.lightColor;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.graphicData.CommonInfo, 1) as dependency_1.graphicData.CommonInfo;
}
set common(value: dependency_1.graphicData.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 lightColor() {
return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor;
}
set lightColor(value: PslElementColor) {
pb_1.Message.setField(this, 4, value);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string;
lightColor?: PslElementColor;
}): PslLight {
const message = new PslLight({});
if (data.common != null) {
message.common = dependency_1.graphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
if (data.lightColor != null) {
message.lightColor = data.lightColor;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string;
lightColor?: PslElementColor;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
if (this.lightColor != null) {
data.lightColor = this.lightColor;
}
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.lightColor != PslElementColor.red)
writer.writeEnum(4, this.lightColor);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PslLight {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PslLight();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.graphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
case 4:
message.lightColor = reader.readEnum();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): PslLight {
return PslLight.deserialize(bytes);
}
}
export class PslButton extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.graphicData.CommonInfo;
code?: string;
buttonColor?: PslElementColor;
isSelfReset?: boolean;
}) {
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 ("buttonColor" in data && data.buttonColor != undefined) {
this.buttonColor = data.buttonColor;
}
if ("isSelfReset" in data && data.isSelfReset != undefined) {
this.isSelfReset = data.isSelfReset;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.graphicData.CommonInfo, 1) as dependency_1.graphicData.CommonInfo;
}
set common(value: dependency_1.graphicData.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 buttonColor() {
return pb_1.Message.getFieldWithDefault(this, 4, PslElementColor.red) as PslElementColor;
}
set buttonColor(value: PslElementColor) {
pb_1.Message.setField(this, 4, value);
}
get isSelfReset() {
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
}
set isSelfReset(value: boolean) {
pb_1.Message.setField(this, 5, value);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string;
buttonColor?: PslElementColor;
isSelfReset?: boolean;
}): PslButton {
const message = new PslButton({});
if (data.common != null) {
message.common = dependency_1.graphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
if (data.buttonColor != null) {
message.buttonColor = data.buttonColor;
}
if (data.isSelfReset != null) {
message.isSelfReset = data.isSelfReset;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string;
buttonColor?: PslElementColor;
isSelfReset?: boolean;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
if (this.buttonColor != null) {
data.buttonColor = this.buttonColor;
}
if (this.isSelfReset != null) {
data.isSelfReset = this.isSelfReset;
}
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.buttonColor != PslElementColor.red)
writer.writeEnum(4, this.buttonColor);
if (this.isSelfReset != false)
writer.writeBool(5, this.isSelfReset);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PslButton {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PslButton();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.graphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
case 4:
message.buttonColor = reader.readEnum();
break;
case 5:
message.isSelfReset = reader.readBool();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): PslButton {
return PslButton.deserialize(bytes);
}
}
export class PslKey extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.graphicData.CommonInfo;
code?: 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 ("common" in data && data.common != undefined) {
this.common = data.common;
}
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
}
}
get common() {
return pb_1.Message.getWrapperField(this, dependency_1.graphicData.CommonInfo, 1) as dependency_1.graphicData.CommonInfo;
}
set common(value: dependency_1.graphicData.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);
}
static fromObject(data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string;
}): PslKey {
const message = new PslKey({});
if (data.common != null) {
message.common = dependency_1.graphicData.CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
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 (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PslKey {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PslKey();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.graphicData.CommonInfo.deserialize(reader));
break;
case 2:
message.code = reader.readString();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): PslKey {
return PslKey.deserialize(bytes);
}
}
export class PslText extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: dependency_1.graphicData.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, dependency_1.graphicData.CommonInfo, 1) as dependency_1.graphicData.CommonInfo;
}
set common(value: dependency_1.graphicData.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 dependency_1.graphicData.CommonInfo.prototype.toObject>;
code?: string;
content?: string;
color?: string;
fontSize?: number;
}): PslText {
const message = new PslText({});
if (data.common != null) {
message.common = dependency_1.graphicData.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 dependency_1.graphicData.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): PslText {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PslText();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.common, () => message.common = dependency_1.graphicData.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): PslText {
return PslText.deserialize(bytes);
}
}
}