同步proto

This commit is contained in:
fan 2024-09-13 16:36:56 +08:00
parent 096a2828e7
commit 9e83e1436d
2 changed files with 141 additions and 2 deletions

@ -1 +1 @@
Subproject commit d4a3340f7cee52ce5dc0c5ad4cdbe9cbe5a1d414
Subproject commit d5735a58f40f7e013e4a4789e47b46e6f3f99adc

View File

@ -10,9 +10,10 @@ export namespace iscsGraphicData {
constructor(data?: any[] | {
canvas?: Canvas;
UniqueIdPrefix?: UniqueIdOfStationLayout;
arrows?: Arrow[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
@ -20,6 +21,9 @@ export namespace iscsGraphicData {
if ("UniqueIdPrefix" in data && data.UniqueIdPrefix != undefined) {
this.UniqueIdPrefix = data.UniqueIdPrefix;
}
if ("arrows" in data && data.arrows != undefined) {
this.arrows = data.arrows;
}
}
}
get canvas() {
@ -40,9 +44,16 @@ export namespace iscsGraphicData {
get has_UniqueIdPrefix() {
return pb_1.Message.getField(this, 2) != null;
}
get arrows() {
return pb_1.Message.getRepeatedWrapperField(this, Arrow, 3) as Arrow[];
}
set arrows(value: Arrow[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
static fromObject(data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
}): IscsGraphicStorage {
const message = new IscsGraphicStorage({});
if (data.canvas != null) {
@ -51,12 +62,16 @@ export namespace iscsGraphicData {
if (data.UniqueIdPrefix != null) {
message.UniqueIdPrefix = UniqueIdOfStationLayout.fromObject(data.UniqueIdPrefix);
}
if (data.arrows != null) {
message.arrows = data.arrows.map(item => Arrow.fromObject(item));
}
return message;
}
toObject() {
const data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
UniqueIdPrefix?: ReturnType<typeof UniqueIdOfStationLayout.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@ -64,6 +79,9 @@ export namespace iscsGraphicData {
if (this.UniqueIdPrefix != null) {
data.UniqueIdPrefix = this.UniqueIdPrefix.toObject();
}
if (this.arrows != null) {
data.arrows = this.arrows.map((item: Arrow) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
@ -74,6 +92,8 @@ export namespace iscsGraphicData {
writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer));
if (this.has_UniqueIdPrefix)
writer.writeMessage(2, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer));
if (this.arrows.length)
writer.writeRepeatedMessage(3, this.arrows, (item: Arrow) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -89,6 +109,9 @@ export namespace iscsGraphicData {
case 2:
reader.readMessage(message.UniqueIdPrefix, () => message.UniqueIdPrefix = UniqueIdOfStationLayout.deserialize(reader));
break;
case 3:
reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Arrow.deserialize(reader), Arrow));
break;
default: reader.skipField();
}
}
@ -959,4 +982,120 @@ export namespace iscsGraphicData {
return UniqueIdOfStationLayout.deserialize(bytes);
}
}
export class Arrow extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
points?: Point[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], 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 ("points" in data && data.points != undefined) {
this.points = data.points;
}
}
}
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 points() {
return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[];
}
set points(value: Point[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
points?: ReturnType<typeof Point.prototype.toObject>[];
}): Arrow {
const message = new Arrow({});
if (data.common != null) {
message.common = CommonInfo.fromObject(data.common);
}
if (data.code != null) {
message.code = data.code;
}
if (data.points != null) {
message.points = data.points.map(item => Point.fromObject(item));
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
points?: ReturnType<typeof Point.prototype.toObject>[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
}
if (this.code != null) {
data.code = this.code;
}
if (this.points != null) {
data.points = this.points.map((item: Point) => 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_common)
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.points.length)
writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Arrow {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Arrow();
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:
reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): Arrow {
return Arrow.deserialize(bytes);
}
}
}