区段边界生成的计轴关联关系调整

This commit is contained in:
joylink_zhaoerwei 2023-09-05 17:04:24 +08:00
parent e18c605818
commit 816b0a6824

View File

@ -243,13 +243,15 @@ function oneClickAxleCounting() {
axleCounting.id = GraphicIdGenerator.next();
const offsetX = i == 0 ? -40 : 40;
axleCounting.position.set(select.x + offsetX, select.y + 30);
const refIndex = i == 0 ? 1 : 0;
const ref = select.datas.axleCountingRef[refIndex];
const refSection = select.queryStore.queryById(ref.id);
axleCounting.datas.axleCountingRef = [
select.datas.axleCountingRef[refIndex],
];
axleCounting.datas.code = `${refSection.code}-${ref.devicePort}`;
const ref = select.datas.axleCountingRef;
for (let j = 0; j < 2; j++) {
if (ref[j].devicePort == i) {
const refSection = select.queryStore.queryById(ref[j].id) as Section;
axleCounting.datas.axleCountingRef = [select.datas.axleCountingRef[j]];
axleCounting.datas.code = `${refSection.datas.code}-${ref[j].devicePort}`;
break;
}
}
const app = drawStore.getDrawApp();
app.addGraphicAndRecord(axleCounting);
axleCounting.loadRelations();