!2772 功能:封边高级边处理,预留边

pull/3091/head
黄诗津 3 weeks ago committed by ChenX
parent f60a266acd
commit a928670fbc

@ -10,7 +10,7 @@ function testBrSealing(br: Board, sealingSize: number[])
{
br.BoardProcessOption.highSealed = sealingSize.map(s =>
{
return { size: s };
return { size: s, sealColor: "" };
});
SetBoardTopDownLeftRightSealData(br, br.BoardProcessOption.highSealed);

@ -42,7 +42,7 @@ export class BatchModify implements Command
let keyRes = await app.Editor.GetKeyWords({
Msg: "编辑项目",
KeyWordList: [{ msg: "封边", key: "S" }, { msg: "排钻", key: "D" }, { msg: "板边备注", key: "R" }]
KeyWordList: [{ msg: "封边", key: "S" }, { msg: "排钻", key: "D" }, { msg: "板边备注", key: "R" }, { msg: "预留边", key: "Y" }]
});
if (keyRes.Status !== PromptStatus.Keyword) return;
@ -105,6 +105,22 @@ export class BatchModify implements Command
boardEdgeRemarksStore.isNotUpdateStore = false;
}, 0);
}
else if (keyRes.StringResult === "Y")
{
const reservedEdgeStore = store.reservedEdgeStore;
reservedEdgeStore.isNotUpdateStore = true;
let config = new DialogUserConfig(reservedEdgeStore, BoardModalType.ReservedEdge);
await config.LoadAndInitConfig();
store.m_IsShow = true;
store.m_TabId = RightTabId.ReservedEdge;
setTimeout(async () =>//当前命令结束后在进入编辑
{
await reservedEdgeStore.StartEditor(brs);
reservedEdgeStore.isNotUpdateStore = false;
}, 0);
}
}
}

@ -22,6 +22,7 @@ export function serializeBoardData(file: CADFiler, processData: BoardProcessOpti
for (let n of processData[EBoardKeyList.HighSealed])
{
file.Write(n.size);
file.Write(n.sealColor);
}
file.Write(processData[EBoardKeyList.UpSealed]);
file.Write(processData[EBoardKeyList.DownSealed]);
@ -63,11 +64,18 @@ export function deserializationBoardData(file: CADFiler, processData: BoardProce
for (let i = 0; i < count; i++)
{
let size = file.Read();
let sealColor = "";
if (ver > 22)
{
sealColor = file.Read();
}
if (ver < 4)
{
file.Read();
}
processData[EBoardKeyList.HighSealed].push({ size });
processData[EBoardKeyList.HighSealed].push({ size, sealColor });
}
processData[EBoardKeyList.UpSealed] = file.Read();

@ -89,10 +89,15 @@ export interface ICFBoard extends ICFExtrudeSolid
LeftSealed?: string;
RightSealed?: string;
sealColorUp?: string; //封边颜色
sealColorDown?: string;
sealColorLeft?: string;
sealColorRight?: string;
// 封边信息
// 普通板时使用 UpSealed,DownSealed,LeftSealed,RightSealed 表示上下左右封边的值
// 异形板时使用 EachSealeds 数组表示每个边的封边数据,size表示封边的厚度
EachSealeds?: { size: number; }[]; //每个边的封边数据
// 异形板时使用 EachSealeds 数组表示每个边的封边数据,size表示封边的厚度,sealColor表示封边颜色
EachSealeds?: { size: number; sealColor: string; }[]; //每个边的封边数据
EachEdgeDrills?: string[]; //每个边的排钻数据

@ -188,6 +188,10 @@ export function ParseCFBoard(el: ICFBoard, boardMaterialMap?: Map<string, Materi
process.sealedDown = el.DownSealed ?? "";
process.sealedLeft = el.LeftSealed ?? "";
process.sealedRight = el.RightSealed ?? "";
process.sealColorUp = el.sealColorUp ?? "";
process.sealColorDown = el.sealColorDown ?? "";
process.sealColorLeft = el.sealColorLeft ?? "";
process.sealColorRight = el.sealColorRight ?? "";
process.frontDrill = el.FrontDrill ?? true;
process.backDrill = el.BackDrill ?? true;

@ -155,10 +155,15 @@ type ICFExtrudeContour = ICFPolylineContour | ICFCircleContour;
LeftSealed?: string;
RightSealed?: string;
sealColorUp?: string; //封边颜色
sealColorDown?: string;
sealColorLeft?: string;
sealColorRight?: string;
// 封边信息
// 普通板时使用 UpSealed,DownSealed,LeftSealed,RightSealed 表示上下左右封边的值
// 异形板时使用 EachSealeds 数组表示每个边的封边数据,size表示封边的厚度
EachSealeds?: { size: number; }[]; //每个边的封边数据
// 异形板时使用 EachSealeds 数组表示每个边的封边数据,size表示封边的厚度,sealColor表示封边颜色
EachSealeds?: { size: number; sealColor: string; }[]; //每个边的封边数据
EachEdgeDrills?: string[]; //每个边的排钻数据
@ -198,8 +203,12 @@ type ICFExtrudeContour = ICFPolylineContour | ICFCircleContour;
DownSealed: "1",
LeftSealed: "1",
RightSealed: "1",
sealColorUp:"",
sealColorDown:"",
sealColorLeft:"",
sealColorRight:"",
//或
EachSealeds: [{ size: 1 }, { size: ,1 }, { size: 1 }, { size: 1 }, { size: 1 }],
EachSealeds: [{ size: 1, sealColor:""}, { size: 1, sealColor:"" }, { size: 1 ,sealColor:""}, { size: 1, sealColor:""}, { size: 1, sealColor:"" }],
EachEdgeDrills: ["不排", "不排", "不排", "不排"],
FrontDrill:true,

@ -852,6 +852,16 @@ export class DrawDoorTool
br.BoardProcessOption[EBoardKeyList.LeftSealed] = this.option.leftDoorSeal.toString();
br.BoardProcessOption[EBoardKeyList.RightSealed] = this.option.rightDoorSeal.toString();
br.BoardProcessOption.sealColorUp = this.option.sealColorUp;
br.BoardProcessOption.sealColorDown = this.option.sealColorDown;
br.BoardProcessOption.sealColorLeft = this.option.sealColorLeft;
br.BoardProcessOption.sealColorRight = this.option.sealColorRight;
br.BoardProcessOption.reservedEdgeUp = this.option.reservedEdgeUp;
br.BoardProcessOption.reservedEdgeDown = this.option.reservedEdgeDown;
br.BoardProcessOption.reservedEdgeLeft = this.option.reservedEdgeLeft;
br.BoardProcessOption.reservedEdgeRight = this.option.reservedEdgeRight;
//正反面排孔
if (!this.option.frontAndBackDrill)
{

@ -37,6 +37,10 @@ export class DrawLeftRightOpenDoor extends DrawDoorTool
verticalBoardName, layerBoardName, layerEdgeRemarkUp, layerEdgeRemarkDown,
layerEdgeRemarkLeft, layerEdgeRemarkRight, verticalEdgeRemarkUp,
verticalEdgeRemarkDown, verticalEdgeRemarkLeft, verticalEdgeRemarkRight,
layerSealColorUp, layerSealColorDown, layerSealColorLeft, layerSealColorRight,
layerReservedEdgeUp, layerReservedEdgeDown, layerReservedEdgeLeft, layerReservedEdgeRight,
verticalSealColorUp, verticalSealColorDown, verticalSealColorLeft, verticalSealColorRight,
verticalReservedEdgeUp, verticalReservedEdgeDown, verticalReservedEdgeLeft, verticalReservedEdgeRight,
offset, thickness, isAuto, useBoardProcessOption,
lbHightDrillOption: { down: lbDrillDown, up: lbDrillUp, left: lbDrillLeft, right: lbDrillRight },
cbHightDrillOption: { down: cbDrillDown, up: cbDrillUp, left: cbDrillLeft, right: cbDrillRight },
@ -76,6 +80,14 @@ export class DrawLeftRightOpenDoor extends DrawDoorTool
en.BoardProcessOption.edgeRemarkDown = layerEdgeRemarkDown.toString();
en.BoardProcessOption.edgeRemarkLeft = layerEdgeRemarkLeft.toString();
en.BoardProcessOption.edgeRemarkRight = layerEdgeRemarkRight.toString();
en.BoardProcessOption.sealColorUp = layerSealColorUp;
en.BoardProcessOption.sealColorDown = layerSealColorDown;
en.BoardProcessOption.sealColorLeft = layerSealColorLeft;
en.BoardProcessOption.sealColorRight = layerSealColorRight;
en.BoardProcessOption.reservedEdgeUp = layerReservedEdgeUp;
en.BoardProcessOption.reservedEdgeDown = layerReservedEdgeDown;
en.BoardProcessOption.reservedEdgeLeft = layerReservedEdgeLeft;
en.BoardProcessOption.reservedEdgeRight = layerReservedEdgeRight;
en.BoardProcessOption.highDrill = [cbDrillDown, cbDrillRight, cbDrillUp, cbDrillLeft];
let drillSet = new Set(en.BoardProcessOption.highDrill);
if (drillSet.size > 1)
@ -125,6 +137,14 @@ export class DrawLeftRightOpenDoor extends DrawDoorTool
en.BoardProcessOption.edgeRemarkDown = verticalEdgeRemarkDown.toString();
en.BoardProcessOption.edgeRemarkLeft = verticalEdgeRemarkLeft.toString();
en.BoardProcessOption.edgeRemarkRight = verticalEdgeRemarkRight.toString();
en.BoardProcessOption.sealColorUp = verticalSealColorUp;
en.BoardProcessOption.sealColorDown = verticalSealColorDown;
en.BoardProcessOption.sealColorLeft = verticalSealColorLeft;
en.BoardProcessOption.sealColorRight = verticalSealColorRight;
en.BoardProcessOption.reservedEdgeUp = verticalReservedEdgeUp;
en.BoardProcessOption.reservedEdgeDown = verticalReservedEdgeDown;
en.BoardProcessOption.reservedEdgeLeft = verticalReservedEdgeLeft;
en.BoardProcessOption.reservedEdgeRight = verticalReservedEdgeRight;
en.BoardProcessOption.highDrill = [lbDrillDown, lbDrillRight, lbDrillUp, lbDrillLeft];
let drillSet = new Set(en.BoardProcessOption.highDrill);
if (drillSet.size > 1)

@ -35,6 +35,10 @@ export class DrawUpDownOpenDoor extends DrawDoorTool
topBrSeal, bottomBrSeal, leftBrSeal, rightBrSeal,
layerEdgeRemarkUp, layerEdgeRemarkDown, layerEdgeRemarkLeft, layerEdgeRemarkRight, verticalEdgeRemarkUp,
verticalEdgeRemarkDown, verticalEdgeRemarkLeft, verticalEdgeRemarkRight,
layerSealColorUp, layerSealColorDown, layerSealColorLeft, layerSealColorRight,
layerReservedEdgeUp, layerReservedEdgeDown, layerReservedEdgeLeft, layerReservedEdgeRight,
verticalSealColorUp, verticalSealColorDown, verticalSealColorLeft, verticalSealColorRight,
verticalReservedEdgeUp, verticalReservedEdgeDown, verticalReservedEdgeLeft, verticalReservedEdgeRight,
verticalBoardName, layerBoardName,
thickness, isAuto, useBoardProcessOption,
lbHightDrillOption: { down: lbDrillDown, up: lbDrillUp, left: lbDrillLeft, right: lbDrillRight },
@ -77,6 +81,14 @@ export class DrawUpDownOpenDoor extends DrawDoorTool
en.BoardProcessOption.edgeRemarkDown = verticalEdgeRemarkDown.toString();
en.BoardProcessOption.edgeRemarkLeft = verticalEdgeRemarkLeft.toString();
en.BoardProcessOption.edgeRemarkRight = verticalEdgeRemarkRight.toString();
en.BoardProcessOption.sealColorUp = verticalSealColorUp;
en.BoardProcessOption.sealColorDown = verticalSealColorDown;
en.BoardProcessOption.sealColorLeft = verticalSealColorLeft;
en.BoardProcessOption.sealColorRight = verticalSealColorRight;
en.BoardProcessOption.reservedEdgeUp = verticalReservedEdgeUp;
en.BoardProcessOption.reservedEdgeDown = verticalReservedEdgeDown;
en.BoardProcessOption.reservedEdgeLeft = verticalReservedEdgeLeft;
en.BoardProcessOption.reservedEdgeRight = verticalReservedEdgeRight;
let drillSet = new Set(en.BoardProcessOption.highDrill);
if (drillSet.size > 1)
en.BoardProcessOption.drillType = DrillType.More;
@ -127,6 +139,14 @@ export class DrawUpDownOpenDoor extends DrawDoorTool
en.BoardProcessOption.edgeRemarkDown = layerEdgeRemarkDown.toString();
en.BoardProcessOption.edgeRemarkLeft = layerEdgeRemarkLeft.toString();
en.BoardProcessOption.edgeRemarkRight = layerEdgeRemarkRight.toString();
en.BoardProcessOption.sealColorUp = layerSealColorUp;
en.BoardProcessOption.sealColorDown = layerSealColorDown;
en.BoardProcessOption.sealColorLeft = layerSealColorLeft;
en.BoardProcessOption.sealColorRight = layerSealColorRight;
en.BoardProcessOption.reservedEdgeUp = layerReservedEdgeUp;
en.BoardProcessOption.reservedEdgeDown = layerReservedEdgeDown;
en.BoardProcessOption.reservedEdgeLeft = layerReservedEdgeLeft;
en.BoardProcessOption.reservedEdgeRight = layerReservedEdgeRight;
let drillSet = new Set(en.BoardProcessOption.highDrill);
if (drillSet.size > 1)
en.BoardProcessOption.drillType = DrillType.More;

@ -573,6 +573,8 @@ export class DrawDrawrer implements Command
const {
verticalBoardName, thickness,
lbSealedUp, lbSealedDown, lbSealedLeft, lbSealedRight,
sealColorUp, sealColorDown, sealColorLeft, sealColorRight,
reservedEdgeUp, reservedEdgeDown, reservedEdgeLeft, reservedEdgeRight,
lbHightDrillOption: { down: lbDrillDown, up: lbDrillUp, left: lbDrillLeft, right: lbDrillRight },
} = option;
let verTemp = new TemplateSizeBoard().InitBaseParams();
@ -584,6 +586,14 @@ export class DrawDrawrer implements Command
br.BoardProcessOption[EBoardKeyList.DownSealed] = lbSealedDown.toString();
br.BoardProcessOption[EBoardKeyList.LeftSealed] = lbSealedLeft.toString();
br.BoardProcessOption[EBoardKeyList.RightSealed] = lbSealedRight.toString();
br.BoardProcessOption.sealColorUp = sealColorUp;
br.BoardProcessOption.sealColorDown = sealColorDown;
br.BoardProcessOption.sealColorLeft = sealColorLeft;
br.BoardProcessOption.sealColorRight = sealColorRight;
br.BoardProcessOption.reservedEdgeUp = reservedEdgeUp;
br.BoardProcessOption.reservedEdgeDown = reservedEdgeDown;
br.BoardProcessOption.reservedEdgeLeft = reservedEdgeLeft;
br.BoardProcessOption.reservedEdgeRight = reservedEdgeRight;
br.BoardProcessOption.highDrill = [lbDrillDown, lbDrillRight, lbDrillUp, lbDrillLeft];
let drillSet = new Set(br.BoardProcessOption.highDrill);
if (drillSet.size > 1)

@ -46,6 +46,9 @@ const ForbidReactorCmd = new Set([
// 板件取消孔槽加工
CommandNames.ClearCDBrHoleModeling,
CommandNames.,
CommandNames.,
//对纹组
CommandNames.AlignLineGroup,
CommandNames.AddAlignLineGroup,

@ -78,18 +78,18 @@ export class DrawWineRackTool extends Singleton
let sizes = [...new Set([downSealed, rightSealed, topSealed, leftSealed])];
let downSeal = {
size: downSealed, color: sizes.indexOf(downSealed) + 1
size: downSealed, color: sizes.indexOf(downSealed) + 1, sealColor: ""
};
let rigthSeal = {
size: rightSealed, color: sizes.indexOf(rightSealed) + 1
size: rightSealed, color: sizes.indexOf(rightSealed) + 1, sealColor: ""
};
let topSeal = { size: topSealed, color: sizes.indexOf(topSealed) + 1 };
let leftSeal = { size: leftSealed, color: sizes.indexOf(leftSealed) + 1 };
let topSeal = { size: topSealed, color: sizes.indexOf(topSealed) + 1, sealColor: "" };
let leftSeal = { size: leftSealed, color: sizes.indexOf(leftSealed) + 1, sealColor: "" };
let highSeals: IHighSealedItem[] = [downSeal];
if (isLeft)
{
let leftSealNoSize = { size: 0, color: sizes.indexOf(leftSealed) + 1 };
let leftSealNoSize = { size: 0, color: sizes.indexOf(leftSealed) + 1, sealColor: "" };
highSeals.push(rigthSeal, topSeal);
for (let i = 3; i <= cu.EndParam - 1; i++)
{
@ -101,7 +101,7 @@ export class DrawWineRackTool extends Singleton
}
else
{
let rightSealNoSize = { size: 0, color: sizes.indexOf(rightSealed) + 1 };
let rightSealNoSize = { size: 0, color: sizes.indexOf(rightSealed) + 1, sealColor: "" };
for (let i = 1; i <= cu.EndParam - 3; i++)
{
if ((i - 1) % 4 === 0)

@ -186,6 +186,18 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes)
}
}
if (userConfig.chaidanOption.reservedEdgeCheckTip)
{
if (boardList.some(br => br.IsSpecialShape ? br.BoardProcessOption.highReservedEdge.some(r => r.size != 0) : ["reservedEdgeUp", "reservedEdgeDown", "reservedEdgeLeft", "reservedEdgeRight"].some(k => br.BoardProcessOption[k] != "0")))
{
AppToaster.show({
message: `注意:拆单板件有预留边处理,会影响CNC(五面钻、六面钻、PTP等设备)加工程序的孔槽及异形轮廓切割的位置,如果有对接CNC加工设备进行加工的,请确认已对原有CNC程序进行升级对接(否则可能出现生产错误问题)!`,
timeout: 8000,
intent: Intent.WARNING,
});
}
}
for (let br of boardList)
{
let b = br.__OriginalEnt__ ?? br;

@ -47,7 +47,7 @@ export function GetPointInfoArray(info: CadBlockInfo): [object, object, object,
let orgPoints = GetArray(CadBlockPoint, info.OrgPointDetail);
if (orgPoints.length > 0)
{
orgPoints[0][5] = 1;
orgPoints[0][7] = 1;
}
return [
GetArray(CadBlockPoint, info.PointDetail),

@ -23,10 +23,12 @@ export class CadBlockPoint extends BaseModel
PointX: number;
PointY: number;
Curve: number;
SealSize: number;
SealSize: number;//封边厚度
SealColor: string;//封边颜色
ReservedEdge: number;//预留边
protected get props()
{
return ['PointID', 'PointX', 'PointY', 'Curve', 'SealSize'];
return ['PointID', 'PointX', 'PointY', 'Curve', 'SealSize', 'SealColor', 'ReservedEdge'];
}
ToArray()
{
@ -134,3 +136,10 @@ export class CadBlockInfo
SideModelDetail: CadBlockModel[];
SideHoleDetail: CadBlockHoles[];
}
export class CadSealInfoPoint
{
PointID: number;
SealSize: number;//封边厚度
SealColor: string;//封边颜色
ReservedEdge: number;//预留边
}

@ -15,7 +15,7 @@ import { GetBoxArr, IdentityMtx4, equalv2 } from "../../Geometry/GeUtils";
import { IContourData } from "../../Production/Convert2PtsBul";
import { I2DModeling, I3DContourData, I3DModeling, IDrillingOption, IHardwareType, IModelingData, IOriginSideModelingData, ISpliteHardwareData, ISpliteOrderData, ModelType, Production } from '../../Production/Product';
import { EMetalsType } from "../../UI/Components/RightPanel/RightPanelInterface";
import { ISealingData } from "../../UI/Store/OptionInterface/IHighSealedItem";
import { IHighReservedEdgeItem, ISealingData } from "../../UI/Store/OptionInterface/IHighSealedItem";
import { FaceDirection } from "../DrawDrilling/DrillType";
// import { DownPanelStore } from "../../UI/Store/DownPanelStore";
import { HostApplicationServices } from "../../ApplicationServices/HostApplicationServices";
@ -31,7 +31,7 @@ import { TemplateWineRackRecord } from './../../DatabaseServices/Template/Progra
import { ErpGroupBy } from "./ErpGroupBy";
import { GetArray, GetPointInfoArray } from "./Models/ArrayHelper";
import { CadType, OrderDataBlock, WaveType } from "./Models/CadBlock";
import { BasePosition, CadBlockHoles, CadBlockInfo, CadBlockModel, CadBlockModelPoint, CadBlockPoint, FaceType, HoleType, ModelOffSetData } from "./Models/CadBlockInfo";
import { BasePosition, CadBlockHoles, CadBlockInfo, CadBlockModel, CadBlockModelPoint, CadBlockPoint, CadSealInfoPoint, FaceType, HoleType, ModelOffSetData } from "./Models/CadBlockInfo";
import { CADDbBoard } from "./Models/CadModel";
import { AlignLineGroupObject, OrderDataObject, ProcessGroupObject, ProcessGroupProjObject } from "./Models/CadObject";
import { DealAlignLineGroup, ParseAlignLine } from "./ParseDataFunction";
@ -361,7 +361,7 @@ export class ErpParseData
return w;
}
//获取异形数据
GetPointDetail(points: IContourData, seals: ISealingData[]): CadBlockPoint[]
GetPointDetail(points: IContourData, seals: ISealingData[], reservedEdge: IHighReservedEdgeItem[]): CadBlockPoint[]
{
if (points == null || points.pts == null) return [];
@ -374,7 +374,6 @@ export class ErpParseData
// intent: Intent.DANGER,
// });
// }
let pointList: CadBlockPoint[] = [];
for (let i = 0; i < points.pts.length; i++)
{
@ -383,7 +382,9 @@ export class ErpParseData
newPoint.PointX = points.pts[i].x;
newPoint.PointY = points.pts[i].y;
newPoint.Curve = points.buls[i];
newPoint.SealSize = seals[i] ? seals[i].size : 0;
newPoint.SealSize = seals[i]?.size ?? 0;
newPoint.SealColor = seals[i]?.sealColor ?? '';
newPoint.ReservedEdge = reservedEdge[i]?.size ?? 0;
pointList.push(newPoint);
}
return pointList;
@ -673,8 +674,8 @@ export class ErpParseData
let orgPointDetail: CadBlockPoint[] = [];
if (board.info.isRect === false)
{
pointDetail = this.GetPointDetail(board.outline, board.sealing);//TODO: 现在这个不应该在写入封边信息了
orgPointDetail = this.GetPointDetail(board.originOutlin, board.sealing);//保留这个
pointDetail = this.GetPointDetail(board.outline, board.sealing, board.reservedEdge);//TODO: 现在这个不应该在写入封边信息了
orgPointDetail = this.GetPointDetail(board.originOutlin, board.sealing, board.reservedEdge);//保留这个
}
else
{
@ -843,14 +844,18 @@ export class ErpParseData
ds.push(hole);
}
},
sealGruopKey: (key: string, b: Board, size: number) =>
sealGruopKey: (key: string, b: Board, thickness: string, data: ISealingData) =>
{
let material = b.BoardProcessOption[EBoardKeyList.Mat];
let color = b.BoardProcessOption[EBoardKeyList.Color];
if (data.sealColor)
color = data.sealColor;
sealMap.set(key, {
size,
[EBoardKeyList.Mat]: b.BoardProcessOption[EBoardKeyList.Mat],
size: data.size,
[EBoardKeyList.Mat]: material,
[EBoardKeyList.BrMat]: b.BoardProcessOption[EBoardKeyList.BrMat],
[EBoardKeyList.Thick]: b.Thickness,
[EBoardKeyList.Color]: b.BoardProcessOption[EBoardKeyList.Color]
[EBoardKeyList.Thick]: Number(thickness),
[EBoardKeyList.Color]: color
});
}
};
@ -996,6 +1001,12 @@ export class ErpParseData
const edgeRemarks = spliteData.boardEdgeRemark.length > 0 ? // 没有高级封边按顺序出 下 左 上 右出
spliteData.boardEdgeRemark.map(i => i ? i.description : '')
: [board.BoardProcessOption.edgeRemarkDown ?? "", board.BoardProcessOption.edgeRemarkRight ?? "", board.BoardProcessOption.edgeRemarkUp ?? "", board.BoardProcessOption.edgeRemarkLeft ?? "",];
//矩形封边信息
let rectSealDetail = [];
if (spliteData.info.isRect)
{
rectSealDetail = this.GetRectSealDetail(spliteData.originOutlin, spliteData.sealing, spliteData.reservedEdge);
}
const info = {
boardType: { 0: '层板', 1: '立板', 2: '背板' }[board.BoardType],
throughHoleCount,
@ -1005,7 +1016,8 @@ export class ErpParseData
has3DModel,
composingFace: { 0: '正面', 1: '反面', 2: '任意面' }[board.BoardProcessOption.composingFace],
processList,
edgeRemarks
edgeRemarks,
rectSealDetail
};
let remarks = spliteData.info.remarks.slice();
let boardRemark = remarks.find(t => t[0] == '#extra');
@ -1026,6 +1038,22 @@ export class ErpParseData
return cadObj.Name === "层板" || cadObj.Name === "立板";
return false;
};
//获取矩形封边数据
GetRectSealDetail(points: IContourData, seals: ISealingData[], reservedEdge: IHighReservedEdgeItem[]): CadSealInfoPoint[]
{
if (points == null || points.pts == null) return [];
let pointList: CadSealInfoPoint[] = [];
for (let i = 0; i < points.pts.length; i++)
{
let newPoint = new CadSealInfoPoint();
newPoint.PointID = i + 1;
newPoint.SealSize = seals[i]?.size ?? 0;
newPoint.SealColor = seals[i]?.sealColor ?? '';
newPoint.ReservedEdge = reservedEdge[i]?.size ?? 0;
pointList.push(newPoint);
}
return pointList;
}
groupBy(data: any[], fileds: string[])
{
let groupList = {};

@ -358,7 +358,7 @@ async function ParseModel(model: KJL_ParamModel,
{
let sealeds: IHighSealedItem[] = edgesBandings[0].map(v =>
{
return { size: v };
return { size: v, sealColor: "" };
});
let cus = pls[0].Explode();
let last = arrayLast(sealeds);

@ -297,17 +297,17 @@ export class DrawLatticeDrawerTool extends Singleton
let sizes = [...new Set([downSealed, rightSealed, topSealed, leftSealed])];
let downSeal = {
size: downSealed, color: sizes.indexOf(downSealed) + 1
size: downSealed, color: sizes.indexOf(downSealed) + 1, sealColor: ""
};
let rigthSeal = {
size: rightSealed, color: sizes.indexOf(rightSealed) + 1
size: rightSealed, color: sizes.indexOf(rightSealed) + 1, sealColor: ""
};
let topSeal = { size: topSealed, color: sizes.indexOf(topSealed) + 1 };
let leftSeal = { size: leftSealed, color: sizes.indexOf(leftSealed) + 1 };
let topSeal = { size: topSealed, color: sizes.indexOf(topSealed) + 1, sealColor: "" };
let leftSeal = { size: leftSealed, color: sizes.indexOf(leftSealed) + 1, sealColor: "" };
if (isHor)
{
let topSealNoSize = { size: 0, color: sizes.indexOf(topSealed) + 1 };
let topSealNoSize = { size: 0, color: sizes.indexOf(topSealed) + 1, sealColor: "" };
highSeals.push(downSeal, rigthSeal);
for (let i = 1; i <= cu.EndParam - 3; i++)
@ -323,7 +323,7 @@ export class DrawLatticeDrawerTool extends Singleton
{
let count = (this._config.depthCount - 1) * 3 + this._config.depthCount;
let downSealNoSize = { size: 0, color: sizes.indexOf(downSealed) + 1 };
let downSealNoSize = { size: 0, color: sizes.indexOf(downSealed) + 1, sealColor: "" };
for (let i = 0; i < count; i++)
{
if (i % 4 === 0)

@ -31,7 +31,7 @@ export interface ICountType<T = IHardwareType>
goodsId?: string;
goodsSn?: string;
}
export type GetCountOption = { sealGruopKey: (key: string, block: Board, size: number) => void; getHoles?: (name: string, hole: CylinderHole) => void; };
export type GetCountOption = { sealGruopKey: (key: string, block: Board, thickness: string, data: ISealingData) => void; getHoles?: (name: string, hole: CylinderHole) => void; };
class LookOverBoardInfosTool
{
private drillTypeMap: Map<string, (Hole | IHardwareType)[]> = new Map();
@ -268,9 +268,7 @@ class LookOverBoardInfosTool
throw "错误:板扣除封边失败!";
}
let sealData: ISealingData[] = Production.ParseSealData(sealdData);
let color = br.BoardProcessOption[EBoardKeyList.Color];
let { seals: sealData, reservedEdges } = Production.ParseSealData(sealdData, br.BoardProcessOption.color);
//封边留头量
let sealReserve = HostApplicationServices.sealReserve * 2;
@ -280,11 +278,11 @@ class LookOverBoardInfosTool
{
if (equaln(0, data.size)) continue;
data.length += sealReserve;
let color = data.sealColor;
let k = `${data.size}-${FixedNotZero(thickness, 2)}-${color}`;
if (options && options.sealGruopKey)
{
options.sealGruopKey(k, br, data.size);
options.sealGruopKey(k, br, thickness, data);
}
let len = this.sealMap.get(k);
if (!len)

@ -285,6 +285,10 @@ export namespace CheckoutValid
case "grooveAddDepth2":
case "grooveAddWidth2":
case "back":
case "reservedEdgeUp":
case "reservedEdgeDown":
case "reservedEdgeLeft":
case "reservedEdgeRight":
{
let val = safeEval(v);
if (isNaN(val))

@ -353,6 +353,7 @@ export enum CommandNames
= "封边属性编辑",
= "板边备注编辑",
= "排钻属性编辑",
= "预留边属性编辑",
SwitchServers = "SWITCHSERVERS",
Replace = "重新放置模型",

@ -16,7 +16,7 @@ import { TemplateWineRackRecord } from "../DatabaseServices/Template/ProgramTemp
import { OBB } from "../Geometry/OBB/obb";
import { FuzzyFactory } from "../csg/core/FuzzyFactory";
import { CSG2Geometry2, Geometry2CSG2 } from "../csg/core/Geometry2CSG";
import { CSGIntersect } from "./CSGIntersect";
import { CSGIntersect, Geom3Res } from "./CSGIntersect";
import { ColorMaterial } from "./ColorPalette";
import { Log, LogType } from "./Log";
import { Sleep } from "./Sleep";
@ -170,7 +170,7 @@ export class CheckInterfereTool
continue;
}
let interCsg = CSGIntersect(csg1, csg2, e1.OCSInv.multiply(e2.OCSNoClone));
let interCsg = CSGIntersect(csg1, csg2, e1.OCSInv.multiply(e2.OCSNoClone)) as unknown as Geom3Res;
// 先判断交集是否围城一个实体,再判断该实体是否造成干涉
let planeSet = new Set<number[]>();
let f = new FuzzyFactory;

@ -31,7 +31,7 @@ import { AddCSGSubtractTask, CSGTask, TerminateCSGTask } from '../../Geometry/CS
import { EdgesGeometry } from '../../Geometry/EdgeGeometry';
import { AsVector2, AsVector3, IdentityMtx4, UpdateBoundingSphere, XAxis, XAxisN, YAxis, YAxisN, ZAxis, ZeroVec, equaln, equalv2, equalv3 } from '../../Geometry/GeUtils';
import { PointShapeUtils } from '../../Geometry/PointShapeUtils';
import { GetBoardContour, GetBoardHighSeal, GetBoardSealingCurves, GetHighBoardEdgeRemark, SetBoardEdgeRemarkData, SetBoardTopDownLeftRightSealData } from '../../GraphicsSystem/CalcEdgeSealing';
import { GetBoardContour, GetBoardHighReservedEdge, GetBoardHighSeal, GetBoardSealingCurves, GetHighBoardEdgeRemark, SetBoardEdgeRemarkData, SetBoardReservedEdgeData, SetBoardTopDownLeftRightSealData } from '../../GraphicsSystem/CalcEdgeSealing';
import { RenderType } from '../../GraphicsSystem/RenderType';
import { BoardProcessOption } from "../../UI/Store/OptionInterface/BoardProcessOption";
import { CSG2Geometry2, Geometry2CSG2 } from '../../csg/core/Geometry2CSG';
@ -582,6 +582,16 @@ export class Board extends ExtrudeSolid
edgeRemarkLeft: "",
edgeRemarkRight: "",
highBoardEdgeRemark: this.CreateArray(),
reservedEdgeUp: "0",
reservedEdgeDown: "0",
reservedEdgeRight: "0",
reservedEdgeLeft: "0",
highReservedEdge: this.CreateArray(),
sealColorUp: "",
sealColorDown: "",
sealColorLeft: "",
sealColorRight: "",
sealColorType: "",
};
this._BoardProcessOption = new Proxy(defaultData, {
@ -594,7 +604,7 @@ export class Board extends ExtrudeSolid
if (Reflect.get(target, key, receiver) !== value)
{
this.WriteAllObjectRecord();
if (key === "highDrill" || key === EBoardKeyList.HighSealed || key === "highBoardEdgeRemark")
if (key === "highDrill" || key === EBoardKeyList.HighSealed || key === "highBoardEdgeRemark" || key === "highReservedEdge")
{
let arr = this.CreateArray() as any[];
arr.push(...value);
@ -796,8 +806,9 @@ export class Board extends ExtrudeSolid
{
Object.assign(this._BoardProcessOption, obj,
{
[EBoardKeyList.HighSealed]: obj[EBoardKeyList.HighSealed].slice(),
highBoardEdgeRemark: obj.highBoardEdgeRemark.slice(),
[EBoardKeyList.HighSealed]: structuredClone(obj[EBoardKeyList.HighSealed]),
highBoardEdgeRemark: structuredClone(obj.highBoardEdgeRemark),
highReservedEdge: structuredClone(obj.highReservedEdge)
});
}
get NeedUpdateRelevanceGroove()
@ -1470,7 +1481,8 @@ export class Board extends ExtrudeSolid
let oldHightSealCurves = GetBoardSealingCurves(this);//旧的封边轮廓
let oldHightSealDatas = GetBoardHighSeal(this, oldHightSealCurves);//旧的封边数据
let oldHighBoardEdgeRemarkDatas = GetHighBoardEdgeRemark(this, oldHightSealCurves);//旧的封边数据
let oldHighBoardEdgeRemarkDatas = GetHighBoardEdgeRemark(this, oldHightSealCurves);//旧的板边备注数据
let oldHighReservedEdgeDatas = GetBoardHighReservedEdge(this, oldHightSealCurves);//旧的预留边数据
let splitSideModel = false;
@ -1524,11 +1536,13 @@ export class Board extends ExtrudeSolid
this._BoardProcessOption.highSealed.length = 0;
this._BoardProcessOption.highBoardEdgeRemark.length = 0;
this._BoardProcessOption.highReservedEdge.length = 0;
//保持封边属性
if (this.isRect)
{
SetBoardTopDownLeftRightSealData(this, oldHightSealDatas, oldHightSealCurves, oldContour);
SetBoardEdgeRemarkData(this, oldHighBoardEdgeRemarkDatas, oldHightSealCurves, oldContour);
SetBoardReservedEdgeData(this, oldHighReservedEdgeDatas, oldHightSealCurves, oldContour);
}
else//变成了异形
{
@ -1555,6 +1569,7 @@ export class Board extends ExtrudeSolid
this._BoardProcessOption.highSealed.push(oldHightSealDatas[closesIndex]);
this._BoardProcessOption.highBoardEdgeRemark.push(oldHighBoardEdgeRemarkDatas[closesIndex]);
this._BoardProcessOption.highReservedEdge.push(oldHighReservedEdgeDatas[closesIndex]);
}
}
@ -3365,6 +3380,7 @@ export class Board extends ExtrudeSolid
processData.edgeRemarkLeft = file.Read();
processData.edgeRemarkRight = file.Read();
let count = file.Read();
processData.highBoardEdgeRemark.length = 0;
processData.highBoardEdgeRemark = file.ReadArray(count);
}
@ -3427,12 +3443,34 @@ export class Board extends ExtrudeSolid
this._LockMaterial = file.ReadBool();
else
this._LockMaterial = false;
if (ver > 23)
{
processData.reservedEdgeUp = file.Read();
processData.reservedEdgeDown = file.Read();
processData.reservedEdgeLeft = file.Read();
processData.reservedEdgeRight = file.Read();
let count = file.Read();
processData.highReservedEdge.length = 0;
for (let i = 0; i < count; i++)
{
let size = file.Read();
processData.highReservedEdge.push({ size });
}
processData.sealColorUp = file.Read();
processData.sealColorDown = file.Read();
processData.sealColorLeft = file.Read();
processData.sealColorRight = file.Read();
processData.sealColorType = file.Read();
}
}
WriteFile(file: CADFiler)
{
super.WriteFile(file);
file.Write(23);
file.Write(24);
// file.Write(this._SpaceOCS.toArray()); ver < 6
file.Write(this._BoardType);
file.Write(this._Name);
@ -3537,6 +3575,23 @@ export class Board extends ExtrudeSolid
// ver 23
file.WriteBool(this._LockMaterial);
//ver 24
file.Write(processData.reservedEdgeUp);
file.Write(processData.reservedEdgeDown);
file.Write(processData.reservedEdgeLeft);
file.Write(processData.reservedEdgeRight);
file.Write(processData.highReservedEdge.length);
for (let r of processData.highReservedEdge)
{
file.Write(r.size);
}
file.Write(processData.sealColorUp);
file.Write(processData.sealColorDown);
file.Write(processData.sealColorLeft);
file.Write(processData.sealColorRight);
file.Write(processData.sealColorType);
}
}

@ -491,7 +491,7 @@ export const DefaultLatticOption: ILatticeOption = {
Object.freeze(DefaultLatticOption);
export const DefaultDoorOption: IDoorConfigOption = {
version: 12,
version: 13,
col: 2,
row: 1,
isAllSelect: true,
@ -559,6 +559,30 @@ export const DefaultDoorOption: IDoorConfigOption = {
verticalEdgeRemarkLeft: '',
verticalEdgeRemarkRight: '',
parseHinge: false,
sealColorUp: "", //门板封边颜色
sealColorDown: "",
sealColorLeft: "",
sealColorRight: "",
reservedEdgeUp: "0", //门板预留边
reservedEdgeDown: "0",
reservedEdgeLeft: "0",
reservedEdgeRight: "0",
layerSealColorUp: "", //层板封边颜色
layerSealColorDown: "",
layerSealColorLeft: "",
layerSealColorRight: "",
layerReservedEdgeUp: "0", //层板预留边
layerReservedEdgeDown: "0",
layerReservedEdgeLeft: "0",
layerReservedEdgeRight: "0",
verticalSealColorUp: "", //立板封边颜色
verticalSealColorDown: "",
verticalSealColorLeft: "",
verticalSealColorRight: "",
verticalReservedEdgeUp: "0", //层板预留边
verticalReservedEdgeDown: "0",
verticalReservedEdgeLeft: "0",
verticalReservedEdgeRight: "0",
};
Object.freeze(DefaultDoorOption);
export const DefaultHingeOption: IHingeConfigOption = {
@ -572,7 +596,7 @@ export const DefaultHingeOption: IHingeConfigOption = {
};
Object.freeze(DefaultHingeOption);
export const DefaultDrawerOption: IDrawerConfigOption = {
version: 9,
version: 10,
col: 1,
row: 1,
isAllSelect: true,
@ -619,6 +643,14 @@ export const DefaultDrawerOption: IDrawerConfigOption = {
color: "",//颜色
roomName: "",//房名
cabinetName: "",//柜名
sealColorUp: "", //抽屉立板封边颜色
sealColorDown: "",
sealColorLeft: "",
sealColorRight: "",
reservedEdgeUp: "0", //抽屉立板预留边
reservedEdgeDown: "0",
reservedEdgeLeft: "0",
reservedEdgeRight: "0",
};
Object.freeze(DefaultDrawerOption);
@ -774,7 +806,7 @@ export const DefaultToplineMetalsOption: IToplineOption = {
Object.freeze(DefaultToplineMetalsOption);
export const DefaultBoardProcessOption: BoardProcessOption = {
version: 4,
version: 5,
roomName: "",
cabinetName: "",
boardName: "",
@ -802,6 +834,16 @@ export const DefaultBoardProcessOption: BoardProcessOption = {
edgeRemarkLeft: "",
edgeRemarkRight: "",
highBoardEdgeRemark: [],
reservedEdgeUp: "0",
reservedEdgeDown: "0",
reservedEdgeLeft: "0",
reservedEdgeRight: "0",
highReservedEdge: [],
sealColorUp: "",
sealColorDown: "",
sealColorLeft: "",
sealColorRight: "",
sealColorType: "",
};
Object.freeze(DefaultBoardProcessOption);

@ -53,7 +53,7 @@ export interface IChat
export class UserConfig implements IConfigStore
{
private readonly _version = 47; //🌟🌟每次更新必须向上添加一次版本号🌟🌟
private readonly _version = 48; //🌟🌟每次更新必须向上添加一次版本号🌟🌟
@observable designer = ""; //一键布局的设计师
_renderType: RenderType = RenderType.Wireframe;
@observable maxSize: IMaxSizeProps = {
@ -139,6 +139,7 @@ export class UserConfig implements IConfigStore
xlineLength: 20000, //构造线长度默认使用20000
cancelHoleProcessing: false,//填写拆单尺寸板件取消孔槽加工
isCheckCustomBoardNumber: false,//是否开启自动板件编号校验
reservedEdgeCheckTip: true,//是否显示预留边检查提示
};
@observable viewSize = {
minViewHeight: 1e-3,
@ -201,6 +202,7 @@ export class UserConfig implements IConfigStore
@observable autoDeviation: boolean = false;//排钻自动偏移
@observable autoDeviationMinDist: number = 200; //排钻自动偏移的最小排钻面
@observable drillShortPrior: boolean = false;//排钻的碰撞面短的优先排钻
@observable reservedEdgeCheckTip: boolean = true;//是否显示预留边检查提示
constructor()
{
@ -267,6 +269,7 @@ export class UserConfig implements IConfigStore
xlineLength: 20000,
cancelHoleProcessing: false,
isCheckCustomBoardNumber: false,
reservedEdgeCheckTip: true,
});
Object.assign(this.textStyleOption, {
appointTextHight: false,
@ -322,6 +325,7 @@ export class UserConfig implements IConfigStore
this.drillShortPrior = false;
this.autoDeviationMinDist = 200;
this.isShowAxesMatrix = true;
this.reservedEdgeCheckTip = true;
}
SaveConfig()
{
@ -387,6 +391,7 @@ export class UserConfig implements IConfigStore
drillShortPrior: this.drillShortPrior,
autoDeviationMinDist: this.autoDeviationMinDist,
isShowAxesMatrix: this.isShowAxesMatrix,
reservedEdgeCheckTip: this.reservedEdgeCheckTip,
}
};
}
@ -603,6 +608,10 @@ export class UserConfig implements IConfigStore
{
this.isShowAxesMatrix = config.option.isShowAxesMatrix;
}
if (config.option.version > 47)
{
this.reservedEdgeCheckTip = config.option.reservedEdgeCheckTip;
}
}
}

@ -149,7 +149,7 @@ export class BoardGetFace
if (highSealingData)
{
let cus = (br.ContourCurve.Clone() as Polyline).Explode();
highSealingData.push(...GetBoardHighSeal(br, cus));
highSealingData.push(...structuredClone(GetBoardHighSeal(br, cus)));
sealCu.push(...cus);
}

@ -16,7 +16,7 @@ import { CreateContour2 } from "../Geometry/CreateContour2";
import { IdentityMtx4, XAxis, equaln, equalv3, isParallelTo } from "../Geometry/GeUtils";
import { Max } from "../Nest/Common/Util";
import { Production } from "../Production/Product";
import { IHighEdgeRemarkItem, IHighSealedItem } from "../UI/Store/OptionInterface/IHighSealedItem";
import { IHighEdgeRemarkItem, IHighReservedEdgeItem, IHighSealedItem } from "../UI/Store/OptionInterface/IHighSealedItem";
import { OffsetPolyline } from "./OffsetPolyline";
import { ParseEdgeSealDir } from "./ParseEdgeSealDir";
@ -148,16 +148,17 @@ export function SubsectionCurvesOfHightSeal(in_out_curves: Curve[]): CurveGroups
//与GetBoardSealingCurves相关
export function GetBoardHighSeal(br: Board, sealcus: Curve[]): IHighSealedItem[]
{
if (br.BoardProcessOption[EBoardKeyList.SpliteHeight]
&& br.BoardProcessOption[EBoardKeyList.SpliteWidth]
&& br.BoardProcessOption[EBoardKeyList.SpliteThickness]
const option = br.BoardProcessOption;
if (option[EBoardKeyList.SpliteHeight]
&& option[EBoardKeyList.SpliteWidth]
&& option[EBoardKeyList.SpliteThickness]
)
{
return [
{ size: parseFloat(br.BoardProcessOption.sealedDown) },
{ size: parseFloat(br.BoardProcessOption.sealedRight) },
{ size: parseFloat(br.BoardProcessOption.sealedUp) },
{ size: parseFloat(br.BoardProcessOption.sealedLeft) },
{ size: parseFloat(option.sealedDown), sealColor: option.sealColorDown },
{ size: parseFloat(option.sealedRight), sealColor: option.sealColorRight },
{ size: parseFloat(option.sealedUp), sealColor: option.sealColorUp },
{ size: parseFloat(option.sealedLeft), sealColor: option.sealColorLeft },
];
}
@ -183,16 +184,16 @@ export function GetBoardHighSeal(br: Board, sealcus: Curve[]): IHighSealedItem[]
if (Math.abs(derv.x) > Math.abs(derv.y))
{
if (derv.x > 0)
highSeals.push({ size: sealDown });
highSeals.push({ size: sealDown, sealColor: option.sealColorDown });
else
highSeals.push({ size: sealUp });
highSeals.push({ size: sealUp, sealColor: option.sealColorUp });
}
else
{
if (derv.y > 0)
highSeals.push({ size: sealRight });
highSeals.push({ size: sealRight, sealColor: option.sealColorRight });
else
highSeals.push({ size: sealLeft });
highSeals.push({ size: sealLeft, sealColor: option.sealColorLeft });
}
}
}
@ -200,6 +201,60 @@ export function GetBoardHighSeal(br: Board, sealcus: Curve[]): IHighSealedItem[]
return highSeals;
}
export function GetBoardHighReservedEdge(br: Board, sealcus: Curve[]): IHighReservedEdgeItem[]
{
if (br.BoardProcessOption[EBoardKeyList.SpliteHeight]
&& br.BoardProcessOption[EBoardKeyList.SpliteWidth]
&& br.BoardProcessOption[EBoardKeyList.SpliteThickness]
)
{
return [
{ size: parseFloat(br.BoardProcessOption.reservedEdgeDown) },
{ size: parseFloat(br.BoardProcessOption.reservedEdgeRight) },
{ size: parseFloat(br.BoardProcessOption.reservedEdgeUp) },
{ size: parseFloat(br.BoardProcessOption.reservedEdgeLeft) },
];
}
let highReservedEdge: IHighReservedEdgeItem[] = [];
for (let d of br.BoardProcessOption.highReservedEdge)
if (d.size != null)
highReservedEdge.push({ ...d });
//若未设置高级封边,把上下左右封边存入高级封边
if (sealcus.length !== highReservedEdge.length || !br.IsSpecialShape)
{
let reservedEdgeDown = parseFloat(br.BoardProcessOption.reservedEdgeDown);
let reservedEdgeUp = parseFloat(br.BoardProcessOption.reservedEdgeUp);
let reservedEdgeLeft = parseFloat(br.BoardProcessOption.reservedEdgeLeft);
let reservedEdgeRight = parseFloat(br.BoardProcessOption.reservedEdgeRight);
highReservedEdge.length = 0;
let dir = Math.sign(br.ContourCurve.Area2);
for (let c of sealcus)
{
let derv = c.GetFirstDeriv(0).multiplyScalar(dir);
if (Math.abs(derv.x) > Math.abs(derv.y))
{
if (derv.x > 0)
highReservedEdge.push({ size: reservedEdgeDown });
else
highReservedEdge.push({ size: reservedEdgeUp });
}
else
{
if (derv.y > 0)
highReservedEdge.push({ size: reservedEdgeRight });
else
highReservedEdge.push({ size: reservedEdgeLeft });
}
}
}
return highReservedEdge;
}
export function GetHighBoardEdgeRemark(br: Board, sealcus: Curve[]): IHighEdgeRemarkItem[]
{
const opt = br.BoardProcessOption;
@ -313,6 +368,7 @@ export interface BrSealedData
brCurves: Curve[];//封边轮廓(高级封边 已经成组)
highSeals: IHighSealedItem[];//高级封边(一一对应)
highReservedEdges: IHighReservedEdgeItem[];//高级预留边
hasSealedErr?: boolean;//调用 GetSealedBoardContour 方法时判断是否有出现封边异常
}
@ -378,6 +434,7 @@ export function GetSealedBoardContour(br: Board): BrSealedData | undefined
let curves = GetBoardSealingCurves(br);
let highSeals = GetBoardHighSeal(br, curves);
let highReservedEdges = GetBoardHighReservedEdge(br, curves);
if (curves.length === 1 && curves[0] instanceof Circle)
{
@ -386,6 +443,7 @@ export function GetSealedBoardContour(br: Board): BrSealedData | undefined
sealedContour: curves[0].GetOffsetCurves(-highSeals[0].size)[0] as Circle,
brCurves: curves,
highSeals,
highReservedEdges,
};
return res;
}
@ -407,56 +465,72 @@ export function GetSealedBoardContour(br: Board): BrSealedData | undefined
}
else
{
//局部偏移
let polylineOffset = new OffsetPolyline2(brContour, dir * -Math.max(...highSeals.map(s => s.size)));
let subIndex = 0;
polylineOffset._TrimCircleContours = [];
polylineOffset._TrimArcContours = [];
polylineOffset._SubOffsetedCurves = [];
polylineOffset._SubCurves = [];
polylineOffset._Circles = [];
polylineOffset._CacheOCS = IdentityMtx4;
polylineOffset._IsClose = true;
let positiveOffset: number; //正偏移
let negativeOffset: number; //负偏移
for (let i = 0; i < curves.length; i++)
{
let curve = curves[i];//曲线组
let seal = highSeals[i];//封边
let reservedEdge = highReservedEdges[i];
let offDist = -seal.size + reservedEdge.size;
if (offDist > 0)
positiveOffset = positiveOffset === undefined ? offDist : (positiveOffset > offDist ? positiveOffset : offDist);
else
negativeOffset = negativeOffset === undefined ? offDist : (negativeOffset < offDist ? negativeOffset : offDist);
}
let preSeal = highSeals[FixIndex(i - 1, curves)];
//先分解多段线生成对应线段和封边值,防止两次偏移得到的线段数不一致
const newSeal: IHighSealedItem[] = [];
const newReservedEdge: IHighReservedEdgeItem[] = [];
const newCurves: Curve[] = [];
for (let i = 0; i < curves.length; i++)
{
let seal = highSeals[i];
let reservedEdge = highReservedEdges[i];
let curve = curves[i];
if (curve instanceof Polyline)
{
let curveExpds = curve.Explode().filter(c => c.Length >= 1e-4);
for (let j = 0; j < curveExpds.length; j++)
for (const c of curveExpds)
{
let c = curveExpds[j];
polylineOffset._SubCurves.push(c);//sub
//trim Circle
if (seal.size && (j || seal.size === preSeal.size))
polylineOffset._Circles.push(new Circle(c.StartPoint, seal.size));
else
polylineOffset._Circles.push(undefined);
//offset
let offsetC = c.GetOffsetCurves(dir * -seal.size)[0];
if (offsetC)
polylineOffset._SubOffsetedCurves.push({
index: subIndex,
curve: offsetC,
dist: seal.size,
});
else
polylineOffset._TrimArcContours.push(Contour.CreateContour([c, new Line(c.StartPoint, c.EndPoint)], false));
subIndex++;
newSeal.push(seal);
newReservedEdge.push(reservedEdge);
newCurves.push(c);
}
}
else
{
newSeal.push(seal);
newReservedEdge.push(reservedEdge);
newCurves.push(curve);
}
}
const SealedContours = (curves: Curve[], highSeals: IHighSealedItem[], highReservedEdges: IHighReservedEdgeItem[], dist: number) =>
{
//局部偏移
let polylineOffset = new OffsetPolyline2(brContour, dir * dist);
let subIndex = 0;
polylineOffset._TrimCircleContours = [];
polylineOffset._TrimArcContours = [];
polylineOffset._SubOffsetedCurves = [];
polylineOffset._SubCurves = [];
polylineOffset._Circles = [];
polylineOffset._CacheOCS = IdentityMtx4;
polylineOffset._IsClose = true;
for (let i = 0; i < curves.length; i++)
{
let curve = curves[i];//曲线组
let seal = highSeals[i];//封边
let reservedEdge = highReservedEdges[i];
let offDist = -seal.size + reservedEdge.size;
if (Math.sign(offDist) != Math.sign(dist))
offDist = 0;
let preSeal = highSeals[FixIndex(i - 1, curves)];
if (curve.Length < 1e-4) continue;
polylineOffset._SubCurves.push(curve);//sub
@ -468,23 +542,41 @@ export function GetSealedBoardContour(br: Board): BrSealedData | undefined
polylineOffset._Circles.push(undefined);
//offset
let offsetC = curve.GetOffsetCurves(dir * -seal.size)[0];
let offsetC = curve.GetOffsetCurves(dir * offDist)[0];
if (offsetC)
polylineOffset._SubOffsetedCurves.push({
index: subIndex,
curve: offsetC,
dist: seal.size,
dist: -offDist,
});
else
polylineOffset._TrimArcContours.push(Contour.CreateContour([curve, new Line(curve.StartPoint, curve.EndPoint)], false));
subIndex++;
}
}
polylineOffset._Vertexs = polylineOffset._SubCurves.map(c => c.StartPoint);
polylineOffset._Vertexs = polylineOffset._SubCurves.map(c => c.StartPoint);
sealedContours = polylineOffset.Do();
polylineOffset.Do();
return polylineOffset;
};
let polylineOffset1: OffsetPolyline2;
let offCurves = newCurves;
//先判断负偏移
if (negativeOffset != undefined)
{
polylineOffset1 = SealedContours(newCurves, newSeal, newReservedEdge, negativeOffset);
offCurves = polylineOffset1._SubOffsetedCurves.map((s) => s.curve);
}
//如果存在正偏移,再偏移一次
if (positiveOffset != undefined)
{
let polylineOffset2 = SealedContours(offCurves, newSeal, newReservedEdge, positiveOffset);
sealedContours = polylineOffset2._RetCurves;
}
else
sealedContours = polylineOffset1._RetCurves;
}
let hasSealedErr = false;
@ -528,6 +620,7 @@ export function GetSealedBoardContour(br: Board): BrSealedData | undefined
sealedContour,
brCurves: curves,
highSeals,
highReservedEdges,
hasSealedErr
};
@ -544,7 +637,7 @@ export function GetSealedBoardContour(br: Board): BrSealedData | undefined
export function ConverEachSeal2HightSealData(seals: IHighSealedItem[], curves: Curve[]): IHighSealedItem[]
{
curves = curves.concat();
seals = seals.concat();
seals = structuredClone(seals);
let lastSeal = seals[seals.length - 1];
for (let i = seals.length; i < curves.length; i++)
@ -583,20 +676,34 @@ export function SetBoardTopDownLeftRightSealData(br: Board, sealDatas: IHighSeal
{
for (let i = 0; i < 4; i++)
{
const size = sealDatas[i].size.toString();
const { sealColor: color = "" } = sealDatas[i];
let derv = sealCurves[i].GetFirstDeriv(0).normalize();
if (isParallelTo(derv, XAxis, 1e-4))
{
if (derv.x * dir > 0)
br.BoardProcessOption[EBoardKeyList.DownSealed] = sealDatas[i].size.toString();
{
br.BoardProcessOption[EBoardKeyList.DownSealed] = size;
br.BoardProcessOption.sealColorDown = color;
}
else
br.BoardProcessOption[EBoardKeyList.UpSealed] = sealDatas[i].size.toString();
{
br.BoardProcessOption[EBoardKeyList.UpSealed] = size;
br.BoardProcessOption.sealColorUp = color;
}
}
else
{
if (derv.y * dir > 0)
br.BoardProcessOption[EBoardKeyList.RightSealed] = sealDatas[i].size.toString();
{
br.BoardProcessOption[EBoardKeyList.RightSealed] = size;
br.BoardProcessOption.sealColorRight = color;
}
else
br.BoardProcessOption[EBoardKeyList.LeftSealed] = sealDatas[i].size.toString();
{
br.BoardProcessOption[EBoardKeyList.LeftSealed] = size;
br.BoardProcessOption.sealColorLeft = color;
}
}
}
}
@ -609,6 +716,49 @@ export function SetBoardTopDownLeftRightSealData(br: Board, sealDatas: IHighSeal
br.BoardProcessOption[EBoardKeyList.RightSealed] = sealDatas[right].size.toString();
br.BoardProcessOption[EBoardKeyList.UpSealed] = sealDatas[top].size.toString();
br.BoardProcessOption[EBoardKeyList.DownSealed] = sealDatas[bottom].size.toString();
br.BoardProcessOption.sealColorLeft = sealDatas[left].sealColor ?? "";
br.BoardProcessOption.sealColorRight = sealDatas[right].sealColor ?? "";
br.BoardProcessOption.sealColorUp = sealDatas[top].sealColor ?? "";
br.BoardProcessOption.sealColorDown = sealDatas[bottom].sealColor ?? "";
}
}
export function SetBoardReservedEdgeData(br: Board, sealDatas: IHighReservedEdgeItem[], sealCurves?: Curve[], brContourCurve?: ExtrudeContourCurve)
{
let dir = Math.sign((brContourCurve ?? br.ContourCurve).Area2);
sealCurves = sealCurves ?? GetBoardSealingCurves(br);
if (br.IsRect && sealCurves.length === 4)
{
for (let i = 0; i < 4; i++)
{
let derv = sealCurves[i].GetFirstDeriv(0).normalize();
if (isParallelTo(derv, XAxis, 1e-4))
{
if (derv.x * dir > 0)
br.BoardProcessOption.reservedEdgeDown = sealDatas[i].size.toString();
else
br.BoardProcessOption.reservedEdgeUp = sealDatas[i].size.toString();
}
else
{
if (derv.y * dir > 0)
br.BoardProcessOption.reservedEdgeRight = sealDatas[i].size.toString();
else
br.BoardProcessOption.reservedEdgeLeft = sealDatas[i].size.toString();
}
}
}
else
{
if (sealCurves.length === 0)
return;
let [left, right, top, bottom] = ParseEdgeSealDir(sealCurves);
br.BoardProcessOption.reservedEdgeLeft = sealDatas[left].size.toString();
br.BoardProcessOption.reservedEdgeRight = sealDatas[right].size.toString();
br.BoardProcessOption.reservedEdgeUp = sealDatas[top].size.toString();
br.BoardProcessOption.reservedEdgeDown = sealDatas[bottom].size.toString();
}
}

@ -30,7 +30,7 @@ import { AsVector2, IsBetweenA2B, MoveMatrix, XAxis, angle, angleTo, equaln, equ
import { BrSealedData, GetSealedBoardContour } from "../GraphicsSystem/CalcEdgeSealing";
import { FeedingToolPath, GetModelingFromCustomDrill } from "../GraphicsSystem/ToolPath/FeedingToolPath";
import { EMetalsType, IHardwareOption, IToplineOption } from "../UI/Components/RightPanel/RightPanelInterface";
import { IHighEdgeRemarkItem, ISealingData } from "../UI/Store/OptionInterface/IHighSealedItem";
import { IHighEdgeRemarkItem, IHighReservedEdgeItem, ISealingData } from "../UI/Store/OptionInterface/IHighSealedItem";
import { Entity } from './../DatabaseServices/Entity/Entity';
import { ICompHardwareOption } from './../UI/Components/RightPanel/RightPanelInterface';
import { ConverArcToPtsBul, ConverToPtsBul, IContourData } from "./Convert2PtsBul";
@ -114,6 +114,7 @@ export interface ISpliteOrderData
outline: IContourData; //拆单轮廓信息
sealing: ISealingData[]; //封边信息
boardEdgeRemark: IHighEdgeRemarkItem[]; //板边备注信息
reservedEdge: IHighReservedEdgeItem[]; //预留边信息
modeling: IModelingData[]; //造型信息
curveBoardModeling: IModeling[];
holes: IBoardHoleInfo; //孔信息
@ -217,13 +218,15 @@ export namespace Production
boardContour = ConverToPtsBul(br.ContourCurve);//不分裂圆弧转点表
//每段封边信息
let perSealData = ParseSealData(sealedData);
let { seals: perSealData, reservedEdges: perReservedEdgeData } = ParseSealData(sealedData, br.BoardProcessOption.color);
let perBoardEdgeRemarkData = br.IsSpecialShape ? ParseBoardEdgeRemarkData(sealedData, br.BoardProcessOption.highBoardEdgeRemark) : [];
//因为传递给拆单软件的数据是逆时针,所以我们翻转它
if (orgContour.Area2 < 0)
{
perSealData.reverse();
perBoardEdgeRemarkData.reverse();
perReservedEdgeData.reverse();
//对应sealedOutlinePtsBul顺序 解析孔时翻转orgContour
orgContour.Reverse();
@ -238,6 +241,7 @@ export namespace Production
outline: sealedOutlinePtsBul, //扣完封边的点表
sealing: perSealData,//每段曲线的封边信息
boardEdgeRemark: perBoardEdgeRemarkData, //每段曲线的板边备注信息
reservedEdge: perReservedEdgeData, //每段曲线的预留边信息
modeling,
curveBoardModeling,
holes,
@ -252,24 +256,31 @@ export namespace Production
//生产那边需要一一对应的数据
export function ParseSealData(sealData: BrSealedData): ISealingData[]
export function ParseSealData(sealData: BrSealedData, defaultSealColor: string = ""): { seals: ISealingData[], reservedEdges: IHighReservedEdgeItem[]; }
{
let seals: ISealingData[] = [];
let reservedEdges: IHighReservedEdgeItem[] = [];
for (let i = 0; i < sealData.brCurves.length; i++)
{
let curve = sealData.brCurves[i];
let sealD = sealData.highSeals[i];
let reservedEdgeD = sealData.highReservedEdges[i];
if (curve instanceof Circle)
{
let seal2: ISealingData = {
length: curve.Length * 0.5,
...sealD
...sealD,
sealColor: sealD.sealColor ? sealD.sealColor : defaultSealColor
};
//圆型板拆单时是分成两段圆弧处理
seals.push(seal2);
seals.push({ ...seal2 });
return seals;
reservedEdges.push(reservedEdgeD);
reservedEdges.push({ ...reservedEdgeD });
return { seals, reservedEdges };
}
else
{
@ -279,22 +290,28 @@ export namespace Production
{
let seal2: ISealingData = {
length: subC.Length,
...sealD
...sealD,
sealColor: sealD.sealColor ? sealD.sealColor : defaultSealColor
};
seals.push(seal2);
reservedEdges.push(reservedEdgeD);
}
}
else//直线 圆弧直接加
{
let seal2: ISealingData = {
length: curve.Length,
...sealD
...sealD,
sealColor: sealD.sealColor ? sealD.sealColor : defaultSealColor
};
seals.push(seal2);
reservedEdges.push(reservedEdgeD);
}
}
}
return seals;
return { seals, reservedEdges };
}
export function ParseBoardEdgeRemarkData(sealData: BrSealedData, highBoardEdgeRemark: IHighEdgeRemarkItem[]): IHighEdgeRemarkItem[]
@ -307,6 +324,7 @@ export namespace Production
if (curve instanceof Circle)
{
//圆型板拆单时是分成两段圆弧处理
remarks.push(remarkData);
remarks.push({ ...remarkData });
return remarks;

@ -164,9 +164,10 @@ export class TitleBanner extends React.Component<ITitleBannerProps>
sealing: ["上封边", "下封边", "左封边", "右封边"],
highDrill: ["上排钻", "下排钻", "左排钻", "右排钻"],
boardEdgeRemark: ["上边备注信息", "下边备注信息", "左边备注信息", "右边备注信息"],
reservedEdge: ["上预留边", "下预留边", "左预留边", "右预留边"],
};
if (["sealing", "highDrill", "boardEdgeRemark"].includes(key))
if (["sealing", "highDrill", "boardEdgeRemark", "reservedEdge"].includes(key))
{
return boardEdgeEditor(index, boardEdgeMap[key], key);
}
@ -442,6 +443,13 @@ export class BBSSealingComponent extends React.Component<IBBSSealingComponentPro
left: "edgeRemarkLeft",
right: "edgeRemarkRight",
},
reservedEdge: {
title: "异形板件请查看预留边",
up: "reservedEdgeUp",
down: "reservedEdgeDown",
left: "reservedEdgeLeft",
right: "reservedEdgeRight",
}
};
const boardInfo: { title: string, up: string, down: string, left: string, right: string; } = boardEdgeInfoMap[keyName];
const minWidth = keyName === "boardEdgeRemark" ? 110 : 62;

@ -122,6 +122,11 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
return this.option.hasOwnProperty("edgeRemarkUp");
}
if (key === "reservedEdge")
{
return this.option.hasOwnProperty("reservedEdgeUp");
}
return this.option.hasOwnProperty(key);
}
public render()
@ -165,6 +170,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
);
case "sealing":
case "boardEdgeRemark":
case "reservedEdge":
return <BBSSealingComponent
key={key}
keyName={key}
@ -350,6 +356,12 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
opt.edgeRemarkLeft = br.BoardProcessOption.edgeRemarkLeft;
opt.edgeRemarkRight = br.BoardProcessOption.edgeRemarkRight;
break;
case "reservedEdge":
opt.reservedEdgeUp = br.BoardProcessOption.reservedEdgeUp;
opt.reservedEdgeDown = br.BoardProcessOption.reservedEdgeDown;
opt.reservedEdgeLeft = br.BoardProcessOption.reservedEdgeLeft;
opt.reservedEdgeRight = br.BoardProcessOption.reservedEdgeRight;
break;
default:
opt[key] = br.BoardProcessOption[key];
}

@ -493,6 +493,20 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
b.BoardProcessOption.edgeRemarkRight,
);
break;
case "reservedEdge":
if (b.IsSpecialShape)
for (let i = 0; i < 4; i++)
{
arr.push("异形板件请查看预留边");
}
else
arr.push(
b.BoardProcessOption.reservedEdgeUp,
b.BoardProcessOption.reservedEdgeDown,
b.BoardProcessOption.reservedEdgeLeft,
b.BoardProcessOption.reservedEdgeRight,
);
break;
default:
arr.push(`"${b.BoardProcessOption[key]}"`);
}
@ -500,16 +514,21 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
this.boardDataInArray.push({ br: b, arr: arr });
}
let titles: string[] = [];
const titleMapping = {
"封边": ["上封边", "下封边", "左封边", "右封边"],
"高级排钻": ["上排钻", "下排钻", "左排钻", "右排钻"],
"板边备注信息": ["上边备注信息", "下边备注信息", "左边备注信息", "右边备注信息"],
"预留边信息": ["上预留边", "下预留边", "左预留边", "右预留边"]
};
for (let i of bbsEditorStore.tabbarIndexs)
{
if (TotalTabbarTitlesInfos[i][0] === "封边")
titles.push("上封边", "下封边", "左封边", "右封边");
else if (TotalTabbarTitlesInfos[i][0] === "高级排钻")
titles.push("上排钻", "下排钻", "左排钻", "右排钻");
else if (TotalTabbarTitlesInfos[i][0] === "板边备注信息")
titles.push("上边备注信息", "下边备注信息", "左边备注信息", "右边备注信息");
else
if (titleMapping[TotalTabbarTitlesInfos[i][0]])
{
titles.push(...titleMapping[TotalTabbarTitlesInfos[i][0]]);
} else
{
titles.push(TotalTabbarTitlesInfos[i][0]);
}
}
this.boardDataInArray.unshift({ br: null, arr: titles });

@ -1,5 +1,5 @@
import { Button, Checkbox, Classes, HTMLSelect, Label, Position, Radio, RadioGroup, Tooltip } from '@blueprintjs/core';
import { observable } from 'mobx';
import { IObservableValue, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { useRef } from 'react';
@ -505,6 +505,7 @@ interface I5InputComponent extends ISetItemOption
otherBoardData?: { [key: string]: any; };
verticalRemark?: boolean;
layerRemark?: boolean;
showHighEdgeProcessing?: IObservableValue<boolean>;
}
/**
@ -520,7 +521,7 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
const options = [...userConfig.DrillConfigs.keys(), "不排"];
const { isRemarks, highDrillOption, isShowEditor, type,
upKey, leftKey, downKey, rightKey, centerKey,
option, uiOption, showDirectionIcon, hasCenter,
option, uiOption, showDirectionIcon, hasCenter, showHighEdgeProcessing,
onChange } = this.props;
const isShow = isShowEditor && highDrillOption;
@ -533,6 +534,7 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
option={option}
uiOption={uiOption}
onChange={onChange}
isHideErrorMsg={showHighEdgeProcessing ? showHighEdgeProcessing.get() : false}
/>
{
isShow && <HTMLSelect
@ -580,6 +582,7 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
option={option}
uiOption={uiOption}
onChange={onChange}
isHideErrorMsg={showHighEdgeProcessing ? showHighEdgeProcessing.get() : false}
/>
{
isShow && <HTMLSelect
@ -633,6 +636,7 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
option={option}
uiOption={uiOption}
onChange={onChange}
isHideErrorMsg={showHighEdgeProcessing ? showHighEdgeProcessing.get() : false}
/>
{
isShow && <HTMLSelect
@ -675,6 +679,7 @@ export class Input5Or4Component extends React.Component<I5InputComponent, {}>
option={option}
uiOption={uiOption}
onChange={onChange}
isHideErrorMsg={showHighEdgeProcessing ? showHighEdgeProcessing.get() : false}
/>
{
isShow && <HTMLSelect
@ -848,6 +853,7 @@ export class DrillTypeSelectCom extends React.Component<IDrillTypeSelect, { isDa
disabled={isHeightDrillLock}
style={{
padding: "0 5px",
width: "100%",
outline: this.state.isDanger && "1px red solid",
}}
options={options}
@ -859,7 +865,7 @@ export class DrillTypeSelectCom extends React.Component<IDrillTypeSelect, { isDa
{
return <div className="flex" style={{
display: "inline-flex",
width: "65%"
width: "71%"
}}>
{select}
<Button
@ -1019,7 +1025,7 @@ export class AutoCutCheckbox extends React.Component<IAutoCutCheckboxProps, {}>
export const BoardOpenDirSelect = observer((data: { opt?: BoardConfigOption, className?: string; }) =>
<label className={"bp3-label bp3-inline .modifier " + data.className} >
<span style={{ width: "4.4rem" }}></span>
<span>:</span>
<HTMLSelect
value={data.opt.openDir}
options={openDirOptions}

@ -176,7 +176,12 @@ export class BoardModal extends React.Component<BoardModalProps, {}>
}}
/>
}
<BoardProcessModal type={this.props.type} opt={store.m_BoardProcessOption} topBottomOption={(store as TopBottomBoardStore).bottomBoardOption} drillOption={store.rectDrillOption} uiOpt={store.UIBoardProcessOption} />
<BoardProcessModal
type={this.props.type}
opt={store.m_BoardProcessOption}
topBottomOption={(store as TopBottomBoardStore).bottomBoardOption}
drillOption={store.rectDrillOption}
uiOpt={store.UIBoardProcessOption} />
</div>
<div className={Classes.CARD}>
<Notes remarks={this.props.store.remarks} />

@ -54,6 +54,7 @@ export enum BoardModalType
BatchModifyPanel = "BatchModifyPanel", //批量修改板件
Sealing = "Sealing", //封边
BoardEdgeRemarks = "boardEdgeRemarks", //板边备注
ReservedEdge = "ReservedEdge", //预留边
DimStyleConfig = "DimStyleConfig",//标注配置
BulkheadCeiling = "BulkheadCeiling",//吊顶轮廓
BulkheadCeilingContour = "BulkheadCeilingContour",//吊顶轮廓

@ -17,7 +17,7 @@ import { TemplateWineRackRecord } from '../../../DatabaseServices/Template/Progr
import { CommandWrap } from '../../../Editor/CommandMachine';
import { PromptStatus } from '../../../Editor/PromptResult';
import { TempEditor } from '../../../Editor/TempEditor';
import { IGoodInfo } from '../../MaterialEditor/GoodsList';
import { GoodsType, IGoodInfo } from '../../MaterialEditor/GoodsList';
import { GoodsListDiv } from '../../MaterialEditor/GoodsListDiv';
import { BoardProcessOption } from "../../Store/OptionInterface/BoardProcessOption";
import { IHightDrillOption, IUiOption, TBBoardOption } from "../../Store/OptionInterface/IOptionInterface";
@ -27,6 +27,7 @@ import { RightTabId } from '../RightPanel/RightPanel';
import { AppToaster } from '../Toaster';
import { DrillTypeSelectCom, Input5Or4Component, SetBoardDataBlock, SetBoardDataItem } from './BoardCommon';
import { BoardModalType } from './BoardModalType';
import { HighEdgeProcessingModal, SealMaterialComponent } from './HighEdgeProcessingModal';
import { DialogUserConfig } from './UserConfigComponent';
interface BoardProcessProps
@ -48,10 +49,11 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
private showShops = observable.box(false);
private showAlert = observable.box(false);
@observable private tags: string[] = [];
private container: HTMLDivElement;
private container = React.createRef<HTMLDivElement>();
private matPars = [
["boardName", "板材名"], ["material", "材料"], ["color", "颜色"]
];
showHighEdgeProcessing = observable.box(false);
private async editorEdgeSealing(br: Board)
{
if (TempEditor.EditorIng)
@ -104,12 +106,37 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}, 0);
}
private renderEl = () =>
private async editorReservedEdge(br: Board)
{
if (TempEditor.EditorIng)
{
AppToaster.show({
message: "当前正处于编辑模式下",
timeout: 3000,
intent: Intent.WARNING,
});
return;
}
app.Editor.ModalManage.Destory();
let store = RightPanelStore.GetInstance();
store.reservedEdgeStore.isNotUpdateStore = true;//禁止UI再次更新配置
let config = new DialogUserConfig(store.reservedEdgeStore, BoardModalType.ReservedEdge);
await config.LoadAndInitConfig();//载入或者初始化
store.m_IsShow = true;
store.m_TabId = RightTabId.ReservedEdge;
setTimeout(() =>
{
store.reservedEdgeStore.StartEditor([br]);
store.reservedEdgeStore.isNotUpdateStore = false;
}, 0);
}
private renderRoomCabinetName = () =>
{
const el =
<>
<SetBoardDataItem
className='modal-pick'
type={CheckObjectType.BR}
optKey="roomName"
option={this.props.opt}
@ -117,7 +144,6 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
placeHolder="输入房间名"
/>
<SetBoardDataItem
className='modal-pick'
type={CheckObjectType.BR}
optKey="cabinetName"
option={this.props.opt}
@ -346,7 +372,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}
componentDidMount()
{
this.container.addEventListener('keydown', e => e.stopPropagation());
this.container.current.addEventListener('keydown', e => e.stopPropagation());
}
componentDidUpdate(prevProps: Readonly<BoardProcessProps>, prevState: Readonly<{}>, snapshot?: any): void
@ -356,15 +382,15 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}
render()
{
const { isEdgeRemarks = true } = this.props;
const { isEdgeRemarks = true, opt, uiOpt } = this.props;
let isShowHighEditor = Boolean(this.props.br);
let tagValue = this.getTags().join(',');
const CheckBoxStyle: React.CSSProperties = { marginBottom: 3 };
return (
<div className="board-info" ref={el => this.container = el}>
<div className="board-info" ref={this.container}>
{
this.renderEl()
this.renderRoomCabinetName()
}
<div className="flex br-mat">
<SetBoardDataBlock
@ -388,7 +414,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}
</div>
<div>
<label className="bp3-label bp3-inline .modifier">
<label className="bp3-label bp3-inline">
<span>:</span>
<HTMLSelect
className='modal-pick'
@ -400,10 +426,10 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}}
/>
</label>
<label className="bp3-label bp3-inline .modifier" style={{ display: "flex" }}>
<label className="bp3-label bp3-inline processing-group-info">
<span>:</span>
<div className="flex" style={{ display: "inline-flex", width: "83%" }}>
<input className="bp3-input br-process-input modal-pick" title="双击查看详细内容" value={tagValue} readOnly style={{ flex: 1 }} onDoubleClick={this.onProcessInputDbClick} />
<div className="detail">
<input className="bp3-input" title="双击查看详细内容" value={tagValue} readOnly style={{ flex: 1 }} onDoubleClick={this.onProcessInputDbClick} />
<Button
text="更多"
intent="success"
@ -464,7 +490,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
{/* todo添加加工组 */}
</Alert>
</label>
<label className="bp3-label bp3-inline .modifier">
<label className="bp3-label bp3-inline">
<span>:</span>
<HTMLSelect
className='modal-pick'
@ -481,7 +507,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}}
/>
</label>
<label className="bp3-label bp3-inline .modifier" style={{ width: 180 }}>
<label className="bp3-label bp3-inline drill-info">
<span>:</span>
<DrillTypeSelectCom
opt={this.props.opt}
@ -491,7 +517,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
drillOption={this.props.drillOption}
/>
</label>
<label className="bp3-label bp3-inline .modifier">
<label className="bp3-label bp3-inline">
<span>:</span>
<HTMLSelect
className='modal-pick'
@ -503,14 +529,77 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}}
/>
</label>
<label className="bp3-label bp3-inline .modifier">
{
this.props.type != BoardModalType.YX &&
<label className="bp3-label bp3-inline seal-material-info">
<span>:</span>
<SealMaterialComponent
type={GoodsType.sealMaterial}
option={opt}
optKey={"sealColorType"}
onChange={(e) =>
{
const value = e.target.value;
opt.sealColorType = value;
opt.sealColorDown = value;
opt.sealColorUp = value;
opt.sealColorLeft = value;
opt.sealColorRight = value;
opt.highSealed = opt.highSealed.map(s =>
{
return { size: s.size, sealColor: value };
});
}}
handleSelect={(good: IGoodInfo) =>
{
opt.sealColorType = good.color;
opt.sealedUp = good.thickness.toString();
opt.sealedDown = good.thickness.toString();
opt.sealedLeft = good.thickness.toString();
opt.sealedRight = good.thickness.toString();
opt.sealColorDown = good.color;
opt.sealColorUp = good.color;
opt.sealColorLeft = good.color;
opt.sealColorRight = good.color;
if (uiOpt)
{
uiOpt.sealedUp = good.thickness.toString();
uiOpt.sealedDown = good.thickness.toString();
uiOpt.sealedLeft = good.thickness.toString();
uiOpt.sealedRight = good.thickness.toString();
}
opt.highSealed = opt.highSealed.map(s =>
{
return { size: good.thickness, sealColor: good.color };
});
}}
/>
{
isShowHighEditor &&
<Button
text="高级"
intent="success"
style={{
minHeight: 18,
height: 18,
padding: 0,
fontSize: 12,
}}
onClick={() => this.editorEdgeSealing(this.props.br)}
/>
}
</label>
}
<label className="bp3-label bp3-inline">
<span>:</span>
<div className="inline">
<Checkbox
label="正面"
style={{
marginRight: 5,
marginLeft: 5,
...CheckBoxStyle
}}
inline
@ -580,13 +669,6 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
<Button
text="高级编辑"
style={{
marginLeft: 20,
minHeight: 18,
height: 18,
padding: "0 10px",
fontSize: 12
}}
intent="success"
onClick={() => this.editorEdgeSealing(this.props.br)}
/>
@ -595,23 +677,48 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
<Button
text="高级编辑"
style={{
marginLeft: 20,
minHeight: 12,
height: 18,
padding: "0 10px",
fontSize: 12
}}
intent="success"
onClick={() => this.editorEdgeRemarks(this.props.br)}
/>
</h6>
<h6 className={"edge-sealing " + Classes.HEADING}>
<Button
text="高级编辑"
intent="success"
onClick={() => this.editorReservedEdge(this.props.br)}
/>
</h6>
</>
}
{
(!this.props.br || (!this.props.isSpecial.get() || this.isSplit())) &&
<>
<h6 className={"edge-sealing " + Classes.HEADING}></h6>
<h6 className={"edge-sealing " + Classes.HEADING}>
{
this.props.type != BoardModalType.YX &&
<>
<Button
text="高级边处理"
intent={Intent.PRIMARY}
onClick={() => { this.showHighEdgeProcessing.set(true); }}
/>
{
this.showHighEdgeProcessing.get() &&
<HighEdgeProcessingModal
showHighEdgeProcessing={this.showHighEdgeProcessing}
option={opt}
UIOption={uiOpt}
type={CheckObjectType.BR}
highDrillOption={this.props.drillOption}
hasDrill={this.props.drillOption ? true : false}
isDrillLock={this.props.otherBoardData?.isDrillLock}
/>
}
</>
}
</h6>
<Input5Or4Component
type={CheckObjectType.BR}
showDirectionIcon={true}
@ -621,12 +728,13 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
downKey="sealedDown"
leftKey="sealedLeft"
rightKey="sealedRight"
option={this.props.opt}
uiOption={this.props.uiOpt}
option={opt}
uiOption={uiOpt}
isShowEditor={true}
isRemarks={isEdgeRemarks}
highDrillOption={this.props.drillOption}
otherBoardData={this.props.otherBoardData}
showHighEdgeProcessing={this.showHighEdgeProcessing}
/>
</>
}

@ -230,10 +230,17 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
ParseBoardRectHoleType(this.CurrentBoard, this.drillsOption);
}
});
public SetRectHighDrill = () =>
public SetRectHighDrillAndSealColor = () =>
{
if (this.CurrentBoard)
{
const opt = this.CurrentBoard.BoardProcessOption;
let types = new Set([opt.sealColorUp, opt.sealColorDown, opt.sealColorLeft, opt.sealColorRight]);
if (types.size === 1)
this.CurrentBoard.BoardProcessOption.sealColorType = [...types][0];
else if (types.size > 1)
this.CurrentBoard.BoardProcessOption.sealColorType = "**多种**";
SetBrHighHoleTypeFromRectHoleType(this.CurrentBoard, this.drillsOption);
}
};
@ -292,7 +299,7 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
board.BoardProcessOption = toJS(this._ProcessOption);
if (isRect)
this.SetRectHighDrill();
this.SetRectHighDrillAndSealColor();
if (userConfig.openDrillingReactor)
{

@ -1,4 +1,5 @@
import { Checkbox, Divider, H5, H6, Radio, RadioGroup, Tooltip } from '@blueprintjs/core';
import { Button, Checkbox, Divider, H5, Intent, Radio, RadioGroup, Tooltip } from '@blueprintjs/core';
import { observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { CheckObjectType } from '../../../../Common/CheckoutVaildValue';
@ -11,6 +12,7 @@ import { DoorPosType, HandleHorPos, HandleVePos, IDoorConfigOption, IDrawerConfi
import { HightDrillOption, IUiOption } from "../../../Store/OptionInterface/IOptionInterface";
import { ToasterInput } from '../../Toaster';
import { Input5Or4Component, SetBoardDataItem } from '../BoardCommon';
import { HighEdgeProcessingModal } from '../HighEdgeProcessingModal';
import { ChangeDoorOrDrawerPosition, DoorDrawerRowCol, UpDownSpaceComponent } from './DoorCommon';
import { HingeRules } from './HingeRule';
@ -18,6 +20,10 @@ import { HingeRules } from './HingeRule';
export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore; }>
{
private uiOption: IUiOption<IDoorConfigOption & IDrawerConfigOption>;
showDoorHighEdgeProcessing = observable.box(false);
showLayerHighEdgeProcessing = observable.box(false);
showVerticalHighEdgeProcessing = observable.box(false);
showDrawerHighEdgeProcessing = observable.box(false);
private isDoor: boolean = true;
private handleDrawerDepth = () =>
{
@ -99,7 +105,7 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
renderDoor = () =>
{
const { store } = this.props;
const { m_Option } = store as DoorStore;
const { m_Option, UIOption } = store as DoorStore;
return (
<>
<DoorDrawerRowCol
@ -154,7 +160,31 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
</div>
</div>
<div>
<H6 style={{ textAlign: "center" }}></H6>
<H5 className={"edge-sealing"}>
<Button
text="高级边处理"
intent={Intent.PRIMARY}
onClick={() => { this.showDoorHighEdgeProcessing.set(true); }}
/>
{
this.showDoorHighEdgeProcessing.get() &&
<HighEdgeProcessingModal
showHighEdgeProcessing={this.showDoorHighEdgeProcessing}
option={store.m_Option}
UIOption={store.UIOption}
type={CheckObjectType.BR}
sealValueMap={{
up: "topDoorSeal",
down: "bottomDoorSeal",
left: "leftDoorSeal",
right: "rightDoorSeal"
}}
hasDrill={false}
hasRemark={false}
/>
}
</H5>
<Input5Or4Component
type={CheckObjectType.Do}
showDirectionIcon={false}
@ -166,6 +196,7 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
rightKey="rightDoorSeal"
option={store.m_Option}
uiOption={this.uiOption}
showHighEdgeProcessing={this.showDoorHighEdgeProcessing}
/>
</div>
</div>
@ -225,9 +256,54 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
inline
/>
</div>
<div className="flex-arround">
<div style={{ display: "flex", justifyContent: "space-around" }}>
<div>
<H5>/</H5>
<H5 className={"edge-sealing"}>
<Button
text="高级边处理"
intent={Intent.PRIMARY}
onClick={() => { this.showVerticalHighEdgeProcessing.set(true); }}
onKeyDown={() =>
{
console.log('1', 1);
}}
/>
{
this.showVerticalHighEdgeProcessing.get() &&
<HighEdgeProcessingModal
showHighEdgeProcessing={this.showVerticalHighEdgeProcessing}
option={m_Option}
UIOption={UIOption}
type={CheckObjectType.BR}
highDrillOption={store.m_Option.lbHightDrillOption}
sealValueMap={{
up: "lbSealedUp",
down: "lbSealedDown",
left: "lbSealedLeft",
right: "lbSealedRight"
}}
sealColorMap={{
up: "verticalSealColorUp",
down: "verticalSealColorDown",
left: "verticalSealColorLeft",
right: "verticalSealColorRight"
}}
reservedEdgeMap={{
up: "verticalReservedEdgeUp",
down: "verticalReservedEdgeDown",
left: "verticalReservedEdgeLeft",
right: "verticalReservedEdgeRight"
}}
remarkMap={{
up: "verticalEdgeRemarkUp",
down: "verticalEdgeRemarkDown",
left: "verticalEdgeRemarkLeft",
right: "verticalEdgeRemarkRight"
}}
/>
}
</H5>
<Input5Or4Component
type={CheckObjectType.BR}
showDirectionIcon={true}
@ -243,10 +319,52 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
highDrillOption={store.m_Option.lbHightDrillOption}
isRemarks={true}
verticalRemark={true}
showHighEdgeProcessing={this.showVerticalHighEdgeProcessing}
/>
</div>
<div>
<H5>/</H5>
<H5 className={"edge-sealing"}>
<Button
text="高级边处理"
intent={Intent.PRIMARY}
onClick={() => { this.showLayerHighEdgeProcessing.set(true); }}
/>
{
this.showLayerHighEdgeProcessing.get() &&
<HighEdgeProcessingModal
showHighEdgeProcessing={this.showLayerHighEdgeProcessing}
option={m_Option}
UIOption={UIOption}
type={CheckObjectType.BR}
highDrillOption={m_Option.cbHightDrillOption}
sealValueMap={{
up: "topBrSeal",
down: "bottomBrSeal",
left: "leftBrSeal",
right: "rightBrSeal"
}}
sealColorMap={{
up: "layerSealColorUp",
down: "layerSealColorDown",
left: "layerSealColorLeft",
right: "layerSealColorRight"
}}
reservedEdgeMap={{
up: "layerReservedEdgeUp",
down: "layerReservedEdgeDown",
left: "layerReservedEdgeLeft",
right: "layerReservedEdgeRight"
}}
remarkMap={{
up: "layerEdgeRemarkUp",
down: "layerEdgeRemarkDown",
left: "layerEdgeRemarkLeft",
right: "layerEdgeRemarkRight"
}}
/>
}
</H5>
<Input5Or4Component
type={CheckObjectType.Do}
showDirectionIcon={true}
@ -262,6 +380,7 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
highDrillOption={m_Option.cbHightDrillOption}
isRemarks={true}
layerRemark={true}
showHighEdgeProcessing={this.showLayerHighEdgeProcessing}
/>
</div>
</div>
@ -341,7 +460,7 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
/>
</div>
<div className='flex'>
<Tooltip content={"选中后抽屉深度强制为50的倍数若不选中则按实际输入的值"}>
<Tooltip content={"选中后抽屉深度强制为50的倍数,若不选中则按实际输入的值"}>
<Checkbox
checked={store.m_Option.isFloor50 || store.m_Option.isAuto}
label="抽屉深为50的倍数"
@ -376,7 +495,30 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
/>
</div>
<div>
<H5 style={{ textAlign: "center" }}>/</H5>
<H5 className={"edge-sealing"}>
<Button
text="高级边处理"
intent={Intent.PRIMARY}
onClick={() => { this.showDrawerHighEdgeProcessing.set(true); }}
/>
{
this.showDrawerHighEdgeProcessing.get() &&
<HighEdgeProcessingModal
showHighEdgeProcessing={this.showDrawerHighEdgeProcessing}
option={store.m_Option}
UIOption={store.UIOption}
type={CheckObjectType.BR}
sealValueMap={{
up: "lbSealedUp",
down: "lbSealedDown",
left: "lbSealedLeft",
right: "lbSealedRight"
}}
hasRemark={false}
/>
}
</H5>
<Input5Or4Component
type={CheckObjectType.BR}
showDirectionIcon={true}
@ -390,6 +532,7 @@ export class DoorConfigModal extends React.Component<{ store?: DoorDrawerStore;
uiOption={store.UIOption}
isShowEditor={true}
highDrillOption={store.m_Option.lbHightDrillOption}
showHighEdgeProcessing={this.showDrawerHighEdgeProcessing}
/>
</div>
</div>

@ -28,6 +28,8 @@ export class DoorModal extends React.Component<{ store: DoorDrawerStore, type: B
this.props.store.currentTempProp.length = 0;
this.props.store.currentHandleProp.length = 0;
}
doorConfigRef = React.createRef<DoorConfigModal>();
private event: Function;
componentDidMount()
{
@ -35,6 +37,10 @@ export class DoorModal extends React.Component<{ store: DoorDrawerStore, type: B
{
if (this.props.type !== app.Editor.ModalManage.CurrentModalKey) return;
let el = e.target as HTMLInputElement;
const ref = this.doorConfigRef.current;
if (ref.showDoorHighEdgeProcessing.get() || ref.showLayerHighEdgeProcessing.get() || ref.showVerticalHighEdgeProcessing.get() || ref.showDrawerHighEdgeProcessing.get())
return;
if (e.keyCode === KeyBoard.Enter ||
(e.keyCode === KeyBoard.Space &&
(el.nodeName !== "INPUT" || el.type !== "text" ||
@ -76,7 +82,7 @@ export class DoorModal extends React.Component<{ store: DoorDrawerStore, type: B
<ModalHeader
title={store.title + "设计"}
icon="remove-column-left"
close={() => store.OnOk(ModalState.Cancel)}
close={() => { store.OnOk(ModalState.Cancel); }}
helpUrlName={isDoor ? CommandNames.Door : CommandNames.Drawer}
/>
<div style={{ display: "flex" }}>
@ -87,7 +93,7 @@ export class DoorModal extends React.Component<{ store: DoorDrawerStore, type: B
<div className={Classes.DIALOG_BODY + " door"} style={{ overflow: "hidden" }}>
<div className="flex" style={{ maxHeight: isDoor ? 830 : 650 }}>
<div className={Classes.CARD} style={{ paddingBottom: 5 }}>
<DoorConfigModal store={this.props.store} />
<DoorConfigModal store={this.props.store} ref={this.doorConfigRef} />
{/* <div>
<AutoCutCheckbox autoCutOption={this.props.store.autoCutOption} />
</div> */}

@ -0,0 +1,375 @@
import { Button, Classes, Dialog, H4, HTMLSelect, Icon, IconSize, InputGroup, Position, Tab, Tabs, Tooltip } from "@blueprintjs/core";
import { IObservableValue } from "mobx";
import { observer } from "mobx-react";
import React, { useRef, useState } from "react";
import { DrillType } from "../../../Add-on/DrawDrilling/DrillType";
import { CheckObjectType, CheckoutValid } from "../../../Common/CheckoutVaildValue";
import { DataAdapter } from "../../../Common/DataAdapter";
import { Intent, Toaster } from "../../../Common/Toaster";
import { userConfig } from "../../../Editor/UserConfig";
import { GoodsType, IGoodInfo } from "../../MaterialEditor/GoodsList";
import { GoodsListDiv } from "../../MaterialEditor/GoodsListDiv";
import { IHightDrillOption, IUiOption } from "../../Store/OptionInterface/IOptionInterface";
import { ToasterInput, ToasterValueError } from "../Toaster";
import { BoardDirectionIcon } from "./BoardCommon";
type IHighEdgeKeyMap = { up: string; down: string; left: string; right: string; };
interface IHighEdgeProcessingModalProps
{
showHighEdgeProcessing: IObservableValue<boolean>;
option: any;
UIOption: IUiOption<any>;
type: CheckObjectType;
highDrillOption?: IHightDrillOption;
hasDrill?: boolean;
isDrillLock?: boolean;
hasRemark?: boolean;
sealValueMap?: IHighEdgeKeyMap;
sealColorMap?: IHighEdgeKeyMap;
reservedEdgeMap?: IHighEdgeKeyMap;
remarkMap?: IHighEdgeKeyMap;
}
export const HighEdgeProcessingModal = (props: IHighEdgeProcessingModalProps) =>
{
const options = [...userConfig.DrillConfigs.keys(), "不排"];
const { type, option, UIOption, highDrillOption = {}, hasDrill = true, isDrillLock = false, hasRemark = true } = props;
const [tabId, SetTabId] = useState("seal");
const [highDrill, SetHighDrill] = useState({ ...highDrillOption });
const curOption = useRef({ ...option });
const Frame = (props: { Content: React.FC<{ optKey: string; }>; }) =>
{
const { Content } = props;
return (
<div>
<div className="content-top">
<Content optKey={"up"} />
</div>
<div className="content-center">
<Content optKey={"left"} />
<div style={{ display: "flex", flexDirection: "column", alignItems: "center", marginBottom: 18 }}>
<span style={{ height: 18, color: "red", fontSize: "14px", fontWeight: 500, opacity: tabId === "seal" ? 1 : 0 }}></span>
<BoardDirectionIcon />
</div>
<Content optKey={"right"} />
</div>
<div className="content-bottom">
<Content optKey={"down"} />
</div>
</div >
);
};
let sealValue = {
up: "sealedUp",
down: "sealedDown",
left: "sealedLeft",
right: "sealedRight",
};
let sealColor = {
up: "sealColorUp",
down: "sealColorDown",
left: "sealColorLeft",
right: "sealColorRight",
};
const renderSeal = () =>
{
if (props.sealValueMap)
sealValue = props.sealValueMap;
if (props.sealColorMap)
sealColor = props.sealColorMap;
const sealContent = (props: { optKey: string; }) =>
{
const sealKey = sealValue[props.optKey];
const sealColorKey = sealColor[props.optKey];
const selectGoods = (good: IGoodInfo) =>
{
option[sealKey] = good.thickness.toString();
option[sealColorKey] = good.color;
if (UIOption)
{
UIOption[sealKey] = good.thickness.toString();
}
};
return (
<div className="select-seal-color">
<SealMaterialComponent
type={GoodsType.sealMaterial}
option={option}
optKey={sealColorKey}
onChange={(e) =>
{
option[sealColorKey] = e.target.value;
}}
handleSelect={selectGoods}
/>
<ToasterInput
type={type}
optKey={sealKey}
option={option}
uiOption={UIOption}
placeHolder="封边值"
/>
</div>
);
};
return <Frame Content={sealContent} />;
};
const renderDrill = () =>
{
const drillSelect = (props: { optKey: string; }) =>
{
const { optKey } = props;
return (
<HTMLSelect
className="select-drillType"
options={options}
disabled={isDrillLock}
value={highDrill[optKey]}
iconProps={{ icon: "chevron-down" }}
onChange={e =>
{
let opt = { ...highDrill };
opt[optKey] = e.currentTarget.value;
SetHighDrill(opt);
}}
/>
);
};
return <Frame Content={drillSelect} />;
};
let reservedEdge = {
up: "reservedEdgeUp",
down: "reservedEdgeDown",
left: "reservedEdgeLeft",
right: "reservedEdgeRight",
};
const renderReservedEdge = () =>
{
if (props.reservedEdgeMap)
reservedEdge = props.reservedEdgeMap;
const reservedEdgeInput = (props: { optKey: string; }) =>
{
const optKey = reservedEdge[props.optKey];
return (
<ToasterInput
inputClassName='remark-input'
type={CheckObjectType.OnlyNumber}
optKey={optKey}
option={option}
placeHolder={"预留边"}
/>
);
};
return <Frame Content={reservedEdgeInput} />;
};
const renderRemark = () =>
{
let remark = {
up: "edgeRemarkUp",
down: "edgeRemarkDown",
left: "edgeRemarkLeft",
right: "edgeRemarkRight",
};
if (props.remarkMap)
remark = props.remarkMap;
const remarkInput = (props: { optKey: string; }) =>
{
const optKey = remark[props.optKey];
return (
<Tooltip
content={`${option[optKey]}`}
position={Position.TOP}
>
<ToasterInput
inputClassName='remark-input'
type={type}
optKey={optKey}
option={option}
onChange={() =>
{
if (UIOption)
UIOption[optKey] = option[optKey];
}}
placeHolder={"备注"}
/>
</Tooltip>
);
};
return <Frame Content={remarkInput} />;
};
const handleClose = (e: React.SyntheticEvent<HTMLElement>) =>
{
e.stopPropagation();
Object.assign(option, curOption.current);
if (UIOption)
Object.assign(UIOption, DataAdapter.ConvertUIData(option));
props.showHighEdgeProcessing.set(false);
};
return (
<Dialog
isOpen={props.showHighEdgeProcessing.get()}
canOutsideClickClose={false}
onClose={handleClose}
className={"high-edge-processing"}
enforceFocus={false} //true会导致搜索关联商品无法点击
usePortal={false}
style={{
width: "auto"
}}
>
<div className='dialog-head'>
<H4 style={{ height: 18 }}>{"高级边处理"}</H4>
<Button
aria-label="Close"
className={Classes.DIALOG_CLOSE_BUTTON}
icon={<Icon icon="cross" size={IconSize.STANDARD} />}
minimal={true}
onClick={handleClose}
/>
</div>
<div className={Classes.CARD} style={{ padding: 0 }}>
<div className={`${Classes.DIALOG_BODY}`}>
<Tabs
id="TabsExample"
onChange={(id: string) => { SetTabId(id); }}
selectedTabId={tabId}
renderActiveTabPanelOnly={true}
>
<Tab id="seal" title="封边颜色(值)" panel={renderSeal()} />
{
hasDrill &&
<Tab id="drill" title="排钻" panel={renderDrill()} panelClassName="ember-panel" />
}
<Tab id="reservedEdge" title="预留边" panel={renderReservedEdge()} />
{
hasRemark &&
<Tab id="remark" title="备注" panel={renderRemark()} />
}
</Tabs>
</div>
<div className={Classes.DIALOG_FOOTER}>
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
<Button
intent={Intent.PRIMARY}
onClick={() =>
{
let error = CheckoutValid.HasInvailValue(option, CheckObjectType.BR);
if (error)
{
ToasterValueError(error);
return;
}
if (JSON.stringify(highDrillOption) != "{}")
Object.assign(highDrillOption, highDrill);
let drillSet = new Set(Object.values(highDrillOption));
if (option.drillType != undefined)
{
if (drillSet.size > 1)
option.drillType = DrillType.More;
else
option.drillType = [...drillSet][0];
}
let sealColorSet = new Set(Object.values(sealColor).map(k => option[k]));
if (option.sealColorType != undefined)
{
if (sealColorSet.size > 1)
option.sealColorType = "**多种**";
else if (sealColorSet.size === 1)
option.sealColorType = [...sealColorSet][0];
}
if (userConfig.reservedEdgeCheckTip && Object.values(reservedEdge).some(k => option[k] != "0"))
{
Toaster({
message: "注意:使用预留边功能会影响CNC(五面钻、六面钻、PTP等设备)加工程序的孔槽及异形轮廓切割的位置,如果有对接CNC加工设备进行加工的,请确认CNC程序已做相关对接(否则可能出现生产错误问题)!",
intent: Intent.WARNING,
timeout: 5000,
});
}
props.showHighEdgeProcessing.set(false);
}}
text="确定"
/>
<Button
onClick={handleClose}
text="取消"
/>
</div>
</div>
</div>
</Dialog>
);
};
interface ISealMaterialProps
{
type: GoodsType;
option: any;
optKey: string;
onChange: (e) => void;
handleSelect: (good: IGoodInfo) => void;
style?: React.CSSProperties;
}
export const SealMaterialComponent = observer((props: ISealMaterialProps) =>
{
const { type, option, optKey, handleSelect, style } = props;
const [isShowShops, setIsShowShops] = useState(false);
return (
<div
className="seal-material"
style={style}
>
<InputGroup
placeholder={`封边颜色`}
value={option[optKey]}
tabIndex={1}
onChange={(e) =>
{
if (props.onChange)
props.onChange(e);
}}
rightElement={
<Button
icon='search'
minimal
onClick={() => { setIsShowShops(true); }}
/>
}
/>
{
isShowShops &&
<GoodsListDiv
onClose={() => { setIsShowShops(false); }}
goods_type={type}
select={(good: IGoodInfo) =>
{
setIsShowShops(false);
handleSelect(good);
}}
/>
}
</div>
);
});

@ -106,7 +106,7 @@ export class SpecialShapeBoardModal extends React.Component<{ store: SpecialShap
</div>
<div className={Classes.CARD}>
<h6 className={Classes.HEADING}></h6>
<BoardProcessModal opt={store.m_BoardProcessOption} uiOpt={store.UIBoardProcessOption} isEdgeRemarks={false} />
<BoardProcessModal opt={store.m_BoardProcessOption} uiOpt={store.UIBoardProcessOption} isEdgeRemarks={false} type={BoardModalType.YX} />
</div>
<div className={Classes.CARD}>
<Notes remarks={store.remarks} />

@ -41,19 +41,6 @@
.br-set input {
width: @infoSelectWidth;
}
.br-set input {
margin-left: 5px;
}
.modal-pick.br-set input {
width: 11rem;
}
.modal-pick select,
.br-set input {
width: 11rem;
}
}
}
@ -151,18 +138,6 @@
.boardSize .bp3-input {
width: 3rem;
}
.board-info .bp3-input {
width: 9rem;
}
.closing-input .bp3-input {
width: 8rem;
}
.board-info .modal-pick.bp3-input {
width: 11rem;
}
}
/* 板长宽厚尺寸拾取,板件拾取*/
@ -300,7 +275,7 @@
margin-bottom: 0.5rem;
input {
width: 6.5rem;
width: 8.5rem;
}
.modal-pick input {
@ -327,13 +302,12 @@
}
}
#commonModal .edge-sealing span>button {
height: 14px;
#commonModal .edge-sealing >button {
margin-left: 10px;
min-height: 18px;
height: 18px;
padding: 0 10px;
font-size: 12px;
width: 6rem;
padding-top: 0px;
padding-bottom: 0px;
min-height: 14px;
}
#commonModal .edge-sealing {

@ -228,6 +228,7 @@
white-space: nowrap;
display: -webkit-box;
-webkit-box-orient: vertical;
line-clamp: 3;
-webkit-line-clamp: 3;
overflow: hidden;
}
@ -235,6 +236,7 @@
.temp-name {
display: -webkit-box;
-webkit-box-orient: vertical;
line-clamp: 3;
-webkit-line-clamp: 3;
overflow: hidden;
list-style: none;
@ -293,6 +295,13 @@
top: 20px;
}
}
.edge-sealing {
display: flex;
margin-top: 0;
align-items: center;
justify-content: center;
}
}
.hinge-rule {

@ -0,0 +1,153 @@
#commonModal .high-edge-processing,
#RightPanel .high-edge-processing{
width: auto;
padding-bottom: 0;
background: #fff;
.bp3-dialog-body {
padding: 10px;
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.15), 0 0 0 rgba(16, 22, 26, 0), 0 0 0 rgba(16, 22, 26, 0);
//图标样式
.boardModel {
@arrowWidth: 15px;
@lineWidth: 5px;
@lineHeight:35px;
display: inline-block;
width: 60px;
height: 95px;
border: 1px solid #000;
vertical-align: middle;
margin: 0 50px;
.arrow {
display: block;
border: @arrowWidth solid transparent;
width: 0;
height: 0px;
margin: 0 auto;
}
.arrowtop {
border-bottom: @arrowWidth solid #000;
margin-top: -3px;
}
.arrowbottom {
border-top: @arrowWidth solid #000;
}
.line {
display: block;
border: @lineWidth solid #000;
width: 0;
height: @lineHeight;
margin: 0 auto;
}
}
//重写tabs样式
.bp3-tab-list {
display: flex;
justify-content: center;
.bp3-tab-indicator-wrapper ~ .bp3-tab {
border: 1px solid #d9d9d9;
width: 90px;
font-weight: 500;
text-align: center;
border-radius: 5px;
}
.bp3-tab[aria-selected="true"] {
border-radius: 5px;
}
.bp3-tab-indicator-wrapper {
display: none;
}
}
.select-drillType {
flex:none
}
.bp3-tab-panel {
@height:24px;
width: 450px;
height: 210px;
margin-top: 10px;
.bp3-input {
width: 60px;
height: @height;
}
select {
width: 90px;
height: @height;
}
.select-seal-color{
.bp3-input-group {
width: 100px;
.bp3-button {
margin: 0;
}
.bp3-input {
width: 100%;
}
}
}
.content-top,
.content-bottom {
display: flex;
justify-content: center;
height: @height;
align-items: center;
.select-seal-color{
display: flex;
}
}
.content-center {
display: flex;
align-items: center;
justify-content: center;
margin: 3px;
height: 130px;
.select-seal-color{
&>:first-child {
margin-bottom: 5px;
}
}
}
}
}
.bp3-dialog-footer {
margin: 1px 0 0 0;
padding: 10px 20px;
border-radius: 0 0 6px 6px;
display: flex;
justify-content: flex-end;
align-items: center;
}
}
#RightPanel .high-edge-processing{
.light-golden .bp3-tab-list {
background: #fff;
}
.bp3-tab-list > *:not(:last-child) {
margin-right: 20px;
}
}

@ -7,7 +7,7 @@
@selectWidth : 10rem;
@inputWidth : 5rem;
@nameInput : 12rem;
@infoSelectWidth: 9rem;
@infoSelectWidth: 11rem;
.bp3-portal {
z-index: 37;
@ -209,6 +209,82 @@
}
}
#commonModal,
#modal .board-config {
.bp3-html-select {
margin: 0;
}
.board-info {
.br-set > span:first-child,
.bp3-label > span:first-child {
display: inline-block;
width: 4.5rem;
white-space: nowrap;
}
.processing-group-info {
.detail {
width: 11rem;
display: inline-flex;
.bp3-input {
margin: 0
}
.bp3-button {
min-height: 18;
height: 18;
padding: 0;
font-size: 12;
}
}
}
.drill-info {
display: flex;
width: 15.5rem;
}
.seal-material-info {
display: flex;
width: 15.5rem;
.seal-material {
flex:1;
}
.bp3-input-group {
width: 100%;
margin: 0;
.bp3-input {
width: 100%;
}
.bp3-input-action{
top: -2px;
}
.bp3-button {
min-width: 16px;
min-height: 16px;
margin: 0;
}
}
}
}
}
#modal .board-config {
.br-set > span:first-child,
.bp3-label > span:first-child {
display: inline-block;
width: 4.5rem;
white-space: nowrap;
}
}
@import (less) "BoardModal.less";
@import (less) "ArrayModal.less";
@import (less) "DrillModal.less";
@ -233,3 +309,4 @@
@import (less) "./Recycle.less";
@import (less) "./FrameManage.less";
@import (less) "./ConfigList.less";
@import (less) "./HighEdgeProcessingModal.less";

@ -27,7 +27,7 @@
display : flex;
flex-direction: column;
flex-wrap : wrap;
height : 100%;
height : 16rem;
}
#snapModal .flexCheckbox button {

@ -105,6 +105,9 @@ export class ChaiDanPanel extends React.Component
checked={userConfig.chaidanOption.isCheckCustomBoardNumber}
onChange={() => userConfig.chaidanOption.isCheckCustomBoardNumber = !userConfig.chaidanOption.isCheckCustomBoardNumber}
/>
<Tooltip content={"拆单时存在设置预留边时提示"} position='top'>
<Checkbox label='预留边设置项检查提示' checked={userConfig.chaidanOption.reservedEdgeCheckTip} onChange={() => userConfig.chaidanOption.reservedEdgeCheckTip = !userConfig.chaidanOption.reservedEdgeCheckTip} />
</Tooltip>
<Label className={Classes.INLINE}>
<RadioGroup
className={Classes.INLINE}

@ -166,6 +166,10 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}>
<Checkbox label='强制修改开门方向或板名' checked={userConfig.forceOpendirOrNameChange} onChange={() => userConfig.forceOpendirOrNameChange = !userConfig.forceOpendirOrNameChange} />
</Tooltip>
<Checkbox label="显示开门方向纹路" checked={userConfig.showOpenDirLines} onChange={() => userConfig.showOpenDirLines = !userConfig.showOpenDirLines} />
<H5></H5>
<Tooltip content={"绘图时存在设置预留边时提示"} position='top'>
<Checkbox label='预留边设置项检查提示' checked={userConfig.reservedEdgeCheckTip} onChange={() => userConfig.reservedEdgeCheckTip = !userConfig.reservedEdgeCheckTip} />
</Tooltip>
</div>
<div>
<Checkbox

@ -1,7 +1,3 @@
#boardPropsCom .br-name {
width: 18rem;
}
#boardPropsCom .bp3-input {
height: 1.5rem;
}
@ -60,10 +56,6 @@
}
}
#boardPropsCom .board-info .br-set input {
margin-left: 5px;
}
#boardPropsCom .board-config .flexWrap {
width: 250px;
}
@ -76,11 +68,11 @@
#boardPropsCom .board-info select,
#boardPropsCom .board-info .br-set input {
width: 15rem;
width: 17rem;
}
#boardPropsCom .board-info .modal-pick .br-set input {
width: 12.5rem;
width: 12rem;
}
#boardPropsCom {
@ -181,6 +173,87 @@
}
}
#boardPropsCom {
.br-set > span:first-child,
.bp3-label > span:first-child {
display: inline-block;
width: 4.5rem;
white-space: nowrap;
}
.br-name {
width: 16rem;
}
.bp3-html-select {
margin: 0;
}
.board-info {
select {
width: 17rem;
}
.br-set input {
width: 14.5rem;
}
.processing-group-info {
.detail {
width: 17rem;
display: inline-flex;
.bp3-input {
margin: 0
}
.bp3-button {
min-height: 18;
height: 18;
padding: 0;
font-size: 12;
}
}
}
.drill-info {
width: 24rem;
}
.seal-material-info {
display: flex;
width: 24rem;
.bp3-input-group {
width: 14.5rem;
margin: 0;
.bp3-input {
width: 100%;
}
.bp3-input-action{
top: -2px;
}
.bp3-button {
min-width: 16px;
min-height: 16px;
margin: 0;
}
}
}
.edge-sealing >button {
margin-left: 10px;
min-height: 18px;
height: 18px;
padding: 0 10px;
font-size: 12px;
}
}
}
.curveBoardOption {
.br-set {
>:first-child {

@ -33,7 +33,7 @@
#RightPanel {
.rightTab {
height: 100%;
.tabBody {
height : calc(100% - 37px);
overflow : auto;

@ -0,0 +1,103 @@
import { Button, Classes, Label } from '@blueprintjs/core';
import { inject, observer } from 'mobx-react';
import * as React from 'react';
import { ColorMaterial } from '../../../Common/ColorPalette';
import { safeEval } from '../../../Common/eval';
import { Intent, Toaster } from '../../../Common/Toaster';
import { userConfig } from '../../../Editor/UserConfig';
import { Board_Editor_Key } from '../../Store/RightPanelStore/BoardEdgesEditor';
import { ReservedEdgeStore } from '../../Store/RightPanelStore/ReservedEdgeStore';
import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore';
import { BoardModalType } from '../Board/BoardModalType';
import { UserConfigComponent } from '../Board/UserConfigComponent';
import { AppToaster } from '../Toaster';
@inject("store")
@observer
export class ReservedEdgeComponent extends React.Component<{ store?: RightPanelStore; }>
{
render()
{
let store = ReservedEdgeStore.GetInstance();
return (
<div className='rightTab'>
<div className='tabBody'>
<ul className={"modeling dataList " + Classes.LIST_UNSTYLED}>
<li>
<Label></Label>
<Label></Label>
</li>
{
store.option.highReservedEdge.map((v, i) =>
{
return (
<li key={i}>
<span
className={Classes.INPUT}
style={{
background: ColorMaterial.GetColor(i + 1).getStyle(),
width: "50%",
color: i >= 10 ? "white" : "black"
}}
>{i + 1}</span>
<input
style={{ width: "50%" }}
tabIndex={1}
value={v}
onFocus={e =>
{
e.target.setSelectionRange(0, e.target.value.length);
}}
className={Classes.INPUT}
onChange={(e) =>
{
store.option.highReservedEdge[i] = e.target.value;
}}
onBlur={e =>
{
let val = safeEval(e.target.value);
if (isNaN(val))
store.option.highReservedEdge[i] = "0";
}}
/>
</li>
);
})
}
</ul>
<div className="flex-arround">
<Button text="写入" intent={Intent.SUCCESS}
onClick={this.ok} />
<Button text="退出" intent={Intent.DANGER}
onClick={this.exit} />
</div>
</div>
<UserConfigComponent
className="modeing-config"
store={store}
type={BoardModalType.ReservedEdge}
isNotUpdateStore={store.isNotUpdateStore}
/>
</div>
);
}
private ok = () =>
{
// if (!this.props.store.reservedEdgeStore.Check()) return;
this.props.store.reservedEdgeStore.IsApplyData = true;
this.exit();
if (userConfig.reservedEdgeCheckTip)
{
Toaster({
message: "注意:使用预留边功能会影响CNC(五面钻、六面钻、PTP等设备)加工程序的孔槽及异形轮廓切割的位置,如果有对接CNC加工设备进行加工的,请确认CNC程序已做相关对接(否则可能出现生产错误问题)!",
intent: Intent.WARNING,
timeout: 5000
});
}
};
private exit()
{
AppToaster.dismiss(Board_Editor_Key);
}
}

@ -580,7 +580,7 @@
justify-items: center;
.bp3-tab {
overflow: auto;
overflow: hidden;
white-space: unset;
line-height: 1.25;
text-align: center;
@ -593,6 +593,12 @@
flex-direction: column;
}
}
@media screen and (max-height: 930px) {
.tab-unstyle {
font-size: 10px;
}
}
}
.light-slider.bp3-dialog-body .bp3-slider {

@ -14,6 +14,7 @@ import { MetalPanel } from './MatalsPanel';
import './Modeling.less';
import { ModelingComponent2 } from './Modeling/ModelingComponent2';
import { ModelingComponent } from './ModelingComponent';
import { ReservedEdgeComponent } from './ReservedEdgeComponrnt';
import { ScenePanel } from './ScenePanel';
import { SealingComponent } from './SealingComponent';
import './TemplateParam.less';
@ -34,6 +35,7 @@ export enum RightTabId
Model3 = "modeing3",
ModuelParams = 'moduleparams',
BoardEgdeRemark = 'boardedgeremark',
ReservedEdge = "ReservedEdge",
}
@inject('store')
@ -92,6 +94,7 @@ export class RightPanel extends React.Component<{ store?: RightPanelStore; }>
<Tab className="tab-unstyle" id={RightTabId.Seal} title="封 边" panel={<SealingComponent />} />
<Tab className="tab-unstyle" id={RightTabId.Drill} title="排 钻" panel={<DrillingComponent />} />
<Tab className="tab-unstyle" id={RightTabId.BoardEgdeRemark} title="板边备注" panel={<BoardEdgeRemarksComponent />} />
<Tab className="tab-unstyle" id={RightTabId.ReservedEdge} title="预留边" panel={<ReservedEdgeComponent />} />
<Tab className="tab-unstyle" id={RightTabId.Scene} title="场 景" panel={<ScenePanel />} />
<Tab className="tab-unstyle" id={RightTabId.Material} title="材 质" panel={<MaterialExplorer materialTable={app.Database.MaterialTable}></MaterialExplorer>} />
<Tab className="tab-unstyle" id={RightTabId.TemplateParam} title="模板参数" panel={<TemplateParamPanel />} />

@ -3,10 +3,12 @@ import { inject, observer } from 'mobx-react';
import * as React from 'react';
import { ColorMaterial } from '../../../Common/ColorPalette';
import { safeEval } from '../../../Common/eval';
import { GoodsType, IGoodInfo } from '../../MaterialEditor/GoodsList';
import { Board_Editor_Key } from '../../Store/RightPanelStore/BoardEdgesEditor';
import { RightPanelStore } from '../../Store/RightPanelStore/RightPanelStore';
import { SealingStore } from '../../Store/RightPanelStore/SealingStore';
import { BoardModalType } from '../Board/BoardModalType';
import { SealMaterialComponent } from '../Board/HighEdgeProcessingModal';
import { UserConfigComponent } from '../Board/UserConfigComponent';
import { AppToaster } from '../Toaster';
@ -25,9 +27,10 @@ export class SealingComponent extends React.Component<{ store?: RightPanelStore;
<li>
<Label></Label>
<Label></Label>
<Label></Label>
</li>
{
store.option.highSizes.map((v, i) =>
store.option.highSizes.map((s, i) =>
{
return (
<li key={i}>
@ -35,14 +38,14 @@ export class SealingComponent extends React.Component<{ store?: RightPanelStore;
className={Classes.INPUT}
style={{
background: ColorMaterial.GetColor(i + 1).getStyle(),
width: "50%",
width: "33%",
color: i >= 10 ? "white" : "black"
}}
>{i + 1}</span>
<input
style={{ width: "50%" }}
style={{ width: "33%" }}
tabIndex={1}
value={v}
value={s.size}
onFocus={e =>
{
e.target.setSelectionRange(0, e.target.value.length);
@ -50,13 +53,28 @@ export class SealingComponent extends React.Component<{ store?: RightPanelStore;
className={Classes.INPUT}
onChange={(e) =>
{
store.option.highSizes[i] = e.target.value;
store.option.highSizes[i].size = e.target.value;
}}
onBlur={e =>
{
let val = safeEval(e.target.value);
if (isNaN(val))
store.option.highSizes[i] = "0";
store.option.highSizes[i].size = "0";
}}
/>
<SealMaterialComponent
style={{ width: "33%" }}
type={GoodsType.sealMaterial}
option={s}
optKey={"sealColor"}
onChange={(e) =>
{
s.sealColor = e.target.value;
}}
handleSelect={(good: IGoodInfo) =>
{
s.size = good.thickness.toString();
s.sealColor = good.color;
}}
/>
</li>

@ -488,62 +488,67 @@ export class TempalteActionDialog extends React.Component<ITempalteActionDialogP
for (let i = 0; i < highSizes.length; i++)
{
if (dataColorMap.has(highSizes[i]))
let s = highSizes[i];
let str = `${s.size}-${s.sealColor}`;
if (dataColorMap.has(str))
canUseColor.push(i);//可以被覆盖
else
dataColorMap.set(highSizes[i], i);//记录颜色
dataColorMap.set(str, i);//记录颜色
}
for (let br of brs)
{
let cus = GetBoardSealingCurves(br, true);
let highseals = GetBoardHighSeal(br, cus);
if (highseals.length === cus.length)
let curves = GetBoardSealingCurves(br, true);
let highseals = GetBoardHighSeal(br, curves);
if (highseals.length === curves.length)
{
for (let i = 0; i < highseals.length; i++)
{
let s = highseals[i];
if (!dataColorMap.has(s.size.toString()))
let str = `${s.size}-${s.sealColor}`;
if (!dataColorMap.has(str))
{
if (canUseColor[0])
{
dataColorMap.set(s.size.toString(), canUseColor[0]);
highSizes[canUseColor[0]] = s.size.toString();
highSizes[canUseColor[0]] = { size: s.size.toString(), sealColor: s.sealColor };
dataColorMap.set(str, canUseColor[0]);
canUseColor.shift();
}
else
{
highSizes.push(s.size.toString());
dataColorMap.set(s.size.toString(), highSizes.length - 1);
highSizes.push({ size: s.size.toString(), sealColor: s.sealColor });
dataColorMap.set(str, highSizes.length - 1);
}
}
let color = dataColorMap.get(s.size.toString()) + 1;
cus[i].ColorIndex = color;
let color = dataColorMap.get(str) + 1;
curves[i].ColorIndex = color;
}
}
else
{
if (!dataColorMap.has("1"))
//"1-"代表封边值1,封边颜色为空
const defaultStr = "1-";
if (!dataColorMap.has(defaultStr))
{
if (canUseColor[0])
{
dataColorMap.set("1", canUseColor[0]);
highSizes[canUseColor[0]] = "1";
dataColorMap.set(defaultStr, canUseColor[0]);
highSizes[canUseColor[0]] = { size: "1", sealColor: "" };
canUseColor.shift();
}
else
{
highSizes.push("1");
dataColorMap.set("1", highSizes.length - 1);
highSizes.push({ size: "1", sealColor: "" });
dataColorMap.set(defaultStr, highSizes.length - 1);
}
}
let color = dataColorMap.get("1") + 1;
cus.forEach(cu => cu.ColorIndex = color);
let color = dataColorMap.get(defaultStr) + 1;
curves.forEach(cu => cu.ColorIndex = color);
}
for (let i = 0; i < cus.length; i++)
for (let i = 0; i < curves.length; i++)
{
let curve = cus[i];
let curve = curves[i];
curve.ApplyMatrix(br.OCSNoClone);
curveData.set(curve, [br, i]);
JigUtils.Draw(curve);

@ -52,6 +52,7 @@ interface IToasterInputProps extends ISetItemOption
onKeyDown?: (e?, errorMsg?: string) => void;
callback?: Function;
selectAll?: boolean;
isHideErrorMsg?: boolean;
}
/**
@ -74,7 +75,7 @@ export class ToasterInput extends React.Component<IToasterInputProps, {}>
if (this.props.callback)
{
let err = this.props.callback(this.props.optKey, v);
if (err)
if (err != undefined)
this.errorMsg = err;
}
this.hideErrorMsg = this.errorMsg === "";
@ -188,7 +189,7 @@ export class ToasterInput extends React.Component<IToasterInputProps, {}>
return (
<Tooltip
content={this.errorMsg}
isOpen={!this.hideErrorMsg}
isOpen={!this.props.isHideErrorMsg && !this.hideErrorMsg}
intent={Intent.WARNING}
disabled={this.hideErrorMsg}
>

@ -139,6 +139,10 @@
background: @topToolBar_tablist_bg;
}
.high-edge-processing .bp3-tab-list {
background: @fileName_bg;
}
.tabs-unstyle .bp3-tab[aria-selected="true"],
.tabs-unstyle .bp3-tab:not([aria-disabled="true"]):hover {
color: @topToolBar_tablist_color;
@ -259,6 +263,10 @@
}
}
.dialog-head {
background-color: @fileName_bg;
}
//模型库
.resourcePanel .bp3-card {
.header {

@ -1628,10 +1628,11 @@ img {
#GoodsListDiv {
.search-shop {
position: absolute;
z-index: 35;
z-index: 38;
padding: 10px;
font-size: 16px;
min-width: 1100px;
min-height: 500px;
outline: 1px solid #ccc;
input {
@ -1674,3 +1675,38 @@ img {
}
}
}
//模板内使用dialog标签需要title时使用
//因为模板缩小时是需要通过dialog标签head的bp3-dialog-header类判断的
.dialog-head {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background: #ffffff;
border-radius: 6px 6px 0 0;
-webkit-box-shadow: 0 1px 0 rgba(16, 22, 26, 0.15);
box-shadow: 0 1px 0 rgba(16, 22, 26, 0.15);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 0;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
min-height: 40px;
padding-left: 20px;
padding-right: 5px;
z-index: 0;
.bp3-heading {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
-webkit-box-flex: 1;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
line-height: inherit;
margin: 0;
}
}

@ -1,5 +1,5 @@
import { Button, Card, HTMLTable, Icon, InputGroup } from '@blueprintjs/core';
import { IObservableValue, observable } from 'mobx';
import { observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { ShopUrls } from '../../Common/HostUrl';
@ -10,8 +10,9 @@ import { Pagination2 } from '../Components/SourceManage/Pagination';
export enum GoodsType
{
board = 1,
comp = 2,
metals = 3
comp = 2, //组件
metals = 3, //五金
sealMaterial = 4, //封边材质
}
export interface IGoodInfo
@ -21,12 +22,13 @@ export interface IGoodInfo
name: string;
color: string;
material: string;
thickness: number;
}
interface IGoodsListProps
{
select: (good: IGoodInfo) => void;
open: IObservableValue<boolean>;
goods_type?: GoodsType;
onClose: () => void;
}
@observer
@ -103,9 +105,21 @@ export class GoodsList extends React.Component<IGoodsListProps>
<Icon icon={this.isDesc === undefined ? "double-caret-vertical" : (this.isDesc ? "chevron-up" : "chevron-down")} />
</div>
</th>
{
this.props.goods_type === GoodsType.sealMaterial &&
<>
<th></th>
<th></th>
</>
}
<th></th>
<th></th>
<th style={{ minWidth: 80 }}></th>
{
this.props.goods_type != GoodsType.sealMaterial &&
<>
<th></th>
<th style={{ minWidth: 80 }}></th>
</>
}
<th></th>
<th></th>
</>
@ -120,6 +134,8 @@ export class GoodsList extends React.Component<IGoodsListProps>
let colorName = v.goods_param.find(p => p.id === 4)?.value ?? "";
let goods_spec = v.goods_param.find(p => p.id === 6)?.value ?? "";
let thick = v.goods_param.find(p => p.id === 2)?.value ?? "";
let width = v.goods_param.find(p => p.id === 1)?.value ?? "";
let length = v.goods_param.find(p => p.id === 0)?.value ?? "";
//品牌
let brand = v.goods_param.find(p => p.id === 5)?.value ?? "";
@ -131,10 +147,10 @@ export class GoodsList extends React.Component<IGoodsListProps>
//类型 型号 厂家 (五金和组件中用到)
let type: string;
let model: string;
let factfactory: string;
let factory: string;
//五金 组件
if (v.class_type != GoodsType.board)
if (this.props.goods_type === GoodsType.comp || this.props.goods_type === GoodsType.metals)
{
//类型
type = v.goods_param.find(p => p.id === 0)?.value ?? "";
@ -147,10 +163,15 @@ export class GoodsList extends React.Component<IGoodsListProps>
//型号
model = v.goods_param.find(p => p.id === 4)?.value ?? "";
//厂家
factfactory = v.goods_param.find(p => p.id === 5)?.value ?? "";
factory = v.goods_param.find(p => p.id === 5)?.value ?? "";
//材质
matName = v.goods_param.find(p => p.id === 6)?.value ?? "";
}
else if (this.props.goods_type === GoodsType.sealMaterial)
{
factory = v.goods_param.find(p => p.id === 7)?.value ?? "";
model = v.goods_param.find(p => p.id === 8)?.value ?? "";
}
let info = {
goods_id: v.goods_id,
@ -159,6 +180,7 @@ export class GoodsList extends React.Component<IGoodsListProps>
color: colorName,
material: matName,
specification: goods_spec,
thickness: thick
};
return <tr
@ -176,7 +198,7 @@ export class GoodsList extends React.Component<IGoodsListProps>
<td><OneLineText text={brand} /></td>
<td><OneLineText text={colorName} /></td>
<td><OneLineText text={model} /></td>
<td><OneLineText text={factfactory} /></td>
<td><OneLineText text={factory} /></td>
<td><OneLineText text={matName} /></td>
<td>{v.goods_stock}</td>
</>
@ -187,13 +209,24 @@ export class GoodsList extends React.Component<IGoodsListProps>
<td><OneLineText text={v.goods_name} /></td>
<td><OneLineText text={goods_spec} /></td>
<td>{thick}</td>
{
this.props.goods_type === GoodsType.sealMaterial &&
<>
<td>{width}</td>
<td>{length}</td>
</>
}
<td><OneLineText text={matName} /></td>
<td>{waveline}</td>
<td>{isPack}</td>
{
this.props.goods_type != GoodsType.sealMaterial &&
<>
<td>{waveline}</td>
<td>{isPack}</td>
</>
}
<td><OneLineText text={colorName} /></td>
<td>{v.goods_stock}</td>
</>
}
</tr>;
})
@ -253,7 +286,7 @@ export class GoodsList extends React.Component<IGoodsListProps>
};
private handleHideSelect = () =>
{
this.props.open.set(false);
this.props.onClose();
};
private handleOrderGoods = () =>
{

@ -12,12 +12,14 @@ const GOODS_LIST_DIV_ID = "GoodsListDiv";
interface IGoodsListProps
{
select: (good: IGoodInfo) => void;
open: IObservableValue<boolean>;
open?: IObservableValue<boolean>;
goods_type?: GoodsType;
onClose?: () => void;
}
@observer
export class GoodsListDiv extends React.Component<IGoodsListProps> {
export class GoodsListDiv extends React.Component<IGoodsListProps>
{
_Event: Function;
_StateContainer: HTMLElement;
_CurrentModalKey = "";
@ -28,7 +30,7 @@ export class GoodsListDiv extends React.Component<IGoodsListProps> {
this._StateContainer = document.createElement('div');
this._StateContainer.id = GOODS_LIST_DIV_ID;
this._StateContainer.style.zIndex = "36";
document.getElementById('modal').appendChild(this._StateContainer);
document.getElementById("modal").appendChild(this._StateContainer);
this._StateContainer.style.position = "absolute";
@ -44,12 +46,19 @@ export class GoodsListDiv extends React.Component<IGoodsListProps> {
ReactDOM.render(<GoodsList
open={this.props.open}
onClose={this.onClose}
select={this.props.select}
goods_type={this.props.goods_type}
/>, this._StateContainer);
}
onClose = () =>
{
if (this.props.onClose)
this.props.onClose();
else if (this.props.open)
this.props.open.set(false);
};
componentDidMount()
{
this._CurrentModalKey = app.Editor.ModalManage.CurrentModalKey;

@ -19,6 +19,7 @@ export const TotalTabbarTitlesInfos: [string, string][] = [
["大孔面", EBoardKeyList.BigHole],//27
["是否拆单", "IsChaiDan"],//28
['板边备注信息', "boardEdgeRemark"],//29
["预留边信息", "reservedEdge"],//30
];
export class BBSEditorStore implements IConfigStore
@ -26,15 +27,15 @@ export class BBSEditorStore implements IConfigStore
private readonly _version = 3;
@observable configName = "默认";
@observable configsNames = [];
noResize = [6, 8, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29]; //用于字段列宽度调整,但是有一些特殊框就不做调整了
@observable tabbarIndexs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20, 29];
noResize = [6, 8, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30]; //用于字段列宽度调整,但是有一些特殊框就不做调整了
@observable tabbarIndexs = []; //这里可以不填会在启动和更新时自动更新值
@observable IsBbsCountChaidan = true; //是否统计非拆单板
InitOption()
{
this.tabbarIndexs.length = 0;
this.tabbarIndexs.push(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20, 29);
this.tabbarIndexs.push(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 19, 20, 29); //BBS默认显示
this.IsBbsCountChaidan = true;
}
SaveConfig()

@ -222,6 +222,27 @@ export class BoardStore<T = IBaseOption> extends Singleton implements IConfigSto
cof.processData.edgeRemarkRight = "";
cof.processData.highBoardEdgeRemark = [];
}
if (cof.processData.version < 5)
{
cof.processData.version = 5;
cof.processData.reservedEdgeUp = "0";
cof.processData.reservedEdgeDown = "0";
cof.processData.reservedEdgeLeft = "0";
cof.processData.reservedEdgeRight = "0";
cof.processData.highReservedEdge = [];
cof.processData.sealColorUp = "";
cof.processData.sealColorDown = "";
cof.processData.sealColorLeft = "";
cof.processData.sealColorRight = "";
cof.processData.sealColorType = "";
cof.processData.highSealed = cof.processData.highSealed.map(s =>
{
return {
size: s.size,
sealColor: s.sealColor ?? "",
};
});
}
Object.assign(this.m_BoardProcessOption, cof.processData);
if (this.ui_BoardProcessOption)

@ -252,6 +252,34 @@ export class DoorStore extends DoorDrawerStore
cof.option.version = 12;
cof.option.parseHinge = DefaultDoorOption.parseHinge;
}
if (opt.version < 13)
{
cof.option.version = 13;
cof.option.sealColorUp = DefaultDoorOption.sealColorUp;
cof.option.sealColorDown = DefaultDoorOption.sealColorDown;
cof.option.sealColorLeft = DefaultDoorOption.sealColorLeft;
cof.option.sealColorRight = DefaultDoorOption.sealColorRight;
cof.option.reservedEdgeUp = DefaultDoorOption.reservedEdgeUp;
cof.option.reservedEdgeDown = DefaultDoorOption.reservedEdgeDown;
cof.option.reservedEdgeLeft = DefaultDoorOption.reservedEdgeLeft;
cof.option.reservedEdgeRight = DefaultDoorOption.reservedEdgeRight;
cof.option.layerSealColorUp = DefaultDoorOption.layerSealColorUp;
cof.option.layerSealColorDown = DefaultDoorOption.layerSealColorDown;
cof.option.layerSealColorLeft = DefaultDoorOption.layerSealColorLeft;
cof.option.layerSealColorRight = DefaultDoorOption.layerSealColorRight;
cof.option.layerReservedEdgeUp = DefaultDoorOption.layerReservedEdgeUp;
cof.option.layerReservedEdgeDown = DefaultDoorOption.layerReservedEdgeDown;
cof.option.layerReservedEdgeLeft = DefaultDoorOption.layerReservedEdgeLeft;
cof.option.layerReservedEdgeRight = DefaultDoorOption.layerReservedEdgeRight;
cof.option.verticalSealColorUp = DefaultDoorOption.verticalSealColorUp;
cof.option.verticalSealColorDown = DefaultDoorOption.verticalSealColorDown;
cof.option.verticalSealColorLeft = DefaultDoorOption.verticalSealColorLeft;
cof.option.verticalSealColorRight = DefaultDoorOption.verticalSealColorRight;
cof.option.verticalReservedEdgeUp = DefaultDoorOption.verticalReservedEdgeUp;
cof.option.verticalReservedEdgeDown = DefaultDoorOption.verticalReservedEdgeDown;
cof.option.verticalReservedEdgeLeft = DefaultDoorOption.verticalReservedEdgeLeft;
cof.option.verticalReservedEdgeRight = DefaultDoorOption.verticalReservedEdgeRight;
}
}
get UIRule()
{

@ -115,6 +115,18 @@ export class DrawerStore extends DoorDrawerStore
cof.option.roomName = DefaultDrawerOption.roomName;
cof.option.cabinetName = DefaultDrawerOption.cabinetName;
}
if (opt.version < 10)
{
opt.version = 10;
cof.option.sealColorUp = DefaultDrawerOption.sealColorUp;
cof.option.sealColorDown = DefaultDrawerOption.sealColorDown;
cof.option.sealColorLeft = DefaultDrawerOption.sealColorLeft;
cof.option.sealColorRight = DefaultDrawerOption.sealColorRight;
cof.option.reservedEdgeUp = DefaultDrawerOption.reservedEdgeUp;
cof.option.reservedEdgeDown = DefaultDrawerOption.reservedEdgeDown;
cof.option.reservedEdgeLeft = DefaultDrawerOption.reservedEdgeLeft;
cof.option.reservedEdgeRight = DefaultDrawerOption.reservedEdgeRight;
}
}
SetDrawerDepth()
{

@ -78,6 +78,36 @@ export interface IDoorConfigOption extends IDoorAndDrawerConfigOption
layerEdgeRemarkLeft: string;
layerEdgeRemarkRight: string;
parseHinge: boolean;//铰链信息写入门板备注
sealColorUp: string; //门板封边颜色
sealColorDown: string;
sealColorLeft: string;
sealColorRight: string;
reservedEdgeUp: string; //门板预留边
reservedEdgeDown: string;
reservedEdgeLeft: string;
reservedEdgeRight: string;
layerSealColorUp: string; //层板封边颜色
layerSealColorDown: string;
layerSealColorLeft: string;
layerSealColorRight: string;
layerReservedEdgeUp: string; //层板预留边
layerReservedEdgeDown: string;
layerReservedEdgeLeft: string;
layerReservedEdgeRight: string;
verticalSealColorUp: string; //立板封边颜色
verticalSealColorDown: string;
verticalSealColorLeft: string;
verticalSealColorRight: string;
verticalReservedEdgeUp: string; //层板预留边
verticalReservedEdgeDown: string;
verticalReservedEdgeLeft: string;
verticalReservedEdgeRight: string;
}
/**
@ -103,6 +133,15 @@ export interface IDrawerConfigOption extends IDoorAndDrawerConfigOption
isAutoSelectTrack: boolean;
isLockTopOffset: boolean;
isLockBottomOffset: boolean;
sealColorUp: string; //抽屉立板封边颜色
sealColorDown: string;
sealColorLeft: string;
sealColorRight: string;
reservedEdgeUp: string; //抽屉立板预留边
reservedEdgeDown: string;
reservedEdgeLeft: string;
reservedEdgeRight: string;
}
//门板位置类型

@ -2,7 +2,7 @@ import { FaceDirection } from "../../../Add-on/DrawDrilling/DrillType";
import { EBoardKeyList } from "../../../Common/BoardKeyList";
import { ComposingType, LinesType } from "../../../DatabaseServices/Entity/BoardInterface";
import { ObjectId } from "../../../DatabaseServices/ObjectId";
import { IHighEdgeRemarkItem, IHighSealedItem } from "./IHighSealedItem";
import { IHighEdgeRemarkItem, IHighReservedEdgeItem, IHighSealedItem } from "./IHighSealedItem";
import { IBaseOption } from "./IOptionInterface";
export interface BoardProcessOption extends IBaseOption
@ -39,4 +39,16 @@ export interface BoardProcessOption extends IBaseOption
edgeRemarkLeft?: string;
edgeRemarkRight?: string;
highBoardEdgeRemark?: IHighEdgeRemarkItem[]; //高级板边备注
reservedEdgeUp?: string; //预留边上下左右
reservedEdgeDown?: string;
reservedEdgeLeft?: string;
reservedEdgeRight?: string;
highReservedEdge?: IHighReservedEdgeItem[]; //高级预留边
sealColorUp?: string; //封边颜色上下左右
sealColorDown?: string;
sealColorLeft?: string;
sealColorRight?: string;
sealColorType?: string; //封边颜色类型(统一的颜色)
}

@ -1,6 +1,7 @@
export interface IHighSealedItem
{
size: number;
sealColor: string;
}
export interface ISealingData extends IHighSealedItem
@ -14,3 +15,8 @@ export interface IHighEdgeRemarkItem
{
description: string;
}
export interface IHighReservedEdgeItem
{
size: number;
}

@ -0,0 +1,177 @@
import { observable, toJS } from "mobx";
import { CommandNames } from "../../../Common/CommandNames";
import { Log, LogType } from "../../../Common/Log";
import { Intent } from "../../../Common/Toaster";
import { safeEval } from "../../../Common/eval";
import { Board } from "../../../DatabaseServices/Entity/Board";
import { CommandWrap } from "../../../Editor/CommandMachine";
import { GetBoardHighReservedEdge, GetBoardSealingCurves, SetBoardReservedEdgeData } from "../../../GraphicsSystem/CalcEdgeSealing";
import { IConfigOption } from "../../Components/Board/UserConfigComponent";
import { AppToaster, ShowLinesToaster } from "../../Components/Toaster";
import { IConfigStore } from "../BoardStore";
import { IHighReservedEdgeItem } from "../OptionInterface/IHighSealedItem";
import { BoardEdgesEditor, Board_Editor_Key } from "./BoardEdgesEditor";
export class ReservedEdgeStore extends BoardEdgesEditor implements IConfigStore
{
isNotUpdateStore = false;//默认打开窗体时,我们更新配置,而在提取预留边时,我们手动更新配置,所以关闭它.
@observable highReservedEdge: string[] = Array(20).fill("0");
private static _SingleInstance: ReservedEdgeStore;
static GetInstance(): ReservedEdgeStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new ReservedEdgeStore;
return this._SingleInstance;
}
@observable option = { highReservedEdge: this.highReservedEdge };
async InitData()
{
}
@observable configName: string = "默认";
@observable configsNames: string[] = [];
InitOption()
{
//禁止再次初始化,避免用户没有配置的时候,使用预留边编辑,导致面板属性被还原
Object.assign(this.option, { highReservedEdge: Array(20).fill("0") });
}
SaveConfig()
{
return { option: toJS(this.option) };
}
UpdateOption(cof: IConfigOption)
{
Object.assign(this.option, cof.option);
}
protected InitCurve()
{
let dataColorMap = new Map<string, number>();//data->color
let canUseColor: number[] = [];//可使用的颜色
let highSizes = this.option.highReservedEdge;
for (let i = 0; i < highSizes.length; i++)
{
if (dataColorMap.has(highSizes[i]))
canUseColor.push(i);//可以被覆盖
else
dataColorMap.set(highSizes[i], i);//记录颜色
}
for (let br of this._boardList)
{
let curves = GetBoardSealingCurves(br, true);
let highReservedEdge = GetBoardHighReservedEdge(br, curves);
if (highReservedEdge.length === curves.length)
{
for (let i = 0; i < highReservedEdge.length; i++)
{
let s = highReservedEdge[i];
if (!dataColorMap.has(s.size.toString()))
{
if (canUseColor[0])
{
dataColorMap.set(s.size.toString(), canUseColor[0]);
highSizes[canUseColor[0]] = s.size.toString();
canUseColor.shift();
}
else
{
highSizes.push(s.size.toString());
dataColorMap.set(s.size.toString(), highSizes.length - 1);
}
}
let color = dataColorMap.get(s.size.toString()) + 1;
curves[i].ColorIndex = color;
}
}
else
{
if (!dataColorMap.has("1"))
{
if (canUseColor[0])
{
dataColorMap.set("1", canUseColor[0]);
highSizes[canUseColor[0]] = "1";
canUseColor.shift();
}
else
{
highSizes.push("1");
dataColorMap.set("1", highSizes.length - 1);
}
}
let color = dataColorMap.get("1") + 1;
curves.forEach(cu => cu.ColorIndex = color);
}
this._brMap.set(br, curves);
}
}
protected ShowToaster()
{
ShowLinesToaster(
["正在编辑预留边...", "点击<写入>写入预留边数据到板件,", "点击<退出>或者关闭退出编辑状态"],
{
intent: Intent.PRIMARY,
timeout: 0,
onDismiss: () =>
{
this.EndEditor();
}
}, Board_Editor_Key);
}
private _dataMap: Map<Board, IHighReservedEdgeItem[]> = new Map();
protected ParseData(isCheck = false)
{
let hasZeroColorIndex = false; //预留边颜色为0
for (let [b, cus] of this._brMap)
{
let data: IHighReservedEdgeItem[] = [];
for (let cu of cus)
{
const color = cu.ColorIndex;
if (color > this.option.highReservedEdge.length)
{
Log(color + "号色未设置数据,默认为1", LogType.Warning);
data.push({ size: 1 });
}
else
{
let size = this.option.highReservedEdge[color - 1];
if (color === 0)
{
size = "0";
hasZeroColorIndex = true;
}
data.push({ size: safeEval(size) });
}
}
this._dataMap.set(b, data);
}
//check()的时候提醒
if (isCheck && hasZeroColorIndex)
AppToaster.show({
message: "编辑存在颜色为 0 的预留边,该预留边自动设置为 0",
timeout: 5000,
intent: Intent.WARNING,
});
}
protected async WriteData()
{
await CommandWrap(() =>
{
for (let [b, cus] of this._brMap)
{
let data = this._dataMap.get(b);
let ocsInv = b.OCSInv;
SetBoardReservedEdgeData(b, data, cus.map(c => c.ApplyMatrix(ocsInv)));
b.BoardProcessOption.highReservedEdge = data;
}
this._dataMap.clear();
}, CommandNames.);
}
}

@ -11,6 +11,7 @@ import { DrillingStore } from "./DrillingStore";
import { LightStore } from "./LightStore";
import { Modeling2Store } from "./Modeling2Store";
import { ModelingStore } from "./ModelingStore";
import { ReservedEdgeStore } from "./ReservedEdgeStore";
import { SealingStore } from "./SealingStore";
import { TemplateParamPanelStore } from "./TemplateParamPanelStore";
@ -25,6 +26,7 @@ export class RightPanelStore
lightStore = LightStore.GetInstance();
sealingStore = SealingStore.GetInstance();
boardEdgeRemarksStore = BoardEdgeRemarksStore.GetInstance();
reservedEdgeStore = ReservedEdgeStore.GetInstance();
drillingStore = new DrillingStore();
modeling2Store = new Modeling2Store();
modeling3Store = new Modeling2Store();

@ -2,7 +2,6 @@ import { observable, toJS } from "mobx";
import { CommandNames } from "../../../Common/CommandNames";
import { Log, LogType } from "../../../Common/Log";
import { Intent, ToasterShowEntityMsg } from "../../../Common/Toaster";
import { safeEval } from "../../../Common/eval";
import { Board } from "../../../DatabaseServices/Entity/Board";
import { Entity } from "../../../DatabaseServices/Entity/Entity";
import { CommandWrap } from "../../../Editor/CommandMachine";
@ -12,12 +11,17 @@ import { AppToaster, ShowLinesToaster } from "../../Components/Toaster";
import { IConfigStore } from "../BoardStore";
import { IHighSealedItem } from "../OptionInterface/IHighSealedItem";
import { BoardEdgesEditor, Board_Editor_Key } from "./BoardEdgesEditor";
interface IHighSizeItem
{
size: string;
sealColor: string;
}
export class SealingStore extends BoardEdgesEditor implements IConfigStore
{
isNotUpdateStore = false;//默认打开窗体时,我们更新配置,而在提取封边时,我们手动更新配置,所以关闭它.
@observable highSizes: string[] = Array(15).fill("1");
@observable highSizes: IHighSizeItem[] = Array(15).fill({ size: "1", sealColor: "" });
private static _SingleInstance: SealingStore;
static GetInstance(): SealingStore
{
@ -26,7 +30,10 @@ export class SealingStore extends BoardEdgesEditor implements IConfigStore
return this._SingleInstance;
}
@observable option = { highSizes: this.highSizes };
@observable option = {
version: 1,
highSizes: this.highSizes,
};
async InitData()
{
}
@ -35,8 +42,9 @@ export class SealingStore extends BoardEdgesEditor implements IConfigStore
@observable configsNames: string[] = [];
InitOption()
{
let highSizes: IHighSizeItem[] = Array(15).fill({ size: "1", sealColor: "" });
//禁止再次初始化,避免用户没有配置的时候,使用封边编辑,导致面板属性被还原
Object.assign(this.option, { highSizes: Array(15).fill("1") });
Object.assign(this.option, { highSizes });
}
SaveConfig()
{
@ -45,20 +53,35 @@ export class SealingStore extends BoardEdgesEditor implements IConfigStore
UpdateOption(cof: IConfigOption)
{
if (!cof.option.version)
{
cof.option.version = 1;
cof.option.highSizes = cof.option.highSizes.map((s) =>
{
return {
size: s,
sealColor: "",
};
});
}
Object.assign(this.option, cof.option);
}
protected InitCurve()
{
let dataColorMap = new Map<string, number>();//data->color
let canUseColor: number[] = [];//可使用的颜色
let highSizes = this.option.highSizes;
let { highSizes } = this.option;
for (let i = 0; i < highSizes.length; i++)
{
if (dataColorMap.has(highSizes[i]))
let { size, sealColor } = highSizes[i];
//通过拼接封边大小、颜色,判断是否重复
let str = `${size}-${sealColor}`;
if (dataColorMap.has(str))
canUseColor.push(i);//可以被覆盖
else
dataColorMap.set(highSizes[i], i);//记录颜色
dataColorMap.set(str, i);//记录颜色
}
for (let br of this._boardList)
@ -70,41 +93,44 @@ export class SealingStore extends BoardEdgesEditor implements IConfigStore
for (let i = 0; i < highseals.length; i++)
{
let s = highseals[i];
if (!dataColorMap.has(s.size.toString()))
let str = `${s.size}-${s.sealColor}`;
if (!dataColorMap.has(str))
{
if (canUseColor[0])
{
dataColorMap.set(s.size.toString(), canUseColor[0]);
highSizes[canUseColor[0]] = s.size.toString();
highSizes[canUseColor[0]] = { size: s.size.toString(), sealColor: s.sealColor };
dataColorMap.set(str, canUseColor[0]);
canUseColor.shift();
}
else
{
highSizes.push(s.size.toString());
dataColorMap.set(s.size.toString(), highSizes.length - 1);
highSizes.push({ size: s.size.toString(), sealColor: s.sealColor });
dataColorMap.set(str, highSizes.length - 1);
}
}
let color = dataColorMap.get(s.size.toString()) + 1;
let color = dataColorMap.get(str) + 1;
curves[i].ColorIndex = color;
}
}
else
{
if (!dataColorMap.has("1"))
//"1-"代表封边值1,封边颜色为空
const defaultStr = "1-";
if (!dataColorMap.has(defaultStr))
{
if (canUseColor[0])
{
dataColorMap.set("1", canUseColor[0]);
highSizes[canUseColor[0]] = "1";
dataColorMap.set(defaultStr, canUseColor[0]);
highSizes[canUseColor[0]] = { size: "1", sealColor: "" };
canUseColor.shift();
}
else
{
highSizes.push("1");
dataColorMap.set("1", highSizes.length - 1);
highSizes.push({ size: "1", sealColor: "" });
dataColorMap.set(defaultStr, highSizes.length - 1);
}
}
let color = dataColorMap.get("1") + 1;
let color = dataColorMap.get(defaultStr) + 1;
curves.forEach(cu => cu.ColorIndex = color);
}
this._brMap.set(br, curves);
@ -137,17 +163,17 @@ export class SealingStore extends BoardEdgesEditor implements IConfigStore
if (color > this.option.highSizes.length)
{
Log(color + "号色未设置数据,默认为1", LogType.Warning);
data.push({ size: 1 });
data.push({ size: 1, sealColor: "" });
}
else
{
let size = this.option.highSizes[color - 1];
let highSize = this.option.highSizes[color - 1];
if (color === 0)
{
size = "0";
highSize.size = "0";
hasZeroColorIndex = true;
}
data.push({ size: safeEval(size) });
data.push({ size: parseFloat(highSize.size), sealColor: highSize.sealColor });
}
}
this._dataMap.set(b, data);
@ -168,6 +194,12 @@ export class SealingStore extends BoardEdgesEditor implements IConfigStore
for (let [b, cus] of this._brMap)
{
let data = this._dataMap.get(b);
let typeSet = new Set(data.map(d => { return d.sealColor; }));
if (typeSet.size > 1)
b.BoardProcessOption.sealColorType = "**多种**";
else
b.BoardProcessOption.sealColorType = data[0].sealColor;
let ocsInv = b.OCSInv;
SetBoardTopDownLeftRightSealData(b, data, cus.map(c => c.ApplyMatrix(ocsInv)));
b.BoardProcessOption.highSealed = data;

Loading…
Cancel
Save