|
|
|
@ -12,10 +12,13 @@ import { Board } from '../../../../DatabaseServices/Entity/Board';
|
|
|
|
|
import { CompositeEntity } from '../../../../DatabaseServices/Entity/CompositeEntity';
|
|
|
|
|
import { safeEval } from '../../../../Common/eval';
|
|
|
|
|
import { UpdateCompositeEntityBoard } from '../../../../Add-on/ShowLines';
|
|
|
|
|
import { ConfigStore } from './ConfigDialog';
|
|
|
|
|
import { ColorMaterial } from '../../../../Common/ColorPalette';
|
|
|
|
|
|
|
|
|
|
interface IConfigProps
|
|
|
|
|
{
|
|
|
|
|
store: UserConfig;
|
|
|
|
|
config: UserConfig;
|
|
|
|
|
store: ConfigStore;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@observer
|
|
|
|
@ -24,13 +27,13 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
|
|
|
|
|
private oldShowLine: boolean;
|
|
|
|
|
private toggleDrillingReactor = () =>
|
|
|
|
|
{
|
|
|
|
|
const userConfig = this.props.store;
|
|
|
|
|
const userConfig = this.props.config;
|
|
|
|
|
userConfig.openDrillingReactor = !userConfig.openDrillingReactor;
|
|
|
|
|
app._drillingReactor.Enable = userConfig.openDrillingReactor;
|
|
|
|
|
};
|
|
|
|
|
UNSAFE_componentWillMount()
|
|
|
|
|
{
|
|
|
|
|
const cof = this.props.store;
|
|
|
|
|
const cof = this.props.config;
|
|
|
|
|
this.maxSizeConfig = DataAdapter.ConvertUIData(cof.maxSize);
|
|
|
|
|
this.oldShowLine = userConfig.showLines;
|
|
|
|
|
}
|
|
|
|
@ -53,47 +56,88 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
|
|
|
|
|
}
|
|
|
|
|
public render()
|
|
|
|
|
{
|
|
|
|
|
const userConfig = this.props.store;
|
|
|
|
|
const userConfig = this.props.config;
|
|
|
|
|
const { kjlConfig } = userConfig;
|
|
|
|
|
return (
|
|
|
|
|
<Card>
|
|
|
|
|
<H5>排钻配置</H5>
|
|
|
|
|
<Checkbox
|
|
|
|
|
label="排钻反应器"
|
|
|
|
|
checked={userConfig.openDrillingReactor}
|
|
|
|
|
onChange={this.toggleDrillingReactor}
|
|
|
|
|
/>
|
|
|
|
|
<Checkbox
|
|
|
|
|
label="板边缘大孔过滤"
|
|
|
|
|
checked={userConfig.forceFilterPxl}
|
|
|
|
|
onChange={() => userConfig.forceFilterPxl = !userConfig.forceFilterPxl}
|
|
|
|
|
/>
|
|
|
|
|
{/* <H5>板件绘图配置</H5>
|
|
|
|
|
<Checkbox
|
|
|
|
|
label="自动切割"
|
|
|
|
|
checked={userConfig.openAutoCuttingReactor}
|
|
|
|
|
onChange={this.toggleAutoCuttingReactor}
|
|
|
|
|
/> */}
|
|
|
|
|
<H5>板件超长</H5>
|
|
|
|
|
<Checkbox label="板件超长超短弹窗提示" checked={userConfig.maxSize.isShow} onChange={() => userConfig.maxSize.isShow = !userConfig.maxSize.isShow} />
|
|
|
|
|
{
|
|
|
|
|
[["板长", "height"], ["板宽", "width"]].map(([t, k]) =>
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<ToasterInput
|
|
|
|
|
type={CheckObjectType.OnlyNumber}
|
|
|
|
|
option={userConfig.maxSize}
|
|
|
|
|
uiOption={this.maxSizeConfig}
|
|
|
|
|
optKey={k}
|
|
|
|
|
onBlur={(e, hasError) =>
|
|
|
|
|
{
|
|
|
|
|
if (hasError)
|
|
|
|
|
this.maxSizeConfig[k] = userConfig.maxSize[k].toString();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
<div className="flex drawconfig-1">
|
|
|
|
|
<div>
|
|
|
|
|
<H5>排钻配置</H5>
|
|
|
|
|
<Checkbox
|
|
|
|
|
label="排钻反应器"
|
|
|
|
|
checked={userConfig.openDrillingReactor}
|
|
|
|
|
onChange={this.toggleDrillingReactor}
|
|
|
|
|
/>
|
|
|
|
|
<Checkbox
|
|
|
|
|
label="板边缘大孔过滤"
|
|
|
|
|
checked={userConfig.forceFilterPxl}
|
|
|
|
|
onChange={() => userConfig.forceFilterPxl = !userConfig.forceFilterPxl}
|
|
|
|
|
/>
|
|
|
|
|
{/* <H5>板件绘图配置</H5>
|
|
|
|
|
<Checkbox
|
|
|
|
|
label="自动切割"
|
|
|
|
|
checked={userConfig.openAutoCuttingReactor}
|
|
|
|
|
onChange={this.toggleAutoCuttingReactor}
|
|
|
|
|
/> */}
|
|
|
|
|
<H5>板件超长</H5>
|
|
|
|
|
<Checkbox label="板件超长超短弹窗" checked={userConfig.maxSize.isShow} onChange={() => userConfig.maxSize.isShow = !userConfig.maxSize.isShow} />
|
|
|
|
|
{
|
|
|
|
|
[["板长", "height"], ["板宽", "width"]].map(([t, k]) =>
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|
<span>{t}</span>
|
|
|
|
|
<ToasterInput
|
|
|
|
|
inputClassName="input"
|
|
|
|
|
type={CheckObjectType.OnlyNumber}
|
|
|
|
|
option={userConfig.maxSize}
|
|
|
|
|
uiOption={this.maxSizeConfig}
|
|
|
|
|
optKey={k}
|
|
|
|
|
onBlur={(e, hasError) =>
|
|
|
|
|
{
|
|
|
|
|
if (hasError)
|
|
|
|
|
this.maxSizeConfig[k] = userConfig.maxSize[k].toString();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Label>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
<H5>纹路</H5>
|
|
|
|
|
<Checkbox label="显示纹路" checked={userConfig.showLines} onChange={() => userConfig.showLines = !userConfig.showLines} />
|
|
|
|
|
<Checkbox label="自动修改纹路" checked={userConfig.autoLines} onChange={() => userConfig.autoLines = !userConfig.autoLines} />
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Checkbox
|
|
|
|
|
label="封边检查"
|
|
|
|
|
checked={this.props.store.checkSealing}
|
|
|
|
|
onChange={() => this.props.store.checkSealing = !this.props.store.checkSealing}
|
|
|
|
|
/>
|
|
|
|
|
<ul className={Classes.LIST_UNSTYLED + " sealingList"}>
|
|
|
|
|
<li>
|
|
|
|
|
<span>封边值</span>
|
|
|
|
|
<span>颜色</span>
|
|
|
|
|
</li>
|
|
|
|
|
{
|
|
|
|
|
this.props.store.sealingArr.map(d =>
|
|
|
|
|
<li>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={d[0]}
|
|
|
|
|
onChange={e => d[0] = e.target.value}
|
|
|
|
|
/>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
className={Classes.INPUT}
|
|
|
|
|
value={d[1]}
|
|
|
|
|
onChange={e => d[1] = e.target.value}
|
|
|
|
|
style={{ background: `${parseFloat(d[1]) ? ColorMaterial.GetColor(parseFloat(d[1])).getStyle() : ""}` }}
|
|
|
|
|
/>
|
|
|
|
|
</li>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<H5>酷家乐导入配置</H5>
|
|
|
|
|
<div className="flex-wrap kjl-config">
|
|
|
|
|
{
|
|
|
|
@ -114,9 +158,7 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
<H5>纹路</H5>
|
|
|
|
|
<Checkbox label="显示纹路" checked={userConfig.showLines} onChange={() => userConfig.showLines = !userConfig.showLines} />
|
|
|
|
|
<Checkbox label="自动修改纹路" checked={userConfig.autoLines} onChange={() => userConfig.autoLines = !userConfig.autoLines} />
|
|
|
|
|
|
|
|
|
|
<H5>其他</H5>
|
|
|
|
|
<Checkbox label="保持上次配置" checked={userConfig.keepConfig} onChange={() => userConfig.keepConfig = !userConfig.keepConfig} />
|
|
|
|
|
<Label className={Classes.INLINE}>
|
|
|
|
|