!608 拆单增加原始点阵数据和开料尺寸数据

pull/608/MERGE
cf-erp 5 years ago committed by ChenX
parent d758562caf
commit 1a934f18d1

@ -6,6 +6,15 @@ switch (location.hostname)
{
case "t.cfcad.cn": //测试环境
ErpURL.host = "https://chenfeng.tech:777";
let hash = location.hash.replace('#', '');
if (hash != '')
{
let branch = hash.split('=')[1];
if (branch)
{
ErpURL.host = branch;
}
}
break;
case "cfcad.cn": //生产环境
ErpURL.host = "https://sc.leye.site";

@ -4,7 +4,6 @@ export class CadBlockPoint
PointX: number;
PointY: number;
Curve: number;
SealSize: number;
}
export class CadBlockHoles
{
@ -50,9 +49,10 @@ export class BasePosition
YVec: string;
ZVec: string;
}
export class CadBlockInfo
export class CadBlockInfo
{
PointDetail: CadBlockPoint[];
HoleDetail: CadBlockHoles[];
ModelDetail: CadBlockModel[];
OrgPointDetail: CadBlockPoint[];
}

@ -40,12 +40,7 @@ export class ErpParseData
block.BoxName = boxName;
block.BoardName = entity.Name; //板名称
block.BoardType = entity.BoardType; // 板类型 0:层板 1:立板 2:背板
let boardInfo = Production.GetBoardInfo(entity);
block.GoodsID = 0;
//材料,颜色
block.Color = boardInfo.color;
block.Material = boardInfo.material;
block.MaterialName = boardInfo.boardName;
//板大小
block.Width = this.GetNumberBit(entity.Width, 3); // 宽
block.Height = this.GetNumberBit(entity.Height, 3); // 高
@ -78,6 +73,10 @@ export class ErpParseData
baseposition.YVec = `${yVec.x},${yVec.y},${yVec.z}`;
baseposition.ZVec = `${zVec.x},${zVec.y},${zVec.z}`;
let boardData = Production.GetBoardSplitOrderData(entity);
//材料,颜色
block.Color = boardData.info.color;
block.Material = boardData.info.material;
block.MaterialName = boardData.info.boardName;
block.FrontHoleCount = boardData.holes.frontBackHoles != null ? boardData.holes.frontBackHoles.filter(t => t.face === DrillingFace.Front).length : 0;
block.BackHoleCount = boardData.holes.frontBackHoles != null ? boardData.holes.frontBackHoles.filter(t => t.face === DrillingFace.Back).length : 0;
block.SideHoleCount = boardData.holes.sideHoles != null ? boardData.holes.sideHoles.length : 0;
@ -91,7 +90,8 @@ export class ErpParseData
let cadModelArray = this.GetCadModelArray([modelData]);
block.CadDataType = CadType.WebCad;
let offsetArray = [boardData.offsetTanslation.x, boardData.offsetTanslation.y, boardData.offsetTanslation.z];
block.CadData = JSON.stringify([pointInfoArray, basepositionArray, cadModelArray, offsetArray]);
let kaiLiaoArray = [boardData.info.kaiLiaoWidth, boardData.info.kaiLiaoHeight]
block.CadData = JSON.stringify([pointInfoArray, basepositionArray, cadModelArray, offsetArray, kaiLiaoArray]);
blockList.push(block);
}
}
@ -125,7 +125,7 @@ export class ErpParseData
return w;
}
//获取异形数据
GetPointDetail(points: IContourData, seals: ISealingData[]): CadBlockPoint[]
GetPointDetail(points: IContourData): CadBlockPoint[]
{
if (points == null || points.pts == null) return [];
let pointList: CadBlockPoint[] = [];
@ -136,7 +136,6 @@ export class ErpParseData
newPoint.PointX = this.GetNumberBit(points.pts[i].x, 2);
newPoint.PointY = this.GetNumberBit(points.pts[i].y, 2);
newPoint.Curve = this.GetNumberBit(points.buls[i], 6);
newPoint.SealSize = seals[i].size;
pointList.push(newPoint);
}
return pointList;
@ -301,9 +300,11 @@ export class ErpParseData
GetBlockPointInfo(board: ISpliteOrderData): CadBlockInfo
{
let pointDetail: CadBlockPoint[] = [];
let orgPointDetail: CadBlockPoint[] = [];
if (board.info.isRect === false)
{
pointDetail = this.GetPointDetail(board.outline, board.sealing);
pointDetail = this.GetPointDetail(board.outline);
orgPointDetail = this.GetPointDetail(board.originOutlin);
}
let frontModelDetail = this.GetModelDetail(board.modeling, FrontOrSide.);
let sideModelDetail = this.GetModelDetail(board.sideModeling, FrontOrSide.);
@ -317,6 +318,7 @@ export class ErpParseData
result.PointDetail = pointDetail;
result.HoleDetail = holeDetail;
result.ModelDetail = modelDetail;
result.OrgPointDetail = orgPointDetail;
return result;
}
@ -365,7 +367,7 @@ export class ErpParseData
{
return points.map(p =>
{
return [p.PointID, p.PointX, p.PointY, p.Curve, p.SealSize];
return [p.PointID, p.PointX, p.PointY, p.Curve];
});
}
GetHolesArray(holes: CadBlockHoles[])
@ -394,9 +396,9 @@ export class ErpParseData
{
return [info.BasePoint, info.XVec, info.YVec, info.ZVec];
}
GetPointInfoArray(info: CadBlockInfo): [object, object, object]
GetPointInfoArray(info: CadBlockInfo): [object, object, object, object]
{
return [this.GetPointsArray(info.PointDetail), this.GetHolesArray(info.HoleDetail), this.GetModelsArray(info.ModelDetail)];
return [this.GetPointsArray(info.PointDetail), this.GetHolesArray(info.HoleDetail), this.GetModelsArray(info.ModelDetail), this.GetPointsArray(info.OrgPointDetail)];
}
GetBasePositionArray(basePosition: CadBlockBasePosition): [number, number, number]
{

@ -76,6 +76,8 @@ interface IBoardProdInfo
isRect: boolean;
reamarks: any[];
kaiLiaoWidth: number;
kaiLiaoHeight: number;
}
/**拆单数据 */
@ -88,6 +90,7 @@ export interface ISpliteOrderData
holes: IBoardHoleInfo; //孔信息
sideModeling: IModelingData[]; //侧面造型信息
offsetTanslation: Vector3;
originOutlin: IContourData; //不扣封边原始轮廓
}
export namespace Production
@ -102,9 +105,16 @@ export namespace Production
//外轮廓去掉最后的闭合点
outlinePtsBul.pts.pop();
outlinePtsBul.buls.pop();
let size = outline.BoundingBox.getSize(new Vector3);
//不扣除封边的轮廓信息
let originOutlinePtsBul = ConverToPolylineAndSplitArc(br.ContourCurve.Clone());
originOutlinePtsBul.pts.pop();
originOutlinePtsBul.buls.pop();
return {
info: GetBoardInfo(br),
info: GetBoardInfo(br, size),
originOutlin: originOutlinePtsBul,
outline: outlinePtsBul,
sealing: GetBoardSealingData(br),
modeling: GetBoardModelingData(br, offsetTanslation),
@ -113,7 +123,7 @@ export namespace Production
offsetTanslation,
};
}
export function GetBoardInfo(br: Board): IBoardProdInfo
export function GetBoardInfo(br: Board, size: Vector3): IBoardProdInfo
{
let data = br.BoardProcessOption;
return {
@ -131,6 +141,8 @@ export namespace Production
spliteWidth: data.spliteWidth,
isRect: !br.IsSpecialShape,
reamarks: [],
kaiLiaoWidth: size.x,
kaiLiaoHeight: size.y,
};
}

Loading…
Cancel
Save