Task 6 of the whole-job engine API: adapt the public NestRequest/NestRunner/
NestResponse surface to delegate to the whole-job runner instead of a manual
quantity loop.
- NestRequest: optional explicit Plates stock list (null keeps the legacy
unlimited SheetSize fallback; empty list means no available stock),
optional per-part Id (derived as part-{index} when absent), and an explicit
PlacementStrategy that takes precedence over the legacy Strategy.
- NestRequestPlate: one physical-stock type (id, size, quantity, spacing,
quadrant).
- NestRunner: imports each DXF once, propagates priority/rotation constraints,
runs a single NestJobRunner solve, materializes ID/pose placements exactly
once, and reports aggregate utilization as total placed part area over total
physical sheet area.
- NestResponse: exposes status, stop reason, part fulfillment, stock usage,
and plate-to-stock mapping; .nestquote save/load gains a schema version and
reports completion as unknown for old archives lacking fulfillment metadata.
- Tests: extend the Api request/runner/persistence suites for legacy SheetSize,
explicit mixed finite stock, stock exhaustion, weighted utilization, old
archive loading, and new-archive round trips.
Verification: cross-compiles clean on net8.0-windows (Linux). The Api tests
require a Windows runner (net8.0-windows) and are NOT executed here; the
delegated engine logic is covered by the 70-test net8.0 Engine.Tests suite
(committed in Task 5). Windows runtime verification remains outstanding.
24 lines
1.1 KiB
C#
24 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest.Api;
|
|
|
|
public class NestRequest
|
|
{
|
|
public IReadOnlyList<NestRequestPart> Parts { get; init; } = [];
|
|
/// <summary>
|
|
/// Explicit available physical stock. Null keeps the legacy unlimited SheetSize fallback;
|
|
/// an empty list deliberately means no stock is available.
|
|
/// </summary>
|
|
public IReadOnlyList<NestRequestPlate> Plates { get; init; }
|
|
public Size SheetSize { get; init; } = new(60, 120);
|
|
/// <summary>Built-in whole-job placement strategy. Explicit values take precedence over legacy Strategy.</summary>
|
|
public string PlacementStrategy { get; init; } = "Default";
|
|
public string Material { get; init; } = "Steel, A1011 HR";
|
|
public double Thickness { get; init; } = 0.06;
|
|
public double Spacing { get; init; } = 0.1;
|
|
/// <summary>Legacy compatibility setting; Auto maps to the Default whole-job strategy.</summary>
|
|
public NestStrategy Strategy { get; init; } = NestStrategy.Auto;
|
|
public CutParameters Cutting { get; init; } = CutParameters.Default;
|
|
}
|