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:
@@ -128,13 +128,14 @@ namespace OpenNest
|
||||
}
|
||||
}
|
||||
|
||||
// Deduct placed quantities from original items.
|
||||
// Deduct placed quantities from original items by drawing reference.
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.Quantity <= 0)
|
||||
continue;
|
||||
|
||||
var placed = allParts.Count(p => p.BaseDrawing.Name == item.Drawing.Name);
|
||||
var placed = allParts.Count(p =>
|
||||
ReferenceEquals(p.BaseDrawing, item.Drawing));
|
||||
item.Quantity = System.Math.Max(0, item.Quantity - placed);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user