!141 UI数据转换

Merge pull request !141 from ZoeLeeFZ/DataAda_PR
pull/141/MERGE
ChenX 6 years ago
parent c4736685d9
commit 4a8ae4d6fa

@ -14,17 +14,17 @@ export class DrawBehindBoard extends DrawBoardTool
let newBox = box.clone();
const opt = data.boardConfig as BehindBoardOption;
//判断延伸
let leftExt = parseFloat(opt.leftExt);
let rightExt = parseFloat(opt.rightExt);
let topExt = parseFloat(opt.topExt);
let bottomExt = parseFloat(opt.bottomExt);
let leftExt = opt.leftExt;
let rightExt = opt.rightExt;
let topExt = opt.topExt;
let bottomExt = opt.bottomExt;
newBox.max.add(new Vector3(leftExt + rightExt, 0, topExt + bottomExt));
newBox.translate(new Vector3(-leftExt, 0, -bottomExt));
//获取背板高度
let size = newBox.getSize(new Vector3());
let height = opt.height === "H" ? size.z : parseFloat(opt.height);
let moveDist = parseFloat(opt.moveDist);
let height = opt.height === Infinity ? size.z : opt.height;
let moveDist = opt.moveDist;
//判断背板位置,更新背板高度
switch (opt.boardPosition)
@ -39,16 +39,16 @@ export class DrawBehindBoard extends DrawBoardTool
break;
}
let count = parseInt(opt.count);
let count = opt.count;
//相对位置
let relPos = opt.boardRelative;
//单层空间宽度
let spaceSize = parseFloat(opt.spaceSize);
let thickness = parseFloat(opt.thickness);
let spaceSize = opt.spaceSize;
let thickness = opt.thickness;
let board = Board.CreateBoard(height, size.x, thickness, BoardType.Behind);
opt.height = height.toString();
opt.width = size.x.toString();
opt.height = height;
opt.width = size.x;
//等分单层空间大小
let singleSize = (size.y - (thickness * count)) / (count + 1);

@ -55,8 +55,8 @@ export class DrawClosingStrip implements Command
let max = totalSpace.max;
let min = totalSpace.min;
let pos = new Vector3();
let thickness = parseFloat(opt.thickness);
let width = parseFloat(opt.width);
let thickness = opt.thickness;
let width = opt.width;
let br: Board;
//靠上,横板为层板,基点位置为前右上方的点往上移动一个厚度 竖板为背板,基点为前左上方点
@ -108,8 +108,8 @@ export class DrawClosingStrip implements Command
}
opt.type = br.BoardType;
opt.height = br.Length.toString();
opt.width = br.Width.toString();
opt.height = br.Length;
opt.width = br.Width;
br.Name = opt.name;
br.m_BoardProcessOption = Object.assign({}, this.store.m_BoardProcessOption);

@ -13,25 +13,25 @@ export class DrawLayerBoard extends DrawBoardTool
{
const opt = data.boardConfig as LayerBoardOption;
let size = box.getSize(new Vector3());
let width = (opt.isTotalLength || opt.height === "L") ? size.y : parseFloat(opt.height);
let width = (opt.isTotalLength || opt.height === Infinity) ? size.y : opt.height;
let count = parseInt(opt.count);
let count = opt.count;
let type = opt.boardRelative;
let spaceSize = parseFloat(opt.spaceSize);
let frontShrink = parseFloat(opt.frontShrink);
let spaceSize = opt.spaceSize;
let frontShrink = opt.frontShrink;
if (opt.isTotalLength)
{
width -= frontShrink;
}
let leftShrink = parseFloat(opt.leftShrink);
let rightShrink = parseFloat(opt.rightShrink);
let thickness = parseFloat(opt.thickness);
let leftShrink = opt.leftShrink;
let rightShrink = opt.rightShrink;
let thickness = opt.thickness;
let len = size.x - leftShrink - rightShrink;
let board = Board.CreateBoard(size.x - leftShrink - rightShrink, width, thickness, BoardType.Layer);
opt.height = len.toString();
opt.width = width.toString();
opt.height = len;
opt.width = width;
//等分单层空间大小
let singleSize = (size.z - (thickness * count)) / (count + 1);

@ -22,10 +22,10 @@ export class DrawLeftRight implements Command
app.m_Editor.m_ModalManage.Callback = async () =>
{
let data = store.m_BoardOption;
let lenght = parseFloat(data.height);
let width = parseFloat(data.width);
let thickness = parseFloat(data.thickness);
let spacing = parseFloat(data.spaceSize);
let lenght = data.height;
let width = data.width;
let thickness = data.thickness;
let spacing = data.spaceSize;
let leftBoard = Jig.Draw(Board.CreateBoard(lenght, width, thickness, BoardType.Vertical));
let rightBoard = Jig.Draw(Board.CreateBoard(lenght, width, thickness, BoardType.Vertical));

@ -20,12 +20,11 @@ export class DrawSingleBoard implements Command
app.m_Editor.m_ModalManage.Callback = async () =>
{
const opt = store.m_BoardOption;
let board = Jig.Draw(Board.CreateBoard(parseFloat(opt.height), parseFloat(opt.width), parseFloat(opt.thickness), opt.type));
board.Name = opt.name;
let board = Jig.Draw(Board.CreateBoard(opt.height, opt.width, opt.thickness, opt.type));
board.m_BoardProcessOption = store.m_BoardProcessOption;
let rx = Math.degToRad(parseFloat(opt.rotateX));
let ry = Math.degToRad(parseFloat(opt.rotateY));
let rz = Math.degToRad(parseFloat(opt.rotateZ));
let rx = Math.degToRad(opt.rotateX);
let ry = Math.degToRad(opt.rotateY);
let rz = Math.degToRad(opt.rotateZ);
let eu = new Euler(rx, ry, rz);
board.ApplyMatrix(new Matrix4().makeRotationFromEuler(eu));

@ -77,12 +77,12 @@ export class DrawTopBottomBoard implements Command
let basePt: Vector3;
let length: number;
let thickness = parseFloat(opt.thickness);
let offset = parseFloat(opt.offset);
let forwardDistance = parseFloat(opt.forwardDistance);
let thickness = opt.thickness;
let offset = opt.offset;
let forwardDistance = opt.forwardDistance;
let rot = spaceParse.SpaceOCS;
let leftExt = parseFloat(opt.leftExt);
let rightExt = parseFloat(opt.rightExt);
let leftExt = opt.leftExt;
let rightExt = opt.rightExt;
if (opt.isWrapSide)
{
@ -107,14 +107,7 @@ export class DrawTopBottomBoard implements Command
let footBoard = Board.CreateBoard(
offset,
spaceParse.SpaceLength,
parseFloat(opt.footThickness), BoardType.Behind);
// footBoard.m_BoardConfigOption = {
// type: BoardType.Behind,
// name: "地脚线",
// height: offset.toString(),
// width: spaceParse.SpaceLength.toString(),
// thickness: opt.footThickness
// };
opt.footThickness, BoardType.Behind);
footBoard.m_BoardProcessOption = Object.assign({}, this.store.m_BoardProcessOption);
footBoard.m_BoardProcessOption.composingFace = ComposingType.Reverse;
footBoard.m_BoardProcessOption.bigHoleDir = PXLFaceType.Reverse;
@ -128,12 +121,9 @@ export class DrawTopBottomBoard implements Command
basePt.add(new Vector3(rightExt, -forwardDistance));
let len = length + leftExt + rightExt;
let width = spaceParse.SpaceWidth + forwardDistance + parseFloat(opt.behindDistance);
let width = spaceParse.SpaceWidth + forwardDistance + opt.behindDistance;
let board = Board.CreateBoard(len, width, thickness, BoardType.Layer);
// board.m_BoardConfigOption = Object.assign({}, opt);
// board.m_BoardConfigOption.height = len.toString();
// board.m_BoardConfigOption.width = width.toString();
board.m_BoardProcessOption = Object.assign({}, this.store.m_BoardProcessOption);

@ -10,28 +10,27 @@ import { DrawBoardTool } from './DrawBoardTool';
export class DrawVerticalBoard extends DrawBoardTool
{
protected drawType = BoardType.Vertical;
protected buildBoard(box: Box3Ext, ro: Matrix4, data: BoardData)
{
const opt = data.boardConfig as VerticalBoardOption;
let size = box.getSize(new Vector3());
let frontShrink = parseFloat(opt.frontShrink);
let bottomShink = parseFloat(opt.bottomShrink);
let width = (opt.isTotalWidth || opt.width === "L") ? size.y : parseFloat(opt.width);
let length = (opt.isTotalLength || opt.width === "H") ? size.z : parseFloat(opt.height);
let frontShrink = opt.frontShrink;
let bottomShink = opt.bottomShrink;
let width = (opt.isTotalWidth || opt.width === Infinity) ? size.y : opt.width;
let length = (opt.isTotalLength || opt.width === Infinity) ? size.z : opt.height;
if (opt.isTotalWidth) width -= frontShrink;
if (opt.isTotalLength) length -= bottomShink;
let count = parseInt(opt.count);
let count = opt.count;
let type = opt.boardRelative;
let spaceSize = parseFloat(opt.spaceSize);
let thickness = parseFloat(opt.thickness);
let spaceSize = opt.spaceSize;
let thickness = opt.thickness;
let board = Board.CreateBoard(length, width, thickness, BoardType.Vertical);
opt.height = length.toString();
opt.width = width.toString();
opt.height = length;
opt.width = width;
//等分单层空间大小
let singleSize = (size.x - (thickness * count)) / (count + 1);

@ -0,0 +1,30 @@
import { observable } from "mobx";
export class DataAdapter
{
static ConvertUIData(obj: Object, isobser: boolean = true): Object
{
let uiObj = {};
for (let i in obj)
{
if (typeof obj[i] === "number")
{
if (obj[i] === Infinity)
{
//=H?L?
uiObj[i] = "";
}
else
{
uiObj[i] = obj[i].toString();
}
}
else
{
uiObj[i] = obj[i];
}
}
return isobser ? observable.object(uiObj) : uiObj;
}
}

@ -4,29 +4,34 @@ import { observer } from 'mobx-react';
import * as React from 'react';
import { BehindHeightPositon, BrRelativePos } from '../../Store/BoardInterface';
import { BehindBoardStore } from '../../Store/BoardStore';
import { BoardConfigBlock, BoardModel, ItemName, SetBoardDataBlock, SetBoardDataItem } from './BoardCommon';
import { BoardModel, ItemName, SetBoardDataBlock, SetBoardDataItem, BoardRePosBlock } from './BoardCommon';
import { DataAdapter } from '../../../Common/DataAdapter';
@observer
export class BehindBoardModal extends React.Component<{ store?: BehindBoardStore }, {}>
{
@observable uiOption;
private m_ScaleParameter = [
["knifeRad", "刀具半径"],
["grooveAddLength", "槽加长"], ["grooveAddWidth", "槽加宽"], ["grooveAddDepth", "槽加深"]
];
@observable private moveDir = "移动";
constructor(props)
componentWillMount()
{
super(props);
let pos = this.props.store.m_BoardOption.boardPosition;
let store = this.props.store;
let pos = store.m_BoardOption.boardPosition;
this.uiOption = DataAdapter.ConvertUIData(store.m_BoardOption);
if (pos === BehindHeightPositon.ForTop)
this.moveDir = "上移"
this.moveDir = "上移";
else if (pos === BehindHeightPositon.ForBottom)
this.moveDir = "下移"
this.moveDir = "下移";
else
this.uiOption.height = "H"
}
render()
{
let store = this.props.store;
return (
<>
<ItemName title="板名称" opt={store.m_BoardOption} className="br-name" />
@ -34,7 +39,7 @@ export class BehindBoardModal extends React.Component<{ store?: BehindBoardStore
<h6 className={Classes.HEADING}></h6>
<SetBoardDataBlock
pars={this.m_ScaleParameter}
opt={store.m_BoardProcessOption}
option={store.m_BoardProcessOption}
className="flexWrap"
/>
</div>
@ -46,22 +51,22 @@ export class BehindBoardModal extends React.Component<{ store?: BehindBoardStore
{
let value = e.currentTarget.value as BehindHeightPositon
store.m_BoardOption.boardPosition = value;
let height = store.m_BoardOption.height;
let height = this.uiOption.height;
if (value === BehindHeightPositon.ForTop)
{
this.moveDir = "上移";
store.m_BoardOption.height = height === "H" ? "0" : height
this.uiOption.height = height === Infinity ? "0" : height
}
else if (value === BehindHeightPositon.ForBottom)
{
store.m_BoardOption.height = height === "H" ? "0" : height
this.uiOption.height = height === Infinity ? "0" : height
this.moveDir = "下移";
}
else
store.m_BoardOption.height = "H"
this.uiOption.height = "H";
}}
selectedValue={store.m_BoardOption.boardPosition}
selectedValue={this.uiOption.boardPosition}
>
<Radio label="总高" value={BehindHeightPositon.AllHeight} />
<Radio label="靠上" value={BehindHeightPositon.ForTop} />
@ -71,25 +76,33 @@ export class BehindBoardModal extends React.Component<{ store?: BehindBoardStore
<SetBoardDataItem
optKey="height"
option={store.m_BoardOption}
uiOption={this.uiOption}
title="板高"
isDisabled={store.m_BoardOption.boardPosition === BehindHeightPositon.AllHeight}
/>
<SetBoardDataItem
optKey="moveDist"
option={store.m_BoardOption}
uiOption={this.uiOption}
title={this.moveDir}
isDisabled={store.m_BoardOption.boardPosition === BehindHeightPositon.AllHeight}
/>
</div>
</div>
<BoardConfigBlock
opt={store.m_BoardOption}
opt1={new Map([[BrRelativePos.Front, "靠前"], [BrRelativePos.Back, "靠后"]])}
<BoardRePosBlock
uiOption={this.uiOption}
option={store.m_BoardOption}
posPars={new Map([[BrRelativePos.Front, "靠前"], [BrRelativePos.Back, "靠后"]])}
/>
<div className="process-data">
<h6 className={Classes.HEADING}></h6>
<div className="boardSize center">
<SetBoardDataItem title="上延伸" optKey="topExt" option={store.m_BoardOption} inline={true} />
<SetBoardDataItem
title="上延伸"
optKey="topExt"
option={store.m_BoardOption}
inline={true}
/>
<div>
<SetBoardDataItem title="左延伸" optKey="leftExt" option={store.m_BoardOption} inline={true} />
<BoardModel />

@ -2,15 +2,18 @@ import { Checkbox, Classes, HTMLSelect, Radio, RadioGroup } from '@blueprintjs/c
import { observer } from 'mobx-react';
import * as React from 'react';
import { BoardType } from '../../../DatabaseServices/Board';
import { BehindBoardOption, BoardConfigOption, BoardOption, BrRelativePos, LayerBoardOption, TBBoardOption, VerticalBoardOption } from '../../Store/BoardInterface';
import { BoardConfigOption, BoardOption, BrRelativePos, TBBoardOption } from '../../Store/BoardInterface';
import { BoardStore } from '../../Store/BoardStore';
import { DrillingOption } from './drillInterface';
type OptionType = BoardOption | DrillingOption;
interface ISetItemOption
{
optKey: string;
title: string;
option: OptionType;
uiOption?: Object;
isDisabled?: boolean;
placeHolder?: string;
onChange?: Function;
@ -18,41 +21,72 @@ interface ISetItemOption
}
interface ISetBlockOption
{
pars: Array<Array<string>>,
opt: BoardOption
className?: string,
isInline?: boolean,
pars: Array<Array<string>>;
option: OptionType;
uiOption?: Object;
className?: string;
isInline?: boolean;
}
interface TBProps
{
pars: Map<string, string>;
option: TBBoardOption;
uiOption: Object;
istop: boolean;
}
interface BroadPosProps
{
uiOption: Object;
option: BoardOption;
posPars: Map<BrRelativePos, string>;
}
type OptionType = BoardOption | DrillingOption
//设置板件数据组件
export const SetBoardDataItem = observer(
(opt: ISetItemOption) =>
<div className={"br-set " + (opt.inline ? "inline" : "")}>
<span>
{opt.title}
</span>
<input
className={BoardStore.IsVailOption(opt.optKey, opt.option[opt.optKey]) ? "bp3-input" : "bp3-input bp3-intent-danger"}
value={opt.option[opt.optKey]}
disabled={opt.isDisabled}
placeholder={opt.placeHolder}
onChange={e =>
{
if (!BoardStore.IsVailOption(opt.optKey, e.target.value))
(props: ISetItemOption) =>
{
let showData = props.uiOption ? props.uiOption : props.option;
return (
<div className={"br-set " + (props.inline ? "inline" : "")}>
<span>
{props.title}:
</span>
<input
className={BoardStore.IsVailOption(props.optKey, showData[props.optKey]) ? "bp3-input" : "bp3-input bp3-intent-danger"}
value={showData[props.optKey]}
disabled={props.isDisabled}
placeholder={props.placeHolder}
onChange={e =>
{
e.target.className += " bp3-intent-danger"
}
else
if (!BoardStore.IsVailOption(props.optKey, e.target.value))
{
e.target.className += " bp3-intent-danger"
}
else
{
e.target.className = "bp3-input"
}
showData[props.optKey] = e.target.value;
}}
onBlur={e =>
{
e.target.className = "bp3-input"
}
opt.option[opt.optKey] = e.target.value;
opt.onChange && opt.onChange();
}}
/>
</div >
if (
typeof props.option[props.optKey] === 'number'
&& e.target.value !== ""
&& !isNaN(parseFloat(e.target.value))
)
{
props.option[props.optKey] = parseFloat(e.target.value);
}
else
{
props.option[props.optKey] = e.target.value;
}
}}
/>
</div>
)
}
);
export const SetBoardDataBlock = observer(
@ -63,47 +97,50 @@ export const SetBoardDataBlock = observer(
<SetBoardDataItem
key={k}
optKey={k}
option={props.opt}
option={props.option}
uiOption={props.uiOption}
title={v}
/>
)
}
</div>
);
export const TBBoardDataBlock =
observer(
({ pars, opt, istop }: { pars: Map<string, string>, opt: TBBoardOption, istop: boolean }) =>
(props: TBProps) =>
{
return (
<div className="pt-card pt-elevation-0 tb-br">
<h6 className={Classes.HEADING}>{istop ? "顶板" : "底板"}</h6>
<h6 className={Classes.HEADING}>{props.istop ? "顶板" : "底板"}</h6>
<Checkbox
checked={opt.isDraw}
checked={props.option.isDraw}
label="是否绘制"
onChange={() => opt.isDraw = !opt.isDraw}
onChange={() => props.option.isDraw = !props.option.isDraw}
/>
<RadioGroup
className="flex"
onChange={e => opt.isWrapSide = e.currentTarget.value === "1"}
selectedValue={opt.isWrapSide ? "1" : "0"}
onChange={e => props.option.isWrapSide = e.currentTarget.value === "1"}
selectedValue={props.option.isWrapSide ? "1" : "0"}
>
<Radio className="widthHalf" label={istop ? "侧包顶" : "侧包底"} value="0" />
<Radio className="widthHalf" label={istop ? "顶包侧" : "底包侧"} value="1" />
<Radio className="widthHalf" label={props.istop ? "侧包顶" : "侧包底"} value="0" />
<Radio className="widthHalf" label={props.istop ? "顶包侧" : "底包侧"} value="1" />
</RadioGroup>
<div className="flexWrap">
{
Array.from(pars.keys()).map(k =>
Array.from(props.pars.keys()).map(k =>
{
if (k !== "footThickness" || (k === "footThickness" && !istop))
if (k !== "footThickness" || (k === "footThickness" && !props.istop))
return (
<SetBoardDataItem
title={pars.get(k)}
title={props.pars.get(k)}
optKey={k}
key={k}
option={opt}
option={props.option}
uiOption={props.uiOption}
isDisabled={
((k === "rightExt" || k === "leftExt") && !opt.isWrapSide) ||
((k === "offset" || k === "footThickness") && opt.isWrapSide)
((k === "rightExt" || k === "leftExt") && !props.option.isWrapSide) ||
((k === "offset" || k === "footThickness") && props.option.isWrapSide)
} />
)
})
@ -113,19 +150,16 @@ export const TBBoardDataBlock =
)
});
export const BoardModel = () =>
{
return (
<label className="boardModel">
<span className="arrow arrowtop"></span>
<span className="line"></span>
<span className="arrow arrowbottom"></span>
</label>
)
}
<label className="boardModel">
<span className="arrow arrowtop"></span>
<span className="line"></span>
<span className="arrow arrowbottom"></span>
</label>
export const BoardConfigBlock = observer(
({ opt, opt1 }: { opt: VerticalBoardOption | LayerBoardOption | BehindBoardOption, opt1: Map<BrRelativePos, string> }) =>
export const BoardRePosBlock = observer(
(props: BroadPosProps) =>
{
let pars =
[["spaceSize", "空间"], ["count", "板数"], ["thickness", "板厚"]];
@ -137,13 +171,13 @@ export const BoardConfigBlock = observer(
onChange={e =>
{
let value = e.currentTarget.value as BrRelativePos;
opt.boardRelative = value;
props.option["boardRelative"] = value;
}}
selectedValue={opt.boardRelative}
selectedValue={props.option["boardRelative"]}
>
{
Array.from(opt1.keys()).map((k, i) =>
<Radio key={i} label={opt1.get(k)} value={k} />
Array.from(props.posPars.keys()).map((k, i) =>
<Radio key={i} label={props.posPars.get(k)} value={k} />
)
}
<Radio label="等分" value={BrRelativePos.Div} />
@ -154,9 +188,10 @@ export const BoardConfigBlock = observer(
<SetBoardDataItem
key={k}
optKey={k}
option={opt}
uiOption={props.uiOption}
option={props.option}
title={v}
isDisabled={(k === "spaceSize" && opt.boardRelative === BrRelativePos.Div)}
isDisabled={(k === "spaceSize" && props.option["boardRelative"] === BrRelativePos.Div)}
/>
)
}

@ -24,17 +24,17 @@ export const BoardConfigModal =
<SetBoardDataBlock
className="flexWrap"
pars={pars}
opt={data.boardConfig}
option={data.boardConfig}
/>
<SetBoardDataBlock
className="flexWrap"
pars={rotatePars}
opt={data.boardConfig}
option={data.boardConfig}
/>
<SetBoardDataBlock
className="flexWrap"
pars={groovePars}
opt={data.boardProcess}
option={data.boardProcess}
/>
<div>
<Checkbox checked={true} label="异型" inline={true} />

@ -30,12 +30,12 @@ export class BoardOptionModal extends React.Component<{ board: Board }, {}>
let newConfig = {
name: br.Name,
type: br.BoardType,
height: FixedNotZero(br.Length, 2),
width: FixedNotZero(br.Width, 2),
thickness: FixedNotZero(br.Thickness, 2),
rotateX: FixedNotZero(Math.radToDeg(euler.x), 2),
rotateY: FixedNotZero(Math.radToDeg(euler.y), 2),
rotateZ: FixedNotZero(Math.radToDeg(euler.z), 2),
height: parseFloat(FixedNotZero(br.Length, 2)),
width: parseFloat(FixedNotZero(br.Width, 2)),
thickness: parseFloat(FixedNotZero(br.Thickness, 2)),
rotateX: parseFloat(FixedNotZero(Math.radToDeg(euler.x), 2)),
rotateY: parseFloat(FixedNotZero(Math.radToDeg(euler.y), 2)),
rotateZ: parseFloat(FixedNotZero(Math.radToDeg(euler.z), 2)),
}
if (this.m_ConfigOption)
{
@ -51,17 +51,17 @@ export class BoardOptionModal extends React.Component<{ board: Board }, {}>
let board = this.props.board;
Object.assign(board.m_BoardProcessOption, this.m_ProcessOption);
board.Name = this.m_ConfigOption.name;
board.Length = parseFloat(this.m_ConfigOption.height);
board.Width = parseFloat(this.m_ConfigOption.width);
board.Thickness = parseFloat(this.m_ConfigOption.thickness);
board.Length = this.m_ConfigOption.height;
board.Width = this.m_ConfigOption.width;
board.Thickness = this.m_ConfigOption.thickness;
board.BoardType = this.m_ConfigOption.type;
//应用旋转分量
let oldEuler = new Euler().setFromRotationMatrix(new Matrix4().extractRotation(board.BoardOCS));
let newEuler = new Euler(
Math.degToRad(parseFloat(this.m_ConfigOption.rotateX)),
Math.degToRad(parseFloat(this.m_ConfigOption.rotateY)),
Math.degToRad(parseFloat(this.m_ConfigOption.rotateZ))
Math.degToRad(this.m_ConfigOption.rotateX),
Math.degToRad(this.m_ConfigOption.rotateY),
Math.degToRad(this.m_ConfigOption.rotateZ)
)
if (!equaln(oldEuler.x, newEuler.x)
|| !equaln(oldEuler.y, newEuler.y)

@ -26,7 +26,7 @@ export const BoardProcessModal = observer(({ opt }: { opt: BoardProcessOption })
<div className="flex br-mat">
<SetBoardDataBlock
pars={matPars}
opt={opt}
option={opt}
isInline={true}
/>
<button className="bp3-button bp3-intent-success"></button>

@ -37,7 +37,7 @@ export const ClosingStripModal =
<h6 className={Classes.HEADING}></h6>
<SetBoardDataBlock
pars={pars}
opt={props.store.m_BoardOption}
option={props.store.m_BoardOption}
/>
</div>
)

@ -2,9 +2,17 @@ import { Button, Classes } from '@blueprintjs/core';
import { observer } from 'mobx-react';
import * as React from 'react';
import { DrillStore } from '../../Store/DrillStore';
import { observable } from 'mobx';
import { DataAdapter } from '../../../Common/DataAdapter';
@observer
export class DrillRulesComponent extends React.Component<{ store?: DrillStore }, {}>{
export class DrillRulesComponent extends React.Component<{ store?: DrillStore, data: any }, {}>{
@observable uiOption: Object;
constructor(props)
{
super(props);
this.uiOption = DataAdapter.ConvertUIData(this.props.store.m_BoardOption);
}
render()
{
const store = this.props.store;
@ -14,10 +22,12 @@ export class DrillRulesComponent extends React.Component<{ store?: DrillStore },
<div>
<input
className="bp3-input"
value={store.m_BoardOption.startDist}
value={this.uiOption["startDist"]}
onChange={e =>
{
store.m_BoardOption.startDist = e.target.value;
this.uiOption["startDist"] = e.target.value;
if (e.target.value !== "" && !isNaN(parseFloat(e.target.value)))
store.m_BoardOption.startDist = parseFloat(e.target.value);
}}
/>
<span>
@ -25,10 +35,12 @@ export class DrillRulesComponent extends React.Component<{ store?: DrillStore },
</span>
<input
className="bp3-input"
value={store.m_BoardOption.endDist}
value={this.uiOption["endDist"]}
onChange={e =>
{
store.m_BoardOption.endDist = e.target.value;
this.uiOption["endDist"] = e.target.value;
if (e.target.value !== "" && !isNaN(parseFloat(e.target.value)))
store.m_BoardOption.endDist = parseFloat(e.target.value);
}}
/>
<Button

@ -1,22 +1,27 @@
import { Button, Checkbox, Classes, Radio, RadioGroup,Icon } from '@blueprintjs/core';
import { Button, Checkbox, Classes, HTMLSelect, Icon, Radio, RadioGroup } from '@blueprintjs/core';
import { observable } from 'mobx';
import { inject, observer } from 'mobx-react';
import * as React from 'react';
import * as xaop from 'xaop';
import { app } from '../../../ApplicationServices/Application';
import { DataAdapter } from '../../../Common/DataAdapter';
import { KeyBoard } from '../../../Common/KeyEnum';
import { commandMachine } from '../../../Editor/CommandMachine';
import { DrillStore } from '../../Store/DrillStore';
import { ModalState } from '../Modal/ModalsManage';
import { ItemName, SetBoardDataItem } from './BoardCommon';
import { BoardModalType } from './BoardModal';
import { DrillType, SpacingType } from './drillInterface';
import { DrillRulesComponent } from './DrillRules';
import { UserConfig } from './UserConfig';
import { commandMachine } from '../../../Editor/CommandMachine';
import { ModalState } from '../Modal/ModalsManage';
import { KeyBoard } from '../../../Common/KeyEnum';
import * as xaop from 'xaop';
@inject('store')
@observer
export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
@observable private showData;
private posPars = [["originDist", "起始距离"], ["retDist", "剩余距离"]];
private holePars = [
["wbHoleRad", "大孔半径"], ["wbHoleDepth", "大孔深度"],
@ -28,7 +33,11 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
["ljgRad", "连接杆半径"], ["ljgLength", "连接杆长度"],
["ymjRad", "预埋件半径"], ["ymjDepth", "预埋件深度"]
];
constructor(props)
{
super(props);
this.showData = DataAdapter.ConvertUIData(this.props.store.m_BoardOption);
}
registerEvent()
{
let store = this.props.store;
@ -75,15 +84,19 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
{
store.type = e.currentTarget.value as DrillType;
if (store.type === DrillType.Three){
store. m_BoardOption.name = "三合一";
store. m_BoardOption.pxlRad="7.5";
store. m_BoardOption.ljgLength="34";
store.m_BoardOption.name = "三合一";
store.m_BoardOption.pxlRad=7.5;
store.m_BoardOption.ljgLength=34;
this.showData["pxlRad"]="7.5";
this.showData["ljgLength"]="34";
}
else
{
store. m_BoardOption.name = "二合一";
store. m_BoardOption.pxlRad = "10";
store. m_BoardOption.ljgLength = "10";
store.m_BoardOption.name = "二合一";
store.m_BoardOption.pxlRad = 10;
store.m_BoardOption.ljgLength = 10;
this.showData["pxlRad"] = "10";
this.showData["ljgLength"] = "10";
}
}}
>
@ -104,11 +117,12 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
<ItemName title="拆单名" opt={store. m_BoardOption} className="small-name"/>
<SetBoardDataItem
optKey="count"
option={store. m_BoardOption}
option={store.m_BoardOption}
uiOption={this.showData}
title="数量"
onChange={()=>{
if (parseFloat(store. m_BoardOption.count) <= 2 && store. m_BoardOption.haveDist){
store. m_BoardOption.haveDist=false
if (parseFloat(this.showData["count"]) <= 2 && this.showData["haveDist"]){
store.m_BoardOption.haveDist=false;
}
}}
/>
@ -119,7 +133,8 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
<SetBoardDataItem
key={k}
optKey={k}
option={store. m_BoardOption}
option={store.m_BoardOption}
uiOption={this.showData}
title={v}
isDisabled={
(k === "retDist" && store. m_BoardOption.isEqualProportion)
@ -136,7 +151,8 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
selectedValue={store. m_BoardOption.spacing}
onChange={e =>
{
store. m_BoardOption.spacing = e.currentTarget.value as SpacingType;
this.showData.spacing = e.currentTarget.value;
store.m_BoardOption.spacing = e.currentTarget.value as SpacingType;
}}
>
<Radio label="间距等分" disabled={store. m_BoardOption.isEqualProportion ||store. m_BoardOption.isFromBack} value={SpacingType.EqualDist} />
@ -169,10 +185,10 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
<div>
<Checkbox
disabled={
store. m_BoardOption.isForceDiv
|| !store. m_BoardOption.count
|| parseFloat(store. m_BoardOption.count) <= 2
|| store. m_BoardOption.spacing===SpacingType.EqualDist
store.m_BoardOption.isForceDiv
|| !store.m_BoardOption.count
|| parseFloat(this.showData.count) <= 2
|| store.m_BoardOption.spacing===SpacingType.EqualDist
}
checked={store. m_BoardOption.haveDist}
inline={true}
@ -180,12 +196,15 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
onChange={() => store. m_BoardOption.haveDist = !store. m_BoardOption.haveDist}
/>
<input
disabled={store. m_BoardOption.isForceDiv || !store. m_BoardOption.count || parseFloat(store. m_BoardOption.count) <= 2}
disabled={store.m_BoardOption.isForceDiv
|| this.showData.count===""
|| parseFloat(this.showData.count) <= 2}
className="bp3-input dist-input"
value={store. m_BoardOption.dist2To1Dist}
value={this.showData.dist2To1Dist}
onChange={e =>
{
store. m_BoardOption.dist2To1Dist = e.target.value;
this.showData.dist2To1Dist = e.target.value;
store.m_BoardOption.dist2To1Dist = parseFloat(e.target.value);
}}
/>
</div>
@ -196,10 +215,11 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
<input
type="text"
className="bp3-input"
value={store. m_BoardOption.pxlOffset}
value={this.showData.pxlOffset}
onChange={e =>
{
store. m_BoardOption.pxlOffset = e.target.value;
store.m_BoardOption.pxlOffset = parseFloat(e.target.value);
this.showData.pxlOffset = e.target.value;
}}
/>
</div>
@ -207,10 +227,11 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
<span>:</span>
<input
className="bp3-input"
value={store. m_BoardOption.collsionDist}
value={this.showData.collsionDist}
onChange={e =>
{
store. m_BoardOption.collsionDist = e.target.value;
store.m_BoardOption.collsionDist = parseFloat(e.target.value);
this.showData.collsionDist = e.target.value;
}}
/>
</div>
@ -273,14 +294,17 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
</div>
<div>
<Checkbox checked={true} inline={true} label="使用模板" />
<div className="bp3-select bp3-inline .modifier">
<select>
<option value="0">1</option>
<option value="1">1</option>
<option value="1">1</option>
</select>
</div>
<Checkbox checked={false} inline={true} label="使用模板" />
<HTMLSelect
options={
[
{
label:"模板",
value:""
}
]
}
/>
</div>
<h5 className={Classes.HEADING}></h5>
<Checkbox
@ -307,10 +331,14 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
<div className="small-input flexWrap flex-col">
<div>
<span></span>
<input type="text" className="bp3-input" value={store. m_BoardOption.notGangDist} onChange={e =>
{
store. m_BoardOption.notGangDist = e.target.value;
}} />
<input
className="bp3-input"
value={this.showData.notGangDist}
onChange={e =>
{
this.showData.notGangDist = e.target.value;
store.m_BoardOption.notGangDist = parseFloat(e.target.value);
}} />
<span></span>
</div>
@ -318,7 +346,7 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
</div>
</div>
<div className="bp3-card small-input flex flex-col">
<DrillRulesComponent store={store} />
<DrillRulesComponent store={store} data={this.showData} />
</div>
</div>
</div>

@ -3,7 +3,8 @@ import { observer } from 'mobx-react';
import * as React from 'react';
import { BrRelativePos } from '../../Store/BoardInterface';
import { LayerBoardStore } from '../../Store/BoardStore';
import { BoardConfigBlock, ItemName, SetBoardDataBlock, SetBoardDataItem } from './BoardCommon';
import { BoardRePosBlock, SetBoardDataBlock, SetBoardDataItem, ItemName } from './BoardCommon';
import { DataAdapter } from '../../../Common/DataAdapter';
export const LayerBoardModal =
(observer((props: { store?: LayerBoardStore }) =>
@ -13,6 +14,7 @@ export const LayerBoardModal =
const nailPars2 = [["front", "前边"], ["behind", "后边"], ["count", "个数"], ["rad", "半径"], ["length", "长度"], ["depth", "深度"]];
let brOpt = props.store.m_BoardOption;
let uiOption = DataAdapter.ConvertUIData(brOpt);
let nailOpt = props.store.layerNailOption;
return (
<>
@ -25,20 +27,27 @@ export const LayerBoardModal =
{
brOpt.isTotalLength = !brOpt.isTotalLength;
if (brOpt.isTotalLength)
brOpt.height = "L";
{
uiOption['height'] = "L";
brOpt.height = Infinity;
}
}} />
<Checkbox checked={brOpt.isActive} label="活动" className="widthHalf" onChange={() =>
{
brOpt.isActive = !brOpt.isActive;
if (brOpt.isActive)
{
brOpt.leftShrink = "1";
brOpt.rightShrink = "1";
uiOption['leftShrink'] = "1";
uiOption['rightShrink'] = "1";
brOpt.leftShrink = 1;
brOpt.rightShrink = 1;
}
else
{
brOpt.leftShrink = "0";
brOpt.rightShrink = "0";
uiOption['leftShrink'] = "0";
uiOption['rightShrink'] = "0";
brOpt.leftShrink = 0;
brOpt.rightShrink = 0;
}
}} />
@ -50,6 +59,7 @@ export const LayerBoardModal =
key={k}
optKey={k}
option={brOpt}
uiOption={uiOption}
title={v}
isDisabled={(k === "height" && brOpt.isTotalLength)}
/>
@ -103,13 +113,14 @@ export const LayerBoardModal =
</div>
<SetBoardDataBlock
pars={nailPars2}
opt={props.store.layerNailOption}
option={props.store.layerNailOption}
className="flexWrap"
/>
</div>
<BoardConfigBlock
opt={props.store.m_BoardOption}
opt1={new Map([[BrRelativePos.Top, "靠上"], [BrRelativePos.Bottom, "靠下"]])}
<BoardRePosBlock
uiOption={uiOption}
option={props.store.m_BoardOption}
posPars={new Map([[BrRelativePos.Top, "靠上"], [BrRelativePos.Bottom, "靠下"]])}
/>
</>
)

@ -1,7 +1,8 @@
import { observer } from "mobx-react";
import * as React from 'react';
import { DataAdapter } from '../../../Common/DataAdapter';
import { SingleBoardStore } from "../../Store/BoardStore";
import { ItemName, SetBoardDataBlock, BoardTypeComponent } from "./BoardCommon";
import { BoardTypeComponent, ItemName, SetBoardDataBlock } from "./BoardCommon";
export const SingleBoardModal =
(observer((props: { store?: SingleBoardStore }) =>
@ -14,18 +15,20 @@ export const SingleBoardModal =
];
let opt = props.store.m_BoardOption;
let processOpt = props.store.m_BoardProcessOption;
let uiOpt = DataAdapter.ConvertUIData(opt);
return (
<div>
<BoardTypeComponent opt={opt} />
<ItemName title="板名称" opt={props.store.m_BoardOption} />
<SetBoardDataBlock
pars={pars}
opt={opt}
option={opt}
uiOption={uiOpt}
isInline={true}
/>
<SetBoardDataBlock
pars={processPars}
opt={processOpt}
option={processOpt}
isInline={true}
/>
</div>

@ -2,12 +2,14 @@ import { observer } from 'mobx-react';
import * as React from 'react';
import { TopBottomBoardStore } from '../../Store/BoardStore';
import { TBBoardDataBlock } from './BoardCommon';
import { DataAdapter } from '../../../Common/DataAdapter';
export const TopBottomBoardModal =
(observer((props: { store?: TopBottomBoardStore }) =>
{
let store = props.store;
const uiTOption = DataAdapter.ConvertUIData(store.topBoardOption);
const uiBOption = DataAdapter.ConvertUIData(store.bottomBoardOption);
let pars = new Map([
["thickness", "板厚"], ["forwardDistance", "前距"], ["behindDistance", "后距"],
["leftExt", "左延伸"], ["rightExt", "右延伸"],
@ -16,12 +18,14 @@ export const TopBottomBoardModal =
return (
<div>
<TBBoardDataBlock
opt={store.topBoardOption}
option={store.topBoardOption}
uiOption={uiTOption}
pars={pars}
istop={true}
/>
<TBBoardDataBlock
opt={store.bottomBoardOption}
option={store.bottomBoardOption}
uiOption={uiBOption}
pars={pars}
istop={false}
/>

@ -3,7 +3,8 @@ import { observer } from 'mobx-react';
import * as React from 'react';
import { BrRelativePos } from '../../Store/BoardInterface';
import { VerticalBoardStore } from '../../Store/BoardStore';
import { BoardConfigBlock, ItemName, SetBoardDataItem } from './BoardCommon';
import { BoardRePosBlock, SetBoardDataItem, ItemName } from './BoardCommon';
import { DataAdapter } from '../../../Common/DataAdapter';
export const VerticalBoardModal =
(observer((props: { store?: VerticalBoardStore }) =>
@ -11,6 +12,18 @@ export const VerticalBoardModal =
const store = props.store;
const scalePars = [["frontShrink", "前缩"], ["bottomShrink", "位高"], ["width", "板深"], ["height", "板高"]];
const brOpt = store.m_BoardOption;
const uiOption = DataAdapter.ConvertUIData(brOpt);
if (brOpt.isTotalWidth)
uiOption["width"] = "L";
else
uiOption["width"] = brOpt.width === Infinity ? "L" : brOpt.width.toString();
if (brOpt.isTotalLength)
uiOption["height"] = "H";
else
uiOption["height"] = brOpt.height === Infinity ? "H" : brOpt.height.toString();
return (
<>
<ItemName title="板名称" opt={props.store.m_BoardOption} className="br-name" />
@ -21,14 +34,14 @@ export const VerticalBoardModal =
<Checkbox checked={brOpt.isTotalWidth} className="widthHalf" label="总深" onChange={() =>
{
brOpt.isTotalWidth = !brOpt.isTotalWidth;
if (brOpt.isTotalWidth)
brOpt.width = "L";
uiOption["width"] = brOpt.isTotalWidth ? "L" : uiOption["width"];
}} />
<Checkbox checked={brOpt.isTotalLength} className="widthHalf" label="总高" onChange={() =>
{
brOpt.isTotalLength = !brOpt.isTotalLength;
if (brOpt.isTotalLength)
brOpt.height = "H";
uiOption["height"] = brOpt.isTotalWidth ? "H" : uiOption["height"];
}} />
</div>
<div className="flexWrap">
@ -37,6 +50,7 @@ export const VerticalBoardModal =
<SetBoardDataItem
key={k}
optKey={k}
uiOption={uiOption}
option={store.m_BoardOption}
title={v}
isDisabled={(k === "width" && store.m_BoardOption.isTotalWidth)
@ -48,9 +62,10 @@ export const VerticalBoardModal =
</div>
</div>
</div>
<BoardConfigBlock
opt={store.m_BoardOption}
opt1={new Map([[BrRelativePos.Left, "靠左"], [BrRelativePos.Right, "靠右"]])}
<BoardRePosBlock
uiOption={uiOption}
option={store.m_BoardOption}
posPars={new Map([[BrRelativePos.Left, "靠左"], [BrRelativePos.Right, "靠右"]])}
/>
</>
)

@ -10,43 +10,37 @@ export enum SpacingType
}
export interface DrillingOption
{
startDist: string;
endDist: string;
startDist: number;
endDist: number;
name: string;//拆单名
originDist: string;//起始距离
retDist: string;//剩余距离
originDist: number;//起始距离
retDist: number;//剩余距离
isEqualProportion: boolean;//是否等比例
spacing: SpacingType;//间距类型
count: string;//排钻数量
count: number;//排钻数量
isFromBack: boolean;//余量是否从后面算
isForceDiv: boolean;//是否强制等分
notGangDist: string;//不排钻距离
pxlOffset: string;//偏心轮偏移距离
collsionDist: string;//碰撞偏移距离
notGangDist: number;//不排钻距离
pxlOffset: number;//偏心轮偏移距离
collsionDist: number;//碰撞偏移距离
haveDist: boolean; //第二个排钻距离第一个排钻
dist2To1Dist: string; //第二个排钻距离第一个排钻的距离
dist2To1Dist: number; //第二个排钻距离第一个排钻的距离
tIsOffset: boolean;//通孔偏移
tIsChange: boolean;//通孔改预埋件
tHoleOffset: string; //通孔偏移
tYmjRad: string;//通孔改小孔半径
tHoleOffset: number; //通孔偏移
tYmjRad: number;//通孔改小孔半径
isDrawWood: boolean;
wbHoleRad: string;//木销大孔
wbHoleDepth: string;
wsHoleRad: string;//木销小孔
wsHoleLength: string;
wdepth: string;//木销深度
pxlRad: string;//偏心轮
pxlDepth: string;
ljgRad: string;//连接杆
ljgLength: string;
ymjRad: string;//预埋件
ymjDepth: string;
wbHoleRad: number;//木销大孔
wbHoleDepth: number;
wsHoleRad: number;//木销小孔
wsHoleLength: number;
wdepth: number;//木销深度
pxlRad: number;//偏心轮
pxlDepth: number;
ljgRad: number;//连接杆
ljgLength: number;
ymjRad: number;//预埋件
ymjDepth: number;
ljgPos: string;//偏心轮位置
woodPinPos: string;//木销位置
}
export interface DrillRule
{
startDist: string;
endDist: string;
}

@ -1,5 +1,6 @@
import { observer } from 'mobx-react';
import * as React from 'react';
import { DataAdapter } from '../../../Common/DataAdapter';
import { SideBoardStore } from '../../Store/BoardStore';
import { SetBoardDataBlock } from './BoardCommon';
@ -8,11 +9,12 @@ export const LeftRightBoardModal =
(observer((props: { store?: SideBoardStore }) =>
{
let pars = [["height", "柜高"], ["width", "柜深"], ["thickness", "板厚"], ["spaceSize", "总宽"]];
let uiOption = DataAdapter.ConvertUIData(props.store.m_BoardOption);
return (
<SetBoardDataBlock
pars={pars}
opt={props.store.m_BoardOption}
isInline={true}
uiOption={uiOption}
option={props.store.m_BoardOption}
className="lr-br"
/>
)

@ -97,13 +97,13 @@ export interface BoardConfigOption extends BoardOption
{
type: BoardType;
name: string;
thickness?: string;
height?: string;
width?: string;
thickness?: number;
height?: number;
width?: number;
}
export interface SideBoardOption extends BoardConfigOption
{
spaceSize?: string; //空间宽度
spaceSize?: number; //空间宽度
}
/**
@ -116,16 +116,16 @@ export interface SideBoardOption extends BoardConfigOption
export interface BehindBoardOption extends BoardConfigOption
{
//上下左右延伸
leftExt: string;
rightExt: string;
topExt: string;
bottomExt: string;
leftExt: number;
rightExt: number;
topExt: number;
bottomExt: number;
//板件位置
boardPosition: BehindHeightPositon;
moveDist: string;
moveDist: number;
spaceSize?: string;
count?: string;
spaceSize?: number;
count?: number;
//板件相对位置
boardRelative?: BrRelativePos;
}
@ -139,14 +139,13 @@ export interface BehindBoardOption extends BoardConfigOption
*/
export interface LayerBoardOption extends BoardConfigOption
{
//前后左右缩
frontShrink: string;
leftShrink: string;
rightShrink: string;
frontShrink: number;
leftShrink: number;
rightShrink: number;
isTotalLength: boolean;
isActive: boolean;
spaceSize?: string;
count?: string;
spaceSize?: number;
count?: number;
boardRelative?: BrRelativePos;
}
@ -181,30 +180,30 @@ export interface LayerNailOption
*/
export interface VerticalBoardOption extends BoardConfigOption
{
frontShrink: string; //前缩
bottomShrink: string;//底缩
frontShrink: number; //前缩
bottomShrink: number;//底缩
isTotalLength: boolean; //是否取总高
isTotalWidth: boolean;//是否取总宽
count?: string;
spaceSize?: string;
count?: number;
spaceSize?: number;
boardRelative?: BrRelativePos;
}
export interface TBBoardOption extends BoardConfigOption
{
isDraw: boolean;
forwardDistance: string; //前距
behindDistance: string; //后距
forwardDistance: number; //前距
behindDistance: number; //后距
isWrapSide: boolean;
leftExt: string;
rightExt: string;
offset: string;
footThickness: string; //地脚厚
leftExt: number;
rightExt: number;
offset: number;
footThickness: number; //地脚厚
}
export interface SingleBoardOption extends BoardConfigOption
{
rotateX: string;
rotateY: string;
rotateZ: string;
rotateX: number;
rotateY: number;
rotateZ: number;
}
export enum StripType

@ -96,10 +96,10 @@ export class SideBoardStore extends BoardStore
@observable m_BoardOption: SideBoardOption = {
type: BoardType.Vertical,
name: "",
height: "1200",
width: "600",
thickness: "18",
spaceSize: "836"
height: 1200,
width: 600,
thickness: 18,
spaceSize: 836
};
title = "左右侧板";
}
@ -110,27 +110,27 @@ export class TopBottomBoardStore extends BoardStore
type: BoardType.Layer,
name: "顶板",
isDraw: true,
thickness: "18",
forwardDistance: "0",
behindDistance: "-18",
thickness: 18,
forwardDistance: 0,
behindDistance: -18,
isWrapSide: false,
leftExt: "0",
rightExt: "0",
offset: "0",
footThickness: "18"
leftExt: 0,
rightExt: 0,
offset: 0,
footThickness: 18
};
@observable bottomBoardOption: TBBoardOption = {
type: BoardType.Layer,
name: "底板",
isDraw: true,
thickness: "18",
forwardDistance: "0",
behindDistance: "-18",
thickness: 18,
forwardDistance: 0,
behindDistance: -18,
isWrapSide: false,
leftExt: "0",
rightExt: "0",
offset: "80",
footThickness: "18"
leftExt: 0,
rightExt: 0,
offset: 80,
footThickness: 18
};
title = "顶底板";
@ -167,17 +167,17 @@ export class BehindBoardStore extends BoardStore
@observable m_BoardOption: BehindBoardOption = {
type: BoardType.Behind,
name: "背板",
leftExt: "0",
rightExt: "0",
topExt: "0",
bottomExt: "0",
thickness: "18",
leftExt: 0,
rightExt: 0,
topExt: 0,
bottomExt: 0,
thickness: 18,
boardPosition: BehindHeightPositon.AllHeight,
height: "H",
moveDist: "0",
height: Infinity,
moveDist: 0,
boardRelative: BrRelativePos.Back,
spaceSize: "0",
count: "1"
spaceSize: 0,
count: 1
};
constructor()
{
@ -192,15 +192,15 @@ export class LayerBoardStore extends BoardStore
@observable m_BoardOption: LayerBoardOption = {
type: BoardType.Layer,
name: "层板",
frontShrink: "0",
leftShrink: "0",
rightShrink: "0",
height: "L",
frontShrink: 0,
leftShrink: 0,
rightShrink: 0,
height: Infinity,
isTotalLength: true,
boardRelative: BrRelativePos.Div,
thickness: "18",
count: "1",
spaceSize: "0",
thickness: 18,
count: 1,
spaceSize: 0,
isActive: false
}
@observable layerNailOption: LayerNailOption = {
@ -246,16 +246,16 @@ export class VerticalBoardStore extends BoardStore
@observable m_BoardOption: VerticalBoardOption = {
type: BoardType.Vertical,
name: "立板",
frontShrink: "0",
bottomShrink: "0",
width: "L",
height: "H",
frontShrink: 0,
bottomShrink: 0,
width: Infinity,
height: Infinity,
isTotalLength: true,
isTotalWidth: true,
boardRelative: BrRelativePos.Div,
thickness: "18",
count: "1",
spaceSize: "0"
thickness: 18,
count: 1,
spaceSize: 0
}
}
@ -265,12 +265,12 @@ export class SingleBoardStore extends BoardStore
@observable m_BoardOption: SingleBoardOption = {
name: "层板",
type: BoardType.Layer,
height: "1200",
width: "600",
thickness: "18",
rotateX: "0",
rotateY: "0",
rotateZ: "0"
height: 1200,
width: 600,
thickness: 18,
rotateX: 0,
rotateY: 0,
rotateZ: 0
}
}
export class ClosingStripStore extends BoardStore
@ -281,8 +281,8 @@ export class ClosingStripStore extends BoardStore
name: "收口条",
striptype: StripType.H,
boardRelative: BrRelativePos.Left,
width: "50",
thickness: "18"
width: 50,
thickness: 18
}
}
export class DoorStore extends BoardStore

@ -20,40 +20,40 @@ export class DrillStore extends BoardStore
Init()
{
let originOption: DrillingOption = {
startDist: "0",
endDist: "40",
startDist: 0,
endDist: 40,
//位置参数
name: "三合一",
originDist: "50",
retDist: "50",
originDist: 50,
retDist: 50,
isEqualProportion: false,
spacing: SpacingType.EqualDist,
count: "0",
count: 0,
//木销属性
isDrawWood: false,
wbHoleRad: "0",
wbHoleDepth: "13.5",
wsHoleRad: "3",
wsHoleLength: "20",
wdepth: "13.5",
wbHoleRad: 0,
wbHoleDepth: 13.5,
wsHoleRad: 3,
wsHoleLength: 20,
wdepth: 13.5,
//通孔属性
tIsOffset: true,
tIsChange: false,
tHoleOffset: "0",
tYmjRad: "5",
tHoleOffset: 0,
tYmjRad: 5,
isFromBack: false,
isForceDiv: false,
notGangDist: "15",
pxlOffset: "0",
collsionDist: "15",
notGangDist: 15,
pxlOffset: 0,
collsionDist: 15,
haveDist: false,
dist2To1Dist: "128",
pxlRad: "7.5",
pxlDepth: "13.5",
ljgRad: "3",
ljgLength: "34",
ymjRad: "5",
ymjDepth: "13.5",
dist2To1Dist: 128,
pxlRad: 7.5,
pxlDepth: 13.5,
ljgRad: 3,
ljgLength: 34,
ymjRad: 5,
ymjDepth: 13.5,
ljgPos: "H*0.5",
woodPinPos: "H*0.5"
}
@ -62,43 +62,43 @@ export class DrillStore extends BoardStore
this.rules.push(originOption);
let opt1 = Object.assign({}, originOption);
opt1.count = "1";
opt1.startDist = "40";
opt1.endDist = "80";
opt1.count = 1;
opt1.startDist = 40;
opt1.endDist = 80;
this.rules.push(opt1);
let opt2 = Object.assign({}, opt1);
opt2.count = "2";
opt2.count = 2;
opt2.isForceDiv = true;
opt2.startDist = "80";
opt2.endDist = "200";
opt2.startDist = 80;
opt2.endDist = 200;
this.rules.push(opt2);
let opt3 = Object.assign({}, opt2);
opt3.isForceDiv = false;
opt3.startDist = "200";
opt3.endDist = "500";
opt3.startDist = 200;
opt3.endDist = 500;
this.rules.push(opt3);
let opt4 = Object.assign({}, opt3);
opt4.count = "3";
opt4.startDist = "500";
opt4.endDist = "900";
opt4.count = 3;
opt4.startDist = 500;
opt4.endDist = 900;
this.rules.push(opt4);
let opt5 = Object.assign({}, opt4);
opt5.count = "4";
opt5.startDist = "900";
opt5.endDist = "1500";
opt5.count = 4;
opt5.startDist = 900;
opt5.endDist = 1500;
this.rules.push(opt5);
let opt6 = Object.assign({}, opt5);
opt6.count = "5";
opt6.originDist = "100";
opt6.retDist = "100";
opt6.startDist = "1500";
opt6.endDist = "2000";
opt6.count = 5;
opt6.originDist = 100;
opt6.retDist = 100;
opt6.startDist = 1500;
opt6.endDist = 2000;
this.rules.push(opt6);
}
SaveRuleOption()
@ -115,7 +115,7 @@ export class DrillStore extends BoardStore
hasEqualRule = false;
break;
}
if (parseFloat(this.m_BoardOption.startDist) > parseFloat(rule.startDist))
if (this.m_BoardOption.startDist > rule.startDist)
{
insertIndex = i;
}

Loading…
Cancel
Save