!1329 优化:用拆单尺寸判断超长板

pull/1329/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 6c25ea72a5
commit a4f31732e8

@ -126,32 +126,19 @@ export class ErpParseData
block.SealedRight = this.GetNumberBit(Number(entity.BoardProcessOption.sealedRight), 3); //封边右
}
sealingMap.set(entity, boardData.sealing);
let spliteWidth = Number(boardData.info.spliteWidth || '0'); //拆单宽
block.SpliteWidth = this.GetNumberBit(spliteWidth, 3);
let spliteHeight = Number(boardData.info.spliteHeight || '0'); //拆单高
block.SpliteHeight = this.GetNumberBit(spliteHeight, 3);
let spliteThickness = Number(boardData.info.spliteThickness || '0'); //拆单厚
block.SpliteThickness = this.GetNumberBit(spliteThickness, 3);
//板大小
if (spliteWidth > 0)
let splitSize = Production.GetSpiteSize(entity);
if (splitSize)
{
block.Width = this.GetNumberBit(spliteWidth, 3);
block.SpliteWidth = this.GetNumberBit(splitSize.spliteWidth, 3);
block.SpliteHeight = this.GetNumberBit(splitSize.spliteHeight, 3);
block.SpliteThickness = this.GetNumberBit(splitSize.spliteThickness, 3);
block.Width = block.SpliteWidth;
block.Height = block.SpliteHeight;
block.Thickness = block.SpliteThickness;
} else
{
block.Width = this.GetNumberBit(entity.Width, 3);
}
if (spliteHeight > 0)
{
block.Height = this.GetNumberBit(spliteHeight, 3);
} else
{
block.Height = this.GetNumberBit(entity.Height, 3);
}
if (spliteThickness > 0)
{
block.Thickness = this.GetNumberBit(spliteThickness, 3);
} else
{
block.Thickness = this.GetNumberBit(entity.Thickness, 3);
}
block.Area = this.GetNumberBit(block.Width * block.Height / 1000 / 1000, 3); // 面积

@ -1,5 +1,6 @@
import { app, ApplicationService } from "../ApplicationServices/Application";
import { userConfig } from "../Editor/UserConfig";
import { Production } from "../Production/Product";
import { AppConfirm } from "../UI/Components/Common/Confirm";
import { LinesType } from "../UI/Store/BoardInterface";
import { CADObject } from "./CADObject";
@ -70,16 +71,25 @@ const ALL_LINES_NAMES = ["正纹", "反纹", "可翻转"];
export function BoardIsLong(br: Board, lines = br.BoardProcessOption.lines): boolean
{
let spliteSize = Production.GetSpiteSize(br);
let height = br.Height;
let width = br.Width;
if (spliteSize)
{
height = spliteSize.spliteHeight;
width = spliteSize.spliteWidth;
}
const maxWidth = userConfig.maxSize.width - userConfig.chaidanOption.duanXiuBian;
const maxHeight = userConfig.maxSize.height - userConfig.chaidanOption.changXiuBian;
if (lines === LinesType.Positive)
return br.Height > maxHeight || br.Width > maxWidth;
return height > maxHeight || width > maxWidth;
else if (lines === LinesType.Reverse)
return br.Height > maxWidth || br.Width > maxHeight;
return height > maxWidth || width > maxHeight;
else
return Math.max(br.Height, br.Width) > maxHeight
|| Math.min(br.Height, br.Width) > maxWidth;
return Math.max(height, width) > maxHeight
|| Math.min(height, width) > maxWidth;
}
const MinWidth = 5;

Loading…
Cancel
Save