diff --git a/src/Add-on/Array.ts b/src/Add-on/Array.ts index 9e4863755..cc50686db 100644 --- a/src/Add-on/Array.ts +++ b/src/Add-on/Array.ts @@ -15,6 +15,7 @@ import { MoveMatrix, rotatePoint, AsVector2 } from '../Geometry/GeUtils'; import { ArrayModal } from '../UI/Components/Modal/ArrayModal'; import { ModalPosition, ModalState } from '../UI/Components/Modal/ModalsManage'; import { AppToaster } from '../UI/Components/Toaster'; +import { IBaseOption } from '../UI/Store/BoardInterface'; export enum ArrayType { @@ -38,7 +39,7 @@ export enum Pick fillAngle = 5, betweenAngle = 6 } -export interface ArrayOptioins +export interface ArrayOptioins extends IBaseOption { row: number; col: number; diff --git a/src/Add-on/BoardCutting/ReferenceCuttingModal.tsx b/src/Add-on/BoardCutting/ReferenceCuttingModal.tsx index 093b295b1..01c28a431 100644 --- a/src/Add-on/BoardCutting/ReferenceCuttingModal.tsx +++ b/src/Add-on/BoardCutting/ReferenceCuttingModal.tsx @@ -12,6 +12,7 @@ import { Singleton } from "../../Common/Singleton"; import { BoardType } from "../../DatabaseServices/Entity/Board"; import { ModalState } from "../../UI/Components/Modal/ModalsManage"; import { AppToaster, ToasterInput } from "../../UI/Components/Toaster"; +import { IBaseOption } from "../../UI/Store/BoardInterface"; export enum CuttingOffset { @@ -24,7 +25,7 @@ interface OffsetKeyWord Front: string; Back: string; } -export interface ReferenceCuttingOptioins +export interface ReferenceCuttingOptioins extends IBaseOption { boardType: BoardType; offset: number; diff --git a/src/Production/Product.ts b/src/Production/Product.ts index ea021d3e8..9e1b643bd 100644 --- a/src/Production/Product.ts +++ b/src/Production/Product.ts @@ -333,6 +333,11 @@ export namespace Production break; } } + if (!endPt) + { + console.warn("排钻位置有问题"); + continue; + } holes = data.sideHoles; face = Math.floor(outline.GetParamAtPoint(pt)); isPush = true; diff --git a/src/UI/Components/Board/BoardCommon.tsx b/src/UI/Components/Board/BoardCommon.tsx index 237b557ec..ef22ef64c 100644 --- a/src/UI/Components/Board/BoardCommon.tsx +++ b/src/UI/Components/Board/BoardCommon.tsx @@ -13,14 +13,12 @@ import { GetEntity } from '../../../Common/Utils'; import { safeEval } from '../../../Common/eval'; import { EBoardKeyList } from '../../../Common/BoardKeyList'; -type OptionType = IBaseOption | DrillingOption; - export interface ISetItemOption { type: CheckObjectType; optKey: string; title?: string; - option: OptionType; + option: IBaseOption; uiOption?: Object; isDisabled?: boolean; placeHolder?: string; @@ -38,7 +36,7 @@ interface ISetBlockOption { type: CheckObjectType; pars: Array>; - option: OptionType; + option: IBaseOption; uiOption?: Object; className?: string; isInline?: boolean; diff --git a/src/UI/Components/Board/BoardInfosList.tsx b/src/UI/Components/Board/BoardInfosList.tsx index 0e6082c2d..b290d516c 100644 --- a/src/UI/Components/Board/BoardInfosList.tsx +++ b/src/UI/Components/Board/BoardInfosList.tsx @@ -6,7 +6,7 @@ import { CheckObjectType } from "../../../Common/CheckoutVaildValue"; import { safeEval } from "../../../Common/eval"; import { FixedNotZero } from "../../../Common/Utils"; import { Board } from "../../../DatabaseServices/Entity/Board"; -import { LinesType } from "../../Store/BoardInterface"; +import { LinesType, IBaseOption } from "../../Store/BoardInterface"; import { ToasterInput } from "../Toaster"; export interface IBoardInfoListProps @@ -17,7 +17,7 @@ export interface IBoardInfoListProps ModifyDataRecord: Function; isSelected: boolean; } -export interface IBoardInfoOptions +export interface IBoardInfoOptions extends IBaseOption { [EBoardKeyList.Height]?: string; [EBoardKeyList.Width]?: string; diff --git a/src/UI/Components/RotateLayerBoard.tsx b/src/UI/Components/RotateLayerBoard.tsx index a7cc4e1de..84b8c588c 100644 --- a/src/UI/Components/RotateLayerBoard.tsx +++ b/src/UI/Components/RotateLayerBoard.tsx @@ -10,11 +10,12 @@ import { BoardStore } from '../Store/BoardStore'; import { SetBoardDataItem } from './Board/BoardCommon'; import { ModalState } from './Modal/ModalsManage'; import { AppToaster } from './Toaster'; +import { IBaseOption } from '../Store/BoardInterface'; export interface IRotateLayerBoardProps { store: RotateLayerBoardStore; } -interface IRotateLayerBoardOption +interface IRotateLayerBoardOption extends IBaseOption { angle: number; length: number; diff --git a/src/UI/Store/BoardFindModifyStore.ts b/src/UI/Store/BoardFindModifyStore.ts index 34a2616ce..8156846f5 100644 --- a/src/UI/Store/BoardFindModifyStore.ts +++ b/src/UI/Store/BoardFindModifyStore.ts @@ -12,6 +12,7 @@ import { DefaultBoardFindOption } from "../../Editor/DefaultConfig"; export class BoardFindStore extends BoardStore { @observable m_Option: IBoardFindOption = { + version: 1, condition: { layer: false, height: false, @@ -82,6 +83,8 @@ export class BoardFindStore extends BoardStore highDrill: [], upDownDrill: [true, true], isClose: false, + isRemoveModeling: false, + isRemoveSpecialShape: false, }; @observable isSelectAllSealed = false; @observable isSelectAllDrill = false; @@ -96,7 +99,7 @@ export class BoardFindStore extends BoardStore private SetDrillType() { let drilltypes = [...userConfig.DrillConfigs.keys()]; - if (drilltypes.length > 0) + if (drilltypes.length > 0 && !drilltypes.includes(this.m_Option.drillType)) { observable(this.m_Option.highDrill).replace(Array(4).fill(drilltypes[0])); this.m_Option.upDownDrill[0] = true; diff --git a/src/UI/Store/BoardInterface.ts b/src/UI/Store/BoardInterface.ts index c40492447..e469a975f 100644 --- a/src/UI/Store/BoardInterface.ts +++ b/src/UI/Store/BoardInterface.ts @@ -7,7 +7,7 @@ import { BoardType } from "../../DatabaseServices/Entity/Board"; */ export interface IBaseOption { - version: number; + version?: number; } //板件数据,配置信息+加工信息 @@ -245,7 +245,7 @@ export interface ClosingStripOption extends BoardConfigOption frontShrink: number; //前缩 } -export interface IGrooveOption +export interface IGrooveOption extends IBaseOption { grooveAddLength: string;//槽加长/宽/高 grooveAddWidth: string; diff --git a/src/UI/Store/DoorDrawerStore/DoorStore.ts b/src/UI/Store/DoorDrawerStore/DoorStore.ts index d92f42b14..012fe1384 100644 --- a/src/UI/Store/DoorDrawerStore/DoorStore.ts +++ b/src/UI/Store/DoorDrawerStore/DoorStore.ts @@ -15,45 +15,7 @@ openDirTitle[DoorOpenDir.None] = "无"; export class DoorStore extends DoorDrawerStore { title = "门板"; - @observable m_Option: IDoorConfigOption = { - col: 1, - row: 1, - isAllSelect: true, - topOffset: 0, - bottomOffset: 0, - doorPosType: DoorPosType.Out, - offset: 0, - topExt: 18, - bottomExt: 18, - leftExt: 18, - rightExt: 18, - topSpace: 2, - bottomSpace: 2, - leftSpace: 2, - rightSpace: 2, - midSpace: 2, - thickness: 18, - depth: 0, - isAuto: true, - boardName: "", - doorThickness: 18, - topBrSeal: 1, - bottomBrSeal: 1, - leftBrSeal: 1, - rightBrSeal: 1, - topDoorSeal: 1, - bottomDoorSeal: 1, - leftDoorSeal: 1, - rightDoorSeal: 1, - handleAngle: 0, - handleHorPos: HandleHorPos.Left, - horSpacing: 10, - handleVePos: HandleVePos.Top, - veSpacing: 10, - hingeCount: 0, - hindeTopDist: 0, - hindeBottomDist: 0, - } + @observable m_Option: IDoorConfigOption = Object.assign({}, DefaultDoorOption); doorPosition = new Vector3(); // 第一块门板起始位置点 @observable doorDrawersInfo: IDoorInfo[] = []; InitInfos() diff --git a/src/UI/Store/DoorDrawerStore/DrawerStore.ts b/src/UI/Store/DoorDrawerStore/DrawerStore.ts index e649ac6ce..badc50b1c 100644 --- a/src/UI/Store/DoorDrawerStore/DrawerStore.ts +++ b/src/UI/Store/DoorDrawerStore/DrawerStore.ts @@ -6,36 +6,7 @@ import { DefaultDrawerOption } from "../../../Editor/DefaultConfig"; export class DrawerStore extends DoorDrawerStore { title = "抽屉"; - @observable m_Option: IDrawerConfigOption = { - col: 1, - row: 1, - isAllSelect: true, - topOffset: 0, - bottomOffset: 0, - doorPosType: DoorPosType.Out, - offset: 0, - topExt: 18, - bottomExt: 18, - leftExt: 18, - rightExt: 18, - topSpace: 2, - bottomSpace: 2, - leftSpace: 2, - rightSpace: 2, - midSpace: 2, - thickness: 18, - depth: 0, - isAuto: true, - boardName: "", - handleAngle: 0, - handleHorPos: HandleHorPos.Left, - horSpacing: 10, - handleVePos: HandleVePos.Top, - veSpacing: 10, - drawerTotalDepth: 0, - trackDepth: 0, - isAutoSelectTrack: true, - } + @observable m_Option: IDrawerConfigOption = Object.assign({}, DefaultDrawerOption); InitInfos() { diff --git a/src/UI/Store/DrillStore.ts b/src/UI/Store/DrillStore.ts index a9f92a446..f88abdb51 100644 --- a/src/UI/Store/DrillStore.ts +++ b/src/UI/Store/DrillStore.ts @@ -23,6 +23,7 @@ export class DrillStore extends BoardStore private GetDefaultOption() { let originOption: DrillingOption = { + version: 1, startDist: 0, endDist: 40, //位置参数 diff --git a/src/UI/Store/drillInterface.ts b/src/UI/Store/drillInterface.ts index 25cb37f8b..5bf21f3de 100644 --- a/src/UI/Store/drillInterface.ts +++ b/src/UI/Store/drillInterface.ts @@ -1,3 +1,5 @@ +import { IBaseOption } from "./BoardInterface"; + export enum SpacingType { Multiple32 = "32", @@ -7,7 +9,7 @@ export enum SpacingType *勿随意更改属性名,若更改,需更改对应UI模态框的属性和检验方法的key * */ -export interface DrillingOption +export interface DrillingOption extends IBaseOption { startDist: number; endDist: number;