重构矩形优化处理器字段名,添加优化回调字段

This commit is contained in:
2025-07-29 17:34:42 +08:00
parent 3631af79c2
commit 2d3c09c0b2
4 changed files with 16 additions and 413 deletions

View File

@@ -9,11 +9,11 @@ import { ConfigBase } from "../config";
export interface RectLayoutProcInput {
/** 小板列表 */
blocks: LayoutBlock[];
blocks: RectLayoutBlock[];
/** 余料大板列表,可选,余料大板将会被优先优化,当余料大板被用尽时,则会使用配置中的大板尺寸进行优化 */
scrapBoards?: Array<{
/** 余料大板 */
board: LayoutBoard,
board: RectLayoutBoard,
/** 大板张数 */
count: number;
}>;
@@ -30,14 +30,17 @@ export class RectLayoutProcConfig extends ConfigBase {
doubleSidedFirst: boolean = false;
/** 刀路间隙 */
gap: number = 0;
/** 运行标识 */
/** 运行标识 (其实改成方法更合适*/
_runFlag: 'running' | 'stopped' | 'terminated' = 'running';
/** 当出现优化结果时,进行回调 */
_onMessage?: (e: LayoutResult) => void;
}
export type RectLayoutProcOutput = LayoutResult;
/** 优化小板输入 */
export interface LayoutBlock {
export type RectLayoutProcOutput = never;
/** 矩形优化小板输入 */
export interface RectLayoutBlock {
/** 小板ID */
id: number;
/** 长 */
@@ -56,8 +59,8 @@ export interface LayoutBlock {
isdtwosided?: boolean;
}
/** 优化大板输入 */
export interface LayoutBoard {
/** 矩形优化大板输入 */
export interface RectLayoutBoard {
length: number;
width: number;
}
@@ -95,10 +98,10 @@ export enum HoleType {
/** 布局大板 */
export interface LayoutResultBoard {
id: string;
/** 大板高度 */
boardLength: number;
/** 大板宽度 */
boardWidth: number;
/** 大板高度 */
boardHeight: number;
}
/** 布局小板 */
@@ -108,10 +111,10 @@ export interface LayoutResultBlock {
x: number;
/** y坐标 */
y: number;
/** 高度 */
length: number;
/** 宽度 */
width: number;
/** 高度 */
height: number;
/** 纹路类型 */
waveType: WaveType;
}