!2259 新增:模拟走刀时可调整图形间距

pull/2261/MERGE
黄诗津 1 year ago committed by ChenX
parent 492212bc22
commit 2504148289

@ -7,6 +7,7 @@ import { Line } from "../DatabaseServices/Entity/Line";
import { Text } from "../DatabaseServices/Text/Text";
import { Command } from "../Editor/CommandMachine";
import { PromptStatus } from "../Editor/PromptResult";
import { userConfig } from "../Editor/UserConfig";
import { MoveMatrix, ZAxis } from "../Geometry/GeUtils";
import { IBoardHoleInfo, IModelingData, ISpliteOrderData, Production } from "../Production/Product";
import { AppToaster } from "../UI/Components/Toaster";
@ -57,7 +58,7 @@ export class FeedingCommand implements Command
{
let info = infos[i];
if (i > 0)
pos.add(new Vector3(width + 50));
pos.add(new Vector3(width + userConfig.testModeSpacing));
else
pos = ptRes.Point;

@ -5,8 +5,8 @@ import { RenderType } from "../GraphicsSystem/RenderType";
import { IConfigOption } from "../UI/Components/Board/UserConfigComponent";
import { IBaseOption, IGrooveOption } from "../UI/Store/BoardInterface";
import { IConfigStore } from "../UI/Store/BoardStore";
import { DrillingOption } from "../UI/Store/drillInterface";
import { IWineRackOption } from "../UI/Store/WineRackInterface";
import { DrillingOption } from "../UI/Store/drillInterface";
import { ICursorConfig } from "./ICursorConfig";
export interface IMaxSizeProps extends IBaseOption
@ -44,7 +44,7 @@ export interface IChat
export class UserConfig implements IConfigStore
{
private readonly _version = 33; //🌟🌟每次更新必须向上添加一次版本号🌟🌟
private readonly _version = 34; //🌟🌟每次更新必须向上添加一次版本号🌟🌟
@observable designer = ""; //一键布局的设计师
_renderType: RenderType = RenderType.Wireframe;
@observable maxSize: IMaxSizeProps = {
@ -95,6 +95,7 @@ export class UserConfig implements IConfigStore
@observable isModifyMaterial: boolean = true;//右侧工具栏应用时覆盖新的材质
@observable isHighlightMaterial: boolean = true;//亮显材质球
@observable cabinetSpacing: number = 1000; //柜子移动到0点配置 柜子间距
@observable testModeSpacing = 50; //模拟走刀图形间距
@observable ConceptualEdgeColor = 7;//概念线框的颜色
ConceptualOpacity = 1;//概念透明的透明度
@ -254,6 +255,7 @@ export class UserConfig implements IConfigStore
this.titleWidthMap = new Map();
this.dxfImportFrontView = false;
this.designer = "";
this.testModeSpacing = 50;
}
SaveConfig()
{
@ -303,7 +305,8 @@ export class UserConfig implements IConfigStore
titleWidthMap: Object.fromEntries(this.titleWidthMap.entries()),
dxfImportFrontView: this.dxfImportFrontView,
designer: this.designer,
showOpenDirLines: this.showOpenDirLines
showOpenDirLines: this.showOpenDirLines,
testModeSpacing: this.testModeSpacing,
}
};
}
@ -449,7 +452,13 @@ export class UserConfig implements IConfigStore
this.designer = config.option.designer;
}
if (config.option.version > 32)
{
this.showOpenDirLines = config.option.showOpenDirLines;
}
if (config.option.version > 33)
{
this.testModeSpacing = config.option.testModeSpacing;
}
}
}

@ -23,6 +23,7 @@ interface IConfigProps
export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
@observable maxSizeConfig: IUiOption<IMaxSizeProps>;
cabinetSpacing: number = userConfig.cabinetSpacing;
private testModeSpacing: number = userConfig.testModeSpacing;
_oldShowLine: boolean;
_oldShowOpenDirLine: boolean;
_toggleDrillingReactor = () =>
@ -190,6 +191,24 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
/>
</Label>
<H5></H5>
<Label className={Classes.INLINE}>
<span style={{ width: "4rem" }}></span>
<ToasterInput
type={CheckObjectType.OnlyNumber}
option={userConfig}
optKey={"testModeSpacing"}
onChange={(e) => { userConfig.testModeSpacing = Number(e.target.value); }}
onBlur={(e, hasErr) =>
{
if (hasErr)
userConfig.testModeSpacing = this.testModeSpacing;
else
this.testModeSpacing = userConfig.testModeSpacing;
}}
/>
</Label>
<H5></H5>
<Label className={Classes.INLINE}>
<span></span>

Loading…
Cancel
Save