fix(engine): isolate job identity and engine selection
Replace name-based quantity deduction with reference-based drawing identity in the engine paths the whole-job runner reaches (NestEngineBase fill/pack, StripNestEngine deduction, RemnantFiller ledger, IterativeShrinkFiller leftovers). Add instance-scoped PlateNesterFactory that resolves built-in strategies without touching the global NestEngineRegistry. Add identity and engine-selection tests. 44 net8.0 tests pass in Debug and Release; no new warnings.
This commit is contained in:
@@ -113,11 +113,11 @@ namespace OpenNest
|
||||
{
|
||||
allParts.AddRange(fillParts);
|
||||
|
||||
// Deduct placed quantities
|
||||
// Deduct placed quantities by drawing reference, not name.
|
||||
foreach (var item in fillItems)
|
||||
{
|
||||
var placed = fillParts.Count(p =>
|
||||
p.BaseDrawing.Name == item.Drawing.Name);
|
||||
ReferenceEquals(p.BaseDrawing, item.Drawing));
|
||||
item.Quantity = System.Math.Max(0, item.Quantity - placed);
|
||||
}
|
||||
|
||||
@@ -147,10 +147,11 @@ namespace OpenNest
|
||||
{
|
||||
allParts.AddRange(packParts);
|
||||
|
||||
// Deduct placed quantities by drawing reference, not name.
|
||||
foreach (var item in regularPackItems)
|
||||
{
|
||||
var placed = packParts.Count(p =>
|
||||
p.BaseDrawing.Name == item.Drawing.Name);
|
||||
ReferenceEquals(p.BaseDrawing, item.Drawing));
|
||||
item.Quantity = System.Math.Max(0, item.Quantity - placed);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user