link调整

This commit is contained in:
fan 2023-07-14 14:44:49 +08:00
parent bcc7f6d718
commit 3062690fc8
7 changed files with 155 additions and 909 deletions

@ -1 +1 @@
Subproject commit c1a99789fe12482085d30eaa66e0e881ffc99c00
Subproject commit 649dd846204bcd9a99706f247665dabfe1bc97d0

@ -1 +1 @@
Subproject commit c89d1eecea3f3c91c4bf52457f1aa51c41171636
Subproject commit 83eab6c5b3d7a25adced20ad2e6179d3154c05fb

View File

@ -69,6 +69,12 @@ export class SectionLinkData
set bRef(v: graphicData.RelatedRef) {
this.data.bRef = v;
}
get index(): number {
return this.data.index;
}
set index(v: number) {
this.data.index = v;
}
clone(): SectionLinkData {
return new SectionLinkData(this.data.cloneMessage());

View File

@ -452,6 +452,7 @@ export async function loadDrawDatas(app: GraphicApp) {
datas.push(new SeparatorData(separator));
});
storage.sectionLinks.forEach((sectionLink) => {
sectionLink.index = parseInt(sectionLink.code);
datas.push(new SectionLinkData(sectionLink));
});
storage.axleCountingSections.forEach((axleCountingSection) => {

View File

@ -5,9 +5,9 @@ import {
JlGraphicTemplate,
VectorText,
IChildTransform,
GraphicRelationParam,
getNormalVector,
movePointAlongNormal,
GraphicRelationParam,
} from 'src/jl-graphic';
import { ILineGraphic } from 'src/jl-graphic/plugins/GraphicEditPlugin';
import {
@ -31,6 +31,8 @@ export interface ISectionLinkData extends GraphicData {
set aRef(v: IRelatedRefData);
get bRef(): IRelatedRefData;
set bRef(v: IRelatedRefData);
get index(): number;
set index(v: number);
clone(): ISectionLinkData;
copyFrom(data: ISectionLinkData): void;
eq(other: ISectionLinkData): boolean;

View File

@ -758,4 +758,123 @@ export namespace state {
return AllDevicesStatus.deserialize(bytes);
}
}
export class PushedDevicesStatus extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
all?: boolean;
varStatus?: VariationStatus;
allStatus?: AllDevicesStatus;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("all" in data && data.all != undefined) {
this.all = data.all;
}
if ("varStatus" in data && data.varStatus != undefined) {
this.varStatus = data.varStatus;
}
if ("allStatus" in data && data.allStatus != undefined) {
this.allStatus = data.allStatus;
}
}
}
get all() {
return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean;
}
set all(value: boolean) {
pb_1.Message.setField(this, 1, value);
}
get varStatus() {
return pb_1.Message.getWrapperField(this, VariationStatus, 2) as VariationStatus;
}
set varStatus(value: VariationStatus) {
pb_1.Message.setWrapperField(this, 2, value);
}
get has_varStatus() {
return pb_1.Message.getField(this, 2) != null;
}
get allStatus() {
return pb_1.Message.getWrapperField(this, AllDevicesStatus, 3) as AllDevicesStatus;
}
set allStatus(value: AllDevicesStatus) {
pb_1.Message.setWrapperField(this, 3, value);
}
get has_allStatus() {
return pb_1.Message.getField(this, 3) != null;
}
static fromObject(data: {
all?: boolean;
varStatus?: ReturnType<typeof VariationStatus.prototype.toObject>;
allStatus?: ReturnType<typeof AllDevicesStatus.prototype.toObject>;
}): PushedDevicesStatus {
const message = new PushedDevicesStatus({});
if (data.all != null) {
message.all = data.all;
}
if (data.varStatus != null) {
message.varStatus = VariationStatus.fromObject(data.varStatus);
}
if (data.allStatus != null) {
message.allStatus = AllDevicesStatus.fromObject(data.allStatus);
}
return message;
}
toObject() {
const data: {
all?: boolean;
varStatus?: ReturnType<typeof VariationStatus.prototype.toObject>;
allStatus?: ReturnType<typeof AllDevicesStatus.prototype.toObject>;
} = {};
if (this.all != null) {
data.all = this.all;
}
if (this.varStatus != null) {
data.varStatus = this.varStatus.toObject();
}
if (this.allStatus != null) {
data.allStatus = this.allStatus.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.all != false)
writer.writeBool(1, this.all);
if (this.has_varStatus)
writer.writeMessage(2, this.varStatus, () => this.varStatus.serialize(writer));
if (this.has_allStatus)
writer.writeMessage(3, this.allStatus, () => this.allStatus.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PushedDevicesStatus {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PushedDevicesStatus();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.all = reader.readBool();
break;
case 2:
reader.readMessage(message.varStatus, () => message.varStatus = VariationStatus.deserialize(reader));
break;
case 3:
reader.readMessage(message.allStatus, () => message.allStatus = AllDevicesStatus.deserialize(reader));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): PushedDevicesStatus {
return PushedDevicesStatus.deserialize(bytes);
}
}
}

File diff suppressed because it is too large Load Diff