From a4f31732e823313375c235696e413db72859b823 Mon Sep 17 00:00:00 2001 From: ZoeLeeFZ Date: Fri, 11 Dec 2020 10:51:52 +0800 Subject: [PATCH] =?UTF-8?q?!1329=20=E4=BC=98=E5=8C=96:=E7=94=A8=E6=8B=86?= =?UTF-8?q?=E5=8D=95=E5=B0=BA=E5=AF=B8=E5=88=A4=E6=96=AD=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/Erp/ParseData.ts | 29 +++++++---------------- src/DatabaseServices/BoardLinesReactor.ts | 18 ++++++++++---- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/Add-on/Erp/ParseData.ts b/src/Add-on/Erp/ParseData.ts index 2892bb80a..9db29e707 100644 --- a/src/Add-on/Erp/ParseData.ts +++ b/src/Add-on/Erp/ParseData.ts @@ -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); // 面积 diff --git a/src/DatabaseServices/BoardLinesReactor.ts b/src/DatabaseServices/BoardLinesReactor.ts index 19895c000..b85ecf913 100644 --- a/src/DatabaseServices/BoardLinesReactor.ts +++ b/src/DatabaseServices/BoardLinesReactor.ts @@ -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;