commit 8f6e7368e0ae4b73edbf4672523e134427869d32 Author: lixiang <504331699@qq.com> Date: Fri Jun 13 15:35:51 2025 +0800 feat:提交 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..759980f --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +node_modules +.DS_Store +dist +.npmrc +.cache +tests/server/static +tests/server/static/upload + +*.local +# local env files +.env.local +.env.*.local +.eslintcache + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +.vscode/** +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +*.lock + +package-lock.json + +.history diff --git a/demoPage.md b/demoPage.md new file mode 100644 index 0000000..515ce5b --- /dev/null +++ b/demoPage.md @@ -0,0 +1,1476 @@ + + + + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..34c4c5b --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "processParser", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/file-saver": "^2.0.7", + "@types/node": "^24.0.0", + "typescript": "^5.8.3" + }, + "dependencies": { + "fflate": "^0.7.4", + "file-saver": "^2.0.2", + "processparser": "file:" + }, + "compilerOptions": { + "target": "ES6", + "module": "ESNext", + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "moduleResolution": "node" + } +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..36fb871 --- /dev/null +++ b/readme.md @@ -0,0 +1,21 @@ +## 解析器接收数据 生成加工文件 + +·数据说明 + 1、刀路描述 + 2、调用的指令 + 3、加工项附带的信息(加工项所在板件信息和所在订单信息等等业务信息,可根据需求添加和开发) + 4、刀具信息 + +## 测试流程 + +1.npm install + +2 编译 TypeScript 代码 npx tsc + +3.运行编译后的 JavaScript 文件 + +# 参考 +内网测试地址:https://192.168.1.205/ +测试账户密码:admin admin123 左侧菜单demo栏目下 + +demo页面vue代码 demoPage.md \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..d5ad43a --- /dev/null +++ b/src/index.ts @@ -0,0 +1,364 @@ +import { ParserMain } from "./processParser/parseMain" +import { device1 } from "./processParser/processConfig/device1/parser1" +import { device2 } from "./processParser/processConfig/device2/parser2" +/** 范例 */ + +const boardLocation = '3' +const widthSideAxis = '0' +const lengthSideAxis = '2' +const parserMain = new ParserMain() +/** 测试数据 */ +const jsonData = ` +//数据说明 +//(1)加工前先调6厘的刀, +//(2)做孔加工的时候找【T1】的刀加工 +//(3)做造型的加工找【T2】的刀 +//(4)开料时 找5厘的刀 +{ + // 加工项信息 + "processList": [ + { + // 加工指令数据集 + "processItemInfo": { + // 代码 + "code": "MARK", + // 指令 + "order": "Mark", + // 指令参数 + "codeParams": "// start fileHead" + }, + // 加工刀路信息 + "list": [] + }, + { + "processItemInfo": { + "code": "FSTART", + "order": "F1" + }, + "list": [] + }, + { + "processItemInfo": { + "code": "T", + "order": "TD", + "codeParams": { + "diameter": 6 + } + }, + "list": [] + }, + { + // 一个加工项 模拟一个孔的加工 + "processItemInfo": { + "knife":{ + "knifeName": "T1" + }, + "code": "C", + "order": "KnifeMove", + "block":{ + "cutWidth":400, + "cutLength":600 + } + }, + "list": [ + // 移动到安全点 + { "x": 100.01, "y": 100.01, "z": 30.01, "dir": 0, "f": 10000 }, + // 下刀 + { "x": 100.01, "y": 100.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 抬刀 + { "x": 100.01, "y": 100.01, "z": 30.01, "dir": 0, "f": 10000 } + ] + }, + { + // 一个加工项 模拟一个造型的加工 + "processItemInfo": { + "knife":{ + "knifeName": "T2" + }, + "code": "C", + "order": "KnifeMove", + "block":{ + "cutWidth":400, + "cutLength":600 + } + }, + "list": [ + // 移动到安全点 + { "x": 150.01, "y": 150.01, "z": 30.01, "dir": 0, "f": 10000 }, + // 下刀 + { "x": 150.01, "y": 150.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 走刀 + { "x": 345.01, "y": 150.01, "z": 0.01, "r": 5, "dir": 1, "f": 8000 }, + // 走刀 + { "x": 350.01, "y": 155.01, "z": 0.01, "dir": 2, "r": 5.01, "f": 8000 }, + // // 走刀 + // { "x": 350.01, "y": 150.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 走刀 + { "x": 350.01, "y": 160.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 走刀 + { "x": 150.01, "y": 160.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 走刀 + { "x": 150.01, "y": 150.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 抬刀 + { "x": 150.01, "y": 150.01, "z": 30.01, "dir": 0, "f": 10000 } + ] + }, + { + "processItemInfo": { + "code": "MARK", + "order": "Mark", + "codeParams": "// cut block" + }, + "list": [] + }, + { + "processItemInfo": { + "knife":{ + "diameter": 5 + }, + "code": "C", + "order": "KnifeMove", + "block":{ + "cutWidth":400, + "cutLength":600 + } + }, + "list": [ + // 移动到安全点 + { "x": 0.01, "y": 0.01, "z": 30.01, "dir": 0, "f": 10000 }, + // 下刀 到板面 + { "x": 0.01, "y": 0.01, "z": 18.01, "dir": 0, "f": 10000 }, + //切入 + { "x": 0.01, "y": 0.01, "z": 6.01, "dir": 1, "f": 10000 }, + // 斜线下刀 + { "x": 20.01, "y": 0.01, "z": 0.01, "dir": 1, "f": 5000 }, + // 走刀 + { "x": 380.01, "y": 0.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 弧线走刀 G2 + { "x": 400.01, "y": 30.01, "z": 0.01, "r": 20.01, "dir": 2, "f": 8000 }, + // 走刀 + { "x": 400.01, "y": 600.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 走刀 + { "x": 50.01, "y": 600.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 弧线走刀 G3 + { "x": 0.01, "y": 560.01, "z": 0.01, "r": 40.01, "dir": 3, "f": 8000 }, + // 走刀 + { "x": 0.01, "y": 0.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 斜线下刀没走的 走掉 + { "x": 20.01, "y": 0.01, "z": 0.01, "dir": 1, "f": 8000 }, + // 抬刀 + { "x": 20.01, "y": 0.01, "z": 30.01, "dir": 0, "f": 10000 } + ] + }, + { + // 程序结束 ----停刀 + 停 轴 + "processItemInfo": { + "code": "CE", + "order": "CE1" + }, + "list": [ + + ] + }, + { + // 文件尾 + "processItemInfo": { + "code": "FEND", + "order": "FEND1" + }, + "list": [ + + ] + } + ] +}` + +/** 测试数据 */ +const txtData = `FSTART\nTD 5\nG0 X100 Y100 Z10 F8000\ng0 x100 y100 z18 f8000\ng2 x120 y120 z18 R20 f8000\ng3 x100 y100 z18 i20 j0 k0 f8000\nTN T2\nFEND\n` + +function demo(){ + getDeviceList() + + setDevice() + setDeviceByName() + setDeviceByKey() +} + +/**处理JSON格式的数据 */ +async function handleJsonData() { + let parserMain = new ParserMain(); + parserMain.setDeviceByName('解析器1'); + let output = '' + let str = jsonData + let strArr = str.split('\n') + let arr = strArr.filter(e => !e.includes('//') && !e.includes('/**') || e.includes('"//')) + arr.forEach(s => { + s = s.trim() + }) + let realStr = arr.join('\n') + let dd: any = '' + try { + dd = JSON.parse(realStr) + } catch (error) { + console.error('输入的Json有误') + } + let tt = await parserMain?.getCode(dd) || '' + output += tt + console.log('handleJsonData', output) +} + +handleJsonData() + +/** 处理指令txt文本数据 */ +function handleTxtData() { + let parserMain = new ParserMain(); + parserMain.setDeviceByName('解析器1'); + let output = '' + let str = txtData + let strArr = str.split('\n') + + let code = '' + + let orderList = parserMain._device.getCodeListByOrderKeys(['FSTART', 'T', 'C', 'FEND', 'MARK']) + + const reg_G = /^[Gg](\d+\.?\d*)$/ + const reg_X = /^[Xx](\d+\.?\d*)$/ + const reg_Y = /^[Yy](\d+\.?\d*)$/ + const reg_Z = /^[Zz](\d+\.?\d*)$/ + const reg_F = /^[Ff](\d+\.?\d*)$/ + const reg_R = /^[Rr](\d+\.?\d*)$/ + const reg_I = /^[Ii](\d+\.?\d*)$/ + const reg_J = /^[Jj](\d+\.?\d*)$/ + const reg_K = /^[Kk](\d+\.?\d*)$/ + + strArr.forEach(str => { + let codeLineData = str.split(' ') + if (Object.keys(codeLineData) && codeLineData.length > 0) { + let orderKey = codeLineData[0] + let paramsValue = codeLineData[1] + let orderItem = orderList.find(e => e.order == orderKey) + + if (orderItem) { + /** */ + // console.log('orderKey', orderKey); + if (orderItem.order == 'KnifeMove') { + // let codeParams: CodeParams = { + + // } + + } else { + code += parserMain.handleCode(orderItem.code, orderItem.order, paramsValue) + } + } else { + let tempCodeParams = {} + codeLineData.forEach(e => { + if (['G0', 'G00', 'G1', 'G01', 'G2', 'G02', 'G3', 'G03', + 'g0', 'g00', 'g1', 'g01', 'g2', 'g02', 'g3', 'g03' + ].includes(e)) { + let match = e.match(reg_G) + if (match != null) { + if (match[1] == '0' || match[1] == '00') { + tempCodeParams.dir = 0 + } else if (match[1] == '1' || match[1] == '01') { + tempCodeParams.dir = 1 + } else if (match[1] == '2' || match[1] == '02') { + tempCodeParams.dir = 2 + } else if (match[1] == '3' || match[1] == '03') { + tempCodeParams.dir = 3 + } + + } + } else if (e.includes('x') || e.includes('X')) { + let match = e.match(reg_X) + if (match != null) { + tempCodeParams.x = match[1] + } + } else if (e.includes('y') || e.includes('Y')) { + let match = e.match(reg_Y) + if (match != null) { + tempCodeParams.y = match[1] + } + } else if (e.includes('z') || e.includes('Z')) { + let match = e.match(reg_Z) + if (match != null) { + tempCodeParams.z = match[1] + } + } else if (e.includes('f') || e.includes('F')) { + let match = e.match(reg_F) + if (match != null) { + tempCodeParams.f = match[1] + } + } else if (e.includes('r') || e.includes('R')) { + let match = e.match(reg_R) + if (match != null) { + tempCodeParams.r = match[1] + } + } else if (e.includes('i') || e.includes('I')) { + let match = e.match(reg_I) + if (match != null) { + tempCodeParams.i = match[1] + } + } else if (e.includes('j') || e.includes('J')) { + let match = e.match(reg_J) + if (match != null) { + tempCodeParams.j = match[1] + } + } else if (e.includes('k') || e.includes('K')) { + let match = e.match(reg_K) + if (match != null) { + tempCodeParams.k = match[1] + } + } + }) + + // console.log('tempCodeParams.dir', tempCodeParams.dir, str); + if (tempCodeParams.dir != undefined) { + let tempProcessItem = { + list: [tempCodeParams] + } + + code += parserMain.handleCode('C', 'KnifeMove', tempProcessItem) + } else { + code += str + '\n' + } + + } + } + }) + + if (parserMain._device.isUseSimpleCode == true) { + code = parserMain._device.handleSimpleCode(code) + } + output += code + console.log('handleTxtData',output) +} + +// handleTxtData() +//#region 获取解析器列表 +function getDeviceList(){ + let list = parserMain.getDeviceList() + // console.log(list) +} +//#endregion + + +//#region 设置要使用的解析器 + +function setDevice(){ + parserMain.setDevice(device1) + // console.log(parserMain._device) + +} + +function setDeviceByName(){ + parserMain.setDeviceByName('解析器2') + // console.log(parserMain._device) +} + +function setDeviceByKey(){ + parserMain.setDeviceByKey('device1') + // console.log(parserMain._device) +} +//#endregion + +//#region 设置 diff --git a/src/processParser/common/ArrayExt.ts b/src/processParser/common/ArrayExt.ts new file mode 100644 index 0000000..1fa4e41 --- /dev/null +++ b/src/processParser/common/ArrayExt.ts @@ -0,0 +1,187 @@ +/** + * 删除数组中指定的元素,返回数组本身 + * @param {Array} arr 需要操作的数组 + * @param {*} el 需要移除的元素 + */ +export function arrayRemove(arr: Array, el: T): Array +{ + let j = 0 + for (let i = 0, l = arr.length; i < l; i++) + { + if (arr[i] !== el) + { + arr[j++] = arr[i] + } + } + arr.length = j + + return arr +} + +export function arrayRemoveOnce(arr: Array, el: T): Array +{ + let index = arr.indexOf(el) + if (index !== -1) + arr.splice(index, 1) + return arr +} + +/** + * 删除通过函数校验的元素 + * @param {(e: T) => boolean} checkFuntion 校验函数 + */ +export function arrayRemoveIf(arr: Array, checkFuntion: (e: T) => boolean): Array +{ + let j = 0 + for (let i = 0, l = arr.length; i < l; i++) + { + if (!checkFuntion(arr[i])) + { + arr[j++] = arr[i] + } + } + arr.length = j + + return arr +} + +/** 获取数据第一个元素 */ +export function arrayFirst(arr: Array): T +{ + return arr[0] +} + +/** 获取数组最后一个元素 */ +export function arrayLast(arr: { [key: number]: T; length: number }): T +{ + return arr[arr.length - 1] +} + +/** + * 根据数值从小到大排序数组 + * @param {Array} arr + * @returns {Array} 返回自身 + */ +export function arraySortByNumber(arr: Array): Array +{ + arr.sort(sortNumberCompart) + return arr +} + +/** + * 对排序好的数组进行去重操作 + * @param {(e1, e2) => boolean} [checkFuction] 校验对象相等函数 + * @returns {Array} 返回自身 + */ +export function arrayRemoveDuplicateBySort(arr: Array, checkFuction: (e1: T, e2: T) => boolean = checkEqual): Array +{ + if (arr.length < 2) + return arr + let j = 1 + for (let i = 1, l = arr.length; i < l; i++) + if (!checkFuction(arr[j - 1], arr[i])) + arr[j++] = arr[i] + arr.length = j + return arr +} + +/** 原地更新数组,注意这个函数并不会比map快 */ +export function arrayMap(arr: Array, mapFunc: (v: T) => T): Array +{ + for (let i = 0, count = arr.length; i < count; i++) + arr[i] = mapFunc(arr[i]) + return arr +} + +/** 排序数比较 */ +function sortNumberCompart(e1: any, e2: any) +{ + return e1 - e2 +} + +/** 判断两个数是否相等 */ +function checkEqual(e1: any, e2: any): boolean +{ + return e1 === e2 +} + +/** + * 改变数组的值顺序 + * @param arr 需要改变初始值位置的数组 + * @param index //将index位置以后的值放到起始位置 + */ +export function changeArrayStartIndex(arr: T[], index: number): T[] +{ + arr.unshift(...arr.splice(index)) + return arr +} + +/** 判断两个数组是否相等 */ +export function equalArray(a: T[], b: T[], checkF = checkEqual) +{ + if (a === b) + return true + if (a.length !== b.length) + return false + for (let i = 0; i < a.length; ++i) + if (!checkF(a[i], b[i])) + return false + return true +} + +/** 数组克隆 */ +export function arrayClone(arr: T[]): T[] +{ + return arr.slice() +} + +/** 数组2元素合并到数组1末尾 */ +// https://jsperf.com/merge-array-implementations/30 +export function arrayPushArray(arr1: T[], arr2: T[]): T[] +{ + let arr1Length = arr1.length + let arr2Length = arr2.length + arr1.length = arr1Length + arr2Length + for (let i = 0; i < arr2Length; i++) + arr1[arr1Length + i] = arr2[i] + + return arr1 +} + +/** 数组元素求合 */ +export function arraySum(arr: number[]) +{ + let sum = 0 + for (let n of arr) sum += n + return sum +} + +/** 条件过滤集合 */ +export function FilterSet(s: Set, fn: (el: T) => boolean): Set +{ + let ns = new Set() + for (let el of s) + { + if (fn(el)) + ns.add(el) + } + return ns +} + +/** 查找数组中最大的元素 */ +export function arrayMax(arr: T[], f: (item: T) => number = a => (a as unknown as number)): [T, number] +{ + let max = Number.NEGATIVE_INFINITY + let maxIndex = -1 + for (let i = 0; i < arr.length; i++) + { + let item = arr[i] + let v = f(item) + if (v > max) + { + maxIndex = i + max = v + } + } + return [arr[maxIndex], maxIndex] +} diff --git a/src/processParser/common/Box2.ts b/src/processParser/common/Box2.ts new file mode 100644 index 0000000..2f71489 --- /dev/null +++ b/src/processParser/common/Box2.ts @@ -0,0 +1,183 @@ +import { Vector2 } from './Vector2.js' +import type { Point } from './Point.js' + +export class Box2 +{ + min: Vector2 + max: Vector2 + constructor(min = new Vector2(+Number.POSITIVE_INFINITY, +Number.POSITIVE_INFINITY), max = new Vector2(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY)) + { + this.min = min + this.max = max + } + + /** 获取面积 */ + get area(): number + { + return (this.max.x - this.min.x) * (this.max.y - this.min.y) + } + + /** */ + set(min: Vector2, max: Vector2): Box2 + { + this.min.copy(min) + this.max.copy(max) + return this + } + + setFromPoints(points: Iterable): Box2 + { + this.makeEmpty() + for (let p of points) + { + this.expandByPoint(p) + } + return this + } + + private static _setFromCenterAndSize_v1 = new Vector2() + setFromCenterAndSize(center: Vector2, size: Vector2): Box2 + { + const v1 = Box2._setFromCenterAndSize_v1 + const halfSize = v1.copy(size).multiplyScalar(0.5) + this.min.copy(center).sub(halfSize) + this.max.copy(center).add(halfSize) + return this + } + + clone(): Box2 + { + return new (this.constructor as any)().copy(this) + } + + copy(box: Box2): Box2 + { + this.min.copy(box.min) + this.max.copy(box.max) + return this + } + + makeEmpty(): Box2 + { + this.min.x = this.min.y = +Number.POSITIVE_INFINITY + this.max.x = this.max.y = Number.NEGATIVE_INFINITY + return this + } + + isEmpty(): boolean + { + // this is a more robust check for empty than (volume <= 0) because volume can get positive with two negative axes + return (this.max.x < this.min.x) || (this.max.y < this.min.y) + } + + getCenter(result: Vector2 = new Vector2()): Vector2 + { + return this.isEmpty() ? result.set(0, 0) : result.addVectors(this.min, this.max).multiplyScalar(0.5) + } + + getSize(result: Vector2 = new Vector2()): Vector2 + { + return this.isEmpty() ? result.set(0, 0) : result.subVectors(this.max, this.min) + } + + expandByPoint(point: Point): Box2 + { + this.min.min(point) + this.max.max(point) + return this + } + + expandByVector(vector: Vector2): Box2 + { + this.min.sub(vector) + this.max.add(vector) + return this + } + + expandByScalar(scalar: number): Box2 + { + this.min.addScalar(-scalar) + this.max.addScalar(scalar) + return this + } + + containsPoint(point: Vector2): boolean + { + if (point.x < this.min.x || point.x > this.max.x + || point.y < this.min.y || point.y > this.max.y) + { + return false + } + return true + } + + containsBox(box: Box2): boolean + { + if ((this.min.x <= box.min.x) && (box.max.x <= this.max.x) + && (this.min.y <= box.min.y) && (box.max.y <= this.max.y)) + { + return true + } + return false + } + + getParameter(point: Vector2, result: Vector2 = new Vector2()): Vector2 + { + // This can potentially have a divide by zero if the box + // has a size dimension of 0. + return result.set( + (point.x - this.min.x) / (this.max.x - this.min.x), + (point.y - this.min.y) / (this.max.y - this.min.y), + ) + } + + intersectsBox(box: Box2): boolean + { + // using 6 splitting planes to rule out intersections. + if (box.max.x < this.min.x || box.min.x > this.max.x + || box.max.y < this.min.y || box.min.y > this.max.y) + { + return false + } + return true + } + + clampPoint(point: Vector2, result: Vector2 = new Vector2()): Vector2 + { + return result.copy(point).clamp(this.min, this.max) + } + + private static _distanceToPoint_v1 = new Vector2() + distanceToPoint(point: Vector2): number + { + const v1 = Box2._distanceToPoint_v1 + const clampedPoint = v1.copy(point).clamp(this.min, this.max) + return clampedPoint.sub(point).length() + } + + intersect(box: Box2): Box2 + { + this.min.max(box.min) + this.max.min(box.max) + return this + } + + union(box: Box2): Box2 + { + this.min.min(box.min) + this.max.max(box.max) + return this + } + + translate(offset: Point): Box2 + { + this.min.add(offset) + this.max.add(offset) + return this + } + + equals(box: Box2): boolean + { + return box.min.equals(this.min) && box.max.equals(this.max) + } +}; diff --git a/src/processParser/common/ClipperCpp.ts b/src/processParser/common/ClipperCpp.ts new file mode 100644 index 0000000..7bb2a5f --- /dev/null +++ b/src/processParser/common/ClipperCpp.ts @@ -0,0 +1,25 @@ +import * as clipperLib from 'js-angusj-clipper/web/index.js' + +// nodejs style require + +export const clipperCpp: { lib?: clipperLib.ClipperLibWrapper } = {} +export function InitClipperCpp(): Promise +{ + if (clipperCpp.lib) + return + if (!globalThis.document) + globalThis.document = {} as any + return new Promise((res, rej) => + { + clipperLib.loadNativeClipperLibInstanceAsync( + // let it autodetect which one to use, but also available WasmOnly and AsmJsOnly + // clipperLib.NativeClipperLibRequestedFormat.WasmWithAsmJsFallback + clipperLib.NativeClipperLibRequestedFormat.WasmOnly, + ).then((c) => + { + clipperCpp.lib = c + res() + console.log('载入成功!') + }) + }) +} diff --git a/src/processParser/common/ComparePoint.ts b/src/processParser/common/ComparePoint.ts new file mode 100644 index 0000000..b701ce6 --- /dev/null +++ b/src/processParser/common/ComparePoint.ts @@ -0,0 +1,62 @@ +interface Vec2 { x: number; y: number } + +export type CompareVectorFn = (v1: Vec2, v2: Vec2) => number + +const comparePointCache: Map = new Map() + +const ALLKEY = ['x', 'X', 'y', 'Y', 'z', 'Z'] +const KEY = ['x', 'y', 'z'] + +/** + * 构建返回一个用来排序的函数.根据key创建排序规则. + * + * 当key = "xyz" 时,点集按 x从小到大,y从小到大 z从小到大 + * key = "X" 时,点集按 x从大到小 + * 以此类推. + * + * 例子: + * let pts:Vector3[] =...; + * pts.sort(comparePoint("x")); //x从小到大排序 + * pts.sort(comparePoint("zX")); //z从小到大 x从大到小 + * + * @export + * @param {string} sortKey + */ +export function ComparePoint(sortKey: string): CompareVectorFn +{ + if (comparePointCache.has(sortKey)) + return comparePointCache.get(sortKey) + + let sortIndex = [] + + for (let char of sortKey) + { + let index = ALLKEY.indexOf(char) + + let i2 = index / 2 + let ci = Math.floor(i2) + sortIndex.push([KEY[ci], i2 > ci ? 1 : -1]) + } + + let compareFunction = (v1: Vec2, v2: Vec2): number => + { + if (!v1) + return -1 + if (!v2) + return 1 + for (let s of sortIndex) + { + let vv1 = v1[s[0]] + let vv2 = v2[s[0]] + if (vv1 === vv2) + continue + if (vv2 > vv1) + return s[1] + else return -s[1] + } + return 0 + } + + comparePointCache.set(sortKey, compareFunction) + return compareFunction +} diff --git a/src/processParser/common/ConvexHull2D.ts b/src/processParser/common/ConvexHull2D.ts new file mode 100644 index 0000000..ff386d1 --- /dev/null +++ b/src/processParser/common/ConvexHull2D.ts @@ -0,0 +1,9 @@ +import convexHull from 'monotone-convex-hull-2d' +import type { Point } from './Point' + +export function ConvexHull2D(points: Point[]): Point[] +{ + let pts = points.map(p => [p.x, p.y]) + let indexs: number[] = convexHull(pts) + return indexs.map(i => points[i]) +} diff --git a/src/processParser/common/Filer.ts b/src/processParser/common/Filer.ts new file mode 100644 index 0000000..a319f18 --- /dev/null +++ b/src/processParser/common/Filer.ts @@ -0,0 +1,31 @@ +/** + * CAD文件数据 + */ +export class NestFiler +{ + private readIndex: number = 0 + constructor(public _datas: any[] = []) { } + + Clear() + { + this._datas.length = 0 + return this.Reset() + } + + Reset() + { + this.readIndex = 0 + return this + } + + Write(data: any) + { + this._datas.push(data) + return this + } + + Read(): any + { + return this._datas[this.readIndex++] + } +} diff --git a/src/processParser/common/GraphAvoidance.ts b/src/processParser/common/GraphAvoidance.ts new file mode 100644 index 0000000..8c6bc6c --- /dev/null +++ b/src/processParser/common/GraphAvoidance.ts @@ -0,0 +1,1265 @@ +import { Vector2, Vector3 } from 'three' +import { Line, Polyline } from 'cadapi' +import type { PlaceBlock } from '../vo/order/PlaceBlock' +import type { SaleBlockHole } from '../vo/model/SaleBlockHole' +import type { SaleBlockModel } from '../vo/model/SaleBlockModel' +import { Point } from '../vo/point/Point' +import { BlockPlus } from '../vo/order/BlockPlus' +import { Arc2d, CADExt } from './base/CAD' + +/** 图形类,两种图形一种异形和一种矩形 */ +class Graphy +{ + private Polyline: Polyline + + private _IsRect: boolean = undefined + /** 判断是否是盒子图形,水平竖直矩形 */ + get IsRect() + { + if (this._IsRect == undefined) + { + for (let index = 0; index < this.AllPoints.length - 1; index++) + { + const pt1 = this.AllPoints[index] + const pt2 = this.AllPoints[index + 1] + if (Math.abs(pt1.X - pt2.X) > 0.1 && Math.abs(pt1.Y - pt2.Y) > 0.1) + { + this._IsRect = false + return + } + } + for (let pt of this.AllPoints) + { + if (!this.Box.onLinePt(pt.X, pt.Y)) + { + this._IsRect = false + return + } + } + this._IsRect = true + } + + return this._IsRect + } + + private _AllPoints: CfPoint[] + /** 所有的夹点 */ + get AllPoints() + { + if (this._AllPoints == undefined) + { + this._AllPoints = [] + for (let i = 0; i < this.Polyline.LineData.length - 1; i++) + { + let prePt = this.Polyline.LineData[i] + let lastPt = this.Polyline.LineData[i + 1] + if (prePt.bul != 0) + { + let points = CADExt.getPointsFromCurve(prePt.pt.x, prePt.pt.y, lastPt.pt.x, lastPt.pt.y, prePt.bul, 2) + for (let pt of points) + { + this._AllPoints.push(new CfPoint(pt.x, pt.y)) + } + } else + { + this._AllPoints.push(new CfPoint(prePt.pt.x, prePt.pt.y)) + } + } + } + return this._AllPoints + } + + private _Box: Box + /** 外包框 盒子对象 */ + get Box() + { + if (this._Box == undefined) + { + let boud = this.Polyline.BoundingBox + this._Box = Box.createBox(new CfPoint(boud.min.x, boud.min.y), new CfPoint(boud.max.x, boud.max.y)) + } + return this._Box + } + + private constructor(pl: Polyline) + { + this.Polyline = pl + } + + /** 通过盒子创建图形 */ + public static createByBox(pBox: Box): Graphy + { + let pl: Polyline = new Polyline() + let points = pBox.get4Pt() + points.push(points[0]) + + for (let i = 0; i < points.length; i++) + { + const pt = points[i] + pl.AddVertexAt(i, new Vector2(pt.X, pt.Y)) + } + + return Graphy.createByPolyline(pl) + } + + public static createByPolyline(pl: Polyline): Graphy + { + let g = new Graphy(pl) + return g + } + + /** 判断两个图形是否相交 */ + public intersectGraphy(inGraphy: Graphy): boolean + { + if (this.Box.intersect(inGraphy.Box)) + { + let v3d = this.Polyline.IntersectWith(inGraphy.Polyline, 0) + if (v3d.length > 0) + return true + } + return false + } + + /** 判断两个图形是否相交 */ + public intersectBox(inBox: Box): boolean + { + if (this.Box.intersect(inBox)) + { + // if (this.IsRect) return true; + let gra = Graphy.createByBox(inBox) + return this.intersectGraphy(gra) + } + return false + } + + /** 判断两个图形是否覆盖 */ + public coverBox(inBox: Box): boolean + { + if (this.Box.intersect(inBox)) + { + if (this.IsRect) + return true + // 判断矩形点是否在图形内部 + let pts = inBox.get4Pt() + for (let pt of pts) + { + if (this.includesPt(pt)) + return true + } + // 判断异形点是否在矩形内部 + for (let pt of this.AllPoints) + { + if (inBox.includesPt(pt.X, pt.Y)) + return true + } + // 两个图形相交则覆盖 + let gra = Graphy.createByBox(inBox) + return this.intersectGraphy(gra) + } + + return false + } + + /** 判断点是否在轮廓内部 */ + public includesPt(pt: CfPoint): boolean + { + if (this.Box.includesPt(pt.X, pt.Y)) + { + if (this.IsRect) + return true// 矩形 + // 异形 + let v: Vector3 = new Vector3(pt.X, pt.Y) + return this.Polyline.PtInCurve(v) + } + return false + } + + /** 判断box是否在轮廓内部 */ + public includesBox(box: Box): boolean + { + if (!this.includesPt(box.minPt)) + return false + if (!this.includesPt(box.maxPt)) + return false + + return true + } + + /** 判断box是否在轮廓内部 */ + public includesGraphy(box: Graphy): boolean + { + for (let pt of box.AllPoints) + { + if (!this.includesPt(pt)) + return false + } + + return true + } + + /** 获取最近的延伸相交点 */ + public getCloseExtendIntersectPoint(pt: CfPoint): CfLine[] + { + let reLes: CfLine[] = [] + let v3d = new Vector3(pt.X, pt.Y, 0) + let closePt = this.Polyline.GetClosestPointTo(v3d, false) + let tempClosePt = new CfPoint(closePt.x, closePt.y) + + let vectors = this.intersectLine(new CfPoint(v3d.x, v3d.y), tempClosePt) + if (vectors.length < 2) + return reLes + for (let i = 0; i <= vectors.length - 2; i++) + { + // 数组里面的第一个点为最近点 + let pt1 = vectors[i] + let pt2 = vectors[i + 1] + if (tempClosePt.DistensTo(pt1) < tempClosePt.DistensTo(pt2)) + { + let le: CfLine = new CfLine(pt1, pt2) + reLes.push(le) + } else + { + let le: CfLine = new CfLine(pt2, pt1) + reLes.push(le) + } + i += 1 + } + + return reLes + } + + /** 图形相交于线返回多个点 */ + public intersectLine(sPt: CfPoint, ePt: CfPoint): CfPoint[] + { + // 此处只获取相交内部的线段 + let line = new Line(new Vector3(sPt.X, sPt.Y), new Vector3(ePt.X, ePt.Y)) + let vectors = this.Polyline.IntersectWith(line, 2) + // 相交出来的可能是个切点所以有可能会有奇数出现 + let rePoint: CfPoint[] = [] + for (let i = 0; i <= vectors.length - 2; i++) + { + let pt1 = vectors[i] + let pt2 = vectors[i + 1] + let cpt = new CfPoint((pt1.x + pt2.x) / 2, (pt1.y + pt2.y) / 2) + if (this.includesPt(cpt)) + { + rePoint.push(new CfPoint(pt1.x, pt1.y)) + rePoint.push(new CfPoint(pt2.x, pt2.y)) + i += 1 + } + } + + return rePoint + } +} + +/** 标签盒子类 */ +export class NoteBox +{ + private _Pt: CfPoint + private _W: number + private _L: number + /** 中点 */ + get CenterPt() { return this._Pt } + /** 宽 */ + get W() { return this._W } + /** 长 */ + get L() { return this._L } + + private _box: Box + /** 外包框 矩形 */ + get Box() + { + if (this._box == undefined) + { + let minPt = new CfPoint(this._Pt.X - this.W / 2, this._Pt.Y - this.L / 2) + let maxPt = new CfPoint(this._Pt.X + this.W / 2, this._Pt.Y + this.L / 2) + this._box = Box.createBox(minPt, maxPt) + } + return this._box + } + + constructor(pt: CfPoint, w: number, l: number) + { + this._Pt = pt + this._W = w + this._L = l + } + + /** 判断是否包含点位 */ + public getIncludesPoints(points: CfPoint[]): CfPoint[] + { + let reArrPt: CfPoint[] = [] + for (let pt of points) + { + if (this.Box.includesPt(pt.X, pt.Y)) + reArrPt.push(pt) + } + return reArrPt + } + + /** 判断是否包含点位 */ + public includesPoints(points: CfPoint[]): boolean + { + for (let pt of points) + { + if (this.Box.includesPt(pt.X, pt.Y)) + return true + } + return false + } + + /** 移动盒子对象 */ + public moveBox(pt: CfPoint) + { + if (pt.X < 0) + { + let T = 0 + } + this._Pt = pt + this._box = undefined + } +} + +class CfLine +{ + private _Pt1: CfPoint + private _Pt2: CfPoint + + get StartPt() + { + return this._Pt1 + } + + get EndPt() + { + return this._Pt2 + } + + public constructor(pt1: CfPoint, pt2: CfPoint) + { + if (pt1 == undefined) + { + let jj = 0 + } + this._Pt1 = pt1 + this._Pt2 = pt2 + } + + get Length() { return this._Pt1.DistensTo(this._Pt2) } + + getCenterPt() + { + return this.StartPt.extendPoint(this.EndPt, this.Length / 2) + } + + /** 排序 */ + public innerOrderPoints(points: CfPoint[]): CfPoint[] + { + let rePoint: CfPoint[] = [] + rePoint.push(this.StartPt) + while (points.length > 0) + { + let index = 0 + let minLen: number = Number.MAX_VALUE + for (let i = 0; i < points.length; i++) + { + const element = points[i] + let len = this.StartPt.DistensTo(element) + if (minLen > len) + { + index = i + minLen = len + break + } + } + rePoint.push(points[index]) + points.splice(index, 1) + } + + rePoint.push(this.EndPt) + return rePoint + } + + /** 旋转线 */ + public rotate(centerPt: CfPoint, ang: number): CfLine + { + let pt1 = this.StartPt.Rotate(centerPt, ang) + let pt2 = this.EndPt.Rotate(centerPt, ang) + return new CfLine(pt1, pt2) + } +} + +/** 点 */ +class CfPoint +{ + public X = 0 + public Y = 0 + + get length() + { + return Math.sqrt(this.X * this.X + this.Y * this.Y) + } + + constructor(x: number, y: number) + { + this.X = x + this.Y = y + } + + /** 延伸一个点 */ + public extendPoint(pt: CfPoint, length: number): CfPoint + { + let vert1 = this.Subtract(pt).Normal() + let tempPt = vert1.Multiply(length) + return this.Add(tempPt) + } + + /** 延伸一个点 */ + public extendVector(vector: CfPoint, length: number): CfPoint + { + let vert1 = vector.Normal() + let tempPt = vert1.Multiply(length) + return this.Add(tempPt) + } + + public Add(p1: CfPoint): CfPoint + { + return new CfPoint(p1.X + this.X, p1.Y + this.Y) + } + + /** otherPt - 本身 */ + public Subtract(otherPt: CfPoint): CfPoint + { + return new CfPoint(otherPt.X - this.X, otherPt.Y - this.Y) + } + + public DistensTo(pt: CfPoint): number + { + let tempX = pt.X - this.X + let tempy = pt.Y - this.Y + let len = Math.sqrt(tempX * tempX + tempy * tempy) + return len + } + + public Normal(): CfPoint + { + let k = 1 / this.length + return new CfPoint(this.X * k, this.Y * k) + } + + public Multiply(c: number): CfPoint + { + return new CfPoint(this.X * c, this.Y * c) + } + + public Rotate(centerPt: CfPoint, ang: number): CfPoint + { + let thisPt = new Vector2(this.X, this.Y) + let vert1 = new Vector2(centerPt.X, centerPt.Y) + let tempPt = thisPt.rotateAround(vert1, ang) + return new CfPoint(tempPt.x, tempPt.y) + } +} + +/** 图形碰撞类 */ +export class GraphAvoidance +{ + private Block: PlaceBlock + // 标签的宽 + private NoteW: number + // 标签的长 + private NoteL: number + // 小板外轮廓图形对象 + private BlockGraph: Graphy + // 造型数组对象 + private ModelesGraph: Graphy[] = [] + + public static debugId: string = '' + + constructor(b: PlaceBlock, w: number, l: number) + { + this.Block = b + this.NoteW = w + this.NoteL = l + let points = this.getBorderPoints(b) + let pl: Polyline = new Polyline() + for (let i = 0; i < points.length; i++) + { + const pt = points[i] + pl.AddVertexAt(i, new Vector2(pt.X, pt.Y)) + } + this.BlockGraph = Graphy.createByPolyline(pl) + } + + /** 获取自动标签的计算点位 */ + public getAutoPrintNotePoint(isFaceB: boolean = false, avoidHole: boolean = true): NoteBox + { + let centerPt = this.BlockGraph.Box.getCenterPt() + let nodeBox: NoteBox = new NoteBox(centerPt, this.NoteW, this.NoteL) + if (nodeBox.L > this.BlockGraph.Box.L - 2 && nodeBox.W > this.BlockGraph.Box.W - 2) + return nodeBox + + // 获取图形数据 + + let boxs: Graphy[] = [] + if (avoidHole) + { + // 初始化模型和造型数据 + boxs = this.initModelAndHole(isFaceB) + } + + // 判断是否可以循环打印 + if (this.canWhilePrintNote(nodeBox, boxs)) + { + // 是否对齐居中点位 + this.isAlignCenterNote(nodeBox, boxs) + return nodeBox + } else + { + // 获取无法找到打印点的节点 + return this.getNoPrintNotePoint(boxs) + } + } + + /** 大多数情况为板很小的时候调用 */ + private getNoPrintNotePoint(boxs: Graphy[]): NoteBox + { + if (this.BlockGraph.IsRect && this.ModelesGraph.length == 0 && boxs.length == 0)// 矩形无法找到是就贴中间 + { + let centerPt = this.BlockGraph.Box.getCenterPt() + return new NoteBox(centerPt, this.NoteW, this.NoteL) + } else // 异形需要找点位 + { + let tempPt = this.lookUpPoint(boxs) + if (tempPt != undefined) + return new NoteBox(tempPt, this.NoteW, this.NoteL) + } + return undefined + } + + /** 寻找点位 */ + private lookUpPoint(boxs: Graphy[]): CfPoint + { + let centerPt = this.BlockGraph.Box.getCenterPt() + let note = new NoteBox(centerPt, this.NoteW, this.NoteL) + let val: number = 2 + let maxLen = Math.max(this.BlockGraph.Box.L, this.BlockGraph.Box.W) / 2 + // 偏移寻找 + while (true) + { + if (val >= maxLen) + break + let tempLes: CfLine[] = getArrayCurve(centerPt, val) + val += 2 + let ArrLine: CfLine[] = [] + for (let le of tempLes) + { + let line = this.lookUpLine(le.StartPt, le.EndPt) + if (line == undefined) + continue + note.moveBox(line.getCenterPt()) + if (this.isPrintNote(note, boxs, [], false)) + { + ArrLine.push(line) + } + } + if (ArrLine.length == 0) + continue + let tempLe = ArrLine.sort((a, b) => b.Length - a.Length)[0] + return tempLe.getCenterPt() + } + + // 对角寻找不管哪种只要相交的都算 + let points = this.BlockGraph.Box.get4Pt() + let upPt = new CfPoint(centerPt.X, centerPt.Y + 100) + let leftPt = new CfPoint(centerPt.X + 100, centerPt.Y) + let ArrLine: CfLine[] = [] + let le = this.lookUpLine(centerPt, upPt) + if (le != undefined) + ArrLine.push(le) + le = this.lookUpLine(centerPt, leftPt) + if (le != undefined) + ArrLine.push(le) + le = this.lookUpLine(points[0], points[2]) + if (le != undefined) + ArrLine.push(le) + le = this.lookUpLine(points[1], points[3]) + if (le != undefined) + ArrLine.push(le) + + // 获取长度最大的线 + let tempLe = ArrLine.sort((a, b) => b.Length - a.Length)[0] + if (tempLe == undefined) + return centerPt + return tempLe.getCenterPt() + + function getArrayCurve(centerPt: CfPoint, val: number): CfLine[] + { + let tempLes: CfLine[] = [] + tempLes.push(new CfLine(new CfPoint(centerPt.X - val, centerPt.Y + 100), new CfPoint(centerPt.X - val, centerPt.Y))) + tempLes.push(new CfLine(new CfPoint(centerPt.X + val, centerPt.Y + 100), new CfPoint(centerPt.X + val, centerPt.Y))) + + tempLes.push(new CfLine(new CfPoint(centerPt.X + 100, centerPt.Y + val), new CfPoint(centerPt.X, centerPt.Y + val))) + tempLes.push(new CfLine(new CfPoint(centerPt.X + 100, centerPt.Y - val), new CfPoint(centerPt.X, centerPt.Y - val))) + + return tempLes + } + } + + /** 寻找最长的线 */ + private lookUpLine(pt1: CfPoint, pt2: CfPoint): CfLine + { + let profileGrapy = this.BlockGraph + let arrPt = profileGrapy.intersectLine(pt1, pt2) + if (arrPt.length < 2) + return undefined + let tempLine = new CfLine(arrPt[0], arrPt[1]) + + let rePoints: CfPoint[] = [] + for (let g of this.ModelesGraph) + { + let temps = g.intersectLine(pt1, pt2) + if (temps.length > 1 && temps.length % 2 == 0) + { + temps.forEach(t => rePoints.push(t)) + } + } + let points = tempLine.innerOrderPoints(rePoints) + + let ArrLine: CfLine[] = [] + for (let i = 0; i <= points.length - 2; i++) + { + AddLine(points[i], points[i + 1]) + i += 1 + } + + // 获取长度最大的线 + let tempLe = ArrLine.sort((a, b) => b.Length - a.Length)[0] + return tempLe + + function AddLine(pt1: CfPoint, pt2: CfPoint) + { + let le1 = new CfLine(pt1, pt2) + ArrLine.push(le1) + } + } + + /** 是否对齐居中点位 */ + private isAlignCenterNote(nodeBox: NoteBox, graphys: Graphy[]) + { + if (this.BlockGraph.IsRect) + return// 矩形不做判断 + let cPt = nodeBox.CenterPt + // 获取最近点的延伸相交的两个点 + let les = this.BlockGraph.getCloseExtendIntersectPoint(cPt) + if (les.length == 0) + return + for (let le of les) + { + if (le.StartPt.DistensTo(cPt) > this.NoteL * 2) + continue + if (le.Length < this.NoteL * 1.5) + continue // 距离过小的不做判断 + let tempLe = le.rotate(le.getCenterPt(), Math.PI / 2) + let points = this.BlockGraph.intersectLine(tempLe.StartPt, tempLe.EndPt) + for (let i = 0; i <= points.length - 2; i++) + { + let le4 = new CfLine(points[i], points[i + 1]) + nodeBox.moveBox(le4.getCenterPt()) + if (this.isPrintNote(nodeBox, graphys, [])) + return + } + } + + for (let le of les) + { + if (le.StartPt.DistensTo(cPt) > this.NoteL * 2) + continue + if (le.Length < this.NoteL * 1.5) + continue // 距离过小的不做判断 + nodeBox.moveBox(le.getCenterPt()) + if (this.isPrintNote(nodeBox, graphys, [])) + return + } + + nodeBox.moveBox(cPt)// 将点位还原 + } + + /** 初始化模型和造型数据 */ + private initModelAndHole(isFaceB: boolean): Graphy[] + { + let boxs: Graphy[] = [] + let mGs = this.ModelesGraph + + if (this.Block.IsScrapBlock) + return boxs + let holes = this.getHoles(this.Block, isFaceB)// BlockHelper.GetHoles_DoFace(this.Block, isFaceB); + for (let h of holes)// 孔数据 + { + let pt: CfPoint = new CfPoint(h.PointX, h.PointY) + let pBox = Box.createBoxByPoint(pt, h.Radius) + boxs.push(Graphy.createByBox(pBox)) + } + + // 造型数据 + let models = this.getModels(this.Block, isFaceB)// BlockHelper.GetModels_DoFace(this.Block, isFaceB); + let vms: SaleBlockModel[] = [] + for (let model of models) + { + if (model.isVKnifeModel) { + vms.push(model) + continue + } + if (model.HasContour)// 普通造型 + { + let pts = model.OriginModeling.outline.pts + let buls = model.OriginModeling.outline.buls + let pl: Polyline = new Polyline() + for (let i = 0; i < pts.length; i++) + { + let v = new Vector2(pts[i].x, pts[i].y) + pl.AddVertexAt(i, v) + pl.SetBulgeAt(i, buls[i]) + } + Add(Graphy.createByPolyline(pl)) + } else + { + let pl: Polyline = new Polyline() + for (let i = 0; i < model.PointList.length; i++) + { + let theP = model.PointList[i] + let v = new Vector2(theP.PointX, theP.PointY) + pl.AddVertexAt(i, v) + pl.SetBulgeAt(i, theP.Curve) + } + Add(Graphy.createByPolyline(pl)) + } + } + // 二维刀路 + // let vms = BlockHelper.getVModels(this.Block); + for (let vm of vms) + { + // if (models.includes(vm.model) == false) continue; + for (let vl of vm.VLines) { + let points = vl.points + // 普通造型 + for (let i = 0; i < points.length - 1; i++) + { + let prevP = points[i] + let theP = points[i + 1] + let pl: Polyline = this.getOffsetPolyline(prevP, theP, vl.knifeRadius, vl.knifeRadius) + let tempG = Graphy.createByPolyline(pl) + Add(tempG) + } + } + } + + return boxs + + function Add(g: Graphy) + { + if (g.Box.L < 50 && g.Box.W < 50) + { + boxs.push(g) + } else + { + for (let i = 0; i < mGs.length; i++) + { + let tempG = mGs[i] + if (tempG.includesGraphy(g)) + return + if (g.includesGraphy(tempG)) + { + mGs[i] = g + return + } + } + mGs.push(g) + } + } + } + + /** 循环移动此节点判断是否可以打印 */ + private canWhilePrintNote(nodeBox: NoteBox, graphys: Graphy[]): boolean + { + let firstBox: Graphy[] = [] + // 第一次判断 + if (this.isPrintNote(nodeBox, graphys, firstBox)) + return true + // return true; + // 外轮廓循环寻找 + let filterBox: Box = nodeBox.Box + if (firstBox.length > 0) + { + filterBox = Box.createBoxByBoxs(firstBox) + } + // 循环 + while (true) + { + let reBoxs: Graphy[] = [] + if (this.canMovePrintNote(nodeBox, graphys, filterBox, reBoxs)) + return true + if (reBoxs.length == 0) + { + if (filterBox.W >= this.Block.PlaceWidth && filterBox.L >= this.Block.PlaceLength) + break + // filterBox.extendBox(nodeBox.W, nodeBox.L); + filterBox.extendBox(1, 1) + continue + } + let tempBox = Box.createBoxByBoxs(reBoxs) + filterBox.AddBox(tempBox) + } + + // 通过造型边界判断 + if (this.ModelesGraph.length > 0) + { + for (let g of this.ModelesGraph) + { + let cpt: CfPoint = g.Box.getCenterPt() + nodeBox.moveBox(cpt) + filterBox = g.Box + if (this.canMovePrintNote(nodeBox, graphys, filterBox, [])) + return true + } + } + + // 通过圆孔边界寻找 + if (graphys.length > 0) + { + for (let g of firstBox) + { + let cpt: CfPoint = g.Box.getCenterPt() + nodeBox.moveBox(cpt) + filterBox = g.Box + if (this.canMovePrintNote(nodeBox, graphys, filterBox, [])) + return true + } + + for (let g of graphys) + { + let cpt: CfPoint = g.Box.getCenterPt() + nodeBox.moveBox(cpt) + filterBox = g.Box + if (this.canMovePrintNote(nodeBox, graphys, filterBox, [])) + return true + } + } + // + + return false + } + + /** 此节点移动完之后是否可以打印 */ + private canMovePrintNote(nodeBox: NoteBox, rects: Graphy[], filterBox: Box, reBoxs: Graphy[]): boolean + { + let tempPts = this.getFilterPoint(this.Block, nodeBox, filterBox) + for (let pt of tempPts) + { + let cpt = filterBox.getCenterPt() + let len = cpt.DistensTo(pt) + let newPt = cpt.extendPoint(pt, len + nodeBox.W / 2) + if (!GraphAvoidance.checkPoint(this.Block, newPt.X, newPt.Y)) + continue + nodeBox.moveBox(newPt) + if (this.isPrintNote(nodeBox, rects, reBoxs)) + { + reBoxs.length = 0// 清空数组 + return true + } + } + return false + } + + /** 标签是否可以打印 */ + private isPrintNote(nodeBox: NoteBox, rects: Graphy[], reBox: Graphy[], breakProfile = true): boolean + { + if (this.isNodeInProfile(nodeBox, breakProfile)) + { + let arrPt = this.getIntersectBox(nodeBox, rects) + if (arrPt.length == 0) + return true + arrPt.forEach(t => reBox.push(t)) + } + return false + } + + /** 判断点是否在轮廓内部 */ + private isNodeInProfile(nodeBox: NoteBox, breakProfile = true): boolean + { + if (breakProfile) + { + if (!this.BlockGraph.includesBox(nodeBox.Box)) + return false// 不包含盒子 + if (this.BlockGraph.intersectBox(nodeBox.Box)) + return false// 盒子和图形相交 + } + + // 造型是否相交于造型 + if (this.ModelesGraph.length > 0) + { + for (let m of this.ModelesGraph) + { + if (m.coverBox(nodeBox.Box)) + { + let jj = 0 + return false + } + } + } + return true + } + + /** 获取过滤的点数据 */ + private getFilterPoint(b: PlaceBlock, nodeBox: NoteBox, box: Box): CfPoint[] + { + let cpt = box.getCenterPt()// 盒子的中点 + let arrPt: CfPoint[] = [] + let xlen = box.W / 2 + nodeBox.W / 2 + let ylen = box.L / 2 + nodeBox.L / 2 + pushPoint(cpt.X + xlen, cpt.Y)// 添加右侧点 + pushPoint(cpt.X - xlen, cpt.Y)// 添加左侧点 + if (box.L > nodeBox.L) + { + addPointx(nodeBox, box, xlen) + addPointx(nodeBox, box, -xlen) + } + + pushPoint(cpt.X, cpt.Y + ylen)// 添加上部点 + pushPoint(cpt.X, cpt.Y - ylen)// 添加下部点 + if (box.W > nodeBox.W) + { + addPointy(nodeBox, box, ylen) + addPointy(nodeBox, box, -ylen) + } + if (box.W < nodeBox.W || box.L < nodeBox.L) + { + let arrPt = box.get4Pt() + pushDiagonalPoint(arrPt[0], arrPt[2])// 斜右上 + pushDiagonalPoint(arrPt[2], arrPt[0]) + pushDiagonalPoint(arrPt[1], arrPt[3]) + pushDiagonalPoint(arrPt[3], arrPt[1]) + } + return arrPt + + function addPointx(nodeBox: NoteBox, box: Box, xlen: number) + { + let cpt = box.getCenterPt()// 盒子的中点 + let count = Math.ceil(box.L / nodeBox.L) + let numLen: number = nodeBox.L + for (let i = 1; i < count; i++) + { + pushPoint(cpt.X + xlen, cpt.Y + numLen)// 添加左右侧点 + numLen = -numLen + if (numLen > 0) + { + numLen = numLen + nodeBox.L + } + } + } + function addPointy(nodeBox: NoteBox, box: Box, ylen: number) + { + let count = Math.ceil(box.W / nodeBox.W) + let numLen: number = nodeBox.W + for (let i = 1; i < count; i++) + { + pushPoint(cpt.X + numLen, cpt.Y + ylen)// 添加上下点 + numLen = -numLen + if (numLen > 0) + { + numLen = numLen + nodeBox.W + } + } + } + + function pushDiagonalPoint(sPt: CfPoint, ePt: CfPoint) + { + let len = nodeBox.Box.getDiagonalLength() / 2 + box.getDiagonalLength() + let pt = sPt.extendPoint(ePt, len) + pushPoint(pt.X, pt.Y) + } + function pushPoint(x: number, y: number) + { + if (!GraphAvoidance.checkPoint(b, x, y)) + return + arrPt.push(new CfPoint(x, y))// 添加上部点 + } + } + + /** 获取造型数据 */ + private getModels(block: PlaceBlock, isFaceB: boolean): SaleBlockModel[] + { + let modelsT = block.Models_OrgTrhough.slice() + if (isFaceB) + { + let modelsB = (block.IsTurnOver ? block.Models_OrgFaceA.slice() : block.Models_OrgFaceB.slice()) + modelsT = modelsT.concat(modelsB) + } else + { + let modelsA = (block.IsTurnOver ? block.Models_OrgFaceB.slice() : block.Models_OrgFaceA.slice()) + modelsT = modelsT.concat(modelsA) + } + return modelsT + } + + /** 获取孔数据 */ + private getHoles(block: PlaceBlock, isFaceB: boolean): SaleBlockHole[] + { + let HolesT = block.Holes_OrgThrough.slice() + if (isFaceB) + { + let holesB = (block.IsTurnOver ? block.Holes_OrgFaceA : block.Holes_OrgFaceB) + HolesT = HolesT.concat(holesB) + } else + { + let holesA = (block.IsTurnOver ? block.Holes_OrgFaceB : block.Holes_OrgFaceA) + HolesT = HolesT.concat(holesA) + } + return HolesT + } + + /** 获取偏移轮廓 */ + private getOffsetPolyline(prevP, theP, leftDis: number, rightDis: number): Polyline + { + let pl: Polyline = new Polyline() + let vpt1 = new Vector2(prevP.x, prevP.y) + let vpt2 = new Vector2(theP.x, theP.y) + pl.AddVertexAt(0, vpt1) + pl.AddVertexAt(1, vpt2) + pl.SetBulgeAt(0, prevP.bul) + + let temppls = pl.GetOffsetCurves(leftDis)[0] + let temppls2 = pl.GetOffsetCurves(-rightDis)[0] + + temppls2.AddVertexAt(2, temppls.GetPoint2dAt(1)) + temppls2.AddVertexAt(3, temppls.GetPoint2dAt(0)) + temppls2.SetBulgeAt(2, -temppls.GetBulgeAt(0)) + temppls2.AddVertexAt(4, temppls2.GetPoint2dAt(0)) + return temppls2 + } + + /** */ + private static checkPoint(Block: PlaceBlock, x: number, y: number): boolean + { + if (x < 0 || y < 0) + return false + if (Block.Width < x || Block.Length < y) + return false + return true + } + + /** 判断是否包含点位 */ + private getIntersectBox(nodeBox: NoteBox, graphys: Graphy[]): Graphy[] + { + let reArrPt: Graphy[] = [] + for (let grapy of graphys) + { + if (grapy.coverBox(nodeBox.Box)) + reArrPt.push(grapy) + } + return reArrPt + } + + /** 获得边框点阵 (弧形拆封3段直线) */ + private getBorderPoints(block: PlaceBlock): Point[] + { + let points: Point[] = [] + if (block.IsScrapBlock) + { + let ps = block.ScrapPoints + for (let pt of ps) + { + points.push(new Point(pt.x, pt.y)) + } + // 闭合 + points.push(new Point(points[0].X, points[0].Y)) + } else + { + let curves = BlockPlus.getOrgBorder(block, false)// BlockHelper.GetBorder_Org(block); + let borderPoints = curves + for (let i = 0; i < borderPoints.length; i++) + { + let p0 = borderPoints[i] + // 如果是圆弧,拆开3段 + if (p0 instanceof Arc2d) + { + let arc = p0// new Arc2d(new Point2d(p0.PointX, p0.PointY), new Point2d(p1.PointX, p1.PointY), p0.Curve); + let arcs = CADExt.SplitArc(arc, 4) + for (let L of arcs) + { + points.push(new Point(L.StartPoint.m_X, L.StartPoint.m_Y)) + } + } + else // 直线 + { + points.push(new Point(p0.StartPoint.m_X, p0.StartPoint.m_Y)) + } + } + + // 闭合 + points.push(new Point(points[0].X, points[0].Y)) + } + + return points + } +} + +class Box +{ + public readonly minPt: CfPoint + public readonly maxPt: CfPoint + + get W() { return this.maxPt.X - this.minPt.X } + + get L() { return this.maxPt.Y - this.minPt.Y } + + private constructor() + { + this.minPt = new CfPoint(Number.MAX_VALUE, Number.MAX_VALUE) + this.maxPt = new CfPoint(Number.MIN_VALUE, Number.MIN_VALUE) + } + + /** 通过点数组创建盒子 */ + public static createBox(minPt: CfPoint, maxPt: CfPoint): Box + { + let rect: Box = new Box() + rect.minPt.X = minPt.X + rect.minPt.Y = minPt.Y + rect.maxPt.X = maxPt.X + rect.maxPt.Y = maxPt.Y + return rect + } + + /** 通过点数组创建盒子 */ + public static createBoxByBoxs(minPt: Graphy[]): Box + { + let rect: Box = new Box() + for (let pBox of minPt) + { + rect.AddBox(pBox.Box) + } + return rect + } + + /** 通过点数组创建盒子 */ + public static createBoxByPoints(points: CfPoint[]): Box + { + let rect: Box = new Box() + for (let pt of points) + { + rect.AddPoint(pt) + } + return rect + } + + /** 通过点数组创建盒子 */ + public static createBoxByPoint(point: CfPoint, extentVal: number): Box + { + let rect: Box = new Box() + rect.minPt.X = point.X - extentVal + rect.minPt.Y = point.Y - extentVal + rect.maxPt.X = point.X + extentVal + rect.maxPt.Y = point.Y + extentVal + return rect + } + + public getDiagonalLength(): number + { + return this.minPt.DistensTo(this.maxPt) + } + + /** 获取中点 */ + public getCenterPt(): CfPoint + { + return this.maxPt.Add(this.minPt).Multiply(0.5) + } + + //* * 获取4个点 左下,右下,右上,左上 */ + public get4Pt(): CfPoint[] + { + let rePoints: CfPoint[] = [] + rePoints.push(new CfPoint(this.minPt.X, this.minPt.Y)) + rePoints.push(new CfPoint(this.maxPt.X, this.minPt.Y)) + rePoints.push(new CfPoint(this.maxPt.X, this.maxPt.Y)) + rePoints.push(new CfPoint(this.minPt.X, this.maxPt.Y)) + + return rePoints + } + + /** 扩大和延伸盒子 */ + private AddPoint(pt: CfPoint) + { + if (pt.X < this.minPt.X) + this.minPt.X = pt.X + if (pt.X > this.maxPt.X) + this.maxPt.X = pt.X + if (pt.Y < this.minPt.Y) + this.minPt.Y = pt.Y + if (pt.Y > this.maxPt.Y) + this.maxPt.Y = pt.Y + } + + /** 扩大和延伸盒子 */ + public AddBox(pBox: Box) + { + this.AddPoint(pBox.minPt) + this.AddPoint(pBox.maxPt) + } + + public extendBox(valw: number, vall: number) + { + this.minPt.X = this.minPt.X - valw + this.maxPt.X = this.maxPt.X + valw + this.minPt.Y = this.minPt.Y - vall + this.maxPt.Y = this.maxPt.Y + vall + } + + /** 判断是否包含点位 */ + public includesPt(x: number, y: number): boolean + { + if (x + 0.1 > this.minPt.X && x - 0.1 < this.maxPt.X) + { + if (y + 0.1 > this.minPt.Y && y - 0.1 < this.maxPt.Y) + { + return true + } + } + return false + } + + /** 判断是否包含点位 */ + public onLinePt(x: number, y: number): boolean + { + let miny = this.minPt.Y - 0.1 + let maxy = this.maxPt.Y + 0.1 + if (Math.abs(this.minPt.X - x) < 0.1 && (y > miny && y < maxy)) + return true + if (Math.abs(this.maxPt.X - x) < 0.1 && (y > miny && y < maxy)) + return true + + let minx = this.minPt.X - 0.1 + let maxx = this.maxPt.X + 0.1 + if (Math.abs(this.minPt.Y - y) < 0.1 && (x > minx && x < maxx)) + return true + if (Math.abs(this.maxPt.Y - y) < 0.1 && (x > minx && x < maxx)) + return true + } + + /** 判断是否相交 */ + public intersect(box: Box): boolean + { + let tempMinPt = box.minPt + let tempMaxPt = box.maxPt + if (tempMinPt.X + 0.1 > this.maxPt.X) + return false + if (tempMinPt.Y + 0.1 > this.maxPt.Y) + return false + if (tempMaxPt.X + 0.1 < this.minPt.X) + return false + if (tempMaxPt.Y + 0.1 < this.minPt.Y) + return false + + return true + } +} diff --git a/src/processParser/common/LayoutEngine/Curves2Parts.ts b/src/processParser/common/LayoutEngine/Curves2Parts.ts new file mode 100644 index 0000000..5fe9ad5 --- /dev/null +++ b/src/processParser/common/LayoutEngine/Curves2Parts.ts @@ -0,0 +1,255 @@ +import type { PolylineProps } from 'cadapi' +import { Circle, Polyline, Polyline2Points } from 'cadapi' +import { EndType, JoinType } from 'js-angusj-clipper/web' +import type { Box3, Vector3 } from 'three' +import { Vector2 } from 'three' +import { clipperCpp } from '../ClipperCpp' +import type { Point } from '../Point' +import { Path, PathScale } from '../core/Path' +import type { IOffset } from './Simplify2' +import { SimplifyDouglasPeucker } from './Simplify2' + +/** 内外接多边形 */ +export function Circle2Points(circle: Circle, knifRadius: number, splitSize = 10, outside = false): Point[] { + let radius = circle.Radius + const an = Math.PI * 2 / splitSize + + if (outside) + radius = radius / Math.cos(an / 2) + knifRadius + else + radius -= knifRadius + + const cenP = circle.Center + const pts: Vector3[] = [] + for (let i = 0; i < splitSize; i++) + pts.push(polar(cenP.clone(), an * i, radius)) + + return pts as Point[] +} + +export function Curve2Path(curve: Polyline, outside = false): Path { + if (curve.IsClockWise) + curve.Reverse() + const w = new CurveWrap(curve, 3, outside) + return new Path(outside ? w.GetOutsidePoints() : w.GetInsidePoints()) +} + +export class CurveWrap { + BoundingBox: Box3 + + Area: number + + SimplyPolyline: Polyline + SimplyOffset: IOffset + Used = false + Holes: CurveWrap[] = [] + + Points: Point[] + + constructor(public Curve: Polyline | Circle, public KnifRadius: number, public IsOutside: boolean) { + this.BoundingBox = Curve.BoundingBox + + if (Curve instanceof Polyline) { + const pts = Polyline2Points(Curve, IsOutside, 0)[1] + /** + * 精简算法SimplifyDouglasPeucker 会导致轮廓变大, + * 修改成直接取点 陈雄 QQ聊天记录 23.9.18 + * 23.10.9 by lrx + */ + + const [spts, offset] = SimplifyDouglasPeucker(pts, KnifRadius ** 2 + KnifRadius) + if (spts.length !== pts.length && spts.length > 2) { + this.SimplyOffset = offset + + this.SimplyPolyline = Path2Polyline(spts) + this.Curve = this.SimplyPolyline// 保险起见,也更新它 + this.Area = this.SimplyPolyline.Area + } + else// 此处更新多段线 + { this.Curve = Path2Polyline(pts) } + this.Points = spts + + // 以下修改后的 + // this.Curve = Path2Polyline(pts); + // this.Points = pts; + } + + if (this.Area === undefined) + this.Area = this.Curve.Area + } + + ContainsCurve(curve: CurveWrap): boolean { + if (this.SimplyPolyline) + return this.SimplyPolyline.PtInCurve(curve.Curve.StartPoint) + return this.Curve.PtInCurve(curve.Curve.StartPoint) + } + + GetOutsidePoints(): Point[] { + if (this.Curve instanceof Circle) { + const pts = Circle2Points(this.Curve, this.KnifRadius, 10, true) + return pts + } + else { + const pl = this.SimplyPolyline || this.Curve + let offset = this.KnifRadius + if (this.SimplyOffset) + offset += this.SimplyOffset.positiveOffset + + if (offset > 0) { + let pts = pl.GetStretchPoints() as Point[] + pts = clipperCpp.lib.offsetToPaths({ + delta: offset * 1e4, + offsetInputs: [{ data: PathScale(pts, 1e4), joinType: JoinType.Miter, endType: EndType.ClosedPolygon }], + })[0] + try { + PathScale(pts, 1e-4) + } + catch { + console.log('err') + } + return pts + } + else { return this.Points } + } + } + + GetInsidePoints(): Point[] { + return this.GetInsidePoints2(this.KnifRadius) + } + + GetInsidePoints2(d: number): Point[] { + if (this.Curve instanceof Circle) { + const pts = Circle2Points(this.Curve, d, 10, false) + return pts + } + else { + const pl = this.SimplyPolyline || this.Curve + let offset = -d + if (this.SimplyOffset) + offset += this.SimplyOffset.negativeOffset + + if (offset < -0.01) { + const pls = pl.GetOffsetCurves(offset) + if (pls.length) + return pls[0].GetStretchPoints() + } + else { return this.Points } + } + } + + /** 引入Polyline 已经含刀半径, 获得精简后的点阵 */ + GetOrgPoints(outside = true): Point[] { + if (this.Curve instanceof Circle) { + const pts = Circle2Points(this.Curve, 0, 10, outside) + return pts + } + else { + const pl = this.SimplyPolyline || this.Curve + let offset = 0 + if (this.SimplyOffset) + offset += this.SimplyOffset.positiveOffset + + if (offset > 0) { + let pts = pl.GetStretchPoints() as Point[] + pts = clipperCpp.lib.offsetToPaths({ + delta: offset * 1e4, + offsetInputs: [{ data: PathScale(pts, 1e4), joinType: JoinType.Miter, endType: EndType.ClosedPolygon }], + })[0] + try { + PathScale(pts, 1e-4) + } + catch { + console.log('err') + } + return pts + } + else { + return this.Points + } + } + } +} + +/** 多段线 转点整 已弃用,整合到CAD api 23.11.2 */ +// export function Polylin2Points(pl: Polyline, outside: boolean, knifRadius: number): [Polyline, Point[]] +// { +// let pts: Point[] = []; + +// if (!outside) knifRadius = -knifRadius; +// if (pl.IsClockWise) pl.Reverse(); +// for (let i = 0; i < pl.EndParam; i++) +// { +// pts.push(pl.GetPointAtParam(i)); + +// let bul = pl.GetBulgeAt(i); +// if (bul !== 0) +// { +// let arc = pl.GetCurveAtIndex(i) as Arc; + +// let allAngle = arc.AllAngle; +// let arcLength = arc.Length; + +// // let splitCount = Math.round(allAngle / 0.4); +// // if (arcLength < 300) +// // splitCount = 2; +// // else +// // splitCount = Math.max(arcLength / 200, splitCount,2); + +// let minCount = Math.floor(allAngle * 4 / Math.PI); +// let splitCount = Math.round(allAngle / 0.4); +// if (arcLength < 300) +// splitCount = Math.max(2, minCount); +// else +// splitCount = Math.max(Math.floor(arcLength / 200), splitCount,2, minCount); + +// let radius = arc.Radius; +// if (outside === bul > 0) +// radius = radius / Math.cos(allAngle / (splitCount * 2)); + +// let cp = arc.Center; +// for (let j = outside ? 0.5 : 0; j < splitCount; j++) +// { +// let a = arc.GetAngleAtParam(j * (1 / splitCount)); +// let p = polar(cp.clone(), a, radius); +// pts.push(p); +// } +// } +// } + +// if (knifRadius !== 0) +// { +// pts = clipperCpp.lib.offsetToPaths({ +// delta: knifRadius * 1e4, +// offsetInputs: [{ data: PathScale(pts, 1e4), joinType: JoinType.Miter, endType: EndType.ClosedPolygon }] +// })[0]; +// PathScale(pts, 1e-4); +// } +// return [pl, pts]; +// } + +export function Path2Polyline(path: Point[]): Polyline { + const pl = new Polyline() + pl.LineData = path.map((p) => { + return { pt: new Vector2(p.x, p.y), bul: 0 } + }) + pl.CloseMark = true + return pl +} + +export function Points2Polyline(pts: any[]): Polyline { + const lined: PolylineProps[] = [] + const count = pts.length + for (let i = 0; i < count; i++) { + const p0 = pts[i] + lined.push({ pt: new Vector2(p0.x, p0.y), bul: p0.bul }) + } + const pls = new Polyline(lined) + pls.CloseMark = true + return pls +} + +export function polar(v: T, an: number, dis: number): T { + v.x += Math.cos(an) * dis + v.y += Math.sin(an) * dis + return v +} diff --git a/src/processParser/common/LayoutEngine/LayoutEngine.ts b/src/processParser/common/LayoutEngine/LayoutEngine.ts new file mode 100644 index 0000000..4a5c987 --- /dev/null +++ b/src/processParser/common/LayoutEngine/LayoutEngine.ts @@ -0,0 +1,655 @@ +// import { Polyline } from "cadapi"; +// import { InstancedBufferAttribute, Matrix4, Vector3 } from "three"; +import type { Circle, Polyline } from 'cadapi' +import type { TextureType } from '../../vo/enums/TextureType' + +// import { PaiKongType, PlaceStyle } from '../../Base/Enum' +import { ComposingType } from '../../algorithm/optimize/bang' +import { PlaceStyle } from '../../vo/enums/PlaceStyle' + +// import Worker from "worker-loader!../Nest/Core/OptimizeWorker.worker"; +// import type { PlaceBlock } from '../../Models/Orders' +import type { PlaceBlock } from '../../vo/order/PlaceBlock' + +// import { BlockPlaceResult } from '../Places' +import { BlockPlaceResult, BoardPlaceResult, MaterialPlaceResult } from '../../vo/order/Places' +import { Box2 } from '../Box2' +import { InitClipperCpp } from '../ClipperCpp' +import { NestFiler } from '../Filer' + +import { Vector2 } from '../Vector2' +import { Individual } from '../core/Individual' +import { NestCache } from '../core/NestCache' +import { NestDatabase } from '../core/NestDatabase' +import { OptimizeMachine } from '../core/OptimizeMachine' +import { Part } from '../core/Part' +import { Path } from '../core/Path' +import { PathGeneratorSingle } from '../core/PathGenerator' +import type { PlaceOrderTask } from '../../vo/order/PlaceOrderTask' +import { ScrapBoardHelper } from '../../vo/order/ScrapBoardHelper' + +import { removeRepeatPoint } from '../base/MathComm' +import { BlockPlus } from '../../vo/order/BlockPlus' +import { BlockSizePlus } from '../../vo/order/BlockSizePlus' + +// import type { RemainBoard } from '@/Source/Models/ScrapBorad' +import type { RemainBoard } from '../../vo/remain/RemainBoard' +import { CurveWrap, Points2Polyline } from './Curves2Parts' +import { PolylineHelper } from './PolylineHelper' +import { PlaceStore } from '@/imes/vo/order/PlaceStore' + +export class LayoutEngine { + pmID: number + border: number + cutDia: number + cutGap: number + boardW: number + boardL: number + scrapBoards: RemainBoard[] = [] + blocks = [] + blockNos = [] + task: PlaceOrderTask // 回掉函数 + filterBlockToPlace = false // 是否锁定板不优化 + + isLastBoard = false // 最后一片 重新优化 + + parts: Part[] = [] + board: Path + threads: Worker[] = [] + result: Individual + placeResult: MaterialPlaceResult + + db: NestDatabase + comparePointKeys: string[] + + offset = 0 + + /** 启用王者优化的最小缺角大小 */ + unregularSizeLimit = 15000 + + constructor(obj) { + console.log('优化算法 线程 初始化') + this.pmID = obj.pmID + this.cutDia = obj.cutDia + this.cutGap = obj.cutGap + this.border = obj.border + this.boardW = obj.boardW + this.boardL = obj.boardL + this.scrapBoards = obj.scrapBoards + this.blocks = obj.blocks + for (const block of obj.blocks) + this.blockNos[block.blockNo] = block + + this.task = obj.task + this.filterBlockToPlace = obj.filterBlock + this.isLastBoard = obj.isLastBoard + // 清理缓存,这个缓存是全局的 + PathGeneratorSingle.Clear() + NestCache.Clear() + + this.offset = (this.cutDia + this.cutGap) / 2 // 间隔 (刀直径 + 1) + const binWidth = this.boardW - this.border * 2 + this.cutDia + this.cutGap + const binLength = this.boardL - this.border * 2 + this.cutDia + this.cutGap + + // 注册bin + const binPath = new Path([{ x: 0, y: 0 }, { x: binWidth, y: 0 }, { x: binWidth, y: binLength }, { x: 0, y: binLength }]) + binPath.Id = undefined + PathGeneratorSingle.RegisterId(binPath) + this.board = binPath + + // this.setLocator(3) + // this.setLocator(0) // 左下 + this.setLocator(PlaceStore.sysConfig.boardLocation) + // + // this.unregularSizeLimit = PlaceStore.sysConfig.UnregularSizeLimit + } + + setLocator(p: number) { + const gravityDict = { + 0: ['xy', 'yx'], // 左下 0 + 1: ['Xy', 'yX'], // 右下 1 + 3: ['xY', 'Yx'], // 左上 3 + 2: ['XY', 'YX'], // 右上 2 + } + + this.comparePointKeys = gravityDict[p.toString()] + } + + async startThread() { + // 初始化 板件 + await InitClipperCpp() + + // 确保 前余料板 placedPolyline 都生成 + const oddpaths = [] + for (const RemainBoard of this.scrapBoards) { + const curve = ScrapBoardHelper.getPlacedPolyline(RemainBoard) + curve.CloseMark = true + const warp = new CurveWrap(curve, 3.5, false) + const pts = warp.GetInsidePoints() + // let pts = warp.Points; + const path = new Path(pts) + const path_0 = PathGeneratorSingle.Allocate(path)// 获得唯一path + PathGeneratorSingle.RegisterId(path_0)// 注册id + oddpaths.push(path_0) + RemainBoard.isUsed = false + } + + // 生产parts + this.parts = [] + let autoID = 0 + + for (const block of this.blocks) { + const part = this.toPart(block, this.offset, this.board, autoID) + this.parts.push(part) + autoID++ + } + + if (this.parts.length == 0) + return// 没有板 + + // 创建 NestDatabase + this.db = new NestDatabase() + this.db.Paths = PathGeneratorSingle.paths + this.db.Parts = this.parts + this.db.Bin = this.board + this.db.OddmentsBins = oddpaths + this.db.ComparePointKeys = this.comparePointKeys + + const searchParams = new URLSearchParams(location.search) + if (searchParams.has('single')) { + const m = new OptimizeMachine() + m.Bin = this.db.Bin + m.PutParts(this.db.Parts) + + await InitClipperCpp() + let best = Number.POSITIVE_INFINITY + m.callBack = async (inv) => { + if (inv.Fitness >= best) + return + best = inv.Fitness + this.result = inv + this.ToPlaceResult() + this.task.receiverResult(this.pmID, this.placeResult, true, this.filterBlockToPlace, this.isLastBoard) + const text = `single 板材${this.pmID} 发现更优 优化率:${inv.Fitness}` + console.log(text) + } + await m.Start() + } + else { + const f = new NestFiler() + this.db.WriteFile(f)// 写入到文件中 + console.log('优化数据 db=', JSON.stringify(f._datas)) + + let best = Number.POSITIVE_INFINITY + + const t = new Worker(new URL('../Nest/Core/OptimizeWorker.worker')) + this.threads = [t] + + // 加载 + // let rtStr = `[1,17.97496389719577,18,-1,0,null,8,35,0,{"x":0,"y":0},199,0,{"x":7758777,"y":0},0,0,{"x":7475524,"y":21084400},50,0,{"x":11500677,"y":0},40,0,{"x":9458109,"y":18660200},113,0,{"x":5750492,"y":0},117,0,{"x":10011472,"y":5185300},38,0,{"x":5944846,"y":22234200},[0,0],[1210.0677,2441.02],-1,0,null,6,130,0,{"x":0,"y":0},12,0,{"x":7190000,"y":0},16,0,{"x":0,"y":20050000},184,0,{"x":4550000,"y":20050000},77,0,{"x":11739999,"y":0},26,0,{"x":7100000,"y":22541717},[0,0],[1215.9999,2428.2203000000004],-1,0,null,8,136,0,{"x":0,"y":0},157,0,{"x":0,"y":13050000},95,0,{"x":8990000,"y":13050000},65,0,{"x":9490000,"y":0},43,0,{"x":10650000,"y":0},14,0,{"x":0,"y":21500000},6,0,{"x":4550000,"y":21500000},186,0,{"x":9100000,"y":20740000},[0,0],[1218,2440.55],-1,0,null,5,129,0,{"x":0,"y":0},142,0,{"x":6050000,"y":0},84,0,{"x":0,"y":20050000},18,0,{"x":3550000,"y":20050000},85,0,{"x":8100000,"y":20050000},[0,0],[1210,2410],-1,0,null,8,152,0,{"x":0,"y":0},107,0,{"x":7910000,"y":0},169,0,{"x":0,"y":13010000},9,0,{"x":0,"y":20450200},8,0,{"x":4550000,"y":21050000},42,0,{"x":11460000,"y":0},46,0,{"x":11460000,"y":11540000},118,0,{"x":9100000,"y":21050000},[0,0],[1212,2431],-1,0,null,7,150,0,{"x":0,"y":0},80,0,{"x":7590000,"y":0},161,0,{"x":0,"y":13050000},92,0,{"x":8043800,"y":12823400},88,0,{"x":0,"y":20130200},11,0,{"x":3550000,"y":20633400},89,0,{"x":8100000,"y":20633400},[0,0],[1218.2,2432.34],-1,0,null,6,151,0,{"x":0,"y":0},137,0,{"x":6050000,"y":0},131,0,{"x":0,"y":13050000},134,0,{"x":5870000,"y":13050000},179,0,{"x":0,"y":22540000},90,0,{"x":7080200,"y":22540000},[0,0],[1210,2441],-1,0,null,10,149,0,{"x":0,"y":0},99,0,{"x":6050000,"y":0},133,0,{"x":0,"y":13050000},49,0,{"x":9600000,"y":0},78,0,{"x":9600000,"y":18211700},110,0,{"x":5870000,"y":21050000},47,0,{"x":10770000,"y":0},67,0,{"x":10770000,"y":6390800},86,0,{"x":0,"y":22540000},36,0,{"x":10770000,"y":14365800},[0,0],[1212,2441],-1,0,null,7,167,0,{"x":0,"y":0},166,0,{"x":0,"y":7440200},165,0,{"x":0,"y":14880400},15,0,{"x":7583800,"y":0},5,0,{"x":7583800,"y":10186100},10,0,{"x":7583800,"y":19770800},174,1,{"x":0,"y":22725699},[0,0],[1213.38,2377.5699],-1,0,null,7,159,0,{"x":0,"y":0},168,0,{"x":0,"y":7440200},153,0,{"x":0,"y":14880400},132,0,{"x":5870000,"y":14880400},1,0,{"x":7583800,"y":0},7,0,{"x":7583800,"y":9703200},21,0,{"x":7583800,"y":12596100},[0,0],[1213.38,2437.04],-1,0,null,6,155,0,{"x":0,"y":0},144,0,{"x":0,"y":8990000},158,0,{"x":0,"y":15680000},146,0,{"x":5870000,"y":0},156,0,{"x":6050000,"y":15680000},66,0,{"x":7510000,"y":7590000},[0,0],[1210,2413],-1,0,null,7,154,0,{"x":0,"y":0},143,0,{"x":0,"y":8990000},147,0,{"x":0,"y":15680000},138,0,{"x":5690000,"y":0},148,0,{"x":5870000,"y":15680000},79,0,{"x":7510000,"y":6979700},175,1,{"x":0,"y":23269999},[0,0],[1212.2,2431.9999000000003],-1,0,null,10,145,0,{"x":0,"y":0},162,0,{"x":0,"y":6690000},164,0,{"x":0,"y":12360767},163,0,{"x":0,"y":18031534},102,0,{"x":8583823,"y":0},108,0,{"x":8583823,"y":7690000},100,0,{"x":8583823,"y":15380000},54,0,{"x":7080200,"y":18031534},64,0,{"x":7510000,"y":0},45,0,{"x":0,"y":9495020},[0,0],[1213.3823,2370.2334],-1,0,null,12,128,0,{"x":0,"y":0},127,0,{"x":5870000,"y":0},125,0,{"x":0,"y":7190000},126,0,{"x":5870000,"y":7190000},33,0,{"x":0,"y":14380000},17,0,{"x":6763794,"y":14380000},29,0,{"x":6217041,"y":21866700},111,0,{"x":0,"y":20483549},96,0,{"x":11313794,"y":14380000},114,0,{"x":0,"y":14380000},74,0,{"x":1870000,"y":21945626},58,0,{"x":10767041,"y":22070000},[0,0],[1216.3794,2436.9826000000003],-1,0,null,14,139,0,{"x":0,"y":0},20,0,{"x":0,"y":6827900},19,0,{"x":0,"y":13520636},34,0,{"x":4758655,"y":9382427},93,0,{"x":6050000,"y":0},140,1,{"x":2885031,"y":17262709},28,0,{"x":0,"y":21968505},31,0,{"x":4550000,"y":21968505},48,0,{"x":11522449,"y":0},98,0,{"x":9890000,"y":0},60,0,{"x":9100000,"y":21968505},71,0,{"x":0,"y":19880476},56,0,{"x":9859631,"y":17510524},70,0,{"x":6546965,"y":7810000},[0,0],[1221.02,2439.5305],-1,0,null,18,94,0,{"x":0,"y":0},97,0,{"x":3840000,"y":0},104,1,{"x":7389466,"y":0},83,0,{"x":3840000,"y":7690000},203,0,{"x":0,"y":7810000},187,0,{"x":6600789,"y":10070000},207,0,{"x":0,"y":12995300},191,0,{"x":6893409,"y":15255300},185,0,{"x":0,"y":18180600},44,0,{"x":3651900,"y":18360000},25,0,{"x":6007900,"y":20440600},115,0,{"x":10342689,"y":10070000},57,0,{"x":10449767,"y":0},69,0,{"x":10449767,"y":4788400},72,0,{"x":10635309,"y":13910000},170,0,{"x":6007900,"y":23108600},119,0,{"x":10635309,"y":18698400},52,0,{"x":6092844,"y":7690000},[0,0],[1220.2689,2415.86],-1,0,null,20,211,0,{"x":0,"y":0},195,0,{"x":0,"y":5185300},181,0,{"x":0,"y":10370600},189,0,{"x":0,"y":15555900},201,0,{"x":3651900,"y":10370600},197,0,{"x":3651900,"y":15555900},193,0,{"x":3741900,"y":0},205,0,{"x":7303800,"y":5185300},209,0,{"x":7303800,"y":10370600},3,0,{"x":7303800,"y":15555900},4,0,{"x":7303800,"y":18223900},23,0,{"x":7393800,"y":0},27,0,{"x":0,"y":20741200},24,0,{"x":4550000,"y":20891900},30,0,{"x":7393800,"y":2668000},106,0,{"x":3741900,"y":5185300},160,0,{"x":10955700,"y":5094800},101,0,{"x":3741900,"y":8235300},37,0,{"x":9100000,"y":20891900},41,0,{"x":10955700,"y":12175000},[0,0],[1212.5700000000002,2355.9900000000002],-1,0,null,31,32,0,{"x":0,"y":0},180,0,{"x":4550000,"y":0},188,0,{"x":7100000,"y":0},182,0,{"x":9650000,"y":0},192,0,{"x":0,"y":2426800},202,0,{"x":2550000,"y":3665500},196,0,{"x":5100000,"y":3665500},190,0,{"x":7650000,"y":3665500},204,0,{"x":0,"y":7331000},194,0,{"x":2550000,"y":7331000},206,0,{"x":5100000,"y":7331000},198,0,{"x":7650000,"y":7331000},200,0,{"x":0,"y":10996500},177,0,{"x":2550000,"y":10996472},208,0,{"x":2550000,"y":13039047},210,0,{"x":5100000,"y":13039047},176,0,{"x":372132,"y":15464478},178,0,{"x":0,"y":17508377},171,0,{"x":0,"y":18558377},173,0,{"x":0,"y":19608377},39,0,{"x":10200000,"y":3665500},62,0,{"x":9862132,"y":13039047},172,1,{"x":5755530,"y":20193826},59,0,{"x":7650000,"y":13039047},76,0,{"x":8990000,"y":17511047},123,0,{"x":0,"y":20658376},51,0,{"x":10200000,"y":8137500},61,0,{"x":1450000,"y":20658377},75,0,{"x":2800000,"y":20658377},73,0,{"x":4150000,"y":20658377},68,0,{"x":5500000,"y":21243826},[0,0],[1220,2381.8376000000003],9,35,0,{"isVector2":true,"x":15.451070343735374,"y":16.34651510924327},8,135,0,{"x":0,"y":3925185},91,0,{"x":6050000,"y":8809129},183,0,{"x":0,"y":16975185},109,0,{"x":3741900,"y":16975185},124,0,{"x":262661,"y":665185},63,0,{"x":6050000,"y":6171301},116,0,{"x":2552661,"y":950420},55,0,{"x":7291900,"y":16619129},[0,66.5185],[989,2216.0485],152,0,{"isVector2":true,"x":62,"y":62.000000000000455},2,141,0,{"x":0,"y":0},13,0,{"x":0,"y":9850000},[0,0],[605,1129.43],144,0,{"isVector2":true,"x":186.6426800426124,"y":52.339509444329806},1,87,0,{"x":26544,"y":20434},[2.6544000000000003,2.0434],[357.6544,371.0434],143,0,{"isVector2":true,"x":186.6426800426124,"y":52.33950944432935},1,103,0,{"x":17062,"y":612763},[1.7062000000000002,61.276300000000006],[356.7062,366.2763],145,0,{"isVector2":true,"x":186.6423965090944,"y":52.33842250129328},2,105,0,{"x":0,"y":67071},53,0,{"x":873022,"y":3117071},[0,6.7071000000000005],[355,518.1271],33,0,{"isVector2":true,"x":29.647527772751403,"y":23.9973798061884},3,112,0,{"x":1794315,"y":1823511},81,0,{"x":3664315,"y":4144613},82,0,{"x":3664315,"y":694573},[179.4315,69.4573],[537.4315,659.4612999999999],20,0,{"isVector2":true,"x":20.50979557910309,"y":20.50979557910042},1,2,0,{"x":401639,"y":1617035},[40.163900000000005,161.70350000000002],[495.1639,444.9735],19,0,{"isVector2":true,"x":20.50979557910418,"y":20.50979557910332},1,22,0,{"x":346614,"y":1699385},[34.6614,169.9385],[489.6614,436.73850000000004],34,0,{"isVector2":true,"x":29.647527772751403,"y":23.9973798061884},3,121,0,{"x":1794315,"y":1823511},120,0,{"x":3654315,"y":686471},122,0,{"x":3654315,"y":4257856},[179.4315,68.64710000000001],[510.4315,680.7856],0]`; + // let data = JSON.parse(rtStr); + // let f1 = new NestFiler(data); + // let inv = new Individual(this.db.Parts); + // inv.ReadFile(f1); + // best = inv.Fitness; + // this.result = inv; + // this.ToPlaceResult(); + // this.parent.receiverResult(this.pmID, this.placeResult, true); + t.onmessage = (e) => { + const f = new NestFiler(e.data) + console.log('优化结果 e.data=', JSON.stringify(e.data)) + + const inv = new Individual(this.db.Parts) + inv.ReadFile(f) + if (best <= inv.Fitness) + return + best = inv.Fitness + this.result = inv + this.ToPlaceResult() + this.task.receiverResult(this.pmID, this.placeResult, true, this.filterBlockToPlace, this.isLastBoard) + + const text = `板材${this.pmID} 王者优化发现更优 优化率:${inv.Fitness}` + console.log(text) + } + t.postMessage(f._datas)// Post给Worker + } + } + + stopThread() { + if (this.threads.length == 0) + return + this.threads[0].terminate() + const text = `板材${this.pmID} 新优化停止 最优优化率:${this.result ? this.result.Fitness : 0}` + console.log(text) + this.threads = [] + } + + Rotations = [ + [0, Math.PI], // 正文 + [0, Math.PI / 2, Math.PI, Math.PI * 1.5], // 可翻转 + [Math.PI / 2, Math.PI * 1.5], // 反纹 + ] + + private toPart(block: PlaceBlock, offset: number, binPath: Path, id: number): Part { + // if (block.blockNo == '2311001545897') + // + const part = new Part() + part.Id = id + + const isYX = block.isUnRegular // 是否异形 + const wave = block.texture + let face = block.isTurnFaceToPlace ? ComposingType.Reverse : ComposingType.Positive + if (this.task.needTurnFaceToPlace) + face = block.isTurnFaceToPlace ? ComposingType.Positive : ComposingType.Reverse + + const do2Face = block.isTwoFaceToPlace + + part.UserData = { bno: block.blockNo, size: block.area, isYX, wave, face, do2Face, width: block.cutWidth, length: block.cutLength } + + let path: Path + // 小板开料轮廓 + const border = BlockPlus.getBorder(block, true, face == ComposingType.Positive ? PlaceStyle.FRONT : PlaceStyle.BACK) + let polyLine: Polyline | Circle + polyLine = PolylineHelper.createByCurve2d(border, true) + polyLine = PolylineHelper.mergeCurve(polyLine) + // 偏移 = 同刀辅助 + 刀半径 + 缝隙/2 + offset = block.blockDetail.useSameKnifeToHelpCutGap + block.placeMaterial.diameter / 2 + block.placeMaterial.cutKnifeGap / 2 + const cureW = new CurveWrap(polyLine, offset, true) + let pts2 = cureW.GetOutsidePoints() + // 确保pts2 不重复 + removeRepeatPoint(pts2, 0.01) + const pl_models = BlockPlus.getOutModelPloyline(block, true, face == ComposingType.Positive ? PlaceStyle.FRONT : PlaceStyle.BACK) + if (pl_models.length > 0) { + // 对外扩 造型 精简 + const new_pls = [] + for (const pl of pl_models) { + const cureW = new CurveWrap(pl, block.placeMaterial.diameter / 2 + block.placeMaterial.cutKnifeGap / 2, true) + const pts = cureW.GetOrgPoints() + removeRepeatPoint(pts, 0.01) + const pl_nw = PolylineHelper.create(pts, true) + new_pls.push(pl_nw) + } + + const pl0 = PolylineHelper.create(pts2, true) + const pl_full = BlockPlus.unionPolylines(pl0, new_pls) + + pts2 = pl_full.LineData.map((t) => { return { x: t.pt.x, y: t.pt.y } }) + } + // 确保pts2 不重复 + removeRepeatPoint(pts2, 0.01) + path = new Path(pts2) + + // if(block.blockNo == '2311691815099') + // { + + // const plstr = PolylineHelper.getStrPLs([polyLine]); + // ; + // } + + // 判断是否 扩大了尺寸 + const orgSize = { w: polyLine.BoundingBox.max.x - polyLine.BoundingBox.min.x, l: polyLine.BoundingBox.max.y - polyLine.BoundingBox.min.y } + const newSize = { w: path.BoundingBox.max.x - path.BoundingBox.min.x, l: path.BoundingBox.max.y - path.BoundingBox.min.y } + // if( newSize.w > orgSize.w + 0.2 || newSize.l > orgSize.l + 0.2) + // { + // const plstr = PolylineHelper.getStrPLs([polyLine]); + // console.log (`小板轮廓精简后变大:宽${orgSize.w} +${newSize.w - orgSize.w} 宽${orgSize.l} +${newSize.l - orgSize.l}`); + // ; + // } + + const area = path.BoundingBox.area - path.Area + if (pl_models.length == 0 && area < this.unregularSizeLimit && pts2.length >= 6) // 没有外扩 , 缺角小,当做矩形来处理 + { + const minX = polyLine.BoundingBox.min.x - offset + const maxX = polyLine.BoundingBox.max.x + offset + const minY = polyLine.BoundingBox.min.y - offset + const maxY = polyLine.BoundingBox.max.y + offset + path = new Path([ + { x: minX, y: minY }, + { x: maxX, y: minY }, + { x: maxX, y: maxY }, + { x: minX, y: maxY }, + ]) + } + + part.Init2(path, binPath, this.Rotations[wave as number]) + + // if (!path.IsRect && part.RotatedStates.length == 0) //放不下,不简化路径 + // { + // const cureW2 = new CurveWrap(polyLine, 0, true); + // cureW2.KnifRadius = offset; + // const pts23 = cureW2.GetOutsidePoints(); + // arrayRemoveDuplicateBySort(pts23, (p1, p2) => this.equalv2(p1, p2, 1e-2)); + // // path = new Path(cureW.Points); + // path = new Path(pts23); + // part.Init2(path, binPath, this.Rotations[wave as number]); + // } + + // // 添加造型洞 + // let modelHoles = BlockPlus.getModelHole(block,true,PlaceStyle.FRONT); + // if(block.IsTurnFaceToPlace) modelHoles =BlockPlus.getModelHole(block,true,PlaceStyle.BACK); + // for(const mHole of modelHoles) + // { + // let polyLine : Polyline|Circle ; + // polyLine = PolylineHelper.createByCurve2d(mHole,true); + // //合并圆弧 + // polyLine = PolylineHelper.mergeCurve(polyLine); + + // const cureW = new CurveWrap(polyLine, 0, false); + // const pts = cureW.GetOrgPoints(); + // //确保pts2 不重复 + // removeRepeatPoint(pts2,0.01); + // if(pts2) + // { + // const pps = new Path(pts2); + // if (pps.Area > 15000) + // part.AppendHole(pps); + // } + + // } + + // 造型孔 + for (const m of block.models) { + if (m.depth < block.thickness - 0.05) + continue + if (m.IsDo == false) + continue + if (!m.HasContour) + continue + if (m.OriginModeling.outline.pts.length != m.OriginModeling.outline.buls.length) + continue + let pts = m.OriginModeling.outline.pts.map((t) => { return { x: t.x, y: t.y, bul: 0 } }) + const buls = m.OriginModeling.outline.buls + for (let i = 0; i < pts.length; i++) + pts[i].bul = buls[i] + + // 如果反面,翻转方向,重设坐标 + if (face == ComposingType.Reverse) + pts = this.reversePoint(pts, block.CuttingWidth) + + let polyLine + polyLine = Points2Polyline(pts) + const cicle = PolylineHelper.ConverPolyLin2Circle(polyLine) + if (cicle) + polyLine = cicle + let off = m.RealKnifeRadius + this.cutGap / 2 // Math.max(m.RealKnifeRadius, this.cutDia / 2) + this.cutGap / 2; + if (m.RealKnifeRadius < this.cutDia / 2) { + // 如果造型刀 小于开料刀, 孔洞 按 开料刀 半径来分析 + off = this.cutDia / 2 + this.cutGap / 2 + } + if (m.RealKnifeRadius > this.cutDia / 2) { + // 如果造型刀 大于 开料刀, 孔洞 按 造型刀 直径 - 开料刀的半径 来分析 + off = m.RealKnifeRadius + m.RealKnifeRadius - this.cutDia / 2 + this.cutGap / 2 + } + const cureW2 = new CurveWrap(polyLine, off, false) + const pts2 = cureW2.GetInsidePoints2(off) + + if (pts2) { + const pps = new Path(pts2) + if (pps.Area > 15000) + part.AppendHole(pps) + } + } + + return part + } + + equalv2(v1, v2, fuzz) { + return Math.abs(v1.x - v2.x) < fuzz && Math.abs(v1.y - v2.y) < fuzz + } + + private ToPlaceResult() { + if (this.result == null) + return + + for (const part of this.parts) { + part.Parent = null + part.HolePosition = null + } + + if (Number.isNaN(this.result.Fitness)) + this.result.Fitness = 0 + const retData = new MaterialPlaceResult() + + let boardCount = 0 + let remainCount = 0 + const offv = this.border - this.cutDia / 2 - this.cutGap / 2 + // const offv = 0.01; + for (let i = 0; i < this.result.OddmentsContainers.length + this.result.Containers.length; i++) { + const isOddment = i < this.result.OddmentsContainers.length + const cn = isOddment ? this.result.OddmentsContainers[i] : this.result.Containers[i - this.result.OddmentsContainers.length] + + if (cn.PlacedParts.length == 0) + continue + boardCount++ + const boardResult = new BoardPlaceResult() + boardResult.boardId = boardCount + if (isOddment) { + boardResult.isRemainBoard = true + boardResult.isScrap = true + const oddBoard = this.scrapBoards[i] + boardResult.width = oddBoard.width + boardResult.length = oddBoard.length + boardResult.remainId = oddBoard.id + boardResult.remainNo = oddBoard.id.toString() + remainCount++ + } + + let pid = 0 + // 零件内 + for (const part of cn.PlacedParts as Part[]) { + // if (part.UserData.bno == '2311001545897') + // + pid++ + const br = this.CreateBlockPlaceResult(part, offv, boardCount, pid) + part.UserData.br = br + boardResult.blocks.push(br) + boardResult.area += part.UserData.size + } + retData.boards.push(boardResult) + } + + // 空洞里头的板信息 + const placeResults: BlockPlaceResult[] = [] + + // 计算网洞的位置信息 + for (const hole of this.result.HoleContainers) { + if (!hole.ParentM) + console.log(hole) + + for (const part of hole.PlacedParts) { + part.Parent = this.parts[hole.ParentId] + // 在这里我们求得这个网洞的左下角相对于父零件的左下角的移动距离 + part.HolePosition = { ...hole.ParentM } + part.HolePosition.x -= part.Parent.State.MinPoint.x + part.HolePosition.y -= part.Parent.State.MinPoint.y + // console.log(`block: ${part.UserData.bno} parent block:${part.Parent.UserData.bno}`); + } + } + + // 放置网洞内的板 + for (const hole of this.result.HoleContainers) { + for (const part of hole.PlacedParts) { + let p = { ...part.PlacePosition } // part在hole中的放置位置 + + p.x += part.HolePosition.x * 1e4 // + hole的在parent中的位置 + p.y += part.HolePosition.y * 1e4 + + let parent = part.Parent + let boardId: number + + console.log(`block: ${part.UserData.bno}`) + + while (parent) { + if (parent.HolePosition) { + p.x += parent.HolePosition.x * 1e4 + p.y += parent.HolePosition.y * 1e4 + } + + p.x += parent.PlacePosition.x + p.y += parent.PlacePosition.y + + boardId = parent.UserData?.br?.BoardID + // console.log(`find parent block: ${parent.UserData.bno} boardID = ${boardId}`); + parent = parent.Parent + } + + // console.log(p); + + [part.PlacePosition, p] = [p, part.PlacePosition] + const br = this.CreateBlockPlaceResult(part, offv, 0, 0) + br.BoardID = boardId; + [part.PlacePosition, p] = [p, part.PlacePosition] + + // console.log(br.PlaceX, br.PlaceY); + + part.UserData.br = br + // part.UserData.Parent = this.parts[hole.ParentId]; + // part.Parent = this.parts[hole.ParentId]; + placeResults.push(br) + } + } + + // placeResults 归并到 retData.boards 中 + + for (const br of placeResults) { + const board = retData.boards[br.BoardID - 1] + board.Blocks.push(br) + br.PlaceID = board.Blocks.length + board.area += br.size + } + + retData.threadID = 0 + retData.usedTime = 0 + retData.placeCount = 0 + + // 计算优化率 + retData.boardCount = boardCount - remainCount // 大板数 + retData.boardCount_remain = remainCount // 余料板数 + let size_all = 0 // 所有大板上的小板面积 + let size_last = 0// 最后一张大板的小板面积 + retData.boards.forEach(t => size_all += (t.IsOddment ? 0 : t.area)) + size_last = retData.boardCount > 0 ? retData.boards[retData.boards.length - 1].area : 0 + + if (retData.boardCount <= 1) // 大板数 + { + retData.useSize_avg = size_last + retData.useSize_noLast = 0 + retData.useSize_last = size_last + } + else { + retData.useSize_avg = size_all / (retData.boardCount) + retData.useSize_noLast = (size_all - size_last) / (retData.boardCount - 1) + retData.useSize_last = size_last + } + + this.placeResult = retData + } + + // 根据Part的PlacePosition来创建一个BlockPlaceResult + private CreateBlockPlaceResult(part: Part, offv: number, bid: number, pid: number): BlockPlaceResult { + const w = part.UserData.width + const h = part.UserData.length + + const c = Math.cos(part.State.Rotation) + const s = Math.sin(part.State.Rotation) + + const RotatePoint = (p: Vector2) => { + const [x, y] = [p.x, p.y] + p.x = x * c - y * s + p.y = x * s + y * c + } + + const pts = [ + new Vector2(), + new Vector2(w, 0), + new Vector2(0, h), + new Vector2(w, h), + ] + + for (const p of pts) { + // Move + p.x -= part.State.OrigionMinPoint.x + p.y -= part.State.OrigionMinPoint.y + + // Rotate + RotatePoint(p) + } + + const box = new Box2().setFromPoints(pts) + const min = box.min + + let px = part.PlacePosition.x / 1e4 + min.x + offv + let py = part.PlacePosition.y / 1e4 + min.y + offv + const [rw, rl, pl] = this.getPlaceStyle(part) + const block = this.blockNos[part.UserData.bno] + if (block) { + const sizeOff = BlockSizePlus.getOffDis(block, pl) + px = px - sizeOff.left + py = py - sizeOff.bottom + } + const size = part.UserData.size + const br = new BlockPlaceResult(part.UserData.bno, bid, pid, px, py, rw, rl, pl, size) + return br + } + + /** 获得放置方式 */ + private getPlaceStyle(part: Part): [number, number, PlaceStyle] { + const ratation = part.State.Rotation + const isYX = part.UserData.isYX + const wave = part.UserData.texture as TextureType + const face = part.UserData.face as PaiKongType + let width = part.UserData.length + let length = part.UserData.width + + if (ratation == 0 || ratation == Math.PI) + [width, length] = [length, width] + + if (face == ComposingType.Positive) { + if (ratation == 0) + return [width, length, PlaceStyle.FRONT] + if (ratation == Math.PI / 2) + return [width, length, PlaceStyle.FRONT左转] + if (ratation == Math.PI) + return [width, length, PlaceStyle.FRONT后转] + return [width, length, PlaceStyle.FRONT右转] + } + else // ComposingType.Reverse + { + if (ratation == 0) + return [width, length, PlaceStyle.BACK] + if (ratation == Math.PI / 2) + return [width, length, PlaceStyle.BACK左转] + if (ratation == Math.PI) + return [width, length, PlaceStyle.BACK后转] + return [width, length, PlaceStyle.BACK右转] + } + } + + private polar(v, an: number, dis: number): any { + v.x += Math.cos(an) * dis + v.y += Math.sin(an) * dis + return v + } + + private PathScale(pts, scale: number) { + for (const p of pts) { + p.x *= scale + p.y *= scale + } + return pts + } + + private reversePoint(pts, w): any[] { + const newPts = [] + for (let i = pts.length - 1; i >= 0; i--) { + const p = pts[i] + const x = w - p.x + const y = p.y + const j = i == 0 ? pts.length - 1 : i - 1 + + const bul = pts[j].bul + newPts.push({ x, y, bul }) + } + return newPts + } +} diff --git a/src/processParser/common/LayoutEngine/OddmentsHelper.ts b/src/processParser/common/LayoutEngine/OddmentsHelper.ts new file mode 100644 index 0000000..818ea08 --- /dev/null +++ b/src/processParser/common/LayoutEngine/OddmentsHelper.ts @@ -0,0 +1,379 @@ +/** 自动生成余料板空间 */ + +import { Vector3 } from 'three' +import { Polyline2Points } from 'cadapi' +import type { Polyline } from 'cadapi' +import { BlockSizePlus } from '../../Pack/BlockSizePlus' +import { BlockHelper } from '../BlockHelper' +import { arrayRemoveDuplicateBySort } from '../Nest/Common/ArrayExt' +import { InitClipperCpp } from '../Nest/Common/ClipperCpp' +import type { Vector2 } from '../Nest/Common/Vector2' +import { Container } from '../Nest/Core/Container' +import { NestCache } from '../Nest/Core/NestCache' +import { ParseOddments } from '../Nest/Core/ParseOddments' +import { Part } from '../Nest/Core/Part' +import { Path } from '../Nest/Core/Path' +import { PathGeneratorSingle } from '../Nest/Core/PathGenerator' +import { PlaceStore } from '../Store' +import { CurveWrap, Points2Polyline } from './Curves2Parts' +import { PolylineHelper } from './PolylineHelper' +import { BlockPlus } from '@/Source/Pack/BlockPlus' +import { ScrapBlock } from '@/Source/Models/ScrapBorad' +import type { PlaceBlock, PlaceBoard, PlaceMetrial, SaleBlockModel } from '@/Source/Models/Orders' +import { Arc2d } from '@/Source/Base/CAD' +import { ArrayExt } from '@/Source/Base/ArrayExt' + +export class OddmentsHelper { + squarePath: Path + canPutPaths: Path[] + offset = 3.5 + + initSquarePath() { + const seqW = PlaceStore.sysConfig.scrapBlockSquare || 200 + const wmin = PlaceStore.sysConfig.srcapBlockWidthMin || 100 + const wmax = PlaceStore.sysConfig.scrapBlockWidthMax || 600 + this.squarePath = NestCache.CreatePath(60, 60, 0) + this.canPutPaths = [ + NestCache.CreatePath(seqW, seqW, 0), + NestCache.CreatePath(wmin, wmax, 0), + NestCache.CreatePath(wmax, wmin, 0), + ] + } + + async analyzeAllScrapSpace(pm1: PlaceMetrial, pb1: PlaceBoard) { + this.initSquarePath() + if (pm1 && pb1) // 当前板 先做 + { + this.offset = (pm1.CutDia) / 2 + await this.analyzeScrapSpace(pm1, pb1) + } + const order = PlaceStore.order + for (const pm of order.MetrialList) { + this.offset = (pm.CutDia) / 2 + for (const pb of pm.BoardList) + await this.analyzeScrapSpace(pm, pb) + } + } + + async analyzeScrapSpace(pm: PlaceMetrial, board: PlaceBoard) { + console.log('OddmentsHelper analyzeScrapSpace', pm, board) + if (board.needToScrapSpace == false) + return + await InitClipperCpp() + + const border = 0// PlaceStore.sysConfig.BoardBorder_A; + let borderB = PlaceStore.sysConfig.BoardBorder_B + if (board.IsDo2Face == false) + borderB = 0 + let binPath: Path + if (board.Points && board.Points.length > 0) // 非矩形板 + + binPath = new Path(board.Points) + + else // 矩形板 + + binPath = new Path([{ x: border, y: border }, { x: board.Width - borderB, y: border }, { x: board.Width - borderB, y: board.Length - borderB }, { x: border, y: board.Length - borderB }]) + + binPath.Id = undefined + PathGeneratorSingle.RegisterId(binPath) + // 容器 + const container = new Container(binPath) + + for (let i = 0; i < board.blockList.length; i++) { + const block = board.blockList[i] + const part = this.toPart(block, binPath, this.offset * 2, i) + // 设置位置 + part[0].PlacePosition = { x: (part[1].x + block.PlaceX - border) * 1e4, y: (part[1].y + block.PlaceY - border) * 1e4 } + container.PlacedParts.push(part[0]) + } + // for (let i = 0; i < board.blockList.length; i++) + // { + // let block = board.blockList[i]; + // let part = this.toPart(block, binPath, 0, board.blockList.length + i); + // //设置位置 + // part[0].PlacePosition = { x: (part[1].x + block.PlaceX - border) * 1e4, y: (part[1].y + block.PlaceY - border) * 1e4 }; + // container.PlacedParts.push(part[0]); + // } + + // let f = new NestFiler(); + // f.Write(container.PlacedParts.length); + // for (let part of container.PlacedParts) + // f.Write(part.State.Contour.BigIntPoints); + // container.WriteFile(f); + // console.log(JSON.stringify(f._datas)); + + // FileZip.WriteFile(`${board.BoardID}.container`, JSON.stringify(f._datas)); + + board.ScrapBlockList = [] // 清空 + try { + const spaces = ParseOddments(container, binPath, this.offset, this.squarePath, this.canPutPaths) + for (const space of spaces) { + const sb = this.toScrapBlock(space) + sb.PlaceX = sb.PlaceX + border + sb.PlaceY = sb.PlaceY + border + board.ScrapBlockList.push(sb) + } + } + catch (err) { + // throw new Error(`计算余料空间异常:${pm.FullName} 第${board.BoardID}片`); + console.log(`计算余料空间异常:${pm.FullName} 第${board.BoardID}片`) + throw new Error(`计算余料空间异常:${pm.FullName} 第${board.BoardID}片;请保存优化联系售后工程师分析`) + } + + // 分析小板内 造型孔洞 余料空间 + for (const block of board.blockList) { + let childBlocks: PlaceBlock[] + // 造型孔 + for (const m of block.Models) { + if (m.Depth < block.Thickness - 0.05) + continue + if (m.HasContour == false) + continue + if (m.IsDo == false) + continue + if (!childBlocks) { + childBlocks = board.blockList.filter(t => t.PlaceX > block.PlaceX + && t.PlaceX + t.PlaceWidth < block.PlaceX + block.PlaceWidth + && t.PlaceY > block.PlaceY + && t.PlaceY + t.PlaceLength < block.PlaceY + block.PlaceLength) + } + const spaces = await this.getModelSpace(block, m, childBlocks) + for (const space of spaces) { + const sb = this.toScrapBlock(space) + // sb.PlaceX += border; + // sb.PlaceY += border; + sb.PlaceX += block.PlaceX + sb.PlaceY += block.PlaceY + board.ScrapBlockList.push(sb) + } + } + } + + board.needToScrapSpace = false + // console.log(`board id=${board.BoardID} find scrap block count = ${board.ScrapBlockList.length}`); + // console.log(`${board.BoardID} scraping ok`) + } + + async getModelSpace(block: PlaceBlock, m: SaleBlockModel, blocks: PlaceBlock[]): Promise { + if (m.OriginModeling == null) + return [] + const pts = m.OriginModeling.outline.pts + const buls = m.OriginModeling.outline.buls + // blocks = []; + // 起点 + let pts_n = [] + for (let i = 0; i < pts.length; i++) { + const p0 = BlockHelper.GetPlaceXYInBlock(block, pts[i].x, pts[i].y, false, false) + pts_n.push({ x: p0.X, y: p0.Y, bul: buls[i] }) + } + // 如果反面,翻转方向,重设坐标 + if (block.IsTurnOver) + pts_n = this.reversePoint(pts_n, block.CuttingWidth) + + // pts_n.forEach(t => { t.x += block.PlaceX; t.y += block.PlaceY; }); + + let polyLine + polyLine = Points2Polyline(pts_n) + const cicle = PolylineHelper.ConverPolyLin2Circle(polyLine) + if (cicle) + polyLine = cicle + const cureW2 = new CurveWrap(polyLine, this.offset, false) + const pts2 = cureW2.GetInsidePoints2(this.offset) + if (!pts2) + return [] + let posx = 10000 + let posy = 10000 + for (const p of pts2) { + if (p.x < posx) + posx = p.x + if (p.y < posy) + posy = p.y + } + for (const p of pts2) { + p.x -= posx + p.y -= posy + } + const binPath = new Path(pts2) + if (binPath.Area < 15000) + return [] + + await InitClipperCpp() + binPath.Id = undefined + PathGeneratorSingle.RegisterId(binPath) + // 容器 + const container = new Container(binPath) + let i = 0 + for (const b of blocks) { + const part = this.toPart(b, binPath, this.offset, i) + if (part[0].State.Contour == null) + continue + part[0].Id = i++ + // let isin = this.blockInBlock(block, b, polyLine); + // if (isin == false) continue; + // let part = this.toPart(b, binPath, this.offset, i++); + + // 设置位置 + part[0].PlacePosition = { x: (b.PlaceX - block.PlaceX - posx) * 1e4, y: (b.PlaceY - block.PlaceY - posy) * 1e4 } + container.PlacedParts.push(part[0]) + } + try { + // let f = new NestFiler(); + // f.Write(container.PlacedParts.length); + // for (let part of container.PlacedParts) + // f.Write(part.State.Contour.BigIntPoints); + // container.WriteFile(f); + // console.log(JSON.stringify(f._datas)); + // FileZip.WriteFile(`${board.BoardID}.container`, JSON.stringify(f._datas)); + + const spaces = ParseOddments(container, binPath, this.offset, this.squarePath, this.canPutPaths) + for (const space of spaces) + space.Points.forEach((t) => { t.x += posx; t.y += posy }) + + return spaces + } + catch (err) { + console.log(`板${block.BlockNo}造型孔分析余料空间失败.`) + throw new Error(`板${block.BlockNo}造型孔分析余料空间失败.请保存优化联系售后工程师分析`) + } + // let spaces = ParseOddments(container, binPath, this.offset, this.squarePath, this.canPutPaths); + // for (let space of spaces) + // { + // space.Points.forEach(t => { t.x += posx; t.y += posy; }); + // } + // return spaces; + } + + toPart(block: PlaceBlock, binPath: Path, offset: number, id: number): [Part, Vector2] { + const w = 10000 + const binPath2 = new Path([{ x: -w, y: -w }, { x: w, y: -w }, { x: w, y: w }, { x: -w, y: w }]) + const part = new Part() + part.Id = id + + part.UserData = { bno: block.BlockNo, size: block.Size, isYX: block.IsUnRegular, width: block.CuttingWidth, length: block.CuttingLength } + + let path: Path + let bPoint: Vector2 + + const sizeOff = BlockSizePlus.getOffDis(block) // 外扩偏移 + const hasSizeOff = (sizeOff.left + sizeOff.right + sizeOff.top + sizeOff.bottom) > (block.PlaceMetrial.CutDia * 2 + block.PlaceMetrial.CutGap * 2 + 0.01) + + // 矩形 且 带板外不偏移 + if (block.IsUnRegular == false && hasSizeOff == false) { + path = NestCache.CreatePath(block.PlaceWidth + sizeOff.left + sizeOff.right, block.PlaceLength + sizeOff.top + sizeOff.bottom, offset) + bPoint = path.OrigionMinPoint + // 轮廓 + part.Init2(path, binPath2, [0]) + } + else // 异形 + { + const pts = [] + + const cured = BlockPlus.getBorder(block) + for (const l of cured) { + if (l instanceof Arc2d) + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: l.Bul }) + + else + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: 0 }) + } + + let polyLine + polyLine = Points2Polyline(pts) + polyLine.CloseMark = true + + const cureW = new CurveWrap(polyLine, offset, true) + const pts2 = cureW.GetOutsidePoints() + arrayRemoveDuplicateBySort(pts, (p1, p2) => (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y) < 1e-2) + path = new Path(pts2) + + const cicle = PolylineHelper.ConverPolyLin2Circle(polyLine) + if (!cicle) { + const area = path.BoundingBox.area - path.Area + if (area < 15000 && pts.length > 6) + path = NestCache.CreatePath(block.PlaceWidth, block.PlaceLength, offset) + } + part.Init2(path, binPath2, [0]) + + // 不能放下,那么尝试不简化路径 + if (!path.IsRect && !cicle && part.RotatedStates.length == 0) { + const pts2 = Polyline2Points(polyLine, true, offset)[1] + arrayRemoveDuplicateBySort(pts2, (p1, p2) => (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y) < 1e-2) + path = new Path(pts2) + part.Init2(path, binPath, [0]) + } + // 轮廓 + bPoint = path.OrigionMinPoint + } + + if (hasSizeOff) { + bPoint.x = bPoint.x - sizeOff.left + bPoint.y = bPoint.y - sizeOff.bottom + } + + return [part, bPoint] + } + + toScrapBlock(path: Path): ScrapBlock { + const bx = path.OrigionMinPoint.x + const by = path.OrigionMinPoint.y + const points = path.Points + const ptsX = points.map((t) => { return t.x }) + const ptsY = points.map((t) => { return t.y }) + + const x0 = ArrayExt.min(ptsX, t => t) + const y0 = ArrayExt.min(ptsY, t => t) + const x1 = ArrayExt.max(ptsX, t => t) + const y1 = ArrayExt.max(ptsY, t => t) + + const sp = new ScrapBlock(x0, y0, x1 - x0, y1 - y0) + + const pts = points.map((t) => { return { x: t.x - x0, y: t.y - y0 } }) + + sp.PlaceX = bx + x0 + sp.PlaceY = by + y0 + + sp.setPoints(pts) + return sp + } + + // 判断板是否在造型洞里头 + blockInBlock(block: PlaceBlock, b: PlaceBlock, modlPl: Polyline, posX = 0, posY = 0): boolean { + const cured = BlockPlus.getBorder(b) + const pts = [] + for (const l of cured) { + if (l instanceof Arc2d) + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: l.Bul }) + + else + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: 0 }) + } + const polyLine = Points2Polyline(pts) + const cureW2 = new CurveWrap(polyLine, this.offset, false) + const pts2 = cureW2.GetInsidePoints2(this.offset) + + // pts2 = pts2.map(t => { return { x: t.x + b.PlaceX - block.PlaceX - posX, y: t.y + b.PlaceY - block.PlaceY - posY }; }); + + for (const t of pts2) { + const x = t.x + b.PlaceX - block.PlaceX - posX + const y = t.y + b.PlaceY - block.PlaceY - posY + if (modlPl.PtInCurve(new Vector3(x, y, 0)) == false) + return false + } + + return true + } + + private reversePoint(pts, w): any[] { + const newPts = [] + for (let i = pts.length - 1; i >= 0; i--) { + const p = pts[i] + const x = p.x + const y = p.y + const j = i == 0 ? pts.length - 1 : i - 1 + + const bul = pts[j].bul + newPts.push({ x, y, bul }) + } + return newPts + } +} diff --git a/src/processParser/common/LayoutEngine/PolylineHelper.ts b/src/processParser/common/LayoutEngine/PolylineHelper.ts new file mode 100644 index 0000000..768c175 --- /dev/null +++ b/src/processParser/common/LayoutEngine/PolylineHelper.ts @@ -0,0 +1,369 @@ +import type { PolylineProps } from 'cadapi' +import { CADFiler, Circle, Polyline, Status, VKnifToolPath, isTargetCurInOrOnSourceCur } from 'cadapi' +import type { Box3 } from 'three' +import { Vector2, Vector3 } from 'three' +import { arrayRemoveDuplicateBySort } from '../ArrayExt' +import type { Curve2d } from '../../common/base/CAD' +import { Arc2d, Point2d, copyTextToClipboard } from '../../common/base/CAD' +import { CurveWrap } from './Curves2Parts' + +// import type { Curve2d } from '../../common/base/CAD' + +export class PolylineHelper { + /** 创建闭合多段线 */ + static create(pts: any[], closeMark = false): Polyline { + let lined: PolylineProps[] = [] + let count = pts.length + for (let i = 0; i < count; i++) { + let p0 = pts[i] + + lined.push({ pt: new Vector2(p0.x, p0.y), bul: p0.bul || 0 }) + } + let pls = new Polyline(lined) + pls.CloseMark = closeMark + return pls + } + + static createByCurve2d(curs: Curve2d[], closeMark = true): Polyline { + let lined: PolylineProps[] = [] + for (let cur of curs) { + let x = cur.StartPoint.m_X + let y = cur.StartPoint.m_Y + let bul = 0 + if (cur instanceof Arc2d) + bul = cur.Bul || 0 + lined.push({ pt: new Vector2(x, y), bul }) + } + let pls = new Polyline(lined) + pls.CloseMark = true + return pls + } + + static createByPts(pts: any[], buls: number[], closeMark = false): Polyline { + let plps: PolylineProps[] = [] + let count = pts.length + for (let i = 0; i < count; i++) { + let p0 = pts[i] + plps.push({ pt: new Vector2(p0.x, p0.y), bul: buls[i] }) + } + let pls = new Polyline(plps) + pls.CloseMark = closeMark + return pls + } + + static getSimplePoints(pts: any[], offset: number): any[] { + let pl = PolylineHelper.create(pts) + pl.CloseMark = true + let cureW = new CurveWrap(pl, offset, true) + let pts2 = cureW.GetOutsidePoints() + arrayRemoveDuplicateBySort(pts2, (p1, p2) => (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y) < 1e-2) + return pts2 + } + + static createByWidthLength(w: number, l: number): Polyline { + let plps: PolylineProps[] = [] + plps.push({ pt: new Vector2(0, 0), bul: 0 }) + plps.push({ pt: new Vector2(w, 0), bul: 0 }) + plps.push({ pt: new Vector2(w, l), bul: 0 }) + plps.push({ pt: new Vector2(0, l), bul: 0 }) + let pls = new Polyline(plps) + pls.CloseMark = true + return pls + } + + /** 多段线,添加位置移动 返回新多段线 */ + static moveTo(pl: Polyline, x: number, y: number): Polyline { + let lindData = pl.LineData + let pos = pl.Position + + let newPts: PolylineProps[] = [] + for (let p of lindData) { + let nx = p.pt.x + pos.x + x + let ny = p.pt.y + pos.y + y + if (ny < 7.9) { + // console.log('修边小于 7.9????', ny) + } + let bul = p.bul + newPts.push({ pt: new Vector2(nx, ny), bul }) + } + let npl = new Polyline(newPts) + npl.CloseMark = pl.CloseMark + return npl + } + + /** 重设 多段线的几点 */ + static resetPosition(pl: Polyline): Polyline { + let lindData = pl.LineData + let pos = pl.Position + + let newPts: PolylineProps[] = [] + for (let p of lindData) { + let nx = p.pt.x + pos.x + let ny = p.pt.y + pos.y + let bul = p.bul + newPts.push({ pt: new Vector2(nx, ny), bul }) + } + let npl = new Polyline(newPts) + npl.CloseMark = pl.CloseMark + return npl + } + + /** 获得v型刀走刀路径 */o + static getVModelPoints(pl: Polyline, depth: number, ang: number): any[] { + // let ang = Math.PI * (0.5 * angle) / 180 ; + let ps = [] + let bx = pl.Position.x + let by = pl.Position.y + if (ang > 0.01) { + let rt = VKnifToolPath(pl, depth, ang / 2) + ps = rt.map((t) => { return { x: t.pt.x + bx, y: t.pt.y + by, z: t.pt.z, bul: t.bul, r: 0 } }) + } + else { + ps = pl.LineData.map((t) => { return { x: t.pt.x + bx, y: t.pt.y + by, z: 0, bul: t.bul, r: 0 } }) + } + for (let i = 0; i < ps.length; i++) { + let p = ps[i] + if (p.bul == 0) + continue + let p2 = (i == ps.length - 1 ? ps[0] : ps[i + 1]) + let r = this.getArcRadius(p.x, p.y, p2.x, p2.y, p.bul) + p.r = r + } + return ps + } + + static ConverPolyLin2Circle(polyline: Polyline, fuzz = 0.1): Circle | undefined { + let box = polyline.BoundingBox + let size = box.getSize(new Vector3()) + if (!this.equaln(size.x, size.y, fuzz))// 盒子四方 + return undefined + + let circleLength = 2 * Math.PI * size.x + if (!this.equaln(circleLength, polyline.Length, fuzz * 2)) + return undefined + + let circleArea = Math.PI * size.x * size.x + if (!this.equaln(circleArea, polyline.Area, fuzz * 2)) + return undefined + + let r = size.x// 必须备份(因为我们要复用这个vector变量) + return new Circle(box.getCenter(size), r) + } + // 有问题 + static getVModelPoints_offset(pl: Polyline, offset: number, depth: number, angle: number) { + let npl = offset == 0 ? pl : pl.GetOffsetCurves(offset)[0] + // if(offset != 0) + // { + // ClipboardTest.write2PolyLine(pl,npl); + // } + return PolylineHelper.getVModelPoints(npl, depth, angle) + } + + static getArcRadius(x1: number, y1: number, x2: number, y2: number, bul: number): number { + let bul2 = Math.abs(bul) + let d = Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) / 2 + return 0.5 * d * (1 + bul2 ** 2) / bul2 + } + + // 圆 转 多段线 + static cicleToPolyline(c: Circle): Polyline { + let arcs = c.GetSplitCurves([0, 0.5]) + let pl = Polyline.FastCombine(arcs) + return pl + } + + /** 判断多段线是否 重叠 */ + static isIntersect(pl1: Polyline, pl2: Polyline): boolean { + let box1 = this.getBox(pl1) + let box2 = this.getBox(pl2) + + if (!box1.intersectsBox(box2)) + return false // 肯定不相交 + + let ipts = pl1.IntersectWith(pl2, 0) + if (ipts.length === 0) { + if (pl1.Area > pl2.Area)// 缓存面积 + { + if (isTargetCurInOrOnSourceCur(pl1, pl2)) + return true // 包含 + } + else { + if (isTargetCurInOrOnSourceCur(pl2, pl1)) + return true // 包含 + } + return false + } + else { + return true // 有交点 一定有交集 + } + } + + // 多段线 圆弧合并 + static mergeCurve(pl2: Polyline): Polyline { + const curves = pl2.Explode() + arrayRemoveDuplicateBySort(curves, (c1, c2) => { + return c1.Join(c2) === Status.True + }) + + return Polyline.FastCombine(curves) + } + + /** + * pl2 包含在pl1 内 + * + */ + // static isInside(pl1:Polyline,pl2:Polyline):boolean + // { + // let box1 = this.getBox(pl1); + // let box2 = this.getBox(pl2); + // if (!box1.intersectsBox(box2)) return false; //肯定不相交 + + // let ipts = pl1.IntersectWith(pl2, 0); + // if (ipts.length > 0) return true; //有交点 一定有交集 + // } + + /** + * 两片板的干涉检查 + * + * @param pl1 + * @param pls1_inner + * @param pls1_model + * @param pl2 + * @param pls2_inner + * @param pls2_model + * @returns + */ + static isOverLap(pl1: Polyline, pls1_inner: Polyline[], pls1_model: Polyline[], pl2: Polyline, pls2_inner: Polyline[], pls2_model: Polyline[]) { + // 是否干涉, 被包含在造型洞,不算干涉 + let isOverlap = this.boxIsOverlap(pl1, pls1_inner, pl2, pls2_inner) + + if (isOverlap) + return true + + // 造型 ,2v 刀路 是否干涉 + for (let pl1_model of pls1_model) { + if (pl1_model.IntersectWith(pl2, 0).length > 0) + return true + for (let pl2_inner of pls2_inner) { + if (pl1_model.IntersectWith(pl2_inner, 0).length > 0) + return true + } + } + + for (let pl2_model of pls2_model) { + if (pl2_model.IntersectWith(pl1, 0).length > 0) + return true + for (let pl1_inner of pls1_inner) { + if (pl2_model.IntersectWith(pl1_inner, 0).length > 0) + return true + } + } + + return false + } + + private static boxIsOverlap(pl1: Polyline, pls1_inner: Polyline[], pl2: Polyline, pls2_inner: Polyline[]) { + let box1 = this.getBox(pl1) + let box2 = this.getBox(pl2) + + if (!box1.intersectsBox(box2)) + return false // 肯定不相交 + + let ipts = pl1.IntersectWith(pl2, 0) + if (ipts.length > 0) + return true // 有交点 一定有交集 + + if (pl1.Area > pl2.Area)// 缓存面积 + { + if (isTargetCurInOrOnSourceCur(pl1, pl2)) // pl1包含 pl2 + { + for (let mpl of pls1_inner) // 如果pl1有造型洞包含pl2, 则表示不干涉,返回false + + { + if (isTargetCurInOrOnSourceCur(mpl, pl2) == true) + return false + } + + return true + } + } + else { + if (isTargetCurInOrOnSourceCur(pl2, pl1)) // pl2包含 pl1 + { + for (let mpl of pls2_inner) // 如果pl2有造型洞包含pl1, 则表示不干涉,返回false + + { + if (isTargetCurInOrOnSourceCur(mpl, pl1) == true) + return false + } + + return true + } + } + + return false + } + + /** 判断 点是否在多段线内 */ + static isPointInPolyline(pl1: Polyline, x: number, y: number): boolean { + return pl1.PtInCurve(new Vector3(x, y, 0)) + } + + static getBox(pl1: Polyline): Box3 { + if (!pl1.box_tp) + pl1.box_tp = pl1.BoundingBox + + return pl1.box_tp as Box3 + } + + static getArea(pl1: Polyline): number { + if (!pl1.area_tp) + pl1.area_tp = pl1.Area + + return pl1.area_tp as number + } + + static getPath(pl: Polyline): Path2D { + let path = new Path2D() + let p0 = pl.LineData[0].pt + path.moveTo(p0.x, p0.y) + + for (let i = 0; i < pl.LineData.length; i++) { + let p0 = pl.LineData[i].pt + let p1 = (i == pl.LineData.length - 1) ? pl.LineData[0].pt : pl.LineData[i + 1].pt + let bul = pl.LineData[i].bul + if (bul == 0) { + path.lineTo(p1.x, p1.y) + } + else { + let arc = new Arc2d(new Point2d(p0.x, p0.y), new Point2d(p1.x, p1.y), bul) + path.arc(arc.m_Center.m_X, arc.m_Center.m_Y, arc.m_Radius, arc.m_StartAngle, arc.m_EndAngle, bul < 0) + } + } + path.closePath() + return path + } + + static equaln(v1: number, v2: number, fuzz = 1e-5) { + return Math.abs(v1 - v2) <= fuzz + } + + static toClipboard(en: Polyline | any) { + let f = new CADFiler() + f.Write(1)// 实体个数 + f.WriteObject(en) + + copyTextToClipboard(f.ToString()) + } + + static getStrPLs(ens: any[]) { + if (ens.length == 0) + return '' + let f = new CADFiler() + f.Write(ens.length)// 实体个数 + for (let en of ens) + f.WriteObject(en) + + return f.ToString() + } +} diff --git a/src/processParser/common/LayoutEngine/RemainHelper.ts b/src/processParser/common/LayoutEngine/RemainHelper.ts new file mode 100644 index 0000000..73797a8 --- /dev/null +++ b/src/processParser/common/LayoutEngine/RemainHelper.ts @@ -0,0 +1,408 @@ +import type { Polyline } from 'cadapi' +import { Polyline2Points } from 'cadapi' +import { Vector3 } from 'three' +import { ArrayExt } from '../base/ArrayExt.js' +import { Arc2d } from '../base/CAD.js' +import { arrayRemoveDuplicateBySort } from '../ArrayExt.js' +import { InitClipperCpp } from '../ClipperCpp.js' +import type { Vector2 } from '../Vector2.js' +import { Container } from '../core/Container.js' +import { NestCache } from '../core/NestCache.js' +import { ParseOddments } from '../core/ParseOddments.js' +import { Part } from '../core/Part.js' +import { Path } from '../core/Path.js' +import { PathGeneratorSingle } from '../core/PathGenerator.js' +import type { PlaceBlock } from '../../vo/order/PlaceBlock.js' +import type { PlaceBoard } from '../../vo/order/PlaceBoard.js' +import type { PlaceMaterial } from '../../vo/order/PlaceMaterial.js' +import type { BlockModel } from '../../vo/model/BlockModel.js' +import { RemainBlock } from '../../vo/remain/RemainBlock.js' +import { BlockPlus } from '../../vo/order/BlockPlus.js' +import { BlockSizePlus } from '../../vo/order/BlockSizePlus.js' +import { BlockHelper } from '../../vo/order/BlockHelper.js' +import { PlaceStore } from '../../vo/order/PlaceStore.js' +import { PolylineHelper } from './PolylineHelper.js' +import { CurveWrap, Points2Polyline } from './Curves2Parts.js' + +/** 自动生成余料板空间 */ +export class RemainHelper { + squarePath: Path + canPutPaths: Path[] + offset = 3.5 + + initSquarePath() { + // let squareWidth = PlaceStore.sysConfig.scrapBlockSquare || 200; + // let widthMin = PlaceStore.sysConfig.srcapBlockWidthMin || 100; + // let widthMax = PlaceStore.sysConfig.scrapBlockWidthMax || 600; + let squareWidth = 200 + let widthMin = 100 + let widthMax = 600 + this.squarePath = NestCache.CreatePath(60, 60, 0) + this.canPutPaths = [ + NestCache.CreatePath(squareWidth, squareWidth, 0), + NestCache.CreatePath(widthMin, widthMax, 0), + NestCache.CreatePath(widthMax, widthMin, 0), + ] + } + + /** 分析所有余料空间 */ + async analyzeAllRemainSpace(pm1: PlaceMaterial, pb1: PlaceBoard) { + this.initSquarePath() + console.log('分析所有余料空间'); + if (pm1 && pb1) // 当前板 先做 + { + + this.offset = (pm1.diameter + pm1.cutKnifeGap) / 2 + PlaceStore.order.sysConfig.preMillingSize + pb1.isCreateRemainSpace = true + await this.analyzeScrapSpace(pm1, pb1) + } + let order = PlaceStore.order + for (let pm of order.materialList) { + this.offset = (pm.diameter + pm.cutKnifeGap ) / 2 + PlaceStore.order.sysConfig.preMillingSize + for (let pb of pm.boardList) { + await this.analyzeScrapSpace(pm, pb) + } + } + } + + /** 分析所有余料空间 */ + async analyzeScrapSpace(pm: PlaceMaterial, board: PlaceBoard) { + // console.log('RemainHelper analyzeScrapSpace', pm, board) + if (board.isCreateRemainSpace == false) + return + await InitClipperCpp() + + let cutBoardBorder = PlaceStore.sysConfig.cutBoardBorder; + let cutBoardBorderB = PlaceStore.sysConfig.cutBoardBorderB + if (board.isTwoFaceProcessing == false) + cutBoardBorderB = 0 + let binPath: Path + if (board.points && board.points.length > 0) // 非矩形板 + { + binPath = new Path(board.points) + } + else // 矩形板 + { + binPath = new Path([{ x: cutBoardBorder, y: cutBoardBorder }, + { x: board.width - cutBoardBorderB, y: cutBoardBorder }, + { x: board.width - cutBoardBorderB, y: board.length - cutBoardBorderB }, + { x: cutBoardBorder, y: board.length - cutBoardBorderB }, + ]) + } + binPath.Id = undefined + PathGeneratorSingle.RegisterId(binPath) + // 容器 + let container = new Container(binPath) + + for (let i = 0; i < board.blockList.length; i++) { + let block = board.blockList[i] + let part = this.toPart(block, binPath, this.offset * 2, i) + // 设置位置 + part[0].PlacePosition = { x: (part[1].x + block.placeX + block.placeOffX - cutBoardBorder) * 1e4, y: (part[1].y + block.placeY + block.placeOffY - cutBoardBorder) * 1e4 } + container.PlacedParts.push(part[0]) + } + // for (let i = 0; i < board.BlockList.length; i++) + // { + // let block = board.BlockList[i]; + // let part = this.toPart(block, binPath, 0, board.BlockList.length + i); + // //设置位置 + // part[0].PlacePosition = { x: (part[1].x + block.placeX - border) * 1e4, y: (part[1].y + block.placeY - border) * 1e4 }; + // container.PlacedParts.push(part[0]); + // } + + // let f = new NestFiler(); + // f.Write(container.PlacedParts.length); + // for (let part of container.PlacedParts) + // f.Write(part.State.Contour.BigIntPoints); + // container.WriteFile(f); + // console.log(JSON.stringify(f._datas)); + + // FileZip.WriteFile(`${board.boardId}.container`, JSON.stringify(f._datas)); + + board.remainBlockList = [] // 清空 + try { + let spaces = ParseOddments(container, binPath, this.offset, this.squarePath, this.canPutPaths) + for (let space of spaces) { + let sb = this.toRemainBlock(space) + sb.placeX = sb.placeX + cutBoardBorder + sb.placeY = sb.placeY + cutBoardBorder + board.remainBlockList.push(sb) + } + } + catch (err) { + // throw new Error(`计算余料空间异常:${pm.FullName} 第${board.boardId}片`); + console.log(`计算余料空间异常:${pm.fullName} 第${board.boardId}片`, err) + throw new Error(`计算余料空间异常:${pm.fullName} 第${board.boardId}片;请保存优化联系售后工程师分析`) + } + + // 分析小板内 造型孔洞 余料空间 + for (let block of board.blockList) { + let childBlocks: PlaceBlock[] + // 造型孔 + for (let m of block.models) { + if (m.depth < block.thickness - 0.05) + continue + if (m.hasContour == false) + continue + if (m.isCutting == false) + continue + if (!childBlocks) { + childBlocks = board.blockList.filter(t => t.placeX > block.placeX + && t.placeX + t.placeWidth < block.placeX + block.placeWidth + && t.placeY > block.placeY + && t.placeY + t.placeLength < block.placeY + block.placeLength) + } + let spaces = await this.getModelSpace(block, m, childBlocks) + for (let space of spaces) { + let sb = this.toRemainBlock(space) + // sb.placeX += border; + // sb.placeY += border; + sb.placeX += block.placeX + sb.placeY += block.placeY + board.remainBlockList.push(sb) + } + } + } + + board.isCreateRemainSpace = false + // console.log(`board id=${board.boardId} find scrap block count = ${board.remainBlockList.length}`); + // console.log(`${board.boardId} scraping ok`) + } + + /** 获取造型空间 */ + async getModelSpace(block: PlaceBlock, m: BlockModel, blocks: PlaceBlock[]): Promise { + if (m.originModeling == null) + return [] + let pts = m.originModeling.outline.pts + let buls = m.originModeling.outline.buls + + if (pts == undefined) { + pts = m.originModeling.outline.map(e => e.pts) + } + + if (buls == undefined) { + buls = m.originModeling.outline.map(e => e.buls) + } + // blocks = []; + // 起点 + let pts_n = [] + for (let i = 0; i < pts.length; i++) { + let p0 = BlockHelper.getPlaceXYInBlock(block, pts[i].x, pts[i].y, false, false) + pts_n.push({ x: p0.x, y: p0.y, bul: buls[i] }) + } + // 如果反面,翻转方向,重设坐标 + if (block.isTurnOver) + pts_n = this.reversePoint(pts_n, block.cutWidth) + + // pts_n.forEach(t => { t.x += block.placeX; t.y += block.placeY; }); + + let polyLine + polyLine = Points2Polyline(pts_n) + let cicle = PolylineHelper.ConverPolyLin2Circle(polyLine) + if (cicle) + polyLine = cicle + let cureW2 = new CurveWrap(polyLine, this.offset, false) + let pts2 = cureW2.GetInsidePoints2(this.offset) + if (!pts2) + return [] + let posx = 10000 + let posy = 10000 + for (let p of pts2) { + if (p.x < posx) + posx = p.x + if (p.y < posy) + posy = p.y + } + for (let p of pts2) { + p.x -= posx + p.y -= posy + } + let binPath = new Path(pts2) + if (binPath.Area < 15000) + return [] + + await InitClipperCpp() + binPath.Id = undefined + PathGeneratorSingle.RegisterId(binPath) + // 容器 + let container = new Container(binPath) + let i = 0 + for (let b of blocks) { + let part = this.toPart(b, binPath, this.offset, i) + if (part[0].State.Contour == null) + continue + part[0].Id = i++ + // let isin = this.blockInBlock(block, b, polyLine); + // if (isin == false) continue; + // let part = this.toPart(b, binPath, this.offset, i++); + + // 设置位置 + part[0].PlacePosition = { x: (b.placeX - block.placeX - posx) * 1e4, y: (b.placeY - block.placeY - posy) * 1e4 } + container.PlacedParts.push(part[0]) + } + try { + // let f = new NestFiler(); + // f.Write(container.PlacedParts.length); + // for (let part of container.PlacedParts) + // f.Write(part.State.Contour.BigIntPoints); + // container.WriteFile(f); + // console.log(JSON.stringify(f._datas)); + // FileZip.WriteFile(`${board.boardId}.container`, JSON.stringify(f._datas)); + + let spaces = ParseOddments(container, binPath, this.offset, this.squarePath, this.canPutPaths) + for (let space of spaces) { + space.Points.forEach((t) => { t.x += posx; t.y += posy }) + } + return spaces + } + catch (err) { + console.log(`板${block.blockNo}造型孔分析余料空间失败.`) + throw new Error(`板${block.blockNo}造型孔分析余料空间失败.请保存优化联系售后工程师分析`) + } + // let spaces = ParseOddments(container, binPath, this.offset, this.squarePath, this.canPutPaths); + // for (let space of spaces) + // { + // space.Points.forEach(t => { t.x += posx; t.y += posy; }); + // } + // return spaces; + } + + /** 转配件 */ + toPart(block: PlaceBlock, binPath: Path, offset: number, id: number): [Part, Vector2] { + let w = 10000 + let binPath2 = new Path([{ x: -w, y: -w }, { x: w, y: -w }, { x: w, y: w }, { x: -w, y: w }]) + let part = new Part() + part.Id = id + + part.UserData = { bno: block.blockNo, area: block.area, isUnRegular: block.isUnRegular, width: block.cutWidth, length: block.cutLength } + + let path: Path + let bPoint: Vector2 + + let sizeOff = BlockSizePlus.getOffDis(block) // 外扩偏移 + let hasSizeOff = (sizeOff.left + sizeOff.right + sizeOff.top + sizeOff.bottom) > (block.placeMaterial.diameter * 2 + block.placeMaterial.cutKnifeGap * 2 + 0.01) + + // 矩形且带板外不偏移 + if (block.isUnRegular == false && hasSizeOff == false) { + path = NestCache.CreatePath(block.placeWidth + sizeOff.left + sizeOff.right, block.placeLength + sizeOff.top + sizeOff.bottom, offset) + bPoint = path.OrigionMinPoint + // 轮廓 + part.Init2(path, binPath2, [0]) + } + else // 异形 + { + let pts = [] + + let cured = BlockPlus.getBorder_moving(block) + for (let l of cured) { + if (l instanceof Arc2d) { + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: l.Bul }) + } + else { + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: 0 }) + } + } + + let polyLine + polyLine = Points2Polyline(pts) + polyLine.CloseMark = true + + let cureW = new CurveWrap(polyLine, offset, true) + let pts2 = cureW.GetOutsidePoints() + arrayRemoveDuplicateBySort(pts, (p1, p2) => (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y) < 1e-2) + path = new Path(pts2) + + let cicle = PolylineHelper.ConverPolyLin2Circle(polyLine) + if (!cicle) { + let area = path.BoundingBox.area - path.Area + if (area < 15000 && pts.length > 6) + path = NestCache.CreatePath(block.placeWidth, block.placeLength, offset) + } + part.Init2(path, binPath2, [0]) + + // 不能放下,那么尝试不简化路径 + if (!path.IsRect && !cicle && part.RotatedStates.length == 0) { + let pts2 = Polyline2Points(polyLine, true, offset)[1] + arrayRemoveDuplicateBySort(pts2, (p1, p2) => (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y) < 1e-2) + path = new Path(pts2) + part.Init2(path, binPath, [0]) + } + // 轮廓 + bPoint = path.OrigionMinPoint + } + + if (hasSizeOff) { + bPoint.x = bPoint.x - sizeOff.left + bPoint.y = bPoint.y - sizeOff.bottom + } + + return [part, bPoint] + } + + /** 余料板空间 */ + toRemainBlock(path: Path): RemainBlock { + let bx = path.OrigionMinPoint.x + let by = path.OrigionMinPoint.y + let points = path.Points + let ptsX = points.map((t) => { return t.x }) + let ptsY = points.map((t) => { return t.y }) + + let x0 = ArrayExt.min(ptsX, t => t) + let y0 = ArrayExt.min(ptsY, t => t) + let x1 = ArrayExt.max(ptsX, t => t) + let y1 = ArrayExt.max(ptsY, t => t) + + let sp = new RemainBlock(x0, y0, x1 - x0, y1 - y0) + + let pts = points.map((t) => { return { x: t.x - x0, y: t.y - y0 } }) + + sp.placeX = bx + x0 + sp.placeY = by + y0 + + sp.setPoints(pts) + return sp + } + + /** 判断板是否在造型洞里头 */ + blockInModelOfBlock(block: PlaceBlock, b: PlaceBlock, modlPl: Polyline, posX = 0, posY = 0): boolean { + let cured = BlockPlus.getBorder(b) + let pts = [] + for (let l of cured) { + if (l instanceof Arc2d) { + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: l.Bul }) + } + else { + pts.push({ x: l.StartPoint.m_X, y: l.StartPoint.m_Y, bul: 0 }) + } + } + let polyLine = Points2Polyline(pts) + let cureW2 = new CurveWrap(polyLine, this.offset, false) + let pts2 = cureW2.GetInsidePoints2(this.offset) + + // pts2 = pts2.map(t => { return { x: t.x + b.placeX - block.placeX - posX, y: t.y + b.placeY - block.placeY - posY }; }); + + for (let t of pts2) { + let x = t.x + b.placeX - block.placeX - posX + let y = t.y + b.placeY - block.placeY - posY + if (modlPl.PtInCurve(new Vector3(x, y, 0)) == false) + return false + } + + return true + } + + /** 反向点 */ + private reversePoint(pts, w): any[] { + let newPts = [] + for (let i = pts.length - 1; i >= 0; i--) { + let p = pts[i] + let x = p.x + let y = p.y + let j = i == 0 ? pts.length - 1 : i - 1 + + let bul = pts[j].bul + newPts.push({ x, y, bul }) + } + return newPts + } +} diff --git a/src/processParser/common/LayoutEngine/Simplify2.ts b/src/processParser/common/LayoutEngine/Simplify2.ts new file mode 100644 index 0000000..3954661 --- /dev/null +++ b/src/processParser/common/LayoutEngine/Simplify2.ts @@ -0,0 +1,85 @@ +import { Vector2 } from '../Vector2' + +interface P { + x: number + y: number +} + +export interface IOffset { + negativeOffset: number + positiveOffset: number +} + +/** 点p到线段P1P2 的最短距离的平方,线段不延伸 */ +function GetSqSegDist(p: P, p1: P, p2: P): number { + let x = p1.x + let y = p1.y + let dx = p2.x - x + let dy = p2.y - y + + if (dx !== 0 || dy !== 0)// 不是0长度线 + { + const t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy) + if (t > 1) { + x = p2.x + y = p2.y + } + else if (t > 0) { + x += dx * t + y += dy * t + } + } + dx = p.x - x + dy = p.y - y + return dx * dx + dy * dy +} + +function CrossVector2(a: P, b: P) +{ + return a.x * b.y - a.y * b.x +} + +// Ramer-Douglas-Peucker algorithm +function SimplifyDPStep(points: P[], first: number, last: number, sqTolerance: number, simplified: P[], offset: IOffset): void { + let maxSqDist = 0 + let index: number + const fp = points[first] + const lp = points[last] + + for (let i = first + 1; i < last; i++) { + const p = points[i] + const sqDist = GetSqSegDist(p, fp, lp) + if (sqDist > maxSqDist) { + index = i + maxSqDist = sqDist + } + } + + if (maxSqDist > sqTolerance) { + if (index - first > 1) + SimplifyDPStep(points, first, index, sqTolerance, simplified, offset) + simplified.push(points[index]) + if (last - index > 1) + SimplifyDPStep(points, index, last, sqTolerance, simplified, offset) + } + else { + // 记录偏移 + const v = new Vector2(lp.x - fp.x, lp.y - fp.y).normalize() + for (let i = first + 1; i < last; i++) { + const p = points[i] + const offsetDist = -CrossVector2(v, { x: p.x - fp.x, y: p.y - fp.y }) + offset.positiveOffset = Math.max(offset.positiveOffset, offsetDist) + offset.negativeOffset = Math.min(offset.negativeOffset, offsetDist) + } + } +} + +// Ramer-Douglas-Peucker 算法 +export function SimplifyDouglasPeucker(points: P[], sqTolerance: number): [P[], IOffset] { + const last = points.length - 1 + const simplified: P[] = [points[0]] + const offset: IOffset = { negativeOffset: 0, positiveOffset: 0 } + SimplifyDPStep(points, 0, last, sqTolerance, simplified, offset) + simplified.push(points[last]) + return [simplified, offset] +} diff --git a/src/processParser/common/LayoutEngine/writeP.ts b/src/processParser/common/LayoutEngine/writeP.ts new file mode 100644 index 0000000..851305e --- /dev/null +++ b/src/processParser/common/LayoutEngine/writeP.ts @@ -0,0 +1,104 @@ +import type { PolylineProps } from 'cadapi' +import { CADFiler, Polyline } from 'cadapi' +import { Vector2 } from 'three' +import { copyTextToClipboard } from '../../Base/CAD' + +export class ClipboardTest { + public static writePolyline1(pl: Polyline, pts1) { + // pl 原图 + // pts :偏移后的点 + + const lined: PolylineProps[] = [] + const count = pts1.length + for (let i = 0; i < count; i++) { + const p0 = pts1[i] + lined.push({ pt: new Vector2(p0.x, p0.y), bul: 0 }) + } + const pl1 = new Polyline(lined) + pl1.CloseMark = true + + const f = new CADFiler() + f.Clear() + f.Write(2) + f.WriteObject(pl) + f.WriteObject(pl1) + + const test = JSON.stringify(f.Data) + + // for (let pl of lined) + // f.WriteObject(pl) + copyTextToClipboard(test) + } + + public static writePolyline2(pl: Polyline, pts1, pts2) { + // pl 原图 + // pts :偏移后的点 + + const lined: PolylineProps[] = [] + const count = pts1.length + for (let i = 0; i < count; i++) { + const p0 = pts1[i] + lined.push({ pt: new Vector2(p0.x, p0.y), bul: 0 }) + } + const pl1 = new Polyline(lined) + + const lined2: PolylineProps[] = [] + const count2 = pts2.length + for (let i = 0; i < count2; i++) { + const p0 = pts2[i] + lined2.push({ pt: new Vector2(p0.x, p0.y), bul: 0 }) + } + const pl2 = new Polyline(lined2) + + const f = new CADFiler() + f.Clear() + f.Write(3) + f.WriteObject(pl) + f.WriteObject(pl1) + f.WriteObject(pl2) + const test = JSON.stringify(f.Data) + + // for (let pl of lined) + // f.WriteObject(pl) + copyTextToClipboard(test) + } + + public static writeClipboard(pts) { + const lined: PolylineProps[] = [] + const count = pts.length + for (let i = 0; i < count; i++) { + const p0 = pts[i] + lined.push({ pt: new Vector2(p0.x, p0.y), bul: 0 }) + } + + const pls = new Polyline(lined) + const f = new CADFiler() + f.Clear() + f.Write(1) + f.WriteObject(pls) + const test = JSON.stringify(f.Data) + + // for (let pl of lined) + // f.WriteObject(pl) + copyTextToClipboard(test) + } + + public static writePolyLine(pls) { + const f = new CADFiler() + f.Clear() + f.Write(1) + f.WriteObject(pls) + const test = JSON.stringify(f.Data) + copyTextToClipboard(test) + } + + public static write2PolyLine(pls, pls2) { + const f = new CADFiler() + f.Clear() + f.Write(2) + f.WriteObject(pls) + f.WriteObject(pls2) + const test = JSON.stringify(f.Data) + copyTextToClipboard(test) + } +} diff --git a/src/processParser/common/Point.ts b/src/processParser/common/Point.ts new file mode 100644 index 0000000..87927a5 --- /dev/null +++ b/src/processParser/common/Point.ts @@ -0,0 +1,5 @@ +export interface Point +{ + x: number + y: number +} diff --git a/src/processParser/common/Random.ts b/src/processParser/common/Random.ts new file mode 100644 index 0000000..2e25e51 --- /dev/null +++ b/src/processParser/common/Random.ts @@ -0,0 +1,11 @@ +import { FixIndex } from './Util' + +export function RandomIndex(count: number, exclude?: number): number +{ + let index = Math.floor(Math.random() * count) + if (index === count) + index = 0 + if (index === exclude) + index = FixIndex(index + 1, count) + return index +} diff --git a/src/processParser/common/Sleep.ts b/src/processParser/common/Sleep.ts new file mode 100644 index 0000000..868f879 --- /dev/null +++ b/src/processParser/common/Sleep.ts @@ -0,0 +1,7 @@ +export async function Sleep(time: number) +{ + return new Promise((res) => + { + setTimeout(res, time) + }) +} diff --git a/src/processParser/common/Util.ts b/src/processParser/common/Util.ts new file mode 100644 index 0000000..a42dd3e --- /dev/null +++ b/src/processParser/common/Util.ts @@ -0,0 +1,38 @@ +/** 判断两个值是否相等 */ +export function equaln(v1: number, v2: number, fuzz = 1e-5) +{ + return Math.abs(v1 - v2) <= fuzz +} + +/** 修正数组索引号 */ +export function FixIndex(index: number, arr: Array | number) +{ + let count = (Array.isArray(arr)) ? arr.length : arr + if (index < 0) + return count + index + else if (index >= count) + return index - count + else + return index +} + +/** + * 获取数组最大元素的索引号 + * @param compart t2大于t1返回t2 + * @returns 索引 + */ +export function Max(arr: T[], compart: (t1: T, t2: T) => boolean): number +{ + let best: T = arr[0] + let bestIndex = 0 + for (let i = 1; i < arr.length; i++) + { + let t1 = arr[i] + if (compart(best, t1)) + { + best = t1 + bestIndex = i + } + } + return bestIndex +} diff --git a/src/processParser/common/Vector2.ts b/src/processParser/common/Vector2.ts new file mode 100644 index 0000000..e2687d1 --- /dev/null +++ b/src/processParser/common/Vector2.ts @@ -0,0 +1,335 @@ +import type { Point } from './Point.js' + +/** 二维向量 */ +export class Vector2 +{ + x: number + y: number + readonly isVector2: boolean = true + constructor(x: number = 0, y: number = 0) + { + this.x = x + this.y = y + } + + get width(): number { return this.x } + set width(value: number) { this.x = value } + get height(): number { return this.y } + set height(value: number) { this.y = value } + set(x: number, y: number): Vector2 + { + this.x = x + this.y = y + return this + } + + setScalar(scalar: number): Vector2 + { + this.x = scalar + this.y = scalar + return this + } + + setX(x: number): Vector2 + { + this.x = x + return this + } + + setY(y: number): Vector2 + { + this.y = y + return this + } + + setComponent(index: number, value: number): Vector2 + { + switch (index) + { + case 0: this.x = value; break + case 1: this.y = value; break + default: throw new Error(`index is out of range: ${index}`) + } + return this + } + + getComponent(index: number): number + { + switch (index) + { + case 0: return this.x + case 1: return this.y + default: throw new Error(`index is out of range: ${index}`) + } + } + + clone(): Vector2 + { + return new (this.constructor as any)().copy(this) + } + + copy(v: Vector2): Vector2 + { + this.x = v.x + this.y = v.y + return this + } + + add(v: Point): Vector2 + { + this.x += v.x + this.y += v.y + return this + } + + addScalar(s: number): Vector2 + { + this.x += s + this.y += s + return this + } + + addVectors(a: Vector2, b: Vector2): Vector2 + { + this.x = a.x + b.x + this.y = a.y + b.y + return this + } + + addScaledVector(v: Vector2, s: number): Vector2 + { + this.x += v.x * s + this.y += v.y * s + return this + } + + sub(v: Vector2): Vector2 + { + this.x -= v.x + this.y -= v.y + return this + } + + subScalar(s: number): Vector2 + { + this.x -= s + this.y -= s + return this + } + + subVectors(a: Vector2, b: Vector2): Vector2 + { + this.x = a.x - b.x + this.y = a.y - b.y + return this + } + + multiply(v: Vector2): Vector2 + { + this.x *= v.x + this.y *= v.y + return this + } + + multiplyScalar(scalar: number): Vector2 + { + if (Number.isFinite(scalar)) + { + this.x *= scalar + this.y *= scalar + } else + { + this.x = 0 + this.y = 0 + } + return this + } + + divide(v: Vector2): Vector2 + { + this.x /= v.x + this.y /= v.y + return this + } + + divideScalar(scalar: number): Vector2 + { + return this.multiplyScalar(1 / scalar) + } + + min(v: Point): Vector2 + { + this.x = Math.min(this.x, v.x) + this.y = Math.min(this.y, v.y) + return this + } + + max(v: Point): Vector2 + { + this.x = Math.max(this.x, v.x) + this.y = Math.max(this.y, v.y) + return this + } + + clamp(min: Vector2, max: Vector2): Vector2 + { + // This function assumes min < max, if this assumption isn't true it will not operate correctly + this.x = Math.max(min.x, Math.min(max.x, this.x)) + this.y = Math.max(min.y, Math.min(max.y, this.y)) + return this + } + + private static clampScalar_min = new Vector2() + private static clampScalar_max = new Vector2() + clampScalar(minVal: number, maxVal: number): Vector2 + { + const min: Vector2 = Vector2.clampScalar_min.set(minVal, minVal) + const max: Vector2 = Vector2.clampScalar_max.set(maxVal, maxVal) + return this.clamp(min, max) + } + + clampLength(min: number, max: number): Vector2 + { + const length: number = this.length() + return this.multiplyScalar(Math.max(min, Math.min(max, length)) / length) + } + + floor(): Vector2 + { + this.x = Math.floor(this.x) + this.y = Math.floor(this.y) + return this + } + + ceil(): Vector2 + { + this.x = Math.ceil(this.x) + this.y = Math.ceil(this.y) + return this + } + + round(): Vector2 + { + this.x = Math.round(this.x) + this.y = Math.round(this.y) + return this + } + + roundToZero(): Vector2 + { + this.x = (this.x < 0) ? Math.ceil(this.x) : Math.floor(this.x) + this.y = (this.y < 0) ? Math.ceil(this.y) : Math.floor(this.y) + return this + } + + negate(): Vector2 + { + this.x = -this.x + this.y = -this.y + return this + } + + dot(v: Vector2): number + { + return this.x * v.x + this.y * v.y + } + + lengthSq(): number + { + return this.x * this.x + this.y * this.y + } + + length(): number + { + return Math.sqrt(this.x * this.x + this.y * this.y) + } + + lengthManhattan(): number + { + return Math.abs(this.x) + Math.abs(this.y) + } + + normalize(): Vector2 + { + return this.divideScalar(this.length()) + } + + angle(): number + { + // computes the angle in radians with respect to the positive x-axis + let angle: number = Math.atan2(this.y, this.x) + if (angle < 0) + angle += 2 * Math.PI + return angle + } + + distanceTo(v: Vector2): number + { + return Math.sqrt(this.distanceToSquared(v)) + } + + distanceToSquared(v: Vector2): number + { + const dx: number = this.x - v.x; const dy: number = this.y - v.y + return dx * dx + dy * dy + } + + distanceToManhattan(v: Vector2): number + { + return Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + } + + setLength(length: number): Vector2 + { + return this.multiplyScalar(length / this.length()) + } + + lerp(v: Vector2, alpha: number): Vector2 + { + this.x += (v.x - this.x) * alpha + this.y += (v.y - this.y) * alpha + return this + } + + lerpVectors(v1: Vector2, v2: Vector2, alpha: number): Vector2 + { + return this.subVectors(v2, v1).multiplyScalar(alpha).add(v1) + } + + equals(v: Vector2): boolean + { + return ((v.x === this.x) && (v.y === this.y)) + } + + fromArray(array: Float32Array | number[], offset: number = 0): Vector2 + { + this.x = array[offset] + this.y = array[offset + 1] + return this + } + + toArray(array: Float32Array | number[] = [], offset: number = 0): Float32Array | number[] + { + array[offset] = this.x + array[offset + 1] = this.y + return array + } + + fromAttribute(attribute: any, index: number, offset: number = 0): Vector2 + { + index = index * attribute.itemSize + offset + this.x = attribute.array[index] + this.y = attribute.array[index + 1] + return this + } + + rotateAround(center: Vector2, angle: number): Vector2 + { + const c: number = Math.cos(angle); const s: number = Math.sin(angle) + const x: number = this.x - center.x + const y: number = this.y - center.y + this.x = x * c - y * s + center.x + this.y = x * s + y * c + center.y + return this + } +} diff --git a/src/processParser/common/base/ArrayExt.ts b/src/processParser/common/base/ArrayExt.ts new file mode 100644 index 0000000..7c73843 --- /dev/null +++ b/src/processParser/common/base/ArrayExt.ts @@ -0,0 +1,375 @@ +export class List extends Array +{ + /** 返回符合条件的第一个元素 */ + first(fn: (item: Item) => boolean): Item + { + if (this.length == 0) + return null + for (const item of this) + { + if (fn(item)) + return item + } + return null + } + + /** 返回符合条件的最后一元素 */ + last(fn: (t: Item) => boolean): Item + { + if (this.length == 0) + return null + for (let i = this.length - 1; i >= 0; i--) + { + if (fn(this[i])) + return this[i] + } + return null + } + + /** 最大值 */ + max(fn: (item: Item) => T): T + { + let maxV: T + for (const i of this) + { + let v = fn(i) + if (maxV == null) + { + maxV = fn(i) + } + else + { + if (v > maxV) + { + maxV = v + } + } + } + return maxV + } + + /** 最小值 */ + min(fn: (item: Item) => T): T + { + let minV: T + for (const i of this) + { + let v = fn(i) + if (minV == null) + { + minV = fn(i) + } + else + { + if (v < minV) + { + minV = v + } + } + } + return minV + } + + /** 累加 */ + sum(fn: (item: Item) => number): number + { + let v: number = 0 + for (const t of this) + { + v = v + fn(t) + } + return v + } + + /** 平均值 */ + avg(fn: (item: Item) => number): number + { + if (this.length == 0) + return 0 + let sum = this.sum(fn) + return sum / this.length + } + + /** 满足条件的元素数量 */ + count(fn: (item: Item) => number): number + { + if (this.length == 0) + return 0 + let c = 0 + for (const item of this) + { + if (fn(item)) + c = c + 1 + } + return c + } + + FindMax(fn: (item: Item) => T): Item + { + return this.reduce((a: Item, b: Item): Item => fn(a) > fn(b) ? a : b) + } +} + +export class ArrayExt +{ + /** 返回满足条件的元素数量 */ + static count(list: Item[], fn: (item: Item) => boolean): number + { + if (list.length == 0) + return 0 + let c = 0 + for (const item of list) + { + if (fn(item)) + c = c + 1 + } + return c + } + + /** 移除 */ + static remove(list: Item[], obj: Item) + { + let index = list.findIndex(t => t == obj) + if (index == -1) + return + list.splice(index, 1) + } + + /** 返回符合条件的第一个元素 */ + static first(list: Item[], fn: (item: Item) => boolean, orderFn1: (item: Item) => number = null, orderFn2: (item: Item) => number = null): Item + { + if (list.length == 0) + return null + if (orderFn1 == null) + { + for (const item of list) + { + if (fn(item)) + return item + } + return null + } + + let minValue1: number + let minValue2: number + let minItem: Item + for (const item of list) + { + if (fn(item) == false) + continue + let v1 = orderFn1(item) + let v2 = orderFn2 != null ? orderFn2(item) : 0 + if (minValue1 == null || v1 < minValue1 || (v1 == minValue1 && v2 < minValue2)) + { + minValue1 = v1 + minValue2 = v2 + minItem = item + } + } + return minItem + } + + /** 返回符合条件的最后一元素 */ + static last(list: Item[], fn: (t: Item) => boolean, orderFn1: (item: Item) => number = null, orderFn2: (item: Item) => number = null): Item + { + if (list.length == 0) + return null + if (orderFn1 == null) + { + for (let i = list.length - 1; i >= 0; i--) + { + if (fn(list[i])) + return list[i] + } + return null + } + + // + let maxValue1: number + let maxValue2: number + let maxItem: Item + for (const item of list) + { + if (fn(item) == false) + continue + let v1 = orderFn1(item) + let v2 = orderFn2 ? orderFn2(item) : 0 + if (maxValue1 == null || v1 > maxValue1 || (v1 == maxValue1 && v2 > maxValue2)) + { + maxValue1 = v1 + maxValue2 = v2 + maxItem = item + } + } + return maxItem + } + + /** 取最大值 */ + static max(list: T1[], fn: (item: T1) => T2, whereF: (item: T1) => boolean = null, defaultV: T2 = null): T2 + { + let maxV: T2 + for (const i of list) + { + if (whereF && whereF(i) == false) + continue + let v = fn(i) + if (maxV == undefined) + { + maxV = fn(i) + } + else + { + if (v > maxV) + { + maxV = v + } + } + } + if (maxV != undefined) + return maxV + return defaultV + } + + /** 最小值 */ + static min(list: Item[], fn: (item: Item) => T, whereF: (item: Item) => boolean = null, defaultV: T = null): T + { + let minV: T + for (const i of list) + { + if (whereF && whereF(i) == false) + continue + let v = fn(i) + if (minV == undefined) + { + minV = v + } + else + { + if (v < minV) + { + minV = v + } + } + } + if (minV != undefined) + return minV + return defaultV + } + + /** 累加 */ + static sum(list: Item[], fn: (item: Item) => number, wn?: (item: Item) => boolean): number + { + let v: number = 0 + for (const t of list) + { + if (wn && wn(t) == false) + continue + v = v + fn(t) + } + return v + } + + /** 平均值 */ + static avg(list: Item[], fn: (item: Item) => number): number + { + if (this.length == 0) + return 0 + let sum = ArrayExt.sum(list, fn) + return sum / this.length + } + + /** 排序 */ + static sortBy(list: Item[], fn: (item: Item) => number, fn2: (item: Item) => number = null) + { + if (fn2 == null) + return list.sort((a: Item, b: Item): number => fn(a) - fn(b)) + else + return list.sort((a: Item, b: Item): number => fn(a) == fn(b) ? (fn2(a) - fn2(b)) : fn(a) - fn(b)) + } + + /** 降序 排序 */ + static sortByDescending(list: Item[], fn: (item: Item) => number) + { + list.sort((a: Item, b: Item): number => fn(b) - fn(a)) + } + + /** 排序成新的数组 */ + static orderBy(list: Item[], fn: (item: Item) => number, fn2: (item: Item) => number = null): Item[] + { + let newList = list.concat([]) + if (fn2 == null) + return newList.sort((a: Item, b: Item): number => fn(a) - fn(b)) + else + return newList.sort((a: Item, b: Item): number => fn(a) == fn(b) ? (fn2(a) - fn2(b)) : fn(a) - fn(b)) + } + + /** 降序成新的数组 */ + static orderByDescending(list: Item[], fn: (item: Item) => number, fn2: (item: Item) => number = null): Item[] + { + let newList = list.concat([]) + if (fn2 == null) + return list.sort((a: Item, b: Item): number => fn(b) - fn(a)) + else + return list.sort((a: Item, b: Item): number => fn(a) == fn(b) ? (fn2(b) - fn2(a)) : fn(b) - fn(a)) + } + + /** 分组 */ + static groupBy(list: Item[], fn: (item: Item) => gT): GroupItem[] + { + let groups = new Array>() + + for (const item of list) + { + let key = fn(item) + let group = groups.find(t => t.key == key) + if (group == null) + { + group = new GroupItem(key) + groups.push(group) + } + group.push(item) + } + return groups + } + + /** + * 选择 + * let newObjectList = ArrayExt.Select(list,t=>({pA:t.name, pB:t.age + "_"+ t.month}) ) ; + */ + static Select(list: Item[], fn: (item: Item) => rT): rT[] + { + let newList = new Array() + for (const t of list) + { + newList.push(fn(t)) + } + return newList + } + + /** 过来,并按顺序排序 */ + static where(list: Item[], whereFn: (item: Item) => boolean, orderfn1: (item: Item) => number = null, orderfn2: (item: Item) => number = null): Item[] + { + let newList = list.filter(whereFn) + if (orderfn1 == null && orderfn2 == null) + return newList + return ArrayExt.sortBy(newList, orderfn1, orderfn2) + } +} + +export class GroupItem +{ + key: gT + get count() { return this.list.length } + list: Item[] + + constructor(k: gT) + { + this.key = k + this.list = [] + } + + push(d: Item) + { + this.list.push(d) + } +} diff --git a/src/processParser/common/base/CAD.ts b/src/processParser/common/base/CAD.ts new file mode 100644 index 0000000..a1eb2f0 --- /dev/null +++ b/src/processParser/common/base/CAD.ts @@ -0,0 +1,1392 @@ +export class Vector2d +{ + m_X = 0 + m_Y = 0 + + /** 长度 */ + Length = 0 + /** 角度 */ + Angle = 0 + + constructor(x: number, y: number) + { + this.m_X = x + this.m_Y = y + + this.GetLength() + this.GetAngle() + } + + private GetLength() + { + this.Length = Math.sqrt(this.m_X * this.m_X + this.m_Y * this.m_Y) + } + + // 角度 + private GetAngle() + { + let a = Math.atan2(this.m_Y, this.m_X) + if (a < 0) + a = Math.PI * 2 + a + this.Angle = a + } + + Normal(): Vector2d + { + if (this.Length != 0) + { + let k = 1 / this.Length + this.m_X *= k + this.m_Y *= k + this.Length = 1 + } + return this + } + + static OpDivide(v: Vector2d, c: number): Vector2d + { + return new Vector2d(v.m_X / c, v.m_Y / c) + } + + static OpMultiply(v: Vector2d, c: number): Vector2d + { + return new Vector2d(v.m_X * c, v.m_Y * c) + } + + static OpAdd(v1: Vector2d, v2: Vector2d): Vector2d + { + return new Vector2d(v1.m_X + v2.m_X, v1.m_Y + v2.m_Y) + } + + static OpMultiplyValue(v1: Vector2d, v2: Vector2d): number + { + return v1.m_X * v2.m_X + v1.m_Y * v2.m_Y + } + + /** 点积 */ + DotProduct(v1: Vector2d): number + { + return Vector2d.OpMultiplyValue(this, v1) + } + + /** 叉积 */ + CrossProduct(v: Vector2d): number + { + return this.m_X * v.m_Y - this.m_Y * v.m_X + } + + IsEqual(v: Vector2d, fuzz = 1e-3): boolean + { + return DoubleUtil.EqualX(this.m_X, v.m_X, fuzz) && DoubleUtil.EqualX(this.m_Y, v.m_Y, fuzz) + } + + /** 返回和另外一个向量的夹角 */ + AngleTo(v: Vector2d): number + { + let an = Math.abs(this.Angle - v.Angle) + if (DoubleUtil.EqualX(v.Length, 0, 1e-5) || DoubleUtil.EqualX(this.Length, 0, 1e-5)) + { + return -Math.PI// 随缘给 + } + else if (Math.abs(Math.sin(an)) < 0) + { + return this.Normal().IsEqual(v.Normal()) ? 0 : Math.PI + } + else + { + let p0 = new Point2d(0, 0) + let p1 = Point2d.OpAdd(new Point2d(0, 0), this) + let p2 = Point2d.OpAdd(new Point2d(0, 0), v) + let s = this.sign(Utils.Det(p1, p0, p2)) + if (an > Math.PI) + { + return ((2 * Math.PI) - an) * s + } + else + { + return an * s + } + } + } + + private sign(x: number): number + { + if (x == 0) + { + return 0 + } + else if (x > 0) + { + return -1 + } + else + { + return 1 + } + } +} + +/** CAD 点 */ +export class Point2d +{ + m_X = 0 + m_Y = 0 + + constructor(x: number, y: number) + { + this.m_X = x + this.m_Y = y + } + + DistensTo(pt: Point2d): number + { + return Point2d.OpSubtract(pt, this).Length + } + + Polar(angle: number, distens: number): Point2d + { + let x1 = this.m_X + Math.cos(angle) * distens + let y1 = this.m_Y + Math.sin(angle) * distens + return new Point2d(x1, y1) + } + + Mid(pt: Point2d): Point2d + { + return new Point2d((this.m_X + pt.m_X) * 0.5, (this.m_Y + pt.m_Y) * 0.5) + } + + AsVector(): Vector2d + { + return new Vector2d(this.m_X, this.m_Y) + } + + /** 减以 - */ + static OpSubtract(p1: Point2d, p2: Point2d): Vector2d + { + return new Vector2d(p1.m_X - p2.m_X, p1.m_Y - p2.m_Y) + } + + static OpAdd(p1: Point2d, p2: Vector2d): Point2d + { + return new Point2d(p1.m_X + p2.m_X, p1.m_Y + p2.m_Y) + } +} + +function equaln(v1: number, v2: number, fuzz = 1e-5) +{ + return Math.abs(v1 - v2) <= fuzz +} +function equalp(v1: Point2d, v2: Point2d, fuzz = 1e-5) +{ + return equaln(v1.m_X, v2.m_X, fuzz) && equaln(v1.m_Y, v2.m_Y, fuzz) +} + +/** 二维曲线:直线,圆弧 */ +export abstract class Curve2d +{ + // 求交点 + abstract IntersectWith(cu: Curve2d, retIns: Point2d[]): void + abstract Offset(distens: number): Curve2d + + // 点在线内部 + abstract PtInCurve(pt: Point2d): boolean + abstract ClosePointTo(pt: Point2d): Point2d + + // 获得参数 返回0或1 + abstract GetParametersAt(pt: Point2d): number + + abstract Parse() + + PtOnCurve(p: Point2d): boolean + { + return equalp(p, this.m_StartPoint) || equalp(p, this.m_EndPoint) || this.ParamOnCurve(this.GetParametersAt(p)) + } + + ParamOnCurve(param: number, fuzz = 1e-6): boolean { return !Number.isNaN(param) && param >= -fuzz && param <= 1 + fuzz } + + get EndPoint(): Point2d + { + return this.m_EndPoint + } + + set EndPoint(p: Point2d) + { + this.m_EndPoint = p + try + { + this.Parse() + } catch (error) + { + + } + } + + get StartPoint(): Point2d + { + return this.m_StartPoint + } + + set StartPoint(p: Point2d) + { + this.m_StartPoint = p + try + { + this.Parse() + } catch (error) + { + + } + } + + protected m_StartPoint: Point2d + protected m_EndPoint: Point2d + tagData: number // 特殊数据 异形边 封边值 + tagData2: number // 特殊数据 侧孔数 +} + +/** 直线 */ +export class Line2d extends Curve2d +{ + get toString() + { + return `[${this.m_StartPoint.m_X.toFixed(1)},${this.m_StartPoint.m_Y.toFixed(1)}] [${this.m_EndPoint.m_X.toFixed(1)},${this.m_EndPoint.m_Y.toFixed(1)}]` + } + + constructor(p1: Point2d, p2: Point2d) + { + super() + this.m_StartPoint = p1 + this.m_EndPoint = p2 + this.Parse() + } + + /** 求交点 */ + IntersectWith(cu: Curve2d, retIns: Point2d[]) + { + if (cu instanceof Line2d) + { + let l = cu as Line2d + let dx1 = this.StartPoint.m_X - this.EndPoint.m_X + let dx2 = l.StartPt.m_X - l.EndPt.m_X + let dx3 = l.EndPt.m_X - this.EndPoint.m_X + let dy1 = this.StartPoint.m_Y - this.EndPoint.m_Y + let dy2 = l.StartPt.m_Y - l.EndPt.m_Y + let dy3 = l.EndPt.m_Y - this.EndPoint.m_Y + + let det = (dx2 * dy1) - (dy2 * dx1) + let pt = new Point2d(0, 0) + + if (DoubleUtil.EqualX(det, 0.0, 1e-5)) + { + if (DoubleUtil.EqualX(dx2 * dy3, dy2 * dx3, 1e-5)) + { + if (l.StartPoint.DistensTo(this.EndPoint) < 1e-3) + { + retIns.push(this.EndPoint) + } + } + return + } + + let ratio = ((dx1 * dy3) - (dy1 * dx3)) / det + pt.m_X = (ratio * dx2) + l.EndPt.m_X + pt.m_Y = (ratio * dy2) + l.EndPt.m_Y + retIns.push(pt) + } + else + { + let arc = cu as Arc2d + arc.IntersectWith(this, retIns) + } + } + + /** 偏移 */ + Offset(distens: number): Curve2d + { + let an = Point2d.OpSubtract(this.EndPt, this.StartPt).Angle - Math.PI * 0.5 + return new Line2d(this.StartPt.Polar(an, distens), this.EndPt.Polar(an, distens)) + } + + /** 判断点在线内 */ + PtInCurve(pt: Point2d): boolean + { + // 首先判断平行 + let minX = Math.min(this.m_StartPoint.m_X, this.m_EndPoint.m_X) + let maxX = Math.max(this.m_StartPoint.m_X, this.m_EndPoint.m_X) + + if (DoubleUtil.EqualX(minX, maxX, 1e-3)) + { + let minY = Math.min(this.m_StartPoint.m_Y, this.m_EndPoint.m_Y) + let maxY = Math.max(this.m_StartPoint.m_Y, this.m_EndPoint.m_Y) + return (pt.m_Y >= minY - 1e-4 && pt.m_Y <= maxY + 1e-4) + } + + if (pt.m_X >= minX - 0.0001 && pt.m_X <= maxX + 0.0001) + { + let vec = Point2d.OpSubtract(this.m_EndPoint, this.m_StartPoint)// 标准向量 + let k = vec.m_Y / vec.m_X + return DoubleUtil.EqualX(this.m_StartPoint.m_Y + k * (pt.m_X - this.m_StartPoint.m_X), pt.m_Y, 0.01) + } + else + { + return false + } + } + + ClosePointTo(pt: Point2d): Point2d + { + let an = Point2d.OpSubtract(this.m_EndPoint, this.m_StartPoint).Angle + Math.PI / 2 + let vec = new Point2d(0, 0).Polar(an, 1).AsVector() + let p2 = Point2d.OpAdd(pt, vec) + let line = new Line2d(pt, p2) + let ptLst: Point2d[] = [] + this.IntersectWith(line, ptLst) + return ptLst[0] + } + + Parse() + { + if (this.EndPoint != null) + { + this.m_Length = this.StartPoint.DistensTo(this.EndPoint) + } + } + + GetParametersAt(pt: Point2d): number + { + let nearPt = this.ClosePointTo(pt) + + let vec = Point2d.OpSubtract(nearPt, this.m_StartPoint) + let vec2 = Point2d.OpSubtract(this.EndPoint, this.StartPoint) + + let an = vec.DotProduct(vec2) + + return Math.sign(an) * vec.Length / this.m_Length + } + + get StartPt(): Point2d { return this.StartPoint } + get EndPt(): Point2d { return this.EndPoint } + + m_Length: number + + static New(x0: number, y0: number, x1: number, y1: number): Line2d + { + let p0 = new Point2d(x0, y0) + let p1 = new Point2d(x1, y1) + return new Line2d(p0, p1) + } +} + +/** 圆弧 */ +export class Arc2d extends Curve2d +{ + constructor(p1: Point2d, p2: Point2d, bul: number) + { + super() + this.m_StartPoint = p1 + this.m_EndPoint = p2 + + this.m_Bul = bul + let vec = Point2d.OpSubtract(p2, p1) + let an = vec.Angle + let length = vec.Length + + this.m_Radius = length / Math.sin(2 * Math.atan(bul)) / 2 + this.m_AllAngle = Math.atan(bul) * 4 + let delDis = bul * length / 2 + + let toDis = this.m_Radius - delDis + + an += Math.PI * 0.5 + + this.m_Center = p1.Mid(p2) + this.m_Center = this.m_Center.Polar(an, toDis) + + this.m_StartAngle = Point2d.OpSubtract(this.StartPoint, this.m_Center).Angle + this.m_EndAngle = Point2d.OpSubtract(this.EndPoint, this.m_Center).Angle + + if (this.m_Bul < 0) + this.m_Radius = Math.abs(this.m_Radius) + } + + /** 圆心 */ + m_Center: Point2d + /** 半径 */ + m_Radius: number + /** 起始弧度 */ + m_StartAngle: number + /** 结束弧度 */ + m_EndAngle: number + /** 所有的弧度 */ + m_AllAngle: number + + IntersectWith(cu: Curve2d, retIns: Point2d[]) + { + if (cu instanceof Line2d) + { + let l = cu as Line2d + let a = DoubleUtil.Sqr(l.EndPt.m_X - l.StartPt.m_X) + DoubleUtil.Sqr(l.EndPt.m_Y - l.StartPt.m_Y) + + let b = (2.0) * ((l.EndPt.m_X - l.StartPt.m_X) * (l.StartPt.m_X - this.m_Center.m_X) + + (l.EndPt.m_Y - l.StartPt.m_Y) * (l.StartPt.m_Y - this.m_Center.m_Y)) + + let c = DoubleUtil.Sqr(this.m_Center.m_X) + DoubleUtil.Sqr(this.m_Center.m_Y) + + DoubleUtil.Sqr(l.StartPt.m_X) + DoubleUtil.Sqr(l.StartPt.m_Y) + - (2.0) * (this.m_Center.m_X * l.StartPt.m_X + this.m_Center.m_Y * l.StartPt.m_Y) - DoubleUtil.Sqr(this.m_Radius) + + let det = b * b - (4.0) * a * c + + if (DoubleUtil.EqualX(det, 0.0, 0.1)) + { + let delta = -b / ((2.0) * a) + + let pt = new Point2d(l.StartPt.m_X + delta * (l.EndPt.m_X - l.StartPt.m_X), l.StartPt.m_Y + delta * (l.EndPt.m_Y - l.StartPt.m_Y)) + retIns.push(pt) + return + } + else if (det > (0.0)) + { + let sqrt_det = Math.sqrt(det) + let delta = (-b + sqrt_det) / ((2.0) * a) + let p2 = new Point2d(l.StartPt.m_X + delta * (l.EndPt.m_X - l.StartPt.m_X), l.StartPt.m_Y + delta * (l.EndPt.m_Y - l.StartPt.m_Y)) + + delta = (-b - sqrt_det) / ((2.0) * a) + let p3 = new Point2d(l.StartPt.m_X + delta * (l.EndPt.m_X - l.StartPt.m_X), l.StartPt.m_Y + delta * (l.EndPt.m_Y - l.StartPt.m_Y)) + + retIns.push(p2) + retIns.push(p3) + return + } + } + else if (cu instanceof Arc2d) + { + let arc = cu as (Arc2d) + let dist = arc.m_Center.DistensTo(this.m_Center) + + if (dist < Math.abs(this.m_Radius - cu.m_Radius) - 1e-3 + || dist > (this.m_Radius + cu.m_Radius + 1e-3)) + return + + let dstsqr = dist * dist + let r1sqr = this.m_Radius * this.m_Radius + let r2sqr = arc.m_Radius * arc.m_Radius + + let a = (dstsqr - r2sqr + r1sqr) / (2 * dist) + let h = Math.sqrt(Math.abs(r1sqr - (a * a))) + + let ratio_a = a / dist + let ratio_h = h / dist + + let dx = arc.m_Center.m_X - this.m_Center.m_X + let dy = arc.m_Center.m_Y - this.m_Center.m_Y + + let phix = this.m_Center.m_X + (ratio_a * dx) + let phiy = this.m_Center.m_Y + (ratio_a * dy) + + dx = dx * ratio_h + dy = dy * ratio_h + + let pt = new Point2d(phix + dy, phiy - dx) + let p2 = new Point2d(phix - dy, phiy + dx) + retIns.push(pt) + retIns.push(p2) + } + } + + Offset(distens: number): Curve2d + { + let rn = new Arc2d(new Point2d(0, 0), new Point2d(0, 0), 0) + rn.m_Center = this.m_Center + rn.m_Radius = this.m_Radius + rn.m_StartAngle = this.m_StartAngle + rn.m_EndAngle = this.m_EndAngle + if (this.m_Bul > 0) + rn.m_Radius += distens + else + rn.m_Radius -= distens + rn.Bul = this.m_Bul + rn.ParsePointFormAngle() + return rn + } + + Parse() + { + // 解析角度 + this.ParseAngleFormPoint() + this.ParseAllAngle() + this.ParseBul() + } + + ParseAllAngle() + { + this.m_AllAngle = this.ComputeAnlge(this.m_EndAngle) + } + + ComputeAnlge(endAngle: number) + { + // 顺时针 + if (this.m_Bul < 0) + { + if (this.m_StartAngle > endAngle) + return this.m_StartAngle - endAngle + else // 越过0点绘制圆弧 + return (Math.PI * 2) - (endAngle - this.m_StartAngle) + } + else + { + if (endAngle > this.m_StartAngle) + return endAngle - this.m_StartAngle + else + return (Math.PI * 2) - (this.m_StartAngle - endAngle) + } + } + + ParseBul() + { + this.m_Bul = Math.tan(this.m_AllAngle * 0.25) * (this.m_Bul < 0 ? -1 : 1) + } + + ParsePointFormAngle() + { + this.m_StartPoint = this.m_Center.Polar(this.m_StartAngle, this.m_Radius) + this.m_EndPoint = this.m_Center.Polar(this.m_EndAngle, this.m_Radius) + } + + ParseAngleFormPoint() + { + this.m_StartAngle = Point2d.OpSubtract(this.StartPoint, this.m_Center).Angle + this.m_EndAngle = Point2d.OpSubtract(this.EndPoint, this.m_Center).Angle + } + + PtInCurve(pt: Point2d): boolean + { + let param = this.GetParametersAt(pt) + return param > -1e-3 && param < 1.0001 + } + + ClosePointTo(pt: Point2d): Point2d + { + return null + } + + GetParametersAt(pt: Point2d): number + { + let vec = Point2d.OpSubtract(pt, this.m_Center) + let an = vec.Angle + this.ParseAllAngle() + + // 如果以pt为终点,那么所有的角度为 + let ptAllAn = this.ComputeAnlge(an) + let allAn = this.m_AllAngle + + // 减去圆弧角度,剩余角度的一半 + let surplusAngleHalf = Math.PI - allAn / 2 + + if (ptAllAn > allAn + surplusAngleHalf)// 返回负数 + return ((ptAllAn - allAn) - (surplusAngleHalf * 2)) / allAn + else// 返回正数 + return ptAllAn / allAn + } + + GetAngleAtParam(param: number) + { + return this.clampRad(this.m_StartAngle + param * this.m_AllAngle) + } + + private clampRad(an: number) + { + an = an % (Math.PI * 2) + if (an < 0) + an += Math.PI * 2 + return an + } + + /** 凸度. */ + m_Bul: number + get Bul() { return this.m_Bul } + set Bul(v: number) { this.m_Bul = v } + + static New(x0: number, y0: number, x1: number, y1: number, bul: number): Arc2d + { + return new Arc2d(new Point2d(x0, y0), new Point2d(x1, y1), bul) + } +} + +function EntityEncode(c: Curve2d) +{ + if (c instanceof Line2d) + return 1 + else return 2 +} +function EntityEncode2(c1: Curve2d, c2: Curve2d) +{ + return EntityEncode(c1) & EntityEncode(c2) +} + +/** CAD 运算库 */ +export class Utils +{ + static Intersec(e1: Curve2d, e2: Curve2d, oldE1: Curve2d): Point2d + { + if (e1.EndPoint.DistensTo(e2.StartPoint) < 1e-2) + { + return e1.EndPoint + } + let ptsIns: Point2d[] = [] + e1.IntersectWith(e2, ptsIns) + if (ptsIns.length == 1) + { + return ptsIns[0] + } + else if (ptsIns.length == 2) + { + // 求一个最近的点. + let pt = oldE1.EndPoint + let d1 = pt.DistensTo(ptsIns[0]) + let d2 = pt.DistensTo(ptsIns[1]) + return d1 < d2 ? ptsIns[0] : ptsIns[1] + } + else // 0点 + { + return null + } + } + + /** 曲线偏移 */ + + static offsetPoints(points, offsetDistens: number): any[] + { + let ens: Curve2d[] = [] + for (let i = 0; i < points.length; i++) + { + let j = i + 1 + if (j == points.length) + j = 0 + + let line = new Line2d(new Point2d(points[i].x, points[i].y), new Point2d(points[j].x, points[j].y)) + if (line.m_Length == 0) + continue + ens.push(line) + } + + let ens2 = Utils.OffsetCurveList(ens, offsetDistens) + + let newPs = [] + for (let c of ens2) + { + newPs.push({ x: c.StartPoint.m_X, y: c.StartPoint.m_Y }) + } + return newPs + } + + // 1.曲线外偏移. + //* 2.曲线尝试首尾相连 + //* ->如果两条不相连,导致曲线连接失败,将添加圆弧过度 + //* + //* 2017-11-17对曲线相连算法进行修改. + //* 现在会先求出连接点,然后在重新进行曲线连接,避免连接点出错. 参见#118 + static OffsetCurveList(ens: Curve2d[], offsetDistens: number): Curve2d[] + { + // 只处理偏移的曲线 + let offEns: Curve2d[] = [] + + ens = ens.filter(e => e.StartPoint.DistensTo(e.EndPoint) > 0.05) + for (const item of ens) + { + offEns.push(item.Offset(offsetDistens)) + } + // 处理偏移 并且对交点进行处理 + let offEns2: Curve2d[] = [] + let linkPts: Point2d[] = [] + + // 计算链接点,如果有必要会新增圆弧 + for (let i = 0; i < offEns.length; i++) + { + let index2 = i + 1 == offEns.length ? 0 : i + 1 + + let e1 = offEns[i] + let e2 = offEns[index2] + + offEns2.push(offEns[i]) + + let iPts: Point2d[] = [] + e1.IntersectWith(e2, iPts) + let tPts = iPts.filter(p => e1.PtOnCurve(p) && e2.PtOnCurve(p)) + + let code = EntityEncode2(e1, e2) + if (code === 1) + { + if (tPts.length > 0) + linkPts.push(tPts[0])// 直接连接 + else + { + let refP = ens[i].EndPoint + let distSq = iPts[0].DistensTo(refP) + if (distSq > offsetDistens ** 2 * 2.1) // 补圆弧 + { + let arc = new Arc2d(e1.EndPoint, e2.StartPoint, Math.sign(offsetDistens)) + arc.m_Center = ens[i].EndPoint + arc.m_Radius = offsetDistens// 半径 + + linkPts.push(e1.EndPoint) + linkPts.push(e2.StartPoint) + offEns2.push(arc)// 添加圆弧. + } + else + linkPts.push(iPts[0]) + } + } + else if ( + code === 2 + && ( + equalp((e1).m_Center, (e2).m_Center, 0.1) // 都是圆弧,且同心圆(由于精度丢失,这里我们给0.01的容差) + || equalp(e1.EndPoint, e2.StartPoint, 0.1)) + ) + linkPts.push(e1.EndPoint) + else + { + function SelectNearP(pts: Point2d[], refPt: Point2d): Point2d + { + if (pts.length > 1) + { + let dist1 = refPt.DistensTo(pts[0]) + let dist2 = refPt.DistensTo(pts[1]) + return dist1 <= dist2 ? pts[0] : pts[1] + } + return pts[0] + } + + let refP = ens[i].EndPoint + if (tPts.length > 0) + linkPts.push(SelectNearP(iPts, refP))// 直接连接 + else + { + let arc = new Arc2d(e1.EndPoint, e2.StartPoint, Math.sign(offsetDistens)) + arc.m_Center = ens[i].EndPoint + arc.m_Radius = offsetDistens// 半径 + + linkPts.push(e1.EndPoint) + linkPts.push(e2.StartPoint) + offEns2.push(arc)// 添加圆弧. + } + } + } + + // 更新链接点位置 + for (let i = 0; i < offEns2.length; i++) + { + offEns2[i].EndPoint = linkPts[i] + let nextIndex = i == offEns2.length - 1 ? 0 : i + 1 + offEns2[nextIndex].StartPoint = linkPts[i] + } + + // 测试数据 + // TestPolyline([ens, offEns2]) + + return offEns2 + } + + /** //自交曲线优化 去除自交部分. */ + static RemoveSelfIntersect(cus: Curve2d[]): Curve2d[] + { + let res = new Array() + let cout = cus.length + for (let i = 0; i < cout; i++) + { + let cu = cus[i] + res.push(cu) + for (let j = cout - 2; j > i + 1; j--) + { + let cu2 = cus[j] + + let pts = new Array() + cu.IntersectWith(cu2, pts) + + // + if (pts.length == 0) + { + continue + } + if (pts.length == 2) + { + if (cu instanceof Line2d) + { + if (cu.GetParametersAt(pts[0]) > cu.GetParametersAt(pts[1])) + { + pts[0] = pts[1] + } + } + else if (cu instanceof Arc2d) + { + // 使用上一条线. 因为我们保证它和上一条线是有一个交点的 + + let arc = cu as Arc2d + + // last cu + let lastIndex = i - 1 + if (i == 0) + lastIndex = cout - 1 + + let lastCu = cus[lastIndex] + + let insPts = new Array() + lastCu.IntersectWith(cu, insPts) + + for (let insP of insPts) + { + let p1 = arc.GetParametersAt(insP) + let p2 = arc.GetParametersAt(insP) + // 从起点圆弧开始 + if (insP.DistensTo(cu.StartPoint) < 1e-3) + { + if (p1 > p2) + { + pts[0] = pts[1] + } + break + } + // 从终点圆弧开始. + else if (insP.DistensTo(cu.EndPoint) < 1e-3) + { + if (p1 < p2) + { + pts[0] = pts[1] + } + break + } + } + } + } + + if (cu.PtInCurve(pts[0]) && cu2.PtInCurve(pts[0])) + { + Utils.changeP(cus, cu, i, -1, pts[0]) + Utils.changeP(cus, cu, j, 1, pts[0]) + + i = j - 1 + break + } + } + } + + Utils.RemoveZeroCurve(res) + return res + } + + static changeP(cus: Curve2d[], cu: Curve2d, index: number, next: number, _pt: Point2d) + { + let cout = cus.length + let lastIndex = index + next + + let _cu = cus[index] + if (lastIndex == -1) + lastIndex = cout - 1 + else if (lastIndex == cout) + lastIndex = 0 + + let lastCu = cus[lastIndex] + + let insPts = new Array() + lastCu.IntersectWith(_cu, insPts) + + for (const insP of insPts) + { + if (insP.DistensTo(_cu.StartPoint) < 1e-3) + { + _cu.EndPoint = _pt + break + } + else if (insP.DistensTo(_cu.EndPoint) < 1e-3) + { + _cu.StartPoint = _pt + break + } + } + if (cu instanceof Arc2d) + { + cu.Parse() + } + } + + static RemoveZeroCurve(cus: Curve2d[]) + { + // remove zero length curve + /* + cus.RemoveAll((Curve2d o) => + { + if (o is Line2d) + { + return ((Line2d)o).m_Length < 1e-3; + } + else if (o is Arc2d) + { + return ((Arc2d)o).m_AllAngle < 1e-3; + } + return false; + }); + */ + + let length = cus.length + let isZero = false + for (let i = length - 1; i >= 0; i--) + { + let o = cus[i] + + isZero = false + if (o instanceof Line2d) + { + let line = o as Line2d + isZero = line.m_Length < 1e-3 + } + else if (o instanceof Arc2d) + { + let arc = o as Arc2d + isZero = arc.m_AllAngle < 1e-3 + } + + if (isZero) + { + cus.splice(i, 1) + } + } + } + + /** 曲线倒角 */ + static FilletCurveList(culist: Curve2d[], offsetDistens: number): Curve2d[] + { + /* + let rn = new List(); + let len = cuList.Count; + for (int i = 0; i < len; i++) + { + let en = cuList[i]; + let index =i==len-1 ? 0 : i + 1; + rn.Add(en); + if (en is Line2d && cuList[index] is Line2d) + { + let l1 = en as Line2d; + let l2 = cuList[index] as Line2d; + if (l1.m_Length < offsetDistens || l2.m_Length < offsetDistens + || (l1.EndPoint-l1.StartPoint).CrossProduct(l2.EndPoint-l2.StartPoint) <1e-3 + ) + { + continue; + } + + let tempEn1 = en.Offset(-offsetDistens) as Line2d; + let tempEn2 = cuList[index].Offset(-offsetDistens)as Line2d; + + let pts = new List(); + tempEn1.IntersectWith(tempEn2, pts); + if (pts.Count>0 && tempEn1.PtInCurve(pts.First())) + { + let pt = pts.First(); + //求交点. + en.EndPoint= en.ClosePointTo(pt); + let en2 = cuList[index]; + en2.StartPoint = en2.ClosePointTo(pt); + + let arc2d = new Arc2d(en.EndPoint, en2.StartPoint, 1);//凸圆弧 + arc2d.m_Center = pt; + arc2d.m_Radius = pt.DistensTo(en.EndPoint); + arc2d.Parse();//解析凸度 角度 + rn.Add(arc2d); + } + } + } + return rn; + */ + + let rn = new Array() + let len = culist.length + for (let i = 0; i < len; i++) + { + let en = culist[i] + let index = i == len - 1 ? 0 : i + 1 + rn.push(en) + + if (en instanceof Line2d && culist[index] instanceof Line2d) + { + let l1 = en as Line2d + let l2 = culist[index] as Line2d + if (l1.m_Length < offsetDistens || l2.m_Length < offsetDistens + || (Point2d.OpSubtract(l1.EndPoint, l1.StartPoint)).CrossProduct(Point2d.OpSubtract(l2.EndPoint, l2.StartPoint)) < 1e-3 + ) + { + continue + } + + let tempEn1 = en.Offset(-offsetDistens) as Line2d + let tempEn2 = culist[index].Offset(-offsetDistens) as Line2d + + let pts = new Array() + tempEn1.IntersectWith(tempEn2, pts) + if (pts.length > 0 && tempEn1.PtInCurve(pts[0])) + { + let pt = pts[0] + // 求交点. + en.EndPoint = en.ClosePointTo(pt) + let en2 = culist[index] + en2.StartPoint = en2.ClosePointTo(pt) + + let arc2d = new Arc2d(en.EndPoint, en2.StartPoint, 1)// 凸圆弧 + arc2d.m_Center = pt + arc2d.m_Radius = pt.DistensTo(en.EndPoint) + arc2d.Parse()// 解析凸度 角度 + rn.push(arc2d) + } + } + } + return rn + } + + /** 圆弧细分 如果大于90度则分割 */ + static SplitCurveListArc(cuList: Curve2d[]): Curve2d[] + { + /* C# 代码 + let rnList = new List();//返回的曲线表 + foreach (let cu in cuList) + { + if (cu is Arc2d) + { + let arc = cu as Arc2d; + arc.Parse();//解析圆弧的凸度 角度 + if (arc.m_AllAngle > Math.PI * 0.5) + { + int cout =(int)( arc.m_AllAngle / (Math.PI * 0.5)) + 1; + let an = arc.m_AllAngle / cout; + let startAn = arc.m_StartAngle; + for (int i = 0; i < cout; i++) + { + let arcNew = new Arc2d(arc.StartPoint, arc.EndPoint, 0); + arcNew.m_Radius = arc.m_Radius; + arcNew.m_Center = arc.m_Center; + arcNew.m_StartAngle = startAn; + arcNew.m_EndAngle = arcNew.m_StartAngle + an; + startAn = arcNew.m_EndAngle; + rnList.Add(arcNew); + } + } + else + { + rnList.Add(cu); + } + } + else + { + rnList.Add(cu); + } + } + return rnList; + + */ + let rnList = new Array()// 返回的曲线表 + for (let cu of cuList) + { + if (cu instanceof Arc2d) + { + let arc = cu as Arc2d + arc.Parse()// 解析圆弧的凸度 角度 + if (arc.m_AllAngle > Math.PI * 0.5) + { + let cout = arc.m_AllAngle / (Math.PI * 0.5) + 1 + let an = arc.m_AllAngle / cout + let startAn = arc.m_StartAngle + for (let i = 0; i < cout; i++) + { + let arcNew = new Arc2d(arc.StartPoint, arc.EndPoint, 0) + arcNew.m_Radius = arc.m_Radius + arcNew.m_Center = arc.m_Center + arcNew.m_StartAngle = startAn + arcNew.m_EndAngle = arcNew.m_StartAngle + an + startAn = arcNew.m_EndAngle + rnList.push(arcNew) + } + } + else + { + rnList.push(cu) + } + } + else + { + rnList.push(cu) + } + } + return rnList + } + + // 三点面积 + static Det(p1: Point2d, p2: Point2d, p3: Point2d): number + { + return this.Det2(p1.AsVector(), p2.AsVector(), p3.AsVector()) + } + + // 三点面积 + static Det2(p1: Vector2d, p2: Vector2d, p3: Vector2d): number + { + return p1.CrossProduct(p2) + p2.CrossProduct(p3) + p3.CrossProduct(p1) + } + + // + static AngleForm3Pt(pSrc: Point2d, p1: Point2d, p2: Point2d): number + { + /* + double angle = 0.0f; // 夹角 + + let vec1 = p1 - pSrc; + let vec2 = p2 - pSrc; + + double productValue = vec1 * vec2; + double cosValue = productValue / (vec1.Length * vec2.Length); // 余弦公式 + + // acos的输入参数范围必须在[-1, 1]之间,否则会"domain error" + // 对输入参数作校验和处理 + if (cosValue < -1 && cosValue > -2) + cosValue = -1; + else if (cosValue > 1 && cosValue < 2) + cosValue = 1; + + // acos返回的是弧度值,转换为角度值 + angle = Math.Acos(cosValue) * 180 / Math.PI; + return angle; + */ + let angle = 0.0 // 夹角 + + let vec1 = Point2d.OpSubtract(p1, pSrc) + let vec2 = Point2d.OpSubtract(p2, pSrc) + + let productValue = Vector2d.OpMultiplyValue(vec1, vec2) + let cosValue = productValue / (vec1.Length * vec2.Length) // 余弦公式 + + // acos的输入参数范围必须在[-1, 1]之间,否则会"domain error" + // 对输入参数作校验和处理 + if (cosValue < -1 && cosValue > -2) + cosValue = -1 + else if (cosValue > 1 && cosValue < 2) + cosValue = 1 + + // acos返回的是弧度值,转换为角度值 + angle = Math.acos(cosValue) * 180 / Math.PI + return angle + } +} + +export class DoubleUtil +{ + static EqualX(v1: number, v2: number, fuzz: number): boolean + { + return (Math.abs(v1 - v2) < fuzz) + } + + static Sqr(v: number): number + { + return v * v + } +} + +export class CADExt +{ + static GetX(arc: Curve2d): number + { + return Math.min(arc.StartPoint.m_X, arc.EndPoint.m_X) + } + + static GetY(arc: Curve2d): number + { + return Math.min(arc.StartPoint.m_Y, arc.EndPoint.m_Y) + } + + static GetWidth(arc: Curve2d): number + { + return Math.abs(arc.StartPoint.m_X - arc.EndPoint.m_X) + } + + static GetHeight(arc: Curve2d): number + { + return Math.abs(arc.StartPoint.m_Y - arc.EndPoint.m_Y) + } + + static GetRadius(p1: Point2d, p2: Point2d, bul: number): number + { + // let arc = new Arc2d(p1, p2, bul); + // return arc.m_Radius; + // this.m_Radius = length / Math.sin(2 * Math.atan(bul)) / 2; + return CADExt.getR(p1.m_X, p1.m_Y, p2.m_X, p2.m_Y, bul) + } + + static getR(x1: number, y1: number, x2: number, y2: number, bul: number): number + { + let length = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) + return length / Math.sin(2 * Math.atan(bul)) / 2 + } + + /** 圆弧分割成count段 */ + static SplitArc(arc: Arc2d, count: number): Arc2d[] + { + let list: Arc2d[] + list = [] + + let an = arc.m_AllAngle / count + let an_0 = arc.m_StartAngle + for (let i = 0; i < count; i++) + { + let arcNew = new Arc2d(arc.StartPoint, arc.EndPoint, 0) + arcNew.m_Radius = arc.m_Radius + arcNew.m_Center = arc.m_Center + arcNew.m_StartAngle = an_0 + arcNew.m_EndAngle = arcNew.m_StartAngle + an + an_0 = arcNew.m_EndAngle + arcNew.ParsePointFormAngle() + + list.push(arcNew) + } + return list + } + + static SplitArcByCell(ar: Arc2d, cellWidth: number): any[] + { + // 弧长 + let fullLenth = Math.abs(ar.m_Radius * (ar.m_EndAngle - ar.m_StartAngle)) + let count = fullLenth / cellWidth + if (count < 2) + count = 2 + let childs = CADExt.SplitArc(ar, count) + let pts = [] + for (let c of childs) + { + pts.push({ x: c.StartPoint.m_X, y: c.StartPoint.m_Y }) + } + pts.push({ x: ar.EndPoint.m_X, y: ar.EndPoint.m_Y }) + return pts + } + + /** 根据两点,深的弧度 中间的n个点 */ + static getCurvePoints(x1: number, y1: number, x2: number, y2: number, d: number, num: number): any + { + // atan(h/(L/2)) * 4 h: + let dis = 0.5 * Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) + let mul = d / dis + let arc = new Arc2d(new Point2d(x1, y1), new Point2d(x2, y2), mul) + + let arc_list = CADExt.SplitArc(arc, num - 1) + let points = [] + for (let li of arc_list) + { + points.push({ x: li.StartPoint.m_X, y: li.StartPoint.m_Y }) + } + points.push({ x: x2, y: y2 }) + return points + } + + /** 求弧长 */ + static getLength(arc: Arc2d): number + { + return arc.m_Radius * Math.abs(arc.m_AllAngle) + } + + /** 按固定线长分割圆弧 */ + static getPointsFromCurve(x1: number, y1: number, x2: number, y2: number, bul: number, dis: number) + { + let arc = new Arc2d(new Point2d(x1, y1), new Point2d(x2, y2), bul) + let length = this.getLength(arc) + let count = Math.max(4, Math.ceil(length / dis)) + let arc_list = CADExt.SplitArc(arc, count) + let points = [] + for (let li of arc_list) + { + points.push({ x: li.StartPoint.m_X, y: li.StartPoint.m_Y }) + } + points.push({ x: x2, y: y2 }) + return points + } + + /** 返回弧形中心点 (不是圆心点) */ + static getCenterPoint(arc: Arc2d): Point2d + { + let arcNew = new Arc2d(arc.StartPoint, arc.EndPoint, 0) + arcNew.m_Radius = arc.m_Radius + arcNew.m_Center = arc.m_Center + arcNew.m_StartAngle = arc.m_StartAngle + arcNew.m_EndAngle = arc.m_StartAngle + arc.m_AllAngle / 2 + arcNew.ParsePointFormAngle() + return arcNew.EndPoint + } + + /** 获得第3点到前2点的距离差 */ + static getDisOff(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): number + { + let dis31 = Math.sqrt((x3 - x1) * (x3 - x1) + (y3 - y1) * (y3 - y1)) + let dis32 = Math.sqrt((x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2)) + let dis12 = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) + return dis31 + dis32 - dis12 + } +} +function TestPolyline(offEnsS: Curve2d[][]) +{ + let str = `[${offEnsS.length}` + for (let i = 0; i < offEnsS.length; i++) + { + let offEns = offEnsS[i] + let linedString = `${offEns.length},` + for (let cu of offEns) + { + let bul = (cu instanceof Arc2d) ? cu.m_Bul : 0 + linedString += `[${cu.StartPoint.m_X},${cu.StartPoint.m_Y}],${bul},` + } + str += `,"Polyline",8,2,116,false,1,${7 + i % 2},0,[1,0,0,0,0,1,0,0,0,0,1,0,${Math.floor(i / 2) * 1000},0,0,1],0,0,true,[1,0,0,0,0,1,0,0,0,0,1,0,3000,0,0,1],0,2,${linedString}true` + } + str += ']' + console.log(str) + copyTextToClipboard(str) +} + +let DebugCurves: (Curve2d[])[] = [] +export function CADDebugInit() +{ + DebugCurves = [] +} + +export function CADCopyPolylines() +{ + TestPolyline(DebugCurves) + DebugCurves = [] +} + +function fallbackCopyTextToClipboard(text: string) +{ + let textArea = document.createElement('textarea') + textArea.value = text + document.body.appendChild(textArea) + textArea.focus() + textArea.select() + + try + { + let successful = document.execCommand('copy') + } catch (err) + { + } + document.body.removeChild(textArea) +} +export async function copyTextToClipboard(text: string) +{ + if (!navigator.clipboard) + { + fallbackCopyTextToClipboard(text) + return + } + return await navigator.clipboard.writeText(text) +} + +// ref: https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript + +/** + * 读取剪切板的字符串 + */ +export async function readClipboardText() +{ + if (navigator.clipboard) + return await navigator.clipboard.readText() + return '' +} diff --git a/src/processParser/common/base/Dxf.ts b/src/processParser/common/base/Dxf.ts new file mode 100644 index 0000000..8138898 --- /dev/null +++ b/src/processParser/common/base/Dxf.ts @@ -0,0 +1,490 @@ +export class DxfWritor +{ + layers: WeakSet + activeLayer: Layer + lineTypes: WeakSet + offX = 0 + offY = 0 // 基点 + constructor() + { + this.layers = new WeakSet() + this.activeLayer = null + this.lineTypes = new WeakSet() + + for (let i = 0; i < DrawingType.LINE_TYPES.length; ++i) + { + this.addLineType( + DrawingType.LINE_TYPES[i].name, + DrawingType.LINE_TYPES[i].description, + DrawingType.LINE_TYPES[i].elements, + ) + } + + for (let i = 0; i < DrawingType.LAYERS.length; ++i) + { + this.addLayer( + DrawingType.LAYERS[i].name, + DrawingType.LAYERS[i].colorNumber, + DrawingType.LAYERS[i].lineTypeName, + ) + } + + this.setActiveLayer('0') + } + + /** + * @param {string} name + * @param {string} description + * @param {Array} elements - if elem > 0 it is a line, if elem < 0 it is gap, if elem == 0.0 it is a + */ + addLineType(name, description, elements) + { + this.lineTypes[name] = new LineType(name, description, elements) + return this + } + + addLayer(name, colorNumber, lineTypeName) + { + this.layers[name] = new Layer(name, colorNumber, lineTypeName) + return this + } + + /** 设置当前图层 白=0, 红=1, 黄=2, 绿=3,CYAN=4,BLUE=5,MAGENTA=6 */ + setActiveLayer(name) + { + this.activeLayer = this.layers[name] + return this + } + + setOffset(x1, y1) + { + this.offX = x1 + this.offY = y1 + } + + clear() + { + + } + + drawLine(x1, y1, x2, y2) + { + this.activeLayer.addShape(new Line(x1 + this.offX, y1 + this.offY, x2 + this.offX, y2 + this.offY)) + return this + } + + drawRect(x1, y1, w, h) + { + x1 = x1 + this.offX + y1 = y1 + this.offY + this.activeLayer.addShape(new Line(x1, y1, x1 + w, y1)) + this.activeLayer.addShape(new Line(x1 + w, y1, x1 + w, y1 + h)) + this.activeLayer.addShape(new Line(x1 + w, y1 + h, x1, y1 + h)) + this.activeLayer.addShape(new Line(x1, y1 + h, x1, y1)) + return this + } + + /** + * @param {number} x1 - Center x + * @param {number} y1 - Center y + * @param {number} r - radius + * @param {number} startAngle - degree + * @param {number} endAngle - degree + */ + drawArc(x1, y1, r, startAngle, endAngle) + { + this.activeLayer.addShape(new Arc(x1 + this.offX, y1 + this.offY, r, startAngle, endAngle)) + return this + } + + /** + * @param {number} x1 - Center x + * @param {number} y1 - Center y + * @param {number} r - radius + */ + drawCircle(x1, y1, r) + { + this.activeLayer.addShape(new Circle(x1 + this.offX, y1 + this.offY, r)) + return this + } + + /** + * @param {number} x1 - x + * @param {number} y1 - y + * @param {number} height - Text height + * @param {number} rotation - Text rotation + * @param {string} value - the string itself + */ + drawText(x1, y1, height, rotation, value) + { + this.activeLayer.addShape(new Text(x1 + this.offX, y1 + this.offY, height, rotation, value)) + return this + } + + /** + * @param {Array} points - Array of points like [ [x1, y1,r], [x2, y2,r]... ] + */ + drawPolyline(points, isClose = false) + { + for (const p of points) + { + p.x += this.offX + p.y += this.offY + } + this.activeLayer.addShape(new Polyline(points, isClose)) + return this + } + + _getDxfLtypeTable() + { + let s = '0\nTABLE\n' // start table + s += '2\nLTYPE\n' // name table as LTYPE table + + for (let lineTypeName in this.lineTypes) + { + s += this.lineTypes[lineTypeName].toDxfString() + } + + s += '0\nENDTAB\n' // end table + + return s + } + + _getDxfLayerTable() + { + let s = '0\nTABLE\n' // start table + s += '2\nLAYER\n' // name table as LAYER table + + for (let layerName in this.layers) + { + s += this.layers[layerName].toDxfString() + } + + s += '0\nENDTAB\n' + + return s + } + + toDxfString() + { + let s = '' + + // start section + s += '0\nSECTION\n' + // name section as TABLES section + s += '2\nTABLES\n' + + s += this._getDxfLtypeTable() + s += this._getDxfLayerTable() + + // end section + s += '0\nENDSEC\n' + + // ENTITES section + s += '0\nSECTION\n' + s += '2\nENTITIES\n' + + for (let layerName in this.layers) + { + let layer = this.layers[layerName] + s += layer.shapesToDxf() + // let shapes = layer.getShapes(); + } + + s += '0\nENDSEC\n' + + // close file + s += '0\nEOF' + + return s + } +} + +namespace DrawingType +{ + // AutoCAD Color Index (ACI) + // http://sub-atomic.com/~moses/acadcolors.html + export const ACI = { + LAYER: 0, + RED: 1, + YELLOW: 2, + GREEN: 3, + CYAN: 4, + BLUE: 5, + MAGENTA: 6, + WHITE: 7, + } + export const LINE_TYPES = [ + { name: 'CONTINUOUS', description: '______', elements: [] }, + { name: 'DASHED', description: '_ _ _ ', elements: [5.0, -5.0] }, + { name: 'DOTTED', description: '. . . ', elements: [0.0, -5.0] }, + ] + export const LAYERS = [ + { name: '0', colorNumber: ACI.WHITE, lineTypeName: 'CONTINUOUS' }, + { name: '1', colorNumber: ACI.RED, lineTypeName: 'CONTINUOUS' }, + { name: '2', colorNumber: ACI.YELLOW, lineTypeName: 'CONTINUOUS' }, + { name: '3', colorNumber: ACI.GREEN, lineTypeName: 'CONTINUOUS' }, + { name: '4', colorNumber: ACI.CYAN, lineTypeName: 'CONTINUOUS' }, + { name: '5', colorNumber: ACI.BLUE, lineTypeName: 'CONTINUOUS' }, + { name: '6', colorNumber: ACI.MAGENTA, lineTypeName: 'CONTINUOUS' }, + ] +} + +export class LineType +{ + name: string + description: string + elements: any[] + + /** + * @param {string} name + * @param {string} description + * @param {Array} elements - if elem > 0 it is a line, if elem < 0 it is gap, if elem == 0.0 it is a + */ + constructor(name, description, elements) + { + this.name = name + this.description = description + this.elements = elements + } + + /** + * @link https://www.autodesk.com/techpubs/autocad/acadr14/dxf/ltype_al_u05_c.htm + */ + toDxfString() + { + let s = '0\nLTYPE\n' + s += '72\n65\n' + s += '70\n64\n' + s += `2\n${this.name}\n` + s += `3\n${this.description}\n` + s += `73\n${this.elements.length}\n` + s += `40\n${this.getElementsSum()}\n` + + for (let i = 0; i < this.elements.length; ++i) + { + s += `49\n${this.elements[i]}\n` + } + + return s + } + + getElementsSum() + { + let sum = 0 + for (let i = 0; i < this.elements.length; ++i) + { + sum += Math.abs(this.elements[i]) + } + + return sum + } +} + +export class Layer +{ + name: string + colorNumber: string + lineTypeName: string + shapes: any[] + constructor(name, colorNumber, lineTypeName) + { + this.name = name + this.colorNumber = colorNumber + this.lineTypeName = lineTypeName + this.shapes = [] + } + + toDxfString() + { + let s = '0\nLAYER\n' + s += '70\n64\n' + s += `2\n${this.name}\n` + s += `62\n${this.colorNumber}\n` + s += `6\n${this.lineTypeName}\n` + return s + } + + addShape(shape) + { + this.shapes.push(shape) + shape.layer = this + } + + getShapes() + { + return this.shapes + } + + shapesToDxf() + { + let s = '' + for (let i = 0; i < this.shapes.length; ++i) + { + s += this.shapes[i].toDxfString() + } + + return s + } +} + +export class Arc +{ + x1: number + y1: number + r: number + startAngle: number + endAngle: number + layer: Layer + /** + * @param {number} x1 - Center x + * @param {number} y1 - Center y + * @param {number} r - radius + * @param {number} startAngle - degree + * @param {number} endAngle - degree + */ + constructor(x1, y1, r, startAngle, endAngle) + { + this.x1 = x1 + this.y1 = y1 + this.r = r + this.startAngle = startAngle + this.endAngle = endAngle + } + + toDxfString() + { + // https://www.autodesk.com/techpubs/autocad/acadr14/dxf/line_al_u05_c.htm + let s = `0\nARC\n` + s += `8\n${this.layer.name}\n` + s += `10\n${this.x1}\n20\n${this.y1}\n30\n0\n` + s += `40\n${this.r}\n50\n${this.startAngle}\n51\n${this.endAngle}\n` + return s + } +} + +export class Circle +{ + x1: number + y1: number + r: number + layer: Layer + /** + * @param {number} x1 - Center x + * @param {number} y1 - Center y + * @param {number} r - radius + */ + constructor(x1, y1, r) + { + this.x1 = x1 + this.y1 = y1 + this.r = r + } + + toDxfString() + { + // https://www.autodesk.com/techpubs/autocad/acadr14/dxf/circle_al_u05_c.htm + let s = `0\nCIRCLE\n` + s += `8\n${this.layer.name}\n` + s += `10\n${this.x1}\n20\n${this.y1}\n30\n0\n` + s += `40\n${this.r}\n` + return s + } +} + +export class Line +{ + x1: number + y1: number + x2: number + y2: number + layer: Layer + constructor(x1: number, y1: number, x2: number, y2: number) + { + this.x1 = x1 + this.y1 = y1 + this.x2 = x2 + this.y2 = y2 + } + + toDxfString() + { + // https://www.autodesk.com/techpubs/autocad/acadr14/dxf/line_al_u05_c.htm + let s = `0\nLINE\n` + s += `8\n${this.layer.name}\n` + s += `10\n${this.x1}\n20\n${this.y1}\n30\n0\n` + s += `11\n${this.x2}\n21\n${this.y2}\n31\n0\n` + return s + } +} + +export class Polyline +{ + points: any[] + isClose = false + layer: Layer + /** + * @param {Array} points - Array of points like [ [x1, y1,r], [x2, y2,r]... ] + */ + constructor(points, isClose) + { + this.points = points + this.isClose = isClose + } + + toDxfString() + { + // https://www.autodesk.com/techpubs/autocad/acad2000/dxf/polyline_dxf_06.htm + // https://www.autodesk.com/techpubs/autocad/acad2000/dxf/vertex_dxf_06.htm + let s = `0\nPOLYLINE\n` + s += `8\n${this.layer.name}\n` + s += `66\n1\n70\n${this.isClose ? 1 : 0}\n` + + for (let i = 0; i < this.points.length; ++i) + { + s += `0\nVERTEX\n` + s += `8\n${this.layer.name}\n` + s += `70\n0\n` + s += `10\n${this.points[i].x}\n20\n${this.points[i].y}\n42\n${this.points[i].r}\n` + } + + s += `0\nSEQEND\n` + return s + } +} + +export class Text +{ + x1: number + y1: number + height: number + rotation: number + value: string + layer: Layer + /** + * @param {number} x1 - x + * @param {number} y1 - y + * @param {number} height - Text height + * @param {number} rotation - Text rotation + * @param {string} value - the string itself + */ + constructor(x1, y1, height, rotation, value) + { + this.x1 = x1 + this.y1 = y1 + this.height = height + this.rotation = rotation + this.value = value + } + + toDxfString() + { + // https://www.autodesk.com/techpubs/autocad/acadr14/dxf/text_al_u05_c.htm + let s = `0\nTEXT\n` + s += `8\n${this.layer.name}\n` + s += `1\n${this.value}\n` + s += `10\n${this.x1}\n20\n${this.y1}\n30\n0\n` + s += `40\n${this.height}\n50\n${this.rotation}\n` + return s + } +} diff --git a/src/processParser/common/base/File.ts b/src/processParser/common/base/File.ts new file mode 100644 index 0000000..d2c64db --- /dev/null +++ b/src/processParser/common/base/File.ts @@ -0,0 +1,122 @@ + + +export class textFile +{ + /**保存单文件 text类型的 */ + static saveFile(filename: string, content: string) + { + let blob = new Blob([content], { type: "text/plain;charset=utf-8" }); + this.saveAs(filename, blob); + } + + /**读取文件 选择文件组件,读取文档处理函数 */ + static readFile(eleFile, fn_doText, fileType = "", fn_msg = null) + { + let noEleFile = !(eleFile); + if (noEleFile) + { + eleFile = document.createElement('input'); + eleFile.type = 'file'; + eleFile.accept = 'text/*'; + eleFile.hidden = true; + document.body.appendChild(eleFile); + } + + + if (fileType && fileType != "") eleFile.accept = fileType; + let reader = new FileReader(); + reader.onload = function (event) + { + let text = event.target["result"]; + if (fn_doText) fn_doText(text); + }; + // 选择文件 + eleFile.onchange = function (event) + { + let file = event.target.files[0]; + if (file) + { + reader.readAsText(file); + } + if (fn_msg != null) + { + fn_msg(); + } + }; + eleFile.click(); + + if (noEleFile) + { + document.body.removeChild(eleFile); + } + + } + + static getStringFromFile(eleFile, fileType = "", fn_msg = null): string + { + let noEleFile = !(eleFile); + if (noEleFile) + { + eleFile = document.createElement('input'); + eleFile.type = 'file'; + eleFile.accept = 'text/*'; + eleFile.hidden = true; + document.body.appendChild(eleFile); + } + + + if (fileType && fileType != "") eleFile.accept = fileType; + let reader = new FileReader(); + reader.onload = function (event) + { + let text = event.target["result"]; + return text; + }; + // 选择文件 + eleFile.onchange = function (event) + { + let file = event.target.files[0]; + if (file) + { + reader.readAsText(file); + } + if (fn_msg != null) + { + fn_msg(); + } + }; + eleFile.click(); + + if (noEleFile) + { + document.body.removeChild(eleFile); + } + return ''; + } + /**保存文件 */ + static saveAs(fileName: string, data: Blob) + { + // 创建隐藏的可下载链接 + let eleLink = document.createElement('a'); + eleLink.download = fileName; + eleLink.style.display = 'none'; + eleLink.href = URL.createObjectURL(data); + // 触发点击 + document.body.appendChild(eleLink); + eleLink.click(); + // 然后移除 + document.body.removeChild(eleLink); + } + + static readFile2() + { + let rf = document.createElement('input'); + rf.type = 'file'; + rf.accept = 'text/*'; + rf.hidden = true; + + + document.body.removeChild(rf); + } + +} diff --git a/src/processParser/common/base/MaskedNumberRange.ts b/src/processParser/common/base/MaskedNumberRange.ts new file mode 100644 index 0000000..c4b7202 --- /dev/null +++ b/src/processParser/common/base/MaskedNumberRange.ts @@ -0,0 +1,118 @@ +/** 文本表示的数字取值范围,比如 : "2,3,5-8" 表示 + * () => 大于等于 小于等于 + * [] => 大于 小于 +*/ +export class MaskedNumberRange { + maskedNumbers: any[] + constructor(strRs: string) { + let rs = [] + let strs = strRs.split(',') + for (let str of strs) { + if (str.trim() == '') + continue + let n = Number(str) + + let s_flag = 'in' + let e_flag = 'in' + if (!Number.isNaN(n)) { + rs.push({ s: n, e: n, s_flag, e_flag }) + } + else { + let zys = str.split('-') + if (zys.length != 2) + continue + if (zys[0].trim() == '' || zys[1].trim() == '') + continue + + + + let start :any = zys[0] + let end :any = zys[1] + if (zys[0].trim().includes('(')) { + s_flag = 'notIn' + start = start.replaceAll('(', '') + } else if (zys[0].trim().includes('[')) { + s_flag = 'in' + start = start.replaceAll('[', '') + } + + if (start == 'x') { + s_flag = 'infinite' + }else{ + start = Number(start) + } + + if (zys[1].trim().includes(')')) { + e_flag = 'notIn' + end = end.replaceAll(')', '') + } else if (zys[1].trim().includes(']')) { + e_flag = 'in' + end = end.replaceAll(']', '') + } + + if (end == 'x') { + e_flag = 'infinite' + }else{ + end = Number(end) + } + + + + let s = start // Number(zys[0]) + let e = end //Number(zys[1]) + + + + rs.push({ s: s, e: e, s_flag, e_flag }) + } + } + this.maskedNumbers = rs + } + + /** 参数是否在给定范围内 */ + isInRange(r: number): boolean { + let res = false + + for (let se of this.maskedNumbers) { + + if (se.s_flag == 'infinite') { + // 无穷 不判断 + res = true + } else if (se.s_flag == 'notIn') { + if (r > se.s) { + res = true + } + } else if (se.s_flag == 'in') { + if (r >= se.s) { + res = true + } + } + + if (res == true) { + let res1 = false + + if (se.e_flag == 'infinite') { + res1 = true + } else if (se.e_flag == 'notIn') { + if (r < se.e) { + res1 = true + } + } else if (se.e_flag == 'in') { + if (r <= se.e) { + res1 = true + } + } + + res = res && res1 + } + + if(res == true){ + return true + } + + // if (r > se.s && r < se.e) + // return true + } + return res + } +} diff --git a/src/processParser/common/base/MathComm.ts b/src/processParser/common/base/MathComm.ts new file mode 100644 index 0000000..9fecb22 --- /dev/null +++ b/src/processParser/common/base/MathComm.ts @@ -0,0 +1,128 @@ +/** 相等, 相差小于diff */ +export function equal(a: number, b: number, diff = 0.001): boolean +{ + return Math.abs(a - b) < diff +} + +/** ab相差dis */ +export function isDiffer(a: number, b: number, dis: number, diff = 0.001): boolean +{ + let rdis = Math.abs(a - b) + return rdis > dis - diff && rdis < dis + diff +} + +/** 两点间距离 */ +export function getDis2(p1, p2): number +{ + let x1 = p1.pointX || p1.X || p1.x || 0 + let y1 = p1.pointY || p1.Y || p1.y || 0 + let x2 = p2.pointX || p2.X || p2.x || 0 + let y2 = p2.pointY || p2.Y || p2.y || 0 + return getDis(x1, y1, x2, y2) +} + +/** 两点间距离 */ +export function getDis(x1: number, y1: number, x2: number, y2: number): number +{ + let xt = x1 - x2 + let yt = y1 - y2 + return Math.sqrt(xt * xt + yt * yt) +} + +/** 两点间弧度半径 */ +export function getR(x1: number, y1: number, x2: number, y2: number, bul: number): number +{ + if (bul == 0) + return 0 + let d = Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) / 2 + return 0.5 * d * (1 + bul ** 2) / bul +} + +/** 获取两点间的半径 */ +export function getR2(p1, p2): number +{ + let bul = p1.Curve || p1.bul || 0 + if (bul == 0) + return 0 + + let x1 = p1.pointX || p1.X || p1.x + let y1 = p1.pointY || p1.Y || p1.y + let x2 = p2.pointX || p2.X || p2.x + let y2 = p2.pointY || p2.Y || p2.y + + return getR(x1, y1, x2, y2, bul) +} + +/** 截取小数点 */ +export function round(n: number, bit = 3): number +{ + if (bit < 1) + return n + let tt = 10 ** bit + return Math.round(n * tt) / tt +} + +/** + * 获得四点p{x,y}形成的矩形{x,y,w,l}; + * 不是矩形 返回null + */ +export function getRect(p0, p1, p2, p3): any +{ + if (equal(p0.x, p1.x) == false && equal(p0.y, p1.y) == false) + return null + + // 中心点 + let xc = (p0.x + p1.x + p2.x + p3.x) / 4 + let yc = (p0.y + p1.y + p2.y + p3.y) / 4 + + let dis0 = getDis(p0.x, p0.y, xc, yc) + let dis1 = getDis(p1.x, p1.y, xc, yc) + let dis2 = getDis(p2.x, p2.y, xc, yc) + let dis3 = getDis(p3.x, p3.y, xc, yc) + + if (equal(dis0, dis1) && equal(dis0, dis2) && equal(dis0, dis3)) + { + let x = Math.min(p0.x, p1.x, p2.x, p3.x) + let y = Math.min(p0.y, p1.y, p2.y, p3.y) + + let w = Math.max(p0.x, p1.x, p2.x, p3.x) - x + let l = Math.max(p0.y, p1.y, p2.y, p3.y) - y + if (w < 0.01 || l < 0.01) + return null + return { x, y, w, l } + } + return null +} + +/** 获取两点的直线的一般式方程AX+BY+C=0 ABC */ +export function getLineABC(x1: number, y1: number, x2: number, y2: number) +{ + let A = y2 - y1 + let B = x1 - x2 + let C = x2 * y1 - x1 * y2 + return { A, B, C } +} + +/** 获取点 p(x,y) 到两点的线的距离 */ +export function getDis_PointLine(x1: number, y1: number, x2: number, y2: number, x: number, y: number) +{ + let abc = getLineABC(x1, y1, x2, y2) + let aabb = Math.sqrt(abc.A * abc.A + abc.B * abc.B) + if (aabb == 0) + return 0 + + return Math.abs(abc.A * x + abc.B * y + abc.C) / aabb +} + +/** 删除重复点 */ +export function removeRepeatPoint(pts, fuzz = 0.01) +{ + for (let n = pts.length - 1; n >= 0; n--) { + let p = n - 1 + if (p < 0) + p = pts.length - 1 + + if (getDis2(pts[p], pts[n]) < fuzz) + pts.splice(n, 1) + } +} diff --git a/src/processParser/common/base/PlaceStyleHelper.ts b/src/processParser/common/base/PlaceStyleHelper.ts new file mode 100644 index 0000000..a1435be --- /dev/null +++ b/src/processParser/common/base/PlaceStyleHelper.ts @@ -0,0 +1,169 @@ +import { PlaceStyle, EdgeType} from '../../confClass.js' + +/** + * 排版方式,返回排版后的[下右上左]所对应原始边 rt = [,,,] 下0 右1 上2 左3 + * 比如 rt[0] = 3 表示现在的下边是原始的左边 + * rt[2] = 0 表示现在的上边是原始的下边 + * @param placeStyle 放置方式 + */ +export function getOriginalSides(placeStyle: PlaceStyle): number[] +{ + // let orgSides = [0, 1, 2, 3]; + let orgSides = [EdgeType.BOTTOM, EdgeType.RIGHT, EdgeType.TOP, EdgeType.LEFT] + switch (placeStyle) + { + case PlaceStyle.FRONT: // 正面 + break + case PlaceStyle.FRONT_TURN_RIGHT: // 正面右转 + orgSides[EdgeType.BOTTOM] = EdgeType.RIGHT + orgSides[EdgeType.RIGHT] = EdgeType.TOP + orgSides[EdgeType.TOP] = EdgeType.LEFT + orgSides[EdgeType.LEFT] = EdgeType.BOTTOM + break + case PlaceStyle.FRONT_TURN_BACK: // 正面后转 + orgSides[EdgeType.BOTTOM] = EdgeType.TOP + orgSides[EdgeType.RIGHT] = EdgeType.LEFT + orgSides[EdgeType.TOP] = EdgeType.BOTTOM + orgSides[EdgeType.LEFT] = EdgeType.RIGHT + break + case PlaceStyle.FRONT_TURN_LEFT: // 正面左转 + orgSides[EdgeType.BOTTOM] = EdgeType.LEFT + orgSides[EdgeType.RIGHT] = EdgeType.BOTTOM + orgSides[EdgeType.TOP] = EdgeType.RIGHT + orgSides[EdgeType.LEFT] = EdgeType.TOP + break + case PlaceStyle.BACK: // 反面 + orgSides[EdgeType.BOTTOM] = EdgeType.BOTTOM + orgSides[EdgeType.RIGHT] = EdgeType.LEFT + orgSides[EdgeType.TOP] = EdgeType.TOP + orgSides[EdgeType.LEFT] = EdgeType.RIGHT + break + case PlaceStyle.BACK_TURN_RIGHT: // 反面右转 + orgSides[EdgeType.BOTTOM] = EdgeType.LEFT + orgSides[EdgeType.RIGHT] = EdgeType.TOP + orgSides[EdgeType.TOP] = EdgeType.RIGHT + orgSides[EdgeType.LEFT] = EdgeType.BOTTOM + break + case PlaceStyle.BACK_TURN_BACK: // 反面后转 + orgSides[EdgeType.BOTTOM] = EdgeType.TOP + orgSides[EdgeType.RIGHT] = EdgeType.RIGHT + orgSides[EdgeType.TOP] = EdgeType.BOTTOM + orgSides[EdgeType.LEFT] = EdgeType.LEFT + break + case PlaceStyle.BACK_TURN_LEFT: // 反面左转 + orgSides[EdgeType.BOTTOM] = EdgeType.RIGHT + orgSides[EdgeType.RIGHT] = EdgeType.BOTTOM + orgSides[EdgeType.TOP] = EdgeType.LEFT + orgSides[EdgeType.LEFT] = EdgeType.TOP + break + default: + break + } + return orgSides +} + +/** + * 返回原始边[下右上左] 放置后位置 rt = [,,,,] + * 例如 rt[0] = 3 表示原始下边,现在放置后的新位置是左边 + * rt[2] = 0 表示原始上边,现在放置后的新位置是下边 + * @param placeStyle 放置方式 + */ +export function getPlacedSides(placeStyle: PlaceStyle): number[] +{ + // let orgSides = [0, 1, 2, 3]; + let orgSides = [EdgeType.BOTTOM, EdgeType.RIGHT, EdgeType.TOP, EdgeType.LEFT] + switch (placeStyle) + { + case PlaceStyle.FRONT: // 正面 + break + case PlaceStyle.FRONT_TURN_RIGHT: // 正面右转 + orgSides[EdgeType.BOTTOM] = EdgeType.LEFT + orgSides[EdgeType.RIGHT] = EdgeType.BOTTOM + orgSides[EdgeType.TOP] = EdgeType.RIGHT + orgSides[EdgeType.LEFT] = EdgeType.TOP + break + case PlaceStyle.FRONT_TURN_BACK: // 正面后转 + orgSides[EdgeType.BOTTOM] = EdgeType.TOP + orgSides[EdgeType.RIGHT] = EdgeType.LEFT + orgSides[EdgeType.TOP] = EdgeType.BOTTOM + orgSides[EdgeType.LEFT] = EdgeType.RIGHT + break + case PlaceStyle.FRONT_TURN_LEFT: // 正面左转 + orgSides[EdgeType.BOTTOM] = EdgeType.RIGHT + orgSides[EdgeType.RIGHT] = EdgeType.TOP + orgSides[EdgeType.TOP] = EdgeType.LEFT + orgSides[EdgeType.LEFT] = EdgeType.BOTTOM + break + case PlaceStyle.BACK: // 反面 + orgSides[EdgeType.BOTTOM] = EdgeType.BOTTOM + orgSides[EdgeType.RIGHT] = EdgeType.LEFT + orgSides[EdgeType.TOP] = EdgeType.TOP + orgSides[EdgeType.LEFT] = EdgeType.RIGHT + break + case PlaceStyle.BACK_TURN_RIGHT: // 反面右转 + orgSides[EdgeType.BOTTOM] = EdgeType.LEFT + orgSides[EdgeType.RIGHT] = EdgeType.TOP + orgSides[EdgeType.TOP] = EdgeType.RIGHT + orgSides[EdgeType.LEFT] = EdgeType.BOTTOM + break + case PlaceStyle.BACK_TURN_BACK: // 反面后转 + orgSides[EdgeType.BOTTOM] = EdgeType.TOP + orgSides[EdgeType.RIGHT] = EdgeType.RIGHT + orgSides[EdgeType.TOP] = EdgeType.BOTTOM + orgSides[EdgeType.LEFT] = EdgeType.LEFT + break + case PlaceStyle.BACK_TURN_LEFT: // 反面左转 + orgSides[EdgeType.BOTTOM] = EdgeType.RIGHT + orgSides[EdgeType.RIGHT] = EdgeType.BOTTOM + orgSides[EdgeType.TOP] = EdgeType.LEFT + orgSides[EdgeType.LEFT] = EdgeType.TOP + break + default: + break + } + return orgSides +} + +/** 获取排版位置 */ +export function getPlacePosition(x: number, y: number, width: number, length: number, placeStyle: PlaceStyle): any +{ + let posX = x + let posY = y + switch (placeStyle) + { + case PlaceStyle.FRONT: // 正面 + break + case PlaceStyle.FRONT_TURN_RIGHT: // 正面右转 + posX = y + posY = width - x + break + case PlaceStyle.FRONT_TURN_BACK: // 正面后转 + posX = width - x + posY = length - y + break + case PlaceStyle.FRONT_TURN_LEFT: // 正面左转 + posX = length - y + posY = x + break + case PlaceStyle.BACK: // 反面 + posX = width - x + posY = y + break + case PlaceStyle.BACK_TURN_RIGHT: // 反面右转 + posX = y + posY = x + break + case PlaceStyle.BACK_TURN_BACK: // 反面后转 + posX = x + posY = length - y + break + case PlaceStyle.BACK_TURN_LEFT: // 反面左转 + posX = length - y + posY = width - x + break + default: + break + } + + return { x: posX, y: posY } +} diff --git a/src/processParser/common/base/StringBase64.ts b/src/processParser/common/base/StringBase64.ts new file mode 100644 index 0000000..06b0b6f --- /dev/null +++ b/src/processParser/common/base/StringBase64.ts @@ -0,0 +1,152 @@ +import gb2312 from './gb2312.json' + +export class StringBase64 { + static ToBase64_gb2312(str: string): string { + let bin = this.toGB2312Bytes(str || '') + let str64 = this.encode(bin) + return str64 + } + + static _table = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'] + + /** 将二进制转换成base64 */ + static encode(bin: number[]): string { + let codes = [] + let un = 0 + un = bin.length % 3 + if (un == 1) + bin.push(0, 0) + else if (un == 2) + bin.push(0) + for (let i = 2; i < bin.length; i += 3) { + let c = bin[i - 2] << 16 + c |= bin[i - 1] << 8 + c |= bin[i] + codes.push(this._table[c >> 18 & 0x3F]) + codes.push(this._table[c >> 12 & 0x3F]) + codes.push(this._table[c >> 6 & 0x3F]) + codes.push(this._table[c & 0x3F]) + } + if (un >= 1) { + codes[codes.length - 1] = '=' + bin.pop() + } + if (un == 1) { + codes[codes.length - 2] = '=' + bin.pop() + } + return codes.join('') + } + + /** 将utf8 转成gb2312字符串 */ + static toGb2312String(str1: string): string { + let substr = '' + let a = '' + let b = '' + let c = '' + let i = -1 + i = str1.indexOf('%') + if (i == -1) { + return str1 + } + while (i != -1) { + if (i < 3) { + substr = substr + str1.substr(0, i - 1) + str1 = str1.substr(i + 1, str1.length - i) + a = str1.substr(0, 2) + str1 = str1.substr(2, str1.length - 2) + if ((Number.parseInt(`0x${a}`) & 0x80) == 0) { + substr = substr + String.fromCharCode(Number.parseInt(`0x${a}`)) + } + else if ((Number.parseInt(`0x${a}`) & 0xE0) == 0xC0) { // two byte + b = str1.substr(1, 2) + str1 = str1.substr(3, str1.length - 3) + let widechar = (Number.parseInt(`0x${a}`) & 0x1F) << 6 + widechar = widechar | (Number.parseInt(`0x${b}`) & 0x3F) + substr = substr + String.fromCharCode(widechar) + } + else { + b = str1.substr(1, 2) + str1 = str1.substr(3, str1.length - 3) + c = str1.substr(1, 2) + str1 = str1.substr(3, str1.length - 3) + let widechar = (Number.parseInt(`0x${a}`) & 0x0F) << 12 + widechar = widechar | ((Number.parseInt(`0x${b}`) & 0x3F) << 6) + widechar = widechar | (Number.parseInt(`0x${c}`) & 0x3F) + substr = substr + String.fromCharCode(widechar) + } + } + else { + substr = substr + str1.substring(0, i) + str1 = str1.substring(i) + } + i = str1.indexOf('%') + } + + return substr + str1 + } + + private static _unicode2gb + static getUnicode2gb() { + if (this._unicode2gb == null) { + this._unicode2gb = gb2312 + } + return this._unicode2gb + } + + static toGB2312Bytes(str: string): number[] { + let unicode2gb = this.getUnicode2gb() + let res = []; let len = str.length + for (let i = 0; i < len; i++) { + let code = str.charCodeAt(i) + if (code <= 0x007F) { + res.push(code) + } + else { + let hex = unicode2gb[`0x${code.toString(16).toUpperCase()}`] + let gb = Number(hex) + if (Number.isNaN(gb)) + gb = Number('0xA1F5') + + let arr = [] + while (gb > 0) { + arr.push(gb & 0xFF) + gb >>= 8 + } + while (arr.length > 0) res.push(arr.pop()) + } + } + return res + } + + static fromGB2312Bytes(gb2312Bytes: number[]): string { + let unicode2gb = this.getUnicode2gb() + let res = [] + // var i = 0 + for (let i = 0; i < gb2312Bytes.length; i++) { + let code = gb2312Bytes[i] + if (code < 0xA1 || code > 0xFE || i + 1 == gb2312Bytes.length) { + res.push(String.fromCharCode(code)) + continue + } + let c2 = gb2312Bytes[i + 1] + if (code < 0xA1 || code > 0xFE) { + res.push(String.fromCharCode(code)) + continue + } + let g = c2 | code << 8 + + c2 = Number(unicode2gb[`0x${g.toString(16).toUpperCase()}`]) + if (typeof c2 == 'undefined') { + res.push(String.fromCharCode(code)) + continue + } + res.push(String.fromCharCode(c2)) + i++ + } + return res.join('') + } +} diff --git a/src/processParser/common/base/StringBuidler.ts b/src/processParser/common/base/StringBuidler.ts new file mode 100644 index 0000000..4edafc4 --- /dev/null +++ b/src/processParser/common/base/StringBuidler.ts @@ -0,0 +1,82 @@ +export class StringBuider +{ + strings: string[] + + constructor() + { + this.strings = [] + } + + /** 插入 */ + Append(obj: any) + { + this.strings.push(obj) + } + + /** 插入文本 */ + AppendString(str: string) { this.strings.push(str) } + + /** 格式化 插入 */ + AppendFormat(str: string, ...arg: any[]): string + { + for (let i = 0; i < arg.length; i++) + { + let parent = `\\{${i}\\}` + let reg = new RegExp(parent, 'g') + str = str.replace(reg, arg[i]) + } + this.strings.push(str) + return str + } + + /** 添加一行(回车) */ + AppendLine(str = '') + { + if (str != null) + { + this.AppendString(str) + } + } + + /** 插入 */ + Insert(index: number, ...strs) + { + if (strs.length == 0) + return + if (index > this.strings.length) + index = this.strings.length + if (index < 0) + index = 0 + this.strings.splice(index, 0, ...strs) + } + + /** 删除片段 */ + Remove(startIndex: number, length: number): string[] + { + return this.strings.splice(startIndex, length) + } + + /** 所有文本 */ + ToString(): string + { + return this.strings.join('\r\n') + } + + /** 清空 */ + Clear() { this.strings = [] } + + /** 容量 */ + get size() { return this.strings.length } + /** 文本数 */ + get Count() { return this.strings.length } + + GetStringLength(): number + { + let length = 0 + for (const str of this.strings) + { + length += str.length + } + return length + } +} diff --git a/src/processParser/common/base/StringFormat.ts b/src/processParser/common/base/StringFormat.ts new file mode 100644 index 0000000..6ed1616 --- /dev/null +++ b/src/processParser/common/base/StringFormat.ts @@ -0,0 +1,126 @@ +export class StringFormat +{ + /** + * 对Date的扩展,将 Date 转化为指定格式的String + * 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符 + * 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) + * eg: + * (new Date()).pattern("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 + * (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2009-03-10 二 20:09:04 + * (new Date()).pattern("yyyy-MM-dd EE hh:mm:ss") ==> 2009-03-10 周二 08:09:04 + * (new Date()).pattern("yyyy-MM-dd EEE hh:mm:ss") ==> 2009-03-10 星期二 08:09:04 + * (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 + */ + static Date(date: Date, fmt): string + { + let o = { + 'M+': date.getMonth() + 1, // 月份 + 'd+': date.getDate(), // 日 + 'h+': date.getHours() % 12 == 0 ? 12 : date.getHours() % 12, // 小时 + 'H+': date.getHours(), // 小时 + 'm+': date.getMinutes(), // 分 + 's+': date.getSeconds(), // 秒 + 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度 + 'S': date.getMilliseconds(), // 毫秒 + } + let week = { + 0: '/u65e5', + 1: '/u4e00', + 2: '/u4e8c', + 3: '/u4e09', + 4: '/u56db', + 5: '/u4e94', + 6: '/u516d', + } + if (/(y+)/.test(fmt)) + { + fmt = fmt.replace(RegExp.$1, (`${date.getFullYear()}`).substr(4 - RegExp.$1.length)) + } + if (/(E+)/.test(fmt)) + { + fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? '/u661f/u671f' : '/u5468') : '') + week[`${date.getDay()}`]) + } + for (let k in o) + { + if (new RegExp(`(${k})`).test(fmt)) + { + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : ((`00${o[k]}`).substr((`${o[k]}`).length))) + } + } + return fmt + } + + /** 返回数字的固定小数点 123.00 */ + static number(value: number, bit: number): string + { + return value?.toFixed(bit).toString() + } + + static toFixed(value: number, bit: number = 3): number + { + let tt = 10 ** bit + return Math.round(value * tt) / tt + } + + static filterIllegalChar(str: string): string + { + // var pattern = new RegExp("[/:*?'<>|\\]"); + // var rs = ""; + // for (var i = 0; i < str.length; i++) + // { + // rs = rs + str.substr(i, 1).replace(pattern, ''); + // } + // return rs; + + let rt = str.replace(/\\/g, '').replace(/\:/g, '').replace(/\*/g, '').replace(/\?/g, '').replace(/\"/g, '').replace(/\/g, '').replace(/\|/g, '').replace(/\'/g, '') + return rt + } + + /** 文本格式化 */ + static format(str: string, ...args: any[]): string + { + let data = args + let tmpl = str + for (const item of tmpl.matchAll(/\{(.+?)\}/g)) + { + let parts = item[1].split(',').map(i => i.trim()) + let index = Number(parts[0]) + let arg = data[index] + + let val = (arg || '').toString() // 默认 + + if (arg instanceof Date) // 日期 + { + let fm = 'MM-dd HH;mm' + if (parts.length > 1) + { + fm = parts[1] + } + val = this.Date(arg, fm) + } + + if (parts.length > 1 && parts[1][0] === '#') + { + // {2,#3} -> 数字 转成3位 001,...023, + val = val.padStart(Number(parts[1].substring(1)), '0') + } + tmpl = tmpl.replace(item[0], val) + } + + return tmpl + } + + /** 实现右对齐,右边填充 (25,4,'*') => '25**' */ + static PadEnd(num: number, totalWidth: number, paddingChar: string): string + { + let str = num.toString() + return str.padEnd(totalWidth, paddingChar[0]) + } + + /** 实现右对齐,左边填充 (25,4,'0') => '0025' */ + static PadStart(num: number, totalWidth: number, paddingChar: string): string + { + let str = num.toString() + return str.padStart(totalWidth, paddingChar[0]) + } +} diff --git a/src/processParser/common/base/TextFile.ts b/src/processParser/common/base/TextFile.ts new file mode 100644 index 0000000..d4e24e0 --- /dev/null +++ b/src/processParser/common/base/TextFile.ts @@ -0,0 +1,119 @@ +export class textFile +{ + /** 保存单文件 text类型的 */ + static saveFile(filename: string, content: string) + { + let blob = new Blob([content], { type: 'text/plain;charset=utf-8' }) + this.saveAs(filename, blob) + } + + /** 读取文件 选择文件组件,读取文档处理函数 */ + static readFile(eleFile, fn_doText, fileType = '', fn_msg = null) + { + let noEleFile = !(eleFile) + if (noEleFile) + { + eleFile = document.createElement('input') + eleFile.type = 'file' + eleFile.accept = 'text/*' + eleFile.hidden = true + document.body.appendChild(eleFile) + } + + if (fileType && fileType != '') + eleFile.accept = fileType + let reader = new FileReader() + reader.onload = function (event) + { + let text = event.target.result + if (fn_doText) + fn_doText(text) + } + // 选择文件 + eleFile.onchange = function (event) + { + let file = event.target.files[0] + if (file) + { + reader.readAsText(file) + } + if (fn_msg != null) + { + fn_msg() + } + } + eleFile.click() + + if (noEleFile) + { + document.body.removeChild(eleFile) + } + } + + static getStringFromFile(eleFile, fileType = '', fn_msg = null): string + { + let noEleFile = !(eleFile) + if (noEleFile) + { + eleFile = document.createElement('input') + eleFile.type = 'file' + eleFile.accept = 'text/*' + eleFile.hidden = true + document.body.appendChild(eleFile) + } + + if (fileType && fileType != '') + eleFile.accept = fileType + let reader = new FileReader() + reader.onload = function (event) + { + let text = event.target.result + return text + } + // 选择文件 + eleFile.onchange = function (event) + { + let file = event.target.files[0] + if (file) + { + reader.readAsText(file) + } + if (fn_msg != null) + { + fn_msg() + } + } + eleFile.click() + + if (noEleFile) + { + document.body.removeChild(eleFile) + } + return '' + } + + /** 保存文件 */ + static saveAs(fileName: string, data: Blob) + { + // 创建隐藏的可下载链接 + let eleLink = document.createElement('a') + eleLink.download = fileName + eleLink.style.display = 'none' + eleLink.href = URL.createObjectURL(data) + // 触发点击 + document.body.appendChild(eleLink) + eleLink.click() + // 然后移除 + document.body.removeChild(eleLink) + } + + static readFile2() + { + let rf = document.createElement('input') + rf.type = 'file' + rf.accept = 'text/*' + rf.hidden = true + + document.body.removeChild(rf) + } +} diff --git a/src/processParser/common/base/ZipFile.ts b/src/processParser/common/base/ZipFile.ts new file mode 100644 index 0000000..4f37caf --- /dev/null +++ b/src/processParser/common/base/ZipFile.ts @@ -0,0 +1,136 @@ +import { saveAs } from 'file-saver' +import type { ZipProvider } from '../zip.js' +import { DefaultZipProvider, FileInfo } from '../zip.js' +import { StringBuider } from './StringBuidler.js' +import { StringBase64 } from './StringBase64.js' + +export class FileZip +{ + zipName: string + // zip对象 + private zip: ZipProvider = DefaultZipProvider() + // 文件数据 + private stringBuider: StringBuider + + constructor() + { + this.stringBuider = new StringBuider() + this.SetZipFileName('') + } + + /** 设置zip文件名 */ + SetZipFileName(_name: string) + { + this.zipName = _name + } + + getZipFileName() + { + return this.zipName + } + + PushBlobFile(fileName: string, content) + { + let newFile = new FileInfo(fileName, content, false) + newFile.binary = true + this.zip.addFile(newFile) + } + + // /**添加文件 */ + // PushFile(fileName: string, fileText: string, isBase64 = false, isgb2312 = false, isUtf8Bom=false) + // { + // if (isgb2312) + // { + // isBase64 = true; + // fileText = StringBase64.ToBase64_gb2312(fileText); + // } + // if(isUtf8Bom) + // { + // fileText = String.fromCharCode(parseInt("0xFEFF")) + fileText; + // } + // let newFile = new FileInfo(fileName, fileText, isBase64); + // this.zip.addFile(newFile); + // } + + /** 添加文件 fileName文件名 fileText文件内容 isBase64是否base64 encoding编码格式(gb2312, utf8bom) */ + PushFile(fileName: string, fileText: string, isBase64 = false, encoding: string = 'gb2312') + { + if (encoding == 'gb2312') + { + isBase64 = true + fileText = StringBase64.ToBase64_gb2312(fileText) + } + if (encoding == 'utf8bom') + { + fileText = String.fromCharCode(Number.parseInt('0xFEFF')) + fileText + } + let newFile = new FileInfo(fileName, fileText, isBase64) + this.zip.addFile(newFile) + } + + pushFile_withBom(fileName: string, fileText: string) + { + this.PushFile(fileName, fileText, false, 'utf8bom') + } + + PushFile_GB2312(fileName: string, fileText: string) + { + this.PushFile(fileName, fileText, false, 'gb2312') + } + + /** 新建文件 */ + NewFile() + { + this.stringBuider.Clear() + } + + /** 推送文本到缓存区 */ + AppentText(comment: string) + { + this.stringBuider.Append(comment) + } + + // //将缓存区的文本 保存起来 + // SaveFile(fileName: string, isgb2312: boolean = false, isutf8bom = false) + // { + // let fileText = this.stringBuider.ToString(); + // this.stringBuider.Clear(); + // this.PushFile(fileName, fileText, false, isgb2312, isutf8bom); + // } + + // 将缓存区的文本 保存起来 + SaveFile(fileName: string, encoding: string = 'gb2312') + { + let fileText = this.stringBuider.ToString() + this.stringBuider.Clear() + this.PushFile(fileName, fileText, false, encoding) + } + + // 下载zip文件 + async Download(zipName = '') + { + let content = await this.zip.saveAsync() + // textFile.saveAs(FileZip.zipName,content); + let name = zipName || this.zipName + saveAs(content, name) + } + + static WriteFile(fname: string, data: BlobPart) + { + let blob = new Blob([data], { type: 'octet/stream' }) + + let download = document.createElement('a') + download.download = fname + download.href = window.URL.createObjectURL(blob) + download.style.display = 'none' + download.onclick = function () + { + document.body.removeChild(download) + } + document.body.appendChild(download) + + download.click() + }; +} + +export { FileInfo } diff --git a/src/processParser/common/base/gb2312.json b/src/processParser/common/base/gb2312.json new file mode 100644 index 0000000..8159ac5 --- /dev/null +++ b/src/processParser/common/base/gb2312.json @@ -0,0 +1,6965 @@ +{ + "0x3001": "0xA1A2", + "0x3002": "0xA1A3", + "0x00B7": "0xA1A4", + "0x02C9": "0xA1A5", + "0x02C7": "0xA1A6", + "0x00A8": "0xA1A7", + "0x3003": "0xA1A8", + "0x2014": "0xA1AA", + "0xFF5E": "0xA1AB", + "0x2016": "0xA1AC", + "0x2026": "0xA1AD", + "0x2018": "0xA1AE", + "0x2019": "0xA1AF", + "0x201C": "0xA1B0", + "0x201D": "0xA1B1", + "0x3014": "0xA1B2", + "0x3015": "0xA1B3", + "0x3008": "0xA1B4", + "0x3009": "0xA1B5", + "0x300A": "0xA1B6", + "0x300B": "0xA1B7", + "0x300C": "0xA1B8", + "0x300D": "0xA1B9", + "0x300E": "0xA1BA", + "0x300F": "0xA1BB", + "0x3016": "0xA1BC", + "0x3017": "0xA1BD", + "0x3010": "0xA1BE", + "0x3011": "0xA1BF", + "0x00B1": "0xA1C0", + "0x00D7": "0xA1C1", + "0x00F7": "0xA1C2", + "0x2236": "0xA1C3", + "0x2227": "0xA1C4", + "0x2238": "0xA1C5", + "0x2211": "0xA1C6", + "0x220F": "0xA1C7", + "0x222A": "0xA1C8", + "0x2229": "0xA1C9", + "0x2208": "0xA1CA", + "0x2237": "0xA1CB", + "0x221A": "0xA1CC", + "0x22A5": "0xA1CD", + "0x2225": "0xA1CE", + "0x2220": "0xA1CF", + "0x2312": "0xA1D0", + "0x2299": "0xA1D1", + "0x222B": "0xA1D2", + "0x222E": "0xA1D3", + "0x2261": "0xA1D4", + "0x224C": "0xA1D5", + "0x2248": "0xA1D6", + "0x223D": "0xA1D7", + "0x221D": "0xA1D8", + "0x2260": "0xA1D9", + "0x226E": "0xA1DA", + "0x226F": "0xA1DB", + "0x2264": "0xA1DC", + "0x2265": "0xA1DD", + "0x221E": "0xA1DE", + "0x2235": "0xA1DF", + "0x2234": "0xA1E0", + "0x2642": "0xA1E1", + "0x2640": "0xA1E2", + "0x00B0": "0xA1E3", + "0x2032": "0xA1E4", + "0x2033": "0xA1E5", + "0x2103": "0xA1E6", + "0xFF04": "0xA1E7", + "0x00A4": "0xA1E8", + "0xFFE0": "0xA1E9", + "0xFFE1": "0xA1EA", + "0x2030": "0xA1EB", + "0x00A7": "0xA1EC", + "0x2116": "0xA1ED", + "0x2606": "0xA1EE", + "0x2605": "0xA1EF", + "0x25CB": "0xA1F0", + "0x25CF": "0xA1F1", + "0x25CE": "0xA1F2", + "0x25C7": "0xA1F3", + "0x25C6": "0xA1F4", + "0x25A1": "0xA1F5", + "0x25A0": "0xA1F6", + "0x25B3": "0xA1F7", + "0x25B2": "0xA1F8", + "0x203B": "0xA1F9", + "0x2192": "0xA1FA", + "0x2190": "0xA1FB", + "0x2191": "0xA1FC", + "0x2193": "0xA1FD", + "0x3013": "0xA1FE", + "0x2170": "0xA2A1", + "0x2171": "0xA2A2", + "0x2172": "0xA2A3", + "0x2173": "0xA2A4", + "0x2174": "0xA2A5", + "0x2175": "0xA2A6", + "0x2176": "0xA2A7", + "0x2177": "0xA2A8", + "0x2178": "0xA2A9", + "0x2179": "0xA2AA", + "0x2488": "0xA2B1", + "0x2489": "0xA2B2", + "0x248A": "0xA2B3", + "0x248B": "0xA2B4", + "0x248C": "0xA2B5", + "0x248D": "0xA2B6", + "0x248E": "0xA2B7", + "0x248F": "0xA2B8", + "0x2490": "0xA2B9", + "0x2491": "0xA2BA", + "0x2492": "0xA2BB", + "0x2493": "0xA2BC", + "0x2494": "0xA2BD", + "0x2495": "0xA2BE", + "0x2496": "0xA2BF", + "0x2497": "0xA2C0", + "0x2498": "0xA2C1", + "0x2499": "0xA2C2", + "0x249A": "0xA2C3", + "0x249B": "0xA2C4", + "0x2474": "0xA2C5", + "0x2475": "0xA2C6", + "0x2476": "0xA2C7", + "0x2477": "0xA2C8", + "0x2478": "0xA2C9", + "0x2479": "0xA2CA", + "0x247A": "0xA2CB", + "0x247B": "0xA2CC", + "0x247C": "0xA2CD", + "0x247D": "0xA2CE", + "0x247E": "0xA2CF", + "0x247F": "0xA2D0", + "0x2480": "0xA2D1", + "0x2481": "0xA2D2", + "0x2482": "0xA2D3", + "0x2483": "0xA2D4", + "0x2484": "0xA2D5", + "0x2485": "0xA2D6", + "0x2486": "0xA2D7", + "0x2487": "0xA2D8", + "0x2460": "0xA2D9", + "0x2461": "0xA2DA", + "0x2462": "0xA2DB", + "0x2463": "0xA2DC", + "0x2464": "0xA2DD", + "0x2465": "0xA2DE", + "0x2466": "0xA2DF", + "0x2467": "0xA2E0", + "0x2468": "0xA2E1", + "0x2469": "0xA2E2", + "0x3220": "0xA2E5", + "0x3221": "0xA2E6", + "0x3222": "0xA2E7", + "0x3223": "0xA2E8", + "0x3224": "0xA2E9", + "0x3225": "0xA2EA", + "0x3226": "0xA2EB", + "0x3227": "0xA2EC", + "0x3228": "0xA2ED", + "0x3229": "0xA2EE", + "0x2160": "0xA2F1", + "0x2161": "0xA2F2", + "0x2162": "0xA2F3", + "0x2163": "0xA2F4", + "0x2164": "0xA2F5", + "0x2165": "0xA2F6", + "0x2166": "0xA2F7", + "0x2167": "0xA2F8", + "0x2168": "0xA2F9", + "0x2169": "0xA2FA", + "0x216A": "0xA2FB", + "0x216B": "0xA2FC", + "0xFF01": "0xA3A1", + "0xFFE5": "0xA3A4", + "0xFF08": "0xA3A8", + "0xFF09": "0xA3A9", + "0xFF0C": "0xA3AC", + "0xFF1A": "0xA3BA", + "0xFF1B": "0xA3BB", + "0xFF1F": "0xA3BF", + "0x2105": "0xA847", + "0x2109": "0xA848", + "0x338E": "0xA94A", + "0x338F": "0xA94B", + "0x339C": "0xA94C", + "0x339D": "0xA94D", + "0x33A1": "0xA94F", + "0x33C4": "0xA950", + "0x33CE": "0xA951", + "0x33D1": "0xA952", + "0x33D2": "0xA953", + "0x33D5": "0xA954", + "0x2121": "0xA959", + "0x554A": "0xB0A1", + "0x963F": "0xB0A2", + "0x57C3": "0xB0A3", + "0x6328": "0xB0A4", + "0x54CE": "0xB0A5", + "0x5509": "0xB0A6", + "0x54C0": "0xB0A7", + "0x7691": "0xB0A8", + "0x764C": "0xB0A9", + "0x853C": "0xB0AA", + "0x77EE": "0xB0AB", + "0x827E": "0xB0AC", + "0x788D": "0xB0AD", + "0x7231": "0xB0AE", + "0x9698": "0xB0AF", + "0x978D": "0xB0B0", + "0x6C28": "0xB0B1", + "0x5B89": "0xB0B2", + "0x4FFA": "0xB0B3", + "0x6309": "0xB0B4", + "0x6697": "0xB0B5", + "0x5CB8": "0xB0B6", + "0x80FA": "0xB0B7", + "0x6848": "0xB0B8", + "0x80AE": "0xB0B9", + "0x6602": "0xB0BA", + "0x76CE": "0xB0BB", + "0x51F9": "0xB0BC", + "0x6556": "0xB0BD", + "0x71AC": "0xB0BE", + "0x7FF1": "0xB0BF", + "0x8884": "0xB0C0", + "0x50B2": "0xB0C1", + "0x5965": "0xB0C2", + "0x61CA": "0xB0C3", + "0x6FB3": "0xB0C4", + "0x82AD": "0xB0C5", + "0x634C": "0xB0C6", + "0x6252": "0xB0C7", + "0x53ED": "0xB0C8", + "0x5427": "0xB0C9", + "0x7B06": "0xB0CA", + "0x516B": "0xB0CB", + "0x75A4": "0xB0CC", + "0x5DF4": "0xB0CD", + "0x62D4": "0xB0CE", + "0x8DCB": "0xB0CF", + "0x9776": "0xB0D0", + "0x628A": "0xB0D1", + "0x8019": "0xB0D2", + "0x575D": "0xB0D3", + "0x9738": "0xB0D4", + "0x7F62": "0xB0D5", + "0x7238": "0xB0D6", + "0x767D": "0xB0D7", + "0x67CF": "0xB0D8", + "0x767E": "0xB0D9", + "0x6446": "0xB0DA", + "0x4F70": "0xB0DB", + "0x8D25": "0xB0DC", + "0x62DC": "0xB0DD", + "0x7A17": "0xB0DE", + "0x6591": "0xB0DF", + "0x73ED": "0xB0E0", + "0x642C": "0xB0E1", + "0x6273": "0xB0E2", + "0x822C": "0xB0E3", + "0x9881": "0xB0E4", + "0x677F": "0xB0E5", + "0x7248": "0xB0E6", + "0x626E": "0xB0E7", + "0x62CC": "0xB0E8", + "0x4F34": "0xB0E9", + "0x74E3": "0xB0EA", + "0x534A": "0xB0EB", + "0x529E": "0xB0EC", + "0x7ECA": "0xB0ED", + "0x90A6": "0xB0EE", + "0x5E2E": "0xB0EF", + "0x6886": "0xB0F0", + "0x699C": "0xB0F1", + "0x8180": "0xB0F2", + "0x7ED1": "0xB0F3", + "0x68D2": "0xB0F4", + "0x78C5": "0xB0F5", + "0x868C": "0xB0F6", + "0x9551": "0xB0F7", + "0x508D": "0xB0F8", + "0x8C24": "0xB0F9", + "0x82DE": "0xB0FA", + "0x80DE": "0xB0FB", + "0x5305": "0xB0FC", + "0x8912": "0xB0FD", + "0x5265": "0xB0FE", + "0x8584": "0xB1A1", + "0x96F9": "0xB1A2", + "0x4FDD": "0xB1A3", + "0x5821": "0xB1A4", + "0x9971": "0xB1A5", + "0x5B9D": "0xB1A6", + "0x62B1": "0xB1A7", + "0x62A5": "0xB1A8", + "0x66B4": "0xB1A9", + "0x8C79": "0xB1AA", + "0x9C8D": "0xB1AB", + "0x7206": "0xB1AC", + "0x676F": "0xB1AD", + "0x7891": "0xB1AE", + "0x60B2": "0xB1AF", + "0x5351": "0xB1B0", + "0x5317": "0xB1B1", + "0x8F88": "0xB1B2", + "0x80CC": "0xB1B3", + "0x8D1D": "0xB1B4", + "0x94A1": "0xB1B5", + "0x500D": "0xB1B6", + "0x72C8": "0xB1B7", + "0x5907": "0xB1B8", + "0x60EB": "0xB1B9", + "0x7119": "0xB1BA", + "0x88AB": "0xB1BB", + "0x5954": "0xB1BC", + "0x82EF": "0xB1BD", + "0x672C": "0xB1BE", + "0x7B28": "0xB1BF", + "0x5D29": "0xB1C0", + "0x7EF7": "0xB1C1", + "0x752D": "0xB1C2", + "0x6CF5": "0xB1C3", + "0x8E66": "0xB1C4", + "0x8FF8": "0xB1C5", + "0x903C": "0xB1C6", + "0x9F3B": "0xB1C7", + "0x6BD4": "0xB1C8", + "0x9119": "0xB1C9", + "0x7B14": "0xB1CA", + "0x5F7C": "0xB1CB", + "0x78A7": "0xB1CC", + "0x84D6": "0xB1CD", + "0x853D": "0xB1CE", + "0x6BD5": "0xB1CF", + "0x6BD9": "0xB1D0", + "0x6BD6": "0xB1D1", + "0x5E01": "0xB1D2", + "0x5E87": "0xB1D3", + "0x75F9": "0xB1D4", + "0x95ED": "0xB1D5", + "0x655D": "0xB1D6", + "0x5F0A": "0xB1D7", + "0x5FC5": "0xB1D8", + "0x8F9F": "0xB1D9", + "0x58C1": "0xB1DA", + "0x81C2": "0xB1DB", + "0x907F": "0xB1DC", + "0x965B": "0xB1DD", + "0x97AD": "0xB1DE", + "0x8FB9": "0xB1DF", + "0x7F16": "0xB1E0", + "0x8D2C": "0xB1E1", + "0x6241": "0xB1E2", + "0x4FBF": "0xB1E3", + "0x53D8": "0xB1E4", + "0x535E": "0xB1E5", + "0x8FA8": "0xB1E6", + "0x8FA9": "0xB1E7", + "0x8FAB": "0xB1E8", + "0x904D": "0xB1E9", + "0x6807": "0xB1EA", + "0x5F6A": "0xB1EB", + "0x8198": "0xB1EC", + "0x8868": "0xB1ED", + "0x9CD6": "0xB1EE", + "0x618B": "0xB1EF", + "0x522B": "0xB1F0", + "0x762A": "0xB1F1", + "0x5F6C": "0xB1F2", + "0x658C": "0xB1F3", + "0x6FD2": "0xB1F4", + "0x6EE8": "0xB1F5", + "0x5BBE": "0xB1F6", + "0x6448": "0xB1F7", + "0x5175": "0xB1F8", + "0x51B0": "0xB1F9", + "0x67C4": "0xB1FA", + "0x4E19": "0xB1FB", + "0x79C9": "0xB1FC", + "0x997C": "0xB1FD", + "0x70B3": "0xB1FE", + "0x75C5": "0xB2A1", + "0x5E76": "0xB2A2", + "0x73BB": "0xB2A3", + "0x83E0": "0xB2A4", + "0x64AD": "0xB2A5", + "0x62E8": "0xB2A6", + "0x94B5": "0xB2A7", + "0x6CE2": "0xB2A8", + "0x535A": "0xB2A9", + "0x52C3": "0xB2AA", + "0x640F": "0xB2AB", + "0x94C2": "0xB2AC", + "0x7B94": "0xB2AD", + "0x4F2F": "0xB2AE", + "0x5E1B": "0xB2AF", + "0x8236": "0xB2B0", + "0x8116": "0xB2B1", + "0x818A": "0xB2B2", + "0x6E24": "0xB2B3", + "0x6CCA": "0xB2B4", + "0x9A73": "0xB2B5", + "0x6355": "0xB2B6", + "0x535C": "0xB2B7", + "0x54FA": "0xB2B8", + "0x8865": "0xB2B9", + "0x57E0": "0xB2BA", + "0x4E0D": "0xB2BB", + "0x5E03": "0xB2BC", + "0x6B65": "0xB2BD", + "0x7C3F": "0xB2BE", + "0x90E8": "0xB2BF", + "0x6016": "0xB2C0", + "0x64E6": "0xB2C1", + "0x731C": "0xB2C2", + "0x88C1": "0xB2C3", + "0x6750": "0xB2C4", + "0x624D": "0xB2C5", + "0x8D22": "0xB2C6", + "0x776C": "0xB2C7", + "0x8E29": "0xB2C8", + "0x91C7": "0xB2C9", + "0x5F69": "0xB2CA", + "0x83DC": "0xB2CB", + "0x8521": "0xB2CC", + "0x9910": "0xB2CD", + "0x53C2": "0xB2CE", + "0x8695": "0xB2CF", + "0x6B8B": "0xB2D0", + "0x60ED": "0xB2D1", + "0x60E8": "0xB2D2", + "0x707F": "0xB2D3", + "0x82CD": "0xB2D4", + "0x8231": "0xB2D5", + "0x4ED3": "0xB2D6", + "0x6CA7": "0xB2D7", + "0x85CF": "0xB2D8", + "0x64CD": "0xB2D9", + "0x7CD9": "0xB2DA", + "0x69FD": "0xB2DB", + "0x66F9": "0xB2DC", + "0x8349": "0xB2DD", + "0x5395": "0xB2DE", + "0x7B56": "0xB2DF", + "0x4FA7": "0xB2E0", + "0x518C": "0xB2E1", + "0x6D4B": "0xB2E2", + "0x5C42": "0xB2E3", + "0x8E6D": "0xB2E4", + "0x63D2": "0xB2E5", + "0x53C9": "0xB2E6", + "0x832C": "0xB2E7", + "0x8336": "0xB2E8", + "0x67E5": "0xB2E9", + "0x78B4": "0xB2EA", + "0x643D": "0xB2EB", + "0x5BDF": "0xB2EC", + "0x5C94": "0xB2ED", + "0x5DEE": "0xB2EE", + "0x8BE7": "0xB2EF", + "0x62C6": "0xB2F0", + "0x67F4": "0xB2F1", + "0x8C7A": "0xB2F2", + "0x6400": "0xB2F3", + "0x63BA": "0xB2F4", + "0x8749": "0xB2F5", + "0x998B": "0xB2F6", + "0x8C17": "0xB2F7", + "0x7F20": "0xB2F8", + "0x94F2": "0xB2F9", + "0x4EA7": "0xB2FA", + "0x9610": "0xB2FB", + "0x98A4": "0xB2FC", + "0x660C": "0xB2FD", + "0x7316": "0xB2FE", + "0x573A": "0xB3A1", + "0x5C1D": "0xB3A2", + "0x5E38": "0xB3A3", + "0x957F": "0xB3A4", + "0x507F": "0xB3A5", + "0x80A0": "0xB3A6", + "0x5382": "0xB3A7", + "0x655E": "0xB3A8", + "0x7545": "0xB3A9", + "0x5531": "0xB3AA", + "0x5021": "0xB3AB", + "0x8D85": "0xB3AC", + "0x6284": "0xB3AD", + "0x949E": "0xB3AE", + "0x671D": "0xB3AF", + "0x5632": "0xB3B0", + "0x6F6E": "0xB3B1", + "0x5DE2": "0xB3B2", + "0x5435": "0xB3B3", + "0x7092": "0xB3B4", + "0x8F66": "0xB3B5", + "0x626F": "0xB3B6", + "0x64A4": "0xB3B7", + "0x63A3": "0xB3B8", + "0x5F7B": "0xB3B9", + "0x6F88": "0xB3BA", + "0x90F4": "0xB3BB", + "0x81E3": "0xB3BC", + "0x8FB0": "0xB3BD", + "0x5C18": "0xB3BE", + "0x6668": "0xB3BF", + "0x5FF1": "0xB3C0", + "0x6C89": "0xB3C1", + "0x9648": "0xB3C2", + "0x8D81": "0xB3C3", + "0x886C": "0xB3C4", + "0x6491": "0xB3C5", + "0x79F0": "0xB3C6", + "0x57CE": "0xB3C7", + "0x6A59": "0xB3C8", + "0x6210": "0xB3C9", + "0x5448": "0xB3CA", + "0x4E58": "0xB3CB", + "0x7A0B": "0xB3CC", + "0x60E9": "0xB3CD", + "0x6F84": "0xB3CE", + "0x8BDA": "0xB3CF", + "0x627F": "0xB3D0", + "0x901E": "0xB3D1", + "0x9A8B": "0xB3D2", + "0x79E4": "0xB3D3", + "0x5403": "0xB3D4", + "0x75F4": "0xB3D5", + "0x6301": "0xB3D6", + "0x5319": "0xB3D7", + "0x6C60": "0xB3D8", + "0x8FDF": "0xB3D9", + "0x5F1B": "0xB3DA", + "0x9A70": "0xB3DB", + "0x803B": "0xB3DC", + "0x9F7F": "0xB3DD", + "0x4F88": "0xB3DE", + "0x5C3A": "0xB3DF", + "0x8D64": "0xB3E0", + "0x7FC5": "0xB3E1", + "0x65A5": "0xB3E2", + "0x70BD": "0xB3E3", + "0x5145": "0xB3E4", + "0x51B2": "0xB3E5", + "0x866B": "0xB3E6", + "0x5D07": "0xB3E7", + "0x5BA0": "0xB3E8", + "0x62BD": "0xB3E9", + "0x916C": "0xB3EA", + "0x7574": "0xB3EB", + "0x8E0C": "0xB3EC", + "0x7A20": "0xB3ED", + "0x6101": "0xB3EE", + "0x7B79": "0xB3EF", + "0x4EC7": "0xB3F0", + "0x7EF8": "0xB3F1", + "0x7785": "0xB3F2", + "0x4E11": "0xB3F3", + "0x81ED": "0xB3F4", + "0x521D": "0xB3F5", + "0x51FA": "0xB3F6", + "0x6A71": "0xB3F7", + "0x53A8": "0xB3F8", + "0x8E87": "0xB3F9", + "0x9504": "0xB3FA", + "0x96CF": "0xB3FB", + "0x6EC1": "0xB3FC", + "0x9664": "0xB3FD", + "0x695A": "0xB3FE", + "0x7840": "0xB4A1", + "0x50A8": "0xB4A2", + "0x77D7": "0xB4A3", + "0x6410": "0xB4A4", + "0x89E6": "0xB4A5", + "0x5904": "0xB4A6", + "0x63E3": "0xB4A7", + "0x5DDD": "0xB4A8", + "0x7A7F": "0xB4A9", + "0x693D": "0xB4AA", + "0x4F20": "0xB4AB", + "0x8239": "0xB4AC", + "0x5598": "0xB4AD", + "0x4E32": "0xB4AE", + "0x75AE": "0xB4AF", + "0x7A97": "0xB4B0", + "0x5E62": "0xB4B1", + "0x5E8A": "0xB4B2", + "0x95EF": "0xB4B3", + "0x521B": "0xB4B4", + "0x5439": "0xB4B5", + "0x708A": "0xB4B6", + "0x6376": "0xB4B7", + "0x9524": "0xB4B8", + "0x5782": "0xB4B9", + "0x6625": "0xB4BA", + "0x693F": "0xB4BB", + "0x9187": "0xB4BC", + "0x5507": "0xB4BD", + "0x6DF3": "0xB4BE", + "0x7EAF": "0xB4BF", + "0x8822": "0xB4C0", + "0x6233": "0xB4C1", + "0x7EF0": "0xB4C2", + "0x75B5": "0xB4C3", + "0x8328": "0xB4C4", + "0x78C1": "0xB4C5", + "0x96CC": "0xB4C6", + "0x8F9E": "0xB4C7", + "0x6148": "0xB4C8", + "0x74F7": "0xB4C9", + "0x8BCD": "0xB4CA", + "0x6B64": "0xB4CB", + "0x523A": "0xB4CC", + "0x8D50": "0xB4CD", + "0x6B21": "0xB4CE", + "0x806A": "0xB4CF", + "0x8471": "0xB4D0", + "0x56F1": "0xB4D1", + "0x5306": "0xB4D2", + "0x4ECE": "0xB4D3", + "0x4E1B": "0xB4D4", + "0x51D1": "0xB4D5", + "0x7C97": "0xB4D6", + "0x918B": "0xB4D7", + "0x7C07": "0xB4D8", + "0x4FC3": "0xB4D9", + "0x8E7F": "0xB4DA", + "0x7BE1": "0xB4DB", + "0x7A9C": "0xB4DC", + "0x6467": "0xB4DD", + "0x5D14": "0xB4DE", + "0x50AC": "0xB4DF", + "0x8106": "0xB4E0", + "0x7601": "0xB4E1", + "0x7CB9": "0xB4E2", + "0x6DEC": "0xB4E3", + "0x7FE0": "0xB4E4", + "0x6751": "0xB4E5", + "0x5B58": "0xB4E6", + "0x5BF8": "0xB4E7", + "0x78CB": "0xB4E8", + "0x64AE": "0xB4E9", + "0x6413": "0xB4EA", + "0x63AA": "0xB4EB", + "0x632B": "0xB4EC", + "0x9519": "0xB4ED", + "0x642D": "0xB4EE", + "0x8FBE": "0xB4EF", + "0x7B54": "0xB4F0", + "0x7629": "0xB4F1", + "0x6253": "0xB4F2", + "0x5927": "0xB4F3", + "0x5446": "0xB4F4", + "0x6B79": "0xB4F5", + "0x50A3": "0xB4F6", + "0x6234": "0xB4F7", + "0x5E26": "0xB4F8", + "0x6B86": "0xB4F9", + "0x4EE3": "0xB4FA", + "0x8D37": "0xB4FB", + "0x888B": "0xB4FC", + "0x5F85": "0xB4FD", + "0x902E": "0xB4FE", + "0x6020": "0xB5A1", + "0x803D": "0xB5A2", + "0x62C5": "0xB5A3", + "0x4E39": "0xB5A4", + "0x5355": "0xB5A5", + "0x90F8": "0xB5A6", + "0x63B8": "0xB5A7", + "0x80C6": "0xB5A8", + "0x65E6": "0xB5A9", + "0x6C2E": "0xB5AA", + "0x4F46": "0xB5AB", + "0x60EE": "0xB5AC", + "0x6DE1": "0xB5AD", + "0x8BDE": "0xB5AE", + "0x5F39": "0xB5AF", + "0x86CB": "0xB5B0", + "0x5F53": "0xB5B1", + "0x6321": "0xB5B2", + "0x515A": "0xB5B3", + "0x8361": "0xB5B4", + "0x6863": "0xB5B5", + "0x5200": "0xB5B6", + "0x6363": "0xB5B7", + "0x8E48": "0xB5B8", + "0x5012": "0xB5B9", + "0x5C9B": "0xB5BA", + "0x7977": "0xB5BB", + "0x5BFC": "0xB5BC", + "0x5230": "0xB5BD", + "0x7A3B": "0xB5BE", + "0x60BC": "0xB5BF", + "0x9053": "0xB5C0", + "0x76D7": "0xB5C1", + "0x5FB7": "0xB5C2", + "0x5F97": "0xB5C3", + "0x7684": "0xB5C4", + "0x8E6C": "0xB5C5", + "0x706F": "0xB5C6", + "0x767B": "0xB5C7", + "0x7B49": "0xB5C8", + "0x77AA": "0xB5C9", + "0x51F3": "0xB5CA", + "0x9093": "0xB5CB", + "0x5824": "0xB5CC", + "0x4F4E": "0xB5CD", + "0x6EF4": "0xB5CE", + "0x8FEA": "0xB5CF", + "0x654C": "0xB5D0", + "0x7B1B": "0xB5D1", + "0x72C4": "0xB5D2", + "0x6DA4": "0xB5D3", + "0x7FDF": "0xB5D4", + "0x5AE1": "0xB5D5", + "0x62B5": "0xB5D6", + "0x5E95": "0xB5D7", + "0x5730": "0xB5D8", + "0x8482": "0xB5D9", + "0x7B2C": "0xB5DA", + "0x5E1D": "0xB5DB", + "0x5F1F": "0xB5DC", + "0x9012": "0xB5DD", + "0x7F14": "0xB5DE", + "0x98A0": "0xB5DF", + "0x6382": "0xB5E0", + "0x6EC7": "0xB5E1", + "0x7898": "0xB5E2", + "0x70B9": "0xB5E3", + "0x5178": "0xB5E4", + "0x975B": "0xB5E5", + "0x57AB": "0xB5E6", + "0x7535": "0xB5E7", + "0x4F43": "0xB5E8", + "0x7538": "0xB5E9", + "0x5E97": "0xB5EA", + "0x60E6": "0xB5EB", + "0x5960": "0xB5EC", + "0x6DC0": "0xB5ED", + "0x6BBF": "0xB5EE", + "0x7889": "0xB5EF", + "0x53FC": "0xB5F0", + "0x96D5": "0xB5F1", + "0x51CB": "0xB5F2", + "0x5201": "0xB5F3", + "0x6389": "0xB5F4", + "0x540A": "0xB5F5", + "0x9493": "0xB5F6", + "0x8C03": "0xB5F7", + "0x8DCC": "0xB5F8", + "0x7239": "0xB5F9", + "0x789F": "0xB5FA", + "0x8776": "0xB5FB", + "0x8FED": "0xB5FC", + "0x8C0D": "0xB5FD", + "0x53E0": "0xB5FE", + "0x4E01": "0xB6A1", + "0x76EF": "0xB6A2", + "0x53EE": "0xB6A3", + "0x9489": "0xB6A4", + "0x9876": "0xB6A5", + "0x9F0E": "0xB6A6", + "0x952D": "0xB6A7", + "0x5B9A": "0xB6A8", + "0x8BA2": "0xB6A9", + "0x4E22": "0xB6AA", + "0x4E1C": "0xB6AB", + "0x51AC": "0xB6AC", + "0x8463": "0xB6AD", + "0x61C2": "0xB6AE", + "0x52A8": "0xB6AF", + "0x680B": "0xB6B0", + "0x4F97": "0xB6B1", + "0x606B": "0xB6B2", + "0x51BB": "0xB6B3", + "0x6D1E": "0xB6B4", + "0x515C": "0xB6B5", + "0x6296": "0xB6B6", + "0x6597": "0xB6B7", + "0x9661": "0xB6B8", + "0x8C46": "0xB6B9", + "0x9017": "0xB6BA", + "0x75D8": "0xB6BB", + "0x90FD": "0xB6BC", + "0x7763": "0xB6BD", + "0x6BD2": "0xB6BE", + "0x728A": "0xB6BF", + "0x72EC": "0xB6C0", + "0x8BFB": "0xB6C1", + "0x5835": "0xB6C2", + "0x7779": "0xB6C3", + "0x8D4C": "0xB6C4", + "0x675C": "0xB6C5", + "0x9540": "0xB6C6", + "0x809A": "0xB6C7", + "0x5EA6": "0xB6C8", + "0x6E21": "0xB6C9", + "0x5992": "0xB6CA", + "0x7AEF": "0xB6CB", + "0x77ED": "0xB6CC", + "0x953B": "0xB6CD", + "0x6BB5": "0xB6CE", + "0x65AD": "0xB6CF", + "0x7F0E": "0xB6D0", + "0x5806": "0xB6D1", + "0x5151": "0xB6D2", + "0x961F": "0xB6D3", + "0x5BF9": "0xB6D4", + "0x58A9": "0xB6D5", + "0x5428": "0xB6D6", + "0x8E72": "0xB6D7", + "0x6566": "0xB6D8", + "0x987F": "0xB6D9", + "0x56E4": "0xB6DA", + "0x949D": "0xB6DB", + "0x76FE": "0xB6DC", + "0x9041": "0xB6DD", + "0x6387": "0xB6DE", + "0x54C6": "0xB6DF", + "0x591A": "0xB6E0", + "0x593A": "0xB6E1", + "0x579B": "0xB6E2", + "0x8EB2": "0xB6E3", + "0x6735": "0xB6E4", + "0x8DFA": "0xB6E5", + "0x8235": "0xB6E6", + "0x5241": "0xB6E7", + "0x60F0": "0xB6E8", + "0x5815": "0xB6E9", + "0x86FE": "0xB6EA", + "0x5CE8": "0xB6EB", + "0x9E45": "0xB6EC", + "0x4FC4": "0xB6ED", + "0x989D": "0xB6EE", + "0x8BB9": "0xB6EF", + "0x5A25": "0xB6F0", + "0x6076": "0xB6F1", + "0x5384": "0xB6F2", + "0x627C": "0xB6F3", + "0x904F": "0xB6F4", + "0x9102": "0xB6F5", + "0x997F": "0xB6F6", + "0x6069": "0xB6F7", + "0x800C": "0xB6F8", + "0x513F": "0xB6F9", + "0x8033": "0xB6FA", + "0x5C14": "0xB6FB", + "0x9975": "0xB6FC", + "0x6D31": "0xB6FD", + "0x4E8C": "0xB6FE", + "0x8D30": "0xB7A1", + "0x53D1": "0xB7A2", + "0x7F5A": "0xB7A3", + "0x7B4F": "0xB7A4", + "0x4F10": "0xB7A5", + "0x4E4F": "0xB7A6", + "0x9600": "0xB7A7", + "0x6CD5": "0xB7A8", + "0x73D0": "0xB7A9", + "0x85E9": "0xB7AA", + "0x5E06": "0xB7AB", + "0x756A": "0xB7AC", + "0x7FFB": "0xB7AD", + "0x6A0A": "0xB7AE", + "0x77FE": "0xB7AF", + "0x9492": "0xB7B0", + "0x7E41": "0xB7B1", + "0x51E1": "0xB7B2", + "0x70E6": "0xB7B3", + "0x53CD": "0xB7B4", + "0x8FD4": "0xB7B5", + "0x8303": "0xB7B6", + "0x8D29": "0xB7B7", + "0x72AF": "0xB7B8", + "0x996D": "0xB7B9", + "0x6CDB": "0xB7BA", + "0x574A": "0xB7BB", + "0x82B3": "0xB7BC", + "0x65B9": "0xB7BD", + "0x80AA": "0xB7BE", + "0x623F": "0xB7BF", + "0x9632": "0xB7C0", + "0x59A8": "0xB7C1", + "0x4EFF": "0xB7C2", + "0x8BBF": "0xB7C3", + "0x7EBA": "0xB7C4", + "0x653E": "0xB7C5", + "0x83F2": "0xB7C6", + "0x975E": "0xB7C7", + "0x5561": "0xB7C8", + "0x98DE": "0xB7C9", + "0x80A5": "0xB7CA", + "0x532A": "0xB7CB", + "0x8BFD": "0xB7CC", + "0x5420": "0xB7CD", + "0x80BA": "0xB7CE", + "0x5E9F": "0xB7CF", + "0x6CB8": "0xB7D0", + "0x8D39": "0xB7D1", + "0x82AC": "0xB7D2", + "0x915A": "0xB7D3", + "0x5429": "0xB7D4", + "0x6C1B": "0xB7D5", + "0x5206": "0xB7D6", + "0x7EB7": "0xB7D7", + "0x575F": "0xB7D8", + "0x711A": "0xB7D9", + "0x6C7E": "0xB7DA", + "0x7C89": "0xB7DB", + "0x594B": "0xB7DC", + "0x4EFD": "0xB7DD", + "0x5FFF": "0xB7DE", + "0x6124": "0xB7DF", + "0x7CAA": "0xB7E0", + "0x4E30": "0xB7E1", + "0x5C01": "0xB7E2", + "0x67AB": "0xB7E3", + "0x8702": "0xB7E4", + "0x5CF0": "0xB7E5", + "0x950B": "0xB7E6", + "0x98CE": "0xB7E7", + "0x75AF": "0xB7E8", + "0x70FD": "0xB7E9", + "0x9022": "0xB7EA", + "0x51AF": "0xB7EB", + "0x7F1D": "0xB7EC", + "0x8BBD": "0xB7ED", + "0x5949": "0xB7EE", + "0x51E4": "0xB7EF", + "0x4F5B": "0xB7F0", + "0x5426": "0xB7F1", + "0x592B": "0xB7F2", + "0x6577": "0xB7F3", + "0x80A4": "0xB7F4", + "0x5B75": "0xB7F5", + "0x6276": "0xB7F6", + "0x62C2": "0xB7F7", + "0x8F90": "0xB7F8", + "0x5E45": "0xB7F9", + "0x6C1F": "0xB7FA", + "0x7B26": "0xB7FB", + "0x4F0F": "0xB7FC", + "0x4FD8": "0xB7FD", + "0x670D": "0xB7FE", + "0x6D6E": "0xB8A1", + "0x6DAA": "0xB8A2", + "0x798F": "0xB8A3", + "0x88B1": "0xB8A4", + "0x5F17": "0xB8A5", + "0x752B": "0xB8A6", + "0x629A": "0xB8A7", + "0x8F85": "0xB8A8", + "0x4FEF": "0xB8A9", + "0x91DC": "0xB8AA", + "0x65A7": "0xB8AB", + "0x812F": "0xB8AC", + "0x8151": "0xB8AD", + "0x5E9C": "0xB8AE", + "0x8150": "0xB8AF", + "0x8D74": "0xB8B0", + "0x526F": "0xB8B1", + "0x8986": "0xB8B2", + "0x8D4B": "0xB8B3", + "0x590D": "0xB8B4", + "0x5085": "0xB8B5", + "0x4ED8": "0xB8B6", + "0x961C": "0xB8B7", + "0x7236": "0xB8B8", + "0x8179": "0xB8B9", + "0x8D1F": "0xB8BA", + "0x5BCC": "0xB8BB", + "0x8BA3": "0xB8BC", + "0x9644": "0xB8BD", + "0x5987": "0xB8BE", + "0x7F1A": "0xB8BF", + "0x5490": "0xB8C0", + "0x5676": "0xB8C1", + "0x560E": "0xB8C2", + "0x8BE5": "0xB8C3", + "0x6539": "0xB8C4", + "0x6982": "0xB8C5", + "0x9499": "0xB8C6", + "0x76D6": "0xB8C7", + "0x6E89": "0xB8C8", + "0x5E72": "0xB8C9", + "0x7518": "0xB8CA", + "0x6746": "0xB8CB", + "0x67D1": "0xB8CC", + "0x7AFF": "0xB8CD", + "0x809D": "0xB8CE", + "0x8D76": "0xB8CF", + "0x611F": "0xB8D0", + "0x79C6": "0xB8D1", + "0x6562": "0xB8D2", + "0x8D63": "0xB8D3", + "0x5188": "0xB8D4", + "0x521A": "0xB8D5", + "0x94A2": "0xB8D6", + "0x7F38": "0xB8D7", + "0x809B": "0xB8D8", + "0x7EB2": "0xB8D9", + "0x5C97": "0xB8DA", + "0x6E2F": "0xB8DB", + "0x6760": "0xB8DC", + "0x7BD9": "0xB8DD", + "0x768B": "0xB8DE", + "0x9AD8": "0xB8DF", + "0x818F": "0xB8E0", + "0x7F94": "0xB8E1", + "0x7CD5": "0xB8E2", + "0x641E": "0xB8E3", + "0x9550": "0xB8E4", + "0x7A3F": "0xB8E5", + "0x544A": "0xB8E6", + "0x54E5": "0xB8E7", + "0x6B4C": "0xB8E8", + "0x6401": "0xB8E9", + "0x6208": "0xB8EA", + "0x9E3D": "0xB8EB", + "0x80F3": "0xB8EC", + "0x7599": "0xB8ED", + "0x5272": "0xB8EE", + "0x9769": "0xB8EF", + "0x845B": "0xB8F0", + "0x683C": "0xB8F1", + "0x86E4": "0xB8F2", + "0x9601": "0xB8F3", + "0x9694": "0xB8F4", + "0x94EC": "0xB8F5", + "0x4E2A": "0xB8F6", + "0x5404": "0xB8F7", + "0x7ED9": "0xB8F8", + "0x6839": "0xB8F9", + "0x8DDF": "0xB8FA", + "0x8015": "0xB8FB", + "0x66F4": "0xB8FC", + "0x5E9A": "0xB8FD", + "0x7FB9": "0xB8FE", + "0x57C2": "0xB9A1", + "0x803F": "0xB9A2", + "0x6897": "0xB9A3", + "0x5DE5": "0xB9A4", + "0x653B": "0xB9A5", + "0x529F": "0xB9A6", + "0x606D": "0xB9A7", + "0x9F9A": "0xB9A8", + "0x4F9B": "0xB9A9", + "0x8EAC": "0xB9AA", + "0x516C": "0xB9AB", + "0x5BAB": "0xB9AC", + "0x5F13": "0xB9AD", + "0x5DE9": "0xB9AE", + "0x6C5E": "0xB9AF", + "0x62F1": "0xB9B0", + "0x8D21": "0xB9B1", + "0x5171": "0xB9B2", + "0x94A9": "0xB9B3", + "0x52FE": "0xB9B4", + "0x6C9F": "0xB9B5", + "0x82DF": "0xB9B6", + "0x72D7": "0xB9B7", + "0x57A2": "0xB9B8", + "0x6784": "0xB9B9", + "0x8D2D": "0xB9BA", + "0x591F": "0xB9BB", + "0x8F9C": "0xB9BC", + "0x83C7": "0xB9BD", + "0x5495": "0xB9BE", + "0x7B8D": "0xB9BF", + "0x4F30": "0xB9C0", + "0x6CBD": "0xB9C1", + "0x5B64": "0xB9C2", + "0x59D1": "0xB9C3", + "0x9F13": "0xB9C4", + "0x53E4": "0xB9C5", + "0x86CA": "0xB9C6", + "0x9AA8": "0xB9C7", + "0x8C37": "0xB9C8", + "0x80A1": "0xB9C9", + "0x6545": "0xB9CA", + "0x987E": "0xB9CB", + "0x56FA": "0xB9CC", + "0x96C7": "0xB9CD", + "0x522E": "0xB9CE", + "0x74DC": "0xB9CF", + "0x5250": "0xB9D0", + "0x5BE1": "0xB9D1", + "0x6302": "0xB9D2", + "0x8902": "0xB9D3", + "0x4E56": "0xB9D4", + "0x62D0": "0xB9D5", + "0x602A": "0xB9D6", + "0x68FA": "0xB9D7", + "0x5173": "0xB9D8", + "0x5B98": "0xB9D9", + "0x51A0": "0xB9DA", + "0x89C2": "0xB9DB", + "0x7BA1": "0xB9DC", + "0x9986": "0xB9DD", + "0x7F50": "0xB9DE", + "0x60EF": "0xB9DF", + "0x704C": "0xB9E0", + "0x8D2F": "0xB9E1", + "0x5149": "0xB9E2", + "0x5E7F": "0xB9E3", + "0x901B": "0xB9E4", + "0x7470": "0xB9E5", + "0x89C4": "0xB9E6", + "0x572D": "0xB9E7", + "0x7845": "0xB9E8", + "0x5F52": "0xB9E9", + "0x9F9F": "0xB9EA", + "0x95FA": "0xB9EB", + "0x8F68": "0xB9EC", + "0x9B3C": "0xB9ED", + "0x8BE1": "0xB9EE", + "0x7678": "0xB9EF", + "0x6842": "0xB9F0", + "0x67DC": "0xB9F1", + "0x8DEA": "0xB9F2", + "0x8D35": "0xB9F3", + "0x523D": "0xB9F4", + "0x8F8A": "0xB9F5", + "0x6EDA": "0xB9F6", + "0x68CD": "0xB9F7", + "0x9505": "0xB9F8", + "0x90ED": "0xB9F9", + "0x56FD": "0xB9FA", + "0x679C": "0xB9FB", + "0x88F9": "0xB9FC", + "0x8FC7": "0xB9FD", + "0x54C8": "0xB9FE", + "0x9AB8": "0xBAA1", + "0x5B69": "0xBAA2", + "0x6D77": "0xBAA3", + "0x6C26": "0xBAA4", + "0x4EA5": "0xBAA5", + "0x5BB3": "0xBAA6", + "0x9A87": "0xBAA7", + "0x9163": "0xBAA8", + "0x61A8": "0xBAA9", + "0x90AF": "0xBAAA", + "0x97E9": "0xBAAB", + "0x542B": "0xBAAC", + "0x6DB5": "0xBAAD", + "0x5BD2": "0xBAAE", + "0x51FD": "0xBAAF", + "0x558A": "0xBAB0", + "0x7F55": "0xBAB1", + "0x7FF0": "0xBAB2", + "0x64BC": "0xBAB3", + "0x634D": "0xBAB4", + "0x65F1": "0xBAB5", + "0x61BE": "0xBAB6", + "0x608D": "0xBAB7", + "0x710A": "0xBAB8", + "0x6C57": "0xBAB9", + "0x6C49": "0xBABA", + "0x592F": "0xBABB", + "0x676D": "0xBABC", + "0x822A": "0xBABD", + "0x58D5": "0xBABE", + "0x568E": "0xBABF", + "0x8C6A": "0xBAC0", + "0x6BEB": "0xBAC1", + "0x90DD": "0xBAC2", + "0x597D": "0xBAC3", + "0x8017": "0xBAC4", + "0x53F7": "0xBAC5", + "0x6D69": "0xBAC6", + "0x5475": "0xBAC7", + "0x559D": "0xBAC8", + "0x8377": "0xBAC9", + "0x83CF": "0xBACA", + "0x6838": "0xBACB", + "0x79BE": "0xBACC", + "0x548C": "0xBACD", + "0x4F55": "0xBACE", + "0x5408": "0xBACF", + "0x76D2": "0xBAD0", + "0x8C89": "0xBAD1", + "0x9602": "0xBAD2", + "0x6CB3": "0xBAD3", + "0x6DB8": "0xBAD4", + "0x8D6B": "0xBAD5", + "0x8910": "0xBAD6", + "0x9E64": "0xBAD7", + "0x8D3A": "0xBAD8", + "0x563F": "0xBAD9", + "0x9ED1": "0xBADA", + "0x75D5": "0xBADB", + "0x5F88": "0xBADC", + "0x72E0": "0xBADD", + "0x6068": "0xBADE", + "0x54FC": "0xBADF", + "0x4EA8": "0xBAE0", + "0x6A2A": "0xBAE1", + "0x8861": "0xBAE2", + "0x6052": "0xBAE3", + "0x8F70": "0xBAE4", + "0x54C4": "0xBAE5", + "0x70D8": "0xBAE6", + "0x8679": "0xBAE7", + "0x9E3F": "0xBAE8", + "0x6D2A": "0xBAE9", + "0x5B8F": "0xBAEA", + "0x5F18": "0xBAEB", + "0x7EA2": "0xBAEC", + "0x5589": "0xBAED", + "0x4FAF": "0xBAEE", + "0x7334": "0xBAEF", + "0x543C": "0xBAF0", + "0x539A": "0xBAF1", + "0x5019": "0xBAF2", + "0x540E": "0xBAF3", + "0x547C": "0xBAF4", + "0x4E4E": "0xBAF5", + "0x5FFD": "0xBAF6", + "0x745A": "0xBAF7", + "0x58F6": "0xBAF8", + "0x846B": "0xBAF9", + "0x80E1": "0xBAFA", + "0x8774": "0xBAFB", + "0x72D0": "0xBAFC", + "0x7CCA": "0xBAFD", + "0x6E56": "0xBAFE", + "0x5F27": "0xBBA1", + "0x864E": "0xBBA2", + "0x552C": "0xBBA3", + "0x62A4": "0xBBA4", + "0x4E92": "0xBBA5", + "0x6CAA": "0xBBA6", + "0x6237": "0xBBA7", + "0x82B1": "0xBBA8", + "0x54D7": "0xBBA9", + "0x534E": "0xBBAA", + "0x733E": "0xBBAB", + "0x6ED1": "0xBBAC", + "0x753B": "0xBBAD", + "0x5212": "0xBBAE", + "0x5316": "0xBBAF", + "0x8BDD": "0xBBB0", + "0x69D0": "0xBBB1", + "0x5F8A": "0xBBB2", + "0x6000": "0xBBB3", + "0x6DEE": "0xBBB4", + "0x574F": "0xBBB5", + "0x6B22": "0xBBB6", + "0x73AF": "0xBBB7", + "0x6853": "0xBBB8", + "0x8FD8": "0xBBB9", + "0x7F13": "0xBBBA", + "0x6362": "0xBBBB", + "0x60A3": "0xBBBC", + "0x5524": "0xBBBD", + "0x75EA": "0xBBBE", + "0x8C62": "0xBBBF", + "0x7115": "0xBBC0", + "0x6DA3": "0xBBC1", + "0x5BA6": "0xBBC2", + "0x5E7B": "0xBBC3", + "0x8352": "0xBBC4", + "0x614C": "0xBBC5", + "0x9EC4": "0xBBC6", + "0x78FA": "0xBBC7", + "0x8757": "0xBBC8", + "0x7C27": "0xBBC9", + "0x7687": "0xBBCA", + "0x51F0": "0xBBCB", + "0x60F6": "0xBBCC", + "0x714C": "0xBBCD", + "0x6643": "0xBBCE", + "0x5E4C": "0xBBCF", + "0x604D": "0xBBD0", + "0x8C0E": "0xBBD1", + "0x7070": "0xBBD2", + "0x6325": "0xBBD3", + "0x8F89": "0xBBD4", + "0x5FBD": "0xBBD5", + "0x6062": "0xBBD6", + "0x86D4": "0xBBD7", + "0x56DE": "0xBBD8", + "0x6BC1": "0xBBD9", + "0x6094": "0xBBDA", + "0x6167": "0xBBDB", + "0x5349": "0xBBDC", + "0x60E0": "0xBBDD", + "0x6666": "0xBBDE", + "0x8D3F": "0xBBDF", + "0x79FD": "0xBBE0", + "0x4F1A": "0xBBE1", + "0x70E9": "0xBBE2", + "0x6C47": "0xBBE3", + "0x8BB3": "0xBBE4", + "0x8BF2": "0xBBE5", + "0x7ED8": "0xBBE6", + "0x8364": "0xBBE7", + "0x660F": "0xBBE8", + "0x5A5A": "0xBBE9", + "0x9B42": "0xBBEA", + "0x6D51": "0xBBEB", + "0x6DF7": "0xBBEC", + "0x8C41": "0xBBED", + "0x6D3B": "0xBBEE", + "0x4F19": "0xBBEF", + "0x706B": "0xBBF0", + "0x83B7": "0xBBF1", + "0x6216": "0xBBF2", + "0x60D1": "0xBBF3", + "0x970D": "0xBBF4", + "0x8D27": "0xBBF5", + "0x7978": "0xBBF6", + "0x51FB": "0xBBF7", + "0x573E": "0xBBF8", + "0x57FA": "0xBBF9", + "0x673A": "0xBBFA", + "0x7578": "0xBBFB", + "0x7A3D": "0xBBFC", + "0x79EF": "0xBBFD", + "0x7B95": "0xBBFE", + "0x808C": "0xBCA1", + "0x9965": "0xBCA2", + "0x8FF9": "0xBCA3", + "0x6FC0": "0xBCA4", + "0x8BA5": "0xBCA5", + "0x9E21": "0xBCA6", + "0x59EC": "0xBCA7", + "0x7EE9": "0xBCA8", + "0x7F09": "0xBCA9", + "0x5409": "0xBCAA", + "0x6781": "0xBCAB", + "0x68D8": "0xBCAC", + "0x8F91": "0xBCAD", + "0x7C4D": "0xBCAE", + "0x96C6": "0xBCAF", + "0x53CA": "0xBCB0", + "0x6025": "0xBCB1", + "0x75BE": "0xBCB2", + "0x6C72": "0xBCB3", + "0x5373": "0xBCB4", + "0x5AC9": "0xBCB5", + "0x7EA7": "0xBCB6", + "0x6324": "0xBCB7", + "0x51E0": "0xBCB8", + "0x810A": "0xBCB9", + "0x5DF1": "0xBCBA", + "0x84DF": "0xBCBB", + "0x6280": "0xBCBC", + "0x5180": "0xBCBD", + "0x5B63": "0xBCBE", + "0x4F0E": "0xBCBF", + "0x796D": "0xBCC0", + "0x5242": "0xBCC1", + "0x60B8": "0xBCC2", + "0x6D4E": "0xBCC3", + "0x5BC4": "0xBCC4", + "0x5BC2": "0xBCC5", + "0x8BA1": "0xBCC6", + "0x8BB0": "0xBCC7", + "0x65E2": "0xBCC8", + "0x5FCC": "0xBCC9", + "0x9645": "0xBCCA", + "0x5993": "0xBCCB", + "0x7EE7": "0xBCCC", + "0x7EAA": "0xBCCD", + "0x5609": "0xBCCE", + "0x67B7": "0xBCCF", + "0x5939": "0xBCD0", + "0x4F73": "0xBCD1", + "0x5BB6": "0xBCD2", + "0x52A0": "0xBCD3", + "0x835A": "0xBCD4", + "0x988A": "0xBCD5", + "0x8D3E": "0xBCD6", + "0x7532": "0xBCD7", + "0x94BE": "0xBCD8", + "0x5047": "0xBCD9", + "0x7A3C": "0xBCDA", + "0x4EF7": "0xBCDB", + "0x67B6": "0xBCDC", + "0x9A7E": "0xBCDD", + "0x5AC1": "0xBCDE", + "0x6B7C": "0xBCDF", + "0x76D1": "0xBCE0", + "0x575A": "0xBCE1", + "0x5C16": "0xBCE2", + "0x7B3A": "0xBCE3", + "0x95F4": "0xBCE4", + "0x714E": "0xBCE5", + "0x517C": "0xBCE6", + "0x80A9": "0xBCE7", + "0x8270": "0xBCE8", + "0x5978": "0xBCE9", + "0x7F04": "0xBCEA", + "0x8327": "0xBCEB", + "0x68C0": "0xBCEC", + "0x67EC": "0xBCED", + "0x78B1": "0xBCEE", + "0x7877": "0xBCEF", + "0x62E3": "0xBCF0", + "0x6361": "0xBCF1", + "0x7B80": "0xBCF2", + "0x4FED": "0xBCF3", + "0x526A": "0xBCF4", + "0x51CF": "0xBCF5", + "0x8350": "0xBCF6", + "0x69DB": "0xBCF7", + "0x9274": "0xBCF8", + "0x8DF5": "0xBCF9", + "0x8D31": "0xBCFA", + "0x89C1": "0xBCFB", + "0x952E": "0xBCFC", + "0x7BAD": "0xBCFD", + "0x4EF6": "0xBCFE", + "0x5065": "0xBDA1", + "0x8230": "0xBDA2", + "0x5251": "0xBDA3", + "0x996F": "0xBDA4", + "0x6E10": "0xBDA5", + "0x6E85": "0xBDA6", + "0x6DA7": "0xBDA7", + "0x5EFA": "0xBDA8", + "0x50F5": "0xBDA9", + "0x59DC": "0xBDAA", + "0x5C06": "0xBDAB", + "0x6D46": "0xBDAC", + "0x6C5F": "0xBDAD", + "0x7586": "0xBDAE", + "0x848B": "0xBDAF", + "0x6868": "0xBDB0", + "0x5956": "0xBDB1", + "0x8BB2": "0xBDB2", + "0x5320": "0xBDB3", + "0x9171": "0xBDB4", + "0x964D": "0xBDB5", + "0x8549": "0xBDB6", + "0x6912": "0xBDB7", + "0x7901": "0xBDB8", + "0x7126": "0xBDB9", + "0x80F6": "0xBDBA", + "0x4EA4": "0xBDBB", + "0x90CA": "0xBDBC", + "0x6D47": "0xBDBD", + "0x9A84": "0xBDBE", + "0x5A07": "0xBDBF", + "0x56BC": "0xBDC0", + "0x6405": "0xBDC1", + "0x94F0": "0xBDC2", + "0x77EB": "0xBDC3", + "0x4FA5": "0xBDC4", + "0x811A": "0xBDC5", + "0x72E1": "0xBDC6", + "0x89D2": "0xBDC7", + "0x997A": "0xBDC8", + "0x7F34": "0xBDC9", + "0x7EDE": "0xBDCA", + "0x527F": "0xBDCB", + "0x6559": "0xBDCC", + "0x9175": "0xBDCD", + "0x8F7F": "0xBDCE", + "0x8F83": "0xBDCF", + "0x53EB": "0xBDD0", + "0x7A96": "0xBDD1", + "0x63ED": "0xBDD2", + "0x63A5": "0xBDD3", + "0x7686": "0xBDD4", + "0x79F8": "0xBDD5", + "0x8857": "0xBDD6", + "0x9636": "0xBDD7", + "0x622A": "0xBDD8", + "0x52AB": "0xBDD9", + "0x8282": "0xBDDA", + "0x6854": "0xBDDB", + "0x6770": "0xBDDC", + "0x6377": "0xBDDD", + "0x776B": "0xBDDE", + "0x7AED": "0xBDDF", + "0x6D01": "0xBDE0", + "0x7ED3": "0xBDE1", + "0x89E3": "0xBDE2", + "0x59D0": "0xBDE3", + "0x6212": "0xBDE4", + "0x85C9": "0xBDE5", + "0x82A5": "0xBDE6", + "0x754C": "0xBDE7", + "0x501F": "0xBDE8", + "0x4ECB": "0xBDE9", + "0x75A5": "0xBDEA", + "0x8BEB": "0xBDEB", + "0x5C4A": "0xBDEC", + "0x5DFE": "0xBDED", + "0x7B4B": "0xBDEE", + "0x65A4": "0xBDEF", + "0x91D1": "0xBDF0", + "0x4ECA": "0xBDF1", + "0x6D25": "0xBDF2", + "0x895F": "0xBDF3", + "0x7D27": "0xBDF4", + "0x9526": "0xBDF5", + "0x4EC5": "0xBDF6", + "0x8C28": "0xBDF7", + "0x8FDB": "0xBDF8", + "0x9773": "0xBDF9", + "0x664B": "0xBDFA", + "0x7981": "0xBDFB", + "0x8FD1": "0xBDFC", + "0x70EC": "0xBDFD", + "0x6D78": "0xBDFE", + "0x5C3D": "0xBEA1", + "0x52B2": "0xBEA2", + "0x8346": "0xBEA3", + "0x5162": "0xBEA4", + "0x830E": "0xBEA5", + "0x775B": "0xBEA6", + "0x6676": "0xBEA7", + "0x9CB8": "0xBEA8", + "0x4EAC": "0xBEA9", + "0x60CA": "0xBEAA", + "0x7CBE": "0xBEAB", + "0x7CB3": "0xBEAC", + "0x7ECF": "0xBEAD", + "0x4E95": "0xBEAE", + "0x8B66": "0xBEAF", + "0x666F": "0xBEB0", + "0x9888": "0xBEB1", + "0x9759": "0xBEB2", + "0x5883": "0xBEB3", + "0x656C": "0xBEB4", + "0x955C": "0xBEB5", + "0x5F84": "0xBEB6", + "0x75C9": "0xBEB7", + "0x9756": "0xBEB8", + "0x7ADF": "0xBEB9", + "0x7ADE": "0xBEBA", + "0x51C0": "0xBEBB", + "0x70AF": "0xBEBC", + "0x7A98": "0xBEBD", + "0x63EA": "0xBEBE", + "0x7A76": "0xBEBF", + "0x7EA0": "0xBEC0", + "0x7396": "0xBEC1", + "0x97ED": "0xBEC2", + "0x4E45": "0xBEC3", + "0x7078": "0xBEC4", + "0x4E5D": "0xBEC5", + "0x9152": "0xBEC6", + "0x53A9": "0xBEC7", + "0x6551": "0xBEC8", + "0x65E7": "0xBEC9", + "0x81FC": "0xBECA", + "0x8205": "0xBECB", + "0x548E": "0xBECC", + "0x5C31": "0xBECD", + "0x759A": "0xBECE", + "0x97A0": "0xBECF", + "0x62D8": "0xBED0", + "0x72D9": "0xBED1", + "0x75BD": "0xBED2", + "0x5C45": "0xBED3", + "0x9A79": "0xBED4", + "0x83CA": "0xBED5", + "0x5C40": "0xBED6", + "0x5480": "0xBED7", + "0x77E9": "0xBED8", + "0x4E3E": "0xBED9", + "0x6CAE": "0xBEDA", + "0x805A": "0xBEDB", + "0x62D2": "0xBEDC", + "0x636E": "0xBEDD", + "0x5DE8": "0xBEDE", + "0x5177": "0xBEDF", + "0x8DDD": "0xBEE0", + "0x8E1E": "0xBEE1", + "0x952F": "0xBEE2", + "0x4FF1": "0xBEE3", + "0x53E5": "0xBEE4", + "0x60E7": "0xBEE5", + "0x70AC": "0xBEE6", + "0x5267": "0xBEE7", + "0x6350": "0xBEE8", + "0x9E43": "0xBEE9", + "0x5A1F": "0xBEEA", + "0x5026": "0xBEEB", + "0x7737": "0xBEEC", + "0x5377": "0xBEED", + "0x7EE2": "0xBEEE", + "0x6485": "0xBEEF", + "0x652B": "0xBEF0", + "0x6289": "0xBEF1", + "0x6398": "0xBEF2", + "0x5014": "0xBEF3", + "0x7235": "0xBEF4", + "0x89C9": "0xBEF5", + "0x51B3": "0xBEF6", + "0x8BC0": "0xBEF7", + "0x7EDD": "0xBEF8", + "0x5747": "0xBEF9", + "0x83CC": "0xBEFA", + "0x94A7": "0xBEFB", + "0x519B": "0xBEFC", + "0x541B": "0xBEFD", + "0x5CFB": "0xBEFE", + "0x4FCA": "0xBFA1", + "0x7AE3": "0xBFA2", + "0x6D5A": "0xBFA3", + "0x90E1": "0xBFA4", + "0x9A8F": "0xBFA5", + "0x5580": "0xBFA6", + "0x5496": "0xBFA7", + "0x5361": "0xBFA8", + "0x54AF": "0xBFA9", + "0x5F00": "0xBFAA", + "0x63E9": "0xBFAB", + "0x6977": "0xBFAC", + "0x51EF": "0xBFAD", + "0x6168": "0xBFAE", + "0x520A": "0xBFAF", + "0x582A": "0xBFB0", + "0x52D8": "0xBFB1", + "0x574E": "0xBFB2", + "0x780D": "0xBFB3", + "0x770B": "0xBFB4", + "0x5EB7": "0xBFB5", + "0x6177": "0xBFB6", + "0x7CE0": "0xBFB7", + "0x625B": "0xBFB8", + "0x6297": "0xBFB9", + "0x4EA2": "0xBFBA", + "0x7095": "0xBFBB", + "0x8003": "0xBFBC", + "0x62F7": "0xBFBD", + "0x70E4": "0xBFBE", + "0x9760": "0xBFBF", + "0x5777": "0xBFC0", + "0x82DB": "0xBFC1", + "0x67EF": "0xBFC2", + "0x68F5": "0xBFC3", + "0x78D5": "0xBFC4", + "0x9897": "0xBFC5", + "0x79D1": "0xBFC6", + "0x58F3": "0xBFC7", + "0x54B3": "0xBFC8", + "0x53EF": "0xBFC9", + "0x6E34": "0xBFCA", + "0x514B": "0xBFCB", + "0x523B": "0xBFCC", + "0x5BA2": "0xBFCD", + "0x8BFE": "0xBFCE", + "0x80AF": "0xBFCF", + "0x5543": "0xBFD0", + "0x57A6": "0xBFD1", + "0x6073": "0xBFD2", + "0x5751": "0xBFD3", + "0x542D": "0xBFD4", + "0x7A7A": "0xBFD5", + "0x6050": "0xBFD6", + "0x5B54": "0xBFD7", + "0x63A7": "0xBFD8", + "0x62A0": "0xBFD9", + "0x53E3": "0xBFDA", + "0x6263": "0xBFDB", + "0x5BC7": "0xBFDC", + "0x67AF": "0xBFDD", + "0x54ED": "0xBFDE", + "0x7A9F": "0xBFDF", + "0x82E6": "0xBFE0", + "0x9177": "0xBFE1", + "0x5E93": "0xBFE2", + "0x88E4": "0xBFE3", + "0x5938": "0xBFE4", + "0x57AE": "0xBFE5", + "0x630E": "0xBFE6", + "0x8DE8": "0xBFE7", + "0x80EF": "0xBFE8", + "0x5757": "0xBFE9", + "0x7B77": "0xBFEA", + "0x4FA9": "0xBFEB", + "0x5FEB": "0xBFEC", + "0x5BBD": "0xBFED", + "0x6B3E": "0xBFEE", + "0x5321": "0xBFEF", + "0x7B50": "0xBFF0", + "0x72C2": "0xBFF1", + "0x6846": "0xBFF2", + "0x77FF": "0xBFF3", + "0x7736": "0xBFF4", + "0x65F7": "0xBFF5", + "0x51B5": "0xBFF6", + "0x4E8F": "0xBFF7", + "0x76D4": "0xBFF8", + "0x5CBF": "0xBFF9", + "0x7AA5": "0xBFFA", + "0x8475": "0xBFFB", + "0x594E": "0xBFFC", + "0x9B41": "0xBFFD", + "0x5080": "0xBFFE", + "0x9988": "0xC0A1", + "0x6127": "0xC0A2", + "0x6E83": "0xC0A3", + "0x5764": "0xC0A4", + "0x6606": "0xC0A5", + "0x6346": "0xC0A6", + "0x56F0": "0xC0A7", + "0x62EC": "0xC0A8", + "0x6269": "0xC0A9", + "0x5ED3": "0xC0AA", + "0x9614": "0xC0AB", + "0x5783": "0xC0AC", + "0x62C9": "0xC0AD", + "0x5587": "0xC0AE", + "0x8721": "0xC0AF", + "0x814A": "0xC0B0", + "0x8FA3": "0xC0B1", + "0x5566": "0xC0B2", + "0x83B1": "0xC0B3", + "0x6765": "0xC0B4", + "0x8D56": "0xC0B5", + "0x84DD": "0xC0B6", + "0x5A6A": "0xC0B7", + "0x680F": "0xC0B8", + "0x62E6": "0xC0B9", + "0x7BEE": "0xC0BA", + "0x9611": "0xC0BB", + "0x5170": "0xC0BC", + "0x6F9C": "0xC0BD", + "0x8C30": "0xC0BE", + "0x63FD": "0xC0BF", + "0x89C8": "0xC0C0", + "0x61D2": "0xC0C1", + "0x7F06": "0xC0C2", + "0x70C2": "0xC0C3", + "0x6EE5": "0xC0C4", + "0x7405": "0xC0C5", + "0x6994": "0xC0C6", + "0x72FC": "0xC0C7", + "0x5ECA": "0xC0C8", + "0x90CE": "0xC0C9", + "0x6717": "0xC0CA", + "0x6D6A": "0xC0CB", + "0x635E": "0xC0CC", + "0x52B3": "0xC0CD", + "0x7262": "0xC0CE", + "0x8001": "0xC0CF", + "0x4F6C": "0xC0D0", + "0x59E5": "0xC0D1", + "0x916A": "0xC0D2", + "0x70D9": "0xC0D3", + "0x6D9D": "0xC0D4", + "0x52D2": "0xC0D5", + "0x4E50": "0xC0D6", + "0x96F7": "0xC0D7", + "0x956D": "0xC0D8", + "0x857E": "0xC0D9", + "0x78CA": "0xC0DA", + "0x7D2F": "0xC0DB", + "0x5121": "0xC0DC", + "0x5792": "0xC0DD", + "0x64C2": "0xC0DE", + "0x808B": "0xC0DF", + "0x7C7B": "0xC0E0", + "0x6CEA": "0xC0E1", + "0x68F1": "0xC0E2", + "0x695E": "0xC0E3", + "0x51B7": "0xC0E4", + "0x5398": "0xC0E5", + "0x68A8": "0xC0E6", + "0x7281": "0xC0E7", + "0x9ECE": "0xC0E8", + "0x7BF1": "0xC0E9", + "0x72F8": "0xC0EA", + "0x79BB": "0xC0EB", + "0x6F13": "0xC0EC", + "0x7406": "0xC0ED", + "0x674E": "0xC0EE", + "0x91CC": "0xC0EF", + "0x9CA4": "0xC0F0", + "0x793C": "0xC0F1", + "0x8389": "0xC0F2", + "0x8354": "0xC0F3", + "0x540F": "0xC0F4", + "0x6817": "0xC0F5", + "0x4E3D": "0xC0F6", + "0x5389": "0xC0F7", + "0x52B1": "0xC0F8", + "0x783E": "0xC0F9", + "0x5386": "0xC0FA", + "0x5229": "0xC0FB", + "0x5088": "0xC0FC", + "0x4F8B": "0xC0FD", + "0x4FD0": "0xC0FE", + "0x75E2": "0xC1A1", + "0x7ACB": "0xC1A2", + "0x7C92": "0xC1A3", + "0x6CA5": "0xC1A4", + "0x96B6": "0xC1A5", + "0x529B": "0xC1A6", + "0x7483": "0xC1A7", + "0x54E9": "0xC1A8", + "0x4FE9": "0xC1A9", + "0x8054": "0xC1AA", + "0x83B2": "0xC1AB", + "0x8FDE": "0xC1AC", + "0x9570": "0xC1AD", + "0x5EC9": "0xC1AE", + "0x601C": "0xC1AF", + "0x6D9F": "0xC1B0", + "0x5E18": "0xC1B1", + "0x655B": "0xC1B2", + "0x8138": "0xC1B3", + "0x94FE": "0xC1B4", + "0x604B": "0xC1B5", + "0x70BC": "0xC1B6", + "0x7EC3": "0xC1B7", + "0x7CAE": "0xC1B8", + "0x51C9": "0xC1B9", + "0x6881": "0xC1BA", + "0x7CB1": "0xC1BB", + "0x826F": "0xC1BC", + "0x4E24": "0xC1BD", + "0x8F86": "0xC1BE", + "0x91CF": "0xC1BF", + "0x667E": "0xC1C0", + "0x4EAE": "0xC1C1", + "0x8C05": "0xC1C2", + "0x64A9": "0xC1C3", + "0x804A": "0xC1C4", + "0x50DA": "0xC1C5", + "0x7597": "0xC1C6", + "0x71CE": "0xC1C7", + "0x5BE5": "0xC1C8", + "0x8FBD": "0xC1C9", + "0x6F66": "0xC1CA", + "0x4E86": "0xC1CB", + "0x6482": "0xC1CC", + "0x9563": "0xC1CD", + "0x5ED6": "0xC1CE", + "0x6599": "0xC1CF", + "0x5217": "0xC1D0", + "0x88C2": "0xC1D1", + "0x70C8": "0xC1D2", + "0x52A3": "0xC1D3", + "0x730E": "0xC1D4", + "0x7433": "0xC1D5", + "0x6797": "0xC1D6", + "0x78F7": "0xC1D7", + "0x9716": "0xC1D8", + "0x4E34": "0xC1D9", + "0x90BB": "0xC1DA", + "0x9CDE": "0xC1DB", + "0x6DCB": "0xC1DC", + "0x51DB": "0xC1DD", + "0x8D41": "0xC1DE", + "0x541D": "0xC1DF", + "0x62CE": "0xC1E0", + "0x73B2": "0xC1E1", + "0x83F1": "0xC1E2", + "0x96F6": "0xC1E3", + "0x9F84": "0xC1E4", + "0x94C3": "0xC1E5", + "0x4F36": "0xC1E6", + "0x7F9A": "0xC1E7", + "0x51CC": "0xC1E8", + "0x7075": "0xC1E9", + "0x9675": "0xC1EA", + "0x5CAD": "0xC1EB", + "0x9886": "0xC1EC", + "0x53E6": "0xC1ED", + "0x4EE4": "0xC1EE", + "0x6E9C": "0xC1EF", + "0x7409": "0xC1F0", + "0x69B4": "0xC1F1", + "0x786B": "0xC1F2", + "0x998F": "0xC1F3", + "0x7559": "0xC1F4", + "0x5218": "0xC1F5", + "0x7624": "0xC1F6", + "0x6D41": "0xC1F7", + "0x67F3": "0xC1F8", + "0x516D": "0xC1F9", + "0x9F99": "0xC1FA", + "0x804B": "0xC1FB", + "0x5499": "0xC1FC", + "0x7B3C": "0xC1FD", + "0x7ABF": "0xC1FE", + "0x9686": "0xC2A1", + "0x5784": "0xC2A2", + "0x62E2": "0xC2A3", + "0x9647": "0xC2A4", + "0x697C": "0xC2A5", + "0x5A04": "0xC2A6", + "0x6402": "0xC2A7", + "0x7BD3": "0xC2A8", + "0x6F0F": "0xC2A9", + "0x964B": "0xC2AA", + "0x82A6": "0xC2AB", + "0x5362": "0xC2AC", + "0x9885": "0xC2AD", + "0x5E90": "0xC2AE", + "0x7089": "0xC2AF", + "0x63B3": "0xC2B0", + "0x5364": "0xC2B1", + "0x864F": "0xC2B2", + "0x9C81": "0xC2B3", + "0x9E93": "0xC2B4", + "0x788C": "0xC2B5", + "0x9732": "0xC2B6", + "0x8DEF": "0xC2B7", + "0x8D42": "0xC2B8", + "0x9E7F": "0xC2B9", + "0x6F5E": "0xC2BA", + "0x7984": "0xC2BB", + "0x5F55": "0xC2BC", + "0x9646": "0xC2BD", + "0x622E": "0xC2BE", + "0x9A74": "0xC2BF", + "0x5415": "0xC2C0", + "0x94DD": "0xC2C1", + "0x4FA3": "0xC2C2", + "0x65C5": "0xC2C3", + "0x5C65": "0xC2C4", + "0x5C61": "0xC2C5", + "0x7F15": "0xC2C6", + "0x8651": "0xC2C7", + "0x6C2F": "0xC2C8", + "0x5F8B": "0xC2C9", + "0x7387": "0xC2CA", + "0x6EE4": "0xC2CB", + "0x7EFF": "0xC2CC", + "0x5CE6": "0xC2CD", + "0x631B": "0xC2CE", + "0x5B6A": "0xC2CF", + "0x6EE6": "0xC2D0", + "0x5375": "0xC2D1", + "0x4E71": "0xC2D2", + "0x63A0": "0xC2D3", + "0x7565": "0xC2D4", + "0x62A1": "0xC2D5", + "0x8F6E": "0xC2D6", + "0x4F26": "0xC2D7", + "0x4ED1": "0xC2D8", + "0x6CA6": "0xC2D9", + "0x7EB6": "0xC2DA", + "0x8BBA": "0xC2DB", + "0x841D": "0xC2DC", + "0x87BA": "0xC2DD", + "0x7F57": "0xC2DE", + "0x903B": "0xC2DF", + "0x9523": "0xC2E0", + "0x7BA9": "0xC2E1", + "0x9AA1": "0xC2E2", + "0x88F8": "0xC2E3", + "0x843D": "0xC2E4", + "0x6D1B": "0xC2E5", + "0x9A86": "0xC2E6", + "0x7EDC": "0xC2E7", + "0x5988": "0xC2E8", + "0x9EBB": "0xC2E9", + "0x739B": "0xC2EA", + "0x7801": "0xC2EB", + "0x8682": "0xC2EC", + "0x9A6C": "0xC2ED", + "0x9A82": "0xC2EE", + "0x561B": "0xC2EF", + "0x5417": "0xC2F0", + "0x57CB": "0xC2F1", + "0x4E70": "0xC2F2", + "0x9EA6": "0xC2F3", + "0x5356": "0xC2F4", + "0x8FC8": "0xC2F5", + "0x8109": "0xC2F6", + "0x7792": "0xC2F7", + "0x9992": "0xC2F8", + "0x86EE": "0xC2F9", + "0x6EE1": "0xC2FA", + "0x8513": "0xC2FB", + "0x66FC": "0xC2FC", + "0x6162": "0xC2FD", + "0x6F2B": "0xC2FE", + "0x8C29": "0xC3A1", + "0x8292": "0xC3A2", + "0x832B": "0xC3A3", + "0x76F2": "0xC3A4", + "0x6C13": "0xC3A5", + "0x5FD9": "0xC3A6", + "0x83BD": "0xC3A7", + "0x732B": "0xC3A8", + "0x8305": "0xC3A9", + "0x951A": "0xC3AA", + "0x6BDB": "0xC3AB", + "0x77DB": "0xC3AC", + "0x94C6": "0xC3AD", + "0x536F": "0xC3AE", + "0x8302": "0xC3AF", + "0x5192": "0xC3B0", + "0x5E3D": "0xC3B1", + "0x8C8C": "0xC3B2", + "0x8D38": "0xC3B3", + "0x4E48": "0xC3B4", + "0x73AB": "0xC3B5", + "0x679A": "0xC3B6", + "0x6885": "0xC3B7", + "0x9176": "0xC3B8", + "0x9709": "0xC3B9", + "0x7164": "0xC3BA", + "0x6CA1": "0xC3BB", + "0x7709": "0xC3BC", + "0x5A92": "0xC3BD", + "0x9541": "0xC3BE", + "0x6BCF": "0xC3BF", + "0x7F8E": "0xC3C0", + "0x6627": "0xC3C1", + "0x5BD0": "0xC3C2", + "0x59B9": "0xC3C3", + "0x5A9A": "0xC3C4", + "0x95E8": "0xC3C5", + "0x95F7": "0xC3C6", + "0x4EEC": "0xC3C7", + "0x840C": "0xC3C8", + "0x8499": "0xC3C9", + "0x6AAC": "0xC3CA", + "0x76DF": "0xC3CB", + "0x9530": "0xC3CC", + "0x731B": "0xC3CD", + "0x68A6": "0xC3CE", + "0x5B5F": "0xC3CF", + "0x772F": "0xC3D0", + "0x919A": "0xC3D1", + "0x9761": "0xC3D2", + "0x7CDC": "0xC3D3", + "0x8FF7": "0xC3D4", + "0x8C1C": "0xC3D5", + "0x5F25": "0xC3D6", + "0x7C73": "0xC3D7", + "0x79D8": "0xC3D8", + "0x89C5": "0xC3D9", + "0x6CCC": "0xC3DA", + "0x871C": "0xC3DB", + "0x5BC6": "0xC3DC", + "0x5E42": "0xC3DD", + "0x68C9": "0xC3DE", + "0x7720": "0xC3DF", + "0x7EF5": "0xC3E0", + "0x5195": "0xC3E1", + "0x514D": "0xC3E2", + "0x52C9": "0xC3E3", + "0x5A29": "0xC3E4", + "0x7F05": "0xC3E5", + "0x9762": "0xC3E6", + "0x82D7": "0xC3E7", + "0x63CF": "0xC3E8", + "0x7784": "0xC3E9", + "0x85D0": "0xC3EA", + "0x79D2": "0xC3EB", + "0x6E3A": "0xC3EC", + "0x5E99": "0xC3ED", + "0x5999": "0xC3EE", + "0x8511": "0xC3EF", + "0x706D": "0xC3F0", + "0x6C11": "0xC3F1", + "0x62BF": "0xC3F2", + "0x76BF": "0xC3F3", + "0x654F": "0xC3F4", + "0x60AF": "0xC3F5", + "0x95FD": "0xC3F6", + "0x660E": "0xC3F7", + "0x879F": "0xC3F8", + "0x9E23": "0xC3F9", + "0x94ED": "0xC3FA", + "0x540D": "0xC3FB", + "0x547D": "0xC3FC", + "0x8C2C": "0xC3FD", + "0x6478": "0xC3FE", + "0x6479": "0xC4A1", + "0x8611": "0xC4A2", + "0x6A21": "0xC4A3", + "0x819C": "0xC4A4", + "0x78E8": "0xC4A5", + "0x6469": "0xC4A6", + "0x9B54": "0xC4A7", + "0x62B9": "0xC4A8", + "0x672B": "0xC4A9", + "0x83AB": "0xC4AA", + "0x58A8": "0xC4AB", + "0x9ED8": "0xC4AC", + "0x6CAB": "0xC4AD", + "0x6F20": "0xC4AE", + "0x5BDE": "0xC4AF", + "0x964C": "0xC4B0", + "0x8C0B": "0xC4B1", + "0x725F": "0xC4B2", + "0x67D0": "0xC4B3", + "0x62C7": "0xC4B4", + "0x7261": "0xC4B5", + "0x4EA9": "0xC4B6", + "0x59C6": "0xC4B7", + "0x6BCD": "0xC4B8", + "0x5893": "0xC4B9", + "0x66AE": "0xC4BA", + "0x5E55": "0xC4BB", + "0x52DF": "0xC4BC", + "0x6155": "0xC4BD", + "0x6728": "0xC4BE", + "0x76EE": "0xC4BF", + "0x7766": "0xC4C0", + "0x7267": "0xC4C1", + "0x7A46": "0xC4C2", + "0x62FF": "0xC4C3", + "0x54EA": "0xC4C4", + "0x5450": "0xC4C5", + "0x94A0": "0xC4C6", + "0x90A3": "0xC4C7", + "0x5A1C": "0xC4C8", + "0x7EB3": "0xC4C9", + "0x6C16": "0xC4CA", + "0x4E43": "0xC4CB", + "0x5976": "0xC4CC", + "0x8010": "0xC4CD", + "0x5948": "0xC4CE", + "0x5357": "0xC4CF", + "0x7537": "0xC4D0", + "0x96BE": "0xC4D1", + "0x56CA": "0xC4D2", + "0x6320": "0xC4D3", + "0x8111": "0xC4D4", + "0x607C": "0xC4D5", + "0x95F9": "0xC4D6", + "0x6DD6": "0xC4D7", + "0x5462": "0xC4D8", + "0x9981": "0xC4D9", + "0x5185": "0xC4DA", + "0x5AE9": "0xC4DB", + "0x80FD": "0xC4DC", + "0x59AE": "0xC4DD", + "0x9713": "0xC4DE", + "0x502A": "0xC4DF", + "0x6CE5": "0xC4E0", + "0x5C3C": "0xC4E1", + "0x62DF": "0xC4E2", + "0x4F60": "0xC4E3", + "0x533F": "0xC4E4", + "0x817B": "0xC4E5", + "0x9006": "0xC4E6", + "0x6EBA": "0xC4E7", + "0x852B": "0xC4E8", + "0x62C8": "0xC4E9", + "0x5E74": "0xC4EA", + "0x78BE": "0xC4EB", + "0x64B5": "0xC4EC", + "0x637B": "0xC4ED", + "0x5FF5": "0xC4EE", + "0x5A18": "0xC4EF", + "0x917F": "0xC4F0", + "0x9E1F": "0xC4F1", + "0x5C3F": "0xC4F2", + "0x634F": "0xC4F3", + "0x8042": "0xC4F4", + "0x5B7D": "0xC4F5", + "0x556E": "0xC4F6", + "0x954A": "0xC4F7", + "0x954D": "0xC4F8", + "0x6D85": "0xC4F9", + "0x60A8": "0xC4FA", + "0x67E0": "0xC4FB", + "0x72DE": "0xC4FC", + "0x51DD": "0xC4FD", + "0x5B81": "0xC4FE", + "0x62E7": "0xC5A1", + "0x6CDE": "0xC5A2", + "0x725B": "0xC5A3", + "0x626D": "0xC5A4", + "0x94AE": "0xC5A5", + "0x7EBD": "0xC5A6", + "0x8113": "0xC5A7", + "0x6D53": "0xC5A8", + "0x519C": "0xC5A9", + "0x5F04": "0xC5AA", + "0x5974": "0xC5AB", + "0x52AA": "0xC5AC", + "0x6012": "0xC5AD", + "0x5973": "0xC5AE", + "0x6696": "0xC5AF", + "0x8650": "0xC5B0", + "0x759F": "0xC5B1", + "0x632A": "0xC5B2", + "0x61E6": "0xC5B3", + "0x7CEF": "0xC5B4", + "0x8BFA": "0xC5B5", + "0x54E6": "0xC5B6", + "0x6B27": "0xC5B7", + "0x9E25": "0xC5B8", + "0x6BB4": "0xC5B9", + "0x85D5": "0xC5BA", + "0x5455": "0xC5BB", + "0x5076": "0xC5BC", + "0x6CA4": "0xC5BD", + "0x556A": "0xC5BE", + "0x8DB4": "0xC5BF", + "0x722C": "0xC5C0", + "0x5E15": "0xC5C1", + "0x6015": "0xC5C2", + "0x7436": "0xC5C3", + "0x62CD": "0xC5C4", + "0x6392": "0xC5C5", + "0x724C": "0xC5C6", + "0x5F98": "0xC5C7", + "0x6E43": "0xC5C8", + "0x6D3E": "0xC5C9", + "0x6500": "0xC5CA", + "0x6F58": "0xC5CB", + "0x76D8": "0xC5CC", + "0x78D0": "0xC5CD", + "0x76FC": "0xC5CE", + "0x7554": "0xC5CF", + "0x5224": "0xC5D0", + "0x53DB": "0xC5D1", + "0x4E53": "0xC5D2", + "0x5E9E": "0xC5D3", + "0x65C1": "0xC5D4", + "0x802A": "0xC5D5", + "0x80D6": "0xC5D6", + "0x629B": "0xC5D7", + "0x5486": "0xC5D8", + "0x5228": "0xC5D9", + "0x70AE": "0xC5DA", + "0x888D": "0xC5DB", + "0x8DD1": "0xC5DC", + "0x6CE1": "0xC5DD", + "0x5478": "0xC5DE", + "0x80DA": "0xC5DF", + "0x57F9": "0xC5E0", + "0x88F4": "0xC5E1", + "0x8D54": "0xC5E2", + "0x966A": "0xC5E3", + "0x914D": "0xC5E4", + "0x4F69": "0xC5E5", + "0x6C9B": "0xC5E6", + "0x55B7": "0xC5E7", + "0x76C6": "0xC5E8", + "0x7830": "0xC5E9", + "0x62A8": "0xC5EA", + "0x70F9": "0xC5EB", + "0x6F8E": "0xC5EC", + "0x5F6D": "0xC5ED", + "0x84EC": "0xC5EE", + "0x68DA": "0xC5EF", + "0x787C": "0xC5F0", + "0x7BF7": "0xC5F1", + "0x81A8": "0xC5F2", + "0x670B": "0xC5F3", + "0x9E4F": "0xC5F4", + "0x6367": "0xC5F5", + "0x78B0": "0xC5F6", + "0x576F": "0xC5F7", + "0x7812": "0xC5F8", + "0x9739": "0xC5F9", + "0x6279": "0xC5FA", + "0x62AB": "0xC5FB", + "0x5288": "0xC5FC", + "0x7435": "0xC5FD", + "0x6BD7": "0xC5FE", + "0x5564": "0xC6A1", + "0x813E": "0xC6A2", + "0x75B2": "0xC6A3", + "0x76AE": "0xC6A4", + "0x5339": "0xC6A5", + "0x75DE": "0xC6A6", + "0x50FB": "0xC6A7", + "0x5C41": "0xC6A8", + "0x8B6C": "0xC6A9", + "0x7BC7": "0xC6AA", + "0x504F": "0xC6AB", + "0x7247": "0xC6AC", + "0x9A97": "0xC6AD", + "0x98D8": "0xC6AE", + "0x6F02": "0xC6AF", + "0x74E2": "0xC6B0", + "0x7968": "0xC6B1", + "0x6487": "0xC6B2", + "0x77A5": "0xC6B3", + "0x62FC": "0xC6B4", + "0x9891": "0xC6B5", + "0x8D2B": "0xC6B6", + "0x54C1": "0xC6B7", + "0x8058": "0xC6B8", + "0x4E52": "0xC6B9", + "0x576A": "0xC6BA", + "0x82F9": "0xC6BB", + "0x840D": "0xC6BC", + "0x5E73": "0xC6BD", + "0x51ED": "0xC6BE", + "0x74F6": "0xC6BF", + "0x8BC4": "0xC6C0", + "0x5C4F": "0xC6C1", + "0x5761": "0xC6C2", + "0x6CFC": "0xC6C3", + "0x9887": "0xC6C4", + "0x5A46": "0xC6C5", + "0x7834": "0xC6C6", + "0x9B44": "0xC6C7", + "0x8FEB": "0xC6C8", + "0x7C95": "0xC6C9", + "0x5256": "0xC6CA", + "0x6251": "0xC6CB", + "0x94FA": "0xC6CC", + "0x4EC6": "0xC6CD", + "0x8386": "0xC6CE", + "0x8461": "0xC6CF", + "0x83E9": "0xC6D0", + "0x84B2": "0xC6D1", + "0x57D4": "0xC6D2", + "0x6734": "0xC6D3", + "0x5703": "0xC6D4", + "0x666E": "0xC6D5", + "0x6D66": "0xC6D6", + "0x8C31": "0xC6D7", + "0x66DD": "0xC6D8", + "0x7011": "0xC6D9", + "0x671F": "0xC6DA", + "0x6B3A": "0xC6DB", + "0x6816": "0xC6DC", + "0x621A": "0xC6DD", + "0x59BB": "0xC6DE", + "0x4E03": "0xC6DF", + "0x51C4": "0xC6E0", + "0x6F06": "0xC6E1", + "0x67D2": "0xC6E2", + "0x6C8F": "0xC6E3", + "0x5176": "0xC6E4", + "0x68CB": "0xC6E5", + "0x5947": "0xC6E6", + "0x6B67": "0xC6E7", + "0x7566": "0xC6E8", + "0x5D0E": "0xC6E9", + "0x8110": "0xC6EA", + "0x9F50": "0xC6EB", + "0x65D7": "0xC6EC", + "0x7948": "0xC6ED", + "0x7941": "0xC6EE", + "0x9A91": "0xC6EF", + "0x8D77": "0xC6F0", + "0x5C82": "0xC6F1", + "0x4E5E": "0xC6F2", + "0x4F01": "0xC6F3", + "0x542F": "0xC6F4", + "0x5951": "0xC6F5", + "0x780C": "0xC6F6", + "0x5668": "0xC6F7", + "0x6C14": "0xC6F8", + "0x8FC4": "0xC6F9", + "0x5F03": "0xC6FA", + "0x6C7D": "0xC6FB", + "0x6CE3": "0xC6FC", + "0x8BAB": "0xC6FD", + "0x6390": "0xC6FE", + "0x6070": "0xC7A1", + "0x6D3D": "0xC7A2", + "0x7275": "0xC7A3", + "0x6266": "0xC7A4", + "0x948E": "0xC7A5", + "0x94C5": "0xC7A6", + "0x5343": "0xC7A7", + "0x8FC1": "0xC7A8", + "0x7B7E": "0xC7A9", + "0x4EDF": "0xC7AA", + "0x8C26": "0xC7AB", + "0x4E7E": "0xC7AC", + "0x9ED4": "0xC7AD", + "0x94B1": "0xC7AE", + "0x94B3": "0xC7AF", + "0x524D": "0xC7B0", + "0x6F5C": "0xC7B1", + "0x9063": "0xC7B2", + "0x6D45": "0xC7B3", + "0x8C34": "0xC7B4", + "0x5811": "0xC7B5", + "0x5D4C": "0xC7B6", + "0x6B20": "0xC7B7", + "0x6B49": "0xC7B8", + "0x67AA": "0xC7B9", + "0x545B": "0xC7BA", + "0x8154": "0xC7BB", + "0x7F8C": "0xC7BC", + "0x5899": "0xC7BD", + "0x8537": "0xC7BE", + "0x5F3A": "0xC7BF", + "0x62A2": "0xC7C0", + "0x6A47": "0xC7C1", + "0x9539": "0xC7C2", + "0x6572": "0xC7C3", + "0x6084": "0xC7C4", + "0x6865": "0xC7C5", + "0x77A7": "0xC7C6", + "0x4E54": "0xC7C7", + "0x4FA8": "0xC7C8", + "0x5DE7": "0xC7C9", + "0x9798": "0xC7CA", + "0x64AC": "0xC7CB", + "0x7FD8": "0xC7CC", + "0x5CED": "0xC7CD", + "0x4FCF": "0xC7CE", + "0x7A8D": "0xC7CF", + "0x5207": "0xC7D0", + "0x8304": "0xC7D1", + "0x4E14": "0xC7D2", + "0x602F": "0xC7D3", + "0x7A83": "0xC7D4", + "0x94A6": "0xC7D5", + "0x4FB5": "0xC7D6", + "0x4EB2": "0xC7D7", + "0x79E6": "0xC7D8", + "0x7434": "0xC7D9", + "0x52E4": "0xC7DA", + "0x82B9": "0xC7DB", + "0x64D2": "0xC7DC", + "0x79BD": "0xC7DD", + "0x5BDD": "0xC7DE", + "0x6C81": "0xC7DF", + "0x9752": "0xC7E0", + "0x8F7B": "0xC7E1", + "0x6C22": "0xC7E2", + "0x503E": "0xC7E3", + "0x537F": "0xC7E4", + "0x6E05": "0xC7E5", + "0x64CE": "0xC7E6", + "0x6674": "0xC7E7", + "0x6C30": "0xC7E8", + "0x60C5": "0xC7E9", + "0x9877": "0xC7EA", + "0x8BF7": "0xC7EB", + "0x5E86": "0xC7EC", + "0x743C": "0xC7ED", + "0x7A77": "0xC7EE", + "0x79CB": "0xC7EF", + "0x4E18": "0xC7F0", + "0x90B1": "0xC7F1", + "0x7403": "0xC7F2", + "0x6C42": "0xC7F3", + "0x56DA": "0xC7F4", + "0x914B": "0xC7F5", + "0x6CC5": "0xC7F6", + "0x8D8B": "0xC7F7", + "0x533A": "0xC7F8", + "0x86C6": "0xC7F9", + "0x66F2": "0xC7FA", + "0x8EAF": "0xC7FB", + "0x5C48": "0xC7FC", + "0x9A71": "0xC7FD", + "0x6E20": "0xC7FE", + "0x53D6": "0xC8A1", + "0x5A36": "0xC8A2", + "0x9F8B": "0xC8A3", + "0x8DA3": "0xC8A4", + "0x53BB": "0xC8A5", + "0x5708": "0xC8A6", + "0x98A7": "0xC8A7", + "0x6743": "0xC8A8", + "0x919B": "0xC8A9", + "0x6CC9": "0xC8AA", + "0x5168": "0xC8AB", + "0x75CA": "0xC8AC", + "0x62F3": "0xC8AD", + "0x72AC": "0xC8AE", + "0x5238": "0xC8AF", + "0x529D": "0xC8B0", + "0x7F3A": "0xC8B1", + "0x7094": "0xC8B2", + "0x7638": "0xC8B3", + "0x5374": "0xC8B4", + "0x9E4A": "0xC8B5", + "0x69B7": "0xC8B6", + "0x786E": "0xC8B7", + "0x96C0": "0xC8B8", + "0x88D9": "0xC8B9", + "0x7FA4": "0xC8BA", + "0x7136": "0xC8BB", + "0x71C3": "0xC8BC", + "0x5189": "0xC8BD", + "0x67D3": "0xC8BE", + "0x74E4": "0xC8BF", + "0x58E4": "0xC8C0", + "0x6518": "0xC8C1", + "0x56B7": "0xC8C2", + "0x8BA9": "0xC8C3", + "0x9976": "0xC8C4", + "0x6270": "0xC8C5", + "0x7ED5": "0xC8C6", + "0x60F9": "0xC8C7", + "0x70ED": "0xC8C8", + "0x58EC": "0xC8C9", + "0x4EC1": "0xC8CA", + "0x4EBA": "0xC8CB", + "0x5FCD": "0xC8CC", + "0x97E7": "0xC8CD", + "0x4EFB": "0xC8CE", + "0x8BA4": "0xC8CF", + "0x5203": "0xC8D0", + "0x598A": "0xC8D1", + "0x7EAB": "0xC8D2", + "0x6254": "0xC8D3", + "0x4ECD": "0xC8D4", + "0x65E5": "0xC8D5", + "0x620E": "0xC8D6", + "0x8338": "0xC8D7", + "0x84C9": "0xC8D8", + "0x8363": "0xC8D9", + "0x878D": "0xC8DA", + "0x7194": "0xC8DB", + "0x6EB6": "0xC8DC", + "0x5BB9": "0xC8DD", + "0x7ED2": "0xC8DE", + "0x5197": "0xC8DF", + "0x63C9": "0xC8E0", + "0x67D4": "0xC8E1", + "0x8089": "0xC8E2", + "0x8339": "0xC8E3", + "0x8815": "0xC8E4", + "0x5112": "0xC8E5", + "0x5B7A": "0xC8E6", + "0x5982": "0xC8E7", + "0x8FB1": "0xC8E8", + "0x4E73": "0xC8E9", + "0x6C5D": "0xC8EA", + "0x5165": "0xC8EB", + "0x8925": "0xC8EC", + "0x8F6F": "0xC8ED", + "0x962E": "0xC8EE", + "0x854A": "0xC8EF", + "0x745E": "0xC8F0", + "0x9510": "0xC8F1", + "0x95F0": "0xC8F2", + "0x6DA6": "0xC8F3", + "0x82E5": "0xC8F4", + "0x5F31": "0xC8F5", + "0x6492": "0xC8F6", + "0x6D12": "0xC8F7", + "0x8428": "0xC8F8", + "0x816E": "0xC8F9", + "0x9CC3": "0xC8FA", + "0x585E": "0xC8FB", + "0x8D5B": "0xC8FC", + "0x4E09": "0xC8FD", + "0x53C1": "0xC8FE", + "0x4F1E": "0xC9A1", + "0x6563": "0xC9A2", + "0x6851": "0xC9A3", + "0x55D3": "0xC9A4", + "0x4E27": "0xC9A5", + "0x6414": "0xC9A6", + "0x9A9A": "0xC9A7", + "0x626B": "0xC9A8", + "0x5AC2": "0xC9A9", + "0x745F": "0xC9AA", + "0x8272": "0xC9AB", + "0x6DA9": "0xC9AC", + "0x68EE": "0xC9AD", + "0x50E7": "0xC9AE", + "0x838E": "0xC9AF", + "0x7802": "0xC9B0", + "0x6740": "0xC9B1", + "0x5239": "0xC9B2", + "0x6C99": "0xC9B3", + "0x7EB1": "0xC9B4", + "0x50BB": "0xC9B5", + "0x5565": "0xC9B6", + "0x715E": "0xC9B7", + "0x7B5B": "0xC9B8", + "0x6652": "0xC9B9", + "0x73CA": "0xC9BA", + "0x82EB": "0xC9BB", + "0x6749": "0xC9BC", + "0x5C71": "0xC9BD", + "0x5220": "0xC9BE", + "0x717D": "0xC9BF", + "0x886B": "0xC9C0", + "0x95EA": "0xC9C1", + "0x9655": "0xC9C2", + "0x64C5": "0xC9C3", + "0x8D61": "0xC9C4", + "0x81B3": "0xC9C5", + "0x5584": "0xC9C6", + "0x6C55": "0xC9C7", + "0x6247": "0xC9C8", + "0x7F2E": "0xC9C9", + "0x5892": "0xC9CA", + "0x4F24": "0xC9CB", + "0x5546": "0xC9CC", + "0x8D4F": "0xC9CD", + "0x664C": "0xC9CE", + "0x4E0A": "0xC9CF", + "0x5C1A": "0xC9D0", + "0x88F3": "0xC9D1", + "0x68A2": "0xC9D2", + "0x634E": "0xC9D3", + "0x7A0D": "0xC9D4", + "0x70E7": "0xC9D5", + "0x828D": "0xC9D6", + "0x52FA": "0xC9D7", + "0x97F6": "0xC9D8", + "0x5C11": "0xC9D9", + "0x54E8": "0xC9DA", + "0x90B5": "0xC9DB", + "0x7ECD": "0xC9DC", + "0x5962": "0xC9DD", + "0x8D4A": "0xC9DE", + "0x86C7": "0xC9DF", + "0x820C": "0xC9E0", + "0x820D": "0xC9E1", + "0x8D66": "0xC9E2", + "0x6444": "0xC9E3", + "0x5C04": "0xC9E4", + "0x6151": "0xC9E5", + "0x6D89": "0xC9E6", + "0x793E": "0xC9E7", + "0x8BBE": "0xC9E8", + "0x7837": "0xC9E9", + "0x7533": "0xC9EA", + "0x547B": "0xC9EB", + "0x4F38": "0xC9EC", + "0x8EAB": "0xC9ED", + "0x6DF1": "0xC9EE", + "0x5A20": "0xC9EF", + "0x7EC5": "0xC9F0", + "0x795E": "0xC9F1", + "0x6C88": "0xC9F2", + "0x5BA1": "0xC9F3", + "0x5A76": "0xC9F4", + "0x751A": "0xC9F5", + "0x80BE": "0xC9F6", + "0x614E": "0xC9F7", + "0x6E17": "0xC9F8", + "0x58F0": "0xC9F9", + "0x751F": "0xC9FA", + "0x7525": "0xC9FB", + "0x7272": "0xC9FC", + "0x5347": "0xC9FD", + "0x7EF3": "0xC9FE", + "0x7701": "0xCAA1", + "0x76DB": "0xCAA2", + "0x5269": "0xCAA3", + "0x80DC": "0xCAA4", + "0x5723": "0xCAA5", + "0x5E08": "0xCAA6", + "0x5931": "0xCAA7", + "0x72EE": "0xCAA8", + "0x65BD": "0xCAA9", + "0x6E7F": "0xCAAA", + "0x8BD7": "0xCAAB", + "0x5C38": "0xCAAC", + "0x8671": "0xCAAD", + "0x5341": "0xCAAE", + "0x77F3": "0xCAAF", + "0x62FE": "0xCAB0", + "0x65F6": "0xCAB1", + "0x4EC0": "0xCAB2", + "0x98DF": "0xCAB3", + "0x8680": "0xCAB4", + "0x5B9E": "0xCAB5", + "0x8BC6": "0xCAB6", + "0x53F2": "0xCAB7", + "0x77E2": "0xCAB8", + "0x4F7F": "0xCAB9", + "0x5C4E": "0xCABA", + "0x9A76": "0xCABB", + "0x59CB": "0xCABC", + "0x5F0F": "0xCABD", + "0x793A": "0xCABE", + "0x58EB": "0xCABF", + "0x4E16": "0xCAC0", + "0x67FF": "0xCAC1", + "0x4E8B": "0xCAC2", + "0x62ED": "0xCAC3", + "0x8A93": "0xCAC4", + "0x901D": "0xCAC5", + "0x52BF": "0xCAC6", + "0x662F": "0xCAC7", + "0x55DC": "0xCAC8", + "0x566C": "0xCAC9", + "0x9002": "0xCACA", + "0x4ED5": "0xCACB", + "0x4F8D": "0xCACC", + "0x91CA": "0xCACD", + "0x9970": "0xCACE", + "0x6C0F": "0xCACF", + "0x5E02": "0xCAD0", + "0x6043": "0xCAD1", + "0x5BA4": "0xCAD2", + "0x89C6": "0xCAD3", + "0x8BD5": "0xCAD4", + "0x6536": "0xCAD5", + "0x624B": "0xCAD6", + "0x9996": "0xCAD7", + "0x5B88": "0xCAD8", + "0x5BFF": "0xCAD9", + "0x6388": "0xCADA", + "0x552E": "0xCADB", + "0x53D7": "0xCADC", + "0x7626": "0xCADD", + "0x517D": "0xCADE", + "0x852C": "0xCADF", + "0x67A2": "0xCAE0", + "0x68B3": "0xCAE1", + "0x6B8A": "0xCAE2", + "0x6292": "0xCAE3", + "0x8F93": "0xCAE4", + "0x53D4": "0xCAE5", + "0x8212": "0xCAE6", + "0x6DD1": "0xCAE7", + "0x758F": "0xCAE8", + "0x4E66": "0xCAE9", + "0x8D4E": "0xCAEA", + "0x5B70": "0xCAEB", + "0x719F": "0xCAEC", + "0x85AF": "0xCAED", + "0x6691": "0xCAEE", + "0x66D9": "0xCAEF", + "0x7F72": "0xCAF0", + "0x8700": "0xCAF1", + "0x9ECD": "0xCAF2", + "0x9F20": "0xCAF3", + "0x5C5E": "0xCAF4", + "0x672F": "0xCAF5", + "0x8FF0": "0xCAF6", + "0x6811": "0xCAF7", + "0x675F": "0xCAF8", + "0x620D": "0xCAF9", + "0x7AD6": "0xCAFA", + "0x5885": "0xCAFB", + "0x5EB6": "0xCAFC", + "0x6570": "0xCAFD", + "0x6F31": "0xCAFE", + "0x6055": "0xCBA1", + "0x5237": "0xCBA2", + "0x800D": "0xCBA3", + "0x6454": "0xCBA4", + "0x8870": "0xCBA5", + "0x7529": "0xCBA6", + "0x5E05": "0xCBA7", + "0x6813": "0xCBA8", + "0x62F4": "0xCBA9", + "0x971C": "0xCBAA", + "0x53CC": "0xCBAB", + "0x723D": "0xCBAC", + "0x8C01": "0xCBAD", + "0x6C34": "0xCBAE", + "0x7761": "0xCBAF", + "0x7A0E": "0xCBB0", + "0x542E": "0xCBB1", + "0x77AC": "0xCBB2", + "0x987A": "0xCBB3", + "0x821C": "0xCBB4", + "0x8BF4": "0xCBB5", + "0x7855": "0xCBB6", + "0x6714": "0xCBB7", + "0x70C1": "0xCBB8", + "0x65AF": "0xCBB9", + "0x6495": "0xCBBA", + "0x5636": "0xCBBB", + "0x601D": "0xCBBC", + "0x79C1": "0xCBBD", + "0x53F8": "0xCBBE", + "0x4E1D": "0xCBBF", + "0x6B7B": "0xCBC0", + "0x8086": "0xCBC1", + "0x5BFA": "0xCBC2", + "0x55E3": "0xCBC3", + "0x56DB": "0xCBC4", + "0x4F3A": "0xCBC5", + "0x4F3C": "0xCBC6", + "0x9972": "0xCBC7", + "0x5DF3": "0xCBC8", + "0x677E": "0xCBC9", + "0x8038": "0xCBCA", + "0x6002": "0xCBCB", + "0x9882": "0xCBCC", + "0x9001": "0xCBCD", + "0x5B8B": "0xCBCE", + "0x8BBC": "0xCBCF", + "0x8BF5": "0xCBD0", + "0x641C": "0xCBD1", + "0x8258": "0xCBD2", + "0x64DE": "0xCBD3", + "0x55FD": "0xCBD4", + "0x82CF": "0xCBD5", + "0x9165": "0xCBD6", + "0x4FD7": "0xCBD7", + "0x7D20": "0xCBD8", + "0x901F": "0xCBD9", + "0x7C9F": "0xCBDA", + "0x50F3": "0xCBDB", + "0x5851": "0xCBDC", + "0x6EAF": "0xCBDD", + "0x5BBF": "0xCBDE", + "0x8BC9": "0xCBDF", + "0x8083": "0xCBE0", + "0x9178": "0xCBE1", + "0x849C": "0xCBE2", + "0x7B97": "0xCBE3", + "0x867D": "0xCBE4", + "0x968B": "0xCBE5", + "0x968F": "0xCBE6", + "0x7EE5": "0xCBE7", + "0x9AD3": "0xCBE8", + "0x788E": "0xCBE9", + "0x5C81": "0xCBEA", + "0x7A57": "0xCBEB", + "0x9042": "0xCBEC", + "0x96A7": "0xCBED", + "0x795F": "0xCBEE", + "0x5B59": "0xCBEF", + "0x635F": "0xCBF0", + "0x7B0B": "0xCBF1", + "0x84D1": "0xCBF2", + "0x68AD": "0xCBF3", + "0x5506": "0xCBF4", + "0x7F29": "0xCBF5", + "0x7410": "0xCBF6", + "0x7D22": "0xCBF7", + "0x9501": "0xCBF8", + "0x6240": "0xCBF9", + "0x584C": "0xCBFA", + "0x4ED6": "0xCBFB", + "0x5B83": "0xCBFC", + "0x5979": "0xCBFD", + "0x5854": "0xCBFE", + "0x736D": "0xCCA1", + "0x631E": "0xCCA2", + "0x8E4B": "0xCCA3", + "0x8E0F": "0xCCA4", + "0x80CE": "0xCCA5", + "0x82D4": "0xCCA6", + "0x62AC": "0xCCA7", + "0x53F0": "0xCCA8", + "0x6CF0": "0xCCA9", + "0x915E": "0xCCAA", + "0x592A": "0xCCAB", + "0x6001": "0xCCAC", + "0x6C70": "0xCCAD", + "0x574D": "0xCCAE", + "0x644A": "0xCCAF", + "0x8D2A": "0xCCB0", + "0x762B": "0xCCB1", + "0x6EE9": "0xCCB2", + "0x575B": "0xCCB3", + "0x6A80": "0xCCB4", + "0x75F0": "0xCCB5", + "0x6F6D": "0xCCB6", + "0x8C2D": "0xCCB7", + "0x8C08": "0xCCB8", + "0x5766": "0xCCB9", + "0x6BEF": "0xCCBA", + "0x8892": "0xCCBB", + "0x78B3": "0xCCBC", + "0x63A2": "0xCCBD", + "0x53F9": "0xCCBE", + "0x70AD": "0xCCBF", + "0x6C64": "0xCCC0", + "0x5858": "0xCCC1", + "0x642A": "0xCCC2", + "0x5802": "0xCCC3", + "0x68E0": "0xCCC4", + "0x819B": "0xCCC5", + "0x5510": "0xCCC6", + "0x7CD6": "0xCCC7", + "0x5018": "0xCCC8", + "0x8EBA": "0xCCC9", + "0x6DCC": "0xCCCA", + "0x8D9F": "0xCCCB", + "0x70EB": "0xCCCC", + "0x638F": "0xCCCD", + "0x6D9B": "0xCCCE", + "0x6ED4": "0xCCCF", + "0x7EE6": "0xCCD0", + "0x8404": "0xCCD1", + "0x6843": "0xCCD2", + "0x9003": "0xCCD3", + "0x6DD8": "0xCCD4", + "0x9676": "0xCCD5", + "0x8BA8": "0xCCD6", + "0x5957": "0xCCD7", + "0x7279": "0xCCD8", + "0x85E4": "0xCCD9", + "0x817E": "0xCCDA", + "0x75BC": "0xCCDB", + "0x8A8A": "0xCCDC", + "0x68AF": "0xCCDD", + "0x5254": "0xCCDE", + "0x8E22": "0xCCDF", + "0x9511": "0xCCE0", + "0x63D0": "0xCCE1", + "0x9898": "0xCCE2", + "0x8E44": "0xCCE3", + "0x557C": "0xCCE4", + "0x4F53": "0xCCE5", + "0x66FF": "0xCCE6", + "0x568F": "0xCCE7", + "0x60D5": "0xCCE8", + "0x6D95": "0xCCE9", + "0x5243": "0xCCEA", + "0x5C49": "0xCCEB", + "0x5929": "0xCCEC", + "0x6DFB": "0xCCED", + "0x586B": "0xCCEE", + "0x7530": "0xCCEF", + "0x751C": "0xCCF0", + "0x606C": "0xCCF1", + "0x8214": "0xCCF2", + "0x8146": "0xCCF3", + "0x6311": "0xCCF4", + "0x6761": "0xCCF5", + "0x8FE2": "0xCCF6", + "0x773A": "0xCCF7", + "0x8DF3": "0xCCF8", + "0x8D34": "0xCCF9", + "0x94C1": "0xCCFA", + "0x5E16": "0xCCFB", + "0x5385": "0xCCFC", + "0x542C": "0xCCFD", + "0x70C3": "0xCCFE", + "0x6C40": "0xCDA1", + "0x5EF7": "0xCDA2", + "0x505C": "0xCDA3", + "0x4EAD": "0xCDA4", + "0x5EAD": "0xCDA5", + "0x633A": "0xCDA6", + "0x8247": "0xCDA7", + "0x901A": "0xCDA8", + "0x6850": "0xCDA9", + "0x916E": "0xCDAA", + "0x77B3": "0xCDAB", + "0x540C": "0xCDAC", + "0x94DC": "0xCDAD", + "0x5F64": "0xCDAE", + "0x7AE5": "0xCDAF", + "0x6876": "0xCDB0", + "0x6345": "0xCDB1", + "0x7B52": "0xCDB2", + "0x7EDF": "0xCDB3", + "0x75DB": "0xCDB4", + "0x5077": "0xCDB5", + "0x6295": "0xCDB6", + "0x5934": "0xCDB7", + "0x900F": "0xCDB8", + "0x51F8": "0xCDB9", + "0x79C3": "0xCDBA", + "0x7A81": "0xCDBB", + "0x56FE": "0xCDBC", + "0x5F92": "0xCDBD", + "0x9014": "0xCDBE", + "0x6D82": "0xCDBF", + "0x5C60": "0xCDC0", + "0x571F": "0xCDC1", + "0x5410": "0xCDC2", + "0x5154": "0xCDC3", + "0x6E4D": "0xCDC4", + "0x56E2": "0xCDC5", + "0x63A8": "0xCDC6", + "0x9893": "0xCDC7", + "0x817F": "0xCDC8", + "0x8715": "0xCDC9", + "0x892A": "0xCDCA", + "0x9000": "0xCDCB", + "0x541E": "0xCDCC", + "0x5C6F": "0xCDCD", + "0x81C0": "0xCDCE", + "0x62D6": "0xCDCF", + "0x6258": "0xCDD0", + "0x8131": "0xCDD1", + "0x9E35": "0xCDD2", + "0x9640": "0xCDD3", + "0x9A6E": "0xCDD4", + "0x9A7C": "0xCDD5", + "0x692D": "0xCDD6", + "0x59A5": "0xCDD7", + "0x62D3": "0xCDD8", + "0x553E": "0xCDD9", + "0x6316": "0xCDDA", + "0x54C7": "0xCDDB", + "0x86D9": "0xCDDC", + "0x6D3C": "0xCDDD", + "0x5A03": "0xCDDE", + "0x74E6": "0xCDDF", + "0x889C": "0xCDE0", + "0x6B6A": "0xCDE1", + "0x5916": "0xCDE2", + "0x8C4C": "0xCDE3", + "0x5F2F": "0xCDE4", + "0x6E7E": "0xCDE5", + "0x73A9": "0xCDE6", + "0x987D": "0xCDE7", + "0x4E38": "0xCDE8", + "0x70F7": "0xCDE9", + "0x5B8C": "0xCDEA", + "0x7897": "0xCDEB", + "0x633D": "0xCDEC", + "0x665A": "0xCDED", + "0x7696": "0xCDEE", + "0x60CB": "0xCDEF", + "0x5B9B": "0xCDF0", + "0x5A49": "0xCDF1", + "0x4E07": "0xCDF2", + "0x8155": "0xCDF3", + "0x6C6A": "0xCDF4", + "0x738B": "0xCDF5", + "0x4EA1": "0xCDF6", + "0x6789": "0xCDF7", + "0x7F51": "0xCDF8", + "0x5F80": "0xCDF9", + "0x65FA": "0xCDFA", + "0x671B": "0xCDFB", + "0x5FD8": "0xCDFC", + "0x5984": "0xCDFD", + "0x5A01": "0xCDFE", + "0x5DCD": "0xCEA1", + "0x5FAE": "0xCEA2", + "0x5371": "0xCEA3", + "0x97E6": "0xCEA4", + "0x8FDD": "0xCEA5", + "0x6845": "0xCEA6", + "0x56F4": "0xCEA7", + "0x552F": "0xCEA8", + "0x60DF": "0xCEA9", + "0x4E3A": "0xCEAA", + "0x6F4D": "0xCEAB", + "0x7EF4": "0xCEAC", + "0x82C7": "0xCEAD", + "0x840E": "0xCEAE", + "0x59D4": "0xCEAF", + "0x4F1F": "0xCEB0", + "0x4F2A": "0xCEB1", + "0x5C3E": "0xCEB2", + "0x7EAC": "0xCEB3", + "0x672A": "0xCEB4", + "0x851A": "0xCEB5", + "0x5473": "0xCEB6", + "0x754F": "0xCEB7", + "0x80C3": "0xCEB8", + "0x5582": "0xCEB9", + "0x9B4F": "0xCEBA", + "0x4F4D": "0xCEBB", + "0x6E2D": "0xCEBC", + "0x8C13": "0xCEBD", + "0x5C09": "0xCEBE", + "0x6170": "0xCEBF", + "0x536B": "0xCEC0", + "0x761F": "0xCEC1", + "0x6E29": "0xCEC2", + "0x868A": "0xCEC3", + "0x6587": "0xCEC4", + "0x95FB": "0xCEC5", + "0x7EB9": "0xCEC6", + "0x543B": "0xCEC7", + "0x7A33": "0xCEC8", + "0x7D0A": "0xCEC9", + "0x95EE": "0xCECA", + "0x55E1": "0xCECB", + "0x7FC1": "0xCECC", + "0x74EE": "0xCECD", + "0x631D": "0xCECE", + "0x8717": "0xCECF", + "0x6DA1": "0xCED0", + "0x7A9D": "0xCED1", + "0x6211": "0xCED2", + "0x65A1": "0xCED3", + "0x5367": "0xCED4", + "0x63E1": "0xCED5", + "0x6C83": "0xCED6", + "0x5DEB": "0xCED7", + "0x545C": "0xCED8", + "0x94A8": "0xCED9", + "0x4E4C": "0xCEDA", + "0x6C61": "0xCEDB", + "0x8BEC": "0xCEDC", + "0x5C4B": "0xCEDD", + "0x65E0": "0xCEDE", + "0x829C": "0xCEDF", + "0x68A7": "0xCEE0", + "0x543E": "0xCEE1", + "0x5434": "0xCEE2", + "0x6BCB": "0xCEE3", + "0x6B66": "0xCEE4", + "0x4E94": "0xCEE5", + "0x6342": "0xCEE6", + "0x5348": "0xCEE7", + "0x821E": "0xCEE8", + "0x4F0D": "0xCEE9", + "0x4FAE": "0xCEEA", + "0x575E": "0xCEEB", + "0x620A": "0xCEEC", + "0x96FE": "0xCEED", + "0x6664": "0xCEEE", + "0x7269": "0xCEEF", + "0x52FF": "0xCEF0", + "0x52A1": "0xCEF1", + "0x609F": "0xCEF2", + "0x8BEF": "0xCEF3", + "0x6614": "0xCEF4", + "0x7199": "0xCEF5", + "0x6790": "0xCEF6", + "0x897F": "0xCEF7", + "0x7852": "0xCEF8", + "0x77FD": "0xCEF9", + "0x6670": "0xCEFA", + "0x563B": "0xCEFB", + "0x5438": "0xCEFC", + "0x9521": "0xCEFD", + "0x727A": "0xCEFE", + "0x7A00": "0xCFA1", + "0x606F": "0xCFA2", + "0x5E0C": "0xCFA3", + "0x6089": "0xCFA4", + "0x819D": "0xCFA5", + "0x5915": "0xCFA6", + "0x60DC": "0xCFA7", + "0x7184": "0xCFA8", + "0x70EF": "0xCFA9", + "0x6EAA": "0xCFAA", + "0x6C50": "0xCFAB", + "0x7280": "0xCFAC", + "0x6A84": "0xCFAD", + "0x88AD": "0xCFAE", + "0x5E2D": "0xCFAF", + "0x4E60": "0xCFB0", + "0x5AB3": "0xCFB1", + "0x559C": "0xCFB2", + "0x94E3": "0xCFB3", + "0x6D17": "0xCFB4", + "0x7CFB": "0xCFB5", + "0x9699": "0xCFB6", + "0x620F": "0xCFB7", + "0x7EC6": "0xCFB8", + "0x778E": "0xCFB9", + "0x867E": "0xCFBA", + "0x5323": "0xCFBB", + "0x971E": "0xCFBC", + "0x8F96": "0xCFBD", + "0x6687": "0xCFBE", + "0x5CE1": "0xCFBF", + "0x4FA0": "0xCFC0", + "0x72ED": "0xCFC1", + "0x4E0B": "0xCFC2", + "0x53A6": "0xCFC3", + "0x590F": "0xCFC4", + "0x5413": "0xCFC5", + "0x6380": "0xCFC6", + "0x9528": "0xCFC7", + "0x5148": "0xCFC8", + "0x4ED9": "0xCFC9", + "0x9C9C": "0xCFCA", + "0x7EA4": "0xCFCB", + "0x54B8": "0xCFCC", + "0x8D24": "0xCFCD", + "0x8854": "0xCFCE", + "0x8237": "0xCFCF", + "0x95F2": "0xCFD0", + "0x6D8E": "0xCFD1", + "0x5F26": "0xCFD2", + "0x5ACC": "0xCFD3", + "0x663E": "0xCFD4", + "0x9669": "0xCFD5", + "0x73B0": "0xCFD6", + "0x732E": "0xCFD7", + "0x53BF": "0xCFD8", + "0x817A": "0xCFD9", + "0x9985": "0xCFDA", + "0x7FA1": "0xCFDB", + "0x5BAA": "0xCFDC", + "0x9677": "0xCFDD", + "0x9650": "0xCFDE", + "0x7EBF": "0xCFDF", + "0x76F8": "0xCFE0", + "0x53A2": "0xCFE1", + "0x9576": "0xCFE2", + "0x9999": "0xCFE3", + "0x7BB1": "0xCFE4", + "0x8944": "0xCFE5", + "0x6E58": "0xCFE6", + "0x4E61": "0xCFE7", + "0x7FD4": "0xCFE8", + "0x7965": "0xCFE9", + "0x8BE6": "0xCFEA", + "0x60F3": "0xCFEB", + "0x54CD": "0xCFEC", + "0x4EAB": "0xCFED", + "0x9879": "0xCFEE", + "0x5DF7": "0xCFEF", + "0x6A61": "0xCFF0", + "0x50CF": "0xCFF1", + "0x5411": "0xCFF2", + "0x8C61": "0xCFF3", + "0x8427": "0xCFF4", + "0x785D": "0xCFF5", + "0x9704": "0xCFF6", + "0x524A": "0xCFF7", + "0x54EE": "0xCFF8", + "0x56A3": "0xCFF9", + "0x9500": "0xCFFA", + "0x6D88": "0xCFFB", + "0x5BB5": "0xCFFC", + "0x6DC6": "0xCFFD", + "0x6653": "0xCFFE", + "0x5C0F": "0xD0A1", + "0x5B5D": "0xD0A2", + "0x6821": "0xD0A3", + "0x8096": "0xD0A4", + "0x5578": "0xD0A5", + "0x7B11": "0xD0A6", + "0x6548": "0xD0A7", + "0x6954": "0xD0A8", + "0x4E9B": "0xD0A9", + "0x6B47": "0xD0AA", + "0x874E": "0xD0AB", + "0x978B": "0xD0AC", + "0x534F": "0xD0AD", + "0x631F": "0xD0AE", + "0x643A": "0xD0AF", + "0x90AA": "0xD0B0", + "0x659C": "0xD0B1", + "0x80C1": "0xD0B2", + "0x8C10": "0xD0B3", + "0x5199": "0xD0B4", + "0x68B0": "0xD0B5", + "0x5378": "0xD0B6", + "0x87F9": "0xD0B7", + "0x61C8": "0xD0B8", + "0x6CC4": "0xD0B9", + "0x6CFB": "0xD0BA", + "0x8C22": "0xD0BB", + "0x5C51": "0xD0BC", + "0x85AA": "0xD0BD", + "0x82AF": "0xD0BE", + "0x950C": "0xD0BF", + "0x6B23": "0xD0C0", + "0x8F9B": "0xD0C1", + "0x65B0": "0xD0C2", + "0x5FFB": "0xD0C3", + "0x5FC3": "0xD0C4", + "0x4FE1": "0xD0C5", + "0x8845": "0xD0C6", + "0x661F": "0xD0C7", + "0x8165": "0xD0C8", + "0x7329": "0xD0C9", + "0x60FA": "0xD0CA", + "0x5174": "0xD0CB", + "0x5211": "0xD0CC", + "0x578B": "0xD0CD", + "0x5F62": "0xD0CE", + "0x90A2": "0xD0CF", + "0x884C": "0xD0D0", + "0x9192": "0xD0D1", + "0x5E78": "0xD0D2", + "0x674F": "0xD0D3", + "0x6027": "0xD0D4", + "0x59D3": "0xD0D5", + "0x5144": "0xD0D6", + "0x51F6": "0xD0D7", + "0x80F8": "0xD0D8", + "0x5308": "0xD0D9", + "0x6C79": "0xD0DA", + "0x96C4": "0xD0DB", + "0x718A": "0xD0DC", + "0x4F11": "0xD0DD", + "0x4FEE": "0xD0DE", + "0x7F9E": "0xD0DF", + "0x673D": "0xD0E0", + "0x55C5": "0xD0E1", + "0x9508": "0xD0E2", + "0x79C0": "0xD0E3", + "0x8896": "0xD0E4", + "0x7EE3": "0xD0E5", + "0x589F": "0xD0E6", + "0x620C": "0xD0E7", + "0x9700": "0xD0E8", + "0x865A": "0xD0E9", + "0x5618": "0xD0EA", + "0x987B": "0xD0EB", + "0x5F90": "0xD0EC", + "0x8BB8": "0xD0ED", + "0x84C4": "0xD0EE", + "0x9157": "0xD0EF", + "0x53D9": "0xD0F0", + "0x65ED": "0xD0F1", + "0x5E8F": "0xD0F2", + "0x755C": "0xD0F3", + "0x6064": "0xD0F4", + "0x7D6E": "0xD0F5", + "0x5A7F": "0xD0F6", + "0x7EEA": "0xD0F7", + "0x7EED": "0xD0F8", + "0x8F69": "0xD0F9", + "0x55A7": "0xD0FA", + "0x5BA3": "0xD0FB", + "0x60AC": "0xD0FC", + "0x65CB": "0xD0FD", + "0x7384": "0xD0FE", + "0x9009": "0xD1A1", + "0x7663": "0xD1A2", + "0x7729": "0xD1A3", + "0x7EDA": "0xD1A4", + "0x9774": "0xD1A5", + "0x859B": "0xD1A6", + "0x5B66": "0xD1A7", + "0x7A74": "0xD1A8", + "0x96EA": "0xD1A9", + "0x8840": "0xD1AA", + "0x52CB": "0xD1AB", + "0x718F": "0xD1AC", + "0x5FAA": "0xD1AD", + "0x65EC": "0xD1AE", + "0x8BE2": "0xD1AF", + "0x5BFB": "0xD1B0", + "0x9A6F": "0xD1B1", + "0x5DE1": "0xD1B2", + "0x6B89": "0xD1B3", + "0x6C5B": "0xD1B4", + "0x8BAD": "0xD1B5", + "0x8BAF": "0xD1B6", + "0x900A": "0xD1B7", + "0x8FC5": "0xD1B8", + "0x538B": "0xD1B9", + "0x62BC": "0xD1BA", + "0x9E26": "0xD1BB", + "0x9E2D": "0xD1BC", + "0x5440": "0xD1BD", + "0x4E2B": "0xD1BE", + "0x82BD": "0xD1BF", + "0x7259": "0xD1C0", + "0x869C": "0xD1C1", + "0x5D16": "0xD1C2", + "0x8859": "0xD1C3", + "0x6DAF": "0xD1C4", + "0x96C5": "0xD1C5", + "0x54D1": "0xD1C6", + "0x4E9A": "0xD1C7", + "0x8BB6": "0xD1C8", + "0x7109": "0xD1C9", + "0x54BD": "0xD1CA", + "0x9609": "0xD1CB", + "0x70DF": "0xD1CC", + "0x6DF9": "0xD1CD", + "0x76D0": "0xD1CE", + "0x4E25": "0xD1CF", + "0x7814": "0xD1D0", + "0x8712": "0xD1D1", + "0x5CA9": "0xD1D2", + "0x5EF6": "0xD1D3", + "0x8A00": "0xD1D4", + "0x989C": "0xD1D5", + "0x960E": "0xD1D6", + "0x708E": "0xD1D7", + "0x6CBF": "0xD1D8", + "0x5944": "0xD1D9", + "0x63A9": "0xD1DA", + "0x773C": "0xD1DB", + "0x884D": "0xD1DC", + "0x6F14": "0xD1DD", + "0x8273": "0xD1DE", + "0x5830": "0xD1DF", + "0x71D5": "0xD1E0", + "0x538C": "0xD1E1", + "0x781A": "0xD1E2", + "0x96C1": "0xD1E3", + "0x5501": "0xD1E4", + "0x5F66": "0xD1E5", + "0x7130": "0xD1E6", + "0x5BB4": "0xD1E7", + "0x8C1A": "0xD1E8", + "0x9A8C": "0xD1E9", + "0x6B83": "0xD1EA", + "0x592E": "0xD1EB", + "0x9E2F": "0xD1EC", + "0x79E7": "0xD1ED", + "0x6768": "0xD1EE", + "0x626C": "0xD1EF", + "0x4F6F": "0xD1F0", + "0x75A1": "0xD1F1", + "0x7F8A": "0xD1F2", + "0x6D0B": "0xD1F3", + "0x9633": "0xD1F4", + "0x6C27": "0xD1F5", + "0x4EF0": "0xD1F6", + "0x75D2": "0xD1F7", + "0x517B": "0xD1F8", + "0x6837": "0xD1F9", + "0x6F3E": "0xD1FA", + "0x9080": "0xD1FB", + "0x8170": "0xD1FC", + "0x5996": "0xD1FD", + "0x7476": "0xD1FE", + "0x6447": "0xD2A1", + "0x5C27": "0xD2A2", + "0x9065": "0xD2A3", + "0x7A91": "0xD2A4", + "0x8C23": "0xD2A5", + "0x59DA": "0xD2A6", + "0x54AC": "0xD2A7", + "0x8200": "0xD2A8", + "0x836F": "0xD2A9", + "0x8981": "0xD2AA", + "0x8000": "0xD2AB", + "0x6930": "0xD2AC", + "0x564E": "0xD2AD", + "0x8036": "0xD2AE", + "0x7237": "0xD2AF", + "0x91CE": "0xD2B0", + "0x51B6": "0xD2B1", + "0x4E5F": "0xD2B2", + "0x9875": "0xD2B3", + "0x6396": "0xD2B4", + "0x4E1A": "0xD2B5", + "0x53F6": "0xD2B6", + "0x66F3": "0xD2B7", + "0x814B": "0xD2B8", + "0x591C": "0xD2B9", + "0x6DB2": "0xD2BA", + "0x4E00": "0xD2BB", + "0x58F9": "0xD2BC", + "0x533B": "0xD2BD", + "0x63D6": "0xD2BE", + "0x94F1": "0xD2BF", + "0x4F9D": "0xD2C0", + "0x4F0A": "0xD2C1", + "0x8863": "0xD2C2", + "0x9890": "0xD2C3", + "0x5937": "0xD2C4", + "0x9057": "0xD2C5", + "0x79FB": "0xD2C6", + "0x4EEA": "0xD2C7", + "0x80F0": "0xD2C8", + "0x7591": "0xD2C9", + "0x6C82": "0xD2CA", + "0x5B9C": "0xD2CB", + "0x59E8": "0xD2CC", + "0x5F5D": "0xD2CD", + "0x6905": "0xD2CE", + "0x8681": "0xD2CF", + "0x501A": "0xD2D0", + "0x5DF2": "0xD2D1", + "0x4E59": "0xD2D2", + "0x77E3": "0xD2D3", + "0x4EE5": "0xD2D4", + "0x827A": "0xD2D5", + "0x6291": "0xD2D6", + "0x6613": "0xD2D7", + "0x9091": "0xD2D8", + "0x5C79": "0xD2D9", + "0x4EBF": "0xD2DA", + "0x5F79": "0xD2DB", + "0x81C6": "0xD2DC", + "0x9038": "0xD2DD", + "0x8084": "0xD2DE", + "0x75AB": "0xD2DF", + "0x4EA6": "0xD2E0", + "0x88D4": "0xD2E1", + "0x610F": "0xD2E2", + "0x6BC5": "0xD2E3", + "0x5FC6": "0xD2E4", + "0x4E49": "0xD2E5", + "0x76CA": "0xD2E6", + "0x6EA2": "0xD2E7", + "0x8BE3": "0xD2E8", + "0x8BAE": "0xD2E9", + "0x8C0A": "0xD2EA", + "0x8BD1": "0xD2EB", + "0x5F02": "0xD2EC", + "0x7FFC": "0xD2ED", + "0x7FCC": "0xD2EE", + "0x7ECE": "0xD2EF", + "0x8335": "0xD2F0", + "0x836B": "0xD2F1", + "0x56E0": "0xD2F2", + "0x6BB7": "0xD2F3", + "0x97F3": "0xD2F4", + "0x9634": "0xD2F5", + "0x59FB": "0xD2F6", + "0x541F": "0xD2F7", + "0x94F6": "0xD2F8", + "0x6DEB": "0xD2F9", + "0x5BC5": "0xD2FA", + "0x996E": "0xD2FB", + "0x5C39": "0xD2FC", + "0x5F15": "0xD2FD", + "0x9690": "0xD2FE", + "0x5370": "0xD3A1", + "0x82F1": "0xD3A2", + "0x6A31": "0xD3A3", + "0x5A74": "0xD3A4", + "0x9E70": "0xD3A5", + "0x5E94": "0xD3A6", + "0x7F28": "0xD3A7", + "0x83B9": "0xD3A8", + "0x8424": "0xD3A9", + "0x8425": "0xD3AA", + "0x8367": "0xD3AB", + "0x8747": "0xD3AC", + "0x8FCE": "0xD3AD", + "0x8D62": "0xD3AE", + "0x76C8": "0xD3AF", + "0x5F71": "0xD3B0", + "0x9896": "0xD3B1", + "0x786C": "0xD3B2", + "0x6620": "0xD3B3", + "0x54DF": "0xD3B4", + "0x62E5": "0xD3B5", + "0x4F63": "0xD3B6", + "0x81C3": "0xD3B7", + "0x75C8": "0xD3B8", + "0x5EB8": "0xD3B9", + "0x96CD": "0xD3BA", + "0x8E0A": "0xD3BB", + "0x86F9": "0xD3BC", + "0x548F": "0xD3BD", + "0x6CF3": "0xD3BE", + "0x6D8C": "0xD3BF", + "0x6C38": "0xD3C0", + "0x607F": "0xD3C1", + "0x52C7": "0xD3C2", + "0x7528": "0xD3C3", + "0x5E7D": "0xD3C4", + "0x4F18": "0xD3C5", + "0x60A0": "0xD3C6", + "0x5FE7": "0xD3C7", + "0x5C24": "0xD3C8", + "0x7531": "0xD3C9", + "0x90AE": "0xD3CA", + "0x94C0": "0xD3CB", + "0x72B9": "0xD3CC", + "0x6CB9": "0xD3CD", + "0x6E38": "0xD3CE", + "0x9149": "0xD3CF", + "0x6709": "0xD3D0", + "0x53CB": "0xD3D1", + "0x53F3": "0xD3D2", + "0x4F51": "0xD3D3", + "0x91C9": "0xD3D4", + "0x8BF1": "0xD3D5", + "0x53C8": "0xD3D6", + "0x5E7C": "0xD3D7", + "0x8FC2": "0xD3D8", + "0x6DE4": "0xD3D9", + "0x4E8E": "0xD3DA", + "0x76C2": "0xD3DB", + "0x6986": "0xD3DC", + "0x865E": "0xD3DD", + "0x611A": "0xD3DE", + "0x8206": "0xD3DF", + "0x4F59": "0xD3E0", + "0x4FDE": "0xD3E1", + "0x903E": "0xD3E2", + "0x9C7C": "0xD3E3", + "0x6109": "0xD3E4", + "0x6E1D": "0xD3E5", + "0x6E14": "0xD3E6", + "0x9685": "0xD3E7", + "0x4E88": "0xD3E8", + "0x5A31": "0xD3E9", + "0x96E8": "0xD3EA", + "0x4E0E": "0xD3EB", + "0x5C7F": "0xD3EC", + "0x79B9": "0xD3ED", + "0x5B87": "0xD3EE", + "0x8BED": "0xD3EF", + "0x7FBD": "0xD3F0", + "0x7389": "0xD3F1", + "0x57DF": "0xD3F2", + "0x828B": "0xD3F3", + "0x90C1": "0xD3F4", + "0x5401": "0xD3F5", + "0x9047": "0xD3F6", + "0x55BB": "0xD3F7", + "0x5CEA": "0xD3F8", + "0x5FA1": "0xD3F9", + "0x6108": "0xD3FA", + "0x6B32": "0xD3FB", + "0x72F1": "0xD3FC", + "0x80B2": "0xD3FD", + "0x8A89": "0xD3FE", + "0x6D74": "0xD4A1", + "0x5BD3": "0xD4A2", + "0x88D5": "0xD4A3", + "0x9884": "0xD4A4", + "0x8C6B": "0xD4A5", + "0x9A6D": "0xD4A6", + "0x9E33": "0xD4A7", + "0x6E0A": "0xD4A8", + "0x51A4": "0xD4A9", + "0x5143": "0xD4AA", + "0x57A3": "0xD4AB", + "0x8881": "0xD4AC", + "0x539F": "0xD4AD", + "0x63F4": "0xD4AE", + "0x8F95": "0xD4AF", + "0x56ED": "0xD4B0", + "0x5458": "0xD4B1", + "0x5706": "0xD4B2", + "0x733F": "0xD4B3", + "0x6E90": "0xD4B4", + "0x7F18": "0xD4B5", + "0x8FDC": "0xD4B6", + "0x82D1": "0xD4B7", + "0x613F": "0xD4B8", + "0x6028": "0xD4B9", + "0x9662": "0xD4BA", + "0x66F0": "0xD4BB", + "0x7EA6": "0xD4BC", + "0x8D8A": "0xD4BD", + "0x8DC3": "0xD4BE", + "0x94A5": "0xD4BF", + "0x5CB3": "0xD4C0", + "0x7CA4": "0xD4C1", + "0x6708": "0xD4C2", + "0x60A6": "0xD4C3", + "0x9605": "0xD4C4", + "0x8018": "0xD4C5", + "0x4E91": "0xD4C6", + "0x90E7": "0xD4C7", + "0x5300": "0xD4C8", + "0x9668": "0xD4C9", + "0x5141": "0xD4CA", + "0x8FD0": "0xD4CB", + "0x8574": "0xD4CC", + "0x915D": "0xD4CD", + "0x6655": "0xD4CE", + "0x97F5": "0xD4CF", + "0x5B55": "0xD4D0", + "0x531D": "0xD4D1", + "0x7838": "0xD4D2", + "0x6742": "0xD4D3", + "0x683D": "0xD4D4", + "0x54C9": "0xD4D5", + "0x707E": "0xD4D6", + "0x5BB0": "0xD4D7", + "0x8F7D": "0xD4D8", + "0x518D": "0xD4D9", + "0x5728": "0xD4DA", + "0x54B1": "0xD4DB", + "0x6512": "0xD4DC", + "0x6682": "0xD4DD", + "0x8D5E": "0xD4DE", + "0x8D43": "0xD4DF", + "0x810F": "0xD4E0", + "0x846C": "0xD4E1", + "0x906D": "0xD4E2", + "0x7CDF": "0xD4E3", + "0x51FF": "0xD4E4", + "0x85FB": "0xD4E5", + "0x67A3": "0xD4E6", + "0x65E9": "0xD4E7", + "0x6FA1": "0xD4E8", + "0x86A4": "0xD4E9", + "0x8E81": "0xD4EA", + "0x566A": "0xD4EB", + "0x9020": "0xD4EC", + "0x7682": "0xD4ED", + "0x7076": "0xD4EE", + "0x71E5": "0xD4EF", + "0x8D23": "0xD4F0", + "0x62E9": "0xD4F1", + "0x5219": "0xD4F2", + "0x6CFD": "0xD4F3", + "0x8D3C": "0xD4F4", + "0x600E": "0xD4F5", + "0x589E": "0xD4F6", + "0x618E": "0xD4F7", + "0x66FE": "0xD4F8", + "0x8D60": "0xD4F9", + "0x624E": "0xD4FA", + "0x55B3": "0xD4FB", + "0x6E23": "0xD4FC", + "0x672D": "0xD4FD", + "0x8F67": "0xD4FE", + "0x94E1": "0xD5A1", + "0x95F8": "0xD5A2", + "0x7728": "0xD5A3", + "0x6805": "0xD5A4", + "0x69A8": "0xD5A5", + "0x548B": "0xD5A6", + "0x4E4D": "0xD5A7", + "0x70B8": "0xD5A8", + "0x8BC8": "0xD5A9", + "0x6458": "0xD5AA", + "0x658B": "0xD5AB", + "0x5B85": "0xD5AC", + "0x7A84": "0xD5AD", + "0x503A": "0xD5AE", + "0x5BE8": "0xD5AF", + "0x77BB": "0xD5B0", + "0x6BE1": "0xD5B1", + "0x8A79": "0xD5B2", + "0x7C98": "0xD5B3", + "0x6CBE": "0xD5B4", + "0x76CF": "0xD5B5", + "0x65A9": "0xD5B6", + "0x8F97": "0xD5B7", + "0x5D2D": "0xD5B8", + "0x5C55": "0xD5B9", + "0x8638": "0xD5BA", + "0x6808": "0xD5BB", + "0x5360": "0xD5BC", + "0x6218": "0xD5BD", + "0x7AD9": "0xD5BE", + "0x6E5B": "0xD5BF", + "0x7EFD": "0xD5C0", + "0x6A1F": "0xD5C1", + "0x7AE0": "0xD5C2", + "0x5F70": "0xD5C3", + "0x6F33": "0xD5C4", + "0x5F20": "0xD5C5", + "0x638C": "0xD5C6", + "0x6DA8": "0xD5C7", + "0x6756": "0xD5C8", + "0x4E08": "0xD5C9", + "0x5E10": "0xD5CA", + "0x8D26": "0xD5CB", + "0x4ED7": "0xD5CC", + "0x80C0": "0xD5CD", + "0x7634": "0xD5CE", + "0x969C": "0xD5CF", + "0x62DB": "0xD5D0", + "0x662D": "0xD5D1", + "0x627E": "0xD5D2", + "0x6CBC": "0xD5D3", + "0x8D75": "0xD5D4", + "0x7167": "0xD5D5", + "0x7F69": "0xD5D6", + "0x5146": "0xD5D7", + "0x8087": "0xD5D8", + "0x53EC": "0xD5D9", + "0x906E": "0xD5DA", + "0x6298": "0xD5DB", + "0x54F2": "0xD5DC", + "0x86F0": "0xD5DD", + "0x8F99": "0xD5DE", + "0x8005": "0xD5DF", + "0x9517": "0xD5E0", + "0x8517": "0xD5E1", + "0x8FD9": "0xD5E2", + "0x6D59": "0xD5E3", + "0x73CD": "0xD5E4", + "0x659F": "0xD5E5", + "0x771F": "0xD5E6", + "0x7504": "0xD5E7", + "0x7827": "0xD5E8", + "0x81FB": "0xD5E9", + "0x8D1E": "0xD5EA", + "0x9488": "0xD5EB", + "0x4FA6": "0xD5EC", + "0x6795": "0xD5ED", + "0x75B9": "0xD5EE", + "0x8BCA": "0xD5EF", + "0x9707": "0xD5F0", + "0x632F": "0xD5F1", + "0x9547": "0xD5F2", + "0x9635": "0xD5F3", + "0x84B8": "0xD5F4", + "0x6323": "0xD5F5", + "0x7741": "0xD5F6", + "0x5F81": "0xD5F7", + "0x72F0": "0xD5F8", + "0x4E89": "0xD5F9", + "0x6014": "0xD5FA", + "0x6574": "0xD5FB", + "0x62EF": "0xD5FC", + "0x6B63": "0xD5FD", + "0x653F": "0xD5FE", + "0x5E27": "0xD6A1", + "0x75C7": "0xD6A2", + "0x90D1": "0xD6A3", + "0x8BC1": "0xD6A4", + "0x829D": "0xD6A5", + "0x679D": "0xD6A6", + "0x652F": "0xD6A7", + "0x5431": "0xD6A8", + "0x8718": "0xD6A9", + "0x77E5": "0xD6AA", + "0x80A2": "0xD6AB", + "0x8102": "0xD6AC", + "0x6C41": "0xD6AD", + "0x4E4B": "0xD6AE", + "0x7EC7": "0xD6AF", + "0x804C": "0xD6B0", + "0x76F4": "0xD6B1", + "0x690D": "0xD6B2", + "0x6B96": "0xD6B3", + "0x6267": "0xD6B4", + "0x503C": "0xD6B5", + "0x4F84": "0xD6B6", + "0x5740": "0xD6B7", + "0x6307": "0xD6B8", + "0x6B62": "0xD6B9", + "0x8DBE": "0xD6BA", + "0x53EA": "0xD6BB", + "0x65E8": "0xD6BC", + "0x7EB8": "0xD6BD", + "0x5FD7": "0xD6BE", + "0x631A": "0xD6BF", + "0x63B7": "0xD6C0", + "0x81F3": "0xD6C1", + "0x81F4": "0xD6C2", + "0x7F6E": "0xD6C3", + "0x5E1C": "0xD6C4", + "0x5CD9": "0xD6C5", + "0x5236": "0xD6C6", + "0x667A": "0xD6C7", + "0x79E9": "0xD6C8", + "0x7A1A": "0xD6C9", + "0x8D28": "0xD6CA", + "0x7099": "0xD6CB", + "0x75D4": "0xD6CC", + "0x6EDE": "0xD6CD", + "0x6CBB": "0xD6CE", + "0x7A92": "0xD6CF", + "0x4E2D": "0xD6D0", + "0x76C5": "0xD6D1", + "0x5FE0": "0xD6D2", + "0x949F": "0xD6D3", + "0x8877": "0xD6D4", + "0x7EC8": "0xD6D5", + "0x79CD": "0xD6D6", + "0x80BF": "0xD6D7", + "0x91CD": "0xD6D8", + "0x4EF2": "0xD6D9", + "0x4F17": "0xD6DA", + "0x821F": "0xD6DB", + "0x5468": "0xD6DC", + "0x5DDE": "0xD6DD", + "0x6D32": "0xD6DE", + "0x8BCC": "0xD6DF", + "0x7CA5": "0xD6E0", + "0x8F74": "0xD6E1", + "0x8098": "0xD6E2", + "0x5E1A": "0xD6E3", + "0x5492": "0xD6E4", + "0x76B1": "0xD6E5", + "0x5B99": "0xD6E6", + "0x663C": "0xD6E7", + "0x9AA4": "0xD6E8", + "0x73E0": "0xD6E9", + "0x682A": "0xD6EA", + "0x86DB": "0xD6EB", + "0x6731": "0xD6EC", + "0x732A": "0xD6ED", + "0x8BF8": "0xD6EE", + "0x8BDB": "0xD6EF", + "0x9010": "0xD6F0", + "0x7AF9": "0xD6F1", + "0x70DB": "0xD6F2", + "0x716E": "0xD6F3", + "0x62C4": "0xD6F4", + "0x77A9": "0xD6F5", + "0x5631": "0xD6F6", + "0x4E3B": "0xD6F7", + "0x8457": "0xD6F8", + "0x67F1": "0xD6F9", + "0x52A9": "0xD6FA", + "0x86C0": "0xD6FB", + "0x8D2E": "0xD6FC", + "0x94F8": "0xD6FD", + "0x7B51": "0xD6FE", + "0x4F4F": "0xD7A1", + "0x6CE8": "0xD7A2", + "0x795D": "0xD7A3", + "0x9A7B": "0xD7A4", + "0x6293": "0xD7A5", + "0x722A": "0xD7A6", + "0x62FD": "0xD7A7", + "0x4E13": "0xD7A8", + "0x7816": "0xD7A9", + "0x8F6C": "0xD7AA", + "0x64B0": "0xD7AB", + "0x8D5A": "0xD7AC", + "0x7BC6": "0xD7AD", + "0x6869": "0xD7AE", + "0x5E84": "0xD7AF", + "0x88C5": "0xD7B0", + "0x5986": "0xD7B1", + "0x649E": "0xD7B2", + "0x58EE": "0xD7B3", + "0x72B6": "0xD7B4", + "0x690E": "0xD7B5", + "0x9525": "0xD7B6", + "0x8FFD": "0xD7B7", + "0x8D58": "0xD7B8", + "0x5760": "0xD7B9", + "0x7F00": "0xD7BA", + "0x8C06": "0xD7BB", + "0x51C6": "0xD7BC", + "0x6349": "0xD7BD", + "0x62D9": "0xD7BE", + "0x5353": "0xD7BF", + "0x684C": "0xD7C0", + "0x7422": "0xD7C1", + "0x8301": "0xD7C2", + "0x914C": "0xD7C3", + "0x5544": "0xD7C4", + "0x7740": "0xD7C5", + "0x707C": "0xD7C6", + "0x6D4A": "0xD7C7", + "0x5179": "0xD7C8", + "0x54A8": "0xD7C9", + "0x8D44": "0xD7CA", + "0x59FF": "0xD7CB", + "0x6ECB": "0xD7CC", + "0x6DC4": "0xD7CD", + "0x5B5C": "0xD7CE", + "0x7D2B": "0xD7CF", + "0x4ED4": "0xD7D0", + "0x7C7D": "0xD7D1", + "0x6ED3": "0xD7D2", + "0x5B50": "0xD7D3", + "0x81EA": "0xD7D4", + "0x6E0D": "0xD7D5", + "0x5B57": "0xD7D6", + "0x9B03": "0xD7D7", + "0x68D5": "0xD7D8", + "0x8E2A": "0xD7D9", + "0x5B97": "0xD7DA", + "0x7EFC": "0xD7DB", + "0x603B": "0xD7DC", + "0x7EB5": "0xD7DD", + "0x90B9": "0xD7DE", + "0x8D70": "0xD7DF", + "0x594F": "0xD7E0", + "0x63CD": "0xD7E1", + "0x79DF": "0xD7E2", + "0x8DB3": "0xD7E3", + "0x5352": "0xD7E4", + "0x65CF": "0xD7E5", + "0x7956": "0xD7E6", + "0x8BC5": "0xD7E7", + "0x963B": "0xD7E8", + "0x7EC4": "0xD7E9", + "0x94BB": "0xD7EA", + "0x7E82": "0xD7EB", + "0x5634": "0xD7EC", + "0x9189": "0xD7ED", + "0x6700": "0xD7EE", + "0x7F6A": "0xD7EF", + "0x5C0A": "0xD7F0", + "0x9075": "0xD7F1", + "0x6628": "0xD7F2", + "0x5DE6": "0xD7F3", + "0x4F50": "0xD7F4", + "0x67DE": "0xD7F5", + "0x505A": "0xD7F6", + "0x4F5C": "0xD7F7", + "0x5750": "0xD7F8", + "0x5EA7": "0xD7F9", + "0xE810": "0xD7FA", + "0xE811": "0xD7FB", + "0xE812": "0xD7FC", + "0xE813": "0xD7FD", + "0xE814": "0xD7FE", + "0x4E8D": "0xD8A1", + "0x4E0C": "0xD8A2", + "0x5140": "0xD8A3", + "0x4E10": "0xD8A4", + "0x5EFF": "0xD8A5", + "0x5345": "0xD8A6", + "0x4E15": "0xD8A7", + "0x4E98": "0xD8A8", + "0x4E1E": "0xD8A9", + "0x9B32": "0xD8AA", + "0x5B6C": "0xD8AB", + "0x5669": "0xD8AC", + "0x4E28": "0xD8AD", + "0x79BA": "0xD8AE", + "0x4E3F": "0xD8AF", + "0x5315": "0xD8B0", + "0x4E47": "0xD8B1", + "0x592D": "0xD8B2", + "0x723B": "0xD8B3", + "0x536E": "0xD8B4", + "0x6C10": "0xD8B5", + "0x56DF": "0xD8B6", + "0x80E4": "0xD8B7", + "0x9997": "0xD8B8", + "0x6BD3": "0xD8B9", + "0x777E": "0xD8BA", + "0x9F17": "0xD8BB", + "0x4E36": "0xD8BC", + "0x4E9F": "0xD8BD", + "0x9F10": "0xD8BE", + "0x4E5C": "0xD8BF", + "0x4E69": "0xD8C0", + "0x4E93": "0xD8C1", + "0x8288": "0xD8C2", + "0x5B5B": "0xD8C3", + "0x556C": "0xD8C4", + "0x560F": "0xD8C5", + "0x4EC4": "0xD8C6", + "0x538D": "0xD8C7", + "0x539D": "0xD8C8", + "0x53A3": "0xD8C9", + "0x53A5": "0xD8CA", + "0x53AE": "0xD8CB", + "0x9765": "0xD8CC", + "0x8D5D": "0xD8CD", + "0x531A": "0xD8CE", + "0x53F5": "0xD8CF", + "0x5326": "0xD8D0", + "0x532E": "0xD8D1", + "0x533E": "0xD8D2", + "0x8D5C": "0xD8D3", + "0x5366": "0xD8D4", + "0x5363": "0xD8D5", + "0x5202": "0xD8D6", + "0x5208": "0xD8D7", + "0x520E": "0xD8D8", + "0x522D": "0xD8D9", + "0x5233": "0xD8DA", + "0x523F": "0xD8DB", + "0x5240": "0xD8DC", + "0x524C": "0xD8DD", + "0x525E": "0xD8DE", + "0x5261": "0xD8DF", + "0x525C": "0xD8E0", + "0x84AF": "0xD8E1", + "0x527D": "0xD8E2", + "0x5282": "0xD8E3", + "0x5281": "0xD8E4", + "0x5290": "0xD8E5", + "0x5293": "0xD8E6", + "0x5182": "0xD8E7", + "0x7F54": "0xD8E8", + "0x4EBB": "0xD8E9", + "0x4EC3": "0xD8EA", + "0x4EC9": "0xD8EB", + "0x4EC2": "0xD8EC", + "0x4EE8": "0xD8ED", + "0x4EE1": "0xD8EE", + "0x4EEB": "0xD8EF", + "0x4EDE": "0xD8F0", + "0x4F1B": "0xD8F1", + "0x4EF3": "0xD8F2", + "0x4F22": "0xD8F3", + "0x4F64": "0xD8F4", + "0x4EF5": "0xD8F5", + "0x4F25": "0xD8F6", + "0x4F27": "0xD8F7", + "0x4F09": "0xD8F8", + "0x4F2B": "0xD8F9", + "0x4F5E": "0xD8FA", + "0x4F67": "0xD8FB", + "0x6538": "0xD8FC", + "0x4F5A": "0xD8FD", + "0x4F5D": "0xD8FE", + "0x4F5F": "0xD9A1", + "0x4F57": "0xD9A2", + "0x4F32": "0xD9A3", + "0x4F3D": "0xD9A4", + "0x4F76": "0xD9A5", + "0x4F74": "0xD9A6", + "0x4F91": "0xD9A7", + "0x4F89": "0xD9A8", + "0x4F83": "0xD9A9", + "0x4F8F": "0xD9AA", + "0x4F7E": "0xD9AB", + "0x4F7B": "0xD9AC", + "0x4FAA": "0xD9AD", + "0x4F7C": "0xD9AE", + "0x4FAC": "0xD9AF", + "0x4F94": "0xD9B0", + "0x4FE6": "0xD9B1", + "0x4FE8": "0xD9B2", + "0x4FEA": "0xD9B3", + "0x4FC5": "0xD9B4", + "0x4FDA": "0xD9B5", + "0x4FE3": "0xD9B6", + "0x4FDC": "0xD9B7", + "0x4FD1": "0xD9B8", + "0x4FDF": "0xD9B9", + "0x4FF8": "0xD9BA", + "0x5029": "0xD9BB", + "0x504C": "0xD9BC", + "0x4FF3": "0xD9BD", + "0x502C": "0xD9BE", + "0x500F": "0xD9BF", + "0x502E": "0xD9C0", + "0x502D": "0xD9C1", + "0x4FFE": "0xD9C2", + "0x501C": "0xD9C3", + "0x500C": "0xD9C4", + "0x5025": "0xD9C5", + "0x5028": "0xD9C6", + "0x507E": "0xD9C7", + "0x5043": "0xD9C8", + "0x5055": "0xD9C9", + "0x5048": "0xD9CA", + "0x504E": "0xD9CB", + "0x506C": "0xD9CC", + "0x507B": "0xD9CD", + "0x50A5": "0xD9CE", + "0x50A7": "0xD9CF", + "0x50A9": "0xD9D0", + "0x50BA": "0xD9D1", + "0x50D6": "0xD9D2", + "0x5106": "0xD9D3", + "0x50ED": "0xD9D4", + "0x50EC": "0xD9D5", + "0x50E6": "0xD9D6", + "0x50EE": "0xD9D7", + "0x5107": "0xD9D8", + "0x510B": "0xD9D9", + "0x4EDD": "0xD9DA", + "0x6C3D": "0xD9DB", + "0x4F58": "0xD9DC", + "0x4F65": "0xD9DD", + "0x4FCE": "0xD9DE", + "0x9FA0": "0xD9DF", + "0x6C46": "0xD9E0", + "0x7C74": "0xD9E1", + "0x516E": "0xD9E2", + "0x5DFD": "0xD9E3", + "0x9EC9": "0xD9E4", + "0x9998": "0xD9E5", + "0x5181": "0xD9E6", + "0x5914": "0xD9E7", + "0x52F9": "0xD9E8", + "0x530D": "0xD9E9", + "0x8A07": "0xD9EA", + "0x5310": "0xD9EB", + "0x51EB": "0xD9EC", + "0x5919": "0xD9ED", + "0x5155": "0xD9EE", + "0x4EA0": "0xD9EF", + "0x5156": "0xD9F0", + "0x4EB3": "0xD9F1", + "0x886E": "0xD9F2", + "0x88A4": "0xD9F3", + "0x4EB5": "0xD9F4", + "0x8114": "0xD9F5", + "0x88D2": "0xD9F6", + "0x7980": "0xD9F7", + "0x5B34": "0xD9F8", + "0x8803": "0xD9F9", + "0x7FB8": "0xD9FA", + "0x51AB": "0xD9FB", + "0x51B1": "0xD9FC", + "0x51BD": "0xD9FD", + "0x51BC": "0xD9FE", + "0x51C7": "0xDAA1", + "0x5196": "0xDAA2", + "0x51A2": "0xDAA3", + "0x51A5": "0xDAA4", + "0x8BA0": "0xDAA5", + "0x8BA6": "0xDAA6", + "0x8BA7": "0xDAA7", + "0x8BAA": "0xDAA8", + "0x8BB4": "0xDAA9", + "0x8BB5": "0xDAAA", + "0x8BB7": "0xDAAB", + "0x8BC2": "0xDAAC", + "0x8BC3": "0xDAAD", + "0x8BCB": "0xDAAE", + "0x8BCF": "0xDAAF", + "0x8BCE": "0xDAB0", + "0x8BD2": "0xDAB1", + "0x8BD3": "0xDAB2", + "0x8BD4": "0xDAB3", + "0x8BD6": "0xDAB4", + "0x8BD8": "0xDAB5", + "0x8BD9": "0xDAB6", + "0x8BDC": "0xDAB7", + "0x8BDF": "0xDAB8", + "0x8BE0": "0xDAB9", + "0x8BE4": "0xDABA", + "0x8BE8": "0xDABB", + "0x8BE9": "0xDABC", + "0x8BEE": "0xDABD", + "0x8BF0": "0xDABE", + "0x8BF3": "0xDABF", + "0x8BF6": "0xDAC0", + "0x8BF9": "0xDAC1", + "0x8BFC": "0xDAC2", + "0x8BFF": "0xDAC3", + "0x8C00": "0xDAC4", + "0x8C02": "0xDAC5", + "0x8C04": "0xDAC6", + "0x8C07": "0xDAC7", + "0x8C0C": "0xDAC8", + "0x8C0F": "0xDAC9", + "0x8C11": "0xDACA", + "0x8C12": "0xDACB", + "0x8C14": "0xDACC", + "0x8C15": "0xDACD", + "0x8C16": "0xDACE", + "0x8C19": "0xDACF", + "0x8C1B": "0xDAD0", + "0x8C18": "0xDAD1", + "0x8C1D": "0xDAD2", + "0x8C1F": "0xDAD3", + "0x8C20": "0xDAD4", + "0x8C21": "0xDAD5", + "0x8C25": "0xDAD6", + "0x8C27": "0xDAD7", + "0x8C2A": "0xDAD8", + "0x8C2B": "0xDAD9", + "0x8C2E": "0xDADA", + "0x8C2F": "0xDADB", + "0x8C32": "0xDADC", + "0x8C33": "0xDADD", + "0x8C35": "0xDADE", + "0x8C36": "0xDADF", + "0x5369": "0xDAE0", + "0x537A": "0xDAE1", + "0x961D": "0xDAE2", + "0x9622": "0xDAE3", + "0x9621": "0xDAE4", + "0x9631": "0xDAE5", + "0x962A": "0xDAE6", + "0x963D": "0xDAE7", + "0x963C": "0xDAE8", + "0x9642": "0xDAE9", + "0x9649": "0xDAEA", + "0x9654": "0xDAEB", + "0x965F": "0xDAEC", + "0x9667": "0xDAED", + "0x966C": "0xDAEE", + "0x9672": "0xDAEF", + "0x9674": "0xDAF0", + "0x9688": "0xDAF1", + "0x968D": "0xDAF2", + "0x9697": "0xDAF3", + "0x96B0": "0xDAF4", + "0x9097": "0xDAF5", + "0x909B": "0xDAF6", + "0x909D": "0xDAF7", + "0x9099": "0xDAF8", + "0x90AC": "0xDAF9", + "0x90A1": "0xDAFA", + "0x90B4": "0xDAFB", + "0x90B3": "0xDAFC", + "0x90B6": "0xDAFD", + "0x90BA": "0xDAFE", + "0x90B8": "0xDBA1", + "0x90B0": "0xDBA2", + "0x90CF": "0xDBA3", + "0x90C5": "0xDBA4", + "0x90BE": "0xDBA5", + "0x90D0": "0xDBA6", + "0x90C4": "0xDBA7", + "0x90C7": "0xDBA8", + "0x90D3": "0xDBA9", + "0x90E6": "0xDBAA", + "0x90E2": "0xDBAB", + "0x90DC": "0xDBAC", + "0x90D7": "0xDBAD", + "0x90DB": "0xDBAE", + "0x90EB": "0xDBAF", + "0x90EF": "0xDBB0", + "0x90FE": "0xDBB1", + "0x9104": "0xDBB2", + "0x9122": "0xDBB3", + "0x911E": "0xDBB4", + "0x9123": "0xDBB5", + "0x9131": "0xDBB6", + "0x912F": "0xDBB7", + "0x9139": "0xDBB8", + "0x9143": "0xDBB9", + "0x9146": "0xDBBA", + "0x520D": "0xDBBB", + "0x5942": "0xDBBC", + "0x52A2": "0xDBBD", + "0x52AC": "0xDBBE", + "0x52AD": "0xDBBF", + "0x52BE": "0xDBC0", + "0x54FF": "0xDBC1", + "0x52D0": "0xDBC2", + "0x52D6": "0xDBC3", + "0x52F0": "0xDBC4", + "0x53DF": "0xDBC5", + "0x71EE": "0xDBC6", + "0x77CD": "0xDBC7", + "0x5EF4": "0xDBC8", + "0x51F5": "0xDBC9", + "0x51FC": "0xDBCA", + "0x9B2F": "0xDBCB", + "0x53B6": "0xDBCC", + "0x5F01": "0xDBCD", + "0x755A": "0xDBCE", + "0x5DEF": "0xDBCF", + "0x574C": "0xDBD0", + "0x57A9": "0xDBD1", + "0x57A1": "0xDBD2", + "0x587E": "0xDBD3", + "0x58BC": "0xDBD4", + "0x58C5": "0xDBD5", + "0x58D1": "0xDBD6", + "0x5729": "0xDBD7", + "0x572C": "0xDBD8", + "0x572A": "0xDBD9", + "0x5733": "0xDBDA", + "0x5739": "0xDBDB", + "0x572E": "0xDBDC", + "0x572F": "0xDBDD", + "0x575C": "0xDBDE", + "0x573B": "0xDBDF", + "0x5742": "0xDBE0", + "0x5769": "0xDBE1", + "0x5785": "0xDBE2", + "0x576B": "0xDBE3", + "0x5786": "0xDBE4", + "0x577C": "0xDBE5", + "0x577B": "0xDBE6", + "0x5768": "0xDBE7", + "0x576D": "0xDBE8", + "0x5776": "0xDBE9", + "0x5773": "0xDBEA", + "0x57AD": "0xDBEB", + "0x57A4": "0xDBEC", + "0x578C": "0xDBED", + "0x57B2": "0xDBEE", + "0x57CF": "0xDBEF", + "0x57A7": "0xDBF0", + "0x57B4": "0xDBF1", + "0x5793": "0xDBF2", + "0x57A0": "0xDBF3", + "0x57D5": "0xDBF4", + "0x57D8": "0xDBF5", + "0x57DA": "0xDBF6", + "0x57D9": "0xDBF7", + "0x57D2": "0xDBF8", + "0x57B8": "0xDBF9", + "0x57F4": "0xDBFA", + "0x57EF": "0xDBFB", + "0x57F8": "0xDBFC", + "0x57E4": "0xDBFD", + "0x57DD": "0xDBFE", + "0x580B": "0xDCA1", + "0x580D": "0xDCA2", + "0x57FD": "0xDCA3", + "0x57ED": "0xDCA4", + "0x5800": "0xDCA5", + "0x581E": "0xDCA6", + "0x5819": "0xDCA7", + "0x5844": "0xDCA8", + "0x5820": "0xDCA9", + "0x5865": "0xDCAA", + "0x586C": "0xDCAB", + "0x5881": "0xDCAC", + "0x5889": "0xDCAD", + "0x589A": "0xDCAE", + "0x5880": "0xDCAF", + "0x99A8": "0xDCB0", + "0x9F19": "0xDCB1", + "0x61FF": "0xDCB2", + "0x8279": "0xDCB3", + "0x827D": "0xDCB4", + "0x827F": "0xDCB5", + "0x828F": "0xDCB6", + "0x828A": "0xDCB7", + "0x82A8": "0xDCB8", + "0x8284": "0xDCB9", + "0x828E": "0xDCBA", + "0x8291": "0xDCBB", + "0x8297": "0xDCBC", + "0x8299": "0xDCBD", + "0x82AB": "0xDCBE", + "0x82B8": "0xDCBF", + "0x82BE": "0xDCC0", + "0x82B0": "0xDCC1", + "0x82C8": "0xDCC2", + "0x82CA": "0xDCC3", + "0x82E3": "0xDCC4", + "0x8298": "0xDCC5", + "0x82B7": "0xDCC6", + "0x82AE": "0xDCC7", + "0x82CB": "0xDCC8", + "0x82CC": "0xDCC9", + "0x82C1": "0xDCCA", + "0x82A9": "0xDCCB", + "0x82B4": "0xDCCC", + "0x82A1": "0xDCCD", + "0x82AA": "0xDCCE", + "0x829F": "0xDCCF", + "0x82C4": "0xDCD0", + "0x82CE": "0xDCD1", + "0x82A4": "0xDCD2", + "0x82E1": "0xDCD3", + "0x8309": "0xDCD4", + "0x82F7": "0xDCD5", + "0x82E4": "0xDCD6", + "0x830F": "0xDCD7", + "0x8307": "0xDCD8", + "0x82DC": "0xDCD9", + "0x82F4": "0xDCDA", + "0x82D2": "0xDCDB", + "0x82D8": "0xDCDC", + "0x830C": "0xDCDD", + "0x82FB": "0xDCDE", + "0x82D3": "0xDCDF", + "0x8311": "0xDCE0", + "0x831A": "0xDCE1", + "0x8306": "0xDCE2", + "0x8314": "0xDCE3", + "0x8315": "0xDCE4", + "0x82E0": "0xDCE5", + "0x82D5": "0xDCE6", + "0x831C": "0xDCE7", + "0x8351": "0xDCE8", + "0x835B": "0xDCE9", + "0x835C": "0xDCEA", + "0x8308": "0xDCEB", + "0x8392": "0xDCEC", + "0x833C": "0xDCED", + "0x8334": "0xDCEE", + "0x8331": "0xDCEF", + "0x839B": "0xDCF0", + "0x835E": "0xDCF1", + "0x832F": "0xDCF2", + "0x834F": "0xDCF3", + "0x8347": "0xDCF4", + "0x8343": "0xDCF5", + "0x835F": "0xDCF6", + "0x8340": "0xDCF7", + "0x8317": "0xDCF8", + "0x8360": "0xDCF9", + "0x832D": "0xDCFA", + "0x833A": "0xDCFB", + "0x8333": "0xDCFC", + "0x8366": "0xDCFD", + "0x8365": "0xDCFE", + "0x8368": "0xDDA1", + "0x831B": "0xDDA2", + "0x8369": "0xDDA3", + "0x836C": "0xDDA4", + "0x836A": "0xDDA5", + "0x836D": "0xDDA6", + "0x836E": "0xDDA7", + "0x83B0": "0xDDA8", + "0x8378": "0xDDA9", + "0x83B3": "0xDDAA", + "0x83B4": "0xDDAB", + "0x83A0": "0xDDAC", + "0x83AA": "0xDDAD", + "0x8393": "0xDDAE", + "0x839C": "0xDDAF", + "0x8385": "0xDDB0", + "0x837C": "0xDDB1", + "0x83B6": "0xDDB2", + "0x83A9": "0xDDB3", + "0x837D": "0xDDB4", + "0x83B8": "0xDDB5", + "0x837B": "0xDDB6", + "0x8398": "0xDDB7", + "0x839E": "0xDDB8", + "0x83A8": "0xDDB9", + "0x83BA": "0xDDBA", + "0x83BC": "0xDDBB", + "0x83C1": "0xDDBC", + "0x8401": "0xDDBD", + "0x83E5": "0xDDBE", + "0x83D8": "0xDDBF", + "0x5807": "0xDDC0", + "0x8418": "0xDDC1", + "0x840B": "0xDDC2", + "0x83DD": "0xDDC3", + "0x83FD": "0xDDC4", + "0x83D6": "0xDDC5", + "0x841C": "0xDDC6", + "0x8438": "0xDDC7", + "0x8411": "0xDDC8", + "0x8406": "0xDDC9", + "0x83D4": "0xDDCA", + "0x83DF": "0xDDCB", + "0x840F": "0xDDCC", + "0x8403": "0xDDCD", + "0x83F8": "0xDDCE", + "0x83F9": "0xDDCF", + "0x83EA": "0xDDD0", + "0x83C5": "0xDDD1", + "0x83C0": "0xDDD2", + "0x8426": "0xDDD3", + "0x83F0": "0xDDD4", + "0x83E1": "0xDDD5", + "0x845C": "0xDDD6", + "0x8451": "0xDDD7", + "0x845A": "0xDDD8", + "0x8459": "0xDDD9", + "0x8473": "0xDDDA", + "0x8487": "0xDDDB", + "0x8488": "0xDDDC", + "0x847A": "0xDDDD", + "0x8489": "0xDDDE", + "0x8478": "0xDDDF", + "0x843C": "0xDDE0", + "0x8446": "0xDDE1", + "0x8469": "0xDDE2", + "0x8476": "0xDDE3", + "0x848C": "0xDDE4", + "0x848E": "0xDDE5", + "0x8431": "0xDDE6", + "0x846D": "0xDDE7", + "0x84C1": "0xDDE8", + "0x84CD": "0xDDE9", + "0x84D0": "0xDDEA", + "0x84E6": "0xDDEB", + "0x84BD": "0xDDEC", + "0x84D3": "0xDDED", + "0x84CA": "0xDDEE", + "0x84BF": "0xDDEF", + "0x84BA": "0xDDF0", + "0x84E0": "0xDDF1", + "0x84A1": "0xDDF2", + "0x84B9": "0xDDF3", + "0x84B4": "0xDDF4", + "0x8497": "0xDDF5", + "0x84E5": "0xDDF6", + "0x84E3": "0xDDF7", + "0x850C": "0xDDF8", + "0x750D": "0xDDF9", + "0x8538": "0xDDFA", + "0x84F0": "0xDDFB", + "0x8539": "0xDDFC", + "0x851F": "0xDDFD", + "0x853A": "0xDDFE", + "0x8556": "0xDEA1", + "0x853B": "0xDEA2", + "0x84FF": "0xDEA3", + "0x84FC": "0xDEA4", + "0x8559": "0xDEA5", + "0x8548": "0xDEA6", + "0x8568": "0xDEA7", + "0x8564": "0xDEA8", + "0x855E": "0xDEA9", + "0x857A": "0xDEAA", + "0x77A2": "0xDEAB", + "0x8543": "0xDEAC", + "0x8572": "0xDEAD", + "0x857B": "0xDEAE", + "0x85A4": "0xDEAF", + "0x85A8": "0xDEB0", + "0x8587": "0xDEB1", + "0x858F": "0xDEB2", + "0x8579": "0xDEB3", + "0x85AE": "0xDEB4", + "0x859C": "0xDEB5", + "0x8585": "0xDEB6", + "0x85B9": "0xDEB7", + "0x85B7": "0xDEB8", + "0x85B0": "0xDEB9", + "0x85D3": "0xDEBA", + "0x85C1": "0xDEBB", + "0x85DC": "0xDEBC", + "0x85FF": "0xDEBD", + "0x8627": "0xDEBE", + "0x8605": "0xDEBF", + "0x8629": "0xDEC0", + "0x8616": "0xDEC1", + "0x863C": "0xDEC2", + "0x5EFE": "0xDEC3", + "0x5F08": "0xDEC4", + "0x593C": "0xDEC5", + "0x5941": "0xDEC6", + "0x8037": "0xDEC7", + "0x5955": "0xDEC8", + "0x595A": "0xDEC9", + "0x5958": "0xDECA", + "0x530F": "0xDECB", + "0x5C22": "0xDECC", + "0x5C25": "0xDECD", + "0x5C2C": "0xDECE", + "0x5C34": "0xDECF", + "0x624C": "0xDED0", + "0x626A": "0xDED1", + "0x629F": "0xDED2", + "0x62BB": "0xDED3", + "0x62CA": "0xDED4", + "0x62DA": "0xDED5", + "0x62D7": "0xDED6", + "0x62EE": "0xDED7", + "0x6322": "0xDED8", + "0x62F6": "0xDED9", + "0x6339": "0xDEDA", + "0x634B": "0xDEDB", + "0x6343": "0xDEDC", + "0x63AD": "0xDEDD", + "0x63F6": "0xDEDE", + "0x6371": "0xDEDF", + "0x637A": "0xDEE0", + "0x638E": "0xDEE1", + "0x63B4": "0xDEE2", + "0x636D": "0xDEE3", + "0x63AC": "0xDEE4", + "0x638A": "0xDEE5", + "0x6369": "0xDEE6", + "0x63AE": "0xDEE7", + "0x63BC": "0xDEE8", + "0x63F2": "0xDEE9", + "0x63F8": "0xDEEA", + "0x63E0": "0xDEEB", + "0x63FF": "0xDEEC", + "0x63C4": "0xDEED", + "0x63DE": "0xDEEE", + "0x63CE": "0xDEEF", + "0x6452": "0xDEF0", + "0x63C6": "0xDEF1", + "0x63BE": "0xDEF2", + "0x6445": "0xDEF3", + "0x6441": "0xDEF4", + "0x640B": "0xDEF5", + "0x641B": "0xDEF6", + "0x6420": "0xDEF7", + "0x640C": "0xDEF8", + "0x6426": "0xDEF9", + "0x6421": "0xDEFA", + "0x645E": "0xDEFB", + "0x6484": "0xDEFC", + "0x646D": "0xDEFD", + "0x6496": "0xDEFE", + "0x647A": "0xDFA1", + "0x64B7": "0xDFA2", + "0x64B8": "0xDFA3", + "0x6499": "0xDFA4", + "0x64BA": "0xDFA5", + "0x64C0": "0xDFA6", + "0x64D0": "0xDFA7", + "0x64D7": "0xDFA8", + "0x64E4": "0xDFA9", + "0x64E2": "0xDFAA", + "0x6509": "0xDFAB", + "0x6525": "0xDFAC", + "0x652E": "0xDFAD", + "0x5F0B": "0xDFAE", + "0x5FD2": "0xDFAF", + "0x7519": "0xDFB0", + "0x5F11": "0xDFB1", + "0x535F": "0xDFB2", + "0x53F1": "0xDFB3", + "0x53FD": "0xDFB4", + "0x53E9": "0xDFB5", + "0x53E8": "0xDFB6", + "0x53FB": "0xDFB7", + "0x5412": "0xDFB8", + "0x5416": "0xDFB9", + "0x5406": "0xDFBA", + "0x544B": "0xDFBB", + "0x5452": "0xDFBC", + "0x5453": "0xDFBD", + "0x5454": "0xDFBE", + "0x5456": "0xDFBF", + "0x5443": "0xDFC0", + "0x5421": "0xDFC1", + "0x5457": "0xDFC2", + "0x5459": "0xDFC3", + "0x5423": "0xDFC4", + "0x5432": "0xDFC5", + "0x5482": "0xDFC6", + "0x5494": "0xDFC7", + "0x5477": "0xDFC8", + "0x5471": "0xDFC9", + "0x5464": "0xDFCA", + "0x549A": "0xDFCB", + "0x549B": "0xDFCC", + "0x5484": "0xDFCD", + "0x5476": "0xDFCE", + "0x5466": "0xDFCF", + "0x549D": "0xDFD0", + "0x54D0": "0xDFD1", + "0x54AD": "0xDFD2", + "0x54C2": "0xDFD3", + "0x54B4": "0xDFD4", + "0x54D2": "0xDFD5", + "0x54A7": "0xDFD6", + "0x54A6": "0xDFD7", + "0x54D3": "0xDFD8", + "0x54D4": "0xDFD9", + "0x5472": "0xDFDA", + "0x54A3": "0xDFDB", + "0x54D5": "0xDFDC", + "0x54BB": "0xDFDD", + "0x54BF": "0xDFDE", + "0x54CC": "0xDFDF", + "0x54D9": "0xDFE0", + "0x54DA": "0xDFE1", + "0x54DC": "0xDFE2", + "0x54A9": "0xDFE3", + "0x54AA": "0xDFE4", + "0x54A4": "0xDFE5", + "0x54DD": "0xDFE6", + "0x54CF": "0xDFE7", + "0x54DE": "0xDFE8", + "0x551B": "0xDFE9", + "0x54E7": "0xDFEA", + "0x5520": "0xDFEB", + "0x54FD": "0xDFEC", + "0x5514": "0xDFED", + "0x54F3": "0xDFEE", + "0x5522": "0xDFEF", + "0x5523": "0xDFF0", + "0x550F": "0xDFF1", + "0x5511": "0xDFF2", + "0x5527": "0xDFF3", + "0x552A": "0xDFF4", + "0x5567": "0xDFF5", + "0x558F": "0xDFF6", + "0x55B5": "0xDFF7", + "0x5549": "0xDFF8", + "0x556D": "0xDFF9", + "0x5541": "0xDFFA", + "0x5555": "0xDFFB", + "0x553F": "0xDFFC", + "0x5550": "0xDFFD", + "0x553C": "0xDFFE", + "0x5537": "0xE0A1", + "0x5556": "0xE0A2", + "0x5575": "0xE0A3", + "0x5576": "0xE0A4", + "0x5577": "0xE0A5", + "0x5533": "0xE0A6", + "0x5530": "0xE0A7", + "0x555C": "0xE0A8", + "0x558B": "0xE0A9", + "0x55D2": "0xE0AA", + "0x5583": "0xE0AB", + "0x55B1": "0xE0AC", + "0x55B9": "0xE0AD", + "0x5588": "0xE0AE", + "0x5581": "0xE0AF", + "0x559F": "0xE0B0", + "0x557E": "0xE0B1", + "0x55D6": "0xE0B2", + "0x5591": "0xE0B3", + "0x557B": "0xE0B4", + "0x55DF": "0xE0B5", + "0x55BD": "0xE0B6", + "0x55BE": "0xE0B7", + "0x5594": "0xE0B8", + "0x5599": "0xE0B9", + "0x55EA": "0xE0BA", + "0x55F7": "0xE0BB", + "0x55C9": "0xE0BC", + "0x561F": "0xE0BD", + "0x55D1": "0xE0BE", + "0x55EB": "0xE0BF", + "0x55EC": "0xE0C0", + "0x55D4": "0xE0C1", + "0x55E6": "0xE0C2", + "0x55DD": "0xE0C3", + "0x55C4": "0xE0C4", + "0x55EF": "0xE0C5", + "0x55E5": "0xE0C6", + "0x55F2": "0xE0C7", + "0x55F3": "0xE0C8", + "0x55CC": "0xE0C9", + "0x55CD": "0xE0CA", + "0x55E8": "0xE0CB", + "0x55F5": "0xE0CC", + "0x55E4": "0xE0CD", + "0x8F94": "0xE0CE", + "0x561E": "0xE0CF", + "0x5608": "0xE0D0", + "0x560C": "0xE0D1", + "0x5601": "0xE0D2", + "0x5624": "0xE0D3", + "0x5623": "0xE0D4", + "0x55FE": "0xE0D5", + "0x5600": "0xE0D6", + "0x5627": "0xE0D7", + "0x562D": "0xE0D8", + "0x5658": "0xE0D9", + "0x5639": "0xE0DA", + "0x5657": "0xE0DB", + "0x562C": "0xE0DC", + "0x564D": "0xE0DD", + "0x5662": "0xE0DE", + "0x5659": "0xE0DF", + "0x565C": "0xE0E0", + "0x564C": "0xE0E1", + "0x5654": "0xE0E2", + "0x5686": "0xE0E3", + "0x5664": "0xE0E4", + "0x5671": "0xE0E5", + "0x566B": "0xE0E6", + "0x567B": "0xE0E7", + "0x567C": "0xE0E8", + "0x5685": "0xE0E9", + "0x5693": "0xE0EA", + "0x56AF": "0xE0EB", + "0x56D4": "0xE0EC", + "0x56D7": "0xE0ED", + "0x56DD": "0xE0EE", + "0x56E1": "0xE0EF", + "0x56F5": "0xE0F0", + "0x56EB": "0xE0F1", + "0x56F9": "0xE0F2", + "0x56FF": "0xE0F3", + "0x5704": "0xE0F4", + "0x570A": "0xE0F5", + "0x5709": "0xE0F6", + "0x571C": "0xE0F7", + "0x5E0F": "0xE0F8", + "0x5E19": "0xE0F9", + "0x5E14": "0xE0FA", + "0x5E11": "0xE0FB", + "0x5E31": "0xE0FC", + "0x5E3B": "0xE0FD", + "0x5E3C": "0xE0FE", + "0x5E37": "0xE1A1", + "0x5E44": "0xE1A2", + "0x5E54": "0xE1A3", + "0x5E5B": "0xE1A4", + "0x5E5E": "0xE1A5", + "0x5E61": "0xE1A6", + "0x5C8C": "0xE1A7", + "0x5C7A": "0xE1A8", + "0x5C8D": "0xE1A9", + "0x5C90": "0xE1AA", + "0x5C96": "0xE1AB", + "0x5C88": "0xE1AC", + "0x5C98": "0xE1AD", + "0x5C99": "0xE1AE", + "0x5C91": "0xE1AF", + "0x5C9A": "0xE1B0", + "0x5C9C": "0xE1B1", + "0x5CB5": "0xE1B2", + "0x5CA2": "0xE1B3", + "0x5CBD": "0xE1B4", + "0x5CAC": "0xE1B5", + "0x5CAB": "0xE1B6", + "0x5CB1": "0xE1B7", + "0x5CA3": "0xE1B8", + "0x5CC1": "0xE1B9", + "0x5CB7": "0xE1BA", + "0x5CC4": "0xE1BB", + "0x5CD2": "0xE1BC", + "0x5CE4": "0xE1BD", + "0x5CCB": "0xE1BE", + "0x5CE5": "0xE1BF", + "0x5D02": "0xE1C0", + "0x5D03": "0xE1C1", + "0x5D27": "0xE1C2", + "0x5D26": "0xE1C3", + "0x5D2E": "0xE1C4", + "0x5D24": "0xE1C5", + "0x5D1E": "0xE1C6", + "0x5D06": "0xE1C7", + "0x5D1B": "0xE1C8", + "0x5D58": "0xE1C9", + "0x5D3E": "0xE1CA", + "0x5D34": "0xE1CB", + "0x5D3D": "0xE1CC", + "0x5D6C": "0xE1CD", + "0x5D5B": "0xE1CE", + "0x5D6F": "0xE1CF", + "0x5D5D": "0xE1D0", + "0x5D6B": "0xE1D1", + "0x5D4B": "0xE1D2", + "0x5D4A": "0xE1D3", + "0x5D69": "0xE1D4", + "0x5D74": "0xE1D5", + "0x5D82": "0xE1D6", + "0x5D99": "0xE1D7", + "0x5D9D": "0xE1D8", + "0x8C73": "0xE1D9", + "0x5DB7": "0xE1DA", + "0x5DC5": "0xE1DB", + "0x5F73": "0xE1DC", + "0x5F77": "0xE1DD", + "0x5F82": "0xE1DE", + "0x5F87": "0xE1DF", + "0x5F89": "0xE1E0", + "0x5F8C": "0xE1E1", + "0x5F95": "0xE1E2", + "0x5F99": "0xE1E3", + "0x5F9C": "0xE1E4", + "0x5FA8": "0xE1E5", + "0x5FAD": "0xE1E6", + "0x5FB5": "0xE1E7", + "0x5FBC": "0xE1E8", + "0x8862": "0xE1E9", + "0x5F61": "0xE1EA", + "0x72AD": "0xE1EB", + "0x72B0": "0xE1EC", + "0x72B4": "0xE1ED", + "0x72B7": "0xE1EE", + "0x72B8": "0xE1EF", + "0x72C3": "0xE1F0", + "0x72C1": "0xE1F1", + "0x72CE": "0xE1F2", + "0x72CD": "0xE1F3", + "0x72D2": "0xE1F4", + "0x72E8": "0xE1F5", + "0x72EF": "0xE1F6", + "0x72E9": "0xE1F7", + "0x72F2": "0xE1F8", + "0x72F4": "0xE1F9", + "0x72F7": "0xE1FA", + "0x7301": "0xE1FB", + "0x72F3": "0xE1FC", + "0x7303": "0xE1FD", + "0x72FA": "0xE1FE", + "0x72FB": "0xE2A1", + "0x7317": "0xE2A2", + "0x7313": "0xE2A3", + "0x7321": "0xE2A4", + "0x730A": "0xE2A5", + "0x731E": "0xE2A6", + "0x731D": "0xE2A7", + "0x7315": "0xE2A8", + "0x7322": "0xE2A9", + "0x7339": "0xE2AA", + "0x7325": "0xE2AB", + "0x732C": "0xE2AC", + "0x7338": "0xE2AD", + "0x7331": "0xE2AE", + "0x7350": "0xE2AF", + "0x734D": "0xE2B0", + "0x7357": "0xE2B1", + "0x7360": "0xE2B2", + "0x736C": "0xE2B3", + "0x736F": "0xE2B4", + "0x737E": "0xE2B5", + "0x821B": "0xE2B6", + "0x5925": "0xE2B7", + "0x98E7": "0xE2B8", + "0x5924": "0xE2B9", + "0x5902": "0xE2BA", + "0x9963": "0xE2BB", + "0x9967": "0xE2BC", + "0x9968": "0xE2BD", + "0x9969": "0xE2BE", + "0x996A": "0xE2BF", + "0x996B": "0xE2C0", + "0x996C": "0xE2C1", + "0x9974": "0xE2C2", + "0x9977": "0xE2C3", + "0x997D": "0xE2C4", + "0x9980": "0xE2C5", + "0x9984": "0xE2C6", + "0x9987": "0xE2C7", + "0x998A": "0xE2C8", + "0x998D": "0xE2C9", + "0x9990": "0xE2CA", + "0x9991": "0xE2CB", + "0x9993": "0xE2CC", + "0x9994": "0xE2CD", + "0x9995": "0xE2CE", + "0x5E80": "0xE2CF", + "0x5E91": "0xE2D0", + "0x5E8B": "0xE2D1", + "0x5E96": "0xE2D2", + "0x5EA5": "0xE2D3", + "0x5EA0": "0xE2D4", + "0x5EB9": "0xE2D5", + "0x5EB5": "0xE2D6", + "0x5EBE": "0xE2D7", + "0x5EB3": "0xE2D8", + "0x8D53": "0xE2D9", + "0x5ED2": "0xE2DA", + "0x5ED1": "0xE2DB", + "0x5EDB": "0xE2DC", + "0x5EE8": "0xE2DD", + "0x5EEA": "0xE2DE", + "0x81BA": "0xE2DF", + "0x5FC4": "0xE2E0", + "0x5FC9": "0xE2E1", + "0x5FD6": "0xE2E2", + "0x5FCF": "0xE2E3", + "0x6003": "0xE2E4", + "0x5FEE": "0xE2E5", + "0x6004": "0xE2E6", + "0x5FE1": "0xE2E7", + "0x5FE4": "0xE2E8", + "0x5FFE": "0xE2E9", + "0x6005": "0xE2EA", + "0x6006": "0xE2EB", + "0x5FEA": "0xE2EC", + "0x5FED": "0xE2ED", + "0x5FF8": "0xE2EE", + "0x6019": "0xE2EF", + "0x6035": "0xE2F0", + "0x6026": "0xE2F1", + "0x601B": "0xE2F2", + "0x600F": "0xE2F3", + "0x600D": "0xE2F4", + "0x6029": "0xE2F5", + "0x602B": "0xE2F6", + "0x600A": "0xE2F7", + "0x603F": "0xE2F8", + "0x6021": "0xE2F9", + "0x6078": "0xE2FA", + "0x6079": "0xE2FB", + "0x607B": "0xE2FC", + "0x607A": "0xE2FD", + "0x6042": "0xE2FE", + "0x606A": "0xE3A1", + "0x607D": "0xE3A2", + "0x6096": "0xE3A3", + "0x609A": "0xE3A4", + "0x60AD": "0xE3A5", + "0x609D": "0xE3A6", + "0x6083": "0xE3A7", + "0x6092": "0xE3A8", + "0x608C": "0xE3A9", + "0x609B": "0xE3AA", + "0x60EC": "0xE3AB", + "0x60BB": "0xE3AC", + "0x60B1": "0xE3AD", + "0x60DD": "0xE3AE", + "0x60D8": "0xE3AF", + "0x60C6": "0xE3B0", + "0x60DA": "0xE3B1", + "0x60B4": "0xE3B2", + "0x6120": "0xE3B3", + "0x6126": "0xE3B4", + "0x6115": "0xE3B5", + "0x6123": "0xE3B6", + "0x60F4": "0xE3B7", + "0x6100": "0xE3B8", + "0x610E": "0xE3B9", + "0x612B": "0xE3BA", + "0x614A": "0xE3BB", + "0x6175": "0xE3BC", + "0x61AC": "0xE3BD", + "0x6194": "0xE3BE", + "0x61A7": "0xE3BF", + "0x61B7": "0xE3C0", + "0x61D4": "0xE3C1", + "0x61F5": "0xE3C2", + "0x5FDD": "0xE3C3", + "0x96B3": "0xE3C4", + "0x95E9": "0xE3C5", + "0x95EB": "0xE3C6", + "0x95F1": "0xE3C7", + "0x95F3": "0xE3C8", + "0x95F5": "0xE3C9", + "0x95F6": "0xE3CA", + "0x95FC": "0xE3CB", + "0x95FE": "0xE3CC", + "0x9603": "0xE3CD", + "0x9604": "0xE3CE", + "0x9606": "0xE3CF", + "0x9608": "0xE3D0", + "0x960A": "0xE3D1", + "0x960B": "0xE3D2", + "0x960C": "0xE3D3", + "0x960D": "0xE3D4", + "0x960F": "0xE3D5", + "0x9612": "0xE3D6", + "0x9615": "0xE3D7", + "0x9616": "0xE3D8", + "0x9617": "0xE3D9", + "0x9619": "0xE3DA", + "0x961A": "0xE3DB", + "0x4E2C": "0xE3DC", + "0x723F": "0xE3DD", + "0x6215": "0xE3DE", + "0x6C35": "0xE3DF", + "0x6C54": "0xE3E0", + "0x6C5C": "0xE3E1", + "0x6C4A": "0xE3E2", + "0x6CA3": "0xE3E3", + "0x6C85": "0xE3E4", + "0x6C90": "0xE3E5", + "0x6C94": "0xE3E6", + "0x6C8C": "0xE3E7", + "0x6C68": "0xE3E8", + "0x6C69": "0xE3E9", + "0x6C74": "0xE3EA", + "0x6C76": "0xE3EB", + "0x6C86": "0xE3EC", + "0x6CA9": "0xE3ED", + "0x6CD0": "0xE3EE", + "0x6CD4": "0xE3EF", + "0x6CAD": "0xE3F0", + "0x6CF7": "0xE3F1", + "0x6CF8": "0xE3F2", + "0x6CF1": "0xE3F3", + "0x6CD7": "0xE3F4", + "0x6CB2": "0xE3F5", + "0x6CE0": "0xE3F6", + "0x6CD6": "0xE3F7", + "0x6CFA": "0xE3F8", + "0x6CEB": "0xE3F9", + "0x6CEE": "0xE3FA", + "0x6CB1": "0xE3FB", + "0x6CD3": "0xE3FC", + "0x6CEF": "0xE3FD", + "0x6CFE": "0xE3FE", + "0x6D39": "0xE4A1", + "0x6D27": "0xE4A2", + "0x6D0C": "0xE4A3", + "0x6D43": "0xE4A4", + "0x6D48": "0xE4A5", + "0x6D07": "0xE4A6", + "0x6D04": "0xE4A7", + "0x6D19": "0xE4A8", + "0x6D0E": "0xE4A9", + "0x6D2B": "0xE4AA", + "0x6D4D": "0xE4AB", + "0x6D2E": "0xE4AC", + "0x6D35": "0xE4AD", + "0x6D1A": "0xE4AE", + "0x6D4F": "0xE4AF", + "0x6D52": "0xE4B0", + "0x6D54": "0xE4B1", + "0x6D33": "0xE4B2", + "0x6D91": "0xE4B3", + "0x6D6F": "0xE4B4", + "0x6D9E": "0xE4B5", + "0x6DA0": "0xE4B6", + "0x6D5E": "0xE4B7", + "0x6D93": "0xE4B8", + "0x6D94": "0xE4B9", + "0x6D5C": "0xE4BA", + "0x6D60": "0xE4BB", + "0x6D7C": "0xE4BC", + "0x6D63": "0xE4BD", + "0x6E1A": "0xE4BE", + "0x6DC7": "0xE4BF", + "0x6DC5": "0xE4C0", + "0x6DDE": "0xE4C1", + "0x6E0E": "0xE4C2", + "0x6DBF": "0xE4C3", + "0x6DE0": "0xE4C4", + "0x6E11": "0xE4C5", + "0x6DE6": "0xE4C6", + "0x6DDD": "0xE4C7", + "0x6DD9": "0xE4C8", + "0x6E16": "0xE4C9", + "0x6DAB": "0xE4CA", + "0x6E0C": "0xE4CB", + "0x6DAE": "0xE4CC", + "0x6E2B": "0xE4CD", + "0x6E6E": "0xE4CE", + "0x6E4E": "0xE4CF", + "0x6E6B": "0xE4D0", + "0x6EB2": "0xE4D1", + "0x6E5F": "0xE4D2", + "0x6E86": "0xE4D3", + "0x6E53": "0xE4D4", + "0x6E54": "0xE4D5", + "0x6E32": "0xE4D6", + "0x6E25": "0xE4D7", + "0x6E44": "0xE4D8", + "0x6EDF": "0xE4D9", + "0x6EB1": "0xE4DA", + "0x6E98": "0xE4DB", + "0x6EE0": "0xE4DC", + "0x6F2D": "0xE4DD", + "0x6EE2": "0xE4DE", + "0x6EA5": "0xE4DF", + "0x6EA7": "0xE4E0", + "0x6EBD": "0xE4E1", + "0x6EBB": "0xE4E2", + "0x6EB7": "0xE4E3", + "0x6ED7": "0xE4E4", + "0x6EB4": "0xE4E5", + "0x6ECF": "0xE4E6", + "0x6E8F": "0xE4E7", + "0x6EC2": "0xE4E8", + "0x6E9F": "0xE4E9", + "0x6F62": "0xE4EA", + "0x6F46": "0xE4EB", + "0x6F47": "0xE4EC", + "0x6F24": "0xE4ED", + "0x6F15": "0xE4EE", + "0x6EF9": "0xE4EF", + "0x6F2F": "0xE4F0", + "0x6F36": "0xE4F1", + "0x6F4B": "0xE4F2", + "0x6F74": "0xE4F3", + "0x6F2A": "0xE4F4", + "0x6F09": "0xE4F5", + "0x6F29": "0xE4F6", + "0x6F89": "0xE4F7", + "0x6F8D": "0xE4F8", + "0x6F8C": "0xE4F9", + "0x6F78": "0xE4FA", + "0x6F72": "0xE4FB", + "0x6F7C": "0xE4FC", + "0x6F7A": "0xE4FD", + "0x6FD1": "0xE4FE", + "0x6FC9": "0xE5A1", + "0x6FA7": "0xE5A2", + "0x6FB9": "0xE5A3", + "0x6FB6": "0xE5A4", + "0x6FC2": "0xE5A5", + "0x6FE1": "0xE5A6", + "0x6FEE": "0xE5A7", + "0x6FDE": "0xE5A8", + "0x6FE0": "0xE5A9", + "0x6FEF": "0xE5AA", + "0x701A": "0xE5AB", + "0x7023": "0xE5AC", + "0x701B": "0xE5AD", + "0x7039": "0xE5AE", + "0x7035": "0xE5AF", + "0x704F": "0xE5B0", + "0x705E": "0xE5B1", + "0x5B80": "0xE5B2", + "0x5B84": "0xE5B3", + "0x5B95": "0xE5B4", + "0x5B93": "0xE5B5", + "0x5BA5": "0xE5B6", + "0x5BB8": "0xE5B7", + "0x752F": "0xE5B8", + "0x9A9E": "0xE5B9", + "0x6434": "0xE5BA", + "0x5BE4": "0xE5BB", + "0x5BEE": "0xE5BC", + "0x8930": "0xE5BD", + "0x5BF0": "0xE5BE", + "0x8E47": "0xE5BF", + "0x8B07": "0xE5C0", + "0x8FB6": "0xE5C1", + "0x8FD3": "0xE5C2", + "0x8FD5": "0xE5C3", + "0x8FE5": "0xE5C4", + "0x8FEE": "0xE5C5", + "0x8FE4": "0xE5C6", + "0x8FE9": "0xE5C7", + "0x8FE6": "0xE5C8", + "0x8FF3": "0xE5C9", + "0x8FE8": "0xE5CA", + "0x9005": "0xE5CB", + "0x9004": "0xE5CC", + "0x900B": "0xE5CD", + "0x9026": "0xE5CE", + "0x9011": "0xE5CF", + "0x900D": "0xE5D0", + "0x9016": "0xE5D1", + "0x9021": "0xE5D2", + "0x9035": "0xE5D3", + "0x9036": "0xE5D4", + "0x902D": "0xE5D5", + "0x902F": "0xE5D6", + "0x9044": "0xE5D7", + "0x9051": "0xE5D8", + "0x9052": "0xE5D9", + "0x9050": "0xE5DA", + "0x9068": "0xE5DB", + "0x9058": "0xE5DC", + "0x9062": "0xE5DD", + "0x905B": "0xE5DE", + "0x66B9": "0xE5DF", + "0x9074": "0xE5E0", + "0x907D": "0xE5E1", + "0x9082": "0xE5E2", + "0x9088": "0xE5E3", + "0x9083": "0xE5E4", + "0x908B": "0xE5E5", + "0x5F50": "0xE5E6", + "0x5F57": "0xE5E7", + "0x5F56": "0xE5E8", + "0x5F58": "0xE5E9", + "0x5C3B": "0xE5EA", + "0x54AB": "0xE5EB", + "0x5C50": "0xE5EC", + "0x5C59": "0xE5ED", + "0x5B71": "0xE5EE", + "0x5C63": "0xE5EF", + "0x5C66": "0xE5F0", + "0x7FBC": "0xE5F1", + "0x5F2A": "0xE5F2", + "0x5F29": "0xE5F3", + "0x5F2D": "0xE5F4", + "0x8274": "0xE5F5", + "0x5F3C": "0xE5F6", + "0x9B3B": "0xE5F7", + "0x5C6E": "0xE5F8", + "0x5981": "0xE5F9", + "0x5983": "0xE5FA", + "0x598D": "0xE5FB", + "0x59A9": "0xE5FC", + "0x59AA": "0xE5FD", + "0x59A3": "0xE5FE", + "0x5997": "0xE6A1", + "0x59CA": "0xE6A2", + "0x59AB": "0xE6A3", + "0x599E": "0xE6A4", + "0x59A4": "0xE6A5", + "0x59D2": "0xE6A6", + "0x59B2": "0xE6A7", + "0x59AF": "0xE6A8", + "0x59D7": "0xE6A9", + "0x59BE": "0xE6AA", + "0x5A05": "0xE6AB", + "0x5A06": "0xE6AC", + "0x59DD": "0xE6AD", + "0x5A08": "0xE6AE", + "0x59E3": "0xE6AF", + "0x59D8": "0xE6B0", + "0x59F9": "0xE6B1", + "0x5A0C": "0xE6B2", + "0x5A09": "0xE6B3", + "0x5A32": "0xE6B4", + "0x5A34": "0xE6B5", + "0x5A11": "0xE6B6", + "0x5A23": "0xE6B7", + "0x5A13": "0xE6B8", + "0x5A40": "0xE6B9", + "0x5A67": "0xE6BA", + "0x5A4A": "0xE6BB", + "0x5A55": "0xE6BC", + "0x5A3C": "0xE6BD", + "0x5A62": "0xE6BE", + "0x5A75": "0xE6BF", + "0x80EC": "0xE6C0", + "0x5AAA": "0xE6C1", + "0x5A9B": "0xE6C2", + "0x5A77": "0xE6C3", + "0x5A7A": "0xE6C4", + "0x5ABE": "0xE6C5", + "0x5AEB": "0xE6C6", + "0x5AB2": "0xE6C7", + "0x5AD2": "0xE6C8", + "0x5AD4": "0xE6C9", + "0x5AB8": "0xE6CA", + "0x5AE0": "0xE6CB", + "0x5AE3": "0xE6CC", + "0x5AF1": "0xE6CD", + "0x5AD6": "0xE6CE", + "0x5AE6": "0xE6CF", + "0x5AD8": "0xE6D0", + "0x5ADC": "0xE6D1", + "0x5B09": "0xE6D2", + "0x5B17": "0xE6D3", + "0x5B16": "0xE6D4", + "0x5B32": "0xE6D5", + "0x5B37": "0xE6D6", + "0x5B40": "0xE6D7", + "0x5C15": "0xE6D8", + "0x5C1C": "0xE6D9", + "0x5B5A": "0xE6DA", + "0x5B65": "0xE6DB", + "0x5B73": "0xE6DC", + "0x5B51": "0xE6DD", + "0x5B53": "0xE6DE", + "0x5B62": "0xE6DF", + "0x9A75": "0xE6E0", + "0x9A77": "0xE6E1", + "0x9A78": "0xE6E2", + "0x9A7A": "0xE6E3", + "0x9A7F": "0xE6E4", + "0x9A7D": "0xE6E5", + "0x9A80": "0xE6E6", + "0x9A81": "0xE6E7", + "0x9A85": "0xE6E8", + "0x9A88": "0xE6E9", + "0x9A8A": "0xE6EA", + "0x9A90": "0xE6EB", + "0x9A92": "0xE6EC", + "0x9A93": "0xE6ED", + "0x9A96": "0xE6EE", + "0x9A98": "0xE6EF", + "0x9A9B": "0xE6F0", + "0x9A9C": "0xE6F1", + "0x9A9D": "0xE6F2", + "0x9A9F": "0xE6F3", + "0x9AA0": "0xE6F4", + "0x9AA2": "0xE6F5", + "0x9AA3": "0xE6F6", + "0x9AA5": "0xE6F7", + "0x9AA7": "0xE6F8", + "0x7E9F": "0xE6F9", + "0x7EA1": "0xE6FA", + "0x7EA3": "0xE6FB", + "0x7EA5": "0xE6FC", + "0x7EA8": "0xE6FD", + "0x7EA9": "0xE6FE", + "0x7EAD": "0xE7A1", + "0x7EB0": "0xE7A2", + "0x7EBE": "0xE7A3", + "0x7EC0": "0xE7A4", + "0x7EC1": "0xE7A5", + "0x7EC2": "0xE7A6", + "0x7EC9": "0xE7A7", + "0x7ECB": "0xE7A8", + "0x7ECC": "0xE7A9", + "0x7ED0": "0xE7AA", + "0x7ED4": "0xE7AB", + "0x7ED7": "0xE7AC", + "0x7EDB": "0xE7AD", + "0x7EE0": "0xE7AE", + "0x7EE1": "0xE7AF", + "0x7EE8": "0xE7B0", + "0x7EEB": "0xE7B1", + "0x7EEE": "0xE7B2", + "0x7EEF": "0xE7B3", + "0x7EF1": "0xE7B4", + "0x7EF2": "0xE7B5", + "0x7F0D": "0xE7B6", + "0x7EF6": "0xE7B7", + "0x7EFA": "0xE7B8", + "0x7EFB": "0xE7B9", + "0x7EFE": "0xE7BA", + "0x7F01": "0xE7BB", + "0x7F02": "0xE7BC", + "0x7F03": "0xE7BD", + "0x7F07": "0xE7BE", + "0x7F08": "0xE7BF", + "0x7F0B": "0xE7C0", + "0x7F0C": "0xE7C1", + "0x7F0F": "0xE7C2", + "0x7F11": "0xE7C3", + "0x7F12": "0xE7C4", + "0x7F17": "0xE7C5", + "0x7F19": "0xE7C6", + "0x7F1C": "0xE7C7", + "0x7F1B": "0xE7C8", + "0x7F1F": "0xE7C9", + "0x7F21": "0xE7CA", + "0x7F22": "0xE7CB", + "0x7F23": "0xE7CC", + "0x7F24": "0xE7CD", + "0x7F25": "0xE7CE", + "0x7F26": "0xE7CF", + "0x7F27": "0xE7D0", + "0x7F2A": "0xE7D1", + "0x7F2B": "0xE7D2", + "0x7F2C": "0xE7D3", + "0x7F2D": "0xE7D4", + "0x7F2F": "0xE7D5", + "0x7F30": "0xE7D6", + "0x7F31": "0xE7D7", + "0x7F32": "0xE7D8", + "0x7F33": "0xE7D9", + "0x7F35": "0xE7DA", + "0x5E7A": "0xE7DB", + "0x757F": "0xE7DC", + "0x5DDB": "0xE7DD", + "0x753E": "0xE7DE", + "0x9095": "0xE7DF", + "0x738E": "0xE7E0", + "0x7391": "0xE7E1", + "0x73AE": "0xE7E2", + "0x73A2": "0xE7E3", + "0x739F": "0xE7E4", + "0x73CF": "0xE7E5", + "0x73C2": "0xE7E6", + "0x73D1": "0xE7E7", + "0x73B7": "0xE7E8", + "0x73B3": "0xE7E9", + "0x73C0": "0xE7EA", + "0x73C9": "0xE7EB", + "0x73C8": "0xE7EC", + "0x73E5": "0xE7ED", + "0x73D9": "0xE7EE", + "0x987C": "0xE7EF", + "0x740A": "0xE7F0", + "0x73E9": "0xE7F1", + "0x73E7": "0xE7F2", + "0x73DE": "0xE7F3", + "0x73BA": "0xE7F4", + "0x73F2": "0xE7F5", + "0x740F": "0xE7F6", + "0x742A": "0xE7F7", + "0x745B": "0xE7F8", + "0x7426": "0xE7F9", + "0x7425": "0xE7FA", + "0x7428": "0xE7FB", + "0x7430": "0xE7FC", + "0x742E": "0xE7FD", + "0x742C": "0xE7FE", + "0x741B": "0xE8A1", + "0x741A": "0xE8A2", + "0x7441": "0xE8A3", + "0x745C": "0xE8A4", + "0x7457": "0xE8A5", + "0x7455": "0xE8A6", + "0x7459": "0xE8A7", + "0x7477": "0xE8A8", + "0x746D": "0xE8A9", + "0x747E": "0xE8AA", + "0x749C": "0xE8AB", + "0x748E": "0xE8AC", + "0x7480": "0xE8AD", + "0x7481": "0xE8AE", + "0x7487": "0xE8AF", + "0x748B": "0xE8B0", + "0x749E": "0xE8B1", + "0x74A8": "0xE8B2", + "0x74A9": "0xE8B3", + "0x7490": "0xE8B4", + "0x74A7": "0xE8B5", + "0x74D2": "0xE8B6", + "0x74BA": "0xE8B7", + "0x97EA": "0xE8B8", + "0x97EB": "0xE8B9", + "0x97EC": "0xE8BA", + "0x674C": "0xE8BB", + "0x6753": "0xE8BC", + "0x675E": "0xE8BD", + "0x6748": "0xE8BE", + "0x6769": "0xE8BF", + "0x67A5": "0xE8C0", + "0x6787": "0xE8C1", + "0x676A": "0xE8C2", + "0x6773": "0xE8C3", + "0x6798": "0xE8C4", + "0x67A7": "0xE8C5", + "0x6775": "0xE8C6", + "0x67A8": "0xE8C7", + "0x679E": "0xE8C8", + "0x67AD": "0xE8C9", + "0x678B": "0xE8CA", + "0x6777": "0xE8CB", + "0x677C": "0xE8CC", + "0x67F0": "0xE8CD", + "0x6809": "0xE8CE", + "0x67D8": "0xE8CF", + "0x680A": "0xE8D0", + "0x67E9": "0xE8D1", + "0x67B0": "0xE8D2", + "0x680C": "0xE8D3", + "0x67D9": "0xE8D4", + "0x67B5": "0xE8D5", + "0x67DA": "0xE8D6", + "0x67B3": "0xE8D7", + "0x67DD": "0xE8D8", + "0x6800": "0xE8D9", + "0x67C3": "0xE8DA", + "0x67B8": "0xE8DB", + "0x67E2": "0xE8DC", + "0x680E": "0xE8DD", + "0x67C1": "0xE8DE", + "0x67FD": "0xE8DF", + "0x6832": "0xE8E0", + "0x6833": "0xE8E1", + "0x6860": "0xE8E2", + "0x6861": "0xE8E3", + "0x684E": "0xE8E4", + "0x6862": "0xE8E5", + "0x6844": "0xE8E6", + "0x6864": "0xE8E7", + "0x6883": "0xE8E8", + "0x681D": "0xE8E9", + "0x6855": "0xE8EA", + "0x6866": "0xE8EB", + "0x6841": "0xE8EC", + "0x6867": "0xE8ED", + "0x6840": "0xE8EE", + "0x683E": "0xE8EF", + "0x684A": "0xE8F0", + "0x6849": "0xE8F1", + "0x6829": "0xE8F2", + "0x68B5": "0xE8F3", + "0x688F": "0xE8F4", + "0x6874": "0xE8F5", + "0x6877": "0xE8F6", + "0x6893": "0xE8F7", + "0x686B": "0xE8F8", + "0x68C2": "0xE8F9", + "0x696E": "0xE8FA", + "0x68FC": "0xE8FB", + "0x691F": "0xE8FC", + "0x6920": "0xE8FD", + "0x68F9": "0xE8FE", + "0x6924": "0xE9A1", + "0x68F0": "0xE9A2", + "0x690B": "0xE9A3", + "0x6901": "0xE9A4", + "0x6957": "0xE9A5", + "0x68E3": "0xE9A6", + "0x6910": "0xE9A7", + "0x6971": "0xE9A8", + "0x6939": "0xE9A9", + "0x6960": "0xE9AA", + "0x6942": "0xE9AB", + "0x695D": "0xE9AC", + "0x6984": "0xE9AD", + "0x696B": "0xE9AE", + "0x6980": "0xE9AF", + "0x6998": "0xE9B0", + "0x6978": "0xE9B1", + "0x6934": "0xE9B2", + "0x69CC": "0xE9B3", + "0x6987": "0xE9B4", + "0x6988": "0xE9B5", + "0x69CE": "0xE9B6", + "0x6989": "0xE9B7", + "0x6966": "0xE9B8", + "0x6963": "0xE9B9", + "0x6979": "0xE9BA", + "0x699B": "0xE9BB", + "0x69A7": "0xE9BC", + "0x69BB": "0xE9BD", + "0x69AB": "0xE9BE", + "0x69AD": "0xE9BF", + "0x69D4": "0xE9C0", + "0x69B1": "0xE9C1", + "0x69C1": "0xE9C2", + "0x69CA": "0xE9C3", + "0x69DF": "0xE9C4", + "0x6995": "0xE9C5", + "0x69E0": "0xE9C6", + "0x698D": "0xE9C7", + "0x69FF": "0xE9C8", + "0x6A2F": "0xE9C9", + "0x69ED": "0xE9CA", + "0x6A17": "0xE9CB", + "0x6A18": "0xE9CC", + "0x6A65": "0xE9CD", + "0x69F2": "0xE9CE", + "0x6A44": "0xE9CF", + "0x6A3E": "0xE9D0", + "0x6AA0": "0xE9D1", + "0x6A50": "0xE9D2", + "0x6A5B": "0xE9D3", + "0x6A35": "0xE9D4", + "0x6A8E": "0xE9D5", + "0x6A79": "0xE9D6", + "0x6A3D": "0xE9D7", + "0x6A28": "0xE9D8", + "0x6A58": "0xE9D9", + "0x6A7C": "0xE9DA", + "0x6A91": "0xE9DB", + "0x6A90": "0xE9DC", + "0x6AA9": "0xE9DD", + "0x6A97": "0xE9DE", + "0x6AAB": "0xE9DF", + "0x7337": "0xE9E0", + "0x7352": "0xE9E1", + "0x6B81": "0xE9E2", + "0x6B82": "0xE9E3", + "0x6B87": "0xE9E4", + "0x6B84": "0xE9E5", + "0x6B92": "0xE9E6", + "0x6B93": "0xE9E7", + "0x6B8D": "0xE9E8", + "0x6B9A": "0xE9E9", + "0x6B9B": "0xE9EA", + "0x6BA1": "0xE9EB", + "0x6BAA": "0xE9EC", + "0x8F6B": "0xE9ED", + "0x8F6D": "0xE9EE", + "0x8F71": "0xE9EF", + "0x8F72": "0xE9F0", + "0x8F73": "0xE9F1", + "0x8F75": "0xE9F2", + "0x8F76": "0xE9F3", + "0x8F78": "0xE9F4", + "0x8F77": "0xE9F5", + "0x8F79": "0xE9F6", + "0x8F7A": "0xE9F7", + "0x8F7C": "0xE9F8", + "0x8F7E": "0xE9F9", + "0x8F81": "0xE9FA", + "0x8F82": "0xE9FB", + "0x8F84": "0xE9FC", + "0x8F87": "0xE9FD", + "0x8F8B": "0xE9FE", + "0x8F8D": "0xEAA1", + "0x8F8E": "0xEAA2", + "0x8F8F": "0xEAA3", + "0x8F98": "0xEAA4", + "0x8F9A": "0xEAA5", + "0x8ECE": "0xEAA6", + "0x620B": "0xEAA7", + "0x6217": "0xEAA8", + "0x621B": "0xEAA9", + "0x621F": "0xEAAA", + "0x6222": "0xEAAB", + "0x6221": "0xEAAC", + "0x6225": "0xEAAD", + "0x6224": "0xEAAE", + "0x622C": "0xEAAF", + "0x81E7": "0xEAB0", + "0x74EF": "0xEAB1", + "0x74F4": "0xEAB2", + "0x74FF": "0xEAB3", + "0x750F": "0xEAB4", + "0x7511": "0xEAB5", + "0x7513": "0xEAB6", + "0x6534": "0xEAB7", + "0x65EE": "0xEAB8", + "0x65EF": "0xEAB9", + "0x65F0": "0xEABA", + "0x660A": "0xEABB", + "0x6619": "0xEABC", + "0x6772": "0xEABD", + "0x6603": "0xEABE", + "0x6615": "0xEABF", + "0x6600": "0xEAC0", + "0x7085": "0xEAC1", + "0x66F7": "0xEAC2", + "0x661D": "0xEAC3", + "0x6634": "0xEAC4", + "0x6631": "0xEAC5", + "0x6636": "0xEAC6", + "0x6635": "0xEAC7", + "0x8006": "0xEAC8", + "0x665F": "0xEAC9", + "0x6654": "0xEACA", + "0x6641": "0xEACB", + "0x664F": "0xEACC", + "0x6656": "0xEACD", + "0x6661": "0xEACE", + "0x6657": "0xEACF", + "0x6677": "0xEAD0", + "0x6684": "0xEAD1", + "0x668C": "0xEAD2", + "0x66A7": "0xEAD3", + "0x669D": "0xEAD4", + "0x66BE": "0xEAD5", + "0x66DB": "0xEAD6", + "0x66DC": "0xEAD7", + "0x66E6": "0xEAD8", + "0x66E9": "0xEAD9", + "0x8D32": "0xEADA", + "0x8D33": "0xEADB", + "0x8D36": "0xEADC", + "0x8D3B": "0xEADD", + "0x8D3D": "0xEADE", + "0x8D40": "0xEADF", + "0x8D45": "0xEAE0", + "0x8D46": "0xEAE1", + "0x8D48": "0xEAE2", + "0x8D49": "0xEAE3", + "0x8D47": "0xEAE4", + "0x8D4D": "0xEAE5", + "0x8D55": "0xEAE6", + "0x8D59": "0xEAE7", + "0x89C7": "0xEAE8", + "0x89CA": "0xEAE9", + "0x89CB": "0xEAEA", + "0x89CC": "0xEAEB", + "0x89CE": "0xEAEC", + "0x89CF": "0xEAED", + "0x89D0": "0xEAEE", + "0x89D1": "0xEAEF", + "0x726E": "0xEAF0", + "0x729F": "0xEAF1", + "0x725D": "0xEAF2", + "0x7266": "0xEAF3", + "0x726F": "0xEAF4", + "0x727E": "0xEAF5", + "0x727F": "0xEAF6", + "0x7284": "0xEAF7", + "0x728B": "0xEAF8", + "0x728D": "0xEAF9", + "0x728F": "0xEAFA", + "0x7292": "0xEAFB", + "0x6308": "0xEAFC", + "0x6332": "0xEAFD", + "0x63B0": "0xEAFE", + "0x643F": "0xEBA1", + "0x64D8": "0xEBA2", + "0x8004": "0xEBA3", + "0x6BEA": "0xEBA4", + "0x6BF3": "0xEBA5", + "0x6BFD": "0xEBA6", + "0x6BF5": "0xEBA7", + "0x6BF9": "0xEBA8", + "0x6C05": "0xEBA9", + "0x6C07": "0xEBAA", + "0x6C06": "0xEBAB", + "0x6C0D": "0xEBAC", + "0x6C15": "0xEBAD", + "0x6C18": "0xEBAE", + "0x6C19": "0xEBAF", + "0x6C1A": "0xEBB0", + "0x6C21": "0xEBB1", + "0x6C29": "0xEBB2", + "0x6C24": "0xEBB3", + "0x6C2A": "0xEBB4", + "0x6C32": "0xEBB5", + "0x6535": "0xEBB6", + "0x6555": "0xEBB7", + "0x656B": "0xEBB8", + "0x724D": "0xEBB9", + "0x7252": "0xEBBA", + "0x7256": "0xEBBB", + "0x7230": "0xEBBC", + "0x8662": "0xEBBD", + "0x5216": "0xEBBE", + "0x809F": "0xEBBF", + "0x809C": "0xEBC0", + "0x8093": "0xEBC1", + "0x80BC": "0xEBC2", + "0x670A": "0xEBC3", + "0x80BD": "0xEBC4", + "0x80B1": "0xEBC5", + "0x80AB": "0xEBC6", + "0x80AD": "0xEBC7", + "0x80B4": "0xEBC8", + "0x80B7": "0xEBC9", + "0x80E7": "0xEBCA", + "0x80E8": "0xEBCB", + "0x80E9": "0xEBCC", + "0x80EA": "0xEBCD", + "0x80DB": "0xEBCE", + "0x80C2": "0xEBCF", + "0x80C4": "0xEBD0", + "0x80D9": "0xEBD1", + "0x80CD": "0xEBD2", + "0x80D7": "0xEBD3", + "0x6710": "0xEBD4", + "0x80DD": "0xEBD5", + "0x80EB": "0xEBD6", + "0x80F1": "0xEBD7", + "0x80F4": "0xEBD8", + "0x80ED": "0xEBD9", + "0x810D": "0xEBDA", + "0x810E": "0xEBDB", + "0x80F2": "0xEBDC", + "0x80FC": "0xEBDD", + "0x6715": "0xEBDE", + "0x8112": "0xEBDF", + "0x8C5A": "0xEBE0", + "0x8136": "0xEBE1", + "0x811E": "0xEBE2", + "0x812C": "0xEBE3", + "0x8118": "0xEBE4", + "0x8132": "0xEBE5", + "0x8148": "0xEBE6", + "0x814C": "0xEBE7", + "0x8153": "0xEBE8", + "0x8174": "0xEBE9", + "0x8159": "0xEBEA", + "0x815A": "0xEBEB", + "0x8171": "0xEBEC", + "0x8160": "0xEBED", + "0x8169": "0xEBEE", + "0x817C": "0xEBEF", + "0x817D": "0xEBF0", + "0x816D": "0xEBF1", + "0x8167": "0xEBF2", + "0x584D": "0xEBF3", + "0x5AB5": "0xEBF4", + "0x8188": "0xEBF5", + "0x8182": "0xEBF6", + "0x8191": "0xEBF7", + "0x6ED5": "0xEBF8", + "0x81A3": "0xEBF9", + "0x81AA": "0xEBFA", + "0x81CC": "0xEBFB", + "0x6726": "0xEBFC", + "0x81CA": "0xEBFD", + "0x81BB": "0xEBFE", + "0x81C1": "0xECA1", + "0x81A6": "0xECA2", + "0x6B24": "0xECA3", + "0x6B37": "0xECA4", + "0x6B39": "0xECA5", + "0x6B43": "0xECA6", + "0x6B46": "0xECA7", + "0x6B59": "0xECA8", + "0x98D1": "0xECA9", + "0x98D2": "0xECAA", + "0x98D3": "0xECAB", + "0x98D5": "0xECAC", + "0x98D9": "0xECAD", + "0x98DA": "0xECAE", + "0x6BB3": "0xECAF", + "0x5F40": "0xECB0", + "0x6BC2": "0xECB1", + "0x89F3": "0xECB2", + "0x6590": "0xECB3", + "0x9F51": "0xECB4", + "0x6593": "0xECB5", + "0x65BC": "0xECB6", + "0x65C6": "0xECB7", + "0x65C4": "0xECB8", + "0x65C3": "0xECB9", + "0x65CC": "0xECBA", + "0x65CE": "0xECBB", + "0x65D2": "0xECBC", + "0x65D6": "0xECBD", + "0x7080": "0xECBE", + "0x709C": "0xECBF", + "0x7096": "0xECC0", + "0x709D": "0xECC1", + "0x70BB": "0xECC2", + "0x70C0": "0xECC3", + "0x70B7": "0xECC4", + "0x70AB": "0xECC5", + "0x70B1": "0xECC6", + "0x70E8": "0xECC7", + "0x70CA": "0xECC8", + "0x7110": "0xECC9", + "0x7113": "0xECCA", + "0x7116": "0xECCB", + "0x712F": "0xECCC", + "0x7131": "0xECCD", + "0x7173": "0xECCE", + "0x715C": "0xECCF", + "0x7168": "0xECD0", + "0x7145": "0xECD1", + "0x7172": "0xECD2", + "0x714A": "0xECD3", + "0x7178": "0xECD4", + "0x717A": "0xECD5", + "0x7198": "0xECD6", + "0x71B3": "0xECD7", + "0x71B5": "0xECD8", + "0x71A8": "0xECD9", + "0x71A0": "0xECDA", + "0x71E0": "0xECDB", + "0x71D4": "0xECDC", + "0x71E7": "0xECDD", + "0x71F9": "0xECDE", + "0x721D": "0xECDF", + "0x7228": "0xECE0", + "0x706C": "0xECE1", + "0x7118": "0xECE2", + "0x7166": "0xECE3", + "0x71B9": "0xECE4", + "0x623E": "0xECE5", + "0x623D": "0xECE6", + "0x6243": "0xECE7", + "0x6248": "0xECE8", + "0x6249": "0xECE9", + "0x793B": "0xECEA", + "0x7940": "0xECEB", + "0x7946": "0xECEC", + "0x7949": "0xECED", + "0x795B": "0xECEE", + "0x795C": "0xECEF", + "0x7953": "0xECF0", + "0x795A": "0xECF1", + "0x7962": "0xECF2", + "0x7957": "0xECF3", + "0x7960": "0xECF4", + "0x796F": "0xECF5", + "0x7967": "0xECF6", + "0x797A": "0xECF7", + "0x7985": "0xECF8", + "0x798A": "0xECF9", + "0x799A": "0xECFA", + "0x79A7": "0xECFB", + "0x79B3": "0xECFC", + "0x5FD1": "0xECFD", + "0x5FD0": "0xECFE", + "0x603C": "0xEDA1", + "0x605D": "0xEDA2", + "0x605A": "0xEDA3", + "0x6067": "0xEDA4", + "0x6041": "0xEDA5", + "0x6059": "0xEDA6", + "0x6063": "0xEDA7", + "0x60AB": "0xEDA8", + "0x6106": "0xEDA9", + "0x610D": "0xEDAA", + "0x615D": "0xEDAB", + "0x61A9": "0xEDAC", + "0x619D": "0xEDAD", + "0x61CB": "0xEDAE", + "0x61D1": "0xEDAF", + "0x6206": "0xEDB0", + "0x8080": "0xEDB1", + "0x807F": "0xEDB2", + "0x6C93": "0xEDB3", + "0x6CF6": "0xEDB4", + "0x6DFC": "0xEDB5", + "0x77F6": "0xEDB6", + "0x77F8": "0xEDB7", + "0x7800": "0xEDB8", + "0x7809": "0xEDB9", + "0x7817": "0xEDBA", + "0x7818": "0xEDBB", + "0x7811": "0xEDBC", + "0x65AB": "0xEDBD", + "0x782D": "0xEDBE", + "0x781C": "0xEDBF", + "0x781D": "0xEDC0", + "0x7839": "0xEDC1", + "0x783A": "0xEDC2", + "0x783B": "0xEDC3", + "0x781F": "0xEDC4", + "0x783C": "0xEDC5", + "0x7825": "0xEDC6", + "0x782C": "0xEDC7", + "0x7823": "0xEDC8", + "0x7829": "0xEDC9", + "0x784E": "0xEDCA", + "0x786D": "0xEDCB", + "0x7856": "0xEDCC", + "0x7857": "0xEDCD", + "0x7826": "0xEDCE", + "0x7850": "0xEDCF", + "0x7847": "0xEDD0", + "0x784C": "0xEDD1", + "0x786A": "0xEDD2", + "0x789B": "0xEDD3", + "0x7893": "0xEDD4", + "0x789A": "0xEDD5", + "0x7887": "0xEDD6", + "0x789C": "0xEDD7", + "0x78A1": "0xEDD8", + "0x78A3": "0xEDD9", + "0x78B2": "0xEDDA", + "0x78B9": "0xEDDB", + "0x78A5": "0xEDDC", + "0x78D4": "0xEDDD", + "0x78D9": "0xEDDE", + "0x78C9": "0xEDDF", + "0x78EC": "0xEDE0", + "0x78F2": "0xEDE1", + "0x7905": "0xEDE2", + "0x78F4": "0xEDE3", + "0x7913": "0xEDE4", + "0x7924": "0xEDE5", + "0x791E": "0xEDE6", + "0x7934": "0xEDE7", + "0x9F9B": "0xEDE8", + "0x9EF9": "0xEDE9", + "0x9EFB": "0xEDEA", + "0x9EFC": "0xEDEB", + "0x76F1": "0xEDEC", + "0x7704": "0xEDED", + "0x770D": "0xEDEE", + "0x76F9": "0xEDEF", + "0x7707": "0xEDF0", + "0x7708": "0xEDF1", + "0x771A": "0xEDF2", + "0x7722": "0xEDF3", + "0x7719": "0xEDF4", + "0x772D": "0xEDF5", + "0x7726": "0xEDF6", + "0x7735": "0xEDF7", + "0x7738": "0xEDF8", + "0x7750": "0xEDF9", + "0x7751": "0xEDFA", + "0x7747": "0xEDFB", + "0x7743": "0xEDFC", + "0x775A": "0xEDFD", + "0x7768": "0xEDFE", + "0x7762": "0xEEA1", + "0x7765": "0xEEA2", + "0x777F": "0xEEA3", + "0x778D": "0xEEA4", + "0x777D": "0xEEA5", + "0x7780": "0xEEA6", + "0x778C": "0xEEA7", + "0x7791": "0xEEA8", + "0x779F": "0xEEA9", + "0x77A0": "0xEEAA", + "0x77B0": "0xEEAB", + "0x77B5": "0xEEAC", + "0x77BD": "0xEEAD", + "0x753A": "0xEEAE", + "0x7540": "0xEEAF", + "0x754E": "0xEEB0", + "0x754B": "0xEEB1", + "0x7548": "0xEEB2", + "0x755B": "0xEEB3", + "0x7572": "0xEEB4", + "0x7579": "0xEEB5", + "0x7583": "0xEEB6", + "0x7F58": "0xEEB7", + "0x7F61": "0xEEB8", + "0x7F5F": "0xEEB9", + "0x8A48": "0xEEBA", + "0x7F68": "0xEEBB", + "0x7F74": "0xEEBC", + "0x7F71": "0xEEBD", + "0x7F79": "0xEEBE", + "0x7F81": "0xEEBF", + "0x7F7E": "0xEEC0", + "0x76CD": "0xEEC1", + "0x76E5": "0xEEC2", + "0x8832": "0xEEC3", + "0x9485": "0xEEC4", + "0x9486": "0xEEC5", + "0x9487": "0xEEC6", + "0x948B": "0xEEC7", + "0x948A": "0xEEC8", + "0x948C": "0xEEC9", + "0x948D": "0xEECA", + "0x948F": "0xEECB", + "0x9490": "0xEECC", + "0x9494": "0xEECD", + "0x9497": "0xEECE", + "0x9495": "0xEECF", + "0x949A": "0xEED0", + "0x949B": "0xEED1", + "0x949C": "0xEED2", + "0x94A3": "0xEED3", + "0x94A4": "0xEED4", + "0x94AB": "0xEED5", + "0x94AA": "0xEED6", + "0x94AD": "0xEED7", + "0x94AC": "0xEED8", + "0x94AF": "0xEED9", + "0x94B0": "0xEEDA", + "0x94B2": "0xEEDB", + "0x94B4": "0xEEDC", + "0x94B6": "0xEEDD", + "0x94B7": "0xEEDE", + "0x94B8": "0xEEDF", + "0x94B9": "0xEEE0", + "0x94BA": "0xEEE1", + "0x94BC": "0xEEE2", + "0x94BD": "0xEEE3", + "0x94BF": "0xEEE4", + "0x94C4": "0xEEE5", + "0x94C8": "0xEEE6", + "0x94C9": "0xEEE7", + "0x94CA": "0xEEE8", + "0x94CB": "0xEEE9", + "0x94CC": "0xEEEA", + "0x94CD": "0xEEEB", + "0x94CE": "0xEEEC", + "0x94D0": "0xEEED", + "0x94D1": "0xEEEE", + "0x94D2": "0xEEEF", + "0x94D5": "0xEEF0", + "0x94D6": "0xEEF1", + "0x94D7": "0xEEF2", + "0x94D9": "0xEEF3", + "0x94D8": "0xEEF4", + "0x94DB": "0xEEF5", + "0x94DE": "0xEEF6", + "0x94DF": "0xEEF7", + "0x94E0": "0xEEF8", + "0x94E2": "0xEEF9", + "0x94E4": "0xEEFA", + "0x94E5": "0xEEFB", + "0x94E7": "0xEEFC", + "0x94E8": "0xEEFD", + "0x94EA": "0xEEFE", + "0x94E9": "0xEFA1", + "0x94EB": "0xEFA2", + "0x94EE": "0xEFA3", + "0x94EF": "0xEFA4", + "0x94F3": "0xEFA5", + "0x94F4": "0xEFA6", + "0x94F5": "0xEFA7", + "0x94F7": "0xEFA8", + "0x94F9": "0xEFA9", + "0x94FC": "0xEFAA", + "0x94FD": "0xEFAB", + "0x94FF": "0xEFAC", + "0x9503": "0xEFAD", + "0x9502": "0xEFAE", + "0x9506": "0xEFAF", + "0x9507": "0xEFB0", + "0x9509": "0xEFB1", + "0x950A": "0xEFB2", + "0x950D": "0xEFB3", + "0x950E": "0xEFB4", + "0x950F": "0xEFB5", + "0x9512": "0xEFB6", + "0x9513": "0xEFB7", + "0x9514": "0xEFB8", + "0x9515": "0xEFB9", + "0x9516": "0xEFBA", + "0x9518": "0xEFBB", + "0x951B": "0xEFBC", + "0x951D": "0xEFBD", + "0x951E": "0xEFBE", + "0x951F": "0xEFBF", + "0x9522": "0xEFC0", + "0x952A": "0xEFC1", + "0x952B": "0xEFC2", + "0x9529": "0xEFC3", + "0x952C": "0xEFC4", + "0x9531": "0xEFC5", + "0x9532": "0xEFC6", + "0x9534": "0xEFC7", + "0x9536": "0xEFC8", + "0x9537": "0xEFC9", + "0x9538": "0xEFCA", + "0x953C": "0xEFCB", + "0x953E": "0xEFCC", + "0x953F": "0xEFCD", + "0x9542": "0xEFCE", + "0x9535": "0xEFCF", + "0x9544": "0xEFD0", + "0x9545": "0xEFD1", + "0x9546": "0xEFD2", + "0x9549": "0xEFD3", + "0x954C": "0xEFD4", + "0x954E": "0xEFD5", + "0x954F": "0xEFD6", + "0x9552": "0xEFD7", + "0x9553": "0xEFD8", + "0x9554": "0xEFD9", + "0x9556": "0xEFDA", + "0x9557": "0xEFDB", + "0x9558": "0xEFDC", + "0x9559": "0xEFDD", + "0x955B": "0xEFDE", + "0x955E": "0xEFDF", + "0x955F": "0xEFE0", + "0x955D": "0xEFE1", + "0x9561": "0xEFE2", + "0x9562": "0xEFE3", + "0x9564": "0xEFE4", + "0x9565": "0xEFE5", + "0x9566": "0xEFE6", + "0x9567": "0xEFE7", + "0x9568": "0xEFE8", + "0x9569": "0xEFE9", + "0x956A": "0xEFEA", + "0x956B": "0xEFEB", + "0x956C": "0xEFEC", + "0x956F": "0xEFED", + "0x9571": "0xEFEE", + "0x9572": "0xEFEF", + "0x9573": "0xEFF0", + "0x953A": "0xEFF1", + "0x77E7": "0xEFF2", + "0x77EC": "0xEFF3", + "0x96C9": "0xEFF4", + "0x79D5": "0xEFF5", + "0x79ED": "0xEFF6", + "0x79E3": "0xEFF7", + "0x79EB": "0xEFF8", + "0x7A06": "0xEFF9", + "0x5D47": "0xEFFA", + "0x7A03": "0xEFFB", + "0x7A02": "0xEFFC", + "0x7A1E": "0xEFFD", + "0x7A14": "0xEFFE", + "0x7A39": "0xF0A1", + "0x7A37": "0xF0A2", + "0x7A51": "0xF0A3", + "0x9ECF": "0xF0A4", + "0x99A5": "0xF0A5", + "0x7A70": "0xF0A6", + "0x7688": "0xF0A7", + "0x768E": "0xF0A8", + "0x7693": "0xF0A9", + "0x7699": "0xF0AA", + "0x76A4": "0xF0AB", + "0x74DE": "0xF0AC", + "0x74E0": "0xF0AD", + "0x752C": "0xF0AE", + "0x9E20": "0xF0AF", + "0x9E22": "0xF0B0", + "0x9E28": "0xF0B1", + "0x9E29": "0xF0B2", + "0x9E2A": "0xF0B3", + "0x9E2B": "0xF0B4", + "0x9E2C": "0xF0B5", + "0x9E32": "0xF0B6", + "0x9E31": "0xF0B7", + "0x9E36": "0xF0B8", + "0x9E38": "0xF0B9", + "0x9E37": "0xF0BA", + "0x9E39": "0xF0BB", + "0x9E3A": "0xF0BC", + "0x9E3E": "0xF0BD", + "0x9E41": "0xF0BE", + "0x9E42": "0xF0BF", + "0x9E44": "0xF0C0", + "0x9E46": "0xF0C1", + "0x9E47": "0xF0C2", + "0x9E48": "0xF0C3", + "0x9E49": "0xF0C4", + "0x9E4B": "0xF0C5", + "0x9E4C": "0xF0C6", + "0x9E4E": "0xF0C7", + "0x9E51": "0xF0C8", + "0x9E55": "0xF0C9", + "0x9E57": "0xF0CA", + "0x9E5A": "0xF0CB", + "0x9E5B": "0xF0CC", + "0x9E5C": "0xF0CD", + "0x9E5E": "0xF0CE", + "0x9E63": "0xF0CF", + "0x9E66": "0xF0D0", + "0x9E67": "0xF0D1", + "0x9E68": "0xF0D2", + "0x9E69": "0xF0D3", + "0x9E6A": "0xF0D4", + "0x9E6B": "0xF0D5", + "0x9E6C": "0xF0D6", + "0x9E71": "0xF0D7", + "0x9E6D": "0xF0D8", + "0x9E73": "0xF0D9", + "0x7592": "0xF0DA", + "0x7594": "0xF0DB", + "0x7596": "0xF0DC", + "0x75A0": "0xF0DD", + "0x759D": "0xF0DE", + "0x75AC": "0xF0DF", + "0x75A3": "0xF0E0", + "0x75B3": "0xF0E1", + "0x75B4": "0xF0E2", + "0x75B8": "0xF0E3", + "0x75C4": "0xF0E4", + "0x75B1": "0xF0E5", + "0x75B0": "0xF0E6", + "0x75C3": "0xF0E7", + "0x75C2": "0xF0E8", + "0x75D6": "0xF0E9", + "0x75CD": "0xF0EA", + "0x75E3": "0xF0EB", + "0x75E8": "0xF0EC", + "0x75E6": "0xF0ED", + "0x75E4": "0xF0EE", + "0x75EB": "0xF0EF", + "0x75E7": "0xF0F0", + "0x7603": "0xF0F1", + "0x75F1": "0xF0F2", + "0x75FC": "0xF0F3", + "0x75FF": "0xF0F4", + "0x7610": "0xF0F5", + "0x7600": "0xF0F6", + "0x7605": "0xF0F7", + "0x760C": "0xF0F8", + "0x7617": "0xF0F9", + "0x760A": "0xF0FA", + "0x7625": "0xF0FB", + "0x7618": "0xF0FC", + "0x7615": "0xF0FD", + "0x7619": "0xF0FE", + "0x761B": "0xF1A1", + "0x763C": "0xF1A2", + "0x7622": "0xF1A3", + "0x7620": "0xF1A4", + "0x7640": "0xF1A5", + "0x762D": "0xF1A6", + "0x7630": "0xF1A7", + "0x763F": "0xF1A8", + "0x7635": "0xF1A9", + "0x7643": "0xF1AA", + "0x763E": "0xF1AB", + "0x7633": "0xF1AC", + "0x764D": "0xF1AD", + "0x765E": "0xF1AE", + "0x7654": "0xF1AF", + "0x765C": "0xF1B0", + "0x7656": "0xF1B1", + "0x766B": "0xF1B2", + "0x766F": "0xF1B3", + "0x7FCA": "0xF1B4", + "0x7AE6": "0xF1B5", + "0x7A78": "0xF1B6", + "0x7A79": "0xF1B7", + "0x7A80": "0xF1B8", + "0x7A86": "0xF1B9", + "0x7A88": "0xF1BA", + "0x7A95": "0xF1BB", + "0x7AA6": "0xF1BC", + "0x7AA0": "0xF1BD", + "0x7AAC": "0xF1BE", + "0x7AA8": "0xF1BF", + "0x7AAD": "0xF1C0", + "0x7AB3": "0xF1C1", + "0x8864": "0xF1C2", + "0x8869": "0xF1C3", + "0x8872": "0xF1C4", + "0x887D": "0xF1C5", + "0x887F": "0xF1C6", + "0x8882": "0xF1C7", + "0x88A2": "0xF1C8", + "0x88C6": "0xF1C9", + "0x88B7": "0xF1CA", + "0x88BC": "0xF1CB", + "0x88C9": "0xF1CC", + "0x88E2": "0xF1CD", + "0x88CE": "0xF1CE", + "0x88E3": "0xF1CF", + "0x88E5": "0xF1D0", + "0x88F1": "0xF1D1", + "0x891A": "0xF1D2", + "0x88FC": "0xF1D3", + "0x88E8": "0xF1D4", + "0x88FE": "0xF1D5", + "0x88F0": "0xF1D6", + "0x8921": "0xF1D7", + "0x8919": "0xF1D8", + "0x8913": "0xF1D9", + "0x891B": "0xF1DA", + "0x890A": "0xF1DB", + "0x8934": "0xF1DC", + "0x892B": "0xF1DD", + "0x8936": "0xF1DE", + "0x8941": "0xF1DF", + "0x8966": "0xF1E0", + "0x897B": "0xF1E1", + "0x758B": "0xF1E2", + "0x80E5": "0xF1E3", + "0x76B2": "0xF1E4", + "0x76B4": "0xF1E5", + "0x77DC": "0xF1E6", + "0x8012": "0xF1E7", + "0x8014": "0xF1E8", + "0x8016": "0xF1E9", + "0x801C": "0xF1EA", + "0x8020": "0xF1EB", + "0x8022": "0xF1EC", + "0x8025": "0xF1ED", + "0x8026": "0xF1EE", + "0x8027": "0xF1EF", + "0x8029": "0xF1F0", + "0x8028": "0xF1F1", + "0x8031": "0xF1F2", + "0x800B": "0xF1F3", + "0x8035": "0xF1F4", + "0x8043": "0xF1F5", + "0x8046": "0xF1F6", + "0x804D": "0xF1F7", + "0x8052": "0xF1F8", + "0x8069": "0xF1F9", + "0x8071": "0xF1FA", + "0x8983": "0xF1FB", + "0x9878": "0xF1FC", + "0x9880": "0xF1FD", + "0x9883": "0xF1FE", + "0x9889": "0xF2A1", + "0x988C": "0xF2A2", + "0x988D": "0xF2A3", + "0x988F": "0xF2A4", + "0x9894": "0xF2A5", + "0x989A": "0xF2A6", + "0x989B": "0xF2A7", + "0x989E": "0xF2A8", + "0x989F": "0xF2A9", + "0x98A1": "0xF2AA", + "0x98A2": "0xF2AB", + "0x98A5": "0xF2AC", + "0x98A6": "0xF2AD", + "0x864D": "0xF2AE", + "0x8654": "0xF2AF", + "0x866C": "0xF2B0", + "0x866E": "0xF2B1", + "0x867F": "0xF2B2", + "0x867A": "0xF2B3", + "0x867C": "0xF2B4", + "0x867B": "0xF2B5", + "0x86A8": "0xF2B6", + "0x868D": "0xF2B7", + "0x868B": "0xF2B8", + "0x86AC": "0xF2B9", + "0x869D": "0xF2BA", + "0x86A7": "0xF2BB", + "0x86A3": "0xF2BC", + "0x86AA": "0xF2BD", + "0x8693": "0xF2BE", + "0x86A9": "0xF2BF", + "0x86B6": "0xF2C0", + "0x86C4": "0xF2C1", + "0x86B5": "0xF2C2", + "0x86CE": "0xF2C3", + "0x86B0": "0xF2C4", + "0x86BA": "0xF2C5", + "0x86B1": "0xF2C6", + "0x86AF": "0xF2C7", + "0x86C9": "0xF2C8", + "0x86CF": "0xF2C9", + "0x86B4": "0xF2CA", + "0x86E9": "0xF2CB", + "0x86F1": "0xF2CC", + "0x86F2": "0xF2CD", + "0x86ED": "0xF2CE", + "0x86F3": "0xF2CF", + "0x86D0": "0xF2D0", + "0x8713": "0xF2D1", + "0x86DE": "0xF2D2", + "0x86F4": "0xF2D3", + "0x86DF": "0xF2D4", + "0x86D8": "0xF2D5", + "0x86D1": "0xF2D6", + "0x8703": "0xF2D7", + "0x8707": "0xF2D8", + "0x86F8": "0xF2D9", + "0x8708": "0xF2DA", + "0x870A": "0xF2DB", + "0x870D": "0xF2DC", + "0x8709": "0xF2DD", + "0x8723": "0xF2DE", + "0x873B": "0xF2DF", + "0x871E": "0xF2E0", + "0x8725": "0xF2E1", + "0x872E": "0xF2E2", + "0x871A": "0xF2E3", + "0x873E": "0xF2E4", + "0x8748": "0xF2E5", + "0x8734": "0xF2E6", + "0x8731": "0xF2E7", + "0x8729": "0xF2E8", + "0x8737": "0xF2E9", + "0x873F": "0xF2EA", + "0x8782": "0xF2EB", + "0x8722": "0xF2EC", + "0x877D": "0xF2ED", + "0x877E": "0xF2EE", + "0x877B": "0xF2EF", + "0x8760": "0xF2F0", + "0x8770": "0xF2F1", + "0x874C": "0xF2F2", + "0x876E": "0xF2F3", + "0x878B": "0xF2F4", + "0x8753": "0xF2F5", + "0x8763": "0xF2F6", + "0x877C": "0xF2F7", + "0x8764": "0xF2F8", + "0x8759": "0xF2F9", + "0x8765": "0xF2FA", + "0x8793": "0xF2FB", + "0x87AF": "0xF2FC", + "0x87A8": "0xF2FD", + "0x87D2": "0xF2FE", + "0x87C6": "0xF3A1", + "0x8788": "0xF3A2", + "0x8785": "0xF3A3", + "0x87AD": "0xF3A4", + "0x8797": "0xF3A5", + "0x8783": "0xF3A6", + "0x87AB": "0xF3A7", + "0x87E5": "0xF3A8", + "0x87AC": "0xF3A9", + "0x87B5": "0xF3AA", + "0x87B3": "0xF3AB", + "0x87CB": "0xF3AC", + "0x87D3": "0xF3AD", + "0x87BD": "0xF3AE", + "0x87D1": "0xF3AF", + "0x87C0": "0xF3B0", + "0x87CA": "0xF3B1", + "0x87DB": "0xF3B2", + "0x87EA": "0xF3B3", + "0x87E0": "0xF3B4", + "0x87EE": "0xF3B5", + "0x8816": "0xF3B6", + "0x8813": "0xF3B7", + "0x87FE": "0xF3B8", + "0x880A": "0xF3B9", + "0x881B": "0xF3BA", + "0x8821": "0xF3BB", + "0x8839": "0xF3BC", + "0x883C": "0xF3BD", + "0x7F36": "0xF3BE", + "0x7F42": "0xF3BF", + "0x7F44": "0xF3C0", + "0x7F45": "0xF3C1", + "0x8210": "0xF3C2", + "0x7AFA": "0xF3C3", + "0x7AFD": "0xF3C4", + "0x7B08": "0xF3C5", + "0x7B03": "0xF3C6", + "0x7B04": "0xF3C7", + "0x7B15": "0xF3C8", + "0x7B0A": "0xF3C9", + "0x7B2B": "0xF3CA", + "0x7B0F": "0xF3CB", + "0x7B47": "0xF3CC", + "0x7B38": "0xF3CD", + "0x7B2A": "0xF3CE", + "0x7B19": "0xF3CF", + "0x7B2E": "0xF3D0", + "0x7B31": "0xF3D1", + "0x7B20": "0xF3D2", + "0x7B25": "0xF3D3", + "0x7B24": "0xF3D4", + "0x7B33": "0xF3D5", + "0x7B3E": "0xF3D6", + "0x7B1E": "0xF3D7", + "0x7B58": "0xF3D8", + "0x7B5A": "0xF3D9", + "0x7B45": "0xF3DA", + "0x7B75": "0xF3DB", + "0x7B4C": "0xF3DC", + "0x7B5D": "0xF3DD", + "0x7B60": "0xF3DE", + "0x7B6E": "0xF3DF", + "0x7B7B": "0xF3E0", + "0x7B62": "0xF3E1", + "0x7B72": "0xF3E2", + "0x7B71": "0xF3E3", + "0x7B90": "0xF3E4", + "0x7BA6": "0xF3E5", + "0x7BA7": "0xF3E6", + "0x7BB8": "0xF3E7", + "0x7BAC": "0xF3E8", + "0x7B9D": "0xF3E9", + "0x7BA8": "0xF3EA", + "0x7B85": "0xF3EB", + "0x7BAA": "0xF3EC", + "0x7B9C": "0xF3ED", + "0x7BA2": "0xF3EE", + "0x7BAB": "0xF3EF", + "0x7BB4": "0xF3F0", + "0x7BD1": "0xF3F1", + "0x7BC1": "0xF3F2", + "0x7BCC": "0xF3F3", + "0x7BDD": "0xF3F4", + "0x7BDA": "0xF3F5", + "0x7BE5": "0xF3F6", + "0x7BE6": "0xF3F7", + "0x7BEA": "0xF3F8", + "0x7C0C": "0xF3F9", + "0x7BFE": "0xF3FA", + "0x7BFC": "0xF3FB", + "0x7C0F": "0xF3FC", + "0x7C16": "0xF3FD", + "0x7C0B": "0xF3FE", + "0x7C1F": "0xF4A1", + "0x7C2A": "0xF4A2", + "0x7C26": "0xF4A3", + "0x7C38": "0xF4A4", + "0x7C41": "0xF4A5", + "0x7C40": "0xF4A6", + "0x81FE": "0xF4A7", + "0x8201": "0xF4A8", + "0x8202": "0xF4A9", + "0x8204": "0xF4AA", + "0x81EC": "0xF4AB", + "0x8844": "0xF4AC", + "0x8221": "0xF4AD", + "0x8222": "0xF4AE", + "0x8223": "0xF4AF", + "0x822D": "0xF4B0", + "0x822F": "0xF4B1", + "0x8228": "0xF4B2", + "0x822B": "0xF4B3", + "0x8238": "0xF4B4", + "0x823B": "0xF4B5", + "0x8233": "0xF4B6", + "0x8234": "0xF4B7", + "0x823E": "0xF4B8", + "0x8244": "0xF4B9", + "0x8249": "0xF4BA", + "0x824B": "0xF4BB", + "0x824F": "0xF4BC", + "0x825A": "0xF4BD", + "0x825F": "0xF4BE", + "0x8268": "0xF4BF", + "0x887E": "0xF4C0", + "0x8885": "0xF4C1", + "0x8888": "0xF4C2", + "0x88D8": "0xF4C3", + "0x88DF": "0xF4C4", + "0x895E": "0xF4C5", + "0x7F9D": "0xF4C6", + "0x7F9F": "0xF4C7", + "0x7FA7": "0xF4C8", + "0x7FAF": "0xF4C9", + "0x7FB0": "0xF4CA", + "0x7FB2": "0xF4CB", + "0x7C7C": "0xF4CC", + "0x6549": "0xF4CD", + "0x7C91": "0xF4CE", + "0x7C9D": "0xF4CF", + "0x7C9C": "0xF4D0", + "0x7C9E": "0xF4D1", + "0x7CA2": "0xF4D2", + "0x7CB2": "0xF4D3", + "0x7CBC": "0xF4D4", + "0x7CBD": "0xF4D5", + "0x7CC1": "0xF4D6", + "0x7CC7": "0xF4D7", + "0x7CCC": "0xF4D8", + "0x7CCD": "0xF4D9", + "0x7CC8": "0xF4DA", + "0x7CC5": "0xF4DB", + "0x7CD7": "0xF4DC", + "0x7CE8": "0xF4DD", + "0x826E": "0xF4DE", + "0x66A8": "0xF4DF", + "0x7FBF": "0xF4E0", + "0x7FCE": "0xF4E1", + "0x7FD5": "0xF4E2", + "0x7FE5": "0xF4E3", + "0x7FE1": "0xF4E4", + "0x7FE6": "0xF4E5", + "0x7FE9": "0xF4E6", + "0x7FEE": "0xF4E7", + "0x7FF3": "0xF4E8", + "0x7CF8": "0xF4E9", + "0x7D77": "0xF4EA", + "0x7DA6": "0xF4EB", + "0x7DAE": "0xF4EC", + "0x7E47": "0xF4ED", + "0x7E9B": "0xF4EE", + "0x9EB8": "0xF4EF", + "0x9EB4": "0xF4F0", + "0x8D73": "0xF4F1", + "0x8D84": "0xF4F2", + "0x8D94": "0xF4F3", + "0x8D91": "0xF4F4", + "0x8DB1": "0xF4F5", + "0x8D67": "0xF4F6", + "0x8D6D": "0xF4F7", + "0x8C47": "0xF4F8", + "0x8C49": "0xF4F9", + "0x914A": "0xF4FA", + "0x9150": "0xF4FB", + "0x914E": "0xF4FC", + "0x914F": "0xF4FD", + "0x9164": "0xF4FE", + "0x9162": "0xF5A1", + "0x9161": "0xF5A2", + "0x9170": "0xF5A3", + "0x9169": "0xF5A4", + "0x916F": "0xF5A5", + "0x917D": "0xF5A6", + "0x917E": "0xF5A7", + "0x9172": "0xF5A8", + "0x9174": "0xF5A9", + "0x9179": "0xF5AA", + "0x918C": "0xF5AB", + "0x9185": "0xF5AC", + "0x9190": "0xF5AD", + "0x918D": "0xF5AE", + "0x9191": "0xF5AF", + "0x91A2": "0xF5B0", + "0x91A3": "0xF5B1", + "0x91AA": "0xF5B2", + "0x91AD": "0xF5B3", + "0x91AE": "0xF5B4", + "0x91AF": "0xF5B5", + "0x91B5": "0xF5B6", + "0x91B4": "0xF5B7", + "0x91BA": "0xF5B8", + "0x8C55": "0xF5B9", + "0x9E7E": "0xF5BA", + "0x8DB8": "0xF5BB", + "0x8DEB": "0xF5BC", + "0x8E05": "0xF5BD", + "0x8E59": "0xF5BE", + "0x8E69": "0xF5BF", + "0x8DB5": "0xF5C0", + "0x8DBF": "0xF5C1", + "0x8DBC": "0xF5C2", + "0x8DBA": "0xF5C3", + "0x8DC4": "0xF5C4", + "0x8DD6": "0xF5C5", + "0x8DD7": "0xF5C6", + "0x8DDA": "0xF5C7", + "0x8DDE": "0xF5C8", + "0x8DCE": "0xF5C9", + "0x8DCF": "0xF5CA", + "0x8DDB": "0xF5CB", + "0x8DC6": "0xF5CC", + "0x8DEC": "0xF5CD", + "0x8DF7": "0xF5CE", + "0x8DF8": "0xF5CF", + "0x8DE3": "0xF5D0", + "0x8DF9": "0xF5D1", + "0x8DFB": "0xF5D2", + "0x8DE4": "0xF5D3", + "0x8E09": "0xF5D4", + "0x8DFD": "0xF5D5", + "0x8E14": "0xF5D6", + "0x8E1D": "0xF5D7", + "0x8E1F": "0xF5D8", + "0x8E2C": "0xF5D9", + "0x8E2E": "0xF5DA", + "0x8E23": "0xF5DB", + "0x8E2F": "0xF5DC", + "0x8E3A": "0xF5DD", + "0x8E40": "0xF5DE", + "0x8E39": "0xF5DF", + "0x8E35": "0xF5E0", + "0x8E3D": "0xF5E1", + "0x8E31": "0xF5E2", + "0x8E49": "0xF5E3", + "0x8E41": "0xF5E4", + "0x8E42": "0xF5E5", + "0x8E51": "0xF5E6", + "0x8E52": "0xF5E7", + "0x8E4A": "0xF5E8", + "0x8E70": "0xF5E9", + "0x8E76": "0xF5EA", + "0x8E7C": "0xF5EB", + "0x8E6F": "0xF5EC", + "0x8E74": "0xF5ED", + "0x8E85": "0xF5EE", + "0x8E8F": "0xF5EF", + "0x8E94": "0xF5F0", + "0x8E90": "0xF5F1", + "0x8E9C": "0xF5F2", + "0x8E9E": "0xF5F3", + "0x8C78": "0xF5F4", + "0x8C82": "0xF5F5", + "0x8C8A": "0xF5F6", + "0x8C85": "0xF5F7", + "0x8C98": "0xF5F8", + "0x8C94": "0xF5F9", + "0x659B": "0xF5FA", + "0x89D6": "0xF5FB", + "0x89DE": "0xF5FC", + "0x89DA": "0xF5FD", + "0x89DC": "0xF5FE", + "0x89E5": "0xF6A1", + "0x89EB": "0xF6A2", + "0x89EF": "0xF6A3", + "0x8A3E": "0xF6A4", + "0x8B26": "0xF6A5", + "0x9753": "0xF6A6", + "0x96E9": "0xF6A7", + "0x96F3": "0xF6A8", + "0x96EF": "0xF6A9", + "0x9706": "0xF6AA", + "0x9701": "0xF6AB", + "0x9708": "0xF6AC", + "0x970F": "0xF6AD", + "0x970E": "0xF6AE", + "0x972A": "0xF6AF", + "0x972D": "0xF6B0", + "0x9730": "0xF6B1", + "0x973E": "0xF6B2", + "0x9F80": "0xF6B3", + "0x9F83": "0xF6B4", + "0x9F85": "0xF6B5", + "0x9F86": "0xF6B6", + "0x9F87": "0xF6B7", + "0x9F88": "0xF6B8", + "0x9F89": "0xF6B9", + "0x9F8A": "0xF6BA", + "0x9F8C": "0xF6BB", + "0x9EFE": "0xF6BC", + "0x9F0B": "0xF6BD", + "0x9F0D": "0xF6BE", + "0x96B9": "0xF6BF", + "0x96BC": "0xF6C0", + "0x96BD": "0xF6C1", + "0x96CE": "0xF6C2", + "0x96D2": "0xF6C3", + "0x77BF": "0xF6C4", + "0x96E0": "0xF6C5", + "0x928E": "0xF6C6", + "0x92AE": "0xF6C7", + "0x92C8": "0xF6C8", + "0x933E": "0xF6C9", + "0x936A": "0xF6CA", + "0x93CA": "0xF6CB", + "0x938F": "0xF6CC", + "0x943E": "0xF6CD", + "0x946B": "0xF6CE", + "0x9C7F": "0xF6CF", + "0x9C82": "0xF6D0", + "0x9C85": "0xF6D1", + "0x9C86": "0xF6D2", + "0x9C87": "0xF6D3", + "0x9C88": "0xF6D4", + "0x7A23": "0xF6D5", + "0x9C8B": "0xF6D6", + "0x9C8E": "0xF6D7", + "0x9C90": "0xF6D8", + "0x9C91": "0xF6D9", + "0x9C92": "0xF6DA", + "0x9C94": "0xF6DB", + "0x9C95": "0xF6DC", + "0x9C9A": "0xF6DD", + "0x9C9B": "0xF6DE", + "0x9C9E": "0xF6DF", + "0x9C9F": "0xF6E0", + "0x9CA0": "0xF6E1", + "0x9CA1": "0xF6E2", + "0x9CA2": "0xF6E3", + "0x9CA3": "0xF6E4", + "0x9CA5": "0xF6E5", + "0x9CA6": "0xF6E6", + "0x9CA7": "0xF6E7", + "0x9CA8": "0xF6E8", + "0x9CA9": "0xF6E9", + "0x9CAB": "0xF6EA", + "0x9CAD": "0xF6EB", + "0x9CAE": "0xF6EC", + "0x9CB0": "0xF6ED", + "0x9CB1": "0xF6EE", + "0x9CB2": "0xF6EF", + "0x9CB3": "0xF6F0", + "0x9CB4": "0xF6F1", + "0x9CB5": "0xF6F2", + "0x9CB6": "0xF6F3", + "0x9CB7": "0xF6F4", + "0x9CBA": "0xF6F5", + "0x9CBB": "0xF6F6", + "0x9CBC": "0xF6F7", + "0x9CBD": "0xF6F8", + "0x9CC4": "0xF6F9", + "0x9CC5": "0xF6FA", + "0x9CC6": "0xF6FB", + "0x9CC7": "0xF6FC", + "0x9CCA": "0xF6FD", + "0x9CCB": "0xF6FE", + "0x9CCC": "0xF7A1", + "0x9CCD": "0xF7A2", + "0x9CCE": "0xF7A3", + "0x9CCF": "0xF7A4", + "0x9CD0": "0xF7A5", + "0x9CD3": "0xF7A6", + "0x9CD4": "0xF7A7", + "0x9CD5": "0xF7A8", + "0x9CD7": "0xF7A9", + "0x9CD8": "0xF7AA", + "0x9CD9": "0xF7AB", + "0x9CDC": "0xF7AC", + "0x9CDD": "0xF7AD", + "0x9CDF": "0xF7AE", + "0x9CE2": "0xF7AF", + "0x977C": "0xF7B0", + "0x9785": "0xF7B1", + "0x9791": "0xF7B2", + "0x9792": "0xF7B3", + "0x9794": "0xF7B4", + "0x97AF": "0xF7B5", + "0x97AB": "0xF7B6", + "0x97A3": "0xF7B7", + "0x97B2": "0xF7B8", + "0x97B4": "0xF7B9", + "0x9AB1": "0xF7BA", + "0x9AB0": "0xF7BB", + "0x9AB7": "0xF7BC", + "0x9E58": "0xF7BD", + "0x9AB6": "0xF7BE", + "0x9ABA": "0xF7BF", + "0x9ABC": "0xF7C0", + "0x9AC1": "0xF7C1", + "0x9AC0": "0xF7C2", + "0x9AC5": "0xF7C3", + "0x9AC2": "0xF7C4", + "0x9ACB": "0xF7C5", + "0x9ACC": "0xF7C6", + "0x9AD1": "0xF7C7", + "0x9B45": "0xF7C8", + "0x9B43": "0xF7C9", + "0x9B47": "0xF7CA", + "0x9B49": "0xF7CB", + "0x9B48": "0xF7CC", + "0x9B4D": "0xF7CD", + "0x9B51": "0xF7CE", + "0x98E8": "0xF7CF", + "0x990D": "0xF7D0", + "0x992E": "0xF7D1", + "0x9955": "0xF7D2", + "0x9954": "0xF7D3", + "0x9ADF": "0xF7D4", + "0x9AE1": "0xF7D5", + "0x9AE6": "0xF7D6", + "0x9AEF": "0xF7D7", + "0x9AEB": "0xF7D8", + "0x9AFB": "0xF7D9", + "0x9AED": "0xF7DA", + "0x9AF9": "0xF7DB", + "0x9B08": "0xF7DC", + "0x9B0F": "0xF7DD", + "0x9B13": "0xF7DE", + "0x9B1F": "0xF7DF", + "0x9B23": "0xF7E0", + "0x9EBD": "0xF7E1", + "0x9EBE": "0xF7E2", + "0x7E3B": "0xF7E3", + "0x9E82": "0xF7E4", + "0x9E87": "0xF7E5", + "0x9E88": "0xF7E6", + "0x9E8B": "0xF7E7", + "0x9E92": "0xF7E8", + "0x93D6": "0xF7E9", + "0x9E9D": "0xF7EA", + "0x9E9F": "0xF7EB", + "0x9EDB": "0xF7EC", + "0x9EDC": "0xF7ED", + "0x9EDD": "0xF7EE", + "0x9EE0": "0xF7EF", + "0x9EDF": "0xF7F0", + "0x9EE2": "0xF7F1", + "0x9EE9": "0xF7F2", + "0x9EE7": "0xF7F3", + "0x9EE5": "0xF7F4", + "0x9EEA": "0xF7F5", + "0x9EEF": "0xF7F6", + "0x9F22": "0xF7F7", + "0x9F2C": "0xF7F8", + "0x9F2F": "0xF7F9", + "0x9F39": "0xF7FA", + "0x9F37": "0xF7FB", + "0x9F3D": "0xF7FC", + "0x9F3E": "0xF7FD", + "0x9F44": "0xF7FE" +} diff --git a/src/processParser/common/bmp.ts b/src/processParser/common/bmp.ts new file mode 100644 index 0000000..d60ee53 --- /dev/null +++ b/src/processParser/common/bmp.ts @@ -0,0 +1,176 @@ +const decoder = new TextDecoder() +export class BmpDecoder { + pos: number + buffer: ArrayBuffer + is_with_alpha: boolean + bottom_up: boolean + flag: string + constructor(buffer: ArrayBuffer, is_with_alpha: boolean) { + this.pos = 0 + this.buffer = buffer + this.is_with_alpha = !!is_with_alpha + this.bottom_up = true + + this.flag = decoder.decode(this.buffer.slice(0, (this.pos += 2))) + + if (this.flag != 'BM') + throw new Error('Invalid BMP File') + // this.parseHeader(); + // this.parseRGBA(); + } + + parseHeader() {} + parseRGBA() {} +} + +export function createBmpFile( + imgData: ImageData, + paramDic: { [key: string]: string } = {}, +) { + let dpi = 300 + let bitPP = paramDic.bpp ? Number(paramDic.bpp) : 24 + let printResolution = Math.round(dpi * 39.3701) + + if ([1, 24, 32].includes(bitPP) == false) { + throw new Error(`不支持的${bitPP}bpp BMP`) + } + + let data = imgData.data + + let width = imgData.width + let height = imgData.height + let extraBytes = width % 4 + let rgbSize = data.length + switch (bitPP) { + case 1: + { + let rowSize = width / 8 + (width % 8 > 0 ? 1 : 0) + extraBytes = rowSize % 4 + rgbSize = height * (rowSize + extraBytes) + } + break + case 24: + { + let rowSize = 3 * width + extraBytes = rowSize % 4 + rgbSize = height * (rowSize + extraBytes) + } + break + } + let headerInfoSize = 40 + + /** ****************header */ + let flag = 'BM' + let reserved = 0 + let offset = 54 + let fileSize = rgbSize + offset + let planes = 1 + + let compress = 0 + let hr = printResolution + let vr = printResolution + let colors = 0 + let importantColors = 0 + let colorPaletteSize = 0 + if (bitPP == 1) { + colorPaletteSize = 2 * 4 + } + let buffer = new ArrayBuffer(offset + colorPaletteSize + rgbSize) + let tempBuffer = new DataView(buffer) + let pos = 0 + + // BMP Header + // ID + tempBuffer.setUint8(pos, flag.charCodeAt(0)) + pos += 1 + tempBuffer.setUint8(pos, flag.charCodeAt(1)) + pos += 1 + // size + tempBuffer.setUint32(pos, fileSize, true) + pos += 4 + + // Application specific + tempBuffer.setUint32(pos, reserved, true) + pos += 4 + // Offset + tempBuffer.setUint32(pos, offset, true) + pos += 4 + + // DIB Header + // Number of bytes in the DIB header (from this point) + tempBuffer.setUint32(pos, headerInfoSize, true) + pos += 4 + + tempBuffer.setUint32(pos, width, true) + pos += 4 + tempBuffer.setUint32(pos, height, true) + pos += 4 + + tempBuffer.setUint16(pos, planes, true) + pos += 2 + tempBuffer.setUint16(pos, bitPP, true) + pos += 2 + + tempBuffer.setUint16(pos, compress, true) + pos += 4 + + tempBuffer.setUint16(pos, rgbSize, true) + pos += 4 + + tempBuffer.setUint16(pos, hr, true) + pos += 4 + tempBuffer.setUint16(pos, vr, true) + pos += 4 + + tempBuffer.setUint16(pos, colors, true) + pos += 4 + tempBuffer.setUint16(pos, importantColors, true) + pos += 4 + + if (bitPP == 1) { + tempBuffer.setUint8(pos++, 0) // b + tempBuffer.setUint8(pos++, 0) // g + tempBuffer.setUint8(pos++, 0) // r + tempBuffer.setUint8(pos++, 0) // a + + tempBuffer.setUint8(pos++, 255) // b + tempBuffer.setUint8(pos++, 255) // g + tempBuffer.setUint8(pos++, 255) // r + tempBuffer.setUint8(pos++, 0) // a + } + + let pixData = '' + let writeBinData = () => { + tempBuffer.setUint8(pos++, Number.parseInt(pixData.padEnd(8, '0'), 2)) + pixData = '' + } + for (let y = height - 1; y >= 0; y--) { + let rowIndex = y * width * 4 + for (let x = 0; x < width; x++) { + let p = rowIndex + x * 4 + + if (bitPP == 1) { + if (pixData.length == 8) { + writeBinData() + } + let rgb = [data[p + 0], data[p + 1], data[p + 2]] + pixData += rgb.filter((v, i) => v > 170).length == 3 ? '1' : '0' // 170 以下小板缩略图条会断 + } else { + tempBuffer.setUint8(pos++, data[p + 2]) // b + tempBuffer.setUint8(pos++, data[p + 1]) // g + tempBuffer.setUint8(pos++, data[p + 0]) // r + if (bitPP == 32) { + tempBuffer.setUint8(pos++, data[p + 3]) // a + } + } + } + if (bitPP == 1 && pixData.length > 0) { + writeBinData() + } + for (let index = 0; index < extraBytes; index++) { + tempBuffer.setUint8(pos++, 0) + } + } + + return tempBuffer.buffer +} diff --git a/src/processParser/common/core/Container.ts b/src/processParser/common/core/Container.ts new file mode 100644 index 0000000..0b065cc --- /dev/null +++ b/src/processParser/common/core/Container.ts @@ -0,0 +1,399 @@ +import { ClipType, PolyFillType } from 'js-angusj-clipper/web' +import type { Paths } from 'js-angusj-clipper/web' +import type { SubjectInput } from 'js-angusj-clipper/web/clipFunctions' +import { Box2 } from '../Box2' +import { clipperCpp } from '../ClipperCpp' +import type { CompareVectorFn } from '../ComparePoint' +import { ComparePoint } from '../ComparePoint' +import { ConvexHull2D } from '../ConvexHull2D' +import type { NestFiler } from '../Filer' +import type { Point } from '../Point' +import { equaln } from '../Util' +import { Vector2 } from '../Vector2' +import { PlaceType } from '../../vo/enums/PlaceType' +import { NestCache } from './NestCache' +import type { Part } from './Part' +import { PartGroup } from './Part' +import type { Path } from './Path' +import { Area, TranslatePath } from './Path' + +/** + * 当零件尝试放置后容器的状态,用于尝试放置,并且尝试贪心 + */ +interface PartPlacedContainerState +{ + p: Point + area?: number + hull?: Point[] + box?: Box2 +} + +/** + * 排料零件的容器,用来放置零件 + * 它是一块大板 + * 也可以是一个网洞 + * 也可以是余料 + */ +export class Container +{ + ParentId: number = -1// 容器bin来源 -1表示默认的bin,大于等于0表示来自板件网洞 + ChildrenIndex: number = 0// 网洞的索引位置 + ParentM: Point// 在旋转网洞时,和非旋转网洞时表现不一样. (网洞相对于父零件的位置,如果是使用旋转网洞则表示网洞的最下角位置) + + PlacedParts: Part[] = [] + // 放置状态 + PlacedArea = 0 + PlacedBox: Box2 + PlacedHull: Point[] + + StatusKey: string + + CompartePoint: CompareVectorFn + constructor(protected BinPath?: Path, private _PlaceType = PlaceType.Box, compare = 'xy') + { + if (BinPath) + this.StatusKey = `${this.BinPath.Id.toString()},${this._PlaceType}` + + this.CompartePoint = ComparePoint(compare) + } + + get UseRatio(): number + { + return this.PlacedBox.area / this.BinPath.Area + } + + private _NotPuts: Set[] = []// 已经无法放置的pathId + + private PrePut(part: Part): PartPlacedContainerState + { + // 无法容纳 + if (this.BinPath.Area - this.PlacedArea < part.State.Contour.Area) + return + + let cacheKey = `${this.StatusKey},${part.State.Contour.Id}` + let cacheP = NestCache.PositionCache[cacheKey] + // 读取缓存位置 + if (cacheP) + { + NestCache.count1++ + return this.Calc(part, cacheP) + } + + let binNfp = this.BinPath.GetInsideNFP(part.State.Contour) + if (!binNfp || binNfp.length === 0) + return + + // 首个 + if (this.PlacedParts.length === 0) + { + let p = this.GetFarLeftP(binNfp) + NestCache.PositionCache[cacheKey] = p + return this.Calc(part, p) + } + + // 快速退出 + let noSet = NestCache.NoPutCache[this.StatusKey] + if (noSet) + this._NotPuts.push(noSet) + for (let set of this._NotPuts) + { + if (set.has(part.State.Contour.Id)) + { + NestCache.count2++ + return + } + } + + let finalNfp = this.GetNFPs(part, binNfp) + if (!finalNfp || finalNfp.length === 0) + { + if (noSet) + noSet.add(part.State.Contour.Id) + else + { + noSet = new Set([part.State.Contour.Id]) + NestCache.NoPutCache[this.StatusKey] = noSet + } + return + } + + // 选择合适的放置点 + let minArea: number = Number.POSITIVE_INFINITY + let translate: Point + let bestBox: Box2 + let bestHull: Point[] + + let tempVec = new Vector2() + for (let nfp of finalNfp) + { + for (let p of nfp) + { + tempVec.set(p.x * 1e-4, p.y * 1e-4) + switch (this._PlaceType) + { + case PlaceType.Box: + { + let box2 = part.State.Contour.BoundingBox.clone() + box2.translate(tempVec) + let rectBox = this.PlacedBox.clone().union(box2) + let size = rectBox.getSize() + let area = size.x * size.y + if (area < minArea || ((equaln(area, minArea, 1)) && this.CompartePoint(p, translate) === -1)) + { + translate = p + minArea = area + bestBox = rectBox + } + break + } + case PlaceType.Hull: + { + let pts = TranslatePath(part.State.Contour.Points, tempVec) + let nhull = ConvexHull2D([...pts, ...this.PlacedHull]) + let area = Math.abs(Area(nhull)) + if (area < minArea || ((equaln(area, minArea, 1)) && this.CompartePoint(p, translate) === -1)) + { + translate = p + minArea = area + bestHull = nhull + } + break + } + case PlaceType.Gravity: + { + if (!translate || this.CompartePoint(p, translate) === -1) + translate = p + + break + } + default: + break + } + } + } + + if (translate) + { + NestCache.PositionCache[cacheKey] = translate + if (!bestBox) + bestBox = this.PlacedBox.clone().union(part.State.Contour.BoundingBox.clone().translate({ x: translate.x * 1e-4, y: translate.y * 1e-4 })) + return { p: translate, area: minArea, box: bestBox, hull: bestHull } + } + } + + private Calc(part: Part, p: Point): PartPlacedContainerState + { + let d: PartPlacedContainerState = { p } + + let m: Point = { x: p.x * 1e-4, y: p.y * 1e-4 } + + if (this.PlacedBox) + d.box = this.PlacedBox.clone().union(part.State.Contour.BoundingBox.clone().translate(m)) + else + d.box = part.State.Contour.BoundingBox.clone().translate(m) + + // 凸包 + if (this._PlaceType === PlaceType.Hull) + { + if (!this.PlacedHull) + { + d.hull = TranslatePath(part.State.Contour.Points, m) + d.area = part.State.Contour.Area + } + else + { + d.hull = ConvexHull2D([...this.PlacedHull, ...TranslatePath(part.State.Contour.Points, m)]) + d.area = Area(d.hull) + } + + d.area = Math.abs(d.area) + } + else + { + d.area = d.box.area + } + return d + } + + PutPart(p: Part, greedy = false): boolean + { + let bestD: PartPlacedContainerState + if (greedy) + { + let bestI: number + for (let i = 0; i < p.RotatedStates.length; i++) + { + p.StateIndex = i + let d = this.PrePut(p) + if (d && (!bestD || bestD.area > d.area + || ( + this._PlaceType === PlaceType.Hull + && equaln(bestD.area, d.area, 0.1) + && d.box.area < bestD.box.area + ) + )) + { + bestD = d + bestI = i + } + } + if (bestD) + p.StateIndex = bestI + } + else + bestD = this.PrePut(p) + + if (bestD) + { + p.PlacePosition = bestD.p + this.PlacedBox = bestD.box ?? this.PlacedBox + this.PlacedHull = bestD.hull + this.AppendPart(p, false) + return true + } + return false + } + + protected GetNFPs(part: Part, binNfp: Point[][]): Paths + { + // 合并(零件和所有已经放置零件的NFP) + let nfps: SubjectInput[] = [] + for (let placedPart of this.PlacedParts) + { + let nfp = placedPart.State.Contour.GetOutsideNFP(part.State.Contour) + if (!nfp) + return + for (let n of nfp) + { + let nnfp = TranslatePath(n, placedPart.PlacePosition) + nfps.push({ data: nnfp, closed: true }) + } + } + // 合并nfp + let combinedNfp = clipperCpp.lib.clipToPaths({ + subjectInputs: nfps, + clipType: ClipType.Union, + subjectFillType: PolyFillType.NonZero, + }) + + combinedNfp = clipperCpp.lib.cleanPolygons(combinedNfp, 100) + + if (combinedNfp.length === 0) + return + + // 减去nfp + let finalNfp = clipperCpp.lib.clipToPaths({ + subjectInputs: [{ data: binNfp, closed: true }], + clipInputs: [{ data: combinedNfp }], + clipType: ClipType.Difference, + subjectFillType: PolyFillType.NonZero, + }) + finalNfp = clipperCpp.lib.cleanPolygons(finalNfp, 100) + return finalNfp + } + + /** + * 将Part添加的Placed列表 + * @param part 零件,已经计算了放置状态 + * @param [calc] 是否计算当前的容器状态? + */ + private AppendPart(part: Part, calc = true): void + { + this.StatusKey += `,${part.State.Contour.Id}` + this.PlacedParts.push(part) + this.PlacedArea += part.State.Contour.Area + let m = { x: part.PlacePosition.x * 1e-4, y: part.PlacePosition.y * 1e-4 } + if (calc) + { + // 凸包 + if (this._PlaceType === PlaceType.Hull) + { + if (!this.PlacedHull) + this.PlacedHull = TranslatePath(part.State.Contour.Points, m) + else + this.PlacedHull = ConvexHull2D(this.PlacedHull.concat(TranslatePath(part.State.Contour.Points, m))) + } + } + if (calc || this._PlaceType !== PlaceType.Box) + { + if (this.PlacedBox) + this.PlacedBox.union(part.State.Contour.BoundingBox.clone().translate(m)) + else + this.PlacedBox = part.State.Contour.BoundingBox.clone().translate(m) + } + } + + /** + * 得到最左边的点 + */ + protected GetFarLeftP(nfp: Point[][]): Point + { + let leftP: Point + for (let path of nfp) + { + for (let p of path) + { + if (!leftP || this.CompartePoint(p, leftP) === -1) + leftP = p + } + } + return leftP + } + + // #region -------------------------File------------------------- + // 对象从文件中读取数据,初始化自身 + ReadFile(file: NestFiler, parts: Part[]) + { + this.ParentId = file.Read() + this.ChildrenIndex = file.Read() + this.ParentM = file.Read() + let count = file.Read() as number + this.PlacedParts = [] + for (let i = 0; i < count; i++) + { + let index = file.Read() as number + let part = parts[index] + part.StateIndex = file.Read() + part.PlacePosition = file.Read() + this.PlacedParts.push(part) + } + + if (!this.PlacedBox) + this.PlacedBox = new Box2() + this.PlacedBox.min.fromArray(file.Read()) + this.PlacedBox.max.fromArray(file.Read()) + + return this + } + + // 对象将自身数据写入到文件. + WriteFile(file: NestFiler) + { + file.Write(this.ParentId) + file.Write(this.ChildrenIndex) + file.Write(this.ParentM) + + let parts: Part[] = [] + for (let p of this.PlacedParts) + { + if (p instanceof PartGroup) + parts.push(...p.Export()) + else + parts.push(p) + } + + file.Write(parts.length) + for (let p of parts) + { + file.Write(p.Id) + file.Write(p.StateIndex) + file.Write(p.PlacePosition) + } + + if (!this.PlacedBox) + this.PlacedBox = new Box2() + file.Write(this.PlacedBox.min.toArray()) + file.Write(this.PlacedBox.max.toArray()) + } + // #endregion +} diff --git a/src/processParser/common/core/GNestConfig.ts b/src/processParser/common/core/GNestConfig.ts new file mode 100644 index 0000000..b2b7b71 --- /dev/null +++ b/src/processParser/common/core/GNestConfig.ts @@ -0,0 +1,5 @@ +export const GNestConfig = { + RotateHole: true, // 在旋转零件的时候旋转网洞 + UsePartGroup: false, // 如果开启这个特性,将在第一次放置零件时,尝试计算完全对插的板件,并且使用它.(基因注册,模范夫妻) + UseOffsetSimplify: true, +} diff --git a/src/processParser/common/core/Individual.ts b/src/processParser/common/core/Individual.ts new file mode 100644 index 0000000..877126e --- /dev/null +++ b/src/processParser/common/core/Individual.ts @@ -0,0 +1,274 @@ +import { arrayLast, arrayRemoveOnce } from '../ArrayExt' +import type { NestFiler } from '../Filer' +import { RandomIndex } from '../Random' +import type { PlaceType } from '../../vo/enums/PlaceType' +import { Container } from './Container' +import { GNestConfig } from './GNestConfig' +import { DefaultComparePointKeys } from './NestDatabase' +import type { Part } from './Part' +import type { Path } from './Path' + +/** + * 个体(表示某一次优化的结果,或者还没开始优化的状态) + * 个体是由一堆零件组成的,零件可以有不同的状态。 + * + * 个体单独变异 + * 可以是某个零件的旋转状态发生改变 + * 可以是零件的顺序发生改变 + * + * 个体交配(感觉暂时不需要) + * 个体和其他个体进行基因交换 + */ +export class Individual { + constructor(public Parts?: Part[], public mutationRate = 0.5, private bin?: Path, private OddmentsBins: Path[] = [], private ComparePointKeys: string[] = DefaultComparePointKeys) { } + + Fitness: number // (评估健康) 大板个数-1 + 最后一块板的利用率 + Containers: Container[] // 大板列表(已排 + HoleContainers: Container[]// 网洞列表 + OddmentsContainers: Container[]// 余料列表 + /** + * 评估健康程度 + */ + Evaluate(bestCount: number, greedy = false, type?: PlaceType) { + if (GNestConfig.RotateHole) + return this.EvaluateOfUseRotateHole(bestCount, greedy, type) + + this.Containers = [] + this.HoleContainers = [] + // 初始化余料列表 + this.OddmentsContainers = this.OddmentsBins.map(path => new Container(path, type ?? RandomIndex(3), this.ComparePointKeys[RandomIndex(2)])) + this.InitHoleContainers() + + // 余料优先 + let parts = this.Parts.filter(p => !this.OddmentsContainers.some(odd => odd.PutPart(p))) + + // 网洞优先 + parts = parts.filter(p => !this.HoleContainers.some(hole => hole.PutPart(p))) + + while (parts.length > 0) { + if (this.Containers.length > bestCount) { + this.Fitness = Math.ceil(bestCount) + 1 + return + } + const container = new Container(this.bin, type ?? RandomIndex(3), this.ComparePointKeys[RandomIndex(2)]) + if (this.mutationRate > 0.5) // 大板优先,可以提高收敛速度 + { + const maxP = parts.reduce((preP, curP) => preP.State.Contour.Area > curP.State.Contour.Area ? preP : curP) + + const PutGroupF = (): boolean => { + // 基因注册 + const nextPartIndex = parts.findIndex(p => p !== maxP) + if (nextPartIndex !== -1) { + const nextPart = parts[nextPartIndex] + const groups = maxP.ParseGroup(nextPart, this.bin) + for (const group of groups) { + if (container.PutPart(group)) { + parts.splice(nextPartIndex, 1) + arrayRemoveOnce(parts, maxP) + return true + } + } + } + return false + } + if (GNestConfig.UsePartGroup && PutGroupF()) { } + else if (container.PutPart(maxP, greedy)) { arrayRemoveOnce(parts, maxP) } + } + parts = parts.filter(p => !container.PutPart(p, greedy)) + if (!greedy)// 如果没有贪心,排完后在贪心一下 + parts = parts.filter(p => !container.PutPart(p, true)) + this.Containers.push(container) + } + this.Fitness = this.Containers.length - 1 + arrayLast(this.Containers)?.UseRatio ?? 0 + } + + /** + * 在网洞利用时,保持纹路正确 + * + * @param bestCount + * @param greedy + * @param type + */ + private EvaluateOfUseRotateHole(bestCount: number, greedy = false, type?: PlaceType) { + // 初始化余料列表 + this.OddmentsContainers = this.OddmentsBins.map(path => new Container(path, type ?? RandomIndex(3), this.ComparePointKeys[RandomIndex(2)])) + + this.Containers = [] + this.HoleContainers = [] + let parts = this.Parts.concat() + while (parts.length > 0) { + if (this.Containers.length > bestCount)// 提前结束,已经超过最佳用板量 + { + this.Fitness = Math.ceil(bestCount) + 1 + return + } + + const container = new Container(this.bin, type ?? RandomIndex(3), this.ComparePointKeys[RandomIndex(2)]) + const holes: Container[] = [] + const PutPart = (part: Part, greedy: boolean): boolean => { + // 先放置在网洞内 + const isOk + = this.OddmentsContainers.some(oc => oc.PutPart(part, greedy)) // 余料 + || holes.some((h) => { + const isOk = h.PutPart(part, greedy) + return isOk + }) // 网洞 + || container.PutPart(part, greedy) // 大板 + + if (isOk) + this.AppendHoles(part, holes) + + return isOk + } + + if (this.mutationRate > 0.5) // 大板优先,可以提高收敛速度 + { + const maxP = parts.reduce((preP, curP) => preP.State.Contour.Area > curP.State.Contour.Area ? preP : curP) + + const PutGroupF = (): boolean => { + // 基因注册 + const nextPartIndex = parts.findIndex(p => p !== maxP) + if (nextPartIndex !== -1) { + const nextPart = parts[nextPartIndex] + const groups = maxP.ParseGroup(nextPart, this.bin) + for (const group of groups) { + if (PutPart(group, greedy)) { + parts.splice(nextPartIndex, 1) + arrayRemoveOnce(parts, maxP) + return true + } + } + } + return false + } + if (GNestConfig.UsePartGroup && PutGroupF()) { } + else if (PutPart(maxP, greedy)) { arrayRemoveOnce(parts, maxP) } + } + + parts = parts.filter(p => !PutPart(p, greedy)) + if (!greedy)// 如果没有贪心,排完后在贪心一下 + parts = parts.filter(p => !PutPart(p, true)) + + if (container.PlacedParts.length) + this.Containers.push(container) + } + this.Fitness = this.Containers.length - 1 + (arrayLast(this.Containers)?.UseRatio ?? 0) + } + + private AppendHoles(part: Part, holes: Container[]) { + for (let i = 0; i < part.Holes.length; i++) { + const hole = part.Holes[i] + const container = new Container(hole.Contour) + container.ParentId = part.Id + container.ChildrenIndex = i + container.ParentM = GNestConfig.RotateHole ? hole.MinPoint : hole.OrigionMinPoint + this.HoleContainers.push(container) + holes.push(container) + } + } + + private InitHoleContainers() { + if (GNestConfig.RotateHole) + return + for (const part of this.Parts) { + for (let i = 0; i < part.Holes.length; i++) { + const hole = part.Holes[i] + const container = new Container(hole.Contour) + container.ParentId = part.Id + container.ChildrenIndex = i + container.ParentM = GNestConfig.RotateHole ? hole.MinPoint : hole.OrigionMinPoint + this.HoleContainers.push(container) + } + } + } + + Clone() { + const p = new Individual(this.Parts.map(p => p.Clone()), this.mutationRate, this.bin, this.OddmentsBins, this.ComparePointKeys) + p.Mutate() + return p + } + + /** + * 突变 + */ + Mutate() { + if (this.mutationRate > 0.5) { + for (let i = 0; i < this.Parts.length; i++) { + const rand = Math.random() + if (rand < this.mutationRate * 0.5) { + // 和下一个调换顺序 + const j = i + 1 + if (j < this.Parts.length) + [this.Parts[i], this.Parts[j]] = [this.Parts[j], this.Parts[i]] + } + if (rand < this.mutationRate) + this.Parts[i].Mutate() + } + } + else { + // 洗牌 + const rand = Math.random() + if (rand < 0.5) { + const index = RandomIndex(this.Parts.length - 2) + const count = Math.ceil(RandomIndex(this.Parts.length - 2 - index) * this.mutationRate * 2) || 1 + const parts = this.Parts.splice(index, count) + this.Parts.push(...parts) + this.Parts[index].Mutate() + } + else { + for (let i = 0; i < this.Parts.length; i++) { + const rand = Math.random() + if (rand < this.mutationRate) { + this.Parts[i].Mutate() + i += 5 + } + } + } + } + + if (this.mutationRate > 0.2) + this.mutationRate -= 0.004 + return this + } + + // #region -------------------------File------------------------- + + // 对象从文件中读取数据,初始化自身 + ReadFile(file: NestFiler) { + const ver = file.Read()// ver + + this.Fitness = file.Read() + let count = file.Read() as number + this.Containers = [] + for (let i = 0; i < count; i++) + this.Containers.push(new Container().ReadFile(file, this.Parts)) + + count = file.Read() + this.HoleContainers = [] + for (let i = 0; i < count; i++) + this.HoleContainers.push(new Container().ReadFile(file, this.Parts)) + + count = file.Read() + this.OddmentsContainers = [] + for (let i = 0; i < count; i++) + this.OddmentsContainers.push(new Container().ReadFile(file, this.Parts)) + } + + // 对象将自身数据写入到文件. + WriteFile(f: NestFiler) { + f.Write(1)// ver + f.Write(this.Fitness) + f.Write(this.Containers.length) + for (const c of this.Containers) + c.WriteFile(f) + + f.Write(this.HoleContainers.length) + for (const c of this.HoleContainers) + c.WriteFile(f) + + f.Write(this.OddmentsContainers.length) + for (const c of this.OddmentsContainers) + c.WriteFile(f) + } + // #endregion +} diff --git a/src/processParser/common/core/NestCache.ts b/src/processParser/common/core/NestCache.ts new file mode 100644 index 0000000..653ad3c --- /dev/null +++ b/src/processParser/common/core/NestCache.ts @@ -0,0 +1,37 @@ +import type { Point } from '../Point' +import { Path } from './Path' + +export class NestCache +{ + static count1 = 0 + static count2 = 0// noset + + static PositionCache: { [key: string]: Point } = {} + static NoPutCache: { [key: string]: Set } = {} + private static CacheRect = new Map() + + /** + * 用于创建原点在0点的矩形路径 + */ + static CreatePath(x: number, y: number, knifRadius = 3.5): Path + { + let minX = -knifRadius + let maxX = x + knifRadius + let minY = -knifRadius + let maxY = y + knifRadius + return new Path([ + { x: minX, y: minY }, + { x: maxX, y: minY }, + { x: maxX, y: maxY }, + { x: minX, y: maxY }, + ]) + } + + static Clear() + { + this.count1 = 0 + this.count2 = 0 + this.CacheRect.clear() + this.PositionCache = {} + } +} diff --git a/src/processParser/common/core/NestDatabase.ts b/src/processParser/common/core/NestDatabase.ts new file mode 100644 index 0000000..5321dc9 --- /dev/null +++ b/src/processParser/common/core/NestDatabase.ts @@ -0,0 +1,82 @@ +import { NestFiler } from '../Filer' +import { Part } from './Part' +import { Path } from './Path' +import { PathGeneratorSingle } from './PathGenerator' + +export const DefaultComparePointKeys = ['xy', 'yx'] + +/** + * 排料数据库,用这个类来序列化需要排料的数据 + * 用于在Work间传输 + */ +export class NestDatabase { + Bin: Path // 默认的容器 + OddmentsBins: Path[]// 余料容器列表 + Paths: Path[] // 所有的Path都在这里 + Parts: Part[] // 所有的零件 + ComparePointKeys: string[] = DefaultComparePointKeys// 用来决定零件靠边模式 + + // #region -------------------------File------------------------- + // 对象从文件中读取数据,初始化自身 + ReadFile(file: NestFiler) { + const ver = file.Read() + let count = file.Read() as number + this.Paths = [] + for (let i = 0; i < count; i++) { + const path = new Path() + path.ReadFile(file) + this.Paths.push(path) + } + this.Bin = this.Paths[file.Read()] + PathGeneratorSingle.paths = this.Paths + count = file.Read() + this.Parts = [] + for (let i = 0; i < count; i++) { + const part = new Part() + part.ReadFile(file) + this.Parts.push(part) + } + + count = file.Read() + this.OddmentsBins = [] + for (let i = 0; i < count; i++) { + const path = new Path() + path.ReadFile(file) + this.OddmentsBins.push(path) + } + + if (ver > 1) + this.ComparePointKeys = file.Read() + return this + } + + // 对象将自身数据写入到文件. + WriteFile(file: NestFiler) { + file.Write(2) + file.Write(this.Paths.length) + for (const path of this.Paths) + path.WriteFile(file) + + file.Write(this.Bin.Id) + file.Write(this.Parts.length) + for (const part of this.Parts) + part.WriteFile(file) + + if (!this.OddmentsBins) + this.OddmentsBins = [] + file.Write(this.OddmentsBins.length) + for (const path of this.OddmentsBins) + path.WriteFile(file) + + file.Write(this.ComparePointKeys) + + return this + } + // #endregion + + get File() { + const f = new NestFiler() + this.WriteFile(f) + return f + } +} diff --git a/src/processParser/common/core/OptimizeMachine.ts b/src/processParser/common/core/OptimizeMachine.ts new file mode 100644 index 0000000..ac79dd0 --- /dev/null +++ b/src/processParser/common/core/OptimizeMachine.ts @@ -0,0 +1,163 @@ +import { arrayRemoveIf } from '../ArrayExt' +import { clipperCpp } from '../ClipperCpp' +import { Sleep } from '../Sleep' +import { Individual } from './Individual' +import { NestCache } from './NestCache' +import { DefaultComparePointKeys } from './NestDatabase' +import type { Part } from './Part' +import type { Path } from './Path' + +/** + * 优化器 + * 配置优化器 + * 放入零件 + * 按下启动 + * 按下暂停 + * 清理机台 + */ +export class OptimizeMachine { + // 配置 + Config: { + PopulationCount: number// 种群个数 + } + + Bin: Path // 默认的容器 + OddmentsBins: Path[]// 余料容器列表 + Parts: Part[] // 所有的零件 + ComparePointKeys: string[] = DefaultComparePointKeys// 用来决定零件靠边模式 + + // //计算重复的零件 TODO:需要对相同的零件提取出来 + // PartCount: number[] = []; + + private _IsSuspend = false + + protected _Individuals: Individual[]// 个体列表 + + constructor() { + this.Config = { PopulationCount: 50 } + } + + // 放入零件 + PutParts(parts: Part[]) { + if (globalThis.document) + parts = parts.slice() + arrayRemoveIf(parts, p => p.RotatedStates.length === 0) + this.Parts = parts + + // //计算重复的零件(暂时不用) + // for (let part of parts) + // { + // let count = this.PartCount[part.Id]; + // this.PartCount[part.Id] = count === undefined ? 1 : (count + 1); + // } + } + + callBack: (i: Individual) => Promise + + // 启动 + async Start() { + if (this.Parts.length === 0) + return + console.log(this.Parts.length) + this._IsSuspend = false + NestCache.Clear() + this.Parts.sort((p1, p2) => p2.State.Contour.Area - p1.State.Contour.Area) + this._Individuals = [new Individual(this.Parts, 0.8, this.Bin, this.OddmentsBins, this.ComparePointKeys)] + for (let i = 1; i < this.Config.PopulationCount; i++) { + const parts = this.Parts.map(p => p.Clone()) + if (i < 3) { + for (let i = parts.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [parts[i], parts[j]] = [parts[j], parts[i]] + parts[i].Mutate() + } + } + this._Individuals.push(new Individual(parts, 0.8, this.Bin, this.OddmentsBins, this.ComparePointKeys)) + } + // 2.执行 + await this.Run() + } + + calcCount = 0 + best = Number.POSITIVE_INFINITY + bestP: Individual + bestCount = 0 + private async Run() { + console.time('1') + if (this.Parts.length === 0) + return + // 开始自然选择 + while (!this._IsSuspend) // 实验停止信号 + { + const goBack = this.calcCount - this.bestCount > 8000 + // 1.适应环境(放置零件) + for (let i = 0; i < this._Individuals.length; i++) { + if (globalThis.document || !clipperCpp.lib) + await Sleep(0) + const p = this._Individuals[i] + if (this.calcCount < 1000 || this.calcCount % 1000 === 0) + p.Evaluate(this.best, true, i % 3) + else + p.Evaluate(this.best) + + if (!this.bestP || p.Fitness < this.bestP.Fitness) { + this.bestP = p + this.best = p.Fitness + await this.callBack(p) + } + if (goBack) + p.mutationRate = 0.5 + } + + this.calcCount += this._Individuals.length + if (this.calcCount % 100 === 0) { + await Sleep(0) + } + + this._Individuals.sort((i1, i2) => i1.Fitness - i2.Fitness) + const bestP = this._Individuals[0] + // //回调最好的 + // if (bestP.Fitness < this.best) + // { + // this.best = bestP.Fitness; + // this.bestP = bestP; + // // console.timeLog("1", this.best, this.calcCount, NestCache.count1, NestCache.count2); + // if (this.callBack) + // await this.callBack(bestP); + // } + + // 自然选择 + this._Individuals.splice(-10)// 杀死它 + for (let i = 0; i < 4; i++) + this._Individuals.push(bestP.Clone()) + this._Individuals.push(this.bestP.Clone()) + for (let i = 0; i < 3; i++) + this._Individuals.push(this._Individuals[1].Clone()) + for (let i = 0; i < 2; i++) + this._Individuals.push(this._Individuals[2].Clone()) + // 全部突变 + for (const p of this._Individuals) { + if (p.Fitness !== undefined) + p.Mutate() + } + } + } + + // 暂停 + Suspend() { + console.timeEnd('1') + console.log(this.best, this.calcCount, NestCache.count1) + this._IsSuspend = true + console.log('暂停') + } + + // 继续 + Continue() { + this._IsSuspend = false + this.Run() + } + + // 清理机台 + Clear() { + } +} diff --git a/src/processParser/common/core/ParseOddments.ts b/src/processParser/common/core/ParseOddments.ts new file mode 100644 index 0000000..fe00cec --- /dev/null +++ b/src/processParser/common/core/ParseOddments.ts @@ -0,0 +1,238 @@ +import { ClipType, EndType, JoinType, PolyFillType } from 'js-angusj-clipper/web' +import type { ClipInput } from 'js-angusj-clipper/web' +import { Box2 } from '..//Box2' +import { clipperCpp } from '../ClipperCpp' +import type { Container } from './Container' +import { NestCache } from './NestCache' +import { Path, PathScale, TranslatePath, TranslatePath_Self } from './Path' + +const SquarePath = NestCache.CreatePath(60, 60, 0) +const CanPutPaths = [ + NestCache.CreatePath(200, 200, 0), + NestCache.CreatePath(600, 100, 0), + NestCache.CreatePath(100, 600, 0), +] + +/** + * 分析排料结果的余料 + * @param container 排料结果的容器 + * @param binPath 容器的bin + * @param [knifeRadius] 刀半径(以便我们再次偏移) + * @param squarePath 使用一个正方形路径来简化余料轮廓 + * @param canPutPaths 使用可以放置的路径列表来测试余料是否可用,如果可用,则保留 + * @returns Path[] 轮廓的位置存储在OrigionMinPoint中 + */ +export function ParseOddments(container: Container, binPath: Path, knifeRadius: number = 3.5, squarePath: Path = SquarePath, canPutPaths: Path[] = CanPutPaths): Path[] +{ + // 构建轮廓数据 + let partPaths: ClipInput[] = container.PlacedParts.map((part) => + { + // 直接在这里偏移,而不缓存,应该没有性能问题 + let newPts = clipperCpp.lib.offsetToPaths({ + delta: knifeRadius * 1e4, + offsetInputs: [{ data: part.State.Contour.BigIntPoints, joinType: JoinType.Miter, endType: EndType.ClosedPolygon }], + })[0] + + let path = TranslatePath(newPts, { x: part.PlacePosition.x - 5e3, y: part.PlacePosition.y - 5e3 })// 因为移动了0.5,0.5,所以这里也要移动0.5 + return { data: path } + }) + // console.log('构建轮廓数据', partPaths) + // 所有的余料(使用布尔差集) + let oddmentsPolygon = clipperCpp.lib.clipToPolyTree({ + subjectInputs: [{ data: binPath.BigIntPoints, closed: true }], + clipInputs: partPaths, + clipType: ClipType.Difference, + subjectFillType: PolyFillType.NonZero, + }) + + // 现在我们用树状结构,应该不会自交了?(文档写了,返回的结果不可能重叠或者自交) + // 简化结果,避免自交 + // oddmentsPolygon = clipperCpp.lib.simplifyPolygons(oddmentsPolygon); + + function CreatePolygon(minx: number, miny: number, maxx: number, maxy: number) + { + return [ + { x: minx, y: miny }, + { x: maxx, y: miny }, + { x: maxx, y: maxy }, + { x: minx, y: maxy }, + ] + } + + let clipedPaths: Path[] = []// 已经减去网洞投影的余料轮廓列表 + + // 由于手动排版可能造成余料网洞,我们将网洞的盒子投影,然后裁剪余料,避免余料有网洞 + for (let node of oddmentsPolygon.childs) + { + let nodePolygon = node.contour + // 减去网洞 + if (node.childs.length) + { + let box = new Box2().setFromPoints(nodePolygon) + + let childBoxPolygon = node.childs.map((cnode) => + { + let cbox = new Box2().setFromPoints(cnode.contour) + let type = 0// 0左1右2上3下 + let minDist = Number.POSITIVE_INFINITY + + let letftDist = cbox.min.x - box.min.x + let rightDist = box.max.x - cbox.max.x + let topDist = box.max.y - cbox.max.y + let downDist = cbox.min.y - box.min.y + + if (rightDist < letftDist) + { + type = 1 + minDist = rightDist + } + + if (topDist < minDist) + { + type = 2 + minDist = topDist + } + + if (downDist < minDist) + type = 3 + + if (type === 0) + return CreatePolygon(box.min.x, cbox.min.y, cbox.max.x, cbox.max.y) + if (type === 1) + return CreatePolygon(cbox.min.x, cbox.min.y, box.max.x, cbox.max.y) + if (type === 2) + return CreatePolygon(cbox.min.x, cbox.min.y, cbox.max.x, box.max.y) + if (type === 3) + return CreatePolygon(cbox.min.x, box.min.y, cbox.max.x, cbox.max.y) + }) + + let splits = clipperCpp.lib.clipToPaths({ + subjectInputs: [{ data: nodePolygon, closed: true }], + clipInputs: childBoxPolygon.map((polygon) => { return { data: polygon } }), + clipType: ClipType.Difference, + subjectFillType: PolyFillType.NonZero, + }) + + for (let p of splits) + clipedPaths.push(new Path(PathScale(p, 1e-4))) + } + else + clipedPaths.push(new Path(node.contour.map((p) => { return { x: p.x * 1e-4, y: p.y * 1e-4 } }))) + } + + let OddmentsPaths: Path[] = [] + for (let polygonPath of clipedPaths) + { + // 先获取内部的nfp + let insideNFPS = polygonPath.GetInsideNFP(squarePath) + + if (!insideNFPS) + continue + + let beferPolygons: ClipInput[] = [] + + for (let nfp of insideNFPS) + { + let nfpPath = new Path(PathScale(nfp, 1e-4)) + // 通过内部nfp还原实际轮廓 + let sumPolygons = clipperCpp.lib.minkowskiSumPath(nfpPath.BigIntPoints, squarePath.BigIntPoints, true) + sumPolygons = clipperCpp.lib.simplifyPolygons(sumPolygons) + + for (let poly of sumPolygons) + { + if (clipperCpp.lib.area(poly) < 0) + continue// 移除内部的,无意义的 + + let tempPath = new Path(poly.map((p) => { return { x: p.x * 1e-4, y: p.y * 1e-4 } }))// 这里new一个新的,下面就复用这个 + if (canPutPaths.some(p => tempPath.GetInsideNFP(p)?.length))// 能塞的下指定的轮廓才会被留下 + { + if (beferPolygons.length) + { + // 移动到实际位置 + TranslatePath_Self(poly, (polygonPath.OrigionMinPoint.x + nfpPath.OrigionMinPoint.x) * 1e4, (polygonPath.OrigionMinPoint.y + nfpPath.OrigionMinPoint.y) * 1e4) + + // 在这里裁剪之前的余料轮廓 + let tree = clipperCpp.lib.clipToPolyTree({ + subjectInputs: [{ data: poly, closed: true }], + clipInputs: beferPolygons, + clipType: ClipType.Difference, + subjectFillType: PolyFillType.NonZero, + }) + + for (let node of tree.childs) + { + if (node.childs.length) + continue + + tempPath = new Path(node.contour.map((p) => { return { x: p.x * 1e-4, y: p.y * 1e-4 } })) + + // 继续简化 + tempPath = SimplifyPathOfSqPath(tempPath, squarePath) + + if (!tempPath) + continue + + OddmentsPaths.push(tempPath) + + // 偏移2把刀 + let offsetedPolygon = clipperCpp.lib.offsetToPaths({ + delta: knifeRadius * 2e4, + offsetInputs: [{ data: node.contour, joinType: JoinType.Miter, endType: EndType.ClosedPolygon }], + })[0] + beferPolygons.push({ data: offsetedPolygon })// 用于裁剪后续的余料 + } + } + else + { + // 设置轮廓的位置 + tempPath.OrigionMinPoint.x += nfpPath.OrigionMinPoint.x + polygonPath.OrigionMinPoint.x + tempPath.OrigionMinPoint.y += nfpPath.OrigionMinPoint.y + polygonPath.OrigionMinPoint.y + OddmentsPaths.push(tempPath) + + // 将余料轮廓加入到裁剪轮廓中,用于裁剪后续的余料 + if (insideNFPS.length) + { + // 移动到实际位置 + TranslatePath_Self(poly, (polygonPath.OrigionMinPoint.x + nfpPath.OrigionMinPoint.x) * 1e4, (polygonPath.OrigionMinPoint.y + nfpPath.OrigionMinPoint.y) * 1e4) + // 偏移2把刀 + let offsetedPolygon = clipperCpp.lib.offsetToPaths({ + delta: knifeRadius * 2e4, + offsetInputs: [{ data: poly, joinType: JoinType.Miter, endType: EndType.ClosedPolygon }], + })[0] + beferPolygons.push({ data: offsetedPolygon })// 用于裁剪后续的余料 + } + } + } + } + } + } + // console.log('ParseOddments end', OddmentsPaths) + return OddmentsPaths +} + +// 使用矩形轮廓来简化余料轮廓(通常一进一出) +function SimplifyPathOfSqPath(polygonPath: Path, sqPath: Path): Path | undefined +{ + // 先获取内部的nfp + let insideNFPS = polygonPath.GetInsideNFP(sqPath) + if (insideNFPS.length > 0)// 目前一般只有1个,不知道会不会有多个 + { + let nfp = insideNFPS[0] + let nfpPath = new Path(PathScale(nfp, 1e-4)) + // 通过内部nfp还原实际轮廓 + let sumPolygons = clipperCpp.lib.minkowskiSumPath(nfpPath.BigIntPoints, sqPath.BigIntPoints, true) + sumPolygons = clipperCpp.lib.simplifyPolygons(sumPolygons) + + for (let poly of sumPolygons)// 通常是一个内部的+一个外部的 + { + if (clipperCpp.lib.area(poly) < 0) + continue// 移除内部的,无意义的 + + let tempPath = new Path(PathScale(poly, 1e-4)) + + tempPath.OrigionMinPoint.x += nfpPath.OrigionMinPoint.x + polygonPath.OrigionMinPoint.x + tempPath.OrigionMinPoint.y += nfpPath.OrigionMinPoint.y + polygonPath.OrigionMinPoint.y + return tempPath + } + } +} diff --git a/src/processParser/common/core/Part.ts b/src/processParser/common/core/Part.ts new file mode 100644 index 0000000..bda223e --- /dev/null +++ b/src/processParser/common/core/Part.ts @@ -0,0 +1,394 @@ +import type { Box2 } from '../Box2' +import type { NestFiler } from '../Filer' +import type { Point } from '../Point' +import { RandomIndex } from '../Random' +import { FixIndex } from '../Util' +import { Vector2 } from '../Vector2' +import { GNestConfig } from './GNestConfig' +import { NestCache } from './NestCache' +import { PartState } from './PartState' +import { Path } from './Path' +import { PathGeneratorSingle } from './PathGenerator' + +const EmptyArray = [] + +/** + * 零件类 + * 零件类可以绑定数据,也存在位置和旋转状态的信息 + * + * 初始化零件: + * 传入零件的轮廓,刀半径,包围容器(或者为空?) + * 初始化用于放置的轮廓。将轮廓首点移动到0点,记录移动的点P。 + * + * 零件放置位置: + * 表示零件轮廓首点的位置。 + * + * 零件的旋转: + * 表示零件轮廓按照首点(0)旋转。 + * + * 还原零件的放置状态: + * 同样将零件移动到0点 + * 同样将零件旋转 + * 同样将零件移动到指定的位置 + * 零件可能处于容器中,变换到容器坐标系 + * + */ +export class Part +{ + Id: number// 用于确定Part的唯一性,并且有助于在其他Work中还原 + private _Holes: PartState[] = [] + _RotateHoles: PartState[][] = [] + // 零件的不同旋转状态,这个数组会在所有的状态间共享,以便快速切换状态 + StateIndex = 0 // 旋转状态 + RotatedStates: PartState[] = []// 可能的旋转状态列表 + PlacePosition: Point // 放置位置(相对于容器的位置) + + HolePosition: Point// + + // #region 临时数据(不会被序列化到优化线程) + UserData: T// 只用于还原零件的显示状态(或者关联到实际数据) + Parent: Part// 如果这个零件放置在了网洞中,这个Parent表示这个网洞所属的零件,我们可以得到这个零件的放置信息,并且可以从Container中的ParentM得到网洞相对于零件的位置 + PlaceCS: Matrix// 放置矩阵 Matrix4 + PlaceIndex: number// 放置的大板索引 + // #endregion + + GroupMap: { [key: number]: Part[] } = {} + get State(): PartState // 零件当前的状态 + { + return this.RotatedStates[this.StateIndex] + } + + get Holes(): PartState[] + { + if (GNestConfig.RotateHole) + return this._RotateHoles[this.StateIndex] || EmptyArray + return this._Holes + } + + // 初始化零件的各个状态,按360度旋转个数 + Init(path: Path, bin: Path, rotateCount = 4): this + { + let rotations: number[] = [] + let a = 2 * Math.PI / rotateCount + for (let i = 0; i < rotateCount; i++) + { + rotations.push(a * i) + } + this.Init2(path, bin, rotations) + return this + } + + // 初始化零件的各个状态,按旋转角度表 + Init2(path: Path, bin: Path, rotations: number[] = []): this + { + let pathP = path.OrigionMinPoint + let path_0 = PathGeneratorSingle.Allocate(path) + let pathSet = new Set() + + // 初始化零件的状态集合 + for (let pa of rotations) + { + let partState = new PartState() + partState.Rotation = pa + if (pa === 0) + { + partState.Contour = path_0 + partState.OrigionMinPoint = pathP + partState.MinPoint = path.OrigionMinPoint + } + else + { + let path_r = new Path(path.Points, pa) + partState.Contour = PathGeneratorSingle.Allocate(path_r) + partState.Contour.Area = path_0.Area + // 避免重复的Path进入State + if (pathSet.has(partState.Contour)) + continue + let p0 = path_r.OrigionMinPoint + let c = Math.cos(-pa) + let s = Math.sin(-pa) + let x1 = p0.x * c - p0.y * s + let y1 = p0.x * s + p0.y * c + partState.OrigionMinPoint = new Vector2(pathP.x + x1, pathP.y + y1) + + // 计算正确的最小点 + let tempPath = new Path(path.OrigionPoints, pa) + partState.MinPoint = tempPath.OrigionMinPoint + } + // 记录已有Path + pathSet.add(partState.Contour) + // 必须能放置 + if (bin.GetInsideNFP(partState.Contour)) + { + this.RotatedStates.push(partState) + PathGeneratorSingle.RegisterId(partState.Contour) + } + } + + // 为了复用NFP,不管第0个Path是否可用,都注册它. + if (this.RotatedStates.length > 4) + PathGeneratorSingle.RegisterId(path_0) + return this + } + + ParseGroup(partOther: Part, bin: Path): Part[] + { + let arr = this.GroupMap[partOther.Id] + if (arr) + return arr + + arr = [] + if (this.Holes.length || partOther.Holes.length) + return arr + this.GroupMap[partOther.Id] = arr + if (this.State.Contour.IsRect || partOther.State.Contour.IsRect) + return arr + if (this.State.Contour.Area > this.State.Contour.BoundingBox.area * 0.9) + return arr + if (partOther.State.Contour.Area > partOther.State.Contour.BoundingBox.area * 0.9) + return arr + + for (let i = 0; i < this.RotatedStates.length; i++) + { + let s1 = this.RotatedStates[i] + for (let j = 1; j < partOther.RotatedStates.length; j++) + { + let s2 = partOther.RotatedStates[j] + let nfps = s1.Contour.GetOutsideNFP(s2.Contour) + for (let nfp of nfps) + { + for (let k = 0; k < nfp.length * 2; k++) + { + let p: Point + if (k % 2 === 0) + { + p = { ...nfp[k / 2] } + } + else + { + let p1 = nfp[FixIndex(k / 2 - 0.5, nfp)] + let p2 = nfp[FixIndex(k / 2 + 0.5, nfp)] + p = { x: p1.x + p2.x, y: p1.y + p2.y } + p.x *= 0.5 + p.y *= 0.5 + } + p.x *= 1e-4 + p.y *= 1e-4 + + let newBox = s2.Contour.BoundingBox.clone().translate(p) + newBox.union(s1.Contour.BoundingBox) + + if (newBox.area < (s1.Contour.Area + s2.Contour.Area) * 1.3) + { + let partGroup = new PartGroup(this, partOther, i, j, p, newBox, bin) + if (partGroup.RotatedStates.length > 0 + && !arr.some(p => p.State.Contour === partGroup.State.Contour)// 类似的 + ) + { + arr.push(partGroup) + return arr + } + } + } + } + } + } + return arr + } + + // 添加网洞 + AppendHole(path: Path) + { + let hole = new PartState() + hole.Contour = PathGeneratorSingle.Allocate(path) + PathGeneratorSingle.RegisterId(hole.Contour) + hole.OrigionMinPoint = path.OrigionMinPoint + hole.Rotation = 0 + this._Holes.push(hole) + + if (GNestConfig.RotateHole) + for (let i = 0; i < this.RotatedStates.length; i++) + { + let r = this.RotatedStates[i].Rotation + let arr = this._RotateHoles[i] + if (!arr) + { + arr = [] + this._RotateHoles[i] = arr + } + + if (r === 0) + { + hole.MinPoint = path.OrigionMinPoint + arr.push(hole) + } + else + { + let newPath = new Path(path.Points, r) + let newHole = new PartState() + newHole.Rotation = r + newHole.Contour = PathGeneratorSingle.Allocate(newPath) + PathGeneratorSingle.RegisterId(newHole.Contour) + newHole.OrigionMinPoint = newPath.OrigionMinPoint + + // 计算正确的最小点 + let tempPath = new Path(path.OrigionPoints, r) + newHole.MinPoint = tempPath.OrigionMinPoint + + arr.push(newHole) + } + } + } + + // TODO:因为现在实现的是左右翻转,所以会出现角度匹配不完全的问题(缺失上下翻转) + Mirror(doubleFace: boolean) + { + let states = this.RotatedStates + let holes = this._Holes + let roholes = this._RotateHoles + if (!doubleFace) + { + this.RotatedStates = [] + this._Holes = [] + this._RotateHoles = [] + } + let count = states.length + for (let i = 0; i < count; i++) + { + let s = states[i] + let ns = s.Mirror() + if (ns && !this.RotatedStates.some(state => state.Contour === s.Contour)) + { + this.RotatedStates.push(ns) + + if (this._Holes.length > 0) + this._Holes.push(holes[i].Mirror()) + + if (this._RotateHoles.length > 0) + this._RotateHoles.push(roholes[i].map(s => s.Mirror())) + } + } + } + + // 浅克隆 + Clone() + { + let part = new Part() + part.Id = this.Id + part.UserData = this.UserData + part.RotatedStates = this.RotatedStates + part.StateIndex = this.StateIndex + part._Holes = this._Holes + part._RotateHoles = this._RotateHoles + return part + } + + // 旋转起来,改变自身旋转状态(变异) + Mutate(): this + { + this.StateIndex = RandomIndex(this.RotatedStates.length, this.StateIndex) + return this + } + + // #region -------------------------File------------------------- + ReadFile(file: NestFiler) + { + this.Id = file.Read() + let count = file.Read() as number + this.RotatedStates = [] + for (let i = 0; i < count; i++) + { + let state = new PartState() + state.ReadFile(file) + this.RotatedStates.push(state) + } + + // 无旋转网洞 + count = file.Read() + this._Holes = [] + for (let i = 0; i < count; i++) + { + let state = new PartState() + state.ReadFile(file) + this._Holes.push(state) + } + + // 旋转网洞 + count = file.Read() + this._RotateHoles = [] + for (let i = 0; i < count; i++) + { + let count2 = file.Read() as number + + let holes: PartState[] = [] + for (let j = 0; j < count2; j++) + { + let state = new PartState() + state.ReadFile(file) + holes.push(state) + } + this._RotateHoles.push(holes) + } + } + + WriteFile(file: NestFiler) + { + file.Write(this.Id) + file.Write(this.RotatedStates.length) + for (let state of this.RotatedStates) + state.WriteFile(file) + + // 非旋转网洞 + file.Write(this._Holes.length) + for (let hole of this._Holes) + hole.WriteFile(file) + + // 写入旋转网洞 + file.Write(this._RotateHoles.length) + for (let holes of this._RotateHoles) + { + file.Write(holes.length) + for (let hole of holes) + { + hole.WriteFile(file) + } + } + } + // #endregion +} + +// 零件组合 +export class PartGroup extends Part +{ + constructor(public part1: Part, + public part2: Part, + public index1: number, + public index2: number, + public p: Point, + public box: Box2, + bin: Path, + ) + { + super() + let size = box.getSize(new Vector2()) + this.Init2(NestCache.CreatePath(size.x, size.y, 0), bin, [0]) + } + + Export(): Part[] + { + this.part1.StateIndex = this.index1 + this.part2.StateIndex = this.index2 + + this.part1.PlacePosition = { + x: this.PlacePosition.x - this.box.min.x * 1e4, + y: this.PlacePosition.y - this.box.min.y * 1e4, + } + + this.part2.PlacePosition = { + x: this.PlacePosition.x - this.box.min.x * 1e4 + this.p.x * 1e4, + y: this.PlacePosition.y - this.box.min.y * 1e4 + this.p.y * 1e4, + } + + return [this.part1, this.part2] + } +} diff --git a/src/processParser/common/core/PartState.ts b/src/processParser/common/core/PartState.ts new file mode 100644 index 0000000..fe976c7 --- /dev/null +++ b/src/processParser/common/core/PartState.ts @@ -0,0 +1,61 @@ +import type { Point } from '../Point' +import type { NestFiler } from '../Filer' +import { Path } from './Path' +import { PathGeneratorSingle } from './PathGenerator' + +/** + * 用于存放零件旋转后的状态 + * 记录了用于放置时的轮廓。该轮廓总是首点等于0,便于放置时的计算。 + */ +export class PartState +{ + Rotation: number + OrigionMinPoint: Point// 使用 Rotation(O - OrigionMinPoint) 将零件变换到和排料矩形状态相同的状态,然后使用PlacePoint(O)将零件设置到正确的状态 + + MinPoint: Point// 这个状态下的最小点 + Contour: Path// 轮廓 + + IsMirror: boolean = false + MirrorOriginMinPoint: Point + + Mirror(): PartState + { + if (this.Contour.IsRect) + return + + let mpts = this.Contour.Points.map((p) => { return { x: -p.x, y: p.y } }).reverse() + let path = new Path(mpts, 0) + let partState = new PartState() + partState.Contour = PathGeneratorSingle.Allocate(path) + PathGeneratorSingle.RegisterId(partState.Contour) + partState.Rotation = this.Rotation + partState.OrigionMinPoint = this.OrigionMinPoint + partState.MinPoint = this.MinPoint + partState.IsMirror = true + partState.MirrorOriginMinPoint = path.OrigionMinPoint + return partState + } + + // #region -------------------------File------------------------- + ReadFile(file: NestFiler) + { + this.Rotation = file.Read() + this.OrigionMinPoint = file.Read() + this.MinPoint = file.Read() + + let index = file.Read() as number + this.Contour = PathGeneratorSingle.paths[index] + + if (!this.Contour) + console.error('无法得到PartState的轮廓!') + } + + WriteFile(file: NestFiler) + { + file.Write(this.Rotation) + file.Write(this.OrigionMinPoint) + file.Write(this.MinPoint) + file.Write(this.Contour.Id) + } + // #endregion +} diff --git a/src/processParser/common/core/Path.ts b/src/processParser/common/core/Path.ts new file mode 100644 index 0000000..093fc73 --- /dev/null +++ b/src/processParser/common/core/Path.ts @@ -0,0 +1,381 @@ +import { Box2 } from '../Box2.js' +import { clipperCpp } from '../ClipperCpp.js' +import type { NestFiler } from '../Filer.js' +import type { Point } from '../Point.js' +import { equaln } from '../Util.js' +import { Vector2 } from '../Vector2.js' + +/** + * 轮廓路径类 + * 可以求NFP,和保存NFPCahce + * 因为NFP结果是按照最低点移动的,所以将点旋转后,按照盒子将点移动到0点. + */ +export class Path +{ + Id: number + Points: Point[] + OutsideNFPCache: { [key: number]: Point[][] } = {} + InsideNFPCache: { [key: number]: Point[][] } = {} + + constructor(public OrigionPoints?: Point[], rotation: number = 0) + { + if (OrigionPoints) + this.Init(OrigionPoints, rotation) + } + + Origion: Path + // 点表在旋转后的原始最小点.使用这个点将轮廓移动到0点 + OrigionMinPoint: Vector2 + Rotation: number + + Size: Vector2// 序列化 + private Init(origionPoints: Point[], rotation: number) + { + this.Rotation = rotation + if (rotation === 0) + this.Points = origionPoints.map((p) => { return { ...p } }) + else + { + let c = Math.cos(rotation) + let s = Math.sin(rotation) + + let npts: Point[] = [] + for (let p of origionPoints) + { + let x = p.x + let y = p.y + const x1 = x * c - y * s + const y1 = x * s + y * c + npts.push({ x: x1, y: y1 }) + } + this.Points = npts + } + + let box = new Box2() + let v2 = new Vector2() + for (let p of this.Points) + { + v2.x = p.x + v2.y = p.y + box.expandByPoint(v2) + } + + this.OrigionMinPoint = box.min + this.Size = box.max.sub(box.min) + + for (let p of this.Points) + { + p.x -= box.min.x + p.y -= box.min.y + } + } + + GetNFPs(path: Path, outside: boolean): Point[][] + { + // 寻找内轮廓时,面积应该比本path小,这个判断移交给使用者自己判断 + // if (!outside && this.Area < path.Area) return []; + let nfps = clipperCpp.lib.minkowskiSumPath(this.BigIntPoints, path.MirrorPoints, true) + + // 必须删除自交,否则将会出错 + nfps = clipperCpp.lib.simplifyPolygons(nfps) + nfps = nfps.filter((nfp) => + { + let area = Area(nfp) + // if (area > 1) return outside;//第一个不一定是外轮廓,但是面积为正时肯定为外轮廓 (因为使用了简化多段线,所以这个代码已经不能有了) + if (Math.abs(area) < 10) + return false// 应该不用在移除这个了 + + let { x, y } = nfp[0] + if (outside) + { + if (this.Area > path.Area) + { + let p = { x: path.InPoint.x + x, y: path.InPoint.y + y } + if (p.x < 0 || p.y < 0 || p.x > this.BigSize.x || p.y > this.BigSize.y) + return true + let dir = clipperCpp.lib.pointInPolygon(p, this.BigIntPoints) + return dir === 0 + } + else + { + let p = { x: this.InPoint.x - x, y: this.InPoint.y - y } + if (p.x < 0 || p.y < 0 || p.x > path.BigSize.x || p.y > path.BigSize.y) + return true + let dir = clipperCpp.lib.pointInPolygon(p, path.BigIntPoints) + return dir === 0 + } + } + else + { + let p = { x: path.InPoint.x + x, y: path.InPoint.y + y } + if (p.x < 0 || p.y < 0 || p.x > this.BigSize.x || p.y > this.BigSize.y) + return false + let dir = clipperCpp.lib.pointInPolygon(p, this.BigIntPoints) + return dir === 1 + } + }) + return nfps + } + + GetOutsideNFP(path: Path): Point[][] + { + let nfps = this.OutsideNFPCache[path.Id] + if (nfps) + return nfps + + if (this.IsRect && path.IsRect) + { + let [ax, ay] = [this.Size.x * 1e4, this.Size.y * 1e4] + let [bx, by] = [path.Size.x * 1e4, path.Size.y * 1e4] + nfps = [[ + { x: -bx, y: -by }, + { x: ax, y: -by }, + { x: ax, y: ay }, + { x: -bx, y: ay }, + ]] + } + else + nfps = this.GetNFPs(path, true) + this.OutsideNFPCache[path.Id] = nfps + // 虽然有这种神奇的特性,但是好像并不会提高性能。 + // path.OutsideNFPCache[this.id] = (this, nfps.map(nfp => + // { + // return nfp.map(p => + // { + // return { x: -p.x, y: -p.y }; + // }); + // })); + return nfps + } + + GetInsideNFP(path: Path): Point[][] + { + if (path.Area > this.Area) + return + let nfp = this.InsideNFPCache[path.Id] + if (nfp) + return nfp + + let nfps: Point[][] + if (this.IsRect) + { + let [ax, ay] = [this.Size.x * 1e4, this.Size.y * 1e4] + let [bx, by] = [path.Size.x * 1e4, path.Size.y * 1e4] + + let l = ax - bx + let h = ay - by + + const MinNumber = 200// 清理的数值是100,所以200是可以接受的, 200=0.020问题不大(过盈配合) + if (l < -MinNumber || h < -MinNumber) + return + + if (l < MinNumber) + l = MinNumber + else + l += MinNumber + + if (h < MinNumber) + h = MinNumber + else + h += MinNumber + + nfps = [[ + { x: 0, y: 0 }, + { x: l, y: 0 }, + { x: l, y: h }, + { x: 0, y: h }, + ]] + } + else + nfps = this.GetNFPs(path, false) + + if (path.Id !== undefined) + this.InsideNFPCache[path.Id] = nfps + return nfps + } + + private _InPoint: Point + + /** + * 用这个点来检测是否在Path内部 + */ + private get InPoint() + { + if (this._InPoint) + return this._InPoint + let mp = { x: (this.Points[0].x + this.Points[1].x) / 2, y: (this.Points[0].y + this.Points[1].y) / 2 } + let normal = new Vector2(this.Points[1].x - this.Points[0].x, this.Points[1].y - this.Points[0].y).normalize() + // [normal.x, normal.y] = [normal.y, -normal.x]; + mp.x -= normal.y + mp.y += normal.x + + mp.x *= 1e4 + mp.y *= 1e4 + this._InPoint = mp + return mp + } + + protected _BigIntPoints: Point[] + get BigIntPoints() + { + if (this._BigIntPoints) + return this._BigIntPoints + this._BigIntPoints = this.Points.map((p) => + { + return { + x: Math.round(p.x * 1e4), + y: Math.round(p.y * 1e4), + } + }) + return this._BigIntPoints + } + + private _BigSize: Vector2 + get BigSize() + { + if (this._BigSize) + return this._BigSize + this._BigSize = new Vector2(this.Size.x * 1e4, this.Size.y * 1e4) + return this._BigSize + } + + protected _MirrorPoints: Point[] + get MirrorPoints() + { + if (!this._MirrorPoints) + this._MirrorPoints = this.BigIntPoints.map((p) => + { + return { x: -p.x, y: -p.y } + }) + + return this._MirrorPoints + } + + protected _BoundingBox: Box2 + get BoundingBox() + { + if (!this._BoundingBox) + { + this._BoundingBox = new Box2(new Vector2(), this.Size) + } + return this._BoundingBox + } + + protected _Area: number + get Area() + { + if (this._Area === undefined) + this._Area = Area(this.Points) + return this._Area + } + + set Area(a: number) + { + this._Area = a + } + + private _IsRect: boolean + get IsRect() + { + if (this._IsRect === undefined) + { + let s = this.BoundingBox.getSize(new Vector2()) + this._IsRect = equaln(this.Area, s.x * s.y, 1) + } + return this._IsRect + } + + ReadFile(file: NestFiler): void + { + let ver = file.Read() + this.Id = file.Read() + let arr = file.Read() + this.Points = [] + for (let i = 0; i < arr.length; i += 2) + { + let p = { x: arr[i], y: arr[i + 1] } + this.Points.push(p) + } + + this.Size = new Vector2(file.Read(), file.Read()) + this._Area = file.Read() + let id = file.Read() + if (id !== -1) + { + this.Origion = id + this.Rotation = file.Read() + this.OrigionMinPoint = new Vector2(file.Read(), file.Read()) + } + } + + WriteFile(file: NestFiler): void + { + file.Write(1)// ver + file.Write(this.Id) + let arr: number[] = [] + for (let p of this.Points) + arr.push(p.x, p.y) + file.Write(arr) + + file.Write(this.Size.x) + file.Write(this.Size.y) + file.Write(this._Area) + if (this.Origion && this.Origion.Id) + { + // 如果有原始的id,则传递它,以便后续进行NFP复用. + file.Write(this.Origion.Id) + file.Write(this.Rotation) + file.Write(this.OrigionMinPoint.x) + file.Write(this.OrigionMinPoint.y) + } + else + file.Write(-1) + } +} + +// 点表面积 +export function Area(pts: Point[]): number +{ + let cnt = pts.length + if (cnt < 3) + return 0 + let a = 0 + for (let i = 0, j = cnt - 1; i < cnt; ++i) + { + a += (pts[j].x + pts[i].x) * (pts[j].y - pts[i].y) + j = i + } + return -a * 0.5 +} + +/** + * 平移点表,返回新点表 + */ +export function TranslatePath(pts: Point[], p: Point): Point[] +{ + return pts.map((px) => + { + return { x: p.x + px.x, y: p.y + px.y } + }) +} + +export function TranslatePath_Self(pts: Point[], mx: number, my: number): Point[] +{ + for (let pt of pts) + { + pt.x += mx + pt.y += my + } + return pts +} + +// 缩放点表,返回原始点表 +export function PathScale(pts: Point[], scale: number): Point[] +{ + for (let p of pts) + { + p.x *= scale + p.y *= scale + } + return pts +} diff --git a/src/processParser/common/core/PathGenerator.ts b/src/processParser/common/core/PathGenerator.ts new file mode 100644 index 0000000..7a5381a --- /dev/null +++ b/src/processParser/common/core/PathGenerator.ts @@ -0,0 +1,87 @@ +import { FixIndex, equaln } from '../Util' +import type { Path } from './Path' + +/** + * 轮廓路径构造器 + * 传递一组简化后的点表过来,如果已经有同样的点表时,返回已经生产的Path,避免重复产生Path。 + * 使用相同的PATH有复用路径缓存。 + * + * 每次进行优化时,必须清理构造器,保证Path生成是对本次优化唯一。 + */ +class PathGenerator +{ + paths: Path[] = [] + pathAreaMap: { [key: string]: Path[] } = {} + + // 缓存命中次数 + cacheCount = 0 + + /** + * 如果存在同样的轮廓,则返回已经构造的轮廓, + * 如果没有,则返回自身,并且注册它。 + * 如果id没有被注册,那么证明它无法放置在bin中 + */ + Allocate(path: Path): Path + { + let area = path.Area.toFixed(0) + let paths = this.pathAreaMap[area] + if (paths) + { + for (let ps of paths) + { + if (EqualPath(ps, path)) + { + this.cacheCount++ + return ps + } + } + paths.push(path) + } + else + this.pathAreaMap[area] = [path] + return path + } + + RegisterId(path: Path) + { + if (path.Id === undefined) + { + path.Id = this.paths.length + this.paths.push(path) + } + } + + Clear() + { + this.paths = [] + this.pathAreaMap = {} + this.cacheCount = 0 + } +} + +/** + * 两路径相等,点表个数相等且每个点都相似 + */ +function EqualPath(path1: Path, path2: Path): boolean +{ + if (path1.Points.length !== path2.Points.length) + return false + + let p0 = path1.Points[0] + let p2Index = path2.Points.findIndex((p) => + { + return equaln(p.x, p0.x, 1e-3) && equaln(p.y, p0.y, 1e-3) + }) + + for (let i = 0; i < path1.Points.length; i++) + { + let p1 = path1.Points[i] + let p2 = path2.Points[FixIndex(p2Index + i, path2.Points)] + + if (!equaln(p1.x, p2.x, 1e-4) || !equaln(p1.y, p2.y, 1e-4)) + return false + } + return true +} + +export const PathGeneratorSingle = new PathGenerator() diff --git a/src/processParser/common/core/PlaceType.ts b/src/processParser/common/core/PlaceType.ts new file mode 100644 index 0000000..6322309 --- /dev/null +++ b/src/processParser/common/core/PlaceType.ts @@ -0,0 +1,11 @@ + +/**排牌类型:Hull=0凸包模式 (凸包面积) Box=1盒子模式 (长x宽) Gravity=2重力模式(重力) */ +export enum PlaceType +{ + /**凸包模式 (凸包面积) */ + Hull = 0, + /**盒子模式 (长乘以宽) */ + Box = 1, + /**重力模式(重力) */ + Gravity = 2 +} diff --git a/src/processParser/common/decorators/json.ts b/src/processParser/common/decorators/json.ts new file mode 100644 index 0000000..0f27000 --- /dev/null +++ b/src/processParser/common/decorators/json.ts @@ -0,0 +1,31 @@ +import 'reflect-metadata' + +export const jsonOptionMataDataKey = Symbol('JsonOptions') + +export enum JsonOptionType + { + Ignore = 0, + Property = 1, +} + +export class JsonOption +{ + constructor(type: JsonOptionType, data: any = null) + { + this.type = type + this.data = data + } + + type: JsonOptionType + data: any +} + +export function jsonProperty(key: string | number) +{ + return Reflect.metadata(jsonOptionMataDataKey, new JsonOption(JsonOptionType.Property, { key })) +} + +export function jsonIgnore() +{ + return Reflect.metadata(jsonOptionMataDataKey, new JsonOption(JsonOptionType.Ignore)) +} diff --git a/src/processParser/common/decorators/model.ts b/src/processParser/common/decorators/model.ts new file mode 100644 index 0000000..a6d99de --- /dev/null +++ b/src/processParser/common/decorators/model.ts @@ -0,0 +1,39 @@ +import 'reflect-metadata' + +const displayMetadataKey = Symbol('display') + +export function display( + name: string, + group: string = '', + type: string = 'color', +) +{ + return Reflect.metadata(displayMetadataKey, { + name, + group, + type, + }) +} + +export function getDisplayInfo(target: any) +{ + let keys = Object.getOwnPropertyNames(target) + let list = [] + keys.forEach((key) => + { + let info = <{ name: string; group: string; type: number }>( + Reflect.getMetadata(displayMetadataKey, target, key) + ) + if (info) + { + info + list.push({ + prop: key, + name: info.name, + group: info.group, + type: info.type, + }) + } + }) + return list +} diff --git a/src/processParser/common/drawing/base.ts b/src/processParser/common/drawing/base.ts new file mode 100644 index 0000000..7194193 --- /dev/null +++ b/src/processParser/common/drawing/base.ts @@ -0,0 +1,98 @@ +export abstract class Drawing +{ + width: number + height: number + + scale: number = 1 + abstract drawPath(path: DrawPathContext, option: DrawLineOption) + + abstract drawLine( + x0: number, + y0: number, + x1: number, + y1: number, + option: DrawLineOption, + ) + abstract drawRect( + x: number, + y: number, + width: number, + height: number, + option: DrawRectOption, + ) + abstract drawLinePolygon(points: Array, option: DrawLinePolygonOption) + abstract drawText(text: string, x: number, y: number, option: DrawTextOption) + abstract drawForeignObjectText( + text: string, + x: number, + y: number, + option: DrawTextOption, + ) + abstract drawImage( + source: CanvasImageSource, + x: number, + y: number, + width: number, + height: number, + option: DrawImageOption, + border: number, + ): Promise + + abstract clearAll() + + abstract toHTML(): string +} + +export class BaseDrawOption +{ + lineWidth: number = 1 + strokeStyle: string +} + +interface IDrawPath +{ + method: string + args: number[] +} +export class DrawPathContext +{ + data: Array = [] + + moveTo(x: number, y: number) + { + this.data.push({ method: 'M', args: [x, y] }) + + return this + } + + lineTo(x: number, y: number) + { + this.data.push({ method: 'L', args: [x, y] }) + return this + } +} + +export class DrawLineOption extends BaseDrawOption { } +export class DrawRectOption extends BaseDrawOption +{ + fillStyle: string +} +export class DrawImageOption extends BaseDrawOption { } +export class DrawLinePolygonOption extends BaseDrawOption +{ + isFill: boolean = true + fillStyle: string = 'rgb(0,0,0)' +} + +export type DrawTextBaseLnie = 'alphabetic' | 'bottom' | 'hanging' | 'ideographic' | 'middle' | 'top' +export type DrawTextAlign = 'start' | 'center' | 'right' +export class DrawTextOption +{ + maxWidth?: number + textAlign: DrawTextAlign = 'center' + textBaseline: DrawTextBaseLnie = 'middle' + fillStyle: string = 'rgb(0,0,0)' + fontSize: string = '12' + fontWeight: string = '400' + fontFamily: string = '宋体' +} diff --git a/src/processParser/common/drawing/canvasDrawing.ts b/src/processParser/common/drawing/canvasDrawing.ts new file mode 100644 index 0000000..f2f39f8 --- /dev/null +++ b/src/processParser/common/drawing/canvasDrawing.ts @@ -0,0 +1,197 @@ +import { createBmpFile } from '../bmp.js' +import { getFileExt } from '../file.js' +import type { + DrawImageOption, + DrawLineOption, + DrawLinePolygonOption, + DrawPathContext, + DrawRectOption, + DrawTextOption } from './base.js' +import +{ + Drawing, +} from './base.js' + +export class CanvasDrawing extends Drawing { + canvas: HTMLCanvasElement + ctx: CanvasRenderingContext2D + // isCaching: boolean; + outputType: string = 'png' + orgWidth: number + orgHeight: number + toHTML(): string { + let img = new Image(this.canvas.width, this.canvas.height) + img.src = this.canvas.toDataURL(`image/${this.outputType}`) + return img.outerHTML + } + + clearAll() { + this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height) + } + + /** + * + */ + constructor( + canvas: HTMLCanvasElement, + // isCaching: boolean = false, + ) { + super() + this.canvas = canvas + this.width = this.orgWidth = canvas.width = canvas.width + this.height = this.orgHeight = canvas.height = canvas.height + // this.isCaching = isCaching; + this.ctx = this.canvas.getContext('2d') + } + + drawPath(path: DrawPathContext, option: DrawLineOption) { + this.ctx.beginPath() + for (const item of path.data) { + switch (item.method) { + case 'M': + this.ctx.moveTo(item.args[0], item.args[1]) + break + case 'L': + this.ctx.lineTo(item.args[0], item.args[1]) + break + } + } + this.ctx.lineWidth = option.lineWidth + this.ctx.strokeStyle = option.strokeStyle + this.ctx.stroke() + } + + drawLine( + x0: number, + y0: number, + x1: number, + y1: number, + option: DrawLineOption, + ) { + this.ctx.lineWidth = option.lineWidth + this.ctx.strokeStyle = option.strokeStyle + this.ctx.beginPath() + this.ctx.moveTo(x0, y0) + this.ctx.lineTo(x1, y1) + this.ctx.stroke() + } + + drawRect( + x: number, + y: number, + width: number, + height: number, + option: DrawRectOption, + ) { + this.ctx.lineWidth = option.lineWidth + this.ctx.strokeStyle = option.strokeStyle + this.ctx.fillStyle = option.fillStyle + if (option.fillStyle) { + this.ctx.fillRect(x, y, width, height) + } else { + this.ctx.strokeRect(x, y, width, height) + } + } + + drawText(text: string, x: number, y: number, option: DrawTextOption) { + this.ctx.textAlign = option.textAlign as CanvasTextAlign + this.ctx.textBaseline = option.textBaseline as CanvasTextBaseline + this.ctx.fillStyle = option.fillStyle + this.ctx.font + = `${option.fontWeight} ${option.fontSize}px ${option.fontFamily}` + this.ctx.fillText(text, x, y, option.maxWidth) + } + + drawForeignObjectText( + text: string, + x: number, + y: number, + option: DrawTextOption, + ) {} + + imageCache: Map = new Map() + drawImage( + source: CanvasImageSource, + x: number, + y: number, + width: number, + height: number, + option: DrawImageOption, + border: number, + ) { + return new Promise((resolve, reject) => { + this.ctx.drawImage(source, x + border, y + border, width, height) + resolve(null) + }) + } + + drawLinePolygon(points: Array, option: DrawLinePolygonOption) { + this.ctx.beginPath() + this.ctx.moveTo(points[0].x, points[0].y) + for (let i = 1; i < points.length; i++) { + this.ctx.lineTo(points[i].x, points[i].y) + } + this.ctx.closePath() + + this.ctx.stroke() + if (option.isFill) + { + this.ctx.fillStyle = option.fillStyle + this.ctx.fill() + } + } + + setScale(value: number) { + this.scale = value + this.canvas.width = this.width = this.orgWidth * value + this.canvas.height = this.height = this.orgHeight * value + this.ctx.scale(value, value) + } + // resize(width: number, height: number) + // { + // let oldWidth = this.width; + // let oldHeight = this.height; + // if (oldWidth != width || oldHeight != height) + // { + // let newCanvas = document.createElement('canvas'); + // this.width = newCanvas.width = width; + // this.height = newCanvas.height = height; + // let newCtx = newCanvas.getContext('2d'); + // newCtx.drawImage(this.canvas, 0, 0, oldWidth, oldHeight, 0, 0, width, height); + // this.canvas = newCanvas; + // this.ctx = newCtx; + // } + // } + + exportFile(nameOrType: string, param: string): Promise { + let mimeType = 'image/png' + let ext = getFileExt(nameOrType) + if (ext === null) { + ext = nameOrType + } + let paramDic: { [key: string]: string } = {} + if (param != null) { + for (const item of param.split('&')) { + let kv = item.split('=') + paramDic[kv[0]] = kv[1] + } + } + switch (ext) { + case 'bmp': + let data = createBmpFile( + this.ctx.getImageData(0, 0, this.width, this.height), + paramDic, + ) + return Promise.resolve(new Uint8Array(data)) + case 'jpg': + case 'jpeg': + mimeType = 'image/jpeg' + break + } + return new Promise((resolve) => { + this.canvas.toBlob((data: Blob) => { + resolve(data) + }, mimeType) + }) + } +} diff --git a/src/processParser/common/drawing/canvasUtil.ts b/src/processParser/common/drawing/canvasUtil.ts new file mode 100644 index 0000000..2c4de26 --- /dev/null +++ b/src/processParser/common/drawing/canvasUtil.ts @@ -0,0 +1,39 @@ +import type { DrawTextOption } from './base' + +// const canvas = new OffscreenCanvas(0, 0); +const canvas = document.createElement('canvas') +const canvasCtx = canvas.getContext('2d') + +export function blobToDataURL(data: Blob): Promise +{ + return new Promise((resolve) => + { + let reader = new FileReader() + reader.onload = (response) => + { + resolve(response.target.result as string) + } + reader.readAsDataURL(data) + }) +} + +export function getStringWidth( + text: string, + width: number, + height: number, + option: DrawTextOption, +): number +{ + canvasCtx.clearRect( + 0, + 0, + width, + height, + ) + canvasCtx.textAlign = option.textAlign as CanvasTextAlign + canvasCtx.textBaseline = option.textBaseline as CanvasTextBaseline + canvasCtx.fillStyle = option.fillStyle + canvasCtx.font + = `${option.fontWeight} ${option.fontSize}px ${option.fontFamily}` + return canvasCtx.measureText(text).width +} diff --git a/src/processParser/common/drawing/imageCode.ts b/src/processParser/common/drawing/imageCode.ts new file mode 100644 index 0000000..8d584b0 --- /dev/null +++ b/src/processParser/common/drawing/imageCode.ts @@ -0,0 +1,33 @@ +import jsbarcode from 'jsbarcode' +import type { QRCodeRenderersOptions } from 'qrcode' +import { toCanvas } from 'qrcode' + +// const canvas = new OffscreenCanvas(0, 0); +const canvas = document.createElement('canvas') +const canvasCtx = canvas.getContext('2d') + +export async function genBarcode(text: string, options: jsbarcode.Options) +{ + canvas.width = options.width + canvas.height = options.height + canvasCtx.clearRect(0, 0, options.width, options.height) + try + { + jsbarcode(canvas, text, options) + // return await canvas.transferToImageBitmap(); + return await createImageBitmap(canvas) + } catch + { + return null + } +} +export async function genQrcode(text: string, options: QRCodeRenderersOptions) +{ + canvas.width = options.width + canvas.height = options.width + canvasCtx.clearRect(0, 0, options.width, options.width) + await toCanvas(canvas, text, options) + + // return await canvas.transferToImageBitmap(); + return await createImageBitmap(canvas) +} diff --git a/src/processParser/common/drawing/imageUtil.ts b/src/processParser/common/drawing/imageUtil.ts new file mode 100644 index 0000000..9097202 --- /dev/null +++ b/src/processParser/common/drawing/imageUtil.ts @@ -0,0 +1,12 @@ +export function UrlToBitmap(src: string) +{ + return new Promise((resolve) => + { + let img = new Image() + img.src = src + img.onload = () => + { + resolve(img) + } + }) +} diff --git a/src/processParser/common/drawing/index.ts b/src/processParser/common/drawing/index.ts new file mode 100644 index 0000000..9d0f88a --- /dev/null +++ b/src/processParser/common/drawing/index.ts @@ -0,0 +1,3 @@ +export * from './base' +export * from './canvasDrawing' +export * from './svgDrawing' diff --git a/src/processParser/common/drawing/svgDrawing.ts b/src/processParser/common/drawing/svgDrawing.ts new file mode 100644 index 0000000..f1a3026 --- /dev/null +++ b/src/processParser/common/drawing/svgDrawing.ts @@ -0,0 +1,251 @@ +import type { + DrawImageOption, DrawLineOption, DrawLinePolygonOption, DrawPathContext, DrawRectOption, + DrawTextOption, +} from './base.js' +import +{ Drawing, +} from './base.js' + +const canvas = document.createElement('canvas') +const canvasCtx = canvas.getContext('2d') +export class SvgDrawing extends Drawing +{ + svg: SVGElement + /** + * + */ + constructor( + width: number | string, + height: number | string, + scale: number = 0.8, + ) + { + super() + this.scale = scale + this.width = Number(width) + this.height = Number(height) + this.svg = this.createElement('svg') + // this.svg.setAttribute('width', this.width.toString());//(Number(width) * this.scale) + // this.svg.setAttribute('height', this.height.toString());//(Number(height) * this.scale) + // this.svg.style.transform = 'scale(' + this.scale + ')'; + // this.svg.style.transformOrigin = 'left top'; + this.svg.setAttribute('viewBox', `0 0 ${width} ${height}`) + } + + private createElement(name) + { + return document.createElementNS('http://www.w3.org/2000/svg', name) + } + + toHTML(): string + { + return this.svg.outerHTML + } + + clearAll() + { + this.svg.innerHTML = '' + } + + drawPath(path: DrawPathContext, option: DrawLineOption) + { + let el = this.createElement('path') + + let pathStr = '' + for (const item of path.data) + { + switch (item.method) + { + case 'M': + pathStr += `M ${item.args.join(' ')} ` + break + case 'L': + pathStr += `L ${item.args.join(' ')} ` + break + } + } + el.setAttribute('d', pathStr) + el.setAttribute('stroke-width', option.lineWidth.toString()) + el.setAttribute('stroke', option.strokeStyle) + this.svg.appendChild(el) + } + + drawLine( + x0: number, + y0: number, + x1: number, + y1: number, + option: DrawLineOption, + ) + { + let el = this.createElement('line') + el.setAttribute('x1', x0.toString()) // (Number(x0) * this.scale) + el.setAttribute('y1', y0.toString()) // (Number(y0) * this.scale) + el.setAttribute('x2', x1.toString()) // (Number(x1) * this.scale) + el.setAttribute('y2', y1.toString()) // (Number(y1) * this.scale) + el.setAttribute('stroke', option.strokeStyle) + el.setAttribute('fill', 'rgba(0,0,0,0)') + el.setAttribute('stroke-width', option.lineWidth.toString()) + this.svg.appendChild(el) + } + + drawRect( + x: number, + y: number, + width: number, + height: number, + option: DrawRectOption, + ) + { + let el = this.createElement('rect') + el.setAttribute('x', x.toString()) // ((x + option.baseLine / 2) * this.scale) + el.setAttribute('y', y.toString()) // ((y + option.baseLine) * this.scale) + el.setAttribute('width', width.toString()) // (Number(width) * this.scale) + el.setAttribute('height', height.toString()) // (Number(height) * this.scale) + if (option.fillStyle) + { + el.setAttribute('fill', option.fillStyle) + el.setAttribute('stroke', option.strokeStyle) + } else + { + el.setAttribute('fill', 'rgba(1,1,1,0)') + el.setAttribute('stroke', option.strokeStyle) + el.setAttribute( + 'stroke-width', + (Math.floor(option.lineWidth) + 0.5).toString(), + ) + } + this.svg.appendChild(el) + } + + drawText(text: string, x: number, y: number, option: DrawTextOption) + { + let el = this.createElement('text') + el.setAttribute('x', x.toString()) // (Number(x) * this.scale) option['CncDict'] ? (x - Number(option.fontSize) / 6).toString() : + el.setAttribute('y', y.toString()) // (Number(y) * this.scale) + el.style.dominantBaseline = 'text-before-edge' + if (option.resetFont) + { + el.style.dominantBaseline = 'middle' + el.setAttribute('text-anchor', 'middle') + } + el.setAttribute('fill', option.fillStyle) + el.setAttribute('font-size', `${option.fontSize}px`) + el.setAttribute('font-weight', option.fontWeight) + el.setAttribute('font-family', option.fontFamily) + if (option.overflowText) + { + el.setAttribute('textLength', option.maxWidth.toString()) + el.setAttribute('lengthAdjust', 'spacingAndGlyphs') + } + el.setAttribute('alignment-baseline', option.textBaseline) + switch (option.textAlign) + { + case 'start': + el.setAttribute('text-anchor', 'left') + break + case 'center': + el.setAttribute('text-anchor', 'middle') + break + case 'right': + el.setAttribute('text-anchor', 'end') + break + } + + if (typeof text === 'string') + { + el.innerHTML = text.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>') + } else + { + el.innerHTML = text + } + + this.svg.appendChild(el) + } + + drawForeignObjectText( + text: string, + x: number, + y: number, + option: DrawTextOption, + ) + { + // let el = this.createElement('foreignObject'); + // el.setAttribute('x',x.toString()); + // el.setAttribute('y',y.toString()); + // el.setAttribute('width',option.maxWidth.toString()); + // el.setAttribute('height',option['maxHeight'].toString()); + // let span = this.createElement('span'); + // span.style.dominantBaseline = 'text-before-edge'; + // if(option['resetFont']){ + // span.style.dominantBaseline = 'middle'; + // span.style.textAnchor = 'middle'; + // } + // span.style.fontSize = option.fontSize + 'px'; + // span.style.fontWeight = option.fontWeight; + // span.style.fontFamily = option.fontFamily; + // span.style.display = 'inline-block'; + // span.style.width = option.maxWidth + 'px'; + // span.style.height = option['maxHeight'] + 'px'; + // span.style.overflow = 'hidden'; + // span.innerHTML = text; + // el.appendChild(span); + // this.svg.appendChild(el); + } + + async drawImage( + source: CanvasImageSource, + x: number, + y: number, + width: number, + height: number, + option: DrawImageOption, + ) + { + let src = '' + if (source instanceof ImageBitmap) + { + canvas.width = source.width + canvas.height = source.height + canvasCtx.clearRect(0, 0, source.width, source.height) + canvasCtx.drawImage(source, 0, 0, source.width, source.height) + src = canvas.toDataURL() + } else if (source instanceof HTMLImageElement) + { + src = source.src + } + return new Promise((resolve, reject) => + { + let el = this.createElement('image') + el.setAttribute('x', x.toString()) // (Number(x) * this.scale) + el.setAttribute('y', y.toString()) // (Number(y) * this.scale) + el.setAttribute('width', width.toString()) // (Number(width) * this.scale) + el.setAttribute('height', height.toString()) // (Number(height) * this.scale) + el.setAttribute('xlink:href', src) + el.setAttribute('preserveAspectRatio', 'none meet') + this.svg.appendChild(el) + resolve(null) + }) + } + + drawLinePolygon(points: Array, option: DrawLinePolygonOption) + { + let el = this.createElement('polygon') + let pointsStr = '' + for (let i = 0; i < points.length; i++) + { + if (i == points.length - 1) + { + pointsStr += `${points[i].x} ${points[i].y}` + } else + { + pointsStr += `${points[i].x} ${points[i].y},` + } + } + el.setAttribute('points', pointsStr) + el.setAttribute('fill', option.isFill ? option.fillStyle : 'none') + el.setAttribute('stroke', option.strokeStyle) + el.setAttribute('stroke-width', option.lineWidth.toString())// 添加多段线的线宽--xyh + this.svg.appendChild(el) + } +} diff --git a/src/processParser/common/file.ts b/src/processParser/common/file.ts new file mode 100644 index 0000000..53b8945 --- /dev/null +++ b/src/processParser/common/file.ts @@ -0,0 +1,22 @@ +export async function readText(file: Blob, encoding?: string): Promise +{ + return new Promise((resolve) => + { + let fileReader = new FileReader() + fileReader.onload = function (e) + { + resolve( this.result) + } + fileReader.readAsText(file, encoding) + }) +} + +export function getFileExt(name: string) +{ + let index = name.lastIndexOf('.') + if (index != -1) + { + return name.substring(index + 1, name.length) + } + return null +} diff --git a/src/processParser/common/log.ts b/src/processParser/common/log.ts new file mode 100644 index 0000000..4df5969 --- /dev/null +++ b/src/processParser/common/log.ts @@ -0,0 +1,33 @@ +export class Logger +{ + name: string + static interceptors: LogInterceptor[] = [] + constructor(name: string) + { + this.name = name + } + + static AddInterceptor(interceptor: LogInterceptor) + { + Logger.interceptors.push(interceptor) + } + + error(error: Error, payload: any = null) + { + console.error(error, payload) + Logger.interceptors.forEach((i) => + { + i.call(this, error, payload) + }) + } + + info(message: string, payload: any = null) + { + console.info(message, payload) + Logger.interceptors.forEach((i) => + { + i.call(this, message, payload) + }) + } +} +export type LogInterceptor = (this: Logger, info: string | Error, payload: any) => void diff --git a/src/processParser/common/placeDataHelper.ts b/src/processParser/common/placeDataHelper.ts new file mode 100644 index 0000000..d617524 --- /dev/null +++ b/src/processParser/common/placeDataHelper.ts @@ -0,0 +1,23634 @@ +import { ref } from "vue"; +import { FileZip } from "./base/ZipFile"; +import { BlockHelper } from "../vo/order/BlockHelper"; +import { PlacePositionHelper } from "../vo/order/PlacePostionHelper"; +import { PlaceBlock } from "../vo/order/PlaceBlock"; +import { BlockSizePlus } from "../vo/order/BlockSizePlus"; +import { PlaceMaterial } from "../vo/order/PlaceMaterial"; +import { PlaceStore } from "../vo/order/PlaceStore"; +import { BlockPlus } from "../vo/order/BlockPlus"; +import { cloneDeep } from "lodash-es"; +import { PlaceStyle } from "../vo/enums/PlaceStyle"; +import { formatToDate } from '@/utils/dateUtil' +import { useMessage } from '@/hooks/web/useMessage' + +const { createMessage } = useMessage() +/**输出到文本文件的内容 正面 (A面) */ +const outPutString = ref(''); +/**输出到文本文件的内容 反面 (B面) */ + +const outPutStringB = ref(''); + +//**机台配置的 CNC文件结构 */ +const TreeData = ref({}) + +//** 优化数据 */ +const placeData = ref(null); +/** + * 记录下所有的加工项 + * 注:不同的加工 + */ +const allProcessList = ref([]) + +//** 机台配置 */ +const drillConfig = ref(null); +export async function readyToCreateCNCFile(treeData: any, planOrder: any, zipFile: FileZip, sysConfigDrill?: any) { + + TreeData.value = treeData + placeData.value = planOrder + drillConfig.value = sysConfigDrill + + /** + * 梳理下流程-- 关于坐标 + * 1、 小板模式 不考虑大板 + * 那么计算坐标的时候 只要考虑 机台 坐标参数 (靠档和长高方向【送板方向?】) 和 小板的排版方式 placeStyle + * + * 2、大板模式 需要考虑大板 + * 那么计算坐标的时候 要考虑 虑 机台 坐标参数 (靠档和长高方向【送板方向?】) 、 大板的坐标、小板在大板中的坐标 板件是否翻面 + */ + + allProcessList.value = []; + await createCNCFile(zipFile); + + console.log('allProcessItem', allProcessList.value) + // 测试 + // testToGetDicValue(DataTags_all) +} + + +function getFileName(val, exportFileType?: any, source?: any, noHandleSource?: any) { + let valueStr = val.slice(3, -3) + let res = '' + + let blockList: any = []; + if (noHandleSource == true) { + if (exportFileType == 0 || exportFileType == 1) { + blockList = source + } else { + source.forEach(m => { + m.blockList.forEach(block => { + blockList.push(block); + }); + }); + } + } else { + if (exportFileType == 0) { + blockList = [source] + } else if (exportFileType == 1) { + blockList = source + } else if (exportFileType == 2) { + source.blockList.forEach(block => { + blockList.push(block); + }); + } else if (exportFileType == 3) { + source.forEach(m => { + m.blockList.forEach(block => { + blockList.push(block); + }); + }); + } + } + + + switch (valueStr) { + case 'organName': + + res = 'organName' // zipFileNameStr.replace(val, placeData.value.source.planOrder.organName) + break; + + case 'dealer': + + res = placeData.value.source.orderList.map(e => e.dealer) + break; + case 'customer': + + res = placeData.value.source.orderList.map(e => e.customer).join('、') + break; + case 'address': + + res = placeData.value.source.orderList.map(e => e.address).join('、') + break; + case 'orderId': + + res = placeData.value.source.orderList.map(e => e.orderId).join('、') + break; + case 'customOrderNo': + + res = placeData.value.source.orderList.map(e => e.customOrderNo).join('、') + break; + case 'planCode': + + res = placeData.value.source.planOrder.planCode + break; + case 'goodsName': + + res = blockList.map(e => e.goodsName).join('、') + break; + case 'material': + + res = blockList.map(e => e.materialName).join('、') + break; + case 'color': + + res = blockList.map(e => e.color).join('、') + break; + case 'spec': + + res = blockList.map(e => e.spec).join('、') + break; + case 'blockNo': + + res = blockList.map(e => e.blockNo).join('、') + break; + case 'blockName': + + res = blockList.map(e => e.bodyName).join('、') + break; + default: + break; + } + + return res +} +function truncateString(str, maxLength, useEllipsis = true) { + if (str.length <= maxLength) { + return str; + } else { + return str.slice(0, maxLength) + (useEllipsis ? '...' : ''); + } +} +async function createCNCFile(zipFile: FileZip) { + + + /** + * 生成CNC 文件有4种情况 + * 小板独立文件、小板合并文件、大板独立文件、大板合并文件 0 || 1 || 2 || 3 + * blockAlone 、 blockMerge 、 boardAlone 、 boardMerge + * 默认 小板独立文件 + * merge alone + * */ + + // 测试 + + let exportFileType = drillConfig.value.fileExportType || drillConfig.value?.machineSettingDO?.ncExportConfigsRef?.fileExportType || 0 + + + // 测试用 读取所有字典的字段看看返回的内容 + // testToGetDicValue(DataTags_all) + let fileRes: any = [] + /** 是否分面 */ + const isFileSort = drillConfig.value?.isFileSort + + + + /** 数据预处理---把每个孔 || 造型的刀 解析下做个关联 后面数据解析的时候减少计算量*/ + + // 已经这之前已经处理 孔和 造型的数据内添加了 knife + let blockList: PlaceBlock[] = [] + placeData.value.materialList.forEach(material => { + material.boardList.forEach(board => { + board.blockList.forEach(block => { + blockList.push(block) + }); + }); + }) + + if (blockList.length == 0 && placeData.value.blockList.length != 0) { + placeData.value.materialList.forEach(material => { + material.blockList.forEach(block => { + blockList.push(block) + }); + }) + } + + /** 加工方案的需求下 没有用 */ + //**导出空单(无板) */ + let isExportOrderNoBoard = drillConfig.value?.isExportOrderNoBoard || false + /** 导出空单(无加工) */ + let isExportOrderNoProcess = drillConfig.value?.isExportOrderNoProcess || false + /** 导出已加工 */ + let isExportOrderProcess = drillConfig.value?.isExportOrderProcess || false + switch (exportFileType) { + case 0: + // 小板独立文件 生成文件的 基准点为 具体的某个小板 + for (let index = 0; index < blockList.length; index++) { + const block = blockList[index]; + // 是否需要双面加工 + + let isTwoFace = block.blockDetail.isTwoFaceProcess + let hasFaceA = block.blockDetail.holeListFaceA.length > 0 || block.blockDetail.modelListFaceA.length > 0 + let hasFaceB = block.blockDetail.holeListFaceB.length > 0 || block.blockDetail.modelListFaceB.length > 0 + + // 若AB 面 都没有加工 且 有侧面加工 的情况下 都在A面加工 + if (!hasFaceA && !hasFaceB && (block.blockDetail.holeListSide.length > 0 || block.blockDetail.modelListSide.length > 0)) { + hasFaceA = true + } + + outPutString.value = '' + outPutStringB.value = '' + + await _setDataSource(block, exportFileType) + console.log('板', block.blockNo, '已设置数据源', fileDataAB.value) + await createCNC(TreeData.value, 0, block, exportFileType, -1, 'start'); + + + // 设置 zip压缩包名称 start + var zipFileNameStr = drillConfig.value?.zipPathName || drillConfig.value?.machineSettingDO?.ncExportConfigsRef.zipPathName || '' + + var zipFileNameConfigList = zipFileNameStr.match(/{{\<([^>]*)>\}}/g) || [] + + zipFileNameConfigList.forEach(val => { + + var newVal = getFileName(val, exportFileType, block); + + zipFileNameStr = zipFileNameStr.replaceAll(val, newVal) + }) + + var zipFileName = zipFileNameStr //`${zipFileNameStr}.zip` + await zipFile.SetZipFileName(zipFileName) + // 设置 zip压缩包名称 end + + + const codeStr = drillConfig.value?.ncFileEncoding || '' + const fileContent = outPutString.value + + + + if (isFileSort) { + + // 需要双面加工的时候 才导出 + if (hasFaceB && drillConfig.value?.isExportBoardFileB) { + var fileNameB = drillConfig.value?.fileBackPathName || '' + var fileNameConfigList_B = fileNameB.match(/{{\<([^>]*)>\}}/g) + fileNameConfigList_B && fileNameConfigList_B.forEach(val => { + + var newVal = getFileName(val, exportFileType, block); + fileNameB = fileNameB.replaceAll(val, newVal) + }) + + let nameB = fileNameB + + let fileBContent = outPutStringB.value; + await zipFile.PushFile(`${nameB}`, fileBContent, false, codeStr) + } else { + console.log('不添加文件~!B面') + } + + if (hasFaceA && drillConfig.value?.isExportBoardFileA) { + var fileNameA = drillConfig.value?.fileFrontPathName || '' + + var fileNameConfigList = fileNameA.match(/{{\<([^>]*)>\}}/g) + + fileNameConfigList && fileNameConfigList.forEach(val => { + var newVal = getFileName(val, exportFileType, block); + fileNameA = fileNameA.replaceAll(val, newVal) + }) + + let nameA = fileNameA + await zipFile.PushFile(`${nameA}`, fileContent, false, codeStr) + } else { + console.log('不添加文件~!A面') + } + + + } else { + var fileName = drillConfig.value?.filePathName || '' + + var fileNameConfigList = fileName.match(/{{\<([^>]*)>\}}/g) + + fileNameConfigList && fileNameConfigList.forEach(val => { + var newVal = getFileName(val, exportFileType, block); + fileName = fileName.replaceAll(val, newVal) + }) + + let name = `${fileName}`; + await zipFile.PushFile(`${name}`, fileContent, false, codeStr) + } + + + } + break; + case 1: + // 小板合并文件 生成文件的 基准点为 小板的数据集 + outPutString.value = '' + outPutStringB.value = '' + + await _setDataSource(blockList, exportFileType) + console.log('小板合并文件模式:生成开始', outPutString.value); + await createCNC(TreeData.value, 0, blockList, exportFileType, -1, 'start'); + console.log('小板合并文件模式:生成结束', outPutString.value); + + + // 设置 zip压缩包名称 start + var zipFileNameStr = drillConfig.value?.zipPathName || drillConfig.value?.machineSettingDO?.ncExportConfigsRef.zipPathName + + var zipFileNameConfigList = zipFileNameStr.match(/{{\<([^>]*)>\}}/g) || [] + + zipFileNameConfigList.forEach(val => { + + var newVal = getFileName(val, exportFileType, blockList); + zipFileNameStr = zipFileNameStr.replaceAll(val, newVal) + }) + + + + + var zipFileName = zipFileNameStr + await zipFile.SetZipFileName(zipFileName) + // 设置 zip压缩包名称 end + + + + + + var fileName = drillConfig.value?.fileFrontPathName || '' + + var fileNameConfigList = fileName.match(/{{\<([^>]*)>\}}/g) + fileNameConfigList.forEach(val => { + + var newVal = getFileName(val, exportFileType, placeData.value.blockList); + fileName = fileName.replaceAll(val, newVal) + }) + + + var fileContent = ''; + + fileContent = outPutString.value + + if (isFileSort) { + fileContent += '\n' + fileContent += '\n' + + fileContent += outPutStringB.value + } + + var codeStr = drillConfig.value?.ncFileEncoding || '' + + + + await zipFile.PushFile(`${fileName}`, fileContent, false, codeStr) + + break; + case 2: + // 大板独立文件 生成文件的 基准点为 具体的某个大板 + + for (let index = 0; index < placeData.value.materialList.length; index++) { + let material = placeData.value.materialList[index]; + + for (let index1 = 0; index1 < material.boardList.length; index1++) { + const board = material.boardList[index1] + outPutString.value = '' + outPutStringB.value = '' + await _setDataSource(material, exportFileType) + console.log('大板独立文件模式:生成开始', outPutString.value); + await createCNC(TreeData.value, 0, material, exportFileType, -1, 'start'); + console.log('大板独立文件模式:生成结束', outPutString.value); + + + // 设置 zip压缩包名称 start + var zipFileNameStr = drillConfig.value?.zipPathName || drillConfig.value?.machineSettingDO?.ncExportConfigsRef.zipPathName + + var zipFileNameConfigList = zipFileNameStr.match(/{{\<([^>]*)>\}}/g) || [] + + zipFileNameConfigList.forEach(val => { + + var newVal = getFileName(val, exportFileType, material); + zipFileNameStr = zipFileNameStr.replaceAll(val, newVal) + }) + + + + + var zipFileName = zipFileNameStr //`${zipFileNameStr}.zip` + await zipFile.SetZipFileName(zipFileName) + // 设置 zip压缩包名称 end + var fileName = drillConfig.value?.fileFrontPathName || '' + + var fileNameConfigList = fileName.match(/{{\<([^>]*)>\}}/g) + + fileNameConfigList && fileNameConfigList.forEach(val => { + var newVal = getFileName(val, exportFileType, material); + fileName = fileName.replaceAll(val, newVal) + }) + + + + let name = `${fileName}`; + + + const fileContent = outPutString.value + const codeStr = drillConfig.value?.ncFileEncoding || '' + let isTwoFace = board.isTwoFaceProcessing + fileNameConfigList_B && fileNameConfigList_B.forEach(val => { + + var newVal = getFileName(val, exportFileType, material); + fileNameB = fileNameB.replaceAll(val, newVal) + }) + if (isFileSort) { + var fileNameB = drillConfig.value?.fileBackPathName || '' + var fileNameConfigList_B = fileNameB.match(/{{\<([^>]*)>\}}/g) + // 需要双面加工的时候 才导出 + + if (isTwoFace) { + let nameB = fileNameB + let fileBContent = outPutStringB.value; + await zipFile.PushFile(`${nameB}`, fileBContent, false, codeStr) + } + + let nameA = fileName + await zipFile.PushFile(`${nameA}`, fileContent, false, codeStr) + + } else { + await zipFile.PushFile(`${name}`, fileContent, false, codeStr) + } + + + } + + } + break; + case 3: + // 大板合并文件 生成文件的 基准点为 大板的数据集 + + outPutString.value = '' + outPutStringB.value = '' + await _setDataSource(placeData.value.materialList, exportFileType) + console.log('大板合并文件模式:生成开始', outPutString.value); + await createCNC(TreeData.value, 0, placeData.value.materialList, exportFileType, -1, 'start'); + console.log('大板合并文件模式:生成结束', outPutString.value); + + + // 设置 zip压缩包名称 start + var zipFileNameStr = drillConfig.value?.zipPathName || drillConfig.value?.machineSettingDO?.ncExportConfigsRef.zipPathName + + var zipFileNameConfigList = zipFileNameStr.match(/{{\<([^>]*)>\}}/g) || [] + + zipFileNameConfigList && zipFileNameConfigList.forEach(val => { + + var newVal = getFileName(val, zipFileNameStr, exportFileType, placeData.value.materialList); + zipFileNameStr = zipFileNameStr.replaceAll(val, newVal) + }) + + + + + var zipFileName: any = `${zipFileNameStr}.zip` + await zipFile.SetZipFileName(zipFileName) + // 设置 zip压缩包名称 end + + var fileName = drillConfig.value?.fileFrontPathName || '' + var fileNameConfigList = fileName.match(/{{\<([^>]*)>\}}/g) + fileNameConfigList.forEach(val => { + + var newVal = getFileName(val, fileName, exportFileType, placeData.value.materialList); + fileName = fileName.replaceAll(val, newVal) + }) + + var fileContent: string = outPutString.value + if (isFileSort) { + fileContent += '\n' + fileContent += '\n' + + fileContent += outPutStringB.value + } + + var codeStr = drillConfig.value?.ncFileEncoding || '' + await zipFile.PushFile(`${fileName}`, fileContent, false, codeStr) + break; + default: + break; + } + + + return fileRes + + + + + + // textFile.saveFile(`cncXML测试.xml`, outPutString.value) +} + + +function testToGetDicValue(tags) { + let resTags: any = [] + // console.log(placeData) + + tags.forEach(tag => { + let temp: any = { + // sourceStr: item, // 在源数据中的字符串 + // valueStr: valueStr, // 剔除 包裹的字符的字符串 + type: tag.flag, // 数据类型 + itemKey: tag.value, // 数据id + itemLabel: tag.label, // 数据说明 + // value: '', // 要替换的数据 + tagRes: null, + tagResB: null, // 拿回来的 B面数据 + tagResA: null // 拿回来的 A面数据 + } + + // 分别对应4中文件导出模式 + let res1 = { ...temp } + let res2 = { ...temp } + let res3 = { ...temp } + let res4 = { ...temp } + // 1getPlaceDataValueByDic(res1, [placeData.value.blockList[0]], 0) + // 1getPlaceDataValueByDic(res2, placeData.value.blockList, 1) + // 1getPlaceDataValueByDic(res3, [placeData.value.materialList[0]], 2) + // 1getPlaceDataValueByDic(res4, placeData.value.materialList, 3) + + // console.log(res1, res2, res3, res4); + + // temp.tagRes = tagRes; + + resTags.push(temp); + }); +} + + +// +const hasConfig = ref(false); + +// 生成一个CNC文件的内容 +/** + * + * @param data // 模板数据 + * @param level // 层级 + * @param targetSource // 实际的基准点数据 目前可能为 block || blockList || material || materialList + * @param exportFileType // 当前文件的生成模式 0 || 1 || 2 || 3 1 和 3 合并模式 0 和 2 独立模式 + * @param parantId // 递归时 定位父级下标用 入口时传 -1 + * @param flag // 用来分辨 AB面 等等 + * + * outPutString 和 outPutStringB 操作说明 + * 若 exportFileType 为 0 或者 2 的时候 + * + * + * + */ + +// exportFileType 为 0 的时候 不管 +function createCNC(data, level?: any, targetSource?: any, exportFileType?: any, parantId?: any, flag?: any, kidId?: any) { + // console.log('runing',level,parantId,flag) + // 这里都整合为 数组的形式处理 + let targetSourceList: any = []; + if (Array.isArray(targetSource)) { + targetSourceList = targetSource + } else { + targetSourceList = [targetSource] + } + /** 钻孔机 配置中 是否分面 */ + const isFileSort = drillConfig.value?.isFileSort + + /** 实际的板材 是否 需要分面 解析的时候可能用 */ + let isTwoFaceList = []; + + // 是否有A面加工 + let hasFaceAList: Array = []; + + // 是否有B面加工 + let hasFaceBList: Array = [] + + + + // 用来定位 板内的某个子集 (轮廓、造型、孔、等等) + let pid = -1 + + /** 导出的是是A面 还是B面 */ + let _flag = '' + + // 逻辑控制: 第一次 传入的时候 都为start + if (flag != undefined) { + _flag = flag + } + + if (parantId != undefined) { + pid = parantId + } + // 用来定位 板内的某个子集的子集 (造型轮廓、造型、孔、等等) + let kid = -1 + + if (kidId != undefined) { + kid = kidId + } + + + let lvl = level; + + + if (Array.isArray(data)) { + // + data.forEach(async (item, d) => { + + // 测试用 + let exportFileType = drillConfig.value.fileExportType || drillConfig.value?.machineSettingDO?.ncExportConfigsRef?.fileExportType || 0 + const ccc = { _flag, title: item.title, lvl, pid, kid, d, exportFileType } + console.log('开始=》', ccc) + + + + + // d: 本节点 在父节点的 层级 () + + const { + dataTextarea, + dataTextarea_end, + dataTextarea_start, + isTab, + isLoop, + LoopOrderBy, + isUsedCondition, + loopOrderByOptions, + conditionList, + + } = item.item + let isUsedChangeKnife = item.item.isUsedChangeKnife || false + /**判断 刀路是否条件显示 刀路的条件显示 生效的逻辑不一样 与 正反面 和是否调刀 逻辑不一样 + * conditionList 内 包含 2 3 4 则为是 + */ + let isCondition_Line = false + if (isUsedCondition && Array.isArray(conditionList)) { + for (const conditionItem of conditionList) { + if (conditionItem.conditionOptions.includes('2') || conditionItem.conditionOptions.includes('3') || conditionItem.conditionOptions.includes('4')) { + isCondition_Line = true + continue + } + } + } + let tabContent = ` ` + let tabVal = ''; + if (isTab) { + for (let i = 0; i < lvl; i++) { + tabVal = tabVal + tabContent; + } + } + + // 标识符 + let nextRow = '\n' + // 头部 + + // 主体内容 + /** + * 关键的地方 + * 逻辑分析 + * 1、 解析当前节点 所有的数据项 + * 2、 判断当前节点的数据项 的 循环依赖项 + * 3、 根据循环 依赖性 和 数据项 判断 是否循环 + */ + + // 当前节点文本 + let dataNode = dataTextarea || '' + + // 当前节点对应的 数据项 + // let dataItemList = dataNode.match(/{{\<([^>]*)>\}}/g) + let dataItemList = [] + + if (loopOrderByOptions) { + dataItemList = loopOrderByOptions.map(e => e.value) + } + + /** 该节点所有的数据项集合 */ + let dataObjectList: any = [] + + /** + * 注:解决翻面问题呢 + * 解决方案:解析数据的时候将 A B面的数据 都解析出来 + * 然后在替换文件内容的时候 根据对应的 A || B 面进行解析替换 + */ + + + // 当前节点循环的依据 + let loopObj: any = null + + if (isLoop == true) { + + let valueStr = '' + try { + valueStr = LoopOrderBy.slice(3, -3) || '' + } catch (error) { + console.log(error, LoopOrderBy); + createMessage.warn(`节点${ccc.title}配置了循环,但未配置循环依据,请前往机台配置后再试!`) + } + + let valueList = valueStr.split('|') + if (valueList.length == 3) { + let type = valueList[0]; + let itemKey = valueList[1]; + let itemLabel = valueList[2]; + loopObj = { + sourceStr: LoopOrderBy, // 在源数据中的字符串 + valueStr: valueStr, // 剔除 包裹的字符的字符串 + type, // 数据类型 + itemKey, // 数据id + itemLabel, // 数据说明 + value: '', // 要替换的数据 + tagRes: null, // 拿回来的 数据 + tagResB: null, // 拿回来的 B面数据 + tagResA: null, // 拿回来的 A面数据 + isTwoFaceList, // 暂时没用 + hasFaceAList, // 暂时没用 + hasFaceBList // 暂时没用 + } + getPlaceDataValueByDic(loopObj, targetSourceList, exportFileType) + + } + } + + + + // 解析数据项 所有数据项都解析出来 + dataItemList && dataItemList.forEach(item => { + let valueStr = item.slice(3, -3) + let valueList = valueStr.split('|') + // 既定的数据 格式为 <<{ 数据类型 | 数据ID | 数据说明 }>> 不符合的不操作 + if (valueList.length == 3) { + let type = valueList[0]; + let itemKey = valueList[1]; + let itemLabel = valueList[2]; + + // if (valueStr.includes('grooves|toolDiameter|刀直径')) { + // + // } + let temp = { + sourceStr: item, // 在源数据中的字符串 + valueStr: valueStr, // 剔除 包裹的字符的字符串 + type, // 数据类型 + itemKey, // 数据id + itemLabel, // 数据说明 + value: '', // 要替换的数据 + tagRes: '', // 从字典拿回来的数据可能要二次操作 留个位置 以防后续改动 + tagResB: null, // 拿回来的 B面数据 + tagResA: null // 拿回来的 A面数据 + } + getPlaceDataValueByDic(temp, targetSourceList, exportFileType) + dataObjectList.push(temp); + } + }); + //** 不同的面 循环的依据是不一样的 所以要分开写 tagRes tagResA tagResB */ + if (isFileSort) { + // A面 + if (_flag == 'start' || _flag == 'A') { + if (isUsedChangeKnife == true) { + hasConfig.value = true + } + // A面 头部补充内容 + if (dataTextarea_start) { + outPutString.value = outPutString.value + (dataTextarea_start || '') + nextRow + } + // 判断这个节点是否循环: 判断数据的循环依赖 是否可以循环 可以的话节点进行循环 不可以直接输出 + if (isLoop && loopObj && loopObj.tagResA && Array.isArray(loopObj.tagResA)) { + if (loopObj.tagResA.length > 0) { + //轮廓 或者点阵等等 这一层级 会走这里 + const target = dataNode; + let loopMore = false + /** + * loopObj.tagResA 板 + * loopObj.tagResA[pid] 某个造型 | 孔 + * loopObj.tagResA[pid][i] 造型下的点 + */ + + // 判断是否需要三级循环 针对 点阵 轮廓 + loopObj.tagResA.forEach(item => { + if (Array.isArray(item)) { + loopMore = true + } + }) + let loopItem = loopObj.tagResA[pid] + if (kid != -1 && kid != null) { + loopItem = loopItem[kid] + } + if (loopMore && Array.isArray(loopItem) && pid != null && pid != -1) { + // 需要循环的节点 + //** 到了这里 说明是 类似点阵 轮廓等信息 loopObj.tagRes 为 多维数组的时候 */ + + loopItem.forEach((noUsed, i) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let onceLoopVal = target + let changeKnifeCode: any = '' + // 换刀逻辑 + if (isUsedChangeKnife) { + changeKnifeCode = getChangeKnifeCode(ccc, loopObj, i, isCondition_Line) + + // onceLoopVal = changeKnifeCode + onceLoopVal + } + + // 条件显示 + if (isUsedCondition && isCondition_Line == false) { + let conditionInfo = checkCondition(conditionList, ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + // if (changeKnifeCode != '') { + // onceLoopVal = changeKnifeCode + conditionInfo.dataTextarea + // } + } else { + // onceLoopVal = '' + } + } + + onceLoopVal = changeKnifeCode + onceLoopVal + + // 是否是三维数组 造型轮廓的时候 + let isLev3Loop = false; + let lev3LoopList: any = []; + + + // 替换操作 + dataObjectList.forEach((dataObj, q) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + // 二维数组 + let tempVal = dataObj.tagResA + let tempDataObj = dataObj + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 A面 + let loopOrderByList = loopObj.tagResA[pid] + let loopTempVal = null + try { + if (Array.isArray(tempVal)) { + loopTempVal = tempVal[pid] + } else { + loopTempVal = tempVal + } + } catch (error) { + + } + + if (kid != -1 && Array.isArray(loopTempVal)) { + loopTempVal = loopTempVal[kid] + loopOrderByList = loopOrderByList[kid] + } + + if (tempVal && Array.isArray(tempVal[pid])) { + // let checkVal + + // 这里做个判定 如果数组的长度是一样的 默认为 同一个数据集 用loopObj.tagRes的下标i就好 + if (loopTempVal.length == loopOrderByList.length) { + + /** + 这里就还需要判断一层 + 如果是 点数据 、轮廓数据或者 3级数据的时候 (小板 =》小板明细 =》点阵|| 轮廓 数据集 =》具体细项(要显示的数据)) + tempDataObj.tagRes[i] 应该是个数组 一维数组的情况 + 这个时候 这个循环的基准 应该 再下一级 ?? + + 解决方案(暂定):在真正替换文本内容的时候 做个判断和循环 + + + */ + + + tempDataObj.value = loopTempVal[i] // tempDataObj.tagResA[pid][i] + + + + } else if (tempVal.length == 1) { + // 若是只有一个项直接输出就好 + + tempDataObj.value = tempVal.join('、') + } else { + // 其它情况 直接输出 + + tempDataObj.value = tempVal.join('、') + } + + } else { + // 其它情况 直接输出 + tempDataObj.value = tempVal + } + + // 真正的替换内容 + if (tempDataObj.value && Array.isArray(tempDataObj.value)) { + isLev3Loop = true + + if (lev3LoopList.length == tempDataObj.value.length && lev3LoopList.length) { + + tempDataObj.value.forEach((val, j) => { + let temp = lev3LoopList[j] + let tempVal = temp.replaceAll(tempDataObj.sourceStr, val) + lev3LoopList[j] = tempVal + }); + } else { + tempDataObj.value.forEach(val => { + let temp = onceLoopVal + let tempVal = temp.replaceAll(tempDataObj.sourceStr, val) + lev3LoopList.push(tempVal); + }); + } + + } else { + if (isUsedCondition && isCondition_Line == true && q == 0) { + + let _ccc = { ...ccc, q } + let conditionInfo = checkCondition(conditionList, _ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + } else { + onceLoopVal = '' + } + } + onceLoopVal = onceLoopVal.replaceAll(tempDataObj.sourceStr, tempDataObj.value) + } + }); + // 出了循环了 + if (isLev3Loop) { + // dataNode = onceLoopVal + lev3LoopList.forEach((str) => { + dataNode = str + + // 判断是否缩进 + + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 1 A', ccc) + + outPutString.value = outPutString.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'A', i) + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', tabVal + '\n') + } + outPutString.value = outPutString.value + (endStr || '') + nextRow + } + }); + } else { + dataNode = onceLoopVal + // 判断是否缩进 + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', tabVal + '\n') + } + + console.log('ccc 2 A', ccc) + // console.log('test:',i,outPutString.value) + // outPutString.value += `// test holes ${i} ` + + + outPutString.value = outPutString.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'A', i) + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutString.value = outPutString.value + (endStr || '') + nextRow + } + } + + + }) + + + } else { + + // 走到这里 一般是 板件信息 或者订单信息 + loopObj.tagResA.forEach((noUsed, i) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let onceLoopVal = target + // 替换操作 + dataObjectList.forEach((dataObj, q) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let tempVal = dataObj.tagResA + let tempDataObj = dataObj + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 + if (Array.isArray(tempVal)) { + // let checkVal + + // 这里做个判定 如果数组的长度是一样的 默认为 同一个数据集 用loopObj.tagRes的下标i就好 + if (tempVal.length == loopObj.tagResA.length) { + + /** + 这里就还需要判断一层 + 如果是 点数据 、轮廓数据或者 3级数据的时候 (小板 =》小板明细 =》点阵|| 轮廓 数据集 =》具体细项(要显示的数据)) + tempDataObj.tagRes[i] 应该是个数组 一维数组的情况 + 这个时候 这个循环的基准 应该 再下一级 ?? + + 解决方案(暂定):在真正替换文本内容的时候 做个判断和循环 + */ + + tempDataObj.value = tempDataObj.tagResA[i] + + } else if (tempVal.length == 1) { + // 若是只有一个项直接输出就好 + + tempDataObj.value = tempVal.join('、') + } else { + // 其它情况 直接输出 + + tempDataObj.value = tempVal.join('、') + } + + } else { + // 其它情况 直接输出 + tempDataObj.value = tempVal + } + // 真正的替换内容 + if (isUsedCondition && isCondition_Line == true && q == 0) { + let _ccc = { ...ccc, q } + let conditionInfo = checkCondition(conditionList, _ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + } else { + onceLoopVal = '' + } + } + onceLoopVal = onceLoopVal.replaceAll(tempDataObj.sourceStr, tempDataObj.value) + }); + dataNode = onceLoopVal + // 判断是否缩进 + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 3 A', ccc) + outPutString.value = outPutString.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, i, 'A') + } + + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutString.value = outPutString.value + (endStr || '') + nextRow + } + }); + } + } + + } else { + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + + dataObjectList.forEach(dataObj => { + // 从字典拿回来的数据可能要二次操作 留个位置 + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 + + let tempVal = dataObj.tagResA + + if (Array.isArray(tempVal)) { + if (pid != null) { + let target = tempVal[pid] + if (kid != -1) { + target = target[kid] + } + dataObj.value = target //tempVal[pid] + } else { + dataObj.value = tempVal.join('、') + } + + } else { + dataObj.value = tempVal + } + + + dataNode = dataNode.replaceAll(dataObj.sourceStr, dataObj.value) + + + }); + console.log('ccc 4 A', ccc, fileDataA.value) + outPutString.value = outPutString.value + dataNode + nextRow + + // 标签头部 结束 + + + // 标签 子节点的内容 A 面 不循环 节点 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'A') + } + // 标签尾部 + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutString.value = outPutString.value + (endStr || '') + nextRow + } + } + } + if (_flag == 'start' && hasConfig.value == true) { + // 加工完成 收刀 + + // 收刀 + hasConfig.value = false + if (allProcessList.value && allProcessList.value[allProcessList.value.length - 1]) { + let finalWorkKnife = allProcessList.value[allProcessList.value.length - 1].processItem.knife + outPutString.value += finalWorkKnife.axisStopCode + finalWorkKnife.knifeStopCode + } + + } + + // B面 + if (_flag == 'start' || _flag == 'B') { + if (isUsedCondition == true) { + hasConfig.value = true + } + // B面 头部补充内容 + if (dataTextarea_start) { + + outPutStringB.value = outPutStringB.value + (dataTextarea_start || '') + nextRow + + } + // 判断数据的循环依赖 是否可以循环 可以的话节点进行循环 不可以直接输出 + if (isLoop && loopObj && loopObj.tagResB && Array.isArray(loopObj.tagResB)) { + if (loopObj.tagResB.length > 0) { + //轮廓 或者点阵等等 这一层级 会走这里 + const target = dataNode; + + let loopMore = false + + // 判断是否需要三级循环 针对 点阵 轮廓 + loopObj.tagResB.forEach(item => { + if (Array.isArray(item)) { + loopMore = true + } + }) + let loopItem = loopObj.tagResB[pid] + if (kid != -1 && kid != null) { + loopItem = loopItem[kid] + } + + if (loopMore && Array.isArray(loopItem) && pid != null && pid != -1) { + //** 到了这里 说明是 类似点阵 轮廓等信息 loopObj.tagRes 为 多维数组的时候 循环的基准点就变了 */ + + loopItem.forEach((noUsed, i) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let onceLoopVal = target + let changeKnifeCode: any = '' + // 换刀逻辑 + if (isUsedChangeKnife) { + changeKnifeCode = getChangeKnifeCode(ccc, loopObj, i, isCondition_Line) + + onceLoopVal = changeKnifeCode + onceLoopVal + } + + // 条件显示 + if (isUsedCondition && isCondition_Line == false) { + let conditionInfo = checkCondition(conditionList, ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + // if (changeKnifeCode != '') { + // onceLoopVal = changeKnifeCode + conditionInfo.dataTextarea + // } + } else { + onceLoopVal = '' + } + } + onceLoopVal = changeKnifeCode + onceLoopVal + + + let isLev3Loop = false; // 是否时三维数组 造型轮廓的时候 + let lev3LoopList: any = []; + // 替换操作 + dataObjectList.forEach((dataObj, q) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let tempVal = dataObj.tagResB + let tempDataObj = dataObj + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 B面 + let loopOrderByList = loopObj.tagResB[pid] + let loopTempVal: any = null + + try { + if (Array.isArray(tempVal)) { + loopTempVal = tempVal[pid] + } else { + loopTempVal = tempVal + } + } catch (error) { + + } + + if (kid != -1 && Array.isArray(loopTempVal)) { + loopTempVal = loopTempVal[kid] + loopOrderByList = loopOrderByList[kid] + } + // if (tempVal == null) { + // loopTempVal = '' + // } else { + // loopTempVal = tempVal[pid] + // } + + // if (kid != -1) { + // loopTempVal = loopTempVal[kid] + // loopOrderByList = loopOrderByList[kid] + // } + + if (tempVal && Array.isArray(tempVal[pid])) { + // let checkVal + + // 这里做个判定 如果数组的长度是一样的 默认为 同一个数据集 用loopObj.tagRes的下标i就好 + if (loopTempVal.length == loopOrderByList.length) { + + /** + 这里就还需要判断一层 + 如果是 点数据 、轮廓数据或者 3级数据的时候 (小板 =》小板明细 =》点阵|| 轮廓 数据集 =》具体细项(要显示的数据)) + tempDataObj.tagRes[i] 应该是个数组 一维数组的情况 + 这个时候 这个循环的基准 应该 再下一级 ?? + + 解决方案(暂定):在真正替换文本内容的时候 做个判断和循环 + */ + + tempDataObj.value = loopTempVal[i] // tempDataObj.tagResB[pid][i] + + } else if (tempVal.length == 1) { + // 若是只有一个项直接输出就好 + + tempDataObj.value = tempVal.join('、') + } else { + // 其它情况 直接输出 + + tempDataObj.value = tempVal.join('、') + } + + } else { + // 其它情况 直接输出 + tempDataObj.value = tempVal + } + + + // 真正的替换内容 + if (tempDataObj.value && Array.isArray(tempDataObj.value)) { + isLev3Loop = true + + if (lev3LoopList.length == tempDataObj.value.length) { + tempDataObj.value.forEach((val, j) => { + let temp = lev3LoopList[j] + + let replaceVal = val || ''; + let tempVal = temp.replaceAll(tempDataObj.sourceStr, replaceVal) + lev3LoopList[j] = tempVal + }); + } else { + tempDataObj.value.forEach(val => { + let temp = onceLoopVal + let tempVal = temp.replaceAll(tempDataObj.sourceStr, val) + lev3LoopList.push(tempVal); + }); + } + + } else { + if (isUsedCondition && isCondition_Line == true && q == 0) { + let _ccc = { ...ccc, q } + let conditionInfo = checkCondition(conditionList, _ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + } else { + onceLoopVal = '' + } + } + onceLoopVal = onceLoopVal.replaceAll(tempDataObj.sourceStr, tempDataObj.value) + } + }); + if (isLev3Loop) { + lev3LoopList.forEach(str => { + dataNode = str + // 判断是否缩进 + + if (isTab) { + outPutStringB.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 1 B', ccc) + outPutStringB.value = outPutStringB.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'B', i) + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutStringB.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutStringB.value = outPutStringB.value + (endStr || '') + nextRow + } + }) + } else { + dataNode = onceLoopVal + // 判断是否缩进 + + if (isTab) { + outPutStringB.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 2 B', ccc) + outPutStringB.value = outPutStringB.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'B', i) + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutStringB.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutStringB.value = outPutStringB.value + (endStr || '') + nextRow + } + } + + }) + + + } else { + // 走到这里 一般是 板件信息 或者订单信息 + loopObj.tagResB.forEach((noUsed, i) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let onceLoopVal = target + // 替换操作 + dataObjectList.forEach((dataObj, q) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let tempVal = dataObj.tagResB + let tempDataObj = dataObj + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 + if (Array.isArray(tempVal)) { + // let checkVal + + // 这里做个判定 如果数组的长度是一样的 默认为 同一个数据集 用loopObj.tagRes的下标i就好 + if (tempVal.length == loopObj.tagResB.length) { + + /** + 这里就还需要判断一层 + 如果是 点数据 、轮廓数据或者 3级数据的时候 (小板 =》小板明细 =》点阵|| 轮廓 数据集 =》具体细项(要显示的数据)) + tempDataObj.tagRes[i] 应该是个数组 一维数组的情况 + 这个时候 这个循环的基准 应该 再下一级 ?? + + 解决方案(暂定):在真正替换文本内容的时候 做个判断和循环 + */ + + tempDataObj.value = tempDataObj.tagResB[i] + + } else if (tempVal.length == 1) { + // 若是只有一个项直接输出就好 + + tempDataObj.value = tempVal.join('、') + } else { + // 其它情况 直接输出 + + tempDataObj.value = tempVal.join('、') + } + + } else { + // 其它情况 直接输出 + tempDataObj.value = tempVal + } + // 真正的替换内容 + if (isUsedCondition && isCondition_Line == true && q == 0) { + let _ccc = { ...ccc, q } + let conditionInfo = checkCondition(conditionList, _ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + } else { + onceLoopVal = '' + } + } + onceLoopVal = onceLoopVal.replaceAll(tempDataObj.sourceStr, tempDataObj.value) + }); + dataNode = onceLoopVal + // 判断是否缩进 + if (isTab) { + outPutStringB.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 3 B', ccc) + outPutStringB.value = outPutStringB.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, i, 'B') + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutStringB.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutStringB.value = outPutStringB.value + (dataTextarea_end || '') + nextRow + } + }); + } + } + + } else { + if (isTab) { + outPutStringB.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + + dataObjectList.forEach(dataObj => { + // 从字典拿回来的数据可能要二次操作 留个位置 + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 + let tempVal = dataObj.tagResB + + if (Array.isArray(tempVal)) { + if (pid != null) { + let target = tempVal[pid] + if (kid != -1) { + target = target[kid] + } + dataObj.value = target //tempVal[pid] + } else { + dataObj.value = tempVal.join('、') + } + } else { + dataObj.value = tempVal + } + + + dataNode = dataNode.replaceAll(dataObj.sourceStr, dataObj.value) + + + }); + console.log('ccc 4 B', ccc) + outPutStringB.value = outPutStringB.value + dataNode + nextRow + + // 标签头部 结束 + + + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'B') + } + // 标签尾部 + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutStringB.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutStringB.value = outPutStringB.value + (endStr || '') + nextRow + } + } + } + if (_flag == 'start' && hasConfig.value == true) { + // 加工完成 收刀 + + // 收刀 + hasConfig.value = false + if (allProcessList.value && allProcessList.value[allProcessList.value.length - 1]) { + let finalWorkKnife = allProcessList.value[allProcessList.value.length - 1].processItem.knife + outPutStringB.value += finalWorkKnife.axisStopCode + finalWorkKnife.knifeStopCode + } + + } + } else { + //#region 新的 写入文件 不分面 + + // 判断是否分面 + if (isUsedChangeKnife == true) { + hasConfig.value = true + } + + + // 头部补充内容 + if (dataTextarea_start) { + outPutString.value = outPutString.value + (dataTextarea_start || '') + nextRow + } + + + + // 判断数据的循环依赖 是否可以循环 可以的话节点进行循环 不可以直接输出 + if (isLoop && loopObj && loopObj.tagRes && Array.isArray(loopObj.tagRes)) { + if (loopObj.tagRes.length > 0) { + //轮廓 或者点阵等等 这一层级 会走这里 + const target = dataNode; + + let loopMore = false + + // 判断是否需要三级循环 针对 点阵 轮廓 + loopObj.tagRes.forEach(item => { + if (Array.isArray(item)) { + loopMore = true + } + }) + // pid 板 // kid // 造型 i + let loopItem = loopObj.tagRes[pid] + if (kid != -1 && kid != null) { + loopItem = loopItem[kid] + } + if (loopMore && Array.isArray(loopItem) && pid != null && pid != -1) { + //** 到了这里 说明是 类似点阵 轮廓等信息 loopObj.tagRes 为 多维数组的时候 循环的基准点就变了 */ + loopItem.forEach((noUsed, i) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let onceLoopVal = target + let changeKnifeCode: any = '' + // 换刀逻辑 + if (isUsedChangeKnife) { + changeKnifeCode = getChangeKnifeCode(ccc, loopObj, i, isCondition_Line) + + onceLoopVal = changeKnifeCode + onceLoopVal + } + + // 条件显示 + + if (isUsedCondition && isCondition_Line == false) { + let conditionInfo = checkCondition(conditionList, ccc, loopObj, i, isCondition_Line) + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + // if (changeKnifeCode != '') { + // onceLoopVal = changeKnifeCode + conditionInfo.dataTextarea + // } + } else { + onceLoopVal = '' + } + } + onceLoopVal = changeKnifeCode + onceLoopVal + + let isLev3Loop = false; // 是否时三维数组 造型轮廓的时候 + let lev3LoopList: any = []; + // 替换操作 + dataObjectList.forEach((dataObj, q) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let tempVal = dataObj.tagRes + let tempDataObj = dataObj + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 + let loopOrderByList = loopObj.tagRes[pid] + let loopTempVal = tempVal[pid] + if (kid != -1 && Array.isArray(tempVal)) { + + loopTempVal = loopTempVal[kid] + loopOrderByList = loopOrderByList[kid] + } + if (Array.isArray(loopTempVal)) { + // let checkVal + // 这里做个判定 如果数组的长度是一样的 默认为 同一个数据集 用loopObj.tagRes的下标i就好 + if (loopTempVal.length == loopOrderByList.length) { + + /** + 这里就还需要判断一层 + 如果是 点数据 、轮廓数据或者 3级数据的时候 (小板 =》小板明细 =》点阵|| 轮廓 数据集 =》具体细项(要显示的数据)) + tempDataObj.tagRes[i] 应该是个数组 一维数组的情况 + 这个时候 这个循环的基准 应该 再下一级 ?? + + 解决方案(暂定):在真正替换文本内容的时候 做个判断和循环 + */ + + // console.log('see!!!!!!!!!!!!!!!!!!!!',loopTempVal); + tempDataObj.value = loopTempVal[i] // tempDataObj.tagRes[pid][i] + + } else if (tempVal.length == 1) { + // 若是只有一个项直接输出就好 + + tempDataObj.value = tempVal.join('、') + } else { + // 其它情况 直接输出 + + tempDataObj.value = tempVal.join('、') + } + + } else { + // 其它情况 直接输出 + tempDataObj.value = tempVal + } + + + + // 真正的替换内容 + // 将数据写入的 当前节点的字符串 + + if (tempDataObj.value && Array.isArray(tempDataObj.value)) { + isLev3Loop = true + + if (lev3LoopList.length == tempDataObj.value.length && lev3LoopList.length) { + tempDataObj.value.forEach((val, j) => { + + let temp = lev3LoopList[j] + let tempVal = temp.replaceAll(tempDataObj.sourceStr, val) + lev3LoopList[j] = tempVal + }); + } else { + tempDataObj.value.forEach((val, j) => { + let temp = onceLoopVal + + let tempVal = temp.replaceAll(tempDataObj.sourceStr, val) + lev3LoopList.push(tempVal); + }); + } + + } else { + if (isUsedCondition && isCondition_Line == true && q == 0) { + let _ccc = { ...ccc, q } + let conditionInfo = checkCondition(conditionList, _ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + } else { + onceLoopVal = '' + } + } + onceLoopVal = onceLoopVal.replaceAll(tempDataObj.sourceStr, tempDataObj.value) + } + + }); + // 将当前节点的字符串 写入到文件的字符串 + if (isLev3Loop) { + lev3LoopList.forEach(str => { + dataNode = str + if(str.includes('{{<')){ + + dataNode = onceLoopVal + } + // 判断是否缩进 + + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 1', ccc, i,) + outPutString.value = outPutString.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'AB', i) + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutString.value = outPutString.value + (endStr || '') + nextRow + } + }) + } else { + dataNode = onceLoopVal + // 判断是否缩进 + + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 2 不封边', ccc, i) + outPutString.value = outPutString.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'AB', i) + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutString.value = outPutString.value + (endStr || '') + nextRow + } + } + + }) + + + } else { + // 走到这里 一般是 板件信息 或者订单信息 + loopObj.tagRes.forEach((noUsed, i) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let onceLoopVal = target + // 替换操作 + dataObjectList.forEach((dataObj, q) => { + // 从字典拿回来的数据可能要二次操作 留个位置 + let tempVal = dataObj.tagRes + let tempDataObj = dataObj + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 + if (Array.isArray(tempVal)) { + // let checkVal + + // 这里做个判定 如果数组的长度是一样的 默认为 同一个数据集 用loopObj.tagRes的下标i就好 + if (tempVal.length == loopObj.tagRes.length) { + + /** + 这里就还需要判断一层 + 如果是 点数据 、轮廓数据或者 3级数据的时候 (小板 =》小板明细 =》点阵|| 轮廓 数据集 =》具体细项(要显示的数据)) + tempDataObj.tagRes[i] 应该是个数组 一维数组的情况 + 这个时候 这个循环的基准 应该 再下一级 ?? + + 解决方案(暂定):在真正替换文本内容的时候 做个判断和循环 + */ + + tempDataObj.value = tempDataObj.tagRes[i] + + } else if (tempVal.length == 1) { + // 若是只有一个项直接输出就好 + + tempDataObj.value = tempVal.join('、') + } else { + // 其它情况 直接输出 + + tempDataObj.value = tempVal.join('、') + } + + } else { + // 其它情况 直接输出 + tempDataObj.value = tempVal + } + // 真正的替换内容 + if (isUsedCondition && isCondition_Line == true && q == 0) { + let _ccc = { ...ccc, q } + let conditionInfo = checkCondition(conditionList, _ccc, loopObj, i, isCondition_Line) + + if (conditionInfo) { + onceLoopVal = conditionInfo.dataTextarea + } else { + onceLoopVal = '' + } + } + onceLoopVal = onceLoopVal.replaceAll(tempDataObj.sourceStr, tempDataObj.value) + }); + dataNode = onceLoopVal + // 判断是否缩进 + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + console.log('ccc 3', ccc, i) + outPutString.value = outPutString.value + dataNode + nextRow + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + createCNC(item.children, lvl + 1, targetSource, exportFileType, i, 'AB') + } + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + outPutString.value = outPutString.value + (endStr || '') + nextRow + } + }); + } + } + + } else { + if (isTab) { + outPutString.value += tabVal; + dataNode = dataNode.replaceAll('\n', '\n' + tabVal) + } + + dataObjectList.forEach(dataObj => { + // 从字典拿回来的数据可能要二次操作 留个位置 + // 绝大多数的返回数据 这里控制的返回都是 数组 + // 这里是不循环的输出结构即可 + let tempVal = dataObj.tagRes + + if (Array.isArray(tempVal)) { + if (pid != null) { + let target = tempVal[pid] + if (kid != -1) { + target = target[kid] + } + dataObj.value = target //tempVal[pid] + } else { + dataObj.value = tempVal.join('、') + } + } else { + dataObj.value = tempVal + } + + + dataNode = dataNode.replaceAll(dataObj.sourceStr, dataObj.value) + + + }); + console.log('ccc 4', ccc) + outPutString.value = outPutString.value + dataNode + nextRow + + // 标签头部 结束 + + + // 标签 子节点的内容 + if (item.children && Array.isArray(item.children)) { + + + createCNC(item.children, lvl + 1, targetSource, exportFileType, pid, 'AB') + } + // 标签尾部 + if (dataTextarea_end) { + let endStr = dataTextarea_end || '' + if (isTab) { + outPutString.value += tabVal; + endStr = endStr.replaceAll('\n', '\n' + tabVal) + } + + outPutString.value = outPutString.value + (endStr || '') + nextRow + + } + } + + if (_flag == 'start' && hasConfig.value == true) { + // 加工完成 收刀 + + // 收刀 + hasConfig.value = false + if (allProcessList.value && allProcessList.value[allProcessList.value.length - 1]) { + let finalWorkKnife = allProcessList.value[allProcessList.value.length - 1].processItem.knife + outPutStringB.value += finalWorkKnife.axisStopCode + finalWorkKnife.knifeStopCode + } + + } + + //#endregion 新的 结束 + + } + }) + } + + if (flag == undefined) { + console.log('加工结束 收刀'); + } +} + + + + + + + + +/** 翻转小板,翻转动作opType: 0翻面 1右转 2后转 3左转 */ +function turnBlock(block: PlaceBlock, opType: number, checkOverlap = true) { + let orgStyle = block.placeStyle + let newStyle = BlockHelper.getTurnedPlaceStyle(orgStyle, opType) + + let orgPlaceX = block.placeX - block.placeOffX + let orgPlaceY = block.placeY - block.placeOffY + + let offset = BlockSizePlus.getOffDis(block, newStyle) + let newPlaceX = orgPlaceX + offset.x + let newPlaceY = orgPlaceY + offset.y + block.placeOffX = offset.x + block.placeOffY = offset.y + // 修改小板的放置方式 + // console.log('修改小板的放置方式', block.blockNo, block, newStyle) + + resetPlaceStyle(block, newStyle, true) + // 重置放置,检查冲突 + // BlockHelper.replaceBlock(block.placeMaterial, block, block.boardId, new Point(newPlaceX, newPlaceY)) +} + +export function resetPlaceStyle(block: PlaceBlock, newStyle: PlaceStyle, isCNC: boolean = false) { + block.placeStyle = newStyle + + // tryFix + let _width = block.cutWidth + let _lenth = block.cutLength + if (block.width > block.length) { + block.cutWidth = Math.max(_width, _lenth) + block.cutLength = Math.min(_width, _lenth) + } else { + block.cutWidth = Math.min(_width, _lenth) + block.cutLength = Math.max(_width, _lenth) + } + + + switch (newStyle) { + case PlaceStyle.FRONT: // 正面 + block.placeWidth = block.cutWidth + block.placeLength = block.cutLength + block.placeSealLeft = block.sealLeft + block.placeSealRight = block.sealRight + block.placeSealTop = block.sealTop + block.placeSealBottom = block.sealBottom + block.holeCountSideLeft = block.holeCountLeft + block.holeCountSideRight = block.holeCountRight + block.holeCountSideTop = block.holeCountTop + block.holeCountSideBottom = block.holeCountBottom + block.placeDirection = '→' + block.placeDirection_Length = block.length > block.width - 0.001 ? '→' : '↓' + break + case PlaceStyle.FRONT_TURN_RIGHT: // 正面右转 + block.placeWidth = block.cutLength + block.placeLength = block.cutWidth + block.placeSealLeft = block.sealBottom + block.placeSealRight = block.sealTop + block.placeSealTop = block.sealLeft + block.placeSealBottom = block.sealRight + block.holeCountSideLeft = block.holeCountBottom + block.holeCountSideRight = block.holeCountTop + block.holeCountSideTop = block.holeCountLeft + block.holeCountSideBottom = block.holeCountRight + + block.modelCountSideLeft = block.modelCountBottom + block.modelCountSideRight = block.modelCountTop + block.modelCountSideTop = block.modelCountLeft + block.modelCountSideBottom = block.modelCountRight + + block.placeDirection = '↓' + block.placeDirection_Length = block.length > block.width - 0.001 ? '↓' : '←' + break + case PlaceStyle.FRONT_TURN_BACK: // 正面后转 + block.placeWidth = block.cutWidth + block.placeLength = block.cutLength + block.placeSealLeft = block.sealRight + block.placeSealRight = block.sealLeft + block.placeSealTop = block.sealBottom + block.placeSealBottom = block.sealTop + block.holeCountSideLeft = block.holeCountRight + block.holeCountSideRight = block.holeCountLeft + block.holeCountSideTop = block.holeCountBottom + block.holeCountSideBottom = block.holeCountTop + block.placeDirection = '←' + block.placeDirection_Length = block.length > block.width - 0.001 ? '←' : '↑' + break + case PlaceStyle.FRONT_TURN_LEFT: // 正面左转 + block.placeWidth = block.cutLength + block.placeLength = block.cutWidth + block.placeSealLeft = block.sealTop + block.placeSealRight = block.sealBottom + block.placeSealTop = block.sealRight + block.placeSealBottom = block.sealLeft + block.holeCountSideLeft = block.holeCountTop + block.holeCountSideRight = block.holeCountBottom + block.holeCountSideTop = block.holeCountRight + block.holeCountSideBottom = block.holeCountLeft + block.placeDirection = '↑' + block.placeDirection_Length = block.length > block.width - 0.001 ? '↑' : '→' + break + case PlaceStyle.BACK: // 反面 + block.placeWidth = block.cutWidth + block.placeLength = block.cutLength + block.placeSealLeft = block.sealRight + block.placeSealRight = block.sealLeft + block.placeSealTop = block.sealTop + block.placeSealBottom = block.sealBottom + block.holeCountSideLeft = block.holeCountRight + block.holeCountSideRight = block.holeCountLeft + block.holeCountSideTop = block.holeCountTop + block.holeCountSideBottom = block.holeCountBottom + block.placeDirection = '→' + block.placeDirection_Length = block.length > block.width - 0.001 ? '→' : '↑' + break + case PlaceStyle.BACK_TURN_RIGHT: // 反面右转 + block.placeWidth = block.cutLength + block.placeLength = block.cutWidth + block.placeSealLeft = block.sealBottom + block.placeSealRight = block.sealTop + block.placeSealTop = block.sealRight + block.placeSealBottom = block.sealLeft + block.holeCountSideLeft = block.holeCountBottom + block.holeCountSideRight = block.holeCountTop + block.holeCountSideTop = block.holeCountRight + block.holeCountSideBottom = block.holeCountLeft + block.placeDirection = '↓' + block.placeDirection_Length = block.length > block.width - 0.001 ? '↓' : '→' + break + case PlaceStyle.BACK_TURN_BACK: // 反面后转 + block.placeWidth = block.cutWidth + block.placeLength = block.cutLength + block.placeSealLeft = block.sealLeft + block.placeSealRight = block.sealRight + block.placeSealTop = block.sealTop + block.placeSealBottom = block.sealBottom + block.holeCountSideLeft = block.holeCountLeft + block.holeCountSideRight = block.holeCountRight + block.holeCountSideTop = block.holeCountTop + block.holeCountSideBottom = block.holeCountBottom + block.placeDirection = '←' + block.placeDirection_Length = block.length > block.width - 0.001 ? '←' : '↓' + break + case PlaceStyle.BACK_TURN_LEFT: // 反面左转 + block.placeWidth = block.cutLength + block.placeLength = block.cutWidth + block.placeSealLeft = block.sealTop + block.placeSealRight = block.sealBottom + block.placeSealTop = block.sealLeft + block.placeSealBottom = block.sealRight + block.holeCountSideLeft = block.holeCountTop + block.holeCountSideRight = block.holeCountBottom + block.holeCountSideTop = block.holeCountLeft + block.holeCountSideBottom = block.holeCountRight + block.placeDirection = '↑' + block.placeDirection_Length = block.length > block.width - 0.001 ? '↑' : '←' + break + default: + break + } + // this.resetDoFace_HoleModel(block) + resetDoFace_HoleModel(block, isCNC) +} + +function resetDoFace_HoleModel(block: PlaceBlock, isCNC: boolean = false) { + + let isTurnOver = block.isTurnOver + + let orgMA = block.blockDetail.modelListFaceA + let orgMB = block.blockDetail.modelListFaceB + let orgMT = block.blockDetail.modelListThrough + let orgHA = block.blockDetail.holeListFaceA + let orgHB = block.blockDetail.holeListFaceB + let orgHT = block.blockDetail.holeListThrough + + if (isTurnOver) { + block.modelListFaceA = orgMB.concat(orgMT); + block.modelListFaceB = orgMA; + block.holeListFaceA = orgHB.concat(orgHT); + block.holeListFaceB = orgHA; + } + else { + block.modelListFaceA = orgMA.concat(orgMT); + block.modelListFaceB = orgMB; + block.holeListFaceA = orgHA.concat(orgHT);; + block.holeListFaceB = orgHB; + } + + + //获取贴标位置 + let p = getPlaceXYInBlock(block, block.blockDetail.labelPosX, block.blockDetail.labelPosY, false, false); + block.labelPosX = p.x; + block.labelPosY = p.y; +} + +/** 获得原坐标在放置后的新坐标 */ +function getPlaceXYInBlock(block: PlaceBlock, x: number, y: number, isSealed: boolean, isFaceB = false, preCutValueOff = null): Point { + let bwidth = block.cutWidth + let blength = block.cutLength + let x0: any = x + let y0: any = y + if (isSealed) // 已封边 + { + bwidth = block.width + blength = block.length + x0 += block.offsetX + y0 += block.offsetY + } + if (!isSealed && preCutValueOff) // 没封边,且有封边 + { + bwidth += preCutValueOff.w + blength += preCutValueOff.l + x0 += preCutValueOff.x + y0 += preCutValueOff.y + } + + let _point: any = BlockHelper.getPlacedPostionInBlock(block.placeStyle, bwidth, blength, x0, y0, isFaceB) + + return _point +} +/* 设置数据源 导出CNC时 用到的数据源 */ +async function _setDataSource(sourceIn, exportFileType) { + let targetSourceList: any = []; + if (Array.isArray(sourceIn)) { + targetSourceList = sourceIn + } else { + targetSourceList = [sourceIn] + } + + let source: Array | Array = targetSourceList + // 数据归类 A(正面)B(反面) + /**翻面后的数据集 反面 */ + let sourceB: Array | Array = [] + + /**正面的数据集 */ + let sourceA: Array | Array = [] + + if (drillConfig.value?.isFileSort == undefined) { + drillConfig.value.isFileSort = false + } + + if (drillConfig.value?.isFileSort == true) { + + if (exportFileType == 0 || exportFileType == 1) { + // 这里的 数据源是小板的集合 做个分类 + + for (const block of source) { + + + let hasProcess = false + let doSideModel = false + let hasA = (block.blockDetail.holeListFaceA.length > 0 || block.blockDetail.modelListFaceA.length > 0) + let hasB = (block.blockDetail.holeListFaceB.length > 0 || block.blockDetail.modelListFaceB.length > 0) + + + if (hasA == false && hasB == false) { + hasA = true + } + if (placeData.value.sysConfig.isExportOrderProcess) { + hasA = true + hasB = true + } + // placeData.value.sysConfig.isExportOrderProcess + + if (hasA) { + var blockA: PlaceBlock = cloneDeep(block) + resetPlaceStyle(blockA, blockA.placeStyle, true) + if (blockA.blockDetail.holes.length > 0 || blockA.blockDetail.models.length > 0) { + hasProcess = true + } + + if (blockA.blockDetail.modelListSide.length > 0) { + doSideModel = true + hasProcess = true + } + + for (const hole of blockA.holes) { + let p = await BlockHelper.getPlaceXYInBoard(blockA, hole.pointX, hole.pointY) + + hole.pointX = p.x + hole.pointY = p.y + hole.pointZ = getProcessItemPointZ(hole.depth, blockA.thickness, hole.face, false) + } + + + for (const hole of blockA.holeListFaceA) { + let p = await BlockHelper.getPlaceXYInBoard(blockA, hole.pointX, hole.pointY) + + hole.pointX = p.x + hole.pointY = p.y + hole.pointZ = getProcessItemPointZ(hole.depth, blockA.thickness, hole.face, false) + } + + for (const hole of blockA.holeListFaceB) { + let p = await BlockHelper.getPlaceXYInBoard(blockA, hole.pointX, hole.pointY) + + hole.pointX = p.x + hole.pointY = p.y + hole.pointZ = getProcessItemPointZ(hole.depth, blockA.thickness, hole.face, false) + } + + for (const model of blockA.modelListFaceA) { + model.pointList.forEach(async point => { + let p = await BlockHelper.getPlaceXYInBoard(blockA, point.pointX, point.pointY) + point.pointX = p.x + point.pointY = p.y + // point.pointZ = getProcessItemPointZ(point.depth, blockA.thickness, model.face, false) + }) + } + + for (const model of blockA.modelListFaceB) { + model.pointList.forEach(async point => { + let p = await BlockHelper.getPlaceXYInBoard(blockA, point.pointX, point.pointY) + point.pointX = p.x + point.pointY = p.y + // point.pointZ = getProcessItemPointZ(point.depth, blockA.thickness, model.face, false) + }) + } + + for (const sideModel of blockA.blockDetail.modelListSide) { + if (sideModel.realPointList.length == 0) { + sideModel.realPointList = sideModel.pointList + } + for (const point of sideModel.realPointList) { + let p = await BlockHelper.getPlaceXYInBoard(blockA, point.pointX, point.pointY) + point.pointX = p.x + point.pointY = p.y + // point.pointZ = Math.abs(point.pointZ) - blockA.thickness + // point.pointZ = getProcessItemPointZ(point.pointZ, blockA.thickness, sideModel.direction, true) // Math.abs(point.pointZ) - blockA.thickness + } + } + const border_final = await BlockPlus.transformBorder(blockA.blockDetail.borderContour.borderFinal, blockA.placeStyle, blockA.width, blockA.length) + blockA.blockDetail.borderContour.borderFinal = border_final + + const border = await BlockPlus.transformBorder(blockA.blockDetail.borderContour.border, blockA.placeStyle, blockA.width, blockA.length) + blockA.blockDetail.borderContour.border = border + + const borderOrg = await BlockPlus.transformBorder(blockA.blockDetail.borderContour.borderOrg, blockA.placeStyle, blockA.width, blockA.length) + blockA.blockDetail.borderContour.borderOrg = borderOrg + await transformDataValue(blockA, drillConfig.value.projectList) + sourceA.push(blockA) + } + + if (hasB) { + var blockB: PlaceBlock = cloneDeep(block) //new PlaceBlock(block) + resetPlaceStyle(blockB, blockB.placeStyle, true) + // 穿 孔 || 造型 剔除掉 + //#region 挖穿的 部分 有A面加工 在A面做 没有的话 在B面做 + if (hasProcess == false) { + blockB.holeListFaceB = blockB.holeListFaceB.filter(e => e.depth < blockB.thickness); + blockB.holeListFaceA = blockB.holeListFaceA.filter(e => e.depth < blockB.thickness); + + blockB.blockDetail.holes = blockB.holes.filter(e => e.depth < blockB.thickness) + blockB.blockDetail.holeListFaceB = blockB.holeListFaceB.filter(e => e.depth < blockB.thickness); + blockB.blockDetail.holeListFaceA = blockB.holeListFaceA.filter(e => e.depth < blockB.thickness); + + blockB.modelListFaceA.filter(e => e.depth < blockB.thickness) + blockB.modelListFaceB.filter(e => e.depth < blockB.thickness) + + blockB.blockDetail.modelListFaceA.filter(e => e.depth < blockB.thickness) + blockB.blockDetail.modelListFaceB.filter(e => e.depth < blockB.thickness) + blockB.blockDetail.models.filter(e => e.depth < blockB.thickness) + } + //#endregion + await turnBlock(blockB, 0) + + for (const hole of block.holes) { + let p = await BlockHelper.getPlaceXYInBoard(blockB, hole.pointX, hole.pointY) + + hole.pointX = p.x + hole.pointY = p.y + } + + + for (const hole of blockB.holeListFaceA) { + let p = await BlockHelper.getPlaceXYInBoard(blockB, hole.pointX, hole.pointY) + + hole.pointX = p.x + hole.pointY = p.y + } + + for (const hole of blockB.holeListFaceB) { + let p = await BlockHelper.getPlaceXYInBoard(blockB, hole.pointX, hole.pointY) + + hole.pointX = p.x + hole.pointY = p.y + } + + for (const model of blockB.modelListFaceA) { + for (const point of model.pointList) { + let p = await BlockHelper.getPlaceXYInBoard(blockB, point.pointX, point.pointY) + point.pointX = p.x + point.pointY = p.y + } + + } + + for (const model of blockB.modelListFaceB) { + for (const point of model.pointList) { + let p = await BlockHelper.getPlaceXYInBoard(blockB, point.pointX, point.pointY) + point.pointX = p.x + point.pointY = p.y + } + } + + for (const sideModel of blockB.blockDetail.modelListSide) { + if (sideModel.realPointList.length == 0) { + sideModel.realPointList = sideModel.pointList + } + for (const point of sideModel.realPointList) { + let p = await BlockHelper.getPlaceXYInBoard(blockB, point.pointX, point.pointY) + point.pointX = p.x + point.pointY = p.y + point.pointZ = Math.abs(point.pointZ) - blockB.thickness + } + } + + + + + const border_final = await BlockPlus.transformBorder(blockB.blockDetail.borderContour.borderFinal, blockB.placeStyle, blockB.width, blockB.length) + blockB.blockDetail.borderContour.borderFinal = border_final + + + const border = await BlockPlus.transformBorder(blockB.blockDetail.borderContour.border, blockB.placeStyle, blockB.width, blockB.length) + blockB.blockDetail.borderContour.border = border + + + const borderOrg = await BlockPlus.transformBorder(blockB.blockDetail.borderContour.borderOrg, blockB.placeStyle, blockB.width, blockB.length) + blockB.blockDetail.borderContour.borderOrg = borderOrg + + await transformDataValue(blockB, drillConfig.value.projectList) + + sourceB.push(blockB) + // sourceB.push(blockB) + } + } + + + } else { + sourceA = source.slice(); + sourceB = source.slice(); + // 这里的 数据源是大板的集合 + sourceB.forEach(board => { + PlacePositionHelper.turnPlacePosition(board, drillConfig.value.processLocation) + + board.blockList.forEach(block => { + turnBlock(block, 0) + + BlockHelper.resetPlaceStyle(block, block.placeStyle) + + const border_final = BlockPlus.transformBorder(block.blockDetail.borderContour.borderFinal, block.placeStyle, block.width, block.length) + const border = BlockPlus.transformBorder(block.blockDetail.borderContour.border, block.placeStyle, block.width, block.length) + const borderOrg = BlockPlus.transformBorder(block.blockDetail.borderContour.borderOrg, block.placeStyle, block.width, block.length) + block.blockDetail.borderContour.borderFinal = border_final + block.blockDetail.borderContour.border = border + block.blockDetail.borderContour.borderOrg = borderOrg + + transformDataValue(block, drillConfig.value.projectList) + }); + }); + } + // console.log('sourceA:', sourceA[0]?.place, 'sourceB:', sourceB) + } + + // 加工项做个排序 减少换刀 + // sortSource 排序 + fileDataA.value = sourceA + fileDataB.value = sourceB + fileDataAB.value = source + + + return +} +/** + * 获取实际Z坐标 + * @param depth 加工深度 + * @param thickness 板厚 + * @param face 0 正面 1 反面 加工面 若侧面造型 face读取 _flag(加工面)-- =》A =0 B = 1 AB = 2 + * @param isSide true 是 false 否 是否是侧面加工 + * 说明 条件1、 板面 或者是 台面 --机台配置 originZ0Position + * 条件2、 是否翻面加工 (A面 B面) --根据是否分面导出判断 + * 条件3、 判断哪个面的加工 + * 若 isSide 为true depth 要穿 pointZ + * @returns + */ +function getProcessItemPointZ(depth: number, thickness: number, face, isSide) { + let z = 0 + if (isSide) { + // 侧面加工 + if (drillConfig.value?.originZ0Position == 0) { + // 台面 + if (drillConfig.value?.isFileSort == true) { + // 分面 + if (face == 0) { + // 正面 + z = depth + } else { + // 反面 + z = thickness - depth + } + + } else { + // 不分面 + if (face == 0) { + // 正面 + z = thickness - depth + } else { + // 反面 + z = depth + } + } + } else { + // 板面 + if (drillConfig.value?.isFileSort == true) { + // 分面 + if (face == 0) { + // 正面 + z = - depth + } else { + // 反面 + z = - depth + } + } else { + // 不分面 + + if (face == 0) { + // 正面 + z = - depth + } else { + // 反面 + z = - (thickness - depth) + } + } + } + } else { + // 垂直加工 + + if (drillConfig.value?.originZ0Position == 0) { + // 台面 + + if (drillConfig.value?.isFileSort == true) { + // 分面 + if (face == 0) { + // 正面 + z = thickness - depth + } else { + // 反面 + z = thickness - depth + } + } else { + // 不分面 + if (face == 0) { + // 正面 + z = thickness - depth + } else { + // 反面 + z = depth + } + } + } else { + // 板面 + + if (drillConfig.value?.isFileSort == true) { + // 分面 + if (face == 0) { + // 正面 + z = - depth + } else { + // 反面 + z = - depth + } + } else { + // 不分面 + if (face == 0) { + // 正面 + z = - depth + } else { + // 反面 + z = - (thickness - depth) + } + } + } + } + + return z +} + +function sortSourceProcess(arr) { + arr.sort((a, b) => a.radius - b.radius) +} + +const fileDataA = ref() +const fileDataB = ref() +const fileDataAB = ref() + +/** + * @param dictItem 字典 object 包含 type 大类标识 itemKey 小类标识 + * @param source 依据的数据项 + * @param exportFileType 导出模式 + * @param boardIndex exportFileType 为 2 大板独立模式时可能会用到 + * @param isFaceB 导出的面 为空 则导出所有 true 导出 B面(反面) false 导出 A面(正面) + * 注: 处理正反面数据的时候 + */ +/**数据处理 取值 */ +export function getPlaceDataValueByDic(dictItem: any, sourceIn?: any, exportFileType?: any) { + + // 数据归类 A(正面)B(反面) + /**翻面后的数据集 反面 */ + let sourceB: Array | Array = [] + + /**正面的数据集 */ + let sourceA: Array | Array = [] + + let source: Array | Array = [] + + source = fileDataAB.value + sourceA = fileDataA.value + sourceB = fileDataB.value + // 代码控制了下 这边 source 只可能为 block 的list 或者是 material 的list + // 0(单条数据小板) 1(所有小板) 2 (单条商品|大板) 3 (所有商品 | 大板) + + + /** + * 注---需要特殊处理的数据 + * 1、翻面 AB 面的数据 + * + * 加工-成品轮廓信息 outline + * 加工-开料成型轮廓信息 cuttingoutline + * 加工-坯料轮廓信息 rawoutline + * 加工-垂直孔列表 holes + * 加工-侧孔列表 sideHoles + * 加工-造型/凹槽列表-垂直 grooves + * 加工-造型/凹槽列表-水平 groovesH + * + * 以上数据需要处理 dictItem.tagResB 和 dictItem.tagResA 要加载对应的数据 + * */ + // 暂不处理 的值 -- 留个位置 暂时没用 + let nodeal = 'noDeal' + // fileInfo + + /** + * 辅助处理数据的 数据集 + */ + + // 余料大板 + let remainBoardList: any = [] + placeData.value.materialList.forEach(material => { + remainBoardList = remainBoardList.concat(material.remainBoardList) + }); + + + // 大板 ID集合 + let goodsIdList: any = []; + + if (exportFileType == 0 || exportFileType == 1) { + goodsIdList = source.map(e => e.goodsId) + } + let originZ0Position = drillConfig.value.originZ0Position + /**解析 说明 + * + * 如果分AB面 解析数据的时候 只要取对应面的数据就好 + * + * 这里就是 如果有分AB面 将 AB面的数据 怼到 dictItem.tagResB 和 dictItem.tagResA 里面 + */ + + switch (dictItem.type) { + // 文件信息 + //#region 文件信息 + case 'fileInfo': + switch (dictItem.itemKey) { + case 'version': + // 文件信息fileInfo + dictItem.tagRes = nodeal + break; + case 'encoding': + // 文件信息fileInfo + dictItem.tagRes = placeData.value.sysConfig.ncFileEncoding + break; + // case 'exportTime': + // dictItem.tagRes = new Date().getTime() + // break; + case 'sourceFlag': + // 文件信息fileInfo + dictItem.tagRes = nodeal + break; + case 'sourceType': + // 文件信息fileInfo + dictItem.tagRes = nodeal + break; + case 'exportTime': + // 文件信息fileInfo + dictItem.tagRes = formatToDate(new Date(), 'YYYY-MM-DD HH:mm:ss') + break; + case 'processFileOrderByFace': + // 文件信息fileInfo + dictItem.tagRes = drillConfig.value?.isFileSort || '' + break; + case 'processFileNameFaceA': + // 文件信息fileInfo + var fileName = drillConfig.value?.fileFrontPathName || '' + var fileNameConfigList = fileName.match(/{{\<([^>]*)>\}}/g) + + fileNameConfigList && fileNameConfigList.forEach(val => { + if (exportFileType == 0 || exportFileType == 1) { + var newVal = getFileName(val, exportFileType, source, true); + fileName = fileName.replaceAll(val, newVal) + } + + }) + dictItem.tagRes = fileName + break; + case 'processFileNameFaceB': + // 文件信息fileInfo + var fileName = drillConfig.value?.fileBackPathName || '' + var fileNameConfigList = fileName.match(/{{\<([^>]*)>\}}/g) + + fileNameConfigList && fileNameConfigList.forEach(val => { + if (exportFileType == 0 || exportFileType == 1) { + var newVal = getFileName(val, exportFileType, source, true); + fileName = fileName.replaceAll(val, newVal) + } + }) + dictItem.tagRes = fileName + + break; + case 'ZipName': + // 文件信息fileInfo + dictItem.tagRes = drillConfig.value?.zipPathName || '' + break; + case 'exportEmptyOrder': + // 文件信息fileInfo + dictItem.tagRes = drillConfig.value?.isExportOrderNoBoard || '' + break; + case 'exportEmptyBoard': + // 文件信息fileInfo + dictItem.tagRes = drillConfig.value?.isExportOrderNoProcess || '' + break; + case 'exportProcessed': + // 文件信息fileInfo + dictItem.tagRes = drillConfig.value?.isExportOrderProcess || '' + break; + case 'notSignAlone': + // 文件信息fileInfo + dictItem.tagRes = drillConfig.value?.isAlreadyOrderProcess || '' + break; + default: + break; + } + break; + + //#endregion 文件信息 + // 订单信息 + //#region 订单信息 + case 'orders': + switch (dictItem.itemKey) { + case 'orderId': + // 订单信息 orders + // 现在只有一个 orderId 没有 orderNo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.orderId) + } else { + // 如果是 2 或者 3 的时候 orderId 是个数组 + dictItem.tagRes = source.map(e => e.orderId).toString().split(','); + } + break; + case 'orderNo': + // 订单信息 orders + // 现在只有一个 orderId 没有 orderNo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.orderId) + } else { + // 如果是 2 或者 3 的时候 orderId 是个数组 + dictItem.tagRes = source.map(e => e.orderId).toString().split(','); + } + break; + case 'customOrderNo': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.customOrderNo) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.customOrderNo) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + + break; + case 'dealer': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.dealer) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.dealer) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + + break; + case 'orderDate': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.orderDate) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.orderDate) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + break; + case 'deliveryDate': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.deliveryDate) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.deliveryDate) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + + break; + case 'customer': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.customer) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.customer) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + break; + case 'phoneNumber': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.phoneNumber) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.phoneNumber) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + + break; + case 'address': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.address) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.address) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + + break; + case 'salesman': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.salesman) + } else { + let tagRes: any = []; + + source.forEach(e => { + let res = e.blockList.map(e => e.order.salesman) + tagRes = tagRes.concat(res) + }) + + dictItem.tagRes = tagRes + } + break; + case 'splitter': + // 订单信息 orders + // dictItem.tagRes = source.map(e => e.order.splitter) + + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.splitter) + } else { + let tagRes: any = []; + source.forEach(e => { + let res = e.blockList.map(e => e.order.splitter) + tagRes = tagRes.concat(res) + }) + dictItem.tagRes = tagRes + } + break; + case 'status': + // 订单信息 orders + // dictItem.tagRes = source.map(e => e.order.status) + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.status) + } else { + let tagRes: any = []; + source.forEach(e => { + let res = e.blockList.map(e => e.order.status) + tagRes = tagRes.concat(res) + }) + dictItem.tagRes = tagRes + } + break; + case 'remark': + // 订单信息 orders + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.order.remark) + } else { + let tagRes: any = []; + source.forEach(e => { + let res = e.blockList.map(e => e.order.remark) + tagRes = tagRes.concat(res) + }) + dictItem.tagRes = tagRes + } + // dictItem.tagRes = source.map(e => e.order.remark) + break; + default: + break; + } + break; + + //#endregion 订单信息 + //排单信息 + + //#region 排单信息 + case 'planOrder': + switch (dictItem.itemKey) { + case 'id': + //排单信息 planOrder + dictItem.tagRes = placeData.value.planId + break; + case 'plateInfoList': + //排单信息 planOrder + dictItem.tagRes = placeData.value.materialList.map(e => e.goodsName) + break; + case 'machineName': + //排单信息 planOrder + dictItem.tagRes = placeData.value.source.machineName + break; + case 'status': + //排单信息 planOrder + dictItem.tagRes = placeData.value.status + break; + case 'optimizeGoodsCount': + //排单信息 planOrder + let length = placeData.value.blockList.length + let blockCountList = placeData.value.materialList.map(e => e.blockCount) + let count = 0; + blockCountList.forEach(e => { + count += e; + }) + dictItem.tagRes = length - count + break; + case 'cutGoodsCount': + //排单信息 planOrder + break; + case 'plateNum': + //排单信息 planOrder + dictItem.tagRes = placeData.value.blockList.length + + break; + case 'unOptimizePlateCount': + //排单信息 planOrder + break; + case 'optimizePlateCount': + //排单信息 planOrder + break; + case 'remark': + //排单信息 planOrder + dictItem.tagRes = placeData.value.remark + break; + case 'createTime': + //排单信息 planOrder + dictItem.tagRes = placeData.value.createTime + break; + case 'creator': + //排单信息 planOrder + dictItem.tagRes = placeData.value.creator + break; + case 'produceTime': + //排单信息 planOrder + dictItem.tagRes = placeData.value.produceTime + break; + default: + break; + } + break + + //#endregion 排单信息 + // 大板 + //#region 大板 + case 'materials': + switch (dictItem.itemKey) { + case 'produceTime': + // 大板(商品)materials + // dictItem.tagRes = placeData.value.materialList + break; + case 'goodsName': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.goodsName) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.goodsName); + } + }); + dictItem.tagRes = res + } + + break; + case 'material': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.material) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.material); + } + }); + dictItem.tagRes = res + } + // dictItem.tagRes = placeData.value.materialList.map(e => e.material) + break; + case 'color': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.color) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.color); + } + }); + dictItem.tagRes = res + } + + break; + case 'texture': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.hasTexture) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.hasTexture); + } + }); + dictItem.tagRes = res + } + break; + case 'brand': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.brand) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.brand); + } + }); + dictItem.tagRes = res + } + break; + case 'width': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.width)) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.width); + } + }); + dictItem.tagRes = res + } + break; + case 'length': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.length)) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.length); + } + }); + dictItem.tagRes = res + } + // dictItem.tagRes = placeData.value.materialList.map(e => outPutFloatNumberByConfig(e.length)) + break; + case 'thickness': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.thickness) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.thickness); + } + }); + dictItem.tagRes = res + } + // dictItem.tagRes = placeData.value.materialList.map(e => e.thickness) + break; + case 'oddmentLength': + // 大板(商品)materials + dictItem.tagRes = remainBoardList.filter(e => goodsIdList.includes(e.goodsId))?.map(e => outPutFloatNumberByConfig(e.length)) + break; + case 'oddmentWidth': + // 大板(商品)materials + dictItem.tagRes = remainBoardList.filter(e => goodsIdList.includes(e.goodsId))?.map(e => outPutFloatNumberByConfig(e.width)) + // dictItem.tagRes = remainBoardList.map(e => outPutFloatNumberByConfig(e.width)) + break; + case 'oddmentThickness': + // 大板(商品)materials + dictItem.tagRes = remainBoardList.filter(e => goodsIdList.includes(e.goodsId))?.map(e => e.thickness) + // dictItem.tagRes = remainBoardList.map(e => e.thickness) + break; + case 'oddmentNo': + // 大板(商品)materials + dictItem.tagRes = remainBoardList.filter(e => goodsIdList.includes(e.goodsId))?.map(e => e.id) + // dictItem.tagRes = remainBoardList.map(e => e.id) + break; + case 'spec': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.spec) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.spec); + } + }); + dictItem.tagRes = res + } + // dictItem.tagRes = placeData.value.materialList.map(e => e.spec) + break; + case 'count': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.blockCount) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.blockCount); + } + }); + dictItem.tagRes = res + } + // dictItem.tagRes = placeData.value.materialList.map(e => e.blockCount) + break; + case 'area': + // 大板(商品)materials + if (exportFileType == 2 || exportFileType == 3) { + dictItem.tagRes = source.map(e => e.blockArea) + } else { + let res: any = []; + placeData.value.materialList.forEach(material => { + if (goodsIdList.includes(material.goodsId)) { + res.push(material.blockArea); + } + }); + dictItem.tagRes = res + } + // dictItem.tagRes = placeData.value.materialList.map(e => e.blockArea) + break; + case 'unit': + // 大板(商品)materials + // dictItem.tagRes = placeData.value.planId + break; + case 'remark': + // 大板(商品)materials + break; + default: + break; + } + break; + + //#endregion 大板 + //小板 + //#region 小板 + case 'plates': + switch (dictItem.itemKey) { + case 'produceTime': + // 小板 plates + break; + case 'roomName': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.roomName) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.roomName)) + }); + dictItem.tagRes = tagRes + } + break; + case 'bodyName': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.bodyName) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.bodyName)) + }); + dictItem.tagRes = tagRes + } + break; + case 'blockNo': + // 小板 plates + // dictItem.tagRes = + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.blockNo) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockNo)) + }); + dictItem.tagRes = tagRes + } + break; + case 'labelNo': + // 小板 plates + // if(exportFileType == 0 || exportFileType == 1){ + // dictItem.tagRes = source.map(e=>e.labelNo) + // }else{ + // let tagRes :any = []; + // source.forEach(material => { + // tagRes.concat(material.blockList.map(e=>e.labelNo)) + // }); + // dictItem.tagRes = tagRes + // } + break; + case 'blockName': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.blockName) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockName)) + }); + dictItem.tagRes = tagRes + } + break; + case 'openDoorType': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.openDoorType) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.openDoorType)) + }); + dictItem.tagRes = tagRes + } + break; + case 'count': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.count) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.count)) + }); + dictItem.tagRes = tagRes + } + break; + case 'id': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.id) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.id)) + }); + dictItem.tagRes = tagRes + } + break; + case 'plateRemark': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.plateRemark) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.plateRemark)) + }); + dictItem.tagRes = tagRes + } + break; + case 'remarkJsonDei': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e?.remarkParams?.remarkJsonDei) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.remarkParams?.remarkJsonDei)) + }); + dictItem.tagRes = tagRes + } + break; + case 'sideRemark': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e?.remarkParams?.sideRemark) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.remarkParams?.sideRemark)) + }); + dictItem.tagRes = tagRes + } + break; + case 'extraRemark': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e?.remarkParams?.extraRemark) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.remarkParams?.extraRemark)) + }); + dictItem.tagRes = tagRes + } + break; + case 'drillsRemark': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e?.remarkParams?.drillsRemark) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.remarkParams?.drillsRemark)) + }); + dictItem.tagRes = tagRes + } + break; + case 'remarkJson': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e?.remarkParams?.remarkJson) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.remarkParams?.remarkJson)) + }); + dictItem.tagRes = tagRes + } + break; + case 'specialRemark': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e?.remarkParams?.specialRemark) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.remarkParams?.specialRemark)) + }); + dictItem.tagRes = tagRes + } + break; + case 'specialRemarkDei': + // 小板 plates + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e?.remarkParams?.specialRemarkDei) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.remarkParams?.specialRemarkDei)) + }); + dictItem.tagRes = tagRes + } + break; + case 'remarkid': + // 小板 plates + break; + case 'remarkname': + // 小板 plates + break; + case 'remarkinfo': + // 小板 plates + break; + + default: + break; + } + break; + + //#endregion 小板 + // 尺寸 + //#region 尺寸 + case 'sizeInfo': + switch (dictItem.itemKey) { + + case 'width': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.width)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.width))) + }); + dictItem.tagRes = tagRes + } + break + case 'length': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.length)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.length))) + }); + dictItem.tagRes = tagRes + } + break + case 'thickness': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.thickness)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.thickness))) + }); + dictItem.tagRes = tagRes + } + break + case 'area': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.area) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.area)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealLeft': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealLeft) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealLeft)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealRight': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealRight) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealRight)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealTop': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealTop) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealTop)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealBottom': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealBottom) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealBottom)) + }); + dictItem.tagRes = tagRes + } + break + case 'cutWidth': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.cutWidth)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.cutWidth))) + }); + dictItem.tagRes = tagRes + } + break + case 'cutLength': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.cutLength)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.cutLength))) + }); + dictItem.tagRes = tagRes + } + break + case 'cutArea': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.cutArea)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.cutArea))) + }); + dictItem.tagRes = tagRes + } + break + case 'placeFullWidth': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeFullWidth)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeFullWidth))) + }); + dictItem.tagRes = tagRes + } + break + case 'placeFullLength': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeFullLength)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeFullLength))) + }); + dictItem.tagRes = tagRes + } + break + case 'sizeExpand': + // 尺寸 sizeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sizeExpand) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sizeExpand)) + }); + dictItem.tagRes = tagRes + } + break + default: + break; + } + break; + //#endregion 尺寸 + // 高级信息 + //#region 高级信息 + case 'highInfo': + switch (dictItem.itemKey) { + + case 'isAdditionalBlock': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isAdditionalBlock) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isAdditionalBlock)) + }); + dictItem.tagRes = tagRes + } + break + case 'isRemainBlock': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isRemainBlock) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isRemainBlock)) + }); + dictItem.tagRes = tagRes + } + break + case 'texture': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.texture) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.texture)) + }); + dictItem.tagRes = tagRes + } + break + case 'placeHole': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.placeHole) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.placeHole)) + }); + dictItem.tagRes = tagRes + } + break + case 'isUnRegular': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isUnRegular) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isUnRegular)) + }); + dictItem.tagRes = tagRes + } + break + case 'processGroupName': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.processGroupName) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.processGroupName)) + }); + dictItem.tagRes = tagRes + } + break + case 'bigHoleInFaceA': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.bigHoleInFaceA) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.bigHoleInFaceA)) + }); + dictItem.tagRes = tagRes + } + break + case 'holeCountFront': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.holeCountFront) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeCountFront)) + }); + dictItem.tagRes = tagRes + } + break + case 'holeCountBack': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.holeCountBack) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeCountBack)) + }); + dictItem.tagRes = tagRes + } + break + case 'holeCountThrough': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.holeCountThrough) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeCountThrough)) + }); + dictItem.tagRes = tagRes + } + break + case 'holeCountSide': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.holeCountSide) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeCountSide)) + }); + dictItem.tagRes = tagRes + } + break + case 'modelCountFront': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.modelCountFront) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelCountFront)) + }); + dictItem.tagRes = tagRes + } + break + case 'modelCountBack': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.modelCountBack) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelCountBack)) + }); + dictItem.tagRes = tagRes + } + break + case 'modelCountThrough': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.modelCountThrough) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelCountThrough)) + }); + dictItem.tagRes = tagRes + } + break + case 'isDoubleFaceProcess': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isDoubleFaceProcess) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isDoubleFaceProcess)) + }); + dictItem.tagRes = tagRes + } + break + case 'isTurnFaceToPlace': + // 高级信息 highInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isTurnFaceToPlace) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isTurnFaceToPlace)) + }); + dictItem.tagRes = tagRes + } + break + default: + break; + } + break + + //#endregion 高级信息 + // 优化信息 + //#region 优化信息 + case 'placeInfo': + switch (dictItem.itemKey) { + + case 'isOptimized': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isPlaced) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isPlaced)) + }); + dictItem.tagRes = tagRes + } + break + case 'boardId': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.boardId) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.boardId)) + }); + dictItem.tagRes = tagRes + } + break + case 'placeX': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeX)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeX))) + }); + dictItem.tagRes = tagRes + } + break + case 'placeY': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeY)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeY))) + }); + dictItem.tagRes = tagRes + } + break + case 'placeOffX': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeOffX)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeOffX))) + }); + dictItem.tagRes = tagRes + } + break + case 'placeOffY': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeOffY)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeOffY))) + }); + dictItem.tagRes = tagRes + } + break + case 'placeStyle': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.placeStyle) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.placeStyle)) + }); + dictItem.tagRes = tagRes + } + break + case 'cutOrder': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.cutOrder) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.cutOrder)) + }); + dictItem.tagRes = tagRes + } + break + case 'cutPointId': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.cutPointId) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.cutPointId)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealLeft': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealLeft) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealLeft)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealRight': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealRight) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealRight)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealTop': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealTop) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealTop)) + }); + dictItem.tagRes = tagRes + } + break + case 'sealBottom': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.sealBottom) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.sealBottom)) + }); + dictItem.tagRes = tagRes + } + break + case 'placeLength': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeLength)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeLength))) + }); + dictItem.tagRes = tagRes + } + break + case 'placeWidth': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeWidth)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeWidth))) + }); + dictItem.tagRes = tagRes + } + break + case 'isTurnOver': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isTurnOver) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isTurnOver)) + }); + dictItem.tagRes = tagRes + } + break + case 'isTurnBack': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isTurnBack) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isTurnBack)) + }); + dictItem.tagRes = tagRes + } + break + case 'isTurnDown': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isTurnDown) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isTurnDown)) + }); + dictItem.tagRes = tagRes + } + break + case 'isAutoPlaced': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isAutoPlaced) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isAutoPlaced)) + }); + dictItem.tagRes = tagRes + } + break + case 'isOverlap': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isOverlap) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isOverlap)) + }); + dictItem.tagRes = tagRes + } + break + case 'placeDirection': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.placeDirection) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.placeDirection)) + }); + dictItem.tagRes = tagRes + } + break + case 'placeDirection_Length': + // 优化信息 placeInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.placeDirection_Length) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.placeDirection_Length)) + }); + dictItem.tagRes = tagRes + } + break + default: + break; + } + break + //#endregion 优化信息 + // 开料信息 + //#region 开料信息 + case 'cuttingInfo': + switch (dictItem.itemKey) { + case 'isCutOtherFace': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isCutOtherFace) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isCutOtherFace)) + }); + dictItem.tagRes = tagRes + } + break + case 'isDrilling': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isDrilling) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isDrilling)) + }); + dictItem.tagRes = tagRes + } + break + case 'isModeling': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.isModeling) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.isModeling)) + }); + dictItem.tagRes = tagRes + } + break + case 'holeCountFaceA': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.holeCountFaceA) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeCountFaceA)) + }); + dictItem.tagRes = tagRes + } + break + case 'holeCountFaceB': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.holeCountFaceB) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeCountFaceB)) + }); + dictItem.tagRes = tagRes + } + break + case 'placeOffY': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => outPutFloatNumberByConfig(e.placeOffY)) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => outPutFloatNumberByConfig(e.placeOffY))) + }); + dictItem.tagRes = tagRes + } + break + case 'modelCountFaceA': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.modelCountFaceA) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelCountFaceA)) + }); + dictItem.tagRes = tagRes + } + break + case 'modelCountFaceB': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.modelCountFaceB) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelCountFaceB)) + }); + dictItem.tagRes = tagRes + } + break + case 'codeA': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.codeA) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.codeA)) + }); + dictItem.tagRes = tagRes + } + break + case 'codeB': + // 开料信息 cuttingInfo + if (exportFileType == 0 || exportFileType == 1) { + dictItem.tagRes = source.map(e => e.codeB) + } else { + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.codeB)) + }); + dictItem.tagRes = tagRes + } + break + + default: + break; + } + break + + //#endregion 开料信息 + // 封边信息 + //#region 封边信息 + case 'edging': + switch (dictItem.itemKey) { + + case 'xxx': + break + + + default: + break; + } + break + //#endregion 封边信息 + + // 轮廓 + //#region 成品轮廓 + case 'outline': + + switch (dictItem.itemKey) { + + case 'count': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.length : null) + dictItem.tagResB = sourceB.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.length : null) + } + dictItem.tagRes = source.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.length : null) + + + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.length : null)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.length : null)) + }); + dictItem.tagResB = tagResB + + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.length : null)) + }); + dictItem.tagRes = tagRes + + + } + + break + + case 'outline_id': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.map((c, b) => b) : null) + dictItem.tagResB = sourceB.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.map((c, b) => b) : null) + } + dictItem.tagRes = source.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.map((c, b) => b) : null) + + + + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.map((c, b) => b) : null)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.map((c, b) => b) : null)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderFinal) ? e.blockDetail.borderContour.borderFinal.map((c, b) => b) : null)) + }); + dictItem.tagRes = tagRes + + } + + break + case 'outline_process': + // 目前没有 + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => { + // let arr = e.blockDetail.borderContour.borderFinal.map((x, i) => i) + // return arr + // }) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => { + // let arr = e.blockDetail.borderContour.borderFinal.map((x, i) => i) + // return arr + // } + // )) + // }); + // dictItem.tagRes = tagRes + // } + + break + + case 'remark': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.plateRemark) + dictItem.tagResB = sourceB.map(e => e.plateRemark) + } + dictItem.tagRes = source.map(e => e.plateRemark) + + + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.plateRemark)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.plateRemark)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.plateRemark)) + }); + dictItem.tagRes = tagRes + } + break + + + case 'scale': + // 成品轮廓 count + //预留边 ReservedEdge 要加 + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.blockdetail?.plateExtraRemark.extra.rectSealDetail.map(x => x.ReservedEdge)) + dictItem.tagResB = sourceB.map(e => e.blockdetail?.plateExtraRemark.extra.rectSealDetail.map(x => x.ReservedEdge)) + } + + dictItem.tagRes = source.map(e => e.blockdetail?.plateExtraRemark.extra.rectSealDetail.map(x => x.ReservedEdge)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockdetail?.plateExtraRemark.extra.rectSealDetail.map(x => x.ReservedEdge))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockdetail?.plateExtraRemark.extra.rectSealDetail.map(x => x.ReservedEdge))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockdetail?.plateExtraRemark.extra.rectSealDetail.map(x => x.ReservedEdge))) + }); + dictItem.tagRes = tagRes + } + + break + case 'preMilling': + // 成品轮廓 count + // 先不管 好像现在没有 + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = 0 + dictItem.tagResB = 0 + } + dictItem.tagRes = 0 + } else { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = 0 + dictItem.tagResB = 0 + } + dictItem.tagRes = 0 + } + break + + case 'radius': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_Radius))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_Radius))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_Radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagRes = tagRes + } + + break + case 'curvature': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x?.m_Bul))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x?.m_Bul))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_Bul) || 0)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x?.m_Bul)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x?.m_Bul)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x?.m_Bul)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => { + // let arr = e.blockDetail.points.map((x) => x.curve) + // return arr + // }) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => { + // let arr = e.blockDetail.points.map((x) => x.curve) + // return arr + // } + // )) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'pointId': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderFinal.map((x, i) => i)) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderFinal.map((x, i) => i)) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderFinal.map((x, i) => i)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map((x, i) => i))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map((x, i) => i))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map((x, i) => i))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'length': + // 成品轮廓 count + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Length))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Length))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Length))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Length)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Length)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderFinal.map(x => outPutFloatNumberByConfig(x.m_StartPoint.m_Length)))) + }); + dictItem.tagRes = tagRes + } + break + case 'width': + // 没有 + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.cutWidth) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.cutWidth + // )) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'thickness': + // 没有 + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.thickness) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.thickness + // )) + // }); + // dictItem.tagRes = tagRes + // } + break + default: + break; + } + break + + //#endregion 轮廓 + // 开料轮廓 + //#region 开料轮廓 + case 'cuttingoutline': + switch (dictItem.itemKey) { + + case 'count': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => Array.isArray(e?.blockDetail?.borderContour?.border) ? e.blockDetail.borderContour.border.length : null) + dictItem.tagResB = sourceB.map(e => Array.isArray(e?.blockDetail?.borderContour?.border) ? e.blockDetail.borderContour.border.length : null) + } + dictItem.tagRes = source.map(e => Array.isArray(e?.blockDetail?.borderContour?.border) ? e.blockDetail.borderContour.border.length : null) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.border) ? e.blockDetail.borderContour.border.length : null)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.border) ? e.blockDetail.borderContour.border.length : null)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.border) ? e.blockDetail.borderContour.border.length : null)) + }); + dictItem.tagRes = tagRes + } + break + case 'referenceOffsetY': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y)) + }); + dictItem.tagRes = tagRes + } + break + case 'referenceOffsetX': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X + )) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X + )) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X + )) + }); + dictItem.tagRes = tagRes + } + break + case 'id': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => i)) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => i)) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => i)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => i))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => i))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => i))) + }); + dictItem.tagRes = tagRes + } + break + case 'process': + // 加工 process + + break + case 'radius': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagResB = tagResB + } + + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius_pre': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature_pre': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX_pre': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_pre': + // 开料轮廓 cuttingoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.border.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + + + default: + break; + } + break + + //#endregion 开料轮廓 + // + //#region 胚料轮廓 + case 'rawoutline': + switch (dictItem.itemKey) { + + case 'count': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderOrg) ? e.blockDetail.borderContour.borderOrg.length : null) + dictItem.tagResB = sourceB.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderOrg) ? e.blockDetail.borderContour.borderOrg.length : null) + } + dictItem.tagRes = source.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderOrg) ? e.blockDetail.borderContour.borderOrg.length : null) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderOrg) ? e.blockDetail.borderContour.borderOrg.length : null)) + }); + dictItem.tagResA = tagResA + + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderOrg) ? e.blockDetail.borderContour.borderOrg.length : null)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => Array.isArray(e?.blockDetail?.borderContour?.borderOrg) ? e.blockDetail.borderContour.borderOrg.length : null)) + }); + dictItem.tagRes = tagRes + } + break + case 'referenceOffsetY': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y)) + }); + dictItem.tagResA = tagResA + + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_Y - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_Y)) + }); + dictItem.tagRes = tagRes + } + break + case 'referenceOffsetX': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X + )) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X + )) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg[0].m_StartPoint.m_X - e?.blockDetail?.borderContour?.borderFinal[0].m_StartPoint.m_X + )) + }); + dictItem.tagRes = tagRes + } + break + case 'id': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => i)) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => i)) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => i)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => i))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => i))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => i))) + }); + dictItem.tagRes = tagRes + } + break + case 'process': + + break + case 'radius': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)))) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)))) + }); + dictItem.tagResB = tagResB + } + + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + dictItem.tagResB = sourceB.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + } + dictItem.tagRes = source.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)))) + }); + dictItem.tagRes = tagRes + } + break + + case 'radius_pre': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Radius)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature_pre': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_Bul)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX_pre': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_X)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_pre': + // 胚料轮廓 rawoutline + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + }) + dictItem.tagResB = sourceB.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + }) + } + dictItem.tagRes = source.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + }) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => { + let arr = e?.blockDetail?.borderContour?.borderOrg.map((x, i) => outPutFloatNumberByConfig(x.m_StartPoint.m_Y)) + arr.unshift(0) + arr.pop() + return arr + })) + }); + dictItem.tagRes = tagRes + } + break + default: + break; + } + break + + //#endregion 胚料轮廓 + + //#region 垂直孔 + case 'holes': + + switch (dictItem.itemKey) { + case 'count': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.length) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.length) + } + dictItem.tagRes = source.map(e => e.holeListFaceA.length + e.holeListFaceB.length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeListFaceA.length + e.holeListFaceB.length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countFaceA': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.length) + dictItem.tagResB = sourceB.map(e => e.holeListFaceB.length) + } + dictItem.tagRes = source.map(e => e.holeListFaceA.length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceB.length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeListFaceA.length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countFaceB': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceB.length) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.length) + } + dictItem.tagRes = source.map(e => e.holeListFaceB.length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceB.length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.holeListFaceB.length)) + }); + dictItem.tagRes = tagRes + } + break + + case 'countThrough': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + // 穿孔会合并到 block.holeListFaceA 里面 而 blockDetail 里面的holeListFaceA 不含穿孔 相减得到穿孔数 + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.length - e.blockDetail.holeListFaceA.length) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.length - e.blockDetail.holeListFaceB.length) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeCountThrough) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.length - e.blockDetail.holeListFaceA.length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.length - e.blockDetail.holeListFaceB.length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeCountThrough)) + }); + dictItem.tagRes = tagRes + } + break + case 'id': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => b)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => b)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => b)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => b))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => b))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => b))) + }); + dictItem.tagRes = tagRes + } + break + case 'type': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c.holeType)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c.holeType)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.holeType)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.holeType))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.holeType))) + }); + dictItem.tagResB = tagResB + + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.holeType))) + }); + dictItem.tagRes = tagRes + } + break + case 'name': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.blockName) + dictItem.tagResB = sourceB.map(e => e.blockName) + } + dictItem.tagRes = source.map(e => e.blockName) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockName)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockName)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockName)) + }); + dictItem.tagRes = tagRes + } + break + case 'face': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c.face)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c.face)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.face)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.face))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.face))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.face))) + }); + dictItem.tagRes = tagRes + } + break + case 'direction': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.placeDirection) + dictItem.tagResB = sourceB.map(e => e.placeDirection) + } + dictItem.tagRes = source.map(e => e.placeDirection) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.placeDirection)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.placeDirection)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.placeDirection)) + }); + dictItem.tagRes = tagRes + } + break + case 'diameter': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c.radius * 2)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c.radius * 2)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.radius * 2)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.radius * 2))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.radius * 2))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.radius * 2))) + }); + dictItem.tagRes = tagRes + } + break + case 'diameterInner': + // 垂直孔 holes + break + case 'depth': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c.depth)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c.depth)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.depth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.depth))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c.depth))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.depth))) + }); + dictItem.tagRes = tagRes + } + break + case 'depthInner': + // 垂直孔 holes + break + + case 'toolName': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeName)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagRes = tagRes + } + break + // 刀号 + case 'toolNo': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeName)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagRes = tagRes + } + break + // 轴号 + case 'toolBelongNo': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c.knife.axleId)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c.knife.axleId)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.knife.axleId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagRes = tagRes + } + break + + case 'axisStartCode': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStartCode || '')) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStartCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.axisStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStartCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStartCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.axisStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeStartCode': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStartCode)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStartCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeStartCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStartCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStartCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeStartCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupStartCode': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupStartCode || '')) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupStartCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.holesGroupStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupStartCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupStartCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.holesGroupStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupEndCode': + // 垂直孔 holes + + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupEndCode || '')) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupEndCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.holesGroupEndCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupEndCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.holesGroupEndCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.holesGroupEndCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeEndCode': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeStopCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeStopCode))) + }); + dictItem.tagRes = tagRes + } + break; + case 'knifeStopCode': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeStopCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.knifeStopCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.knifeStopCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'axisStopCode': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStopCode)) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStopCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.axisStopCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStopCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => c?.knife?.axisStopCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c?.knife?.axisStopCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'X_start': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX))) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX))) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => outPutFloatNumberByConfig(c.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => outPutFloatNumberByConfig(c.pointX)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.pointX)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.pointX))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'Y_start': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointY))) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointY))) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => outPutFloatNumberByConfig(c.pointY))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointY)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointY)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => outPutFloatNumberByConfig(c.pointY)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.pointY)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.pointY))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'Z_start': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + })) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + })) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'X_end': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX))) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX))) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => outPutFloatNumberByConfig(c.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointX)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => outPutFloatNumberByConfig(c.pointX)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.pointX)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.pointX))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'Y_end': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c) => outPutFloatNumberByConfig(c.pointY))) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c) => outPutFloatNumberByConfig(c.pointY))) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c) => outPutFloatNumberByConfig(c.pointY))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.holeListFaceA.map((c) => outPutFloatNumberByConfig(c.pointY)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.holeListFaceA.map((c, b) => outPutFloatNumberByConfig(c.pointY)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => outPutFloatNumberByConfig(c.pointY)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => c.pointY)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => c.pointY))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'Z_end': + // 垂直孔 holes + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.holeListFaceA.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + })) + dictItem.tagResB = sourceB.map(e => e.holeListFaceA.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + })) + } + dictItem.tagRes = source.map(e => e.blockDetail.holes.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holes.map((c, b) => { + let val = 0 + if (originZ0Position == 0) { + val = -c.pointZ - e.thickness + } else { + val = -c.pointZ + } + return outPutFloatNumberByConfig(val) + }))) + }); + dictItem.tagRes = tagRes + } + break + // case 'toolRotateX_end': + + // break + // case 'toolRotateY_end': + + // break + // case 'toolRotateZ_end': + + // break + default: + break; + } + break + + //#endregion 垂直孔 + //#region 侧孔 + case 'sideHoles': + switch (dictItem.itemKey) { + + case 'count': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeCountSide + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountSide + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeCountSide + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeCountSide) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeCountSide + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountSide + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeCountSide + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeCountSide)) + }); + dictItem.tagRes = tagRes + } + break + + + case 'countSideL': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + + return e.blockDetail.holeCountLeft + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountLeft + } + + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeCountLeft + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeCountLeft) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeCountLeft + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountLeft + } + + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeCountLeft + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeCountLeft)) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.holeCountSideLeft) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.holeCountSideLeft)) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'countSideR': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + + return e.blockDetail.holeCountRight + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountRight + } + + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeCountRight + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeCountRight) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeCountRight + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountRight + } + + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeCountRight + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeCountRight)) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.holeCountSideRight) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.holeCountSideRight)) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'countSideU': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + + return e.blockDetail.holeCountTop + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountTop + } + + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeCountTop + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeCountTop) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeCountTop + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountTop + } + + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeCountTop + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeCountTop)) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.holeCountSideTop) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.holeCountSideTop)) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'countSideD': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + + return e.blockDetail.holeCountBottom + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountBottom + } + + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeCountBottom + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeCountBottom) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeCountBottom + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeCountBottom + } + + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeCountBottom + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeCountBottom)) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.holeCountSideBottom) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.holeCountSideBottom)) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'countBevelled': + // 侧孔 sideHoles + break + case 'countLocking': + // 侧孔 sideHoles + break + case 'countBuildIn': + // 侧孔 sideHoles + break + case 'countHinge': + // 侧孔 sideHoles + break + + case 'id': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => b) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => b) + } + + + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => b) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => b)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => b) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => b) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => b) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => b))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // if (drillConfig.value?.isFileSort == true) { + // dictItem.tagResA = sourceA.map(e => e.blockDetail.holeListSide.map((c, b) => b)) + // } + // dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => b)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => b))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'type': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.holeType) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.holeType) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.holeType) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.holeType)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.holeType) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.holeType) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.holeType) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.holeType))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.cncCanNotProcessType)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.cncCanNotProcessType))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'name': + // 侧孔 sideHoles + // 先不管 + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockName) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockName)) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'face': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.sideFace) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.sideFace) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.sideFace) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.sideFace)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.sideFace) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.sideFace) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.sideFace) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.sideFace))) + }); + dictItem.tagRes = tagRes + } + break + case 'direction': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.direct) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.direct) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.direct) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.direct)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.direct) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.direct) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.direct) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.direct))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.placeDirection) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.placeDirection)) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'diameter': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.radius * 2) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.radius * 2) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.radius * 2) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.radius * 2)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.radius * 2) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.radius * 2) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.radius * 2) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.radius * 2))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.radius * 2)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.radius * 2))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'diameterInner': + // 侧孔 sideHoles + break + case 'depth': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.depth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.depth) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.depth) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.depth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.depth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c.depth) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c.depth) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.depth))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.depth)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.depth))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'depthInner': + // 侧孔 sideHoles + break + + case 'toolName': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeName))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolNo': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId))) + }); + dictItem.tagRes = tagRes + } + break + + case 'axisStartCode': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + + case 'knifeStartCode': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStartCode))) + }); + dictItem.tagRes = tagRes + } + break + + case 'holesGroupStartCode': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + + case 'holesGroupEndCode': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.holesGroupEndCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeStopCode': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.knifeStopCode))) + }); + dictItem.tagRes = tagRes + } + break + + case 'axisStopCode': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axisStopCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolBelongNo': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c?.knife?.axleId))) + }); + dictItem.tagRes = tagRes + } + break; + case 'X_start': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.pointX)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.pointX))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'Y_start': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.pointY)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.pointY))) + // }); + // dictItem.tagRes = tagRes + // } + break + case 'Z_start': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)))) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => c.pointZ)) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => c.pointZ))) + // }); + // dictItem.tagRes = tagRes + // } + break + + case 'X_end': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointX2)))) + }); + dictItem.tagRes = tagRes + } + break + case 'Y_end': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY2)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY2)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY2)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY2))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY2)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY2)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointY2)))) + }); + dictItem.tagRes = tagRes + } + break + case 'Z_end': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c, b) => outPutFloatNumberByConfig(c?.pointZ)))) + }); + dictItem.tagRes = tagRes + } + + break + + case 'X_safe': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c) => { + let _pointX = c?.pointX + switch (c.direct) { + case 0: + // 下侧孔 + // _pointX = + break; + case 1: + // 右侧孔 + _pointX = parseFloat(_pointX) + drillConfig.value.horiSafeSize + break; + case 2: + // 上侧孔 + break; + case 3: + // 左侧孔 + _pointX = parseFloat(_pointX) - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'Y_safe': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c) => { + let _pointY = c?.pointY + switch (c.direct) { + case 0: + // 下侧孔 + _pointY = parseFloat(_pointY) - drillConfig.value.horiSafeSize + break; + case 1: + // 右侧孔 + + break; + case 2: + // 上侧孔 + _pointY = parseFloat(_pointY) + drillConfig.value.horiSafeSize + + break; + case 3: + // 左侧孔 + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'Z_safe': + // 侧孔 sideHoles + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.holeListSide.map((c) => outPutFloatNumberByConfig(c?.pointZ)))) + }); + dictItem.tagRes = tagRes + } + break + + default: + break; + } + break + + //#endregion 侧孔 + + //#region 垂直造型 + case 'models': + + switch (dictItem.itemKey) { + case 'count': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).length) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).length) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countFaceA': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).length) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).length) + } + dictItem.tagRes = source.map(e => e.modelListFaceA.filter(x => x.isRect == false).length) + } else { + if (drillConfig.value?.isFileSort == true) { + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countFaceB': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceB.filter(x => x.isRect == false).length) + dictItem.tagResB = sourceB.map(e => e.modelListFaceB.filter(x => x.isRect == false).length) + } + dictItem.tagRes = source.map(e => e.modelListFaceB.filter(x => x.isRect == false).length) + } else { + if (drillConfig.value?.isFileSort == true) { + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceB.filter(x => x.isRect == false).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceB.filter(x => x.isRect == false).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelListFaceB.filter(x => x.isRect == false).length)) + }); + dictItem.tagRes = tagRes + } + + break + + case 'countThrough': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true && x.depth >= x.thickness).length) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false && x.depth >= x.thickness).length) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListThrough.filter(x => x.isRect == false && x.depth >= x.thickness).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false && x.depth >= x.thickness).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false && x.depth >= x.thickness).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListThrough.filter(x => x.isRect == false && x.depth >= x.thickness))) + }); + dictItem.tagRes = tagRes + } + break + case 'count2V': + // 垂直造型 models + + break + case 'count3V': + // 垂直造型 models + break + case 'id': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelId)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelId)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.modelId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelId))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelId))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.modelId))) + }); + dictItem.tagRes = tagRes + } + break + + case 'face': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.face)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.face)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.face)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.face))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.face))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.face))) + }); + dictItem.tagRes = tagRes + } + break + case 'width': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelWidth)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelWidth)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.modelWidth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelWidth))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelWidth))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.modelWidth))) + }); + dictItem.tagRes = tagRes + } + break + case 'length': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelLength)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelLength)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.modelLength)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelLength))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.modelLength))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.modelLength))) + }); + dictItem.tagRes = tagRes + } + break + case 'depth': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.depth)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.depth)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.depth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.depth))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.depth))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.depth))) + }); + dictItem.tagRes = tagRes + } + break + // case 'widthExtend': + // break + // case 'lengthExtend': + // break + // case 'depthExtend': + // break + + case 'toolName': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeName || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeName || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.knifeName || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolNo': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axleId || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axleId || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolBelongNo': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axleId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axleId))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axleId))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolDiameter': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.diameter)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.diameter)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.diameter)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.diameter))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.diameter))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.diameter))) + }); + dictItem.tagRes = tagRes + } + break + case 'axisStartCode': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStartCode || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStartCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axisStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStartCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStartCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axisStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeStartCode': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStartCode || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStartCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.knifeStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStartCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStartCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.knifeStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupStartCode': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupStartCode || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupStartCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupStartCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupStartCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupEndCode': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupEndCode || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupEndCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupEndCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupEndCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupEndCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.holesGroupEndCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeStopCode': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStopCode || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStopCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.knifeStopCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStopCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.knifeStopCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.knifeStopCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'axisStopCode': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStopCode || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStopCode || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axisStopCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStopCode || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.axisStopCode || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.axisStopCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_x': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetX)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetX)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.offsetX)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetX))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetX))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.offsetX))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_y': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetY)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetY)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.offsetY)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetY))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetY))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.offsetY))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_z': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagRes = tagRes + } + break + case 'tangentAngle': + // 没有 + break + case 'isletCount': + // 没有 + break + case 'pointX_start': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX))) + + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX))) + + } + dictItem.tagRes = source.map(e => e.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX))) + + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX)))) + + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_start': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_start': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + } + )) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX_end': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_end': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_end': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.realPointList[model?.realPointList.length - 1] + // let rd = - c.depth + // if (c.face == 1) { + // rd = c.depth - e.thickness + // } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + } + )) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.realPointList[model?.realPointList.length - 1] + // let rd = - c.depth + // if (c.face == 1) { + // rd = c.depth - e.thickness + // } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.realPointList[model?.realPointList.length - 1] + // let rd = - c.depth + // if (c.face == 1) { + // rd = c.depth - e.thickness + // } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.realPointList[model?.realPointList.length - 1] + // let rd = - c.depth + // if (c.face == 1) { + // rd = c.depth - e.thickness + // } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.realPointList[model?.realPointList.length - 1] + // let rd = - c.depth + // if (c.face == 1) { + // rd = c.depth - e.thickness + // } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagRes = tagRes + } + break; + case 'radius': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))))) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))))) + }); + dictItem.tagRes = tagRes + } + break + + case 'radius_start': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)))) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature_start': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius_end': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.radius))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.radius))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.radius)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.radius)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.radius)))) + }); + dictItem.tagRes = tagRes + } + break + + case 'curvature_end': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.curve))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.curve))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.curve))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.curve)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.curve)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.curve)))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_pre': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointX) + arr.unshift(firstData) + return arr + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointX) + arr.unshift(firstData) + return arr + })) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointX) + arr.unshift(firstData) + return arr + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointX) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointX) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointX) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointY_pre': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointY) + arr.unshift(firstData) + return arr + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointY) + arr.unshift(firstData) + return arr + })) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointY) + arr.unshift(firstData) + return arr + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointY) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointY) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].pointY) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_pre': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - model.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - model.realPointList[0].pointY.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + })) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - model.realPointList[0].pointY.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - model.realPointList[0].pointY.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - model.realPointList[0].pointY.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - model.realPointList[0].pointY.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }))) + }); + dictItem.tagRes = tagRes + } + break; + case 'radius_pre': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = parseFloat(Number.isNaN(model.realPointList[0].radius) ? 0 : model.realPointList[0].radius) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = parseFloat(Number.isNaN(model.realPointList[0].radius) ? 0 : model.realPointList[0].radius) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + })) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = parseFloat(Number.isNaN(model.realPointList[0].radius) ? 0 : model.realPointList[0].radius) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = parseFloat(Number.isNaN(model.realPointList[0].radius) ? 0 : model.realPointList[0].radius) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = parseFloat(Number.isNaN(model.realPointList[0].radius) ? 0 : model.realPointList[0].radius) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = parseFloat(Number.isNaN(model.realPointList[0].radius) ? 0 : model.realPointList[0].radius) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature_pre': + // 垂直造型 models + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = parseFloat(model.realPointList[0].curve) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = parseFloat(model.realPointList[0].curve) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + })) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = parseFloat(model.realPointList[0].curve) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = parseFloat(model.realPointList[0].curve) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = parseFloat(model.realPointList[0].curve) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = parseFloat(model.realPointList[0].curve) + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + }))) + }); + dictItem.tagRes = tagRes + } + break + + default: + break; + } + + break + + //#endregion 垂直造型 + + //#region 侧面造型 + case 'modelsH': + switch (dictItem.itemKey) { + case 'count': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).length + } + if (!flag) { + return 0 + } + + }) + dictItem.tagResB = sourceA.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).length)) + }); + dictItem.tagRes = tagRes + } + break + + case 'countSideL': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 3).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideR': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 1).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideU': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 2).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideD': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 0).length)) + }); + dictItem.tagRes = tagRes + } + break + + case 'countSideLeftBottom': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 10).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideRightBottom': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 11).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideRightTop': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 12).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideLeftTop': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false && x.direction == 13).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'id': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelId))) + }); + dictItem.tagRes = tagRes + } + break + case 'face': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.direction))) + }); + dictItem.tagRes = tagRes + } + break + case 'width': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelWidth))) + }); + dictItem.tagRes = tagRes + } + break + case 'length': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.modelLength))) + }); + dictItem.tagRes = tagRes + } + break + case 'depth': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.depth))) + }); + dictItem.tagRes = tagRes + } + break + + + case 'toolName': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeName || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolBelongNo': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolNo': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axleId || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolDiameter': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || '') + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.diameter || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'axisStartCode': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStartCode || '' || ''))) + }); + dictItem.tagRes = tagRes + } + break + + case 'knifeStartCode': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + + case 'holesGroupStartCode': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'holesGroupEndCode': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'knifeStopCode': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.knifeStopCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + + case 'axisStopCode': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c?.knife?.axisStopCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_x': + // 凹槽 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetX)) + dictItem.tagResB = sourceB.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetX)) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetX)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetX))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetX))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetX))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_y': + // 凹槽 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetY)) + dictItem.tagResB = sourceB.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetY)) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetY)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetY))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetY))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetY))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_z': + // 凹槽 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ)) + dictItem.tagResB = sourceB.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ)) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifePointCount': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map((c, b) => c.realPointList.length || 0))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_start': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_start': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.filter(x => x.isRect == false).map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.filter(x => x.isRect == false).map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.filter(x => x.isRect == false).map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_start': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.modelEndPoint) { + return '' + } + let c = model.modelEndPoint + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return outPutFloatNumberByConfig(rd) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return outPutFloatNumberByConfig(rd) + } + + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + if (!flag) { + return outPutFloatNumberByConfig(rd) + } + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + + return ( + + e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return (e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + }))) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return (e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + + return outPutFloatNumberByConfig(rd) + }))) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + + + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return (e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return (e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + } + + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + if (!flag) { + return outPutFloatNumberByConfig(rd) + } + })) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagRes = tagRes + } + break; + + case 'curvature_start': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius_start': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX_safe': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_safe': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.filter(x => x.isRect == false).map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.filter(x => x.isRect == false).map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.filter(x => x.isRect == false).map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_safe': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature_safe': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.curve)))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius_safe': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.radius)))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_safe_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_safe_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + + return outPutFloatNumberByConfig(_pointY) + } + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_safe_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.modelEndPoint) { + return '' + } + let c = model.modelEndPoint + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return outPutFloatNumberByConfig(rd) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return outPutFloatNumberByConfig(rd) + } + + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + if (!flag) { + return outPutFloatNumberByConfig(rd) + } + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'curvature_safe_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius_safe_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)))) + }); + dictItem.tagRes = tagRes + } + break + + case 'curvature_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) || '') + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve)) || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.curve) || '')))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius_end': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) || '') + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius)) || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => parseFloat(parseFloat(outPutFloatNumberByConfig(model?.realPointList[model.realPointList.length - 1]?.radius))) || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'curvature': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve))))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_pre': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointX))))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_pre': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.pointY))))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_pre': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = - c.depth + if (model.face == 1) { + rd = c.depth - e.thickness + } + return outPutFloatNumberByConfig(rd) + }) + arr.pop() + let firstData = - model.realPointList[0].depth + if (model.face == 1) { + firstData = model.realPointList[0].depth - e.thickness + } + arr.unshift(outPutFloatNumberByConfig(firstData)) + return arr + + }))) + }); + dictItem.tagRes = tagRes + } + break; + + case 'curvature_pre': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.curve)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].curve) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'radius_pre': + // 侧面槽造型 modelsH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == false).map(model => { + let arr = model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)) + arr.pop() + let firstData = outPutFloatNumberByConfig(model.realPointList[0].radius) + arr.unshift(firstData) + return arr + }))) + }); + dictItem.tagRes = tagRes + } + break + default: + break; + } + break + //#endregion 侧面造型 + + //#region 侧面槽 + + case 'groovesH': + switch (dictItem.itemKey) { + case 'count': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + return e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length + } + if (!flag) { + return 0 + } + }) + dictItem.tagResB = sourceA.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length + } else { + return 0 + } + + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length + } + + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagRes = tagRes + } + break + + case 'countSideL': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length + } + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 3).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideR': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length + } + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 1).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideU': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length + } + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 2).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideD': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 0).length)) + }); + dictItem.tagRes = tagRes + } + break + + case 'countSideLeftBottom': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length + } + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 10).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideRightBottom': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length + } + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 11).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideRightTop': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 12).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countSideLeftTop': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length + } + + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length + } + if (!flag) { + return 0 + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length + } else { + return 0 + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length + } + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length + } + if (!flag) { + return 0 + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length + } else { + return 0 + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true && x.direction == 13).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'id': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelId))) + }); + dictItem.tagRes = tagRes + } + break + case 'face': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.direction))) + }); + dictItem.tagRes = tagRes + } + break + case 'width': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.modelWidth))) + }); + dictItem.tagRes = tagRes + } + break + case 'length': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength)) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength)) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength))) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength)) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength)) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength)) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => outPutFloatNumberByConfig(c.modelLength)))) + }); + dictItem.tagRes = tagRes + } + break + case 'depth': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.depth))) + }); + dictItem.tagRes = tagRes + } + break + + + case 'toolName': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || '') + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || '') + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeName || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolBelongNo': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolNo': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axleId || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolDiameter': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.diameter || ''))) + }); + dictItem.tagRes = tagRes + } + break + + case 'axisStartCode': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStartCode || '' || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeStartCode': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStartCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupStartCode': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupStartCode || '') { + return c?.knife?.holesGroupStartCode || '' + } else { + return '' + } + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupEndCode': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => { + if (c?.knife?.holesGroupEndCode || '') { + return c?.knife?.holesGroupEndCode || '' + } else { + return '' + } + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'knifeStopCode': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.knifeStopCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + + case 'axisStopCode': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || '') + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || '') + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || '') + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || '') + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || '') + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c?.knife?.axisStopCode || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_x': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetX) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetX) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetX)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetX) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetX) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetX) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetX))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_y': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetY))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_z': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ) + } + }) + dictItem.tagResB = sourceB.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ)) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagRes = tagRes + } + break + + + case 'knifePointCount': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0) + } + }) + + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0)) + } else { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map((c, b) => c.realPointList.length || 0))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_start': + // 侧面槽 groovesH + + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth // drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth // drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_start': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.filter(x => x.isRect == true).map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.filter(x => x.isRect == true).map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.filter(x => x.isRect == true).map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_start': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_end': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model?.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_end': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model?.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointZ_end': + // 侧面槽 groovesH + + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.modelEndPoint) { + return '' + } + let c = model.modelEndPoint + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return outPutFloatNumberByConfig(rd) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return outPutFloatNumberByConfig(rd) + } + + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + if (!flag) { + return outPutFloatNumberByConfig(rd) + } + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointX = point.pointX + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + model.depth + break; + case 2: + + break; + case 3: + _pointX = _pointX - model.depth + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let _pointY = point.pointY + switch (model.direction) { + case 0: + _pointY = _pointY + model.depth // drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY - model.depth // drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + + return ( + + e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return (e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + }))) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return (e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + + return outPutFloatNumberByConfig(rd) + }))) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + + + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return (e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return (e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + } + + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.slice(1, -1).map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + if (!flag) { + return outPutFloatNumberByConfig(rd) + } + })) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => model.realPointList.map(point => { + let c = point + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagRes = tagRes + } + break; + + case 'pointX_safe': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + + let _pointX = model?.realPointList[0]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_safe': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.filter(x => x.isRect == true).map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.filter(x => x.isRect == true).map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.filter(x => x.isRect == true).map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[0]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[0] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_safe': + // 侧面槽 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + + return outPutFloatNumberByConfig(rd) + + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let c = model.realPointList[0] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_safe_end': + // 侧面槽造型 groovesH + if (exportFileType == 0 || exportFileType == 1) { + let flag = false + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointX = model?.realPointList[model.realPointList.length - 1]?.pointX + if (_pointX == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointX = p.x + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + + break; + case 1: + _pointX = _pointX + drillConfig.value.horiSafeSize + break; + case 2: + + break; + case 3: + _pointX = _pointX - drillConfig.value.horiSafeSize + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointX) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_safe_end': + // 侧面槽造型 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }) + } + })) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + let _pointY = model?.realPointList[model.realPointList.length - 1]?.pointY + if (_pointY == undefined) { + let _p = model?.pointList[model?.pointList.length - 1] + let p = BlockHelper.getPlaceXYInBoard(e, _p.pointX, _p.pointY) + _pointY = p.y + } + /** 造型方向 -2 未知(是异常情况 要排查) + * -1 斜的 0 下 1右 2上 3左 + * 10 左下斜 11 右下斜 12 右上斜 13 左上斜 */ + switch (model.direction) { + case 0: + _pointY = _pointY - drillConfig.value.horiSafeSize + break; + case 1: + break; + case 2: + _pointY = _pointY + drillConfig.value.horiSafeSize + break; + case 3: + break; + default: + break; + } + return outPutFloatNumberByConfig(_pointY) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ_safe_end': + // 侧面槽造型 groovesH + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + let flag = false + dictItem.tagResA = sourceA.map(e => { + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + + }) + } + + }) + dictItem.tagResB = sourceB.map(e => { + if (!flag) { + return e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + return outPutFloatNumberByConfig(rd) + + } + ) + } + }) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.modelEndPoint) { + return '' + } + let c = model.modelEndPoint + + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 2, true) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + let flag = false + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + if (e.holeListFaceA.length > 0 || e.modelListFaceA.length > 0) { + flag = true + return outPutFloatNumberByConfig(rd) + } + if (flag == false && (e.holeListFaceA.length == 0 || e.modelListFaceA.length == 0) && (e.blockDetail.holeListSide.length > 0 || e.blockDetail.modelListSide.length > 0)) { + flag = true + return outPutFloatNumberByConfig(rd) + } + + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 1, true) + if (!flag) { + return outPutFloatNumberByConfig(rd) + } + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListSide.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + // let c = model.modelEndPoint + // let rd = - c.z || -c.pointZ + let c = model.realPointList[model?.realPointList.length - 1] + let rd = getProcessItemPointZ(c.pointZ, e.thickness, 0, true) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + + default: + break; + } + break + + //#endregion 侧面槽 + + //#region 凹槽 + case 'grooves': + switch (dictItem.itemKey) { + case 'count': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length) + dictItem.tagResB = sourceA.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.map(x => x.realPointList.length || 0)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countFaceA': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length) + } + dictItem.tagRes = source.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length) + } else { + if (drillConfig.value?.isFileSort == true) { + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelListFaceA.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagRes = tagRes + } + break + case 'countFaceB': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceB.filter(e => e.isRect == true && e.isTilt == false).length) + dictItem.tagResB = sourceB.map(e => e.modelListFaceB.filter(e => e.isRect == true && e.isTilt == false).length) + } + dictItem.tagRes = source.map(e => e.modelListFaceB.filter(e => e.isRect == true && e.isTilt == false).length) + } else { + if (drillConfig.value?.isFileSort == true) { + + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceB.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceB.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.modelListFaceB.filter(e => e.isRect == true && e.isTilt == false).length)) + }); + dictItem.tagRes = tagRes + } + // if (exportFileType == 0 || exportFileType == 1) { + // dictItem.tagRes = source.map(e => e.modelListFaceB.length) + // } else { + // let tagRes: any = []; + // source.forEach(material => { + // tagRes = tagRes.concat(material.blockList.map(e => e.modelListFaceB.length)) + // }); + // dictItem.tagRes = tagRes + // } + break + + case 'countThrough': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true && x.depth >= x.thickness).length) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true && x.depth >= x.thickness).length) + } + dictItem.tagRes = source.map(e => e.blockDetail.modelListThrough.filter(x => x.isRect == true && x.depth >= x.thickness).length) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true && x.depth >= x.thickness).length)) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true && x.depth >= x.thickness).length)) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.modelListThrough.filter(x => x.isRect == true && x.depth >= x.thickness).length)) + }); + dictItem.tagRes = tagRes + } + break + + case 'id': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelId)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelId)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.modelId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelId))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelId))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.modelId))) + }); + dictItem.tagRes = tagRes + } + break + + case 'face': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.face)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.face)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.face)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.face))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.face))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.face))) + }); + dictItem.tagRes = tagRes + } + break + case 'width': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelWidth)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelWidth)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.modelWidth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelWidth))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelWidth))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.modelWidth))) + }); + dictItem.tagRes = tagRes + } + break + case 'length': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelLength)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelLength)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.modelLength)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelLength))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.modelLength))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.modelLength))) + }); + dictItem.tagRes = tagRes + } + break + case 'depth': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.depth)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.depth)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.depth)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.depth))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.depth))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.depth))) + }); + dictItem.tagRes = tagRes + } + break + + case 'toolName': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolNo': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || '')) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || '')) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || '')) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeName || ''))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolBelongNo': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axleId)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axleId)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.axleId)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axleId))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axleId))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.axleId))) + }); + dictItem.tagRes = tagRes + } + break + case 'toolDiameter': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.diameter)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.diameter)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.diameter)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.diameter))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.diameter))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.diameter))) + }); + dictItem.tagRes = tagRes + } + break + + case 'axisStartCode': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStartCode)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStartCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.axisStartCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStartCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStartCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.axisStartCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeStartCode': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStartCode)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStartCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeStartCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStartCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStartCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeStartCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupStartCode': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupStartCode)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupStartCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupStartCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupStartCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupStartCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupStartCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'holesGroupEndCode': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupEndCode)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupEndCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupEndCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupEndCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupEndCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.holesGroupEndCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'knifeStopCode': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStopCode)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStopCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeStopCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStopCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.knifeStopCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.knifeStopCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'axisStopCode': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStopCode)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStopCode)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.axisStopCode)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStopCode))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.axisStopCode))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.axisStopCode))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_x': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetX)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetX)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.offsetX)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetX))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetX))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.offsetX))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_y': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetY)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetY)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.offsetY)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetY))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetY))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.offsetY))) + }); + dictItem.tagRes = tagRes + } + break + case 'redundance_z': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model?.knife?.offsetZ))) + }); + dictItem.tagRes = tagRes + } + break + + + case 'knifePointCount': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.length)) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.length)) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.length)) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.length))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.length))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.length))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX_start': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointX)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_start': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.filter(x => x.isRect == true).map(e => e.modelListFaceA.map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.filter(x => x.isRect == true).map(e => e.modelListFaceA.map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.filter(x => x.isRect == true).map(e => e.blockDetail.models.map(model => outPutFloatNumberByConfig(model?.realPointList[0]?.pointY)))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointZ_start': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + } + )) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[0]) { + return '' + } + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointX_end': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointX)))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY_end': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY)))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY)))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => outPutFloatNumberByConfig(model?.realPointList[model?.realPointList.length - 1]?.pointY)))) + }); + dictItem.tagRes = tagRes + } + break + + case 'pointZ_end': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + + })) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + } + )) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => { + if (!model.realPointList[model?.realPointList.length - 1]) { + return '' + } + + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointX': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointX)))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointX)))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointX)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointX))))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointX))))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointX))))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointY': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointY)))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointY)))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointY)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointY))))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointY))))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.map(point => outPutFloatNumberByConfig(point.pointY))))) + }); + dictItem.tagRes = tagRes + } + break + case 'pointZ': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + }))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.filter(x => x.isRect == true).map(model => model.realPointList.map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.filter(x => x.isRect == true).map(model => model.realPointList.map(point => { + let rd = getProcessItemPointZ(model.depth, e.thickness, model.face, false) + return outPutFloatNumberByConfig(rd) + })))) + }); + dictItem.tagRes = tagRes + } + break; + + case 'radius': + // 凹槽 grooves + if (exportFileType == 0 || exportFileType == 1) { + if (drillConfig.value?.isFileSort == true) { + dictItem.tagResA = sourceA.map(e => e.modelListFaceA.map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)))) + dictItem.tagResB = sourceB.map(e => e.modelListFaceA.map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)))) + } + dictItem.tagRes = source.map(e => e.blockDetail.models.map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius)))) + } else { + if (drillConfig.value?.isFileSort == true) { + let tagResA: any = []; + sourceA.forEach(material => { + tagResA = tagResA.concat(material.blockList.map(e => e.modelListFaceA.map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))))) + }); + dictItem.tagResA = tagResA + + let tagResB: any = []; + sourceB.forEach(material => { + tagResB = tagResB.concat(material.blockList.map(e => e.modelListFaceA.map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))))) + }); + dictItem.tagResB = tagResB + } + let tagRes: any = []; + source.forEach(material => { + tagRes = tagRes.concat(material.blockList.map(e => e.blockDetail.models.map(model => model.realPointList.slice(1, -1).map(point => outPutFloatNumberByConfig(point.radius))))) + }); + dictItem.tagRes = tagRes + } + break; + + default: + break; + } + + break + + //#endregion + case 'Islets': + switch (dictItem.itemKey) { + + case 'xxx': + + + + default: + break; + } + break + case 'Hardwares': + switch (dictItem.itemKey) { + + case 'xxx': + + + + default: + break; + } + break + case 'Assemblie': + switch (dictItem.itemKey) { + + case 'xxx': + + + + default: + break; + } + break + case 'machineInfo': + switch (dictItem.itemKey) { + + case 'isOpen': + // 没有 + break + case 'configName': + + dictItem.tagRes = drillConfig.value.name + break + case 'brand': + + dictItem.tagRes = drillConfig.value.brand + break + // case 'configType': + // dictItem.tagRes = drillConfig.value.brand + // break + // case 'remark': + + // dictItem.tagRes = drillConfig.value.brand + // break + default: + break; + } + break + case 'process': + + switch (dictItem.itemKey) { + case 'verticalSafeSize': + // 垂直安全距离 + let val = outPutFloatNumberByConfig(drillConfig.value.freeHeight + placeData.value.materialList[0].thickness) + + dictItem.tagRes = val + dictItem.tagResA = val + dictItem.tagResB = val + break + case 'horizontalSafeSize': + // 水平安全距离 + dictItem.tagRes = outPutFloatNumberByConfig(drillConfig.value.horiSafeSize) + dictItem.tagResA = outPutFloatNumberByConfig(drillConfig.value.horiSafeSize) + dictItem.tagResB = outPutFloatNumberByConfig(drillConfig.value.horiSafeSize) + break + case 'freeSpeed': + // 空程速度 + dictItem.tagRes = drillConfig.value.freeSpeed + dictItem.tagResA = drillConfig.value.freeSpeed + dictItem.tagResB = drillConfig.value.freeSpeed + break + case 'startSpeed': + // 初始加工深度 + dictItem.tagRes = drillConfig.value.modelSpeed + dictItem.tagResA = drillConfig.value.modelSpeed + dictItem.tagResB = drillConfig.value.modelSpeed + break + + // case 'modelSpeed': + // dictItem.tagRes = drillConfig.value.modelSpeed + // break + // case 'millingSpeed': + // dictItem.tagRes = drillConfig.value.millingSpeed + // break + // case 'holeOrModeEnDepth': + // dictItem.tagRes = drillConfig.value.holeOrModelDeepen + // break + // case 'throughModelSlantLength': + // dictItem.tagRes = drillConfig.value.holeOrModelKnifeDeepen + // break + default: + break; + } + break + case 'machineBaseInfo': + switch (dictItem.itemKey) { + + case 'horizontalBaeePoint': + dictItem.tagRes = drillConfig.value.originZ0Position + break + case 'verticalBaeePoint': + dictItem.tagRes = drillConfig.value.originPointPosition + break + case 'lengthDirection': + dictItem.tagRes = drillConfig.value.lengthSideAxis + break + case 'shortDirection': + dictItem.tagRes = drillConfig.value.widthSideAxis + break + case 'zDirection': + dictItem.tagRes = drillConfig.value.heightAxis + break + case 'basePoint': + dictItem.tagRes = drillConfig.value.processLocation + break + case 'boardStyle': + dictItem.tagRes = drillConfig.value.setBoardStyle + break + case 'overLapStyle': + dictItem.tagRes = drillConfig.value.overLapStyle + break + case 'isFourSideFrontBackItem': + dictItem.tagRes = drillConfig.value.isFourSideFrontBackItem + break + default: + break; + } + break + case 'processHoles': + switch (dictItem.itemKey) { + + case 'freeSpeed': + dictItem.tagRes = drillConfig.value?.holeFreeSpeed || '' + break + case 'holeSpeed': + dictItem.tagRes = drillConfig.value?.holeSpeed || '' + break + case 'isHoleDelay': + dictItem.tagRes = drillConfig.value?.isHoleDelay || '' + break + case 'holeDelayCode': + dictItem.tagRes = drillConfig.value?.holeDelayCode || '' + break + case 'isPreHoleDelay': + dictItem.tagRes = drillConfig.value?.isPreHoleDelay || '' + break + case 'preHoleDelayCode': + dictItem.tagRes = drillConfig.value?.preHoleDelayCode || '' + break + case 'throughHoleOneTime': + dictItem.tagRes = drillConfig.value?.throughHoleOneTime || '' + break + case 'throughHoleProcessMode': + dictItem.tagRes = drillConfig.value?.throughHoleProcessMode || '' + break + case 'holeEnDepth': + dictItem.tagRes = drillConfig.value?.throughHoleDeepen || '' + break + default: + break; + } + break + case 'processModel': + + switch (dictItem.itemKey) { + + case 'modelSpeed': + dictItem.tagRes = drillConfig.value?.modelSpeed || '' + break + case 'millingSpeed': + dictItem.tagRes = drillConfig.value?.millingSpeed || '' + break + case 'holeOrModeEnDepth': + dictItem.tagRes = drillConfig.value?.holeOrModelDeepen || '' + break + case 'throughModelSlantLength': + dictItem.tagRes = drillConfig.value?.holeOrModelKnifeDeepen || '' + break + + + default: + break; + } + break + case 'processUnRegular': + switch (dictItem.itemKey) { + + case 'overRun_unRegular': + dictItem.tagRes = drillConfig.value?.specialShapedBorder || '' + break + + + + default: + break; + } + break + + // case 'knifes': + // switch (dictItem.itemKey) { + + // case 'knifeId': + // // dictItem.tagRes = knifeId + + // break + + + + // default: + // break; + // } + // break + case 'DataDefinition': + switch (dictItem.itemKey) { + + case 'ncFileEncoding': + + + + default: + break; + } + break + case 'DataPreDeal': + switch (dictItem.itemKey) { + + case 'maxGrooveWidth': + dictItem.tagRes = drillConfig.value?.maxSlotWidth || '' + break + case 'minGrooveWidth': + dictItem.tagRes = drillConfig.value?.maxSlotLength || '' + break + case 'GrooveExLength': + dictItem.tagRes = drillConfig.value?.slotLengthExtend || '' + break + case 'GrooveExWidth': + dictItem.tagRes = drillConfig.value?.slotWidthExtend || '' + break + case 'GrooveExDepth': + dictItem.tagRes = drillConfig.value?.slotDepthExtend || '' + break + + case 'GrooveIsInside': + dictItem.tagRes = drillConfig.value?.isSlotLimitInsideBoard || '' + break + case 'GrooveDirectionX': + dictItem.tagRes = drillConfig.value?.slotProcessDirectionY || '' + break + case 'GrooveDirectionY': + dictItem.tagRes = drillConfig.value?.slotProcessDirectionX || '' + break + + case 'sawProcessContent': + dictItem.tagRes = drillConfig.value?.slotProcessCut || '' + break + case 'arcTurnPolylineLen': + dictItem.tagRes = drillConfig.value?.arcTurnPolylineLen || '' + break + case 'isProcess_throuthhole': + dictItem.tagRes = drillConfig.value?.isThroughHole2FaceProcess || '' + break + + case 'isDBProcess_throuthModel': + dictItem.tagRes = drillConfig.value?.isThroughModel2FaceProcess || '' + break + case 'DBProcess_Depth': + dictItem.tagRes = drillConfig.value?.processDepth2Face || '' + break + case 'unRegularKnifeEx': + dictItem.tagRes = drillConfig.value?.unRegularMillingKnifeExpand || '' + break + case 'unRegularKnifeSplite': + dictItem.tagRes = drillConfig.value?.isUnRegularMillingKnifeSplit || '' + break + case 'unRegularKnifeOffset': + dictItem.tagRes = drillConfig.value?.unRegularMillingKnifeOffset || '' + break + case 'unRegularKnifeDBProcess': + dictItem.tagRes = drillConfig.value?.isUnRegularMillingKnife2FaceProcess || '' + break + case 'unRegularKnife_Depth': + dictItem.tagRes = drillConfig.value?.unRegularMillingKnifeDepth || '' + break + case 'unRegularKnifeItem': + dictItem.tagRes = drillConfig.value?.unRegularMillingKnife || '' + break + case 'highProcessContent': + dictItem.tagRes = drillConfig.value?.advancedCode || '' + break + + default: + break; + } + break + case 'DataSourceHandle': + switch (dictItem.itemKey) { + + case 'boardId': + dictItem.tagRes = drillConfig.value?.customBoardNo || '' + break + case 'decimalPlaces': + dictItem.tagRes = drillConfig.value?.decimalPointPrecision || '' + break + case 'connectToPlaceInfo': + dictItem.tagRes = drillConfig.value?.relateCuttingInfo || '' + break + default: + break; + } + break + case 'processOtherKnife': + switch (dictItem.itemKey) { + + case 'OtherKnife_holes': + dictItem.tagRes = drillConfig.value.isAllowDoubleSplit + break + case 'OtherKnife_models': + dictItem.tagRes = drillConfig.value.isAllowModelSplit + break + case 'depth': + dictItem.tagRes = drillConfig.value.splitDepth + break + case 'times': + dictItem.tagRes = drillConfig.value.splitCount + break + default: + break; + } + break + default: + break; + } + + let checkArr = ['outline', 'cuttingoutline', 'rawoutline', 'holes', 'sideHoles', 'grooves', 'groovesH', 'models', 'modelsH']; + + + + if (dictItem.tagRes == null && dictItem.tagResA == null && dictItem.tagResB == null) { + console.log('未处理:', dictItem.type, dictItem.itemKey, dictItem.itemLabel) + } else { + // console.log('已处理:', dictItem.type, dictItem.itemKey, dictItem.itemLabel, dictItem.tagRes); + } + + if (drillConfig.value?.isFileSort == true && !checkArr.includes(dictItem.type)) { + if (dictItem.tagResA == null && dictItem.tagRes != null) { + dictItem.tagResA = dictItem.tagRes + } + + + if (dictItem.tagResB == null && dictItem.tagRes != null) { + dictItem.tagResB = dictItem.tagRes + } + } + + if (Array.isArray(dictItem.tagResA)) { + dictItem.tagResA = dictItem.tagResA.filter(e => e != undefined) + } + if (Array.isArray(dictItem.tagResB)) { + dictItem.tagResB = dictItem.tagResB.filter(e => e != undefined) + } + + // 做个控制 如果没有加工项 则不返回数据 达到不生成文件的目的 + // if(exportFileType == 0 || exportFileType ==1){ + // let hasAArr = sourceA.map(block=>block.blockDetail.modelListSide.length > 0 || block.block) + // }else{ + + // } + +} + + +/** 根据机台配置 输出小数点位数 相符的数据 */ +function outPutFloatNumberByConfig(val) { + let num = 0 + if (Number.isNaN(val) || !val) { + num = 0 + }else{ + num = parseFloat(val) + } + + /** + * decimalPointPrecision 小数点后保留几位 + * fixFloatNumberEndZero 所有数值 后面是否保留小数位 + * intNumberAddDecimalPoint 整数值 是否保留小数位 + */ + const { decimalPointPrecision, fixFloatNumberEndZero, intNumberAddDecimalPoint } = drillConfig.value + + let res: any = '' + + if (decimalPointPrecision) { + // 有配置小数点位数才进来 + if (fixFloatNumberEndZero) { + // 所有数值都做保留小数位操作 + let fix = decimalPointPrecision || 0 + res = num.toFixed(decimalPointPrecision) + } else { + if (intNumberAddDecimalPoint) { + if (Number.isInteger(num)) { + // 只有整数做保留小数位操作 + res = num.toFixed(decimalPointPrecision) + } else { + res = num + } + }else{ + res = num + } + } + } else { + res = num + } + + + return res +} + +/** + * 数据转换 + * 将特定字段的值转为实际生产的对应的值 + * @param block + * + */ +export function transformDataValue(block: PlaceBlock, projectList) { + + if (Array.isArray(projectList) && projectList.length > 0) { + let dict_face = projectList.find(e => e.key == 'face') + let dict_sideFace = projectList.find(e => e.key == 'sideFace') + let dict_arcDirection = projectList.find(e => e.key == 'arcDirection') + let dict_modelKnifeOffset = projectList.find(e => e.key == 'modelKnifeOffset') + let dict_axisPoint = projectList.find(e => e.key == 'axisPoint') + let dict_axisZeroPoint = projectList.find(e => e.key == 'axisZeroPoint') + + + // 加工面转换 + if (dict_face) { + for (const i in block.holeListFaceA) { + let hole = block.holeListFaceA[i] + block.holeListFaceA[i].face = _transForm(hole.face, dict_face) + } + + for (const i in block.holeListFaceB) { + let hole = block.holeListFaceB[i] + block.holeListFaceB[i].face = _transForm(hole.face, dict_face) + } + + for (const i in block.blockDetail.holes) { + let hole = block.blockDetail.holes[i] + block.blockDetail.holes[i].face = _transForm(hole.face, dict_face) + } + + for (const i in block.modelListFaceA) { + let model = block.modelListFaceA[i] + block.modelListFaceA[i].face = _transForm(model.face, dict_face) + } + + for (const i in block.modelListFaceB) { + let model = block.modelListFaceB[i] + block.modelListFaceB[i].face = _transForm(model.face, dict_face) + } + + for (const i in block.blockDetail.models) { + let model = block.blockDetail.models[i] + block.blockDetail.models[i].face = _transForm(model.face, dict_face) + } + } + // 侧面加工转换 + if (dict_sideFace) { + for (const i in block.blockDetail.holeListSide) { + let sideHole = block.blockDetail.holeListSide[i] + block.blockDetail.holeListSide[i].direct = _transForm(sideHole.direct, dict_sideFace) + } + + for (const i in block.blockDetail.modelListSide) { + let sideModel = block.blockDetail.modelListSide[i] + block.blockDetail.modelListSide[i].direction = _transForm(sideModel.direction, dict_sideFace) + } + } + + // 弧线方向 + if (dict_arcDirection) { } + // 铣型刀路偏置 + if (dict_modelKnifeOffset) { } + // 参考顶点 + if (dict_axisPoint) { } + // 平面参考点 + if (dict_axisZeroPoint) { } + } + + // 侧面加工 + +} + +function _transForm(val, dict) { + let res = val + let item = dict.rows.find(e => e.rawValue == val) + if (item) { + res = item.targetValue + } + return res +} +/** + * + * @param info 节点信息 + * @param loopObj 节点循环依据数据集 定位数据具体位置用的 + * @param i 节点下标 + * @param isCondition_Line 是否是刀路 + * @returns + */ +function getChangeKnifeCode(info, loopObj, i, isCondition_Line) { + // 定位加工项 + let conditionSource: any = null + if (info._flag == 'A') { + conditionSource = fileDataA.value + } else if (info._flag == 'B') { + conditionSource = fileDataB.value + } else { + conditionSource = fileDataAB.value + } + if (conditionSource == null) { + return + } + let processList: any = [] + + switch (loopObj.type) { + case 'holes': + // 垂直孔 + + switch (info._flag) { + case 'A': + processList = conditionSource[info.pid].holeListFaceA + break; + case 'B': + processList = conditionSource[info.pid].holeListFaceA + + break; + default: + processList = conditionSource[info.pid].holes + break; + } + break; + case 'sideHoles': + // 侧孔 + processList = conditionSource[info.pid].blockDetail.holeListSide + break; + case 'models': + // 垂直造型 + switch (info._flag) { + case 'A': + processList = conditionSource[info.pid].blockDetail.modelListFaceA.filter(e => e.isRect == false) + break; + case 'B': + processList = conditionSource[info.pid].blockDetail.modelListFaceB.filter(e => e.isRect == false) + break; + default: + processList = conditionSource[info.pid].blockDetail.models.filter(e => e.isRect == false) + break; + } + break; + case 'modelsH': + // 侧面造型 + processList = conditionSource[info.pid].blockDetail.modelListSide.filter(e => e.isRect == false) + break; + case 'groovesH': + // 侧面槽 + processList = conditionSource[info.pid].blockDetail.modelListSide.filter(e => e.isRect == true) + break; + case 'grooves': + // 垂直槽 + + switch (info._flag) { + case 'A': + processList = conditionSource[info.pid].blockDetail.modelListFaceA.filter(e => e.isRect == true) + break; + case 'B': + processList = conditionSource[info.pid].blockDetail.modelListFaceB.filter(e => e.isRect == true) + break; + default: + processList = conditionSource[info.pid].blockDetail.models.filter(e => e.isRect == true) + break; + } + break; + default: + break; + } + + let _item: any = null + let _index = -1 + if (isCondition_Line) { + _item = processList[info.kid] + _index = info.kid + } else { + _item = processList[i] + _index = i + } + + let allprocessItem = { + block: conditionSource[info.pid], + blockNo: conditionSource[info.pid]?.blockNo, + processItem: _item, + processFace: info._flag, + processType: loopObj.type, + isLine: isCondition_Line, + index: _index + } + + if (_item == undefined) { + console.log('没有对应的加工项', conditionSource, loopObj.type); + return + } + + // 输出的代码 + let code = '' + + + // 是否要换刀 + let isChangeKnife = false + // 是否换轴 + let isChangeAxis = false + + // 上个加工项 + let lastProcessItem = allProcessList.value[allProcessList.value.length - 1] + + + + if (allProcessList.value.length == 0) { + // 第一个加工项 要调刀 + isChangeKnife = true + isChangeAxis = true + } else { + if (info.exportFileType == 0 || info.exportFileType == 1) { + if (lastProcessItem.processItem.knife.knifeId == _item?.knife.knifeId + && allprocessItem.processFace == lastProcessItem.processFace + && allprocessItem.blockNo == lastProcessItem.blockNo + && allprocessItem.processFace == lastProcessItem.processFace) { + // 同一把刀 不要换 + isChangeKnife = false + } else { + // 要换刀 + isChangeKnife = true + } + } else if (info.exportFileType == 2 || info.exportFileType == 3) { + if (lastProcessItem.processItem.knife.knifeId == _item?.knife.knifeId + && allprocessItem.processFace == lastProcessItem.processFace + && allprocessItem.block.boardId == lastProcessItem.block.boardId) { + // 同一把刀 不要换 + isChangeKnife = false + + } else { + // 要换刀 + isChangeKnife = true + } + } + + // 要换刀的前提下 判断 轴变化 + if (isChangeKnife == true) { + if (_item.knife.axleId != lastProcessItem.processItem.knife.axleId) { + isChangeAxis = true + } + } + } + + // 生成代码 + // 当前加工代码 + //轴启动代码 + let axisStartCode = addNextLineCode(_item.knife.axisStartCode) + // 刀启动代码 + let knifeStartCode = addNextLineCode(_item.knife.knifeStartCode) + // 轴停止代码 + let axisStopCode = addNextLineCode(_item.knife.axisStopCode) + // 刀停止代码 + let knifeStopCode = addNextLineCode(_item.knife.knifeStopCode) + + + function addNextLineCode(str) { + if (str.includes('\n')) { + return str + } else { + return str + '\n' + } + + } + // 上个加工代码 + + if (allProcessList.value.length == 0) { + // 轴启动 + 刀启动 + code = axisStartCode + knifeStartCode + } else { + //轴启动代码 + let axisStartCode_last = addNextLineCode(lastProcessItem.processItem.knife.axisStartCode) + // 刀启动代码 + let knifeStartCode_last = addNextLineCode(lastProcessItem.processItem.knife.knifeStartCode) + // 轴停止代码 + let axisStopCode_last = addNextLineCode(lastProcessItem.processItem.knife.axisStopCode) + // 刀停止代码 + let knifeStopCode_last = addNextLineCode(lastProcessItem.processItem.knife.knifeStopCode) + + + if (isChangeKnife == true && isChangeAxis == true) { + // 轴停止 + 刀停止 + 轴启动 + 刀启动 + code = axisStopCode_last + knifeStopCode_last + axisStartCode + knifeStartCode + } else if (isChangeKnife == true && isChangeAxis == false) { + // + code = axisStartCode + knifeStartCode + } + + } + + + + + return code + '\n' +} + +function getKnifeUpCode() { + +} + + +export function checkCondition(conditionList, info, loopObj, i, isCondition_Line) { + /** + * 0 需要调刀 + * 1 不需要调刀 + * 2 直线刀路 + * 3 逆时针圆弧刀路 + * 4 顺时针圆弧刀路 + * 5 正面加工 + * 6 反面加工 + */ + + + + // 定位加工项 + let conditionSource = null + if (info._flag == 'A') { + conditionSource = fileDataA.value + } else if (info._flag == 'B') { + conditionSource = fileDataB.value + } else { + conditionSource = fileDataAB.value + } + let processList: any = [] + if (conditionSource == null) { + // 有问题哦 + } + switch (loopObj.type) { + case 'holes': + // 垂直孔 + + switch (info._flag) { + case 'A': + processList = conditionSource[info.pid].holeListFaceA + break; + case 'B': + processList = conditionSource[info.pid].holeListFaceA + + break; + default: + processList = conditionSource[info.pid].holes + break; + } + break; + case 'sideHoles': + // 侧孔 + processList = conditionSource[info.pid].blockDetail.holeListSide + break; + case 'models': + // 垂直造型 + switch (info._flag) { + case 'A': + processList = conditionSource[info.pid].blockDetail.modelListFaceA.filter(e => e.isRect == false) + break; + case 'B': + processList = conditionSource[info.pid].blockDetail.modelListFaceB.filter(e => e.isRect == false) + break; + default: + processList = conditionSource[info.pid].blockDetail.models.filter(e => e.isRect == false) + break; + } + break; + case 'modelsH': + // 侧面造型 + processList = conditionSource[info.pid].blockDetail.modelListSide.filter(e => e.isRect == false) + break; + case 'groovesH': + // 侧面槽 + processList = conditionSource[info.pid].blockDetail.modelListSide.filter(e => e.isRect == true) + break; + case 'grooves': + // 垂直槽 + + switch (info._flag) { + case 'A': + processList = conditionSource[info.pid].blockDetail.modelListFaceA.filter(e => e.isRect == true) + break; + case 'B': + processList = conditionSource[info.pid].blockDetail.modelListFaceB.filter(e => e.isRect == true) + break; + default: + processList = conditionSource[info.pid].blockDetail.models.filter(e => e.isRect == true) + break; + } + break; + default: + break; + } + + let _item: any = null + let _index = -1 + if (isCondition_Line) { + _item = processList[info.kid] + _index = info.kid + } else { + _item = processList[i] + _index = i + } + + let allprocessItem = { + block: conditionSource[info.pid], + blockNo: conditionSource[info.pid].blockNo, + processItem: _item, + processFace: info._flag, + processType: loopObj.type, + isLine: isCondition_Line, + index: _index + } + + + if (_item == undefined) { + console.log('没有对应的加工项', conditionSource, loopObj.type); + return + } + let res = null + let isLine = false + + for (let condition of conditionList) { + + let checkArr = condition.conditionOptions + + let flag = true + let c = 0 + if (checkArr.includes('2') || checkArr.includes('3') || checkArr.includes('4')) { + let point: any = null + + point = { ..._item.realPointList[i] } + if (point) { + if (point.curve == undefined) { + c = 0 + } else if (Number.isNaN(point.curve)) { + c = 0 + } else { + c = point.curve + } + } else { + c = 0 + } + } + for (const str of checkArr) { + switch (str) { + case '0': + // 0 需要调刀 + let c_0 = checkChangeKnife(allprocessItem, info); + if (c_0 == true) { + flag = true + } else { + flag = false + } + break; + case '1': + // 1 不需要调刀 + let c_1 = checkChangeKnife(allprocessItem, info); + if (c_1 == false) { + flag = true + } else { + flag = false + } + break; + case '2': + // 2 直线刀路 + if (c == 0) { + flag = true + } else { + flag = false + } + break; + case '3': + // 3 逆时针圆弧刀路 + if (c > 0) { + flag = true + } else { + flag = false + } + break; + case '4': + // 4 顺时针圆弧刀路 + if (c < 0) { + flag = true + } else { + flag = false + } + break; + case '5': + // 5 正面加工 + if ((info._flag == 'A' || info._flag == 'AB') && _item.face == 0) { + flag = true + } else { + flag = false + } + + break; + case '6': + // 6 反面加工 + + if ((info._flag == 'B' || info._flag == 'AB') && _item.face == 1) { + flag = true + } else { + flag = false + } + break; + default: + break; + } + + if (flag == false) { + continue + } + } + + if (flag == true) { + if (_item != undefined) { + let orderby = 'block' + if (info.exportFileType == '2' || info.exportFileType == '3') { + orderby = 'board' + } + if (!allProcessList.value.find(e => e.blockNo == allprocessItem.blockNo && e.index == allprocessItem.index && e.processType == allprocessItem.processType && e.processFace == allprocessItem.processFace)) { + allProcessList.value.push(allprocessItem) + } + } + + res = condition + console.log('条件输出', info, res) + return res + } else { + if (!allProcessList.value.find(e => e.blockNo == allprocessItem.blockNo && e.index == allprocessItem.index && e.processType == allprocessItem.processType && e.processFace == allprocessItem.processFace)) { + allProcessList.value.push(allprocessItem) + } + } + } + + function checkChangeKnife(param, _info) { + let isChangeKnife = false + let lastProcessItem = allProcessList.value[allProcessList.value.length - 1] + if (allProcessList.value.length == 0) { + // 第一个加工项 要调刀 + isChangeKnife = true + } else { + if (_info.exportFileType == 0 || _info.exportFileType == 1) { + if (lastProcessItem.processItem.knife.knifeId == _item?.knife.knifeId + && param.processFace == lastProcessItem.processFace + && param.blockNo == lastProcessItem.blockNo + && param.processFace == lastProcessItem.processFace) { + // 同一把刀 不要换 + isChangeKnife = false + } else { + // 要换刀 + isChangeKnife = true + } + } else if (_info.exportFileType == 2 || _info.exportFileType == 3) { + if (lastProcessItem.processItem.knife.knifeId == _item?.knife.knifeId + && param.processFace == lastProcessItem.processFace + && param.block.boardId == lastProcessItem.block.boardId) { + // 同一把刀 不要换 + isChangeKnife = false + + } else { + // 要换刀 + isChangeKnife = true + } + } + + } + return isChangeKnife + } + + return res + +} diff --git a/src/processParser/common/transform.ts b/src/processParser/common/transform.ts new file mode 100644 index 0000000..9169d4f --- /dev/null +++ b/src/processParser/common/transform.ts @@ -0,0 +1,1519 @@ +import { ref } from 'vue' +import { SysConfig } from '../biz/SysConfig' +import type { HoleDetail } from '../vo/hole/HoleDetail' +import { PlaceBorderContour } from '../vo/order/PlaceBorderContour' +import type { contourDetail, sideHoleDetail } from '../vo/product/plateModel' +import { BlockModel } from '../vo/model/BlockModel' +import { equal, getRect } from './base/MathComm' +import { PlaceBlock } from '../vo/order/PlaceBlock' +import { CADExt, Point2d } from './base/CAD' +import { BlockPoint } from '../vo/point/BlockPoint' +// 小板数据转换 +export function transformXb(blockList, sysConfig) { + const transformedData: any = [] + for (let i = 0; i < blockList.length; i++) { + const plate = blockList[i] + const transformedPlate = { + l: plate.length, + w: plate.width, + line: plate.texture, + face: plate.placeHole, + id: i + 1, // 使用当前索引加1作为id的值 + bno: plate.plateNo || undefined, + holeFaceCount: 3, + isRect: !plate.isUnRegular, + hasHole: plate.hasHole, + isdtwosided: false, // sysConfig.isDoubleFaceBlockFirst, + } + transformedData.push(transformedPlate) + } + return transformedData +} + +// 获取优化次数-根据小板 +export function getOpCs(bans) { + let xyhcs = 50 + if (bans.length > 1000) + xyhcs = 40 + if (bans.length > 1500) + xyhcs = 30 + if (bans.length > 2000) + xyhcs = 25 + if (bans.length > 4000) + xyhcs = 20 + if (bans.length > 6000) + xyhcs = 15 + if (bans.length > 10000) + xyhcs = 10 + if (bans.length > 15000) + xyhcs = 5 + if (bans.length > 20000) + xyhcs = 1 + return xyhcs +} + +// 大板数据转换 +export function transformDb(materialList, sysConfig) { + let transbndData: any = [] + const { boardOffsetX, boardOffsetY } = sysConfig + function addParams(length, width) { + return { l: length, w: width, x: boardOffsetX, y: boardOffsetY } + } + const remainBoardList = materialList[0]?.remainBoardList || [] + remainBoardList.forEach((remainBoard) => { + transbndData.push(addParams(remainBoard.length, remainBoard.width)) + }) + materialList.forEach((plate) => { + transbndData.push(addParams(plate.orgLength || plate.length, plate.orgWidth || plate.width)) + }) + return transbndData +} + +// 取最厚的一个大板的板厚 +function findMaxThickness(data) { + let maxThickness = 0 + let maxThicknessData = null + + data?.forEach((item) => { + if (item.thickness > maxThickness) { + maxThickness = item.thickness + maxThicknessData = item + } + }) + return maxThicknessData +} + +// 获取排版间隙 +export function transformThickness(materialList, sysConfig) { + const data = _getDefaultKnife(materialList, sysConfig) + return data.diameter + sysConfig.blockKnifeLineSpacing // sysConfig.cutKnifeGap +} + +// 获取开料刀 +export function _getDefaultKnife(materialList, sysConfig) { + const obj = new SysConfig(sysConfig) + const target = findMaxThickness(materialList) + const data = obj.getDefaultKnife(target.thickness) + return data +} + +// 数据转换 +// 数据转换前的数据集存一下 转回去的时候估计要用 +const beforeConvertData = ref() +export function convertData(newJson) { + beforeConvertData.value = JSON.parse(JSON.stringify(newJson)) + const { goodsList, machineDTO, optimizeBoardModelDOS, orderList, plan, plateList, plateModels, orderPartsRespVOS, planActualGoodsModelDO } = newJson + + // configList + let mixGoodsId = ''; + const { setting, label } = machineDTO + const configRef = typeof (setting) == 'string' ? JSON.parse(setting) : setting + const sysConfig = new SysConfig(setting) + const tagConfig = label + const styleConfig = JSON.stringify(configRef?.styleConfigsRef) + const configList = [ + { + Type: 1, + Setting: JSON.stringify(configRef), + MachineID: machineDTO.id, + }, + { + Type: 2, + Setting: label, + MachineID: machineDTO.id, + }, + { + Type: 3, + Setting: JSON.stringify(configRef?.styleConfigsRef), + MachineID: machineDTO.id, + }, + ] + // planOrder + + let blockInfoArr: any = [] + + Array.isArray(optimizeBoardModelDOS) && optimizeBoardModelDOS.forEach((item) => { + if (item) { + let str = `${item.material}--${item.color}--${item.spec}--${item.plateNum}片--0.251` + blockInfoArr.push(str) + } + + }) + // 排单数据 + let planOrder: any = {} + // 订单流程时 plan(排单数据)是没有的 忽略 + if (plan) { + planOrder = { + goodsIdList: null, + planId: plan.id, + planCode: plan.id, + status: plan.status, + machineId: machineDTO.id, + createTime: plan.createTime, + creator: plan.creator, + planTime: plan.planTime, + produceTime: plan.produceTime, + producer: '', // + remark: plan.remark, + organId: plan.organId, + updateTime: plan.updateTime, + planType: plan.type, + orderIds: `[${plan.orderNos}]`, + blockInfo: blockInfoArr.join(';'), + orderList: null, + deleted: false, + sort: plan.sort, + } + } + + // materialList goodsList大板中的 goodid没用 + let materialList: any = [] + let newGoodsList: any = [] + goodsList.forEach((item) => { // 去重的 + let i = newGoodsList.findIndex(e => e.goodsId == item.goodsId) + if (i == -1) { + newGoodsList.push(item) + } + }) + // 混单的情况 才会走这个 + if(planActualGoodsModelDO != undefined){ + newGoodsList = [planActualGoodsModelDO] + mixGoodsId = planActualGoodsModelDO.goodsId + } + + newGoodsList.forEach((item) => { + if (optimizeBoardModelDOS && optimizeBoardModelDOS.length > 0) { + let placeItem = optimizeBoardModelDOS.find(e => e?.goodsId == item.goodsId) + if (placeItem) { + if (placeItem.usedBoardInfo) { + let keys = Object.keys(placeItem) + keys.forEach((k) => { + if (placeItem[k] != null && placeItem[k] != undefined) { + item[k] = placeItem[k] + } else { + // console.log('数据为空,不做复写操作,', k, placeItem[k], item[k]) + } + }) + } + } else { + // console.error('没找到 异常 排查: 大板的id 和 优化数据中的大板id 对应不上') + } + } + + const temp = { + orderId: item.orderId, + goodsId: item.goodsId, + goodsName: item.goodsName, + spec: item.spec, + material: item.material, + color: item.color, + brand: item.brand, + width: item.width, + length: item.height, + isOptimized: item.isOptimized, + thickness: item.thickness, + cutBorder: item.cutBorder, + CutDia: item.CutDia, + CutGap: item.CutGap, + boardCount: item.boardCount || 0, + cutKnifeGap: item.cutKnifeGap, + minBoardId: item.minBoardId, + maxBoardId: item.maxBoardId, + avgUsageRateAll: item.avgUsageRateAll, + avgUsageRateExcludeLastBoard: item.avgUsageRateExcludeLastBoard, + usageRateLastBoard: item.usageRateLastBoard, + usedBoardInfo: item.usedBoardInfo, + blockPlaceInfo: item.blockPlaceInfo, + status: item.status, + hasTexture: item.texture, + // texture: item.texture || '', + orgWidth: item.orgWidth || item.width, + orgLength: item.orgLength || item.height, + boardCountRemain: item.boardCountRemain, + remainBoardInfo: item.remainBoardInfo, + preMillingSize: item.preMillingSize, + remainBoardList: [], + isHelpCut: item.isHelpCut, + helpCutGap: item.helpCutGap, + cutKnifeId: item.cutKnifeId, + helpKnifeId: item.helpKnifeId, + updateDate: item.updateDate, + } + materialList.push(temp) + }) + // orderList + let areaDeleted = false + let newOrderList: any = [] + orderList.forEach((item) => { + let temp = { + customerId: item.customerId, + customer: item.customer, + phoneNumber: item.phoneNumber, + orderDate: item.orderDate, + salemanId: item.salemanId, + dealer: item.dealer, + dealerPhoneNumber: item.dealerPhoneNumber, + address: item.address, + splitter: item.splitter, + status: item.status, + amount: 0, + remark: item.remark, + customOrderNo: item.customOrderNo, + deliveryDate: item.deliveryDate, + pushConfig: item.pushConfig || false, + offerListStr: item.offerListStr || null, + cancelStatus: item.cancelStatus || 0, + itemList: item.itemList || null, + goodsList: item.goodsList || null, + offerList: item.offerList || null, + totalOrderOfferList: item.totalOrderOfferList || null, + blockList: item.blockList || null, + dataBlockList: item.dataBlockList || null, + objectList: item.objectList || null, + dataObjectList: item.dataObjectList || null, + goodsInfoList: item.goodsInfoList || null, + orderProcessList: item.orderProcessList || null, + editFun: null, + saleman: item.salesman, + orderId: item.id, + createTime: item.createTime, + organId: item.organId, + schduleDeliveryDate: null, + orderType: item.orderType, + orderSort: item.orderSort, + dataType: item.dataType, + deleted: item.deleted, + processStatus: null, + } + areaDeleted = item.deleted + newOrderList.push(temp) + }) + + // blockList + let blockList: any = [] + + plateList.forEach((item, i) => { + const temp = { + area: item.area, + roomName: item.roomName, + bodyName: item.bodyName, + roomId: item.roomId || 0, + bodyId: item.bodyId || 0, + processGroupld: item.processGroupld, + orderId: item.orderId, + blockId: item.plateId, + goodsId: mixGoodsId || item.goodsId, + oldBlockId: item.plateId, + blockNo: item.plateNo || (i + 1).toString(), + labelNo: '', + blockName: item.name, + width: item.width, + length: item.height, + customPlateNo: item.customPlateNo, // 自定义板编号 + thickness: item.thickness, + isCurvedGroundLine: false, // item.isCurvedGroundLine, // 是否弧线 不处理异形 异形 + isUnRegular: item.isSpecialShaped, + sealLeft: item.sealLeft, + sealRight: item.sealRight, + sealTop: item.sealUp, + sealBottom: item.sealDown, + texture: item.texture, + placeHole: item.holeFace, + abnormalOffsetY: item.offsetX, + abnormalOffsetX: item.offsetY, + remarkJson: '', + dataType: 2, + processGroupName: item.processGroupName, + type: item.type, + openDoorType: item.openDoorType, + extraRemark: {}, + itemId: item.itemId, + plateRemark: item.remark, + } + blockList.push(temp) + }) + + let blockDetailList: any = [] + let holeId = 1 + plateModels.forEach((item) => { + const fitBlock = plateList.find(e => e.plateId === item.plateId) + + if (item.pointInfo && item.boardData && false) { + // webCAd 拆单数据转换 + let _boardData = JSON.parse(item.boardData) + let _data = JSON.parse(item.pointInfo) + // const { holes, outline, modeling, modeling2D,sideModeling,originOutlin} = _data + const { HoleDetail, OrgPointDetail, PointDetail, SideHoleDetail,SideModelDetail,ModelDetail} = _data + let holeDetailArr: HoleDetail[] = [] + + if (HoleDetail) { + HoleDetail.forEach(frontBackHoles => { + let holeDetail: HoleDetail = { + holeId: frontBackHoles.HoleID, + holeType: frontBackHoles.HoleType || 0, + face: frontBackHoles.Face, + pointX: frontBackHoles.PointX || 0, + pointY: frontBackHoles.PointY || 0, + pointZ: frontBackHoles.PointZ || 0, + radius: frontBackHoles.Radius || 0, + depth: frontBackHoles.Depth || 0, + pointX2: 0, + pointY2: 0, + pointZ2: 0, + endPoint: 0, + angle: frontBackHoles.Angle, + name:'', + } + holeId = holeId + 1 + holeDetailArr.push(holeDetail) + }); + } + let sideHoleDetailArr: sideHoleDetail[] = [] + if (SideHoleDetail) { + SideHoleDetail.forEach(sideHoles => { + let sideholeDetail: sideHoleDetail = { + holeId:sideHoles.HoleID || holeId, + holeType: sideHoles.HoleType, + face: sideHoles.Face || 0, + pointX: sideHoles.PointX || 0, + pointY: sideHoles.PointY || 0, + pointZ: sideHoles.PointZ || 0, + radius: sideHoles.Radius || 0, + depth: sideHoles.Depth || 0, + pointX2: sideHoles.PointX2 || 0, + pointY2: sideHoles.PointY2 || 0, + pointZ2: sideHoles.PointZ || 0, + endPoint: sideHoles.EndPoint, + angle: 0, + direction: null, + } + holeId = holeId + 1 + sideHoleDetailArr.push(sideholeDetail) + }); + } + let modelDetailArr: contourDetail[] = [] + let sideModelDetailArr: contourDetail[] = [] + // 造型还缺数据 !!! + if(Array.isArray(ModelDetail) && ModelDetail.length > 0){ + ModelDetail.forEach(_item => { + + const modelDetail: contourDetail = { + modelId: _item.ModelID || ++holeId, + lineId: _item.LineID, + face: _item.Face || 0, + knifeName: _item.KnifeName, + knifeRadius: _item.KnifeRadius || 0, + depth: _item.Depth || 0, + originModeling: _item.OriginModeling, + modelPoint: _item.PointList || [], + modelOffSet: _item.OffSetList || [], + } + modelDetailArr.push(modelDetail) + }); + } + + if(Array.isArray(SideModelDetail) && SideModelDetail.length > 0){ + SideModelDetail.forEach(_item => { + const sideModelDetail: any = { + modelId:_item.ModelID, + lineId: _item.LineID, + face: _item.Face, + knifeName: _item.KnifeName, + knifeRadius: _item.KnifeRadius || 0, + depth: _item.Depth || 0, + originModeling: _item.OriginModeling, + modelPoint: [], + modelOffSet: [], + } + sideModelDetailArr.push(sideModelDetail) + }); + } + + let _PointDetail = [...PointDetail] + // let p = {...PointDetail[0]} + // p.PointID = _PointDetail.length +1 + // _PointDetail.push(p) + + let _OrgPointDetail = [...OrgPointDetail] + // let orgP = {...OrgPointDetail[0]} + // orgP = _OrgPointDetail.length +1 + // _OrgPointDetail.push(orgP) + + // if(fitBlock.isSpecialShaped == false){ + // _PointDetail = []; + // _OrgPointDetail = []; + // } + + const temp = { + blockId: item.plateId, + orderId: item.orderId, + pointDetail: _PointDetail || PointDetail || [], + modelDetail: modelDetailArr || [], + holeDetail: holeDetailArr || [], + models: modelDetailArr || [], + remarkParams: { + sideRemark: item.sideRemark || '', + extraRemark: item.extraRemark || '', + specialRemarkDei: item.specialRemarkDei || '', + extraHandleRemark: item.extraHandleRemark || '', + drillsRemark: item.drillsRemark || '', + infoRemark: item.infoRemark || '', + remarkJsonDei: item.remarkJsonDei || '', + remarkJson: item.remarkJson || '', + specialRemark: item.specialRemark || '', + }, + offSet: { + x: _boardData.offsetTanslation.x, + y: _boardData.offsetTanslation.y, + z: _boardData.offsetTanslation.z || 0, + }, + orgPointDetail: _OrgPointDetail || OrgPointDetail || [], + cutSize: { + width: fitBlock.splitWidth, + height: fitBlock.splitHeight, + }, + modelListSide: sideModelDetailArr,//[], // 侧槽 + sideHoleDetail: sideHoleDetailArr || [], + isUnRegular: fitBlock && fitBlock.isSpecialShaped || false, // item.isSpecialShaped || false, + plateExtraRemark: item.plateExtraRemark, + has2DModel: ModelDetail && ModelDetail.filter(e=>e.OffSetList).length > 0, + has3DModel: _boardData.modeling3D && _boardData.modeling3D.length > 0 // item.has3DModel + } + blockDetailList.push(temp) + } else { + // API导入 拆单数据转换 + // 孔 (正面/反面 + let holeDetailArr: HoleDetail[] = [] + if (item.holeDetail) { + item.holeDetail.forEach((hole) => { + // direction 只有侧孔有 angle 生产数据中没有 + const { holeType, faceType, startX, startY, startZ, radius, depth, direction, angle, endX, endY, endZ } = hole + let holeDetail: HoleDetail = { + holeId, + holeType: holeType || 0, + face: faceType, + pointX: startX || 0, + pointY: startY || 0, + pointZ: startZ || 0, + radius: radius || 0, + depth: depth || 0, + pointX2: endX || 0, + pointY2: endY || 0, + pointZ2: endZ || 0, + endPoint: 0, + angle: 0, + name: '', + } + holeId = holeId + 1 + holeDetailArr.push(holeDetail) + }) + } + + // 侧孔 + let sideHoleDetailArr: sideHoleDetail[] = [] + if (item.sideHoleDetail) { + item.sideHoleDetail.forEach((sideHole) => { + // direction 只有侧孔有 angle 生产数据中没有 + const { holeType, faceType, startX, startY, startZ, radius, depth, direction, angle, endX, endY, endZ } = sideHole + let sideholeDetail: sideHoleDetail = { + holeId, + holeType, + face: faceType || 0, + pointX: startX || 0, + pointY: startY || 0, + pointZ: startZ || 0, + radius: radius || 0, + depth: depth || 0, + pointX2: endX || 0, + pointY2: endY || 0, + pointZ2: endZ || 0, + endPoint: 0, + angle: 0, + direction, + } + holeId = holeId + 1 + sideHoleDetailArr.push(sideholeDetail) + }) + } + + let modelDetailArr: contourDetail[] = [] + let sideModelDetailArr: contourDetail[] = [] + if (item.contourDetail) { + // 垂直造型 + item.contourDetail.forEach((model) => { + const { modelId, lineID, faceType, knifeName, knifeRadius, depth, originModeling, modelPoint, modelOffSet } = model + const modelDetail: contourDetail = { + modelId: model.id || ++holeId, + lineId: lineID, + face: faceType, + knifeName: knifeName || '', + knifeRadius: knifeRadius || 0, + depth: depth || 0, + originModeling, + modelPoint: model.pointList || [], + modelOffSet: model.offSetList || [], + } + modelDetailArr.push(modelDetail) + // if(faceType == 0 || faceType == 1){ + // } + }) + } + + if (item.sideDetail) { + item.sideDetail.forEach((model) => { + const { modelId, lineId, faceType, knifeName, knifeRadius, depth, originModeling, modelPoint, modelOffSet } = model + + const sideModelDetail: any = { + modelId: modelId || ++holeId, + lineId, + face: faceType, + knifeName: knifeName || '', + knifeRadius: knifeRadius || 0, + depth: depth || 0, + originModeling, + modelPoint: model.pointList || [], + modelOffSet: model.offSetList || [], + } + sideModelDetailArr.push(sideModelDetail) + }) + } + + const temp = { + blockId: item.plateId, + orderId: item.orderId, + pointDetail: item.pointDetail || [], + modelDetail: modelDetailArr || [], + holeDetail: holeDetailArr || [], + models: modelDetailArr || [], + remarkParams: { + sideRemark: item.sideRemark, + extraRemark: item.extraRemark, + specialRemarkDei: item.specialRemarkDei, + extraHandleRemark: item.extraHandleRemark, + drillsRemark: item.drillsRemark, + infoRemark: item.infoRemark, + remarkJsonDei: item.remarkJsonDei, + remarkJson: item.remarkJson, + specialRemark: item.specialRemark, + }, + offSet: { + x: item.offsetX, + y: item.offsetY, + z: item.offsetZ || 0, + }, + orgPointDetail: item.rawPointDetail || [], + cutSize: { + width: item.splitWidth, + height: item.splitLength, + }, + modelListSide: sideModelDetailArr,//[], // 侧槽 + sideHoleDetail: sideHoleDetailArr || [], + isUnRegular: fitBlock && fitBlock.isSpecialShaped || false, // item.isSpecialShaped || false, + plateExtraRemark: item.plateExtraRemark, + has2DModel: item.has2DModel, + has3DModel: item.has3DModel + } + /** + * 异形的情况下 已经作用到 orgPoint 和 points 里面了 + * plateExtraRemark 数据结构 + * plateExtraRemark:{ + * CustomNumber // webCAD 图纸编号 + * extra :{ + * boardType: "背板" + * composingFace: "任意面" + edgeRemarks: ["", "", "", ""] + has2DModel: false + has3DModel: false + processList: [] + rectSealDetail:[ + { + SealColor: "F-A330铁力木", // 封边颜色 + SealSize: 1, // 封边尺寸 + ReservedEdge: 0, // 外扩尺寸 + PointID: 1 // 第几个线条 + } + ] + * } + + * } + */ + blockDetailList.push(temp) + } + + + + + }) + + let resData = { + machineId: machineDTO.id, + machineName: machineDTO.name, + materialList, + configList, + sysConfig, + tagConfig, + styleConfig, + planOrder, + orderList: newOrderList, + blockList, + blockDetailList, + areaDeleted, + sealInfo: orderPartsRespVOS && orderPartsRespVOS.filter(e => e.type == '封边条'), + } + + // console.log('转换数据:', resData) + return resData +} + +// 数据转换-没有机台 +// 数据转换前的数据集存一下 转回去的时候估计要用 +export function convertNoMachineData(newJson) { + beforeConvertData.value = JSON.parse(JSON.stringify(newJson)) + const { goodsList, optimizeBoardModelDOS, orderList, plan, plateList, plateModels, orderPartsRespVOS + } = newJson + + + let blockInfoArr: any = [] + + Array.isArray(optimizeBoardModelDOS) && optimizeBoardModelDOS.forEach((item) => { + let str = `${item.material}--${item.color}--${item.spec}--${item.plateNum}片--0.251` + blockInfoArr.push(str) + }) + // 排单数据 + let planOrder: any = {} + // 订单流程时 plan(排单数据)是没有的 忽略 + if (plan) { + planOrder = { + goodsIdList: null, + planId: plan.id, + planCode: plan.id, + status: plan.status, + // machineId: machineDTO.id, + createTime: plan.createTime, + creator: plan.creator, + planTime: plan.planTime, + produceTime: plan.produceTime, + producer: '', // + remark: plan.remark, + organId: plan.organId, + updateTime: plan.updateTime, + planType: plan.type, + orderIds: `[${plan.orderNos}]`, + blockInfo: blockInfoArr.join(';'), + orderList: null, + deleted: false, + sort: plan.sort, + } + } + + // materialList goodsList大板中的 goodid没用 + let materialList: any = [] + let newGoodsList: any = [] + goodsList.forEach((item) => { // 去重的 + let i = newGoodsList.findIndex(e => e.goodsId == item.goodsId) + if (i == -1) { + newGoodsList.push(item) + } + }) + newGoodsList.forEach((item) => { + if (optimizeBoardModelDOS && optimizeBoardModelDOS.length > 0) { + let placeItem = optimizeBoardModelDOS.find(e => e.goodsId == item.goodsId) + if (placeItem) { + if (placeItem.usedBoardInfo) { + let keys = Object.keys(placeItem) + keys.forEach((k) => { + if (placeItem[k] != null && placeItem[k] != undefined) { + item[k] = placeItem[k] + } else { + // console.log('数据为空,不做复写操作,', k, placeItem[k], item[k]) + } + }) + } + } else { + console.error('没找到 异常 排查: 大板的id 和 优化数据中的大板id 对应不上') + } + } + const temp = { + orderId: item.orderId, + goodsId: item.goodsId, + goodsName: item.goodsName, + spec: item.spec, + color: item.color, + brand: item.brand, + width: item.width, + length: item.height, + isOptimized: item.isOptimized, + thickness: item.thickness, + cutBorder: item.cutBorder, + CutDia: item.CutDia, + CutGap: item.CutGap, + boardCount: item.boardCount || 0, + cutKnifeGap: item.cutKnifeGap, + minBoardId: item.minBoardId, + maxBoardId: item.maxBoardId, + avgUsageRateAll: item.avgUsageRateAll, + avgUsageRateExcludeLastBoard: item.avgUsageRateExcludeLastBoard, + usageRateLastBoard: item.usageRateLastBoard, + usedBoardInfo: item.usedBoardInfo, + blockPlaceInfo: item.blockPlaceInfo, + status: item.status, + hasTexture: item.texture, + material: item.material, + // texture: item.texture || '', + orgWidth: item.orgWidth, + orgLength: item.orgLength, + boardCountRemain: item.boardCountRemain, + remainBoardInfo: item.remainBoardInfo, + preMillingSize: item.preMillingSize, + remainBoardList: [], + isHelpCut: item.isHelpCut, + helpCutGap: item.helpCutGap, + cutKnifeId: item.cutKnifeId, + helpKnifeId: item.helpKnifeId, + updateDate: item.updateDate, + } + materialList.push(temp) + }) + // orderList + let areaDeleted = false + let newOrderList: any = [] + orderList.forEach((item) => { + let temp = { + customerId: item.customerId, + customer: item.customer, + phoneNumber: item.phoneNumber, + orderDate: item.orderDate, + salemanId: item.salemanId, + dealer: item.dealer, + dealerPhoneNumber: item.dealerPhoneNumber, + address: item.address, + splitter: item.splitter, + status: item.status, + amount: 0, + remark: item.remark, + customOrderNo: item.customOrderNo, + deliveryDate: item.deliveryDate, + pushConfig: item.pushConfig || false, + offerListStr: item.offerListStr || null, + cancelStatus: item.cancelStatus || 0, + itemList: item.itemList || null, + goodsList: item.goodsList || null, + offerList: item.offerList || null, + totalOrderOfferList: item.totalOrderOfferList || null, + blockList: item.blockList || null, + dataBlockList: item.dataBlockList || null, + objectList: item.objectList || null, + dataObjectList: item.dataObjectList || null, + goodsInfoList: item.goodsInfoList || null, + orderProcessList: item.orderProcessList || null, + editFun: null, + saleman: item.salesman, + orderId: item.id, + createTime: item.createTime, + organId: item.organId, + schduleDeliveryDate: null, + orderType: item.orderType, + orderSort: item.orderSort, + dataType: item.dataType, + deleted: item.deleted, + processStatus: null, + } + areaDeleted = item.deleted + newOrderList.push(temp) + }) + + // blockList + let blockList: any = [] + + plateList.forEach((item, i) => { + const temp = { + roomName: item.roomName, + bodyName: item.bodyName, + roomId: item.roomId || 0, + bodyId: item.bodyId || 0, + processGroupld: item.processGroupld, + orderId: item.orderId, + blockId: item.plateId, + goodsId: item.goodsId, + oldBlockId: item.plateId, + blockNo: item.plateNo || (i + 1).toString(), + labelNo: '', + blockName: item.name, + width: item.width, + length: item.height, + thickness: item.thickness, + isCurvedGroundLine: false, // item.isCurvedGroundLine, // 是否弧线 不处理异形 异形 + isUnRegular: item.isSpecialShaped, + isSpecialShaped: item.isSpecialShaped, + isSculpt: item.isSculpt, + isRowHole: item.isRowHole, + sealLeft: item.sealLeft, + sealRight: item.sealRight, + sealTop: item.sealUp, + sealBottom: item.sealDown, + texture: item.texture, + placeHole: item.holeFace, + abnormalOffsetY: item.offsetX, + abnormalOffsetX: item.offsetY, + remarkJson: '', + dataType: 2, + processGroupName: item.processGroupName, + type: item.type, + openDoorType: item.openDoorType, + extraRemark: {}, + itemId: item.itemId, + plateRemark: item.remark, + area: item.area, + color: item.color, + hasHole: item.hasHole, + material: item.material, + blockMaterial: item.goodsName, + customPlateNo: item.customPlateNo + } + blockList.push(temp) + }) + + let blockDetailList: any = [] + let holeId = 1 + plateModels.forEach((item) => { + const fitBlock = plateList.find(e => e.id === item.plateId) + + // 孔 (正面/反面) + let holeDetailArr: HoleDetail[] = [] + if (item.holeDetail) { + item.holeDetail.forEach((hole) => { + // direction 只有侧孔有 angle 生产数据中没有 + const { holeType, faceType, startX, startY, startZ, radius, depth, direction, angle, endX, endY, endZ } = hole + let holeDetail: HoleDetail = { + holeId, + holeType: holeType || 0, + face: faceType, + pointX: startX || 0, + pointY: startY || 0, + pointZ: startZ || 0, + radius: radius || 0, + depth: depth || 0, + pointX2: endX || 0, + pointY2: endY || 0, + pointZ2: endZ || 0, + endPoint: 0, + angle: 0, + } + holeId = holeId + 1 + holeDetailArr.push(holeDetail) + }) + } + + // 侧孔 + let sideHoleDetailArr: sideHoleDetail[] = [] + if (item.sideHoleDetail) { + item.sideHoleDetail.forEach((sideHole) => { + // direction 只有侧孔有 angle 生产数据中没有 + const { holeType, faceType, startX, startY, startZ, radius, depth, direction, angle, endX, endY, endZ } = sideHole + let sideholeDetail: sideHoleDetail = { + holeId, + holeType, + face: faceType || 0, + pointX: startX || 0, + pointY: startY || 0, + pointZ: startZ || 0, + radius: radius || 0, + depth: depth || 0, + pointX2: endX || 0, + pointY2: endY || 0, + pointZ2: endZ || 0, + endPoint: 0, + angle: 0, + direction, + } + holeId = holeId + 1 + sideHoleDetailArr.push(sideholeDetail) + }) + } + + let modelDetailArr: contourDetail[] = [] + let sideModelDetailArr: contourDetail[] = [] + if (item.contourDetail) { + // 垂直造型 + item.contourDetail.forEach((model) => { + const { modelId, lineID, faceType, knifeName, knifeRadius, depth, originModeling } = model + const modelDetail: contourDetail = { + modelId: model.id || ++holeId, + lineId: lineID, + face: faceType, + knifeName: knifeName || '', + knifeRadius: knifeRadius || 0, + depth: depth || 0, + originModeling, + modelPoint: model.pointList || [], + modelOffSet: model.offSetList || [], + } + modelDetailArr.push(modelDetail) + }) + } + + if (item.sideDetail) { + item.sideDetail.forEach((model) => { + const { modelId, lineId, faceType, knifeName, knifeRadius, depth, originModeling } = model + + const sideModelDetail: any = { + modelId: modelId || ++holeId, + lineId, + face: faceType, + knifeName: knifeName || '', + knifeRadius: knifeRadius || 0, + depth: depth || 0, + originModeling, + modelPoint: model.pointList || [], + modelOffSet: model.offSetList || [], + } + sideModelDetailArr.push(sideModelDetail) + }) + } + + const temp = { + blockId: item.plateId, + orderId: item.orderId, + pointDetail: item.pointDetail || [], + modelDetail: modelDetailArr || [], + holeDetail: holeDetailArr || [], + models: modelDetailArr || [], + remarkParams: { + sideRemark: item.sideRemark, + extraRemark: item.extraRemark, + specialRemarkDei: item.specialRemarkDei, + extraHandleRemark: item.extraHandleRemark, + drillsRemark: item.drillsRemark, + infoRemark: item.infoRemark, + remarkJsonDei: item.remarkJsonDei, + remarkJson: item.remarkJson, + specialRemark: item.specialRemark, + }, + offSet: { + x: item.offsetX, + y: item.offsetY, + z: item.offsetZ || 0, + }, + orgPointDetail: item.rawPointDetail || [], + cutSize: { + width: item.splitWidth, + height: item.splitLength, + }, + modelListSide: sideModelDetailArr,//[], // 侧槽 + sideHoleDetail: sideHoleDetailArr || [], + isUnRegular: fitBlock && fitBlock.isSpecialShaped || false, // item.isSpecialShaped || false, + plateExtraRemark: item.plateExtraRemark, + has2DModel: item.has2DModel, + has3DModel: item.has3DModel + } + blockDetailList.push(temp) + }) + + let resData = { + planOrder, + orderList: newOrderList, + blockList, + blockDetailList, + areaDeleted, + newGoodsList, + sealInfo: orderPartsRespVOS && orderPartsRespVOS.filter(e => e.type == '封边条'), + } + return resData +} + + +export function convertDataBack(placeData) { + console.log('placeData', placeData, beforeConvertData) + const { materialList, blockList, orderList, planId, planCode } = placeData + + let goodsList = [] + + let optimizeRemainPlates: any = [] + let optimizeBoardModelDOS: any = [] + materialList.forEach((material) => { + if (material.isOptimized === false) { + console.error('板材没有优化,异常!排查') + } + const temp = { + id: material.id, + orderId: material.orderId, + goodsId: material.goodsId, + goodsName: material.goodsName, + planId: planCode, + spec: material.spec, + material: material.material, + color: material.color, + brand: material.brand, + width: material.width, + length: material.length, + thickness: material.thickness, + cutBorder: material.cutBorder, + diameter: material.diameter, + isOptimized: material.isOptimized, + CutDia: material.CutDia, + CutGap: material.CutGap, + boardCount: material.boardCount || 0, + cutKnifeGap: material.cutKnifeGap, + minBoardId: material.minBoardId, + maxBoardId: material.maxBoardId, + avgUsageRateAll: material.avgUsageRateAll, + avgUsageRateExcludeLastBoard: material.avgUsageRateExcludeLastBoard, + usageRateLastBoard: material.usageRateLastBoard, + usedBoardInfo: material.usedBoardInfo, + blockPlaceInfo: material.blockPlaceInfo, + status: material.status, + hasTexture: material.texture, + // texture: material.texture, + orgWidth: material.orgWidth, + orgLength: material.orgLength, + boardCountRemain: material.remainBoardCount, + remainBoardInfo: material.remainBoardInfo, + preMillingSize: material.preMillingSize, + remainBoardList: material.remainBoardList, + isHelpCut: material.isHelpCut, + helpCutGap: material.helpCutGap, + cutKnifeId: material.cutKnifeId, + helpKnifeId: material.helpKnifeId, + // updateDate: material.updateDate, + } + + optimizeBoardModelDOS.push(temp) + if (material.remainBoardList.length != 0) { + material.remainBoardList.forEach((remainBoard) => { + let tempRemainBoard: any = { + + goodsName: material.goodsName, + material: material.material, + color: material.color, + width: remainBoard.width, + length: remainBoard.length, + count: remainBoard.count, + thickness: material.thickness, + remark: remainBoard.remark, + placeStyle: material.placeStyle, + } + // 余料这里的ID 对应的是 源数据中的大板的ID + + let item = beforeConvertData.value.goodsList.find(e => e.goodsId == material.goodsId) + + if (item && item.id) { + tempRemainBoard = { ...tempRemainBoard, goodsId: item.id } + } + + if (remainBoard.id && !remainBoard.id.includes('_')) { + tempRemainBoard = { ...tempRemainBoard, id: remainBoard.id } + } + + if (beforeConvertData.value.plan && beforeConvertData.value.plan.id) { + tempRemainBoard = { ...tempRemainBoard, planId: beforeConvertData.value.plan.id } + } + + if (remainBoard.brand) { + tempRemainBoard = { ...tempRemainBoard, brand: remainBoard.brand } + } + + optimizeRemainPlates.push(tempRemainBoard) + }) + } + }) + // 订单信息 目测一致 + // let orderList_temp = [] + // orderList.forEach(item => { + // let temp = { + // customerId: item.customerId, + // customer: item.customer, + // phoneNumber: item.phoneNumber, + // orderDate: item.orderDate, + // salemanId: item.salemanId, + // dealer: item.dealer, + // dealerPhoneNumber: item.dealerPhoneNumber, + // address: item.dealerAddress, + // status: item.status, + // amount: 0, + // remark: item.remark, + // customOrderNo: item.customOrderNo, + // deliveryDate: item.deliveryDate, + // pushConfig: item.pushConfig || false, + // offerListStr: item.offerListStr || null, + // cancelStatus: item.cancelStatus || 0, + // itemList: item.itemList || null, + // goodsList: item.goodsList || null, + // offerList: item.offerList || null, + // totalOrderOfferList: item.totalOrderOfferList || null, + // blockList: item.blockList || null, + // dataBlockList: item.dataBlockList || null, + // objectList: item.objectList || null, + // dataObjectList: item.dataObjectList || null, + // goodsInfoList: item.goodsInfoList || null, + // orderProcessList: item.orderProcessList || null, + // editFun: null, + // saleman: item.salesman, + // orderId: item.id, + // createTime: item.createTime, + // organId: item.organId, + // schduleDeliveryDate: null, + // orderType: item.orderType, + // orderSort: item.orderSort, + // dataType: item.dataType, + // deleted: item.deleted, + // processStatus: null, + // } + // }); + // let plateList = [] + // blockList.forEach((item) => { + // const temp = { + // roomName: item.roomName, + // bodyName: item.bodyName, + // processGroupName: item.processGroupName, + // roomId: item.roomId || 0, + // bodyId: item.bodyId || 0, + // processGroupld: item.processGroupld, + // orderId: item.orderId, + // blockId: item.blockId, + // goodsId: item.goodsId, + // oldBlockId: item.blockId, + // blockNo: item.blockNo, + // labelNo: item.labelNo, // 这个为空 标签的 + // blockName: item.blockName, + // width: item.width, + // length: item.length, + // thickness: item.thickness, + // isCurvedGroundLine: item.isCurvedGroundLine, // item.isCurvedGroundLine, // 是否弧线 不处理异形 异形 + // isSpecialShaped: item.isUnRegular, + // sealLeft: item.sealLeft, + // sealRight: item.sealRight, + // sealUp: item.sealTop, + // sealDown: item.sealBottom, + // texture: item.texture, + // holeFace: item.placeHole, + // offsetX: item.abnormalOffsetY, + // offsetY: item.abnormalOffsetX, + // remarkJson: '', + // dataType: item.dataType, + // type: item.type, + // openDoorType: item.openDoorType, + // extraRemark: item.extraRemark, + // itemId: item.itemId, + // } + // plateList.push(temp) + // }) + + // let addPlateIds: any = [] + // let deletePlateIds: any = [] + let resData = { + optimizeBoardModelDOS, + // optimizeRemainPlates, + // goodsList, + // orderList, + // plateList, + // addPlateIds, + // deletePlateIds, + } + return resData +} + +// 先保存配置, +/** 保存 原尺寸,开料刀,预铣,辅助开料 */ +export function saveSetting(c) { + let setting: any = {} + // 尺寸, + setting.orgWidth = c.orgWidth + setting.orgLength = c.orgLength + setting.width = c.width + setting.length = c.length + setting.thickness = c.thickness + + setting.preMillingSize = c.preMillingSize + setting.isHelpCut = c.isHelpCut + setting.helpCutGap = c.helpCutGap + + setting.diameter = c.diameter + setting.cutKnifeId = c.cutKnifeId + setting.cutKnifeName = c.cutKnifeName + setting.helpKnifeId = c.helpKnifeId + setting.helpKnifeName = c.helpKnifeName + c.savedSetting = setting + + // 小板备份资料 + let createTime = Date.now() + for (let block of c.blockList) { + let savedObj = block.blockDetail.savedSetting + if (savedObj && savedObj.createTime == createTime) + break // 已备份 + blockDetailSaveSetting(block.blockDetail) + block.blockDetail.savedSetting.createTime = createTime + } + return c +} + +// 小板备份 +function blockDetailSaveSetting(info) { + info.savedSetting = {} + + info.savedSetting.offsetKnifeRadius = info.offsetKnifeRadius + info.savedSetting.preMillingSize = info.preMillingSize + info.savedSetting.isHelpCut = info.isHelpCut + info.savedSetting.helpCutGap = info.helpCutGap + // SizeExpand + info.savedSetting.preMillingExpandSize = info.preMillingExpandSize + info.savedSetting.modelExpandSize = info.modelExpandSize + info.savedSetting.vKnifeModelExpandSize = info.vKnifeModelExpandSize + info.savedSetting.sameKnfieHelpExpandSize = info.sameKnfieHelpExpandSize + info.savedSetting.currentExpandSize = info.currentSizeExpand + // 轮廓,铣刀路径 + info.savedSetting.borderContour = clone(info.borderContour) +} + +/** 克隆 */ +function clone(obj): PlaceBorderContour { + let newObj = new PlaceBorderContour(obj.placeStyle, obj.borderFinal, obj.borderOrg) + newObj.borderPreMilling = obj.borderPreMilling + newObj.polylineOrg = obj.polylineOrg + newObj.border = obj.border + newObj.borderSameKnifeHelpCut = obj.borderSameKnifeHelpCut + newObj.cutLines = obj.cutLines + newObj.cutLinesSameKnifeHelpCut = obj.cutLinesSameKnifeHelpCut + newObj.borderMoving = obj.borderMoving + // newObj.borderKingOptimize = obj.borderKingOptimize; + newObj.borderModelThrough = obj.borderModelThrough + newObj.borderModelThroughR = obj.borderModelThroughR + newObj.cutLinesModelThrough = obj.cutLinesModelThrough + newObj.borderInnerPlace = obj.borderInnerPlace + newObj.blockInnerSpace = obj.blockInnerSpace + newObj.blockOuterSpace = obj.blockOuterSpace + newObj.spaces = obj.spaces + newObj.polylines2vModel = obj.polylines2vModel + newObj.polylinesOutModel = obj.polylinesOutModel + newObj.placeContours = [] + for (let pc of obj.placeContours) { + if (pc) { + let npc = pc.clone() + newObj.placeContours.push(npc) + } + } + return newObj +} + + + +export function isRect(outline: any): any { + let pts :any = [] //outline.pts + let buls :any=[] // outline.buls + if(Array.isArray(outline)){ + pts = outline.map(e => e.pts) + buls = outline.map(e => e.buls) + }else{ + pts = outline.pts + buls = outline.buls + } + if (buls.length != 5) + return null + if (buls.some(t => t != 0)) + return null + + if (pts.length != 5) + return null + if (pts[4].x != pts[0].x || pts[4].y != pts[0].y) + return null + + return getRect(pts[0], pts[1], pts[2], pts[3]) +} +export function isCircle(outline: any): any { + // const pts = outline.pts + // const buls = outline.buls + const pts = outline.map(e => e.pts) //outline.pts + const buls = outline.map(e => e.buls) // outline.buls + + + if (buls.length != 3) + return null + if (equal(buls[0], 1) && equal(buls[1], 1) && equal(buls[2], 0)) { + const p0 = Array.isArray(outline) ? outline[0].pts : outline?.pts[0] + const p1 = Array.isArray(outline) ? outline[1].pts : outline?.pts[1] + let x0 = Math.min(p0.x, p1.x) + let x1 = Math.max(p0.x, p1.x) + let y0 = Math.min(p0.y, p1.y) + let y1 = Math.max(p0.y, p1.y) + + let r + if (equal(x0, x1)) { + r = (y1 - y0) / 2 + x0 -= r + x1 += r + } + else { + r = (x1 - x0) / 2 + y0 -= r + y1 += r + } + const t = r / Math.SQRT2 + const dis = r - t + return { x: x0 + dis, y: y0 + dis, w: t * 2, l: t * 2 } + } +} + + +export function getSize(m: BlockModel): number { + if (m.pointList.some(t => t.curve != 0)) + return -1 + if (m.pointList.length < 5) + return -1 + + let p1 = m.pointList[0] + let p2 = m.pointList[1] + let p3 = m.pointList[2] + let p4 = m.pointList[3] + let p5 = m.pointList[4] + + let dis12 = getdis(p1, p2) + let dis23 = getdis(p2, p3) + let dis_min = Math.min(dis12, dis23) + let dis_max = Math.max(dis12, dis23) + + if (getdis(p1, p5) > 0.001) + return -1 // 1.5 不重叠的不是拉槽 + // 矩形 中点到四个点 距离都是一样的 + let pc = { pointX: (p1.pointX + p2.pointX + p3.pointX + p4.pointX) / 4, pointY: (p1.pointY + p2.pointY + p3.pointY + p4.pointY) / 4 } + let dis1 = getdis(p1, pc) + let dis2 = getdis(p2, pc) + if (!equal(dis1, dis2)) + return -1 + let dis3 = getdis(p3, pc) + if (!equal(dis1, dis3)) + return -1 + let dis4 = getdis(p4, pc) + if (!equal(dis1, dis4)) + return -1 + + return (dis_min + m.knifeRadius * 2) * (dis_max + m.knifeRadius * 2) +} + + +export function getdis(p1, p2) { + return Math.sqrt((p1.pointX - p2.pointX) ** 2 + (p1.pointY - p2.pointY) ** 2) +} + +export function getMaxChamferR(b: PlaceBlock): number { + let maxR = 0; + let daojiaoCount = 0; + + for (let i = 0; i < b.points.length; i++) { + let p0 = b.points[i]; + if (p0.curve > 0.4143) continue; //不是倒角的, + if (p0.curve < 0.4142) continue; + + let j = i + 1; + if (j == b.points.length) j = 0; + let p1 = b.points[j]; + + let r = CADExt.GetRadius(new Point2d(p0.pointX, p0.pointY), new Point2d(p1.pointX, p1.pointY), p0.curve); + if (r > maxR) maxR = r; + daojiaoCount++; + } + return maxR; +} + +/** 获取板件所有缺角 */ +export function getInnerCorner(b: PlaceBlock): BlockPoint[][] { + let startPos = -1; + let unfilledCorners: BlockPoint[][] = []; //缺角 + for (let i = 0; i < b.points.length; i++) { + if (isBorderPoint(b, b.points[i])) { + startPos = i; + break; + } + } + if (startPos == -1) return unfilledCorners; //找不到板边缘点 + + let insizePs: BlockPoint[] = []; //缺角轮廓点 + for (let i = startPos; i <= b.points.length + startPos; i++) { + let p = b.points[i >= b.points.length ? i - b.points.length : i]; + let onBorder = isBorderPoint(b, p); + if (onBorder) //边缘点 + { + if (insizePs.length == 0) { + insizePs.push(p); + } + else if (insizePs.length == 1 && isSameBorder(insizePs[0], p)) //已有一个边缘点且同边, 替换它 + { + insizePs.splice(0, 1, p); + } + else { + insizePs.push(p); // 获得一个缺角轮廓 + unfilledCorners.push(insizePs); + insizePs = []; + insizePs.push(p); + } + } + else //板内点 + { + if (insizePs.length > 0) insizePs.push(p);// + } + } + return unfilledCorners; +} + +/** 获取板件所有缺角row */ +export function getRawInnerCorner(b): BlockPoint[][] { + let startPos = -1; + let unfilledCorners: BlockPoint[][] = []; //缺角 + for (let i = 0; i < b.rawPointDetail.length; i++) { + if (isBorderPoint(b, b.rawPointDetail[i])) { + startPos = i; + break; + } + } + if (startPos == -1) return unfilledCorners; //找不到板边缘点 + + let insizePs: BlockPoint[] = []; //缺角轮廓点 + for (let i = startPos; i <= b.rawPointDetail.length + startPos; i++) { + let p = b.rawPointDetail[i >= b.rawPointDetail.length ? i - b.rawPointDetail.length : i]; + let onBorder = isAfrerBorderPoint(b, p); + if (onBorder) //边缘点 + { + if (insizePs.length == 0) { + insizePs.push(p); + } + else if (insizePs.length == 1 && isSameBorder(insizePs[0], p)) //已有一个边缘点且同边, 替换它 + { + insizePs.splice(0, 1, p); + } + else { + insizePs.push(p); // 获得一个缺角轮廓 + unfilledCorners.push(insizePs); + insizePs = []; + insizePs.push(p); + } + } + else //板内点 + { + if (insizePs.length > 0) insizePs.push(p);// + } + } + return unfilledCorners; +} + +/**是否边缘点 */ +export function isBorderPoint(b: PlaceBlock, p: BlockPoint): boolean { + if (equal(p.pointX, 0)) return true; + if (equal(p.pointY, 0)) return true; + if (equal(p.pointX, b.cutWidth)) return true; + if (equal(p.pointY, b.cutLength)) return true; + return false; +} + +/**是否边缘点2 */ +export function isAfrerBorderPoint(b, p): boolean { + if (equal(p.pointX, 0)) return true; + if (equal(p.pointY, 0)) return true; + if (equal(p.pointX, b.splitWidth)) return true; + if (equal(p.pointY, b.splitHeight)) return true; + return false; +} + +/**是否同边 */ +export function isSameBorder(p1: BlockPoint, p2: BlockPoint): boolean { + if (equal(p1.pointX, p2.pointX)) return true; + if (equal(p1.pointY, p2.pointY)) return true; + return false; +} \ No newline at end of file diff --git a/src/processParser/common/zip.ts b/src/processParser/common/zip.ts new file mode 100644 index 0000000..0cdd21a --- /dev/null +++ b/src/processParser/common/zip.ts @@ -0,0 +1,151 @@ +// import JsZip from 'jszip'; +import type { DeflateOptions } from 'fflate' +import { Zip, ZipDeflate, strToU8 } from 'fflate' +import { getFileExt } from './file' + +export class FileInfo +{ + name: string + content: string | Blob | Uint8Array + encode: string + isBase64 = false + binary = false + constructor(name, text, isBase64 = false) + { + this.name = name + this.content = text + this.isBase64 = isBase64 + } +} + +export abstract class ZipProvider +{ + // abstract loadAsync(file: File): Promise; + protected files: FileInfo[] = [] + + addFile(file: FileInfo) + { + this.files.push(file) + } + + abstract saveAsync(): Promise +} + +// export class JsZipProvider extends ZipProvider +// { + +// private ctx = new JsZip(); + +// // async loadAsync(file: File): Promise +// // { +// // await this.ctx.loadAsync(file); +// // } + +// async saveAsync(): Promise +// { +// for (const file of this.files) +// { +// this.ctx.file(file.name, file.content, { +// createFolders: true, +// base64: file.isBase64, +// binary: file.binary, +// compression: "DEFLATE", +// }); +// } +// return await this.ctx.generateAsync({ type: 'blob' }); +// } +// } + +export class FflateZipProvider extends ZipProvider +{ + private ctx = new Zip() + + private task: Promise + + constructor() + { + super() + this.task = new Promise((resolve, reject) => + { + let result = [] + this.ctx.ondata = (err, data, final) => + { + if (!err) + { + result.push(data) + if (final) + { + resolve(new Blob(result, { type: 'application/zip' })) + } + } else + { + reject() + } + } + }) + } + + async saveAsync(): Promise + { + for (const file of this.files) + { + let data: Uint8Array + if (file.content instanceof Blob) + { + // console.log(file.name); + let buffer = await file.content.arrayBuffer() + // console.log('buffer', buffer); + data = new Uint8Array(buffer) + } else if (file.content instanceof Uint8Array) + { + data = file.content + } + else if (file.isBase64) + { + data = new Uint8Array(atob(file.content).split('').map((c) => + { + return c.charCodeAt(0) + })) + } else + { + data = strToU8(file.content) + } + + let zipInput = new ZipDeflate(file.name, this.getOptionByExt(file.name)) + this.ctx.add(zipInput) + zipInput.push(data, true) + } + this.ctx.end() + return this.task + } + + getOptionByExt(fileName: string) + { + let option: DeflateOptions = { + level: 6, + // mem: 12 + } + let ext = getFileExt(fileName) + if (ext !== null) + { + switch (ext) + { + case 'bmp': + option.level = 1 + option.mem = 0 + break + case 'jpg': + case 'jpeg': + option.level = 1 + break + case 'png': + option.level = 0 + break + } + } + + return option + } +} + +export const DefaultZipProvider = () => new FflateZipProvider() diff --git a/src/processParser/confClass.ts b/src/processParser/confClass.ts new file mode 100644 index 0000000..7909e8f --- /dev/null +++ b/src/processParser/confClass.ts @@ -0,0 +1,1348 @@ + +/**配置项 */ +export interface configItem { + /** 配置字段 */ + key: String, + /** 默认值 */ + defaultValue?: String | Number | Array | boolean + /** 文字说明 */ + label: String, + /** 文字的class */ + labelClass?: String + /** 文字样式 */ + labelStyle?: any + /** 生效的值 */ + value?: String | Number | Array | boolean + /** 分组 */ + groupBy: String + /** 辅助说明 */ + helpMessage?: String + //** 是否在UI界面显示 */ + isShow?: boolean + /** 是否在UI界面可编辑 */ + disable?: boolean + /** 组件类型 标识*/ + component?: string + /** 附带的其它组件信息 */ + componentList?: configItem[] + /** 数据选项 */ + options?: any[] + /** 样式 */ + style?: any +} +/**G代码指令 + * 目前 只需要做 G0 - G3 + */ +export enum GCode { + /**快速定位 空程移动 范例:G00 X100 Y50(刀具快速移动至X100、Y50位置) */ + G0 = 'G0', + /**快速定位 空程移动 范例:G00 X100 Y50(刀具快速移动至X100、Y50位置)*/ + G00 = 'G00', + /**直线 直线插补 范例:G01 X200 Y300 F150(刀具以150mm/min的进给速度直线移动至X200、Y300)*/ + G1 = 'G1', + /**直线 范例:G01 X200 Y300 F150(刀具以150mm/min的进给速度直线移动至X200、Y300)*/ + G01 = 'G01', + /** 顺时针 范例:G17 G02 X150 Y50 I50 J0 F100(在XY平面,以半径50mm顺时针圆弧插补至X150、Y50)*/ + G2 = 'G2', + /** 顺时针 范例:G17 G02 X150 Y50 I50 J0 F100(在XY平面,以半径50mm顺时针圆弧插补至X150、Y50)*/ + G02 = 'G02', + /** 逆时针 范例:G17 G03 X150 Y50 I50 J0 F100(在XY平面,以半径50mm逆时针圆弧插补至X150、Y50)*/ + G3 = 'G3', + /** 逆时针 范例:G17 G03 X150 Y50 I50 J0 F100(在XY平面,以半径50mm逆时针圆弧插补至X150、Y50)*/ + G03 = 'G03', + /**暂停 范例:G04 X2(暂停2秒)*/ + G4 = 'G4', + /**暂停 范例:G04 X2(暂停2秒)*/ + G04 = 'G04', + /** 通过中间点圆弧插补 + * 1. 通过中间点圆弧插补 + * 示例:G05 X60 Z50 IX50 IZ60 F120 刀具从当前位置出发,经过中间点 (50, 60),最终到达终点 (60, 50),形成圆弧轨迹。 + * 2. 高精轨迹控制(HPCC)模式 + * 功能:G05 可启动高精轨迹控制模式(HPCC),通过曲线拟合和参数优化,实现高精度、高速度的轨迹加工,适用于复杂曲面或高精度零件。 + * 指令格式: + * 启动:G05 P10000(P值设为10000) + * 关闭:G05 P0(P值设为0) + * 3、注意事项: + * 轴类型限制:建议线性轴参与HPCC模式,旋转轴需谨慎设置。 + 与其他功能冲突: + 在HPCC模式下,G61(准确停止检查)、G63(攻螺纹)等功能可能失效,需退出HPCC模式后恢复。 + 启用 RTCP(旋转刀具中心点)或 STCP 模式时,禁止同时启用HPCC功能。 + 不支持的功能: + 不支持单节停止(C40/M00)、反向手轮模拟、图形模拟等。 + 剩余距离显示可能不准确,因显示的是离曲线终点的距离,而非单节终点。 + * */ + G5 = 'G5', + /** 通过中间点圆弧插补 */ + G05 = 'G05', + /** 抛物线插补 */ + G6 = 'G6', + /** 抛物线插补 */ + G06 = 'G06', + /** z样条曲线插补 */ + G7 = 'G7', + /** z样条曲线插补 */ + G07 = 'G07', + /** 进给加速 */ + G8 = 'G8', + /** 进给加速 */ + G08 = 'G08', + /** 进给减速 */ + G9 = 'G9', + /** 进给减速 */ + G09 = 'G09', + /** 参数写入方式有效 */ + G10 = 'G10', + /** 参数写入方式取消 */ + G11 = 'G11', + /** 极坐标变成 */ + G16 = 'G16', + /** XY平面选择 */ + G17 = 'G17', + /** XZ平面选择 */ + G18 = 'G18', + /** YZ平面选择 */ + G19 = 'G19', + /** 英制输入 */ + G20 = 'G20', + /** 公制输入 */ + G21 = 'G21', + /** 半径尺寸编程方式 */ + G22 = 'G22', + /** 系统操作界面上使用 */ + G220 = 'G220', + /** 直径尺寸编程方式 */ + G23 = 'G23', + /** 系统操作界面上使用 */ + G230 = 'G230', + /** 子程序结束 */ + G24 = 'G24', + /** 跳转加工 */ + G25 = 'G25', + /** 循环加工 */ + G26 = 'G26', + /** 参考点返回 */ + G28 = 'G28', + /** 倍率注销 */ + G30 = 'G30', + /** 倍率定义 */ + G31 = 'G31', + /** 等螺距螺纹切削,英制 */ + G32 = 'G32', + /** 等螺距螺纹切削,公制 */ + G33 = 'G33', + /** 增螺距螺纹切削 */ + G34 = 'G34', + /** 减螺距螺纹切削 */ + G35 = 'G35', + //** 刀具半径补正取消 */ + G40 = 'G40', + //** 刀具半径补正 左*/ + G41 = 'G41', + //** 刀具半径补正 右*/ + G42 = 'G42', + //** 刀具长度补正+ */ + G43 = 'G43', + //** 刀具长度补正- */ + G44 = 'G44', + //** 道具偏置+/+ */ + G45 = 'G45', + //** 道具偏置+/- */ + G46 = 'G46', + //** 道具偏置-/- */ + G47 = 'G47', + //** 道具偏置-/+ */ + G48 = 'G48', + //** 刀具长度 补正取消 */ + G49 = 'G49', + //** 局部坐标系设定 */ + G52 = 'G52', + //** 机床坐标系选择 */ + G53 = 'G53', + //** 工件坐标系选择1 */ + G54 = 'G54', + //** 工件坐标系选择2 */ + G55 = 'G55', + //** 工件坐标系选择3 */ + G56 = 'G56', + //** 工件坐标系选择4 */ + G57 = 'G57', + //** 工件坐标系选择5 */ + G58 = 'G58', + //** 工件坐标系选择6 */ + G59 = 'G59', + //** 坐标系旋转有效 */ + G68 = 'G68', + //** 坐标系旋转取消 */ + G69 = 'G69', + /** 高速深孔钻 */ + G73 = 'G73', + /** 精搪孔 */ + G76 = 'G76', + /** 固定循环取消/取消循环指令 */ + G80 = 'G80', + /**程序停止 */ + M00 = 'M00', + /**选择性停止 */ + M01 = 'M01', + /** 程序结束 */ + M02 = 'M02', + /**主轴正转 */ + M03 = 'M03', + /**主轴反转 */ + M04 = 'M04', + /**主轴停止 */ + M05 = 'M05', + /**自动换刀 */ + M06 = 'M06', +} + +/** 内部指令 接收 */ +export class CodeAction { + code?: String + order?: String + codeParams?: any +} +/**内部响应类 */ +export class GCodeResType { + code: number = -1 + data: any = null + msg: string = '' + logError(msg) { + console.error(msg) + } +} + +/**G代码基类 */ +export class GCodeAction { + + /** 空程直线 */ + G0(params: CodeParams) { + const { x, y, z, f, xKey, yKey, zKey, fKey, codeKey } = params + let val: string = GCode.G0 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + return val + } + /** 空程直线 */ + G00(params: CodeParams) { + const { x, y, z, f, xKey, yKey, zKey, fKey, codeKey } = params + let val: string = GCode.G00 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + return val + } + /** 直线 */ + G1(params: CodeParams) { + const { x, y, z, f, xKey, yKey, zKey, fKey, codeKey } = params + let val: string = GCode.G1 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + + + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + + + + return val + } + /** 直线 */ + G01(params: CodeParams) { + const { x, y, z, f, xKey, yKey, zKey, fKey, codeKey } = params + let val: string = GCode.G01 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + + + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + return val + } + /** 顺时针 弧线 + * @param x x坐标 + * @param y y坐标 + * @param z z坐标 + * @param i 圆弧 对于起点的偏移量 x + * @param y 圆弧 对于起点的偏移量 Y + * @param z 圆弧 对于起点的偏移量 Y + * @param f 速度 + */ + G2(params: CodeParams) { + const { x, y, z, i, j, k, r, f, xKey, yKey, zKey, fKey, iKey, jKey, kKey, codeKey } = params + let val: string = GCode.G2 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + let _iKey = iKey || 'I' + let _jKey = jKey || 'J' + let _kKey = kKey || 'K' + + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + if (checkVal(r)) { + val += ` R${r}` + } else { + if (checkVal(i)) { + val += ` ${_iKey}${i}` + } + if (checkVal(j)) { + val += ` ${_jKey}${j}` + } + if (checkVal(k)) { + val += ` ${_kKey}${k}` + } + } + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + return val + } + /** 顺时针 弧线 + * @param x x坐标 + * @param y y坐标 + * @param z z坐标 + * @param i 圆弧 对于起点的偏移量 x + * @param y 圆弧 对于起点的偏移量 Y + * @param z 圆弧 对于起点的偏移量 Y + * @param f 速度 + */ + G02(params: CodeParams) { + const { x, y, z, i, j, k, r, f, xKey, yKey, zKey, fKey, iKey, jKey, kKey, codeKey } = params + let val: string = GCode.G02 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + let _iKey = iKey || 'I' + let _jKey = jKey || 'J' + let _kKey = kKey || 'K' + + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + + if (checkVal(r)) { + val += ` R${r}` + } else { + if (checkVal(i)) { + val += ` ${_iKey}${i}` + } + if (checkVal(j)) { + val += ` ${_jKey}${j}` + } + if (checkVal(k)) { + val += ` ${_kKey}${k}` + } + } + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + return val + } + /** 逆时针 弧线 + * @param x x坐标 + * @param y y坐标 + * @param z z坐标 + * @param i 圆弧 对于起点的偏移量 x + * @param y 圆弧 对于起点的偏移量 Y + * @param z 圆弧 对于起点的偏移量 Y + * @param f 速度 + */ + G3(params: CodeParams) { + const { x, y, z, i, j, k, r, f, xKey, yKey, zKey, fKey, iKey, jKey, kKey, codeKey } = params + let val: string = GCode.G3 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + let _iKey = iKey || 'I' + let _jKey = jKey || 'J' + let _kKey = kKey || 'K' + + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + + if (checkVal(r)) { + val += ` R${r}` + } else { + if (checkVal(i)) { + val += ` ${_iKey}${i}` + } + if (checkVal(j)) { + val += ` ${_jKey}${j}` + } + if (checkVal(k)) { + val += ` ${_kKey}${k}` + } + } + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + return val + } + /** 逆时针 弧线 + * @param x x坐标 + * @param y y坐标 + * @param z z坐标 + * @param i 圆弧 对于起点的偏移量 x + * @param y 圆弧 对于起点的偏移量 Y + * @param z 圆弧 对于起点的偏移量 Y + * @param f 速度 + */ + G03(params: CodeParams) { + const { x, y, z, i, j, k, r, f, xKey, yKey, zKey, fKey, iKey, jKey, kKey, codeKey } = params + let val: string = GCode.G03 + if (typeof (codeKey) == 'string' && codeKey != '') { + val = codeKey + } + let _xkey = xKey || 'X' + let _yKey = yKey || 'Y' + let _zKey = zKey || 'Z' + let _fKey = fKey || 'F' + let _iKey = iKey || 'I' + let _jKey = jKey || 'J' + let _kKey = kKey || 'K' + + if (checkVal(x)) { + val += ` ${_xkey}${x}` + } + if (checkVal(y)) { + val += ` ${_yKey}${y}` + } + if (checkVal(z)) { + val += ` ${_zKey}${z}` + } + + if (checkVal(r)) { + val += ` R${r}` + } else { + if (checkVal(i)) { + val += ` ${_iKey}${i}` + } + if (checkVal(j)) { + val += ` ${_jKey}${j}` + } + if (checkVal(k)) { + val += ` ${_kKey}${k}` + } + } + + if (checkVal(f)) { + val += ` ${_fKey}${f}` + } + return val + } + /** 主轴正转 + * + * @param s 转速 + */ + M03(s: any) { + let val: string = GCode.M03 + if (checkVal(s)) { + val += ` S${s}` + } + return val + } + /**主轴反向转 + * @param s 转速 + */ + M04(s: any) { + let val: string = GCode.M04 + if (checkVal(s)) { + val += ` S${s}` + } + return val + } + + /**主轴停止 */ + M05() { + let val: string = GCode.M05 + + return val + } + /**换刀指令 */ + M06(t: String) { + let val: string = GCode.M06 + if (checkVal(t)) { + val += ` T${t}` + } + return val + } + +} + +/** 行为基类 */ +export class processServeBase extends GCodeResType { + /**G代码基类 */ + _Action = new GCodeAction() + /** 刀库 */ + knifeList?: Array + /** 当前使用的刀具 */ + usedKnife?: Knife | _knifeType + constructor() { + super() + } + //** 使用G0代码 移动刀具 */ + KnifeMove(params: CodeParams) { + let res = this._Action.G0(params) + return res + '\n' + } + /** + * 根据传入的数据 生成 G0 || G1 || G2 || G3 代码 + */ + KnifeMove_Arc(params: CodeParams) { + let res: any = '' + + let dir = params.dir || 0 + if (typeof (dir) == 'string') { + dir = parseInt(dir) + } + switch (dir) { + case 0: + res = this._Action.G0(params) + break; + case 1: + res = this._Action.G1(params) + break; + case 2: + res = this._Action.G2(params) + break; + case 3: + res = this._Action.G3(params) + break; + default: + res = '' + break; + } + + return res + } + + /** 换刀指令 -- + * + * 因为设计的问题 + * 现在配置界面会直接配置换刀代码 + * + * + * 配置数据读取 + * @param str: 刀具名 + */ + KnifeChange(str: String) { + let res: any = null + if (str != '') { + res = this._Action.M06(str) + } + return res + } + /** 开始指令 + * 因为设计的问题 + * 相关配置从传入配置中读取 + */ + startCode() { + let res: any = null + /** 文件头 */ + res = 'codeName\n' + /** 轴启动 */ + res += this._Action.M03(18000) + + /** 刀启动 */ + res = this._Action.M06('T1') + + /** */ + return res + } + /** 结束指令 + * 因为设计的问题 + * 相关配置从传入配置中读取 + */ + endCode() { + let res: any = null + + /**刀停止 */ + + /** 轴停止 */ + res = this._Action.M05() + + return res + } + +} + +/** 业务类 */ +export class processServe { + /** 安全距离 */ + safeZ = 30 + /** 注释标识 */ + leaderChar: string = '//' + serveBase = new processServeBase() + _GCodeResType = new GCodeResType() + /**G代码基类 */ + _Action = new GCodeAction() + /**文件头 */ + boardFileHead = 'G54 G90' + /** 文件尾 */ + boardFileEnd = 'M30' + /** 测试用 */ + checkParams(code) { + let res = new GCodeResType() + let handle = true + let temp = { + /** x坐标 */ + x: false, + /** y坐标 */ + y: false, + /** z坐标 */ + z: false, + /** */ + dir: false, + /** 圆弧半径 */ + r: false, + /** 速度 */ + f: false, + /** IJK 模式的i */ + i: false, + /** IJK 模式的j */ + j: false, + /** IJK 模式的k */ + k: false, + } + switch (code) { + case 'G0': + temp = { ...temp, x: true, y: true, z: true, f: true } + break; + case 'G00': + temp = { ...temp, x: true, y: true, z: true, f: true } + break; + case 'G1': + temp = { ...temp, x: true, y: true, z: true, f: true } + break; + case 'G01': + temp = { ...temp, x: true, y: true, z: true, f: true } + break; + case 'G2': + temp = { ...temp, x: true, y: true, z: true, i: true, j: true, k: true, dir: true, r: true, f: true } + break; + case 'G02': + temp = { ...temp, x: true, y: true, z: true, i: true, j: true, k: true, dir: true, r: true, f: true } + break; + case 'G3': + temp = { ...temp, x: true, y: true, z: true, i: true, j: true, k: true, dir: true, r: true, f: true } + break; + case 'G03': + temp = { ...temp, x: true, y: true, z: true, i: true, j: true, k: true, dir: true, r: true, f: true } + break; + default: + handle = false + break; + } + + if (handle == false) { + res.code = -1 + res.data = null + res.msg = `${code}命令开发中` + } else { + res.code = 100 + res.data = temp + res.msg = 'sucess' + } + return res + } + + //** 生成单个加工项的代码 -- 测试用 */ + doProcessItem(processItem: CodeParamsObj) { + let code = '' + // 文件头 + code += this.boardFileHead + '\n' + if (processItem.list.length > 0) { + if (processItem.processItemInfo?.knife) { + code += this.startCode(processItem.processItemInfo?.knife) + '\n' + } + + code += this.addAnnotation('process Remark') + '\n' + for (const item of processItem.list) { + code += `${this.serveBase.KnifeMove_Arc(item)} \n` + } + if (processItem.processItemInfo?.knife) { + code += this.endCode(processItem.processItemInfo?.knife) + '\n' + } + } else { + this._GCodeResType.logError('doProcessItem fail,no processItem Data') + } + // 文件尾 + code += this.boardFileEnd + '\n' + return code + } + /** 生成多个加工项代码 */ + doProcessList(data: CodeParamsList) { + let code = '' + + if (data.processList.length > 0) { + for (const item of data.processList) { + code += `${this.doProcessItem(item)} \n` + } + } else { + this._GCodeResType.logError('doProcessList fail,no processItem Data') + } + return code + } + /** 添加注释 */ + addAnnotation(str) { + let res = `${this.leaderChar} ${str}` + return res + } + + + startCode(knife: _knifeType) { + let res: any = '' + + /** 轴启动 */ + res += knife.axisStartCode + '\n' + /** 刀启动 */ + res = knife.knifeStartCode + + /** */ + return res + } + /** 结束指令 + * 因为设计的问题 + * 相关配置从传入配置中读取 + */ + endCode(knife: _knifeType) { + let res: any = '' + /**刀停止 */ + res += knife.knifeStopCode + '\n' + /** 轴停止 */ + res += knife.axisStopCode + + return res + } +} + +function checkVal(val) { + let r = true + if ((val == undefined || val == '')) { + r = false + } + return r +} + + + +/** 加工项的类别 + * 用于区分加工项的类别,不同的类别 在文件生成的时候 可能需要对应某些独立的节点 + */ +export enum processItemType { + /**排钻 */ + Hole = 'hole', + /** 铣孔 */ + MillingHole = 'millingHole', + /** 造型 非槽加工 铣型 */ + Model = 'model', + /** 造型 槽-- 拉槽 */ + Grooves = 'grooves', + /** 造型 铣槽 */ + MillingGrooves = 'millingGrooves', + /** 侧面造型 */ + SideModel = 'SideModel', + /** 侧面槽 - 拉槽 */ + SideGrooves = 'sideGrooves', + /** 侧面槽 - 拉槽 */ + SideMillingGrooves = 'SideMillingGrooves', + /** 侧面孔 排钻 */ + SideHole = 'sideHole', + /** 侧面孔 铣孔 */ + MillingSideHole = 'MillingSideHole', + /** 开料 */ + CutBlock = 'cutBlock', + /** 修边 */ + MillingBlockBoard = 'MillingBlockBoard' +} + + +// 加工项 点数据 +export class CodeParams { + /** x坐标 */ + x?: Number | String + /** y坐标 */ + y?: Number | String + /** z坐标 */ + z?: Number | String + /** 调用的代码编号 */ + dir?: Number | String + /** 圆弧半径 */ + r?: Number | String + /** 速度 */ + f?: Number | String + /** IJK 模式的i */ + i?: Number | String + /** IJK 模式的j */ + j?: Number | String + /** IJK 模式的k */ + k?: Number | String + + /** 代码标识 */ + codeKey?: String + /** x坐标 */ + xKey?: String + /** y坐标 */ + yKey?: String + /** z坐标 */ + zKey?: String + /** 圆弧半径 */ + rKey?: String + /** 速度 */ + fKey?: String + /** IJK 模式的i */ + iKey?: String + /** IJK 模式的j */ + jKey?: String + /** IJK 模式的k */ + kKey?: String +} + + +/** 加工项对应的信息 */ +export class ProcessInfo extends CodeAction { + /**当前加工项的下标*/ + i?: Number + /** 加工项 对应刀具的数据 */ + knife?: _knifeType + /** 加工项的类型 */ + type?: processItemType + /** 加工项所在的 文件名 */ + belong?: string + /** 该加工项基于哪个加工面 传入数据 主要用于 加工项坐标转换 感觉可能没用 */ + belongFace?: FaceType + /** 板件信息 */ + block?: any + // /** 垂直基准点 */ + // originZ0Position?: OriginZPosition + // /** 水平基准点 */ + // originPointPosition?: BoardPosition + // /** 大板定位 */ + // boardLocation?: BoardPosition + // /** 加工项的宽方向 x */ + // widthSideAxis?: AxisType + // /** 加工项的长方向 y */ + // lengthSideAxis ?: AxisType + // /** 加工项的高方向 */ + // heightSideAxis ?: AxisType + +} + + +/**导出文件的 业务信息 */ +export class ProcessFileInfo extends CodeAction { + // 订单数据 + order?: any = [] + /** 排单信息 */ + planOrderInfo?: any = {} + // 商品信息 + materialInfo?: any[] + /** 所在板件信息 */ + block?: any[] + /** 压缩包 文件名 */ + zipFileName?: any + /** 文件名数据集 */ + fileNameList?: string[] + /** 文件名 */ + fileName?: string | FileNameType + /** */ +} + +export class FileNameType { + name: String = '' + Suffix: String = '' +} + +/**加工项数据 */ +export class CodeParamsObj { + //**加工项 点阵 */ + list: CodeParams[] = [] + /** 加工项 的其他附带信息 */ + processItemInfo?: ProcessInfo = {} +} + +/** 代码指令数据集 加工项数据集 */ +export class CodeParamsList { + processListInfo?: ProcessFileInfo + processList: CodeParamsObj[] = [] +} + + +export class _knifeType { + [key: string]: any + /** 开料刀ID号 */ + knifeId?: number | string + /** 轴号 */ + axleId?: number | string + /** 是否启用 */ + isEnabled?: boolean = true; + + /** 刀直径mm */ + diameter?: number + /** 刀长(最大深度) */ + length?: number + /**进给速度, 0取系统默认 */ + speed?: number + + /** 偏置短边偏移(X轴)-相对于工件原点位置XY坐标的短边方向偏移量 */ + offsetX?: number + /** 偏置长边偏移(Y轴)-相对于工件原点位置XY坐标的长边方向偏移量*/ + offsetY?: number + /** 偏置垂直偏移(Z轴)-相对于工件原点位置XY坐标的垂直方向偏移量*/ + offsetZ?: number + /** 基准坐标-短边(X轴)-钻头在钻包中短边方向(纵向)的相对位置 */ + baseX?: number + /** 基准坐标-长边(Y轴)-钻头在钻包中长边方向(横向)的相对位置 */ + baseY?: number + /** 轴启动指令后置 */ + isAxisStartCodePostpost?: boolean = false; + /** 轴启动指令前置 */ + isAxisStartCodePrepost?: boolean = false; + + + /** 刀名称 */ + knifeName?: String + /** 刀类型 */ + knifeType?: Number | String + /** 功能属性(数组): 1开料/切割 2拉槽 3铣型 4铣孔 5钻孔 6拉米诺 7乐扣 8T型 */ + ability?: any = [] + /** 支持的加工面 */ + face?: FaceType = 0 + /**刀启动指令 */ + knifeStartCode?: string = '' + /**刀停止指令 */ + knifeStopCode?: string = '' + /**轴开始指令 */ + axisStartCode?: string = '' + /** 轴停止指令 */ + axisStopCode?: string = '' +} + + +/** 让对象能够支持动态属性 */ +export class _type { + [key: string]: any; +} + +/** + * 板面类型 + * 0正面 1反面 2侧面 21左侧面 22右侧面 23上侧面 24下侧面 29 弧形侧面 30异形侧面 + */ +export enum FaceType { + /** 正面 */ + FRONT = 0, + /** 反面 */ + BACK = 1, + /** 侧面 */ + SIDE = 2, + /** 左侧面 */ + LEFT_SIDE = 21, + /** 右侧面 */ + RIGHT_SIDE = 22, + /** 上侧面 */ + TOP_SIDE = 23, + /** 下侧面 */ + BOTTOM_SIDE = 24, + /** 弧形侧面 */ + CURVED_SIDE = 29, + /** 异形侧面 */ + SPECIAL_SHAPED_SIDE = 30, +} + +/** 开料刀 */ +export class Knife { + /** 是否启用 */ + isEnabled = true; + /** 轴号 */ + axleId = 0; + /** 开料刀ID号 */ + knifeId = 1; + /** 加工面(0正面 1反面 2左侧面 3右侧面 4上侧面 5下侧面 6任意) */ + processFace = 0; + /** 刀名称 */ + knifeName = ''; + /** 刀具类型(1铣刀 2成型刀 3钻头 4锯 5刀片) */ + knifeType = KnifeType.MILLING_CUTTER; + /** 功能属性(数组): 1开料/切割 2拉槽 3铣型 4铣孔 5钻孔 6拉米诺 7乐扣 8T型 */ + ability: any = []; + + // /** 默认开料刀 */ + // isDefaultCutKnife = false; + // /** 是否可用于开料切割 */ + // isCuttingKnife = false; + // /** 是否允许铣孔(knifeType为铣刀生效) */ + // isMillingAllowed = false; + /** 刀直径mm */ + diameter = 6; + /** 刀长(最大深度) */ + length = 20; + /** 锯齿厚度,单次加工切缝宽度 */ + sawThiness = 0; + /**锯向: 0横向(或长边) 1纵向(短边) 2自由角度*/ + sawDirection = 0; + /**切向加工方向: 0横向左往右 2横向右往左 3纵向上往下 4纵向下往上 5随意 */ + processDirection = 0; + /**进给速度, 0取系统默认 */ + speed = 0; + /** 进给深度 */ + stepDepth = 0; + // /** 组号 */ + // groupNo = 0; + // /** 主刀 */ + // isMainKnife = false; + // /** 是否高级加工 */ + // isAdvancedProcessEnabled = false; + // /** 是否集合加工 */ + // isBatchProcessEnabled = false; + // /** 副刀偏置长边偏移(Y轴) */ + // auxKnifeOffsetY = 0; + // /** 副刀偏置短边偏移(X轴) */ + // auxKnifeOffsetX = 0; + /** 偏置短边偏移(X轴)-相对于工件原点位置XY坐标的短边方向偏移量 */ + offsetX = 0; + /** 偏置长边偏移(Y轴) -相对于工件原点位置XY坐标的长边方向偏移量*/ + offsetY = 0; + /** 偏置垂直偏移(Z轴) -相对于工件原点位置XY坐标的垂直方向偏移量*/ + offsetZ = 0; + /** 基准坐标-短边(X轴) -钻头在钻包中短边方向(纵向)的相对位置 */ + baseX = 0; + /** 基准坐标-长边(Y轴) -钻头在钻包中长边方向(横向)的相对位置 */ + baseY = 0; + /**组合钻 */ + isModularDrill = false; + /** 是否预启动 */ + isPreStartEnabled = false; + /** 预启动提前动作数 */ + preStartAheadActionCount = 5; + /** 预启动延迟换刀 */ + isPreStartToolChangeDelay = false; + /** 预启动延迟换刀指令 */ + preStartToolChangeDelayCode = ''; + /** 轴启动指令后置 */ + isAxisStartCodePostpost = false; + /** 轴停止指令前置 */ + isAxisStopCodePrepose = false; + /** 钻组独立指令(启用后,刀起始指令、刀结束指令使用钻组起始指令、钻组结束指令替换) */ + drillGroupCode = ''; + + /** 轴启动代码*/ + axisStartCode = ""; + /** 刀启动代码 */ + knifeStartCode = ''; + /** 钻组起始指令 */ + drillGroupStartCode = ''; + /** 钻组结束指令 */ + drillGroupEndCode = ''; + /** 刀停止代码 */ + knifeStopCode = ''; + /** 轴停止指令 */ + axisStopCode = ''; + // /** 高级加工指令 */ + // advancedCode = ''; + + /** 开料刀 */ + get isCuttingKnife() { + return this.isEnabled && this.ability.includes(AbilityType.CUT); + } + + /** 造型刀 */ + get isModelingKnife() { + return this.isEnabled && this.ability.includes(AbilityType.MILLING_MODEL); + } + + /** 钻刀 */ + get isDrillingKnife() { + return this.isEnabled && this.ability.includes(AbilityType.DRILL_HOLE); + } + + /** 铣孔 */ + get isCutting4HoleKnife() { + return this.isEnabled && this.ability.includes(AbilityType.MILLING_HOLE); + } + + constructor(data: any = null) { + if (data != null) { + for (const key in data) { + try { + this[key] = data[key] + // if (Reflect.has(this, key)) { + // this[key] = data[key] + // } + } catch (error) { + console.log('load knife parameter error', key, error) + } + } + } + } + + /** 设置刀具(轴号, 刀名, 刀直径, 是否主刀, 是否铣孔, 是否开料刀) */ + // set(axleId: number, name: string, diameter: number, isMainKnife: boolean, isMillingAllowed: boolean, isCuttingKnife: boolean) + /** 设置刀具(轴号, 刀名, 刀类型, 刀直径, 刀长, 是否默认刀) */ + set(axleId: number, name: string, knifeType: KnifeType, diameter: number, length: number, isEnabled: boolean) { + this.axleId = axleId; + this.knifeName = name; + this.knifeType = knifeType; + this.diameter = diameter; + this.length = length; + this.isEnabled = isEnabled; + } +} + + +/** 刀类型: MILLING_CUTTER铣刀 FORMING_CUTTER成型刀 DRILL钻头 SAW锯 BLADE刀片 */ +export enum KnifeType { + /** 铣刀 */ + MILLING_CUTTER = 1, + /** 成型刀 */ + FORMING_CUTTER = 2, + /** 钻头 */ + DRILL = 3, + /** 锯 */ + SAW = 4, + /** 刀片 */ + BLADE = 5 +} + +/** 刀功能: + ** 1-CUT开料/切割 2-PULLING_GROOVE拉槽 3-MILLING_MODEL铣型 4-MILLING_HOLE铣孔 + ** 5-DRILL_HOLE钻孔 6-RAMINO拉米诺 7-EASY_FASTEN乐扣 8-T_TYPE T型 */ +export enum AbilityType { + /** 1开料/切割 */ + CUT = 1, + /** 2拉槽 */ + PULLING_GROOVE = 2, + /** 3铣型 */ + MILLING_MODEL = 3, + /** 4铣孔 */ + MILLING_HOLE = 4, + /** 5钻孔 */ + DRILL_HOLE = 5, + /** 6拉米诺 */ + RAMINO = 6, + /** 7乐扣 */ + EASY_FASTEN = 7, + /** 8T型 */ + T_TYPE = 8 +} + +/** 枚举 坐标轴类型 */ +export enum AxisType { + /** X轴正 */ + X_POS = 0, + /** X轴负 */ + X_NEG = 1, + /** Y轴正 */ + Y_POS = 2, + /** Y轴负 */ + Y_NEG = 3, + /** 向上Z轴正 */ + Z_POS = 4, + /** 向下Z轴负 */ + Z_NEG = 5, +} + +/** 枚举 坐标轴类型 */ +export enum OriginZPosition { + /** 台面向上Z轴正 */ + WorkTop = 0, + /** 板面向上Z轴正 */ + BoardFace = 1, +} + +// nc文件编码 +export const ncEncodeMap = { + 'UTF-8': 'UTF-8', + 'GB2312': 'GB2312', + 'UTF-8-BOM': 'UTF-8-BOM', + 'GBK': 'GBK', + 'Big-5': 'Big-5', + 'GB18030': 'GB18030', + 'Unicode': 'Unicode' +} + +// 小板文件名选项 +export const smallPlateOptionsMap = { + 板宽: '{0}', + 板长: '{1}', + 颜色: '{2}', + 材质: '{3}', + 大板号: '{4}', + 工位号: '{5}', + 板厚: '{6}', + 开料顺序: '{7}', + 批次识别: '{8}', + 小板编号: '{9}', + 全局大板号: '{10}', + 品牌: '{11}', +} + +// zip压缩包文件名选项 +export const zipFileOptionsMap = { + '板宽': '{0}', + '板长': '{1}', + '颜色': '{2}', + '材质': '{3}', + '大板号': '{4}', + '工位号': '{5}', + '板厚': '{6}', + '开料顺序': '{7}', + '批次识别': '{8}', + '小板编号': '{9}', + '全局大板号': '{10}', + '品牌': '11', +} + +/** 枚举 大板边角位置 */ +export enum BoardPosition { + /** 左上角 */ + // LEFT_TOP = 0, + // /** 左下角 */ + // LEFT_BOTTOM = 1, + // /** 右下角 */ + // RIGHT_BOTTOM = 2, + // /** 右上角 */ + // RIGHT_TOP = 3, + /** 左上角 */ + LEFT_TOP = 3, + /** 左下角 */ + LEFT_BOTTOM = 0, + /** 右下角 */ + RIGHT_BOTTOM = 1, + /** 右上角 */ + RIGHT_TOP = 2, + /** + * 左下角 = 0, + 右下角 = 1, + 右上角 = 2, + 左上角 = 3 + */ +} + +/** 排版样式 */ +export enum PlaceStyle { + /** 正面 */ + FRONT = 0, + /** 正面右转 */ + FRONT_TURN_RIGHT = 1, + /** 正面后转 */ + FRONT_TURN_BACK = 2, + /** 正面左转 */ + FRONT_TURN_LEFT = 3, + /** 反面 */ + BACK = 4, + /** 反面右转 */ + BACK_TURN_RIGHT = 5, + /** 反面后转 */ + BACK_TURN_BACK = 6, + /** 反面左转 */ + BACK_TURN_LEFT = 7, +} + +/** 小板边的位置类型 */ +export enum EdgeType + { + /** 下=0 */ + BOTTOM = 0, + /** 右=1 */ + RIGHT = 1, + /** 上=2 */ + TOP = 2, + /** 左=3 */ + LEFT = 3, +} diff --git a/src/processParser/parseMain.ts b/src/processParser/parseMain.ts new file mode 100644 index 0000000..2f9d5cb --- /dev/null +++ b/src/processParser/parseMain.ts @@ -0,0 +1,462 @@ +import { Knife } from "./confClass" +import { FileZip } from "./common/base/ZipFile" +import { _knifeType, _type, CodeParamsList } from "./confClass" +import { device1 } from "./processConfig/device1/parser1" +import { device2 } from "./processConfig/device2/parser2" + +export enum CodeType { + 文件头 = 'FSTART', + 调刀 = 'T', + 主程序 = 'C', + 主程序结束 = 'CE', + 文件尾 = 'FEND', + 备注 = 'MARK', + FileStart = 'FSTART', + UseKnife = 'T', + MainCode = 'C', + MainCodeEnd = 'CE', + FileEnd = 'FEND', + REMARK = 'MARK', +} + +export class ParserMain { + /**解析器 解析器容器 */ + _device + deviceList = [ + { + label: '解析器1', + value: 'device1', + groupLabel: '通用', + groupKey: 'parser1', + device: device1 + }, + { + label: '解析器2', + value: 'device2', + groupKey: 'parser1', + groupLabel: '通用', + device: device2 + } + ] + zipFile: FileZip + processListData?: CodeParamsList + + constructor(device?) { + if (device) { + this._device = device + } + this.zipFile = new FileZip() + } + //** 文件头 */ + FSTART(val) { + let str = this.handleCode('FSTART', val) + return str + } + /** 换刀 */ + T(val, params?) { + let str = this.handleCode('T', val, params) + return str + } + /** 主程序 加工数据 */ + C(val, params) { + let str = this.handleCode('C', val, params) + return str + } + /** 主程序结束 */ + CE(val) { + let str = this.handleCode('CE', val) + return str + } + /** 文件结束 */ + FEND(val) { + let str = this.handleCode('FEND', val) + return str + } + /** 备注 */ + MARK(val, params) { + let str = this.handleCode('MARK', val, params) + return str + } + // { + // "value": "1", + // "label": "铣刀", + // }, + // { + // "value": "2", + // "label": "成型刀", + // }, + // { + // "value": "3", + // "label": "钻头" + // }, + // { + // "dictType": "work_area_knif_type", + // "value": "4", + // "label": "锯片", + // } + getAbilityOptions(i) { + let knife = this._device.knifeList[i] + const knifeTypeOptions = this.getKnifeTypeOptions() || [] + let label = knifeTypeOptions.find(e => e.value == knife.knifeType).label || '' + const allowedAbilities = knifeTypeAbilityMap[label] || [] + const filteredAbilities = orginAbilitys.filter(ability => allowedAbilities.includes(ability.label)) || [] + return filteredAbilities + } + setDefaultKnife(i) { + console.log('setDefaultKnife', i); + this._device.knifeList.forEach((knife, index) => { + if (i == index) { + knife.isDefaultCutKnife = true + } else { + knife.isDefaultCutKnife = false + } + }); + } + getKnifeTypeOptions() { + return knifeTypeOptions + } + /** 设置使用的解析器 */ + setDevice(device) { + this._device = device + } + /** 根据解析器名称 设置解析器 */ + setDeviceByName(deviceName) { + let deviceOption = this.deviceList.find(e => e.label == deviceName) + if (deviceOption) { + let device = deviceOption.device + this.setDevice(new device()) + } + } + /** 根据解析器key 设置解析器 */ + setDeviceByKey(deviceKey) { + let deviceOption = this.deviceList.find(e => e.value == deviceKey) + if (deviceOption) { + let device = deviceOption.device + this.setDevice(new device()) + } + } + + /** 处理指令代码 */ + handleCode(codeType, codeKey, params?) { + let str = '' + if (typeof (this._device[codeType][codeKey]) == 'function') { + str += this._device[codeType][codeKey](params) + } else { + str += this._device[codeType][codeKey] + } + if (!codeType) { + str = '// 未输入代码,请重新输入\n' + } else if (!codeKey) { + str = '// 未输入指令,请重新输入\n' + let k = Object.keys(this._device[codeType]) + str += `// 代码【${codeType}】支持的指令为:${k.join(',')}` + } else if (str == 'undefined') { + str = `// 代码【${codeType}】指令【${codeKey}】解析失败,请检查代码指令配置\n` + } + // console.log('handleCode parserMain', str) + /** 空行处理 */ + if (this._device.isFilterEmptyLine == true) { + str = this._device.handleEmptyLine(str) + } + + // 空行前插入 + if (this._device.isNcLinePrefixEnabled == true) { + str = this._device.handleEmptyLinePreFix(str) + } + // 空行后插入 + if (this._device.isNcLineSuffixEnabled == true) { + str = this._device.handleEmptyLineSuffix(str) + } + + if (codeType == 'FEND') { + this._device.lastCodeParams = undefined + } + return str + } + + /** + * 加载 解析器数据 + * + */ + loadProcessListData(data: CodeParamsList) { + this.processListData = data + } + + checkProcessDataPosition(data: CodeParamsList): CodeParamsList { + let newData = { ...data } + + // 根据解析器的放置方式 转换数据 + for (let processList of newData.processList) { + if (Array.isArray(processList.list) && processList.list.length > 0) { + let newList = this._device.getRealPoints(processList.list) + processList.list = newList + } + } + return newData + } + + /**根据 解析器收到的数据 生成 加工代码 */ + getCode(data: CodeParamsList) { + let str = ''; + if (!data || !Array.isArray(data?.processList)) { + console.error('无效数据: data.processList 必须是数组'); + return str; + } + + for (const item of data.processList) { + if (!item?.processItemInfo) continue; + const { code, order, codeParams } = item.processItemInfo; + str += this.handleCode(code, order, code === 'C' ? item : codeParams); + } + + if (this._device?.isUseSimpleCode) { + str = this._device.handleSimpleCode(str); + } + return str; + } + /** 导出文件 */ + async exportFile(data: CodeParamsList) { + let zipFileName = data.processListInfo?.zipFileName || 'test.zip' + this.zipFile.SetZipFileName(zipFileName) + + let fileNameInfo = data.processListInfo?.fileName + let fileName = '' + if (typeof (fileNameInfo) == 'string') { + fileName = fileNameInfo + } else { + fileName = `${fileNameInfo?.name || 'empty'}.${fileNameInfo?.Suffix || '.txt'}` + } + let str = ''; + for (const item of data.processList) { + if (!item.processItemInfo) { + continue + } + let code = item.processItemInfo.code + let order = item.processItemInfo.order + let params = item.processItemInfo.codeParams + + if (code == 'C') { + params = item + } + str += await this.handleCode(code, order, params) + } + + await this.zipFile.PushFile(fileName, str) + + + await this.zipFile.Download() + // + } + + + setZipFileName(fileName: string) { + this.zipFile.SetZipFileName(fileName) + } + /** 设置刀库 */ + setKnifeList(knifeList: Array) { + this._device.knifeList = knifeList + } + /** 获取解析器列表 */ + getDeviceList() { + + return this.deviceList + } +} + + +/** demo 刀具数据 */ +export const knifeData = { + "isEnabled": true, + "axleId": 2, + "knifeId": 2, + "processFace": "", + "knifeName": "T1", + "knifeType": 3, + "ability": [ + 5 + ], + "diameter": 5, + "length": 20, + "sawThiness": 7, + "sawDirection": 2, + "processDirection": 4, + "speed": 0, + "stepDepth": 0, + "offsetX": 0, + "offsetY": 0, + "offsetZ": 0, + "baseX": 0, + "baseY": 0, + "isModularDrill": false, + "isPreStartEnabled": false, + "preStartAheadActionCount": 5, + "isPreStartToolChangeDelay": false, + "preStartToolChangeDelayCode": "", + "isAxisStartCodePostpost": false, + "isAxisStopCodePrepose": false, + "drillGroupCode": "", + "axisStartCode": "M03 S18000\n", + "knifeStartCode": `M06 T1\nG43 H1\n`, + "drillGroupStartCode": "T1", + "drillGroupEndCode": "", + "knifeStopCode": "", + "axisStopCode": "M05\n", + "preStartActionDeferCode": "", + "useHolesGroupKnife": false, + "preStartActionStepsLimit": "", + "knifeNo": "", + "editable": true, + "isDefaultCutKnife": false, + "isPreStartChangeKnifeDefer": false +} +export const knifeData1 = { + "isEnabled": true, + "axleId": 2, + "knifeId": 2, + "processFace": "", + "knifeName": "T2", + "knifeType": 3, + "ability": [ + 5 + ], + "diameter": 6, + "length": 20, + "sawThiness": 7, + "sawDirection": 2, + "processDirection": 4, + "speed": 0, + "stepDepth": 0, + "offsetX": 0, + "offsetY": 0, + "offsetZ": 0, + "baseX": 0, + "baseY": 0, + "isModularDrill": false, + "isPreStartEnabled": false, + "preStartAheadActionCount": 5, + "isPreStartToolChangeDelay": false, + "preStartToolChangeDelayCode": "", + "isAxisStartCodePostpost": false, + "isAxisStopCodePrepose": false, + "drillGroupCode": "", + "axisStartCode": "M03 S18000\n", + "knifeStartCode": `M06 T2\nG43 H2\n`, + "drillGroupStartCode": "T2", + "drillGroupEndCode": "", + "knifeStopCode": "", + "axisStopCode": "M05\n", + "preStartActionDeferCode": "", + "useHolesGroupKnife": false, + "preStartActionStepsLimit": "", + "knifeNo": "", + "editable": true, + "isDefaultCutKnife": false, + "isPreStartChangeKnifeDefer": false +} +export const knifeData2 = { + "isEnabled": true, + "axleId": 2, + "knifeId": 2, + "processFace": "", + "knifeName": "T3", + "knifeType": 3, + "ability": [ + 5 + ], + "diameter": 6, + "length": 20, + "sawThiness": 7, + "sawDirection": 2, + "processDirection": 4, + "speed": 0, + "stepDepth": 0, + "offsetX": 0, + "offsetY": 0, + "offsetZ": 0, + "baseX": 0, + "baseY": 0, + "isModularDrill": false, + "isPreStartEnabled": false, + "preStartAheadActionCount": 5, + "isPreStartToolChangeDelay": false, + "preStartToolChangeDelayCode": "", + "isAxisStartCodePostpost": false, + "isAxisStopCodePrepose": false, + "drillGroupCode": "", + + "axisStartCode": "M03 S18000\n", + "knifeStartCode": `M06 T2\nG43 H2\n`, + "drillGroupStartCode": "T3", + "drillGroupEndCode": "", + "knifeStopCode": "", + "axisStopCode": "M05\n", + + "preStartActionDeferCode": "", + "useHolesGroupKnife": false, + "preStartActionStepsLimit": "", + "knifeNo": "", + "editable": true, + "isDefaultCutKnife": false, + "isPreStartChangeKnifeDefer": false +} + +export const knifeTypeOptions = [ + { + "value": "1", + "label": "铣刀", + }, + { + "value": "2", + "label": "成型刀", + }, + { + "value": "3", + "label": "钻头", + }, + { + "value": "4", + "label": "锯片", + }, +] + +export const orginAbilitys = [ + { + "value": "1", + "label": "切割", + }, + { + "value": "2", + "label": "拉槽", + }, + { + "value": "3", + "label": "铣型", + }, + { + "value": "4", + "label": "铣孔", + }, + { + "value": "5", + "label": "钻孔", + }, + { + "value": "6", + "label": "拉米诺", + }, + { + "value": "7", + "label": "乐扣/U形件", + }, + { + "value": "8", + "label": "T形/燕尾槽刀", + }, +] + +export const knifeTypeAbilityMap = { + 钻头: ['钻孔'], // 3 + 铣刀: ['切割', '拉槽', '铣型', '铣孔', '钻孔'], // 1 + 成型刀: ['铣型', '拉米诺', '乐扣/U形件', 'T形/燕尾槽刀'], // 2 + 锯片: ['拉槽', '拉米诺'],//4 '切割',下个版本支持 + } \ No newline at end of file diff --git a/src/processParser/processConfig/device1/parser1.ts b/src/processParser/processConfig/device1/parser1.ts new file mode 100644 index 0000000..32eb904 --- /dev/null +++ b/src/processParser/processConfig/device1/parser1.ts @@ -0,0 +1,905 @@ +/** 解析器1 */ +import { AxisType } from "../../confClass"; +import { _knifeType, _type, CodeParams, CodeParamsList, CodeParamsObj, configItem, GCodeAction, ProcessInfo,OriginZPosition } from "../../confClass"; +import { BoardPosition } from "../../confClass"; +import { FileZip } from "../../common/base/ZipFile"; +import { confList } from "./parser1Data"; +import { knifeData, knifeData1, knifeData2 } from "../../parseMain"; + +/** + * 备注: + * 文件导出模式(大板模式 || 小板模式)---作用于 加工项数据 和加工项的点阵数据 + * 应该在数据处理 生效 + * 解析器 只根据 板件的放置方式进行转换 + */ +export class device1 { + [key: string]: any; + + /**G代码基类 */ + _Action = new GCodeAction() + /** 刀库 */ + knifeList?: Array<_knifeType> + /** 当前使用的刀具 */ + usedKnife?: _knifeType + + /** 暴露给外部的参数 */ + config: configItem[] = confList + /** 板厚 -- 读数据处理的数据 */ + thickness: number = 18 + /** 文件导出工具类 */ + zipFile?: FileZip + + + /**是否执行换刀后的第一行精简指令 */ + doSimpleFirstCode: boolean = false + + lastCodeParams?: CodeParams + + /** 为了开发 方便 把一些配置的字段写在这里 */ + + /** ZIP压缩包文件名 */ + exportOrderPathName: string = '{2}.zip' + /** NC文件编码 */ + ncFileEncoding: string = 'UTF-8' + /** 是否添加注释信息 */ + isNcFileComment: boolean = true + /** 是否空行插入前缀 */ + isNcLinePrefixEnabled: boolean = false + /** 空行插入前缀 前缀内容*/ + ncLinePrefix: string = '' + /** 文件名 */ + blockFileName: string = '{9}.ban' + + /** 使用精简指令 */ + isUseSimpleCode: boolean = false + /** 精简换刀后第一行指令 */ + isSimpleFirstCode: boolean = false + /** 反转圆弧指令 */ + reverseArcCode: boolean = false + /** 空程移动指令 */ + NcCodeFreeMove: string = 'G0' + /** 直线插补标识 */ + NcCodeLineInterpolation: string = 'G1' + /** 顺时针圆弧插补标识 */ + NcCodeClockwiseArcInterpolation: string = 'G2' + /** 逆时针圆弧插补标识 */ + NcCodeAnticlockwiseArcInterpolation: string = 'G3' + /** 水平坐标横轴标识 */ + NcCodeAxisX: string = 'Y' + /** 水平坐标纵轴标识 */ + NcCodeAxisY: string = 'X' + /** 垂直坐标轴标识 */ + NcCodeAxisZ: string = 'Z' + /** 速度标识 */ + NcCodeSpeed: string = 'F' + /** 水平坐标横轴增量标识 */ + NcCodeIncrementAxisX: string = 'I' + /** 水平坐标纵轴增量标识 */ + NcCodeIncrementAxisY: string = 'J' + /** 垂直坐标轴增量标识 */ + NcCodeIncrementAxisZ: string = 'K' + /** 注释标识符 */ + leaderChar: string = '//' + /** 解析器(输出机台)的坐标系基准 x */ + boardLength: number = 2440 + /** 解析器(输出机台)的坐标系基准 y */ + boardWidth: number = 1220 + /** 解析器(输出机台)的坐标系基准 z */ + boardHeight: number = 50 + + /** 水平基准 */ + originPointPosition: BoardPosition = BoardPosition.LEFT_TOP + /** 垂直基准 */ + originZ0Position: OriginZPosition = OriginZPosition.BoardFace + /** 水平纵轴坐标轴向 */ + widthSideAxis: AxisType = AxisType.X_POS + /** 水平横轴坐标轴向 */ + lengthSideAxis: AxisType = AxisType.Y_POS + /** 垂直轴坐标轴向 */ + heightAxis: AxisType = AxisType.Z_POS + /** 大板定位 */ + boardLocation: BoardPosition = BoardPosition.LEFT_BOTTOM + /** 大板长轴偏置 */ + boardOffsetY: number = 0 + /** 大板短轴偏置 */ + boardOffsetX: number = 0 + /** 导出文件 保留小数点位数 */ + decimalPointPrecision: number = 3 + /** 末尾补零 */ + fixFloatNumberEndZero: boolean = true + /** 整数值末尾加小数点 */ + intNumberAddDecimalPoint: boolean = true + /** 辅助开料指令 */ + helpCutKnifeCode: string = '' + /** 辅助开料指令2 */ + helpCutKnifeCode2: string = '' + + constructor() { + this.knifeList = [] + this.knifeList.push(knifeData) + this.knifeList.push(knifeData1) + this.knifeList.push(knifeData2) + } + /**文件头 */ + FSTART: _type = { + FSTART: `G54 G90\nM03\n`, + // F1: `G54 G90\n`, + // F2: `G53 G90\nM03\n`, + } + /** 换刀 */ + T: _type = { + // T6: `T6 \nG43 H6\n`, + // Ts6: `T6\n`, + // T7: `T7\nG43 H7\n`, + // ** 默认都走这个 调刀指令 若无需调刀则返回 '' 要调刀 则返回刀具的调刀代码 */ + // 20250508 将TD 定义为 + /**根据刀直径(半径)找刀 */ + + TD: (diameter, params?: any) => { + let code = '' + let _knife: _knifeType | undefined = undefined + + if (diameter) { + _knife = this.knifeList?.find(e => e.diameter == diameter) + } + + + if (_knife != undefined) { + code += this.checkChangeKnifeEndCode(_knife) + this.usedKnife = _knife + // code += _knife.axisStartCode + code += _knife.knifeStartCode + } + if (this.isSimpleFirstCode == true && this.lastCodeParams) { + this.doSimpleFirstCode = true + } + return code + }, + /**根据刀名称找刀 换刀 */ + TN: (knifeName, params?: any) => { + let code = '' + let _knife: any = null + if (knifeName) { + _knife = this.knifeList?.find(e => e.knifeName == knifeName) + } + + if (_knife != undefined) { + code += this.checkChangeKnifeEndCode(_knife) + this.usedKnife = _knife + // code += _knife.axisStartCode + code += _knife.knifeStartCode + } + if (this.isSimpleFirstCode == true && this.lastCodeParams) { + this.doSimpleFirstCode = true + } + return code + }, + // 停刀 + 停轴 + TE: () => { + let code = '' + if (this.usedKnife) { + code += this.usedKnife.knifeStopCode + '\n' + // code += this.usedKnife.axisStopCode + '\n' + } + + return code + } + + } + /**主程序 G0 - G3 辅助开料 */ + C: _type = { + KnifeMove: (processItem: CodeParamsObj) => { + let code = '' + /** 获取调刀代码 */ + if (processItem.processItemInfo?.knife) { + let changeKnifeCode = '' + if (processItem.processItemInfo?.knife.diameter) { + changeKnifeCode = this.T?.TD(processItem.processItemInfo?.knife.diameter) + } else if (processItem.processItemInfo?.knife.knifeName) { + changeKnifeCode = this.T?.TN(processItem.processItemInfo?.knife.knifeName) + } + + code += changeKnifeCode + } + + if (processItem.list.length > 0) { + for (const item of processItem.list) { + let point = item + if (processItem.processItemInfo) { + point = this.getXYZ(item, processItem.processItemInfo); + } + if (this.reverseArcCode == true) { + if (point.dir == 2) { + point.dir = 3 + } else if (point.dir == 3) { + point.dir = 2 + } + } + code += `${this.KnifeMove_Arc(point)} \n` + } + } else { + this.logError('doProcessItem fail,no processItem Data') + } + return code + }, + HelpCutCode1: this.helpCutKnifeCode, + HelpCutCode2: this.helpCutKnifeCode2 + } + /**主程序结束 */ + CE: _type = { + CE1: `M05\n` + } + /**文件尾 */ + FEND: _type = { + FEND: `M30\n`, + // FEND1: `M30\n` + } + /** 备注 */ + MARK: _type = { + Mark: (str) => { + let markContent = str + '\n' + let isShowMark = this.isNcFileComment || false + if (isShowMark) { + let leaderChar = this.leaderChar || '' + markContent = `${leaderChar} ${markContent}` + } else { + markContent = '' + } + return markContent + '\n' + }, + BLOCKREMARK1: `//Cut Block`, + } + /** 文件操作指令 */ + FILE: _type = { + START: (zipName) => { + this.initZipFile() + this.setZipFileName(zipName) + }, + ADDFILE: (data) => { + this.setFile(data) + }, + END: () => { + this.fileDownLoad() + } + } + /** 根据分组key 返回配置项 */ + getConfigListByGroupKey(groupKey: string, groupCompment?: string[][]) { + let list = this.config.filter(e => e.groupBy == groupKey) + if (groupCompment) { + for (const groupItem of groupCompment) { + if (groupItem.length > 1) { + let itemFirstOne = groupItem[0] + let concatItem: configItem[] = []; + let itemWithOutFirst = groupItem.filter((e, x) => x != 0) + itemWithOutFirst.forEach(keyStr => { + concatItem = list.filter(e => e.key == keyStr) + list = list.filter(e => e.key != keyStr) + }) + + let i = list.findIndex(e => e.key == itemFirstOne) + + list[i].componentList = concatItem + } else { + // 分组的 配置项 如果少于2个 就不需要分组 + continue + } + } + } + console.log('getConfigListByGroupKey',groupKey,groupCompment,list); + return list + } + /** 根据代码列表 获取指令列表 */ + getCodeListByOrderKeys(codeKeys: string[]) { + let list = [] + codeKeys.forEach(code => { + let orderList = this.getCodeByOrderKeys(code) + list = list.concat(orderList) + }) + return list + } + /** 根据代码 获取指令列表 */ + getCodeByOrderKeys(codeKey: string) { + let list: any = [] + + let arr = Object.keys(this[codeKey]) + arr.forEach(str => { + let temp = { + code: codeKey, + order: str + } + list.push(temp) + }) + return list + } + //** 使用G0代码 移动刀具 */ + KnifeMove(params: CodeParams) { + let res = this._Action.G0(params) + return res + '\n' + } + /** + * 根据传入的数据 生成 G0 || G1 || G2 || G3 代码 + */ + KnifeMove_Arc(params: CodeParams) { + let res: any = '' + + let dir = params.dir || 0 + if (typeof (dir) == 'string') { + dir = parseInt(dir) + } + + let usedParams: CodeParams = { ...params } + if (this.doSimpleFirstCode == true && this.lastCodeParams) { + for (const key in usedParams) { + if (['x', 'y', 'z', 'f'].includes(key)) { + if (usedParams[key] == this.lastCodeParams[key]) { + Reflect.deleteProperty(usedParams, key) + } + } + } + this.doSimpleFirstCode = false + } + + switch (dir) { + case 0: + + if (typeof (this.NcCodeFreeMove) == 'string' && this.NcCodeFreeMove != '') { + usedParams.codeKey = this.NcCodeFreeMove + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + usedParams.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + usedParams.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + usedParams.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + usedParams.fKey = this.NcCodeSpeed + } + + res = this._Action.G0(usedParams) + break; + case 1: + if (typeof (this.NcCodeLineInterpolation) == 'string' && this.NcCodeLineInterpolation != '') { + usedParams.codeKey = this.NcCodeLineInterpolation + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + usedParams.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + usedParams.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + usedParams.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + usedParams.fKey = this.NcCodeSpeed + } + res = this._Action.G1(usedParams) + break; + case 2: + if (typeof (this.NcCodeClockwiseArcInterpolation) == 'string' && this.NcCodeClockwiseArcInterpolation != '') { + usedParams.codeKey = this.NcCodeClockwiseArcInterpolation + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + usedParams.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + usedParams.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + usedParams.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + usedParams.fKey = this.NcCodeSpeed + } + + if (typeof (this.NcCodeIncrementAxisX) == 'string' && this.NcCodeIncrementAxisX != '') { + usedParams.iKey = this.NcCodeIncrementAxisX + } + if (typeof (this.NcCodeIncrementAxisY) == 'string' && this.NcCodeIncrementAxisY != '') { + usedParams.jKey = this.NcCodeIncrementAxisY + } + if (typeof (this.NcCodeIncrementAxisZ) == 'string' && this.NcCodeIncrementAxisZ != '') { + usedParams.kKey = this.NcCodeIncrementAxisZ + } + res = this._Action.G2(usedParams) + break; + case 3: + if (typeof (this.NcCodeAnticlockwiseArcInterpolation) == 'string' && this.NcCodeAnticlockwiseArcInterpolation != '') { + usedParams.codeKey = this.NcCodeAnticlockwiseArcInterpolation + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + usedParams.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + usedParams.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + usedParams.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + usedParams.fKey = this.NcCodeSpeed + } + + if (typeof (this.NcCodeIncrementAxisX) == 'string' && this.NcCodeIncrementAxisX != '') { + usedParams.iKey = this.NcCodeIncrementAxisX + } + if (typeof (this.NcCodeIncrementAxisY) == 'string' && this.NcCodeIncrementAxisY != '') { + usedParams.jKey = this.NcCodeIncrementAxisY + } + if (typeof (this.NcCodeIncrementAxisZ) == 'string' && this.NcCodeIncrementAxisZ != '') { + usedParams.kKey = this.NcCodeIncrementAxisZ + } + res = this._Action.G3(usedParams) + break; + default: + res = '' + break; + } + this.lastCodeParams = params + return res + } + /** 换刀指令 -- + * + * 因为设计的问题 + * 现在配置界面会直接配置换刀代码 + * + * + * 配置数据读取 + * @param str: 刀具名 + */ + KnifeChange(str: String) { + let res: any = null + if (str != '') { + res = this._Action.M06(str) + } + return res + } + /** 开始指令 + * 因为设计的问题 + * 相关配置从传入配置中读取 + */ + startCode() { + let res: any = null + /** 文件头 */ + res = 'codeName\n' + /** 轴启动 */ + res += this._Action.M03(18000) + + /** 刀启动 */ + res = this._Action.M06('T1') + + /** */ + return res + } + /** 结束指令 + * 因为设计的问题 + * 相关配置从传入配置中读取 + */ + endCode() { + let res: any = null + + /**刀停止 */ + + /** 轴停止 */ + res = this._Action.M05() + + return res + } + + /** 处理空行过滤 */ + handleEmptyLine(code) { + let arr = code.split('\n') + let newArr = arr.filter(e => e != '') + newArr = newArr.map(e => { + return e + '\n' + }) + + let newCode = newArr.join('') + return newCode + } + /** 空行插入前缀 */ + handleEmptyLinePreFix(code) { + let arr = code.split('\n') + let newArr = arr.map(e => { + if (e != '') { + return e + } else { + return `${this.ncLinePrefix} ${e}\n` + } + }) + + let newCode = newArr.join('\n') + return newCode + } + /** 空行插入后缀 */ + handleEmptyLineSuffix(code) { + let arr = code.split('\n') + let newArr = arr.map(e => { + if (e != '') { + return e + } else { + return `${e} ${this.ncLineSuffix}\n` + } + }) + + let newCode = newArr.join('\n') + return newCode + } + /** 精简指令 */ + handleSimpleCode(code) { + let arr = code.split('\n') + let objArr = arr.map((e, i) => { + let type = (!e.includes('//') && !e.includes('/**') || e.includes('"//')) ? 'code' : 'remark' + let temp = { + code: e, + index: i, + regList: e.match(/[XYZF]([-+]?\d*\.?\d+)/g) || [], + type + } + return temp + }) + let checkLines = objArr.filter(e => e.type == 'code') + + // 校验对象 存键值 + let targetObject = {} + for (const key in checkLines) { + let line = checkLines[key] + if (line.regList.length > 0) { + for (const regVal of line.regList) { + let reg = regVal.match(/([XYZF])([-+]?\d*\.?\d+)/) + let FullVal = reg[0] + let valKey = reg[1] + let val = reg[2] + if (Reflect.has(targetObject, valKey)) { + if (targetObject[valKey] == val) { + // 相同 需要精简操作 + objArr[line.index].code = objArr[line.index].code.replace(FullVal, ``) + } else { + // 不同 更新校验的值 + targetObject[valKey] = val + } + } else { + // 键值 没有 赋给 校验对象 + Reflect.set(targetObject, valKey, val) + } + } + } + } + let newCode = objArr.map(e => e.code).join('\n') + // 这里 数据中莫名其妙多了个空格 处理下 + let list = newCode.split(' ').filter(e => e != '') + newCode = list.join(' ') + return newCode + } + + /** 获取配置列表 */ + getConfigList() { + return this.config + } + //** 设置配置列表 */ + setConfigList(List: configItem[]) { + this.config = [...List] + } + //** 装载配置列表 */ + updateConfigList(List: configItem[]) { + this.config = [...this.config, ...List] + } + /**根据数据导出文件 */ + async exportFile(data: CodeParamsList) { + if (this.zipFile == undefined) { + this.zipFile = new FileZip() + } + + let zipFileName = data.processListInfo?.zipFileName || 'test.zip' + this.zipFile.SetZipFileName(zipFileName) + + let fileNameInfo = data.processListInfo?.fileName + let fileName = '' + if (typeof (fileNameInfo) == 'string') { + fileName = fileNameInfo + } else { + fileName = `${fileNameInfo?.name || 'empty'}.${fileNameInfo?.Suffix || '.txt'}` + } + let str = ''; + for (const item of data.processList) { + if (!item.processItemInfo) { + continue + } + let code = item.processItemInfo.code + let order = item.processItemInfo.order + let params = item.processItemInfo.codeParams + + if (code == 'C') { + params = item + } + str += await this.handleCode(code, order, params) + } + + await this.zipFile.PushFile(fileName, str) + + + await this.zipFile.Download() + } + initZipFile() { + this.zipFile = new FileZip() + } + /** 设置文件名 */ + async setZipFileName(zipName, fileZipObj?: FileZip) { + if (this.zipFile == undefined) { + return + } + let zipFileName = zipName || 'empty.zip' + if (fileZipObj != undefined) { + this.fileZipObj.SetZipFileName(zipFileName) + } else { + this.zipFile.SetZipFileName(zipFileName) + } + + } + /** 给zip文件内添加文件 */ + // async setFile(fileName, content, fileZipObj?: FileZip) { + async setFile(data) { + const { fileName, content, fileZipObj, isBase64, ncFileEncoding } = data + if (this.zipFile == undefined) { + return + } + let _isBase64 = isBase64 || false + let fileCode = ncFileEncoding || 'UTF-8' + if (fileZipObj != undefined) { + await this.fileZipObj.PushFile(fileName, content, _isBase64, fileCode) + } else { + await this.zipFile.PushFile(fileName, content, _isBase64, fileCode) + } + + } + /** 下载zip */ + async fileDownLoad(fileZipObj?: FileZip) { + if (this.zipFile == undefined) { + return + } + if (fileZipObj != undefined) { + await this.fileZipObj.Download() + } else { + await this.zipFile.Download() + } + + } + + /** 处理C代码 */ + handleCode(codeType, codeKey, params?) { + let str = '' + if (typeof (this[codeType][codeKey]) == 'function') { + str += this[codeType][codeKey](params) + } else { + str += this[codeType][codeKey] + } + if (!codeType) { + str = '// 未输入代码,请重新输入\n' + } else if (!codeKey) { + str = '// 未输入指令,请重新输入\n' + let k = Object.keys(this[codeType]) + str += `// 代码【${codeType}】支持的指令为:${k.join(',')}` + } else if (str == 'undefined') { + str = `// 代码【${codeType}】指令【${codeKey}】解析失败,请检查代码指令配置\n` + } + + console.log('handleCode', str) + + // 输出文件未 清除上一条的刀路数据 + if (codeType == 'FEND') { + this.lastCodeParams = undefined + } + + return str + } + /** 更新代码 */ + updateCode(data) { + for (const codeItem of data) { + this.updateOrder(codeItem.value, codeItem.orderArr) + } + } + /** 更新指令 */ + updateOrder(code, orderArr) { + // 更新前 指令的数据集 + let keys = Object.keys(this[code]) + + // 更新指令 + for (const orderItem of orderArr) { + let key = orderItem.name + let value = orderItem.value + Reflect.set(this[code], key, value) + } + + // 移除指令 + let orderKeys = orderArr.map(e => e.name) + + for (const key of keys) { + if (!orderKeys.includes(key)) { + if (typeof (this[code][key]) != 'function') { + Reflect.deleteProperty(this[code], key) + } + } + } + } + /** 添加备注 */ + blockRemark(params?) { + let str = `//Cut Block Id=${params.boardId} No=${params.blockNo} W=${params.width} L=${params.length}\n` + return str + } + /** */ + getFileHead(params?) { + let str = `//根据参数生成文件头\n ${params}\n` + return str + } + getRealPoints(list: CodeParams[]) { + let newList = [...list] + for (let point of newList) { + point = this.getRealPoint(point) + } + } + getRealPoint(point: CodeParams) { + let newPoint = { ...point } + + return newPoint + } + + /** 内部功能逻辑 换刀时判断是否需要 上一把刀的停止代码 */ + checkChangeKnifeEndCode(knife: _knifeType) { + let code = ''; + /** true 需要 输出停刀代码 false 不需要 */ + let flag = false + // 必须要有刀 + if (this.usedKnife) { + let keys = Object.keys(knife) + for (const key of keys) { + if (knife[key] != this.usedKnife[key]) { + flag = true + continue + } + } + } + if (flag) { + code += this.T.TE() + } + return code; + } + /** + * + * @param point 加工项的点 + * @param processItemInfo 加工项的信息 水平基准、垂直基准、轴方向(x、y、z),板件方向(x、y、z) + * // 这里加工项的点数据 都是经过数据处理的 假定这里拿到的数据都是基于左上角 台面 + * + * @returns 实际加工项的点 + */ + getXYZ(point: CodeParams, processItemInfo: ProcessInfo): CodeParams { + let newPoint: any = {} + for (const key in point) { + if (point[key] != undefined) { + Reflect.set(newPoint, key, parseFloat(point[key])) + } + } + /** 有2个部分 + * 一个是基于机台和板件的转换 依据板件定位 + * 另外一个是基于板件和加工项的转换 依据板件长高方向*/ + switch (this.originZ0Position) { + case 0: + // 台面 不操作 + break; + case 1: + // 板面 Z坐标需要转换 + newPoint.z = newPoint.z - this.thickness + break; + default: + break; + } + + /** step 先转换板件的位置 */ + // 大板定位 不同 根据不同的定位点修改 + + // processItemInfo + switch (this.originPointPosition) { + case BoardPosition.LEFT_TOP: + // 不操作 + newPoint = this.changeXYZAxiosSide(newPoint) + break; + case BoardPosition.LEFT_BOTTOM: + // 左下角 x坐标要转换 + newPoint.x = newPoint.x + this.boardWidth - processItemInfo.block.cutWidth //400 + newPoint = this.changeXYZAxiosSide(newPoint) + break; + case BoardPosition.RIGHT_TOP: + // 右上角 y坐标要转换 + newPoint.y = newPoint.y + this.boardLength - processItemInfo.block.cutLength // 600 + newPoint = this.changeXYZAxiosSide(newPoint) + break; + case BoardPosition.RIGHT_BOTTOM: + // 右下角 xy 坐标要转换 + newPoint.x = newPoint.x + this.boardWidth - processItemInfo.block.cutWidth + newPoint.y = newPoint.y + this.boardLength - processItemInfo.block.cutLength + newPoint = this.changeXYZAxiosSide(newPoint) + break; + default: + break; + } + + + + + // 这里做 数值的小数点处理 + for (const key in newPoint) { + if (['x', 'y', 'z', 'r', 'i', 'j', 'k'].includes(key)) { + let isTofix = false + if (this.fixFloatNumberEndZero == true) { + // 末尾补零 + isTofix = true + } else if (this.intNumberAddDecimalPoint == true) { + // 整数值末尾加小数点 + if (Number.isInteger(newPoint[key])) { + isTofix = true + } + } + if (isTofix) { + newPoint[key] = parseFloat(newPoint[key]).toFixed(this.decimalPointPrecision) + } + } + } + + + return newPoint + } + /** 根据 轴向变更坐标 */ + changeXYZAxiosSide(point: CodeParams) { + let newPoint: any = {} + for (const key in point) { + if (point[key] != undefined) { + Reflect.set(newPoint, key, parseFloat(point[key])) + } + } + let width = this.boardWidth + let length = this.boardLength + let height = this.boardHeight + + + if (this.widthSideAxis == AxisType.X_POS && this.lengthSideAxis == AxisType.Y_POS) { + // 默认 为 X = x 正 Y = y 正 不操作 + } else if (this.widthSideAxis == AxisType.Y_POS && this.lengthSideAxis == AxisType.X_POS) { + // x = y正 y = x正 X Y坐标 倒转 + newPoint = { ...newPoint, x: newPoint.y, y: newPoint.x } + } + + else if (this.widthSideAxis == AxisType.X_NEG && this.lengthSideAxis == AxisType.Y_POS) { + // x = x负 y = y正 + newPoint = { ...newPoint, x: newPoint.x - width, y: newPoint.y } + } else if (this.widthSideAxis == AxisType.Y_POS && this.lengthSideAxis == AxisType.X_NEG) { + // x = y正 y = x负 + newPoint = { ...newPoint, x: newPoint.y - width, y: newPoint.x } + } + + else if (this.widthSideAxis == AxisType.X_NEG && this.lengthSideAxis == AxisType.Y_NEG) { + // x = x负 y = y负 + newPoint = { ...newPoint, x: newPoint.x - width, y: newPoint.y - length } + } else if (this.widthSideAxis == AxisType.Y_NEG && this.lengthSideAxis == AxisType.X_NEG) { + // x = y负 y = x负 + newPoint = { ...newPoint, x: newPoint.y - width, y: newPoint.x - length } + } + + else if (this.widthSideAxis == AxisType.X_POS && this.lengthSideAxis == AxisType.Y_NEG) { + // x = x正 y = y负 + newPoint = { ...newPoint, x: newPoint.x, y: newPoint.y - length } + } else if (this.widthSideAxis == AxisType.Y_NEG && this.lengthSideAxis == AxisType.X_POS) { + // x = y负 y = x正 + newPoint = { ...newPoint, x: newPoint.y, y: newPoint.x - length } + } + + if (this.heightAxis == AxisType.Z_NEG) { + // Z轴负 + newPoint = { ...newPoint, z: newPoint.z - height } + } + + return newPoint + } +} + diff --git a/src/processParser/processConfig/device1/parser1Data.ts b/src/processParser/processConfig/device1/parser1Data.ts new file mode 100644 index 0000000..5623433 --- /dev/null +++ b/src/processParser/processConfig/device1/parser1Data.ts @@ -0,0 +1,1202 @@ + +import { configItem, ncEncodeMap, smallPlateOptionsMap, zipFileOptionsMap, AxisType } from "../../confClass"; +/** 解析器1 的配置参数 */ +export const confList: configItem[] = [ + { + key: 'boardWidth', + defaultValue: 1220, + label: '机台宽度', + groupBy: 'base', + component: 'InputNumber', + style: { + width: '120px' + } + }, + { + key: 'boardLength', + defaultValue: 2440, + label: '机台长度', + groupBy: 'base', + component: 'InputNumber', + style: { + width: '120px' + } + }, + { + key: 'boardHeight', + defaultValue: 100, + label: '机台高度', + groupBy: 'base', + component: 'InputNumber', + style: { + width: '120px', + } + }, + { + key: 'originPointPosition', + defaultValue: 3, + label: '原点位置', + groupBy: 'baseAxios', + helpMessage: `提示:加工台面工件原点,坐标XY轴零点位置`, + component: 'Select', + options: [ + { + value: 3, + label: '左上角', + }, + { + value: 0, + label: '左下角', + }, + { + value: 1, + label: '右下角', + }, + { + value: 2, + label: '右上角', + }, + ], + style: { + width: '120px' + } + }, + { + // 注: isUseBoardFaceZ + key: 'originZ0Position', + defaultValue: 0, + label: '垂直原点', + groupBy: 'baseAxios', + component: 'Select', + options: [ + { + value: 0, + label: '台面', + }, + { + value: 1, + label: '板面', + } + ], + style: { + width: '120px' + } + }, + { + key: 'widthSideAxis', + defaultValue: AxisType.X_POS, + label: '水平纵轴坐标轴向', + groupBy: 'axios', + component: 'Select', + options: [ + { + value: 0, + label: 'X轴正', + }, + { + value: 1, + label: 'X轴负', + }, + { + value: 2, + label: 'Y轴正', + }, + { + value: 3, + label: 'Y轴负', + }, + ], + helpMessage: `提示:屏幕显示的上下方向。`, + }, + { + key: 'lengthSideAxis', + defaultValue: AxisType.Y_POS, + label: '水平横轴坐标轴向', + groupBy: 'axios', + helpMessage: `提示:屏幕显示的上下方向。`, + component: 'Select', + options: [ + { + value: 0, + label: 'X轴正', + }, + { + value: 1, + label: 'X轴负', + }, + { + value: 2, + label: 'Y轴正', + }, + { + value: 3, + label: 'Y轴负', + }, + ], + }, + { + key: 'heightAxis', + defaultValue: AxisType.Z_POS, + label: '垂直轴坐标轴向', + groupBy: 'axios', + helpMessage: `提示:向上,默认Z+。`, + component: 'Select', + options: [ + { + value: 4, + label: 'Z轴正', + }, + { + value: 5, + label: 'Z轴负', + } + ], + }, + { + key: 'boardLocation', + defaultValue: 0, + label: '大板', + groupBy: 'position', + helpMessage: `提示:常规开料加工靠档位置。`, + component: 'Select', + options: [ + { + value: 3, + label: '左上角', + }, + { + value: 0, + label: '左下角', + }, + { + value: 1, + label: '右下角', + }, + { + value: 2, + label: '右上角', + }, + ], + }, + { + key: 'boardOffsetY', + defaultValue: 0, + label: '长边偏置', + groupBy: 'position', + helpMessage: `提示:大板工件原点长边方向偏置,用于校准机台坐标,支持正负值,单位mm毫米。`, + component: 'InputNumber', + style: { + width: '120px' + } + }, + { + key: 'boardOffsetX', + defaultValue: 0, + label: '短边偏置', + groupBy: 'position', + helpMessage: `提示:大板工件短边方向原点偏置,用于校准机台坐标,支持正负值,单位mm毫米。`, + component: 'InputNumber', + style: { + width: '120px' + } + }, + { + key: 'exportOrderPathName', + label: 'ZIP压缩包文件名', + groupBy: 'general', + helpMessage: `支持路径(文件夹/目录),如:D:/晨丰开料加工/{0}-{1}-{2}.zip`, + component: 'MultiSelect', + options: convertToLabelValue(zipFileOptionsMap), // getDictOptions(DICT_TYPE.WORK_AREA_COMMON_FILE_TYPE, 'string').reverse(), + style: { + width: '80px' + } + }, + { + key: 'ncFileEncoding', + label: 'NC文件编码', + groupBy: 'general', + helpMessage: `文件编码格式,后续可能会有扩展需要`, + component: 'Select', + options: convertToLabelValue(ncEncodeMap), + style: { + width: '120px' + } + }, + { + key: 'isFilterEmptyLine', + defaultValue: false, + label: '空行过滤', + groupBy: 'NcRowHandle', + helpMessage: '过滤文件头尾、刀具启停等指令多余的空行,默认开启', + component: 'CheckBox', + }, + { + key: 'isNcFileComment', + defaultValue: '', + label: '添加注释信息', + groupBy: 'NcRowHandle', + helpMessage: 'nc添加文件说明、加工说明的注释内容', + component: 'CheckBox', + }, + { + key: 'leaderChar', + defaultValue: '', + label: '注释标识符', + groupBy: 'NcRowHandle', + helpMessage: 'nc指令行,指定起始符号+注释内容,如:“//开料开始,加工刀直径6mm”', + component: 'Input', + }, + { + key: 'isNcLinePrefixEnabled', + defaultValue: false, + label: '空行插入前缀', + groupBy: 'NcRowHandle', + helpMessage: '开启NC每行前缀生效', + component: 'CheckBox', + }, + { + key: 'ncLinePrefix', + defaultValue: '', + label: '前缀', // + groupBy: 'NcRowHandle', + helpMessage: '用于添加NC指令行起始符,支持类似格式N', + component: 'Input', + }, + { + key: 'isNcLineSuffixEnabled', + defaultValue: false, + label: '空行插入后缀', + groupBy: 'NcRowHandle', + helpMessage: '开启NC每行后缀生效', + component: 'CheckBox', + }, + { + key: 'ncLineSuffix', + defaultValue: '', + label: '后缀', // + groupBy: 'NcRowHandle', + helpMessage: '用于添加NC指令行结束符', + component: 'Input', + }, + { + key: 'blockFileName', + defaultValue: '', + label: '文件名', + groupBy: 'fileNameConfig1', + helpMessage: '支持路径(文件夹/目录),如:NC/{10,#3}.nc', + component: 'MultiSelect', + options: convertToLabelValue(smallPlateOptionsMap), + style: { + width: '420px', + marginRight: '50%' + } + }, + { + key: 'blockFileAB', + defaultValue: '', + label: '合并正反面文件名', + groupBy: 'fileNameConfig', + helpMessage: '支持路径(文件夹/目录),如:NC/{10,#3}.nc', + component: 'MultiSelect', + options: convertToLabelValue(smallPlateOptionsMap), + style: { + width: '420px', + marginRight: '50%' + } + }, + // blockFileA + { + key: 'blockFileA', + defaultValue: '', + label: '正面文件名', + groupBy: 'fileNameConfig', + helpMessage: '支持路径(文件夹/目录),如:NC/{10,#3}_Z.nc', + component: 'MultiSelect', + options: convertToLabelValue(smallPlateOptionsMap), + style: { + width: '420px', + marginRight: '50%' + } + }, + { + key: 'blockFileB', + defaultValue: '', + label: '反面文件名', + groupBy: 'fileNameConfig', + helpMessage: '支持路径(文件夹/目录),如:NC/{10,#3}_F.nc', + component: 'MultiSelect', + options: convertToLabelValue(smallPlateOptionsMap), + style: { + width: '420px', + marginRight: '50%' + } + }, + { + key: 'isUseSimpleCode', + defaultValue: false, + label: '使用精简指令', + groupBy: 'orderCode', + helpMessage: `使用精简指令,默认关闭,开启用于支持精简XYZ和F指令`, + component: 'CheckBox', + }, + { + key: 'isSimpleFirstCode', + defaultValue: false, + label: '精简换刀后第一行指令', + groupBy: 'orderCode', + helpMessage: `使用精简指令,默认关闭,开启用于支持精简XYZ和F指令(一般是配合嵌入式计算机控制系统的机台使用,因为存储空间和读取速度限制)。`, + component: 'CheckBox', + }, + { + key: 'reverseArcCode', + defaultValue: false, + label: '反转圆弧指令', + groupBy: 'orderCode', + helpMessage: `提示:(配合坐标系设置项——顺时针圆弧指令G2变为G3,逆时针圆弧指令G3变为G2。)`, + component: 'CheckBox', + }, + { + key: 'isNCPreCode', + defaultValue: false, + label: '代码前置', + groupBy: 'cutCode', + helpMessage: `提示:(插入到NC文件头前。)`, + component: 'CheckBox', + }, + + { + key: 'ncFileHead', + defaultValue: '', + label: '文件头', + groupBy: 'NcOrderAndCode', + helpMessage: `提示:(插入到NC文件头前。)`, + component: 'Textarea', + style: { + width: '220px', + } + }, + { + key: 'ncFileEnd', + defaultValue: '', + label: '文件尾', + groupBy: 'NcOrderAndCode', + helpMessage: `提示:(插入到NC文件尾后。)`, + component: 'Textarea', + style: { + width: '220px', + } + }, + { + key: 'ncMergeConnection', + defaultValue: '', + label: '合并连接', + groupBy: 'NcOrderAndCode', + helpMessage: `提示:(插入到NC文件尾后。)`, + component: 'Textarea', + style: { + width: '220px', + } + }, + { + key: 'NcCodeFreeMove', + defaultValue: 'G0', + label: '空程移动指令', + labelClass: 'NcCodeKeysConfigLabel', + groupBy: 'NcCodeKeysConfig', + helpMessage: `提示:G0或G00指令`, + component: 'Input', + style: { + width: '220px', + }, + + }, + { + key: 'NcCodeLineInterpolation', + defaultValue: 'G1', + label: '直线插补标识', + labelClass: 'NcCodeKeysConfigLabel', + groupBy: 'NcCodeKeysConfig', + helpMessage: `提示:文本,默认“G1”`, + component: 'Input', + style: { + width: '220px', + } + }, + { + key: 'NcCodeClockwiseArcInterpolation', + defaultValue: 'G2', + label: '顺时针圆弧插补标识', + labelClass: 'NcCodeKeysConfigLabel', + groupBy: 'NcCodeKeysConfig', + helpMessage: `提示:文本,默认“G2”`, + component: 'Input', + style: { + width: '220px', + } + }, + { + key: 'NcCodeAnticlockwiseArcInterpolation', + defaultValue: 'G3', + label: '逆时针圆弧插补标识', + groupBy: 'NcCodeKeysConfig', + labelClass: 'NcCodeKeysConfigLabel', + helpMessage: `提示:文本,默认“G3”`, + component: 'Input', + style: { + width: '220px', + } + }, + // { + // key: 'NcCodeAxisX', + // defaultValue: 'Y', + // label: '水平坐标横轴标识', + // groupBy: 'NcCodeKeysConfig', + // labelClass: 'NcCodeKeysConfigLabel', + // helpMessage: `提示:默认“Y”`, + // component: 'Input', + // style: { + // width: '220px', + // } + // }, + // { + // key: 'NcCodeAxisY', + // defaultValue: 'X', + // label: '水平坐标纵轴标识', + // groupBy: 'NcCodeKeysConfig', + // labelClass: 'NcCodeKeysConfigLabel', + // helpMessage: `提示:默认“X”`, + // component: 'Input', + // style: { + // width: '220px', + // } + // }, + // { + // key: 'NcCodeAxisZ', + // defaultValue: 'Z', + // label: '垂直坐标轴标识', + // groupBy: 'NcCodeKeysConfig', + // labelClass: 'NcCodeKeysConfigLabel', + // helpMessage: `提示:默认“Z”`, + // component: 'Input', + // style: { + // width: '220px', + // } + // }, + // { + // key: 'NcCodeSpeed', + // defaultValue: 'F', + // label: '速度标识', + // groupBy: 'NcCodeKeysConfig', + // labelClass: 'NcCodeKeysConfigLabel', + // helpMessage: `提示:默认“F”`, + // component: 'Input', + // style: { + // width: '220px', + // } + // }, + // { + // key: 'NcCodeIncrementAxisX', + // defaultValue: 'J', + // label: '水平坐标横轴增量标识', + // labelClass: 'NcCodeKeysConfigLabel', + // groupBy: 'NcCodeKeysConfig', + // helpMessage: `提示:默认“J”`, + // component: 'Input', + // style: { + // width: '220px', + // } + // }, + // { + // key: 'NcCodeIncrementAxisY', + // defaultValue: 'I', + // label: '水平坐标纵轴增量标识', + // labelClass: 'NcCodeKeysConfigLabel', + // groupBy: 'NcCodeKeysConfig', + // helpMessage: `提示:默认“I”`, + // component: 'Input', + // style: { + // width: '220px', + // } + // }, + // { + // key: 'NcCodeIncrementAxisZ', + // defaultValue: 'K', + // label: '垂直坐标轴增量标识', + // labelClass: 'NcCodeKeysConfigLabel', + // groupBy: 'NcCodeKeysConfig', + // helpMessage: `提示:默认“K”`, + // component: 'Input', + // style: { + // width: '220px', + // } + // }, + { + key: 'decimalPointPrecision', + defaultValue: 0, + label: 'NC小数点位数', + groupBy: '', + helpMessage: `NC文件中数值生成指定位数的小数点`, + }, + { + key: 'fixFloatNumberEndZero', + defaultValue: true, + label: '末尾补零', + groupBy: '', + helpMessage: ``, + }, + { + key: 'intNumberAddDecimalPoint', + defaultValue: true, + label: '整数值末尾加小数点', + groupBy: '', + helpMessage: ``, + }, + { + key: 'helpCutKnifeCode', + defaultValue: '', + label: '辅助开料指令', + groupBy: 'helpCut', + helpMessage: `提示:(辅助开料与正常开料加工指令之间插入的指定指令(关真空吸附、长延时、开真空吸附、短延时))。`, + component: 'Textarea', + style: { + width: '240px', + } + }, + { + key: 'helpCutKnifeCode2', + defaultValue: '', + label: '辅助开料指令2', + groupBy: 'helpCut', + helpMessage: `提示:(辅助开料与正常开料加工指令之间插入的指定指令(关真空吸附、长延时、开真空吸附、短延时))。 + 限制:启用双工位后生效。`, + component: 'Textarea', + style: { + width: '240px', + } + }, + + + + + // { + // key: 'boardFileHeadA', + // defaultValue: '', + // label: '大板NC正(A)面文件头', + // groupBy: '', + // }, + // { + // key: 'boardFileEndA', + // defaultValue: '', + // label: '大板NC正(A)面文件尾', + // groupBy: '', + // }, + // { + // key: 'boardFileHeadB', + // defaultValue: '', + // label: '反面文件头', + // groupBy: '', + // }, + // { + // key: 'boardFileEndB', + // defaultValue: '', + // label: '反面文件尾', + // groupBy: '', + // }, + // { + // key: 'isExportBlockFileB', + // defaultValue: '', + // label: '导出反面文件', + // groupBy: '', + // }, + // { + // key: 'blockNcFileHead', + // defaultValue: '', + // label: '文件头(合并)', + // groupBy: '', + // }, + // { + // key: 'blockNcFileEnd', + // defaultValue: '', + // label: '文件尾(合并)', + // groupBy: '', + // }, + // { + // key: 'isDualStationEnabled', + // defaultValue: false, + // label: '启用双工位', + // groupBy: '', + // }, + // { + // key: 'station2NcFileHeadA', + // defaultValue: '', + // label: '正面文件头(双工位)', + // groupBy: '', + // }, + // { + // key: 'station2NcFileEndA', + // defaultValue: '', + // label: '正面文件尾(双工位)', + // groupBy: '', + // }, + // { + // key: 'station2NcFileHeadB', + // defaultValue: '', + // label: '反面文件头(双工位)', + // groupBy: '', + // }, + // { + // key: 'station2NcFileEndB', + // defaultValue: '', + // label: '反面文件尾(双工位)', + // groupBy: '', + // }, + // { + // key: 'isHelpCut', + // defaultValue: false, + // label: '辅助开料-启用', + // groupBy: '', + // }, + // { + // key: 'loadBoardCode', + // defaultValue: '', + // label: '上料代码', + // groupBy: '', + // }, + // { + // key: 'isLoadBoardBeforeFileHead', + // defaultValue: '', + // label: '上料代码插入到NC文件头前', + // groupBy: '', + // }, + // { + // key: 'leaderChar', + // defaultValue: '', + // label: '注释标识符', + // groupBy: '', + // helpMessage: 'nc指令行,指定起始符号+注释内容,如:“//开料开始,加工刀直径6mm”', + // }, + // { + // key: 'isNcFileComment', + // defaultValue: '', + // label: '添加注释信息', + // groupBy: '', + // helpMessage: 'nc添加文件说明、加工说明的注释内容', + // }, + + // { + // key: 'toolChangeLowerLimitActionCount', + // defaultValue: '', + // label: '延迟换刀下限动作数', + // groupBy: '', + // helpMessage: '', + // }, + // { + // key: 'toolChangeDelayCode', + // defaultValue: '', + // label: '延迟换刀指令', + // groupBy: '', + // helpMessage: '', + // }, + // { + // key: 'isFirstCutBorderInFaceB', + // defaultValue: '', + // label: '先修边', + // groupBy: '', + // helpMessage: '', + // }, + // { + // key: 'isAllowDoubleSplit', + // defaultValue: '', + // label: '开料分刀', + // groupBy: '', + // helpMessage: '开料切割加工,分层切割,步进加工', + // }, + // { + // key: 'isSplitCondition', + // defaultValue: '', + // label: '启用', + // groupBy: '', + // helpMessage: '提示:(启用钻孔分刀加工(啄钻))。', + // }, + // { + // key: 'knifeSplitType', + // defaultValue: '', + // label: '分刀方式', + // groupBy: '', + // helpMessage: '加工的分拆方式', + // }, + // { + // key: 'splitCount', + // defaultValue: 2, + // label: '分刀次数', + // groupBy: '', + // helpMessage: '按指定层数分刀,单位层', + // }, + // { + // key: 'splitDepth', + // defaultValue: 15, + // label: '步进深度', + // groupBy: '', + // helpMessage: '分层切割的每层进刀量,最后一刀小于等于设定值,单位mm毫米', + // }, + // { + // key: 'isModelSplitCondition', + // defaultValue: 15, + // label: '启用', + // groupBy: '', + // helpMessage: '提示:(启用钻孔分刀加工)。', + // }, + // { + // key: 'modelKnifeSplitType', + // defaultValue: 15, + // label: '分刀方式', + // groupBy: '', + // helpMessage: '提示:(按深度——分刀加工时按指定的步进深度值,由浅到深依次生成多个造型刀路;按层数——加工深度按指定层数,等分步进深度生成多个造型刀路。)。', + // }, + // { + // key: 'modelKnifeSplitType', + // defaultValue: 15, + // label: '分刀方式', + // groupBy: '', + // helpMessage: '提示:(按深度——分刀加工时按指定的步进深度值,由浅到深依次生成多个造型刀路;按层数——加工深度按指定层数,等分步进深度生成多个造型刀路。)。', + // }, + // { + // key: 'modelSplitCount', + // defaultValue: 2, + // label: '分刀次数', + // groupBy: '', + // helpMessage: '按指定层数分刀,单位层', + // }, + // { + // key: 'modelSplitDepth', + // defaultValue: 15, + // label: '步进深度', + // groupBy: '', + // helpMessage: '分层切割的每层进刀量,最后一刀小于等于设定值,单位mm毫米', + // }, + + + + + // { + // key: 'isHoleByPosition', + // defaultValue: false, + // label: '排钻按位置加工', + // groupBy: '', + // helpMessage: '用于添加NC指令行结束符', + // }, + // { + // key: 'holeSplitProcessType', + // defaultValue: 0, + // label: '加工方式', + // groupBy: '', + // helpMessage: '回安全点——同一位置相同直径的孔,打完一个深度后,回退到安全距离,再进行下一次打孔动作;退刀刀指定距离——同一位置相同直径的孔,打完一个深度后,回退指定距离后,再进行下一次打孔动作。', + // }, + // { + // key: 'knifeUpSize', + // defaultValue: 2, + // label: '退刀指定距离', + // groupBy: '', + // helpMessage: '退刀指定距离', + // }, + // { + // key: 'holeKnifeSplitType', + // defaultValue: 2, + // label: '分刀方式', + // groupBy: '', + // helpMessage: '提示:(按深度——分刀加工时按指定的步进深度值,由浅到深依次生成多个孔;按层数——加工深度按指定层数,等分步进深度生成多个孔。)。', + // }, + // { + // key: 'throughHoleOneTime', + // defaultValue: true, + // label: '通孔一刀加工', + // groupBy: '', + // helpMessage: '含穿孔(深度大于等于板厚的孔);否,避免刀具对刀误差无法完整打通相关的孔;是,减少反面加工概率', + // }, + // { + // key: 'holeFreeSpeed', + // defaultValue: 0, + // label: '空程速度', + // groupBy: '', + // helpMessage: '提示:(为0时不插入空程动作(G00到板面),直接从安全高度到孔底或预钻孔深度;非0则按指定速度加入空程动作。)。', + // }, + // { + // key: 'preProcessHoleDepth', + // defaultValue: 0, + // label: '预钻深度', + // groupBy: '', + // helpMessage: `提示:(预钻孔深度,单位mm毫米)。 + // 限制:为0时,置灰“预钻孔速度”、“预钻孔延时”、“预钻孔延时指令”。`, + // }, + // { + // key: 'preProcessHoleSpeed', + // defaultValue: 0, + // label: '预钻速度', + // groupBy: '', + // helpMessage: `提示:(预钻孔加工速度,单位mm/min毫米每分钟)。 + // 限制:“初始加工深度”大于0时有效。`, + // }, + // { + // key: 'isCuttingSplitCondition', + // defaultValue: false, + // label: '启用', + // groupBy: '', + // helpMessage: '提示:(启用钻孔分刀加工)。', + // }, + // { + // key: 'cuttingKnifeSplitType', + // defaultValue: 1, + // label: '分刀方式', + // groupBy: '', + // helpMessage: '加工的分拆方式', + // }, + // { + // key: 'cuttingSplitCount', + // defaultValue: 2, + // label: '分刀次数', + // groupBy: '', + // helpMessage: '按指定层数分刀,单位层', + // }, + // { + // key: 'cuttingSplitDepth', + // defaultValue: 15, + // label: '步进深度', + // groupBy: '', + // helpMessage: '分层切割的每层进刀量,最后一刀小于等于设定值,单位mm毫米', + // }, + // { + // key: 'helpCutKnifeDepth', + // defaultValue: 0, + // label: '留底', + // groupBy: '', + // helpMessage: '辅助开料刀路加工深度,是否切透,单位mm毫米', + // }, + // { + // key: 'workStartDistance', + // defaultValue: 30, + // label: '下刀长度', + // groupBy: '', + // helpMessage: `提示:(开料起始进刀距离(板面到台面水平方向距离),单位mm毫米)。 + // 限制:关联校验收刀提前长度。`, + // }, + // { + // key: 'cuttingSplitProcessType', + // defaultValue: 0, + // label: '加工方式', + // groupBy: '', + // helpMessage: `提示:(按板件——逐片板件分层加工;按层——按拆分好的深度由浅到深的先后顺序加工。)。`, + // }, + // { + // key: 'workSpeed', + // defaultValue: 8000, + // label: '速度', + // groupBy: '', + // helpMessage: `G1/G2/G3或G01/G02/G03指令对应F速度值,单位mm/min毫米每分钟`, + // }, + // { + // key: 'workPreDistance', + // defaultValue: 8000, + // label: '提前长度', + // groupBy: '', + // helpMessage: `提示:(下刀点到斜向下刀底部水平距离,单位mm毫米)。 + // 限制:关联校验收刀提前长度。`, + // }, + // { + // key: 'holeSpeed', + // defaultValue: 5000, + // label: '加工速度', + // groupBy: '', + // helpMessage: ``, + // }, + // { + // key: 'workStartSpeed', + // defaultValue: 3000, + // label: '下刀速度', + // groupBy: '', + // helpMessage: `提示:(G1/G2/G3或G01/G02/G03指令对应F速度值,单位mm/min毫米每分钟)。`, + // }, + // { + // key: 'innerCornerDistence', + // defaultValue: 0, + // label: '内转角进弯长度', + // groupBy: '', + // helpMessage: `用于解决内转角进弯速度过快,变向后减速出现进弯与出弯圆弧角加工不到位问题,为0不启用,单位mm毫米`, + // }, + // { + // key: 'innerCornerSpeed', + // defaultValue: 6000, + // label: '内转角速度', + // groupBy: '', + // helpMessage: `内转角减速段加工速度,G1/G2/G3或G01/G02/G03指令对应F速度值,单位mm/min毫米每分钟`, + // }, + // { + // key: 'outerCornerSpeed', + // defaultValue: 6000, + // label: '外转角速度', + // groupBy: '', + // helpMessage: `内转角减速段加工速度,G1/G2/G3或G01/G02/G03指令对应F速度值,单位mm/min毫米每分钟`, + // }, + // { + // key: 'sameBorderSpeed', + // defaultValue: 0, + // label: '共边速度', + // groupBy: '', + // helpMessage: `内转角减速段加工速度,G1/G2/G3或G01/G02/G03指令对应F速度值,单位mm/min毫米每分钟`, + // }, + // { + // key: 'workEndDistace', + // defaultValue: 0, + // label: '共边速度', + // groupBy: '', + // helpMessage: `内转角减速段加工速度,G1/G2/G3或G01/G02/G03指令对应F速度值,单位mm/min毫米每分钟`, + // }, { + // key: 'workEndSpeed', + // defaultValue: 0, + // label: '收刀速度', + // groupBy: '', + // helpMessage: `G1/G2/G3或G01/G02/G03指令对应F速度值,单位mm/min毫米每分钟`, + // }, + + // { + // key: 'arcTurnPolylineLen', + // defaultValue: 0, + // label: '圆弧转多段线', + // groupBy: '', + // helpMessage: `圆弧转多段线刀路最大直线段长度值,用于对接不支持圆弧加工项的协议或机台;0圆弧描述,不转多段线刀路。`, + // }, + + // { + // key: 'arcCode', + // defaultValue: 0, + // label: '圆弧加工指令', + // groupBy: '', + // helpMessage: `提示:(配合坐标系设置项——顺时针圆弧指令G2变为G3,逆时针圆弧指令G3变为G2。)`, + // }, + // { + // key: 'prestartAheadActionCount', + // defaultValue: 0, + // label: '预启动提前动作数', + // groupBy: '', + // helpMessage: `用于多主轴电机(多工序)固定刀具机台换刀加工,提前启动主轴,减少等待时间。提前动作计数说明:1. 空程移动,安全位置水平一个坐标点移动到另一个坐标点,记为一个动作;2. 打孔,安全位置向下-到板面-再到孔底-退刀到安全位置,记为一个动作;3. 拉槽/造型加工,安全位置向下-到凹槽深度-板内加工-对刀到安全位置,记为一个动作。`, + // }, + // { + // key: 'cutBoardBorderB', + // defaultValue: 2, + // label: '反面修边值', + // groupBy: '', + // helpMessage: `修改变更后要求重新优化排版`, + // }, + // { + // key: 'isSameOriginPointPosition', + // defaultValue: false, + // label: '同工位1设置', + // groupBy: '', + // helpMessage: `提示:(“是”——与工位1同样配置(使用工位1配置的水平基准(零点)、垂直基准(零点)、水平横轴坐标轴向、水平纵轴坐标轴向、垂直轴坐标轴向、*多坐标系、*多坐标系配置))。 + // 限制:“是”则置灰工单坐标相关设置项。`, + // }, + // { + // key: 'boardLocation2', + // defaultValue: 0, + // label: '大板定位', + // groupBy: '', + // helpMessage: `提示:常规开料加工靠档位置。`, + // }, + + + // { + // key: 'offsetX_station2', + // defaultValue: 0, + // label: '短边偏移', + // groupBy: '', + // helpMessage: `人工偏移-短边偏移`, + // }, + // { + // key: 'offsetY_station2', + // defaultValue: 0, + // label: '长边偏移', + // groupBy: '', + // helpMessage: `人工偏移-长边偏移`, + // }, + // { + // key: 'offsetX_fromStation1', + // defaultValue: 0, + // label: '短边方向', + // groupBy: '', + // helpMessage: `工位2工件原点-短边方向`, + // }, + // { + // key: 'offsetY_fromStation1', + // defaultValue: 0, + // label: '长边方向', + // groupBy: '', + // helpMessage: `工位2工件原点-长边方向`, + // }, + // { + // key: 'blockOffsetX', + // defaultValue: 0, + // label: '小板短轴偏置', + // groupBy: '', + // helpMessage: `提示:小板工件原点短边方向偏置,用于校准机台坐标,支持正负值,单位mm毫米。`, + // }, + // { + // key: 'blockOffsetY', + // defaultValue: 0, + // label: '小板长轴偏置', + // groupBy: '', + // helpMessage: `提示:小板工件原点长边方向偏置,用于校准机台坐标,支持正负值,单位mm毫米。`, + // }, + // { + // key: 'originPointPosition2', + // defaultValue: 0, + // label: '水平基准(零点)', + // groupBy: '', + // helpMessage: `提示:(加工台面工件原点,坐标XY轴零点位置(X0Y0点))。`, + // }, + // { + // key: 'widthSideAxis2', + // defaultValue: 0, + // label: '水平纵轴坐标轴向', + // groupBy: '', + // helpMessage: `提示:(加工台面工件原点,坐标Z轴零点位置(Z0平面),可选台面、板面)。`, + // }, + // { + // key: 'lengthSideAxis2', + // defaultValue: 0, + // label: '水平横轴坐标轴向', + // groupBy: '', + // helpMessage: `提示:(加工台面工件原点,坐标Z轴零点位置(Z0平面),可选台面、板面)。`, + // }, + + + + // { + // key: 'blockKnifeLineSpacing', + // defaultValue: 0, + // label: '刀路间距', + // groupBy: '', + // helpMessage: ``, + // }, + // { + // key: 'extensionBeforeCutBoardBorder', + // defaultValue: 0, + // label: '刀路前延伸', + // groupBy: '', + // helpMessage: `修边刀路起始前延伸量,用于解决修边不充分问题。`, + // }, + // { + // key: 'extensionAfterCutBoardBorder', + // defaultValue: 0, + // label: '刀路后延伸', + // groupBy: '', + // helpMessage: `修边刀路终止后延伸量,用于解决修边不充分问题。`, + // }, + // { + // key: 'modelSplitProcessType', + // defaultValue: 0, + // label: '加工方式', + // groupBy: '', + // helpMessage: `方式一(按开料顺序)——按开料顺序逐片加工/开料完; + // 方式二(按层加工)——按深度由浅到深逐层加工; + // 方式三(未挖穿项就近加工,挖穿项按开料顺序)——未挖穿层按加工项加工至挖穿前,挖穿的层按开料顺序逐片加工。`, + // }, + // { + // key: 'cutBoardBorderFaceA', + // defaultValue: 0, + // label: '正面修边', + // groupBy: '', + // helpMessage: `正面加工开始前先修边,用于减少大板边缘板件开料阻力造成的跑板问题。`, + // }, + // { + // key: 'processType', + // defaultValue: 0, + // label: '加工方式', + // groupBy: '', + // helpMessage: ` + // 方式一(按开料顺序)——按开料顺序逐片加工/开料完; + // 方式二(按层加工)——按深度由浅到深逐层加工; + // 方式三(未挖穿项就近加工,挖穿项按开料顺序)——未挖穿层按加工项加工至挖穿前,挖穿的层按开料顺序逐片加工。`, + // }, + // { + // key: 'helpCutStyle', + // defaultValue: 0, + // label: '方式', + // groupBy: '', + // helpMessage: `提示:(同刀辅助开料,使用与板材开料刀一样的刀具;小刀辅助开料,使用比正常开料刀直径小的铣刀进行辅助开料)`, + // }, + // { + // key: 'helpCutGap', + // defaultValue: 0, + // label: '外扩', + // groupBy: '', + // helpMessage: `提示:(第一次开料刀路外扩偏移距离,单位mm毫米)`, + // }, + // { + // key: 'helpCutKnifeDiameterMin', + // defaultValue: 0, + // label: '辅助开料刀直径范围(下限)', + // groupBy: '', + // helpMessage: ``, + // }, + // { + // key: 'helpCutKnifeDiameterMax', + // defaultValue: 0, + // label: '辅助开料刀直径范围(上限)', + // groupBy: '', + // helpMessage: ``, + // }, + // { + // key: 'isCutBlockInModelFirst', + // defaultValue: false, + // label: '挖穿板优先开料', + // groupBy: '', + // helpMessage: ``, + // }, + + + // { + // key: 'freeHeight', + // defaultValue: 20, + // label: '垂直安全距离', + // groupBy: '', + // helpMessage: `提示:(空程移动时或停刀位置,Z坐标点到板面距离,单位mm毫米)。`, + // }, + // { + // key: 'freeSpeed', + // defaultValue: 10000, + // label: '空程速度', + // groupBy: '', + // helpMessage: `G0或G00指令对应速度,单位mm/min毫米每分钟`, + // }, + + + + + // { + // key: 'ncLineSuffix', + // defaultValue: 0, + // label: 'NC每行后缀', + // groupBy: '', + // helpMessage: `用于添加NC指令行结束符,如:星辉雕刻机,NC指令行需要以分号“;”结束`, + // }, + // { + // key: 'preCuttingDepth', + // defaultValue: 0, + // label: '预切入深度', + // groupBy: '', + // helpMessage: `提示:(常规造型加工,下刀预切入深度)。`, + // }, +] + + + + +export function convertToLabelValue(obj) { + if (typeof obj !== 'object' || obj === null) + throw new Error('参数必须是对象') + + const entries = Object.entries(obj) + if (entries.length === 0) + return [] + + return entries.map(([label, value]) => ({ label, value })) +} \ No newline at end of file diff --git a/src/processParser/processConfig/device2/parser2.ts b/src/processParser/processConfig/device2/parser2.ts new file mode 100644 index 0000000..dbc2d38 --- /dev/null +++ b/src/processParser/processConfig/device2/parser2.ts @@ -0,0 +1,767 @@ +import { AxisType } from "../../confClass" +import { _knifeType, _type, CodeParams, CodeParamsList, CodeParamsObj, configItem, GCodeAction, ProcessInfo, processServeBase } from "../../confClass"; +import { BoardPosition } from "../../confClass" +import { FileZip } from "../../common/base/ZipFile"; +import { OriginZPosition } from "../../confClass" + +/** 解析器2 */ +export class device2 extends processServeBase { + [key: string]: any; + + /**G代码基类 */ + _Action = new GCodeAction() + /** 刀库 */ + knifeList?: Array<_knifeType> = [] + /** 当前使用的刀具 */ + // usedKnife?: Knife | _knifeType + + /** 暴露给外部的参数 */ + config: configItem[] = [] + /** 板厚 -- 读数据处理的数据 */ + thickness: number = 18 + /** 文件导出工具类 */ + zipFile?: FileZip + + /** 解析器(输出机台)的坐标系基准 x */ + boardLength: number = 2440 + /** 解析器(输出机台)的坐标系基准 y */ + boardWidth: number = 1220 + /** 解析器(输出机台)的坐标系基准 z */ + boardHeight: number = 50 + + /** 水平基准 */ + originPointPosition: BoardPosition = BoardPosition.LEFT_TOP + /** 垂直基准 */ + originZ0Position: OriginZPosition = OriginZPosition.BoardFace + /** 水平纵轴坐标轴向 */ + widthSideAxis: AxisType = AxisType.X_POS + /** 水平横轴坐标轴向 */ + lengthSideAxis: AxisType = AxisType.Y_POS + /** 垂直轴坐标轴向 */ + heightAxis: AxisType = AxisType.Z_POS + /** 大板定位 */ + boardLocation: BoardPosition = BoardPosition.LEFT_BOTTOM + /** 大板长轴偏置 */ + boardOffsetY: number = 0 + /** 大板短轴偏置 */ + boardOffsetX: number = 0 + /** 导出文件 保留小数点位数 */ + decimalPointPrecision: number = 3 + /** 末尾补零 */ + fixFloatNumberEndZero: boolean = true + /** 整数值末尾加小数点 */ + intNumberAddDecimalPoint: boolean = true + /** 辅助开料指令 */ + helpCutKnifeCode: string = '' + /** 辅助开料指令2 */ + helpCutKnifeCode2: string = '' + constructor() { + super() + this.knifeList = [] + // this.knifeList.push(knifeData) + // this.knifeList.push(knifeData1) + } + /**文件头 */ + FSTART: _type = { + F1: `G54 G90\n`, + F2: `G53 G90\nM03\n`, + } + /** 换刀 */ + T: _type = { + T6: `T6 \nG43 H6\n`, + Ts6: `T6\n`, + T7: `T7\nG43 H7\n`, + // ** 默认都走这个 调刀指令 若无需调刀则返回 '' 要调刀 则返回刀具的调刀代码 */ + // 20250508 将TD 定义为 + /**根据刀直径(半径)找刀 */ + TD: (params) => { + let code = '' + let _knife: _knifeType | undefined = undefined + + if (params?.diameter) { + _knife = this.knifeList?.find(e => e.diameter == params.diameter) + } + if (_knife != undefined) { + code += this.checkChangeKnifeEndCode(_knife) + this.usedKnife = _knife + // code += _knife.axisStartCode + code += _knife.knifeStartCode + } + return code + }, + /**根据刀名称找刀 换刀 */ + TN: (params) => { + let code = '' + let _knife: any = null + if (params?.knifeName) { + _knife = this.knifeList?.find(e => e.knifeName == params.knifeName) + } + + if (_knife != undefined) { + code += this.checkChangeKnifeEndCode(_knife) + this.usedKnife = _knife + // code += _knife.axisStartCode + code += _knife.knifeStartCode + } + return code + }, + // 停刀 + 停轴 + TE: () => { + let code = '' + if (this.usedKnife) { + code += this.usedKnife.knifeStopCode + '\n' + code += this.usedKnife.axisStopCode + '\n' + } + return code + } + + } + /**主程序 G0 - G3 辅助开料 */ + C: _type = { + KnifeMove: (processItem: CodeParamsObj) => { + let code = '' + /** 获取调刀代码 */ + if (processItem.processItemInfo?.knife) { + let changeKnifeCode = '' + if (processItem.processItemInfo?.knife.diameter) { + changeKnifeCode = this.T?.TD(processItem.processItemInfo?.knife.diameter) + } else if (processItem.processItemInfo?.knife.knifeName) { + changeKnifeCode = this.T?.TN(processItem.processItemInfo?.knife.knifeName) + } + + code += changeKnifeCode + } + + if (processItem.list.length > 0) { + for (const item of processItem.list) { + let point = item + if (processItem.processItemInfo) { + point = this.getXYZ(item, processItem.processItemInfo); + } + + code += `${this.KnifeMove_Arc(point)} \n` + } + } else { + + this.logError('doProcessItem fail,no processItem Data') + } + return code + }, + HelpCutCode1: this.helpCutKnifeCode, + HelpCutCode2: this.helpCutKnifeCode2 + } + /**主程序结束 */ + CE: _type = { + CE1: `M05\n` + } + /**文件尾 */ + FEND: _type = { + FEND1: `M30\n` + } + /** 备注 */ + MARK: _type = { + Mark: (str) => { + let markContent = str + '\n' + let isShowMark = this.isNcFileComment || false + if (isShowMark) { + let leaderChar = this.leaderChar || '' + markContent = `${leaderChar} ${markContent}` + } else { + markContent = '' + } + return markContent + '\n' + }, + BLOCKREMARK1: `//Cut Block`, + } + /** 文件操作指令 */ + FILE: _type = { + START: (zipName) => { + this.initZipFile() + this.setZipFileName(zipName) + }, + ADDFILE: (data) => { + this.setFile(data) + }, + END: () => { + this.fileDownLoad() + } + } + /** 根据分组key 返回配置项 */ + getConfigListByGroupKey(groupKey: string) { + let list = this.config.filter(e => e.groupBy == groupKey) + + return list + } + + //** 使用G0代码 移动刀具 */ + KnifeMove(params: CodeParams) { + let res = this._Action.G0(params) + return res + '\n' + } + /** + * 根据传入的数据 生成 G0 || G1 || G2 || G3 代码 + */ + KnifeMove_Arc(params: CodeParams) { + let res: any = '' + + let dir = params.dir || 0 + if (typeof (dir) == 'string') { + dir = parseInt(dir) + } + + switch (dir) { + case 0: + + if (typeof (this.NcCodeFreeMove) == 'string' && this.NcCodeFreeMove != '') { + params.codeKey = this.NcCodeFreeMove + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + params.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + params.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + params.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + params.fKey = this.NcCodeSpeed + } + + res = this._Action.G0(params) + break; + case 1: + if (typeof (this.NcCodeLineInterpolation) == 'string' && this.NcCodeLineInterpolation != '') { + params.codeKey = this.NcCodeLineInterpolation + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + params.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + params.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + params.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + params.fKey = this.NcCodeSpeed + } + res = this._Action.G1(params) + break; + case 2: + if (typeof (this.NcCodeClockwiseArcInterpolation) == 'string' && this.NcCodeClockwiseArcInterpolation != '') { + params.codeKey = this.NcCodeClockwiseArcInterpolation + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + params.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + params.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + params.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + params.fKey = this.NcCodeSpeed + } + + if (typeof (this.NcCodeIncrementAxisX) == 'string' && this.NcCodeIncrementAxisX != '') { + params.iKey = this.NcCodeIncrementAxisX + } + if (typeof (this.NcCodeIncrementAxisY) == 'string' && this.NcCodeIncrementAxisY != '') { + params.jKey = this.NcCodeIncrementAxisY + } + if (typeof (this.NcCodeIncrementAxisZ) == 'string' && this.NcCodeIncrementAxisZ != '') { + params.kKey = this.NcCodeIncrementAxisZ + } + res = this._Action.G2(params) + break; + case 3: + if (typeof (this.NcCodeAnticlockwiseArcInterpolation) == 'string' && this.NcCodeAnticlockwiseArcInterpolation != '') { + params.codeKey = this.NcCodeAnticlockwiseArcInterpolation + } + if (typeof (this.NcCodeAxisX) == 'string' && this.NcCodeAxisX != '') { + params.xKey = this.NcCodeAxisX + } + if (typeof (this.NcCodeAxisY) == 'string' && this.NcCodeAxisY != '') { + params.yKey = this.NcCodeAxisY + } + if (typeof (this.NcCodeAxisZ) == 'string' && this.NcCodeAxisZ != '') { + params.zKey = this.NcCodeAxisZ + } + if (typeof (this.NcCodeSpeed) == 'string' && this.NcCodeSpeed != '') { + params.fKey = this.NcCodeSpeed + } + + if (typeof (this.NcCodeIncrementAxisX) == 'string' && this.NcCodeIncrementAxisX != '') { + params.iKey = this.NcCodeIncrementAxisX + } + if (typeof (this.NcCodeIncrementAxisY) == 'string' && this.NcCodeIncrementAxisY != '') { + params.jKey = this.NcCodeIncrementAxisY + } + if (typeof (this.NcCodeIncrementAxisZ) == 'string' && this.NcCodeIncrementAxisZ != '') { + params.kKey = this.NcCodeIncrementAxisZ + } + res = this._Action.G3(params) + break; + default: + res = '' + break; + } + + return res + } + /** 换刀指令 -- + * + * 因为设计的问题 + * 现在配置界面会直接配置换刀代码 + * + * + * 配置数据读取 + * @param str: 刀具名 + */ + KnifeChange(str: String) { + let res: any = null + if (str != '') { + res = this._Action.M06(str) + } + return res + } + /** 开始指令 + * 因为设计的问题 + * 相关配置从传入配置中读取 + */ + startCode() { + let res: any = null + /** 文件头 */ + res = 'codeName\n' + /** 轴启动 */ + res += this._Action.M03(18000) + + /** 刀启动 */ + res = this._Action.M06('T1') + + /** */ + return res + } + /** 结束指令 + * 因为设计的问题 + * 相关配置从传入配置中读取 + */ + endCode() { + let res: any = null + + /**刀停止 */ + + /** 轴停止 */ + res = this._Action.M05() + + return res + } + + /** 处理空行过滤 */ + handleEmptyLine(code) { + let arr = code.split('\n') + let newArr = arr.filter(e => e != '') + newArr = newArr.map(e => { + return e + '\n' + }) + + let newCode = newArr.join('') + return newCode + } + /** 空行插入前缀 */ + handleEmptyLinePreFix(code) { + let arr = code.split('\n') + let newArr = arr.map(e => { + if (e != '') { + return e + } else { + return `${this.ncLinePrefix} ${e}\n` + } + }) + + let newCode = newArr.join('\n') + return newCode + } + /** 空行插入后缀 */ + handleEmptyLineSuffix(code) { + let arr = code.split('\n') + let newArr = arr.map(e => { + if (e != '') { + return e + } else { + return `${e} ${this.ncLineSuffix}\n` + } + }) + + let newCode = newArr.join('\n') + return newCode + } + /** 精简指令 */ + handleSimpleCode(code) { + let arr = code.split('\n') + let objArr = arr.map((e, i) => { + let type = (!e.includes('//') && !e.includes('/**') || e.includes('"//')) ? 'code' : 'remark' + let temp = { + code: e, + index: i, + regList: e.match(/[XYZF]([-+]?\d*\.?\d+)/g) || [], + type + } + return temp + }) + let checkLines = objArr.filter(e => e.type == 'code') + + // 校验对象 存键值 + let targetObject = {} + for (const key in checkLines) { + let line = checkLines[key] + if (line.regList.length > 0) { + for (const regVal of line.regList) { + let reg = regVal.match(/([XYZF])([-+]?\d*\.?\d+)/) + let FullVal = reg[0] + let valKey = reg[1] + let val = reg[2] + if (Reflect.has(targetObject, valKey)) { + if (targetObject[valKey] == val) { + // 相同 需要精简操作 + objArr[line.index].code = objArr[line.index].code.replace(FullVal, ``) + } else { + // 不同 更新校验的值 + targetObject[valKey] = val + } + } else { + // 键值 没有 赋给 校验对象 + Reflect.set(targetObject, valKey, val) + } + } + } + } + let newCode = objArr.map(e => e.code).join('\n') + // 这里 数据中莫名其妙多了个空格 处理下 + let list = newCode.split(' ').filter(e => e != '') + newCode = list.join(' ') + return newCode + } + + /** 获取配置列表 */ + getConfigList() { + return this.config + } + //** 设置配置列表 */ + setConfigList(List: configItem[]) { + this.config = [...List] + } + //** 装载配置列表 */ + updateConfigList(List: configItem[]) { + this.config = [...this.config, ...List] + } + /**根据数据导出文件 */ + async exportFile(data: CodeParamsList) { + if (this.zipFile == undefined) { + this.zipFile = new FileZip() + } + + let zipFileName = data.processListInfo?.zipFileName || 'test.zip' + this.zipFile.SetZipFileName(zipFileName) + + let fileNameInfo = data.processListInfo?.fileName + let fileName = '' + if (typeof (fileNameInfo) == 'string') { + fileName = fileNameInfo + } else { + fileName = `${fileNameInfo?.name || 'empty'}.${fileNameInfo?.Suffix || '.txt'}` + } + let str = ''; + for (const item of data.processList) { + if (!item.processItemInfo) { + continue + } + let code = item.processItemInfo.code + let order = item.processItemInfo.order + let params = item.processItemInfo.codeParams + + if (code == 'C') { + params = item + } + str += await this.handleCode(code, order, params) + } + + await this.zipFile.PushFile(fileName, str) + + + await this.zipFile.Download() + } + initZipFile() { + this.zipFile = new FileZip() + } + /** 设置文件名 */ + async setZipFileName(zipName, fileZipObj?: FileZip) { + if (this.zipFile == undefined) { + return + } + let zipFileName = zipName || 'empty.zip' + if (fileZipObj != undefined) { + this.fileZipObj.SetZipFileName(zipFileName) + } else { + this.zipFile.SetZipFileName(zipFileName) + } + + } + /** 给zip文件内添加文件 */ + // async setFile(fileName, content, fileZipObj?: FileZip) { + async setFile(data) { + const { fileName, content, fileZipObj, isBase64, ncFileEncoding } = data + if (this.zipFile == undefined) { + return + } + let _isBase64 = isBase64 || false + let fileCode = ncFileEncoding || 'UTF-8' + if (fileZipObj != undefined) { + await this.fileZipObj.PushFile(fileName, content, _isBase64, fileCode) + } else { + await this.zipFile.PushFile(fileName, content, _isBase64, fileCode) + } + + } + /** 下载zip */ + async fileDownLoad(fileZipObj?: FileZip) { + if (this.zipFile == undefined) { + return + } + if (fileZipObj != undefined) { + await this.fileZipObj.Download() + } else { + await this.zipFile.Download() + } + + } + + /** 处理C代码 */ + handleCode(codeType, codeKey, params?) { + let str = '' + if (typeof (this[codeType][codeKey]) == 'function') { + str += this[codeType][codeKey](params) + } else { + str += this[codeType][codeKey] + } + if (!codeType) { + str = '// 未输入代码,请重新输入\n' + } else if (!codeKey) { + str = '// 未输入指令,请重新输入\n' + let k = Object.keys(this[codeType]) + str += `// 代码【${codeType}】支持的指令为:${k.join(',')}` + } else if (str == 'undefined') { + str = `// 代码【${codeType}】指令【${codeKey}】解析失败,请检查代码指令配置\n` + } + console.log('handleCode', str) + return str + } + /** 更新代码 */ + updateCode(data) { + for (const codeItem of data) { + this.updateOrder(codeItem.value, codeItem.orderArr) + } + } + /** 更新指令 */ + updateOrder(code, orderArr) { + // 更新前 指令的数据集 + let keys = Object.keys(this[code]) + + // 更新指令 + for (const orderItem of orderArr) { + let key = orderItem.name + let value = orderItem.value + Reflect.set(this[code], key, value) + } + + // 移除指令 + let orderKeys = orderArr.map(e => e.name) + + for (const key of keys) { + if (!orderKeys.includes(key)) { + if (typeof (this[code][key]) != 'function') { + Reflect.deleteProperty(this[code], key) + } + } + } + } + /** 添加备注 */ + blockRemark(params?) { + let str = `//Cut Block Id=${params.boardId} No=${params.blockNo} W=${params.width} L=${params.length}\n` + return str + } + /** */ + getFileHead(params?) { + let str = `//根据参数生成文件头\n ${params}\n` + return str + } + getRealPoints(list: CodeParams[]) { + let newList = [...list] + for (let point of newList) { + point = this.getRealPoint(point) + } + } + getRealPoint(point: CodeParams) { + let newPoint = { ...point } + + return newPoint + } + + /** 内部功能逻辑 换刀时判断是否需要 上一把刀的停止代码 */ + checkChangeKnifeEndCode(knife: _knifeType) { + let code = ''; + /** true 需要 输出停刀代码 false 不需要 */ + let flag = false + // 必须要有刀 + if (this.usedKnife) { + let keys = Object.keys(knife) + for (const key of keys) { + if (knife[key] != this.usedKnife[key]) { + flag = true + continue + } + } + } + if (flag) { + code += this.T.TE() + } + return code; + } + /** + * + * @param point 加工项的点 + * @param processItemInfo 加工项的信息 水平基准、垂直基准、轴方向(x、y、z),板件方向(x、y、z) + * // 这里加工项的点数据 都是经过数据处理的 假定这里拿到的数据都是基于左上角 台面 + * + * @returns 实际加工项的点 + */ + getXYZ(point: CodeParams, processItemInfo: ProcessInfo): CodeParams { + let newPoint: any = {} + for (const key in point) { + if (point[key] != undefined) { + Reflect.set(newPoint, key, parseFloat(point[key])) + } + } + /** 有2个部分 + * 一个是基于机台和板件的转换 依据板件定位 + * 另外一个是基于板件和加工项的转换 依据板件长高方向*/ + switch (this.originZ0Position) { + case 0: + // 台面 不操作 + break; + case 1: + // 板面 Z坐标需要转换 + newPoint.z = newPoint.z - this.thickness + break; + default: + break; + } + + /** step 先转换板件的位置 */ + // 大板定位 不同 根据不同的定位点修改 + + // processItemInfo + switch (this.boardLocation) { + case BoardPosition.LEFT_TOP: + // 不操作 + newPoint = this.changeXYZAxiosSide(newPoint) + break; + case BoardPosition.LEFT_BOTTOM: + // 左下角 x坐标要转换 + newPoint.x = newPoint.x + this.boardWidth - processItemInfo.block.cutWidth //400 + newPoint = this.changeXYZAxiosSide(newPoint) + break; + case BoardPosition.RIGHT_TOP: + // 右上角 y坐标要转换 + newPoint.y = newPoint.y + this.boardLength - processItemInfo.block.cutLength // 600 + newPoint = this.changeXYZAxiosSide(newPoint) + break; + case BoardPosition.RIGHT_BOTTOM: + // 右下角 xy 坐标要转换 + newPoint.x = newPoint.x + this.boardWidth - processItemInfo.block.cutWidth + newPoint.y = newPoint.y + this.boardLength - processItemInfo.block.cutLength + newPoint = this.changeXYZAxiosSide(newPoint) + break; + default: + break; + } + + + + + // 这里做 数值的小数点处理 + for (const key in newPoint) { + if (['x', 'y', 'z', 'r', 'i', 'j', 'k'].includes(key)) { + let isTofix = false + if (this.fixFloatNumberEndZero == true) { + // 末尾补零 + isTofix = true + } else if (this.intNumberAddDecimalPoint == true) { + // 整数值末尾加小数点 + if (Number.isInteger(newPoint[key])) { + isTofix = true + } + } + if (isTofix) { + newPoint[key] = parseFloat(newPoint[key]).toFixed(this.decimalPointPrecision) + } + } + } + + + return newPoint + } + /** 根据 轴向变更坐标 */ + changeXYZAxiosSide(point: CodeParams) { + let newPoint: any = {} + for (const key in point) { + if (point[key] != undefined) { + Reflect.set(newPoint, key, parseFloat(point[key])) + } + } + let width = this.boardWidth + let length = this.boardLength + let height = this.boardHeight + + + if (this.widthSideAxis == AxisType.X_POS && this.lengthSideAxis == AxisType.Y_POS) { + // 默认 为 X = x 正 Y = y 正 不操作 + } else if (this.widthSideAxis == AxisType.Y_POS && this.lengthSideAxis == AxisType.X_POS) { + // x = y正 y = x正 X Y坐标 倒转 + newPoint = { ...newPoint, x: newPoint.y, y: newPoint.x } + } + + else if (this.widthSideAxis == AxisType.X_NEG && this.lengthSideAxis == AxisType.Y_POS) { + // x = x负 y = y正 + newPoint = { ...newPoint, x: newPoint.x - width, y: newPoint.y } + } else if (this.widthSideAxis == AxisType.Y_POS && this.lengthSideAxis == AxisType.X_NEG) { + // x = y正 y = x负 + newPoint = { ...newPoint, x: newPoint.y - width, y: newPoint.x } + } + + else if (this.widthSideAxis == AxisType.X_NEG && this.lengthSideAxis == AxisType.Y_NEG) { + // x = x负 y = y负 + newPoint = { ...newPoint, x: newPoint.x - width, y: newPoint.y - length } + } else if (this.widthSideAxis == AxisType.Y_NEG && this.lengthSideAxis == AxisType.X_NEG) { + // x = y负 y = x负 + newPoint = { ...newPoint, x: newPoint.y - width, y: newPoint.x - length } + } + + else if (this.widthSideAxis == AxisType.X_POS && this.lengthSideAxis == AxisType.Y_NEG) { + // x = x正 y = y负 + newPoint = { ...newPoint, x: newPoint.x, y: newPoint.y - length } + } else if (this.widthSideAxis == AxisType.Y_NEG && this.lengthSideAxis == AxisType.X_POS) { + // x = y负 y = x正 + newPoint = { ...newPoint, x: newPoint.y, y: newPoint.x - length } + } + + if (this.heightAxis == AxisType.Z_NEG) { + // Z轴负 + newPoint = { ...newPoint, z: newPoint.z - height } + } + + return newPoint + } +} \ No newline at end of file diff --git a/src/processParser/readme.md b/src/processParser/readme.md new file mode 100644 index 0000000..9a518a2 --- /dev/null +++ b/src/processParser/readme.md @@ -0,0 +1,23 @@ +# 解析器说明 + +## 解析器接收数据 生成加工文件 +·数据说明 + 1、刀路描述 + 2、调用的指令 + 3、加工项附带的信息(加工项所在板件信息和所在订单信息) + 4、刀具信息 + +### 数据传输思考 +1、文件头 + +2、调刀代码 ----有调刀逻辑 + +3、主程序 + +4、主程序结束代码 + +5、文件尾 + + + +## 解析器包含坐标转换功能 diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..729352c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,115 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "libReplacement": true, /* Enable lib replacement. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + "rootDir": "./src", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./dist", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "include": ["src/**/*"], + "exclude": ["node_modules"] +}