refactor: move material and thickness from Plate to Nest
Material and thickness are properties of the nest (all plates share the same material/gauge), not individual plates. This moves them to the Nest class, removes them from Plate and PlateSettings, and updates the UI so EditNestInfoForm has a material field while EditPlateForm no longer shows thickness. The nest file format gains top-level thickness/material fields with backward-compatible reading from PlateDefaults for old files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -33,8 +33,8 @@ namespace OpenNest.Mcp.Tools
|
||||
sb.AppendLine($"Plate {plateIndex}:");
|
||||
sb.AppendLine($" Size: {plate.Size.Width:F1} x {plate.Size.Length:F1}");
|
||||
sb.AppendLine($" Quadrant: {plate.Quadrant}");
|
||||
sb.AppendLine($" Thickness: {plate.Thickness:F2}");
|
||||
sb.AppendLine($" Material: {plate.Material.Name}");
|
||||
sb.AppendLine($" Thickness: {_session.Nest?.Thickness:F2}");
|
||||
sb.AppendLine($" Material: {_session.Nest?.Material?.Name}");
|
||||
sb.AppendLine($" Part spacing: {plate.PartSpacing:F2}");
|
||||
sb.AppendLine($" Edge spacing: L={plate.EdgeSpacing.Left:F2} B={plate.EdgeSpacing.Bottom:F2} R={plate.EdgeSpacing.Right:F2} T={plate.EdgeSpacing.Top:F2}");
|
||||
sb.AppendLine($" Work area: {work.X:F1},{work.Y:F1} {work.Width:F1}x{work.Length:F1}");
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace OpenNest.Mcp.Tools
|
||||
plate.Quadrant = quadrant;
|
||||
plate.Quantity = 1;
|
||||
|
||||
if (!string.IsNullOrEmpty(material))
|
||||
plate.Material.Name = material;
|
||||
if (!string.IsNullOrEmpty(material) && _session.Nest != null)
|
||||
_session.Nest.Material = new Material(material);
|
||||
|
||||
_session.Plates.Add(plate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user