更新下字段名
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@imes-modelprocesspoints/libs",
|
"name": "@imes-modelprocesspoints/libs",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@@ -1,2 +1 @@
|
|||||||
// export * from "./processors/modelProcessPoints/modelProcessPoints";
|
|
||||||
export * from "./processors/TransformProcessItemByPosition/TransformProcessItemByPosition"
|
export * from "./processors/TransformProcessItemByPosition/TransformProcessItemByPosition"
|
@@ -126,7 +126,7 @@ export class TransformProcessItemByPositionProc extends ProcessorBase<TransformP
|
|||||||
|
|
||||||
resBlock.models = this.transformByBlock(resBlock.models, isTurn, action, _width, _length)
|
resBlock.models = this.transformByBlock(resBlock.models, isTurn, action, _width, _length)
|
||||||
resBlock.holes = this.transformByBlock(resBlock.holes, isTurn, action, _width, _length)
|
resBlock.holes = this.transformByBlock(resBlock.holes, isTurn, action, _width, _length)
|
||||||
resBlock.board = this.transformByBlock(resBlock.board, isTurn, action, _width, _length)
|
resBlock.border = this.transformByBlock(resBlock.border, isTurn, action, _width, _length)
|
||||||
|
|
||||||
|
|
||||||
/** 左转 或者 右转 长宽值 要互换 */
|
/** 左转 或者 右转 长宽值 要互换 */
|
||||||
@@ -356,7 +356,7 @@ export class TransformProcessItemByPositionProc extends ProcessorBase<TransformP
|
|||||||
// 孔
|
// 孔
|
||||||
let holes = block.holes
|
let holes = block.holes
|
||||||
// 板件轮廓
|
// 板件轮廓
|
||||||
let board = block.board
|
let border = block.border
|
||||||
|
|
||||||
if (Array.isArray(models) && models.length > 0) {
|
if (Array.isArray(models) && models.length > 0) {
|
||||||
models = await this.handleByPlaceXY(models, placeX, placeY)
|
models = await this.handleByPlaceXY(models, placeX, placeY)
|
||||||
@@ -368,16 +368,16 @@ export class TransformProcessItemByPositionProc extends ProcessorBase<TransformP
|
|||||||
} else {
|
} else {
|
||||||
holes = []
|
holes = []
|
||||||
}
|
}
|
||||||
if (Array.isArray(board) && board.length > 0) {
|
if (Array.isArray(border) && border.length > 0) {
|
||||||
board = await this.handleByPlaceXY(board, placeX, placeY)
|
border = await this.handleByPlaceXY(border, placeX, placeY)
|
||||||
} else {
|
} else {
|
||||||
board = []
|
border = []
|
||||||
}
|
}
|
||||||
block = {
|
block = {
|
||||||
...block,
|
...block,
|
||||||
holes: holes,
|
holes: holes,
|
||||||
models: models,
|
models: models,
|
||||||
board: board
|
border: border
|
||||||
}
|
}
|
||||||
return block
|
return block
|
||||||
}
|
}
|
||||||
@@ -425,7 +425,7 @@ export type TransformProcessItemByPositionInputBlock = {
|
|||||||
/** 孔数据 */
|
/** 孔数据 */
|
||||||
holes: TransformProcessingItem[],
|
holes: TransformProcessingItem[],
|
||||||
/** 轮廓数据 */
|
/** 轮廓数据 */
|
||||||
board: TransformProcessingItem[],
|
border: TransformProcessingItem[],
|
||||||
/** 板件的原放置方式 默认为正面(0) 不传则为正面 原 placestyle*/
|
/** 板件的原放置方式 默认为正面(0) 不传则为正面 原 placestyle*/
|
||||||
positionType?: PositionType,
|
positionType?: PositionType,
|
||||||
/** 目标放置方式 优化后会有这个数据 或者是 手动排版 */
|
/** 目标放置方式 优化后会有这个数据 或者是 手动排版 */
|
||||||
@@ -446,7 +446,7 @@ export type TransformProcessItemByPositionOutputBlock = {
|
|||||||
/** 孔数据 */
|
/** 孔数据 */
|
||||||
holes: TransformProcessingItem[],
|
holes: TransformProcessingItem[],
|
||||||
/** 轮廓数据 看需求 因为存在多种类型的轮廓 所有这里为数组 */
|
/** 轮廓数据 看需求 因为存在多种类型的轮廓 所有这里为数组 */
|
||||||
board: TransformProcessingItem[],
|
border: TransformProcessingItem[],
|
||||||
/** 板件(小板)长 */
|
/** 板件(小板)长 */
|
||||||
length: number,
|
length: number,
|
||||||
/** 板件(小板)宽 */
|
/** 板件(小板)宽 */
|
||||||
|
@@ -12,7 +12,7 @@ test('conversionTest', async () => {
|
|||||||
/** 孔数据集 */
|
/** 孔数据集 */
|
||||||
let holes: TransformProcessingItem[] = []
|
let holes: TransformProcessingItem[] = []
|
||||||
/** 轮廓集合 */
|
/** 轮廓集合 */
|
||||||
let board: TransformProcessingItem[] = []
|
let border: TransformProcessingItem[] = []
|
||||||
|
|
||||||
//#region 业务数据转为处理器入参数据
|
//#region 业务数据转为处理器入参数据
|
||||||
// 造型 数据转换
|
// 造型 数据转换
|
||||||
@@ -44,14 +44,14 @@ test('conversionTest', async () => {
|
|||||||
|
|
||||||
/** 各种轮廓的集合 */
|
/** 各种轮廓的集合 */
|
||||||
// 原始轮廓
|
// 原始轮廓
|
||||||
let orgBoard: TransformProcessingItem = {
|
let orgBorder: TransformProcessingItem = {
|
||||||
id: `orgBoard_${block.blockNo}`,
|
id: `orgBorder_${block.blockNo}`,
|
||||||
pts: block.blockDetail.orgContourData?.pts || [],
|
pts: block.blockDetail.orgContourData?.pts || [],
|
||||||
buls: block.blockDetail.orgContourData?.buls || [],
|
buls: block.blockDetail.orgContourData?.buls || [],
|
||||||
face: 0
|
face: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
board.push(orgBoard)
|
border.push(orgBorder)
|
||||||
|
|
||||||
// 开料轮廓 。。。。 若需要 按照原始轮廓的方式添加
|
// 开料轮廓 。。。。 若需要 按照原始轮廓的方式添加
|
||||||
let _block: TransformProcessItemByPositionInputBlock = {
|
let _block: TransformProcessItemByPositionInputBlock = {
|
||||||
@@ -69,7 +69,7 @@ test('conversionTest', async () => {
|
|||||||
positionType: 0,
|
positionType: 0,
|
||||||
models,
|
models,
|
||||||
holes,
|
holes,
|
||||||
board,
|
border,
|
||||||
}
|
}
|
||||||
blocks.push(_block)
|
blocks.push(_block)
|
||||||
//#endregion
|
//#endregion
|
||||||
@@ -87,7 +87,7 @@ test('conversionTest', async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let proc = new TransformProcessItemByPositionProc()
|
let proc = new TransformProcessItemByPositionProc()
|
||||||
proc.handleProcessItemPointsData
|
|
||||||
await proc.exec(context)
|
await proc.exec(context)
|
||||||
|
|
||||||
console.log(context)
|
console.log(context)
|
||||||
|
Reference in New Issue
Block a user