!1864 修复:收口条切换配置不能正常使用周围板件数据

pull/1860/MERGE
林三 3 years ago committed by ChenX
parent 3f6263ebbc
commit b8418ec017

@ -1,12 +1,11 @@
import { Intent } from '@blueprintjs/core';
import { Matrix4, Vector3 } from 'three';
import { begin } from 'xaop';
import { app } from '../../ApplicationServices/Application';
import { EBoardKeyList } from '../../Common/BoardKeyList';
import { Board } from '../../DatabaseServices/Entity/Board';
import { Command } from '../../Editor/CommandMachine';
import { PromptStatus } from '../../Editor/PromptResult';
import { Box3Ext } from '../../Geometry/Box';
import { TryRotateSpaceToUCS } from '../../Geometry/SpaceParse/PointSelectSpace';
import { TotalSpaceParse } from '../../Geometry/SpaceParse/TotalSpaceParse';
import { BoardModal, BoardModalType } from '../../UI/Components/Board/BoardModal';
import { ModalState } from '../../UI/Components/Modal/ModalInterface';
@ -14,7 +13,6 @@ import { AppToaster } from '../../UI/Components/Toaster';
import { BoardType, BrRelativePos, LinesType, StripType } from '../../UI/Store/BoardInterface';
import { ClosingStripStore } from '../../UI/Store/BoardStore';
import { AutoCutting } from '../BoardCutting/AutoCuttingReactor';
import { TryRotateSpaceToUCS } from '../../Geometry/SpaceParse/PointSelectSpace';
//补收口条默认宽度
const DEFAULT_STRIP_WIDTH = 80;
@ -22,6 +20,7 @@ const DEFAULT_STRIP_WIDTH = 80;
export class DrawClosingStrip implements Command
{
private store: ClosingStripStore;
async exec()
{
let useUcs = false;
@ -61,23 +60,8 @@ export class DrawClosingStrip implements Command
this.store = ClosingStripStore.GetInstance();
app.Editor.ModalManage.RenderModeless(BoardModal, { store: this.store, type: BoardModalType.Skt }, { canMinimize: false });
this.store.GetBoardProcessOption(boards[0]);
// this.store.GetBoardProcessOption(boards[0]);
this.store.ChangeCabinetName();
let useOptionCallback = begin(this.store, this.store.UpdateOption, (cof) =>
{
//用周围板件加工数据
if (cof.processData.useBoardProcessOption)
{
cof.processData[EBoardKeyList.RoomName] = boards[0].BoardProcessOption[EBoardKeyList.RoomName];
cof.processData[EBoardKeyList.CabinetName] = boards[0].BoardProcessOption[EBoardKeyList.CabinetName];
cof.processData[EBoardKeyList.Mat] = boards[0].BoardProcessOption[EBoardKeyList.Mat];
cof.processData[EBoardKeyList.BrMat] = boards[0].BoardProcessOption[EBoardKeyList.BrMat];
cof.processData[EBoardKeyList.Color] = boards[0].BoardProcessOption[EBoardKeyList.Color];
}
useOptionCallback();
useOptionCallback = null;
});
let res = await app.Editor.ModalManage.Wait();
if (res.Status !== ModalState.Ok)
@ -94,7 +78,7 @@ export class DrawClosingStrip implements Command
while (true)
{
this.buildClosingStrip(spaceParse.SpaceBox, spaceParse.SpaceOCS);
this.buildClosingStrip(spaceParse.SpaceBox, spaceParse.SpaceOCS, boards[0]);
AppToaster.show({
message: "收口条已绘制",
timeout: 1000,
@ -111,7 +95,7 @@ export class DrawClosingStrip implements Command
}
}
//构建收口条,更新总空间
buildClosingStrip(totalSpace: Box3Ext, rot: Matrix4)
buildClosingStrip(totalSpace: Box3Ext, rot: Matrix4, board: Board)
{
const opt = this.store.m_Option;
let size = totalSpace.getSize(new Vector3());
@ -200,12 +184,14 @@ export class DrawClosingStrip implements Command
}
br.BoardProcessOption = this.store.BoardProcessOption;
}
this.useBoardProcessOption(br, board);
let brs = [br];
if (opt.isDrawFuZhu && br2)
{
brs.push(br2);
br2.BoardProcessOption = this.store.BoardProcessOption;
this.useBoardProcessOption(br2, board);
}
br.Position = pos;
//更新总空间
@ -221,4 +207,16 @@ export class DrawClosingStrip implements Command
app.Editor.UpdateScreen();
}
private useBoardProcessOption(br: Board, board: Board)//使用周围板件数据
{
if (this.store.BoardProcessOption.useBoardProcessOption)
{
br.BoardProcessOption.roomName = board.BoardProcessOption.roomName;
br.BoardProcessOption.cabinetName = board.BoardProcessOption.cabinetName + br.Name.replace("条", "");
br.BoardProcessOption.material = board.BoardProcessOption.material;
br.BoardProcessOption.boardName = board.BoardProcessOption.boardName;
br.BoardProcessOption.color = board.BoardProcessOption.color;
}
}
}

@ -200,7 +200,12 @@ export class BoardModal extends React.Component<BoardModalProps, {}>
{
store.m_BoardProcessOption.useBoardProcessOption = !store.m_BoardProcessOption.useBoardProcessOption;
}} />
<BoardProcessModal opt={store.m_BoardProcessOption} drillOption={store.rectDrillOption} uiOpt={store.UIBoardProcessOption} />
<BoardProcessModal
opt={store.m_BoardProcessOption}
drillOption={store.rectDrillOption}
uiOpt={store.UIBoardProcessOption}
isDisabled={store.m_BoardProcessOption.useBoardProcessOption}
/>
</div>
<div className={Classes.CARD}>
<Notes remarks={this.props.store.remarks} />

@ -33,6 +33,7 @@ interface BoardProcessProps
br?: Board;
drillOption?: IHightDrillOption;
otherBoardData?: { [key: string]: any; };
isDisabled?: boolean;
}
@observer
export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
@ -69,6 +70,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
option={this.props.opt}
title="房间名"
placeHolder="输入房间名"
isDisabled={this.props.isDisabled}
/>
<SetBoardDataItem
type={CheckObjectType.BR}
@ -76,6 +78,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
option={this.props.opt}
title="柜名"
placeHolder="输入柜名"
isDisabled={this.props.isDisabled}
/></>;
if (this.props.br)
{

@ -116,7 +116,7 @@ export interface BoardProcessOption extends IBaseOption
frontDrill: boolean;
backDrill: boolean;
remarks: [string, string][];
useBoardProcessOption?: boolean;
useBoardProcessOption?: boolean;//使用周围板
}
/**

Loading…
Cancel
Save