代码同步
This commit is contained in:
parent
240e75262f
commit
3c04f8ee4a
@ -1 +1 @@
|
||||
Subproject commit 3612e0fc16a52ee1b9aa0c7422908fc0784c08d1
|
||||
Subproject commit 0a7e6144bad3d943b5adfec4595c70209d8b1127
|
@ -543,9 +543,14 @@ export class GraphicApp extends EventEmitter<GraphicAppEvents> {
|
||||
g.loadState(state);
|
||||
this.addGraphics(g);
|
||||
} else {
|
||||
list.forEach((g) => {
|
||||
g.updateStates(state);
|
||||
});
|
||||
// 调整逻辑:所有图形对象状态数据更新完后再统一重绘
|
||||
list
|
||||
.filter((g) => {
|
||||
return g.updateStates(state);
|
||||
})
|
||||
.forEach((g) => {
|
||||
g.repaint();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -902,7 +902,7 @@ export abstract class JlGraphic extends Container {
|
||||
this.onStateChange(state, old);
|
||||
stateChange = true;
|
||||
this.emit('stateupdate', this.getStates(), old);
|
||||
this.repaint();
|
||||
// this.repaint();
|
||||
}
|
||||
return stateChange;
|
||||
}
|
||||
@ -912,8 +912,12 @@ export abstract class JlGraphic extends Container {
|
||||
onStateChange(newVal: GraphicState, old?: GraphicState): void {}
|
||||
|
||||
repaint(): void {
|
||||
this.doRepaint();
|
||||
this.emit('repaint', this);
|
||||
try {
|
||||
this.doRepaint();
|
||||
this.emit('repaint', this);
|
||||
} catch (e) {
|
||||
console.error(`设备id=${this.id},type=${this.type}重绘逻辑异常`, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3727,6 +3727,7 @@ export namespace graphicData {
|
||||
points?: Point[];
|
||||
isUp?: boolean;
|
||||
kilometerPoints?: KilometerPoint[];
|
||||
aToB?: boolean;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 5], this.#one_of_decls);
|
||||
@ -3746,6 +3747,9 @@ export namespace graphicData {
|
||||
if ("kilometerPoints" in data && data.kilometerPoints != undefined) {
|
||||
this.kilometerPoints = data.kilometerPoints;
|
||||
}
|
||||
if ("aToB" in data && data.aToB != undefined) {
|
||||
this.aToB = data.aToB;
|
||||
}
|
||||
}
|
||||
}
|
||||
get common() {
|
||||
@ -3781,12 +3785,19 @@ export namespace graphicData {
|
||||
set kilometerPoints(value: KilometerPoint[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 5, value);
|
||||
}
|
||||
get aToB() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean;
|
||||
}
|
||||
set aToB(value: boolean) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
isUp?: boolean;
|
||||
kilometerPoints?: ReturnType<typeof KilometerPoint.prototype.toObject>[];
|
||||
aToB?: boolean;
|
||||
}): PathLine {
|
||||
const message = new PathLine({});
|
||||
if (data.common != null) {
|
||||
@ -3804,6 +3815,9 @@ export namespace graphicData {
|
||||
if (data.kilometerPoints != null) {
|
||||
message.kilometerPoints = data.kilometerPoints.map(item => KilometerPoint.fromObject(item));
|
||||
}
|
||||
if (data.aToB != null) {
|
||||
message.aToB = data.aToB;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -3813,6 +3827,7 @@ export namespace graphicData {
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
isUp?: boolean;
|
||||
kilometerPoints?: ReturnType<typeof KilometerPoint.prototype.toObject>[];
|
||||
aToB?: boolean;
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
@ -3829,6 +3844,9 @@ export namespace graphicData {
|
||||
if (this.kilometerPoints != null) {
|
||||
data.kilometerPoints = this.kilometerPoints.map((item: KilometerPoint) => item.toObject());
|
||||
}
|
||||
if (this.aToB != null) {
|
||||
data.aToB = this.aToB;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -3845,6 +3863,8 @@ export namespace graphicData {
|
||||
writer.writeBool(4, this.isUp);
|
||||
if (this.kilometerPoints.length)
|
||||
writer.writeRepeatedMessage(5, this.kilometerPoints, (item: KilometerPoint) => item.serialize(writer));
|
||||
if (this.aToB != false)
|
||||
writer.writeBool(6, this.aToB);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -3869,6 +3889,9 @@ export namespace graphicData {
|
||||
case 5:
|
||||
reader.readMessage(message.kilometerPoints, () => pb_1.Message.addToRepeatedWrapperField(message, 5, KilometerPoint.deserialize(reader), KilometerPoint));
|
||||
break;
|
||||
case 6:
|
||||
message.aToB = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 2d4a7c97fe9a0f5694932918e10a90248a60422b
|
||||
Subproject commit e8ac23070828a1eca3bd68b6f78e4e419123d139
|
Loading…
Reference in New Issue
Block a user