feat: add Assign Lead-ins button to EditNestForm toolbar
Adds a text-only toolbar button to the Plates tab that opens the CuttingParametersForm, saves the chosen parameters on the plate, and runs LeadInAssigner with LeftSideSequencer to auto-assign lead-ins. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using OpenNest.CNC.CuttingStrategy;
|
||||
using OpenNest.Collections;
|
||||
using OpenNest.Controls;
|
||||
using OpenNest.Engine;
|
||||
using OpenNest.Engine.Sequencing;
|
||||
using OpenNest.IO;
|
||||
using OpenNest.Math;
|
||||
@@ -711,6 +712,32 @@ namespace OpenNest.Forms
|
||||
CalculateCurrentPlateCutTime();
|
||||
}
|
||||
|
||||
private void AssignLeadIns_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (PlateView?.Plate == null)
|
||||
return;
|
||||
|
||||
var plate = PlateView.Plate;
|
||||
|
||||
using var form = new CuttingParametersForm();
|
||||
if (plate.CuttingParameters != null)
|
||||
form.Parameters = plate.CuttingParameters;
|
||||
|
||||
if (form.ShowDialog(this) != DialogResult.OK)
|
||||
return;
|
||||
|
||||
var parameters = form.BuildParameters();
|
||||
plate.CuttingParameters = parameters;
|
||||
|
||||
var assigner = new LeadInAssigner
|
||||
{
|
||||
Sequencer = new LeftSideSequencer()
|
||||
};
|
||||
assigner.Assign(plate);
|
||||
|
||||
PlateView.Invalidate();
|
||||
}
|
||||
|
||||
private void ImportDrawings_Click(object sender, EventArgs e)
|
||||
{
|
||||
Import();
|
||||
|
||||
Reference in New Issue
Block a user