!1249 修复:阵列模态框数据没更新的问题

pull/1249/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 0bde7c488f
commit b4dcd201ea

@ -16,6 +16,7 @@ import { ModalPosition, ModalState } from '../UI/Components/Modal/ModalInterface
import { AppToaster } from '../UI/Components/Toaster'; import { AppToaster } from '../UI/Components/Toaster';
import { IBaseOption, IUiOption } from '../UI/Store/BoardInterface'; import { IBaseOption, IUiOption } from '../UI/Store/BoardInterface';
import { Hole } from '../DatabaseServices/3DSolid/Hole'; import { Hole } from '../DatabaseServices/3DSolid/Hole';
import { FixedNotZero } from '../Common/Utils';
export enum ArrayType export enum ArrayType
{ {
@ -109,11 +110,12 @@ export class ArrayStore extends Singleton
} }
export class Command_Array implements Command export class Command_Array implements Command
{ {
arrayStore = ArrayStore.GetInstance(); arrayStore: ArrayStore = ArrayStore.GetInstance();
async exec() async exec()
{ {
let option = this.arrayStore.m_Option; let option = this.arrayStore.m_Option;
let uiOption = this.arrayStore.UIOption;
let ssRes = await app.Editor.GetSelection({ let ssRes = await app.Editor.GetSelection({
Msg: "请选择阵列对象:", Msg: "请选择阵列对象:",
@ -152,7 +154,9 @@ export class Command_Array implements Command
{ {
let pt1Ucs = ptRes1.Point.applyMatrix4(ucsInv); let pt1Ucs = ptRes1.Point.applyMatrix4(ucsInv);
option.x = pt1Ucs.x; option.x = pt1Ucs.x;
uiOption.x = FixedNotZero(pt1Ucs.x, 2);
option.y = pt1Ucs.y; option.y = pt1Ucs.y;
uiOption.y = FixedNotZero(pt1Ucs.y, 2);
} }
break; break;
@ -165,7 +169,10 @@ export class Command_Array implements Command
}, },
}); });
if (disRes1.Status === PromptStatus.OK) if (disRes1.Status === PromptStatus.OK)
{
option.rowOffset = (Math.round(disRes1.Distance * 100) / 100); option.rowOffset = (Math.round(disRes1.Distance * 100) / 100);
uiOption.rowOffset = FixedNotZero(option.rowOffset, 2);
}
break; break;
case Pick.colOffset: case Pick.colOffset:
@ -177,13 +184,19 @@ export class Command_Array implements Command
}, },
}); });
if (disRes2.Status === PromptStatus.OK) if (disRes2.Status === PromptStatus.OK)
{
option.colOffset = (Math.round(disRes2.Distance * 100) / 100); option.colOffset = (Math.round(disRes2.Distance * 100) / 100);
uiOption.colOffset = FixedNotZero(option.colOffset, 2);
}
break; break;
case Pick.arrayAngle: case Pick.arrayAngle:
let ptRes4 = await app.Editor.GetAngle({ Msg: "请指定阵列角度:" }); let ptRes4 = await app.Editor.GetAngle({ Msg: "请指定阵列角度:" });
if (ptRes4.Status === PromptStatus.OK) if (ptRes4.Status === PromptStatus.OK)
option.arrayAngle = Math.round(ptRes4.Distance); {
option.arrayAngle = ptRes4.Distance;
uiOption.arrayAngle = FixedNotZero(option.arrayAngle, 6);
}
break; break;
case Pick.fillAngle: case Pick.fillAngle:
@ -298,7 +311,9 @@ export class Command_Array implements Command
{ {
updateRect(p1, ptRes.Point); updateRect(p1, ptRes.Point);
option.rowOffset = row; option.rowOffset = row;
uiOption.rowOffset = FixedNotZero(row, 2);
option.colOffset = col; option.colOffset = col;
uiOption.colOffset = FixedNotZero(col, 2);
} }
JigUtils.End(); JigUtils.End();
break; break;
@ -310,8 +325,11 @@ export class Command_Array implements Command
break; break;
//数据提交 //数据提交
option.itemTotal = itemTotal; option.itemTotal = itemTotal;
uiOption.itemTotal = FixedNotZero(itemTotal, 2);
option.fillAngle = fillAngle; option.fillAngle = fillAngle;
uiOption.fillAngle = FixedNotZero(fillAngle, 2);
option.betweenAngle = betweenAngle; option.betweenAngle = betweenAngle;
uiOption.betweenAngle = FixedNotZero(betweenAngle, 2);
//呼出模态框 //呼出模态框
app.Editor.ModalManage.RenderModal(ArrayModal, { store: this.arrayStore }, { position: ModalPosition.Old }); app.Editor.ModalManage.RenderModal(ArrayModal, { store: this.arrayStore }, { position: ModalPosition.Old });
} }

Loading…
Cancel
Save