车站关联的设备转int

This commit is contained in:
joylink_zhaoerwei 2023-12-12 18:03:53 +08:00
parent 7a069b955e
commit 7a0b650e52
2 changed files with 37 additions and 32 deletions

View File

@ -497,6 +497,11 @@ export function saveCommonDrawDatas(app: IDrawApp) {
storage.otherLineList.forEach((item) => {
item.newids = item.ids.map((item) => +item);
});
storage.stationRelateDeviceList.forEach((item) => {
item.combinationtypes.forEach((itemB) => {
itemB.newrefDevices = itemB.refDevices.map((item) => +item);
});
});
return storage;
}

View File

@ -2904,7 +2904,7 @@ export namespace graphicData {
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
sectionId?: string;
sectionId?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -2936,15 +2936,15 @@ export namespace graphicData {
pb_1.Message.setField(this, 2, value);
}
get sectionId() {
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set sectionId(value: string) {
set sectionId(value: number) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
sectionId?: string;
sectionId?: number;
}): TrainWindow {
const message = new TrainWindow({});
if (data.common != null) {
@ -2962,7 +2962,7 @@ export namespace graphicData {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
sectionId?: string;
sectionId?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -2983,8 +2983,8 @@ export namespace graphicData {
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.sectionId.length)
writer.writeString(3, this.sectionId);
if (this.sectionId != 0)
writer.writeInt32(3, this.sectionId);
if (!w)
return writer.getResultBuffer();
}
@ -3001,7 +3001,7 @@ export namespace graphicData {
message.code = reader.readString();
break;
case 3:
message.sectionId = reader.readString();
message.sectionId = reader.readInt32();
break;
default: reader.skipField();
}
@ -7036,7 +7036,6 @@ export namespace graphicData {
refScreenDoor?: string;
refGatedBoxMapCode?: string;
newrefScreenDoor?: number;
newrefGatedBoxMapCode?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -7059,9 +7058,6 @@ export namespace graphicData {
if ("newrefScreenDoor" in data && data.newrefScreenDoor != undefined) {
this.newrefScreenDoor = data.newrefScreenDoor;
}
if ("newrefGatedBoxMapCode" in data && data.newrefGatedBoxMapCode != undefined) {
this.newrefGatedBoxMapCode = data.newrefGatedBoxMapCode;
}
}
}
get common() {
@ -7103,12 +7099,6 @@ export namespace graphicData {
set newrefScreenDoor(value: number) {
pb_1.Message.setField(this, 7, value);
}
get newrefGatedBoxMapCode() {
return pb_1.Message.getFieldWithDefault(this, 8, 0) as number;
}
set newrefGatedBoxMapCode(value: number) {
pb_1.Message.setField(this, 8, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
@ -7116,7 +7106,6 @@ export namespace graphicData {
refScreenDoor?: string;
refGatedBoxMapCode?: string;
newrefScreenDoor?: number;
newrefGatedBoxMapCode?: number;
}): GatedBox {
const message = new GatedBox({});
if (data.common != null) {
@ -7137,9 +7126,6 @@ export namespace graphicData {
if (data.newrefScreenDoor != null) {
message.newrefScreenDoor = data.newrefScreenDoor;
}
if (data.newrefGatedBoxMapCode != null) {
message.newrefGatedBoxMapCode = data.newrefGatedBoxMapCode;
}
return message;
}
toObject() {
@ -7150,7 +7136,6 @@ export namespace graphicData {
refScreenDoor?: string;
refGatedBoxMapCode?: string;
newrefScreenDoor?: number;
newrefGatedBoxMapCode?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -7170,9 +7155,6 @@ export namespace graphicData {
if (this.newrefScreenDoor != null) {
data.newrefScreenDoor = this.newrefScreenDoor;
}
if (this.newrefGatedBoxMapCode != null) {
data.newrefGatedBoxMapCode = this.newrefGatedBoxMapCode;
}
return data;
}
serialize(): Uint8Array;
@ -7191,8 +7173,6 @@ export namespace graphicData {
writer.writeString(6, this.refGatedBoxMapCode);
if (this.newrefScreenDoor != 0)
writer.writeInt32(7, this.newrefScreenDoor);
if (this.newrefGatedBoxMapCode != 0)
writer.writeInt32(8, this.newrefGatedBoxMapCode);
if (!w)
return writer.getResultBuffer();
}
@ -7220,9 +7200,6 @@ export namespace graphicData {
case 7:
message.newrefScreenDoor = reader.readInt32();
break;
case 8:
message.newrefGatedBoxMapCode = reader.readInt32();
break;
default: reader.skipField();
}
}
@ -8962,9 +8939,10 @@ export namespace graphicData {
constructor(data?: any[] | {
code?: string;
refDevices?: string[];
newrefDevices?: number[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
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 ("code" in data && data.code != undefined) {
this.code = data.code;
@ -8972,6 +8950,9 @@ export namespace graphicData {
if ("refDevices" in data && data.refDevices != undefined) {
this.refDevices = data.refDevices;
}
if ("newrefDevices" in data && data.newrefDevices != undefined) {
this.newrefDevices = data.newrefDevices;
}
}
}
get code() {
@ -8986,9 +8967,16 @@ export namespace graphicData {
set refDevices(value: string[]) {
pb_1.Message.setField(this, 2, value);
}
get newrefDevices() {
return pb_1.Message.getFieldWithDefault(this, 3, []) as number[];
}
set newrefDevices(value: number[]) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
code?: string;
refDevices?: string[];
newrefDevices?: number[];
}): DeviceCombinationtype {
const message = new DeviceCombinationtype({});
if (data.code != null) {
@ -8997,12 +8985,16 @@ export namespace graphicData {
if (data.refDevices != null) {
message.refDevices = data.refDevices;
}
if (data.newrefDevices != null) {
message.newrefDevices = data.newrefDevices;
}
return message;
}
toObject() {
const data: {
code?: string;
refDevices?: string[];
newrefDevices?: number[];
} = {};
if (this.code != null) {
data.code = this.code;
@ -9010,6 +9002,9 @@ export namespace graphicData {
if (this.refDevices != null) {
data.refDevices = this.refDevices;
}
if (this.newrefDevices != null) {
data.newrefDevices = this.newrefDevices;
}
return data;
}
serialize(): Uint8Array;
@ -9020,6 +9015,8 @@ export namespace graphicData {
writer.writeString(1, this.code);
if (this.refDevices.length)
writer.writeRepeatedString(2, this.refDevices);
if (this.newrefDevices.length)
writer.writePackedInt32(3, this.newrefDevices);
if (!w)
return writer.getResultBuffer();
}
@ -9035,6 +9032,9 @@ export namespace graphicData {
case 2:
pb_1.Message.addToRepeatedField(message, 2, reader.readString());
break;
case 3:
message.newrefDevices = reader.readPackedInt32();
break;
default: reader.skipField();
}
}