|
|
|
@ -30,13 +30,13 @@ export interface IConfigStore
|
|
|
|
|
EditorTemplate?: TemplateRecord;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class BoardStore extends Singleton implements IConfigStore
|
|
|
|
|
export class BoardStore<T = IBaseOption> extends Singleton implements IConfigStore
|
|
|
|
|
{
|
|
|
|
|
@observable configName = "默认";
|
|
|
|
|
@observable configsNames: string[] = [];
|
|
|
|
|
EditorTemplate: TemplateRecord;
|
|
|
|
|
m_Option: IBaseOption;
|
|
|
|
|
protected m_UiOption;
|
|
|
|
|
m_Option: T;
|
|
|
|
|
protected m_UiOption: IUiOption<T>;
|
|
|
|
|
readonly title: string;
|
|
|
|
|
@observable UseBoardProcessOption = true;
|
|
|
|
|
@observable m_BoardProcessOption: BoardProcessOption = { ...DefaultBoardProcessOption };
|
|
|
|
@ -101,7 +101,7 @@ export class BoardStore extends Singleton implements IConfigStore
|
|
|
|
|
this.rectDrillOption.left = highDrill[3];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
get UIOption()
|
|
|
|
|
get UIOption(): IUiOption<T>
|
|
|
|
|
{
|
|
|
|
|
if (!this.m_UiOption)
|
|
|
|
|
this.m_UiOption = DataAdapter.ConvertUIData(this.m_Option);
|
|
|
|
@ -217,7 +217,7 @@ export class BoardStore extends Singleton implements IConfigStore
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
export class SideBoardStore extends BoardStore
|
|
|
|
|
export class SideBoardStore extends BoardStore<SideBoardOption>
|
|
|
|
|
{
|
|
|
|
|
//板数据
|
|
|
|
|
@observable m_Option: SideBoardOption = Object.assign({}, DefaultSideBoardOption);
|
|
|
|
@ -334,7 +334,7 @@ export class TopBottomBoardStore extends BoardStore
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class BehindBoardStore extends BoardStore
|
|
|
|
|
export class BehindBoardStore extends BoardStore<BehindBoardOption>
|
|
|
|
|
{
|
|
|
|
|
title = "背板";
|
|
|
|
|
@observable m_Option: BehindBoardOption = Object.assign({}, DefaultBehindBoardConfig);
|
|
|
|
@ -368,8 +368,14 @@ export class BehindBoardStore extends BoardStore
|
|
|
|
|
newConfig.grooveData = toJS(this.grooveOption);
|
|
|
|
|
return newConfig;
|
|
|
|
|
}
|
|
|
|
|
UpdateOption(cof: IConfigOption)
|
|
|
|
|
UpdateOption(cof: IConfigOption<BehindBoardOption>)
|
|
|
|
|
{
|
|
|
|
|
if (cof.option.version < 2)
|
|
|
|
|
{
|
|
|
|
|
cof.option.calcSpaceSize = cof.option.spaceSize.toString();
|
|
|
|
|
cof.option.calcMoveDist = cof.option.moveDist.toString();
|
|
|
|
|
cof.option.version = 2;
|
|
|
|
|
}
|
|
|
|
|
super.UpdateOption(cof);
|
|
|
|
|
Object.assign(this.grooveOption, cof.grooveData);
|
|
|
|
|
}
|
|
|
|
@ -379,7 +385,7 @@ export class BehindBoardStore extends BoardStore
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class LayerBoardStore extends BoardStore
|
|
|
|
|
export class LayerBoardStore extends BoardStore<LayerBoardOption>
|
|
|
|
|
{
|
|
|
|
|
title = "层板";
|
|
|
|
|
@observable m_Option: LayerBoardOption = Object.assign({}, DefaultLayerBoardConfig);
|
|
|
|
@ -416,8 +422,24 @@ export class LayerBoardStore extends BoardStore
|
|
|
|
|
newConfig.nailData = toJS(this.layerNailOption);
|
|
|
|
|
return newConfig;
|
|
|
|
|
}
|
|
|
|
|
UpdateOption(cof: IConfigOption)
|
|
|
|
|
UpdateOption(cof: IConfigOption<LayerBoardOption>)
|
|
|
|
|
{
|
|
|
|
|
if (this.m_Option.version === undefined)
|
|
|
|
|
{
|
|
|
|
|
cof.option.version = 1;
|
|
|
|
|
if (cof.option.calcHeight === "L")
|
|
|
|
|
{
|
|
|
|
|
cof.option.calcHeight = "W";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (cof.option.version < 2)
|
|
|
|
|
{
|
|
|
|
|
cof.option.calcSpaceSize = cof.option.spaceSize.toString();
|
|
|
|
|
cof.option.calcLeftShrink = cof.option.leftShrink.toString();
|
|
|
|
|
cof.option.calcRightShrink = cof.option.rightShrink.toString();
|
|
|
|
|
cof.option.calcFrontShrink = cof.option.frontShrink.toString();
|
|
|
|
|
cof.option.version = 2;
|
|
|
|
|
}
|
|
|
|
|
super.UpdateOption(cof);
|
|
|
|
|
if (!cof.nailData)
|
|
|
|
|
cof.nailData = this.layerNailOption;
|
|
|
|
@ -426,15 +448,8 @@ export class LayerBoardStore extends BoardStore
|
|
|
|
|
if (this.uiLayerNailOption)
|
|
|
|
|
Object.assign(this.uiLayerNailOption, DataAdapter.ConvertUIData(this.layerNailOption));
|
|
|
|
|
|
|
|
|
|
if (this.m_Option.version === undefined)
|
|
|
|
|
{
|
|
|
|
|
this.m_Option.version = 1;
|
|
|
|
|
if (this.m_Option.calcHeight === "L")
|
|
|
|
|
{
|
|
|
|
|
this.m_Option.calcHeight = "W";
|
|
|
|
|
this.UIOption.calcHeight = "W";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
HasInvailValue()
|
|
|
|
|
{
|
|
|
|
@ -442,7 +457,7 @@ export class LayerBoardStore extends BoardStore
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class VerticalBoardStore extends BoardStore
|
|
|
|
|
export class VerticalBoardStore extends BoardStore<VerticalBoardOption>
|
|
|
|
|
{
|
|
|
|
|
title = "立板";
|
|
|
|
|
|
|
|
|
@ -453,9 +468,20 @@ export class VerticalBoardStore extends BoardStore
|
|
|
|
|
Object.assign(this.m_Option, DefaultVerticalBoardConfig);
|
|
|
|
|
super.InitOption();
|
|
|
|
|
}
|
|
|
|
|
UpdateOption(cof: IConfigOption<VerticalBoardOption>)
|
|
|
|
|
{
|
|
|
|
|
if (cof.option.version < 2)
|
|
|
|
|
{
|
|
|
|
|
cof.option.calcSpaceSize = cof.option.spaceSize.toString();
|
|
|
|
|
cof.option.calcFrontShrink = cof.option.frontShrink.toString();
|
|
|
|
|
cof.option.calcBottomShrink = cof.option.bottomShrink.toString();
|
|
|
|
|
cof.option.version = 2;
|
|
|
|
|
}
|
|
|
|
|
super.UpdateOption(cof);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class SingleBoardStore extends BoardStore
|
|
|
|
|
export class SingleBoardStore extends BoardStore<SingleBoardOption>
|
|
|
|
|
{
|
|
|
|
|
title = "单板";
|
|
|
|
|
@observable m_Option: SingleBoardOption = {
|
|
|
|
@ -476,7 +502,7 @@ export class SingleBoardStore extends BoardStore
|
|
|
|
|
super.InitOption();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
export class ClosingStripStore extends BoardStore
|
|
|
|
|
export class ClosingStripStore extends BoardStore<ClosingStripOption>
|
|
|
|
|
{
|
|
|
|
|
title = "收口条";
|
|
|
|
|
@observable m_Option: ClosingStripOption = {
|
|
|
|
@ -530,7 +556,7 @@ export class ClosingStripStore extends BoardStore
|
|
|
|
|
super.UpdateOption(cof);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
export class SpecialShapeStore extends BoardStore
|
|
|
|
|
export class SpecialShapeStore extends BoardStore<BoardConfigOption>
|
|
|
|
|
{
|
|
|
|
|
title = "绘制异型板";
|
|
|
|
|
@observable m_Option: BoardConfigOption = {
|
|
|
|
|