diff --git a/OpenNest/Forms/BomImportForm.cs b/OpenNest/Forms/BomImportForm.cs index 673104d..b172622 100644 --- a/OpenNest/Forms/BomImportForm.cs +++ b/OpenNest/Forms/BomImportForm.cs @@ -18,7 +18,6 @@ namespace OpenNest.Forms private readonly BindingList _parts; private Dictionary _groupSettings; private NestDefaults _defaults; - private ClampSettings _clamps; public Form MdiParentForm { get; set; } @@ -31,7 +30,6 @@ namespace OpenNest.Forms dgvParts.DataSource = _parts; _groupSettings = new Dictionary(); _defaults = MainForm.LoadSavedNestDefaults(out _); - _clamps = MainForm.LoadSavedClampSettings(out _); ApplyDefaults(); } @@ -412,6 +410,8 @@ namespace OpenNest.Forms var jobName = txtJobName.Text.Trim(); var nestsCreated = 0; var importErrors = new List(); + // Read when the nests are created, warning (once per session) like New does. + var clamps = MainForm.LoadClampSettings(this); foreach (var group in groups) { @@ -437,7 +437,7 @@ namespace OpenNest.Forms { // As New does: saved defaults, then the machine clamps in those units. _defaults.ApplyTo(nest); - _clamps.ApplyToNewNest(nest); + clamps.ApplyToNewNest(nest); } ); importErrors.AddRange(result.Errors); diff --git a/OpenNest/Forms/ClampsForm.cs b/OpenNest/Forms/ClampsForm.cs index 8143d76..ad3dbf8 100644 --- a/OpenNest/Forms/ClampsForm.cs +++ b/OpenNest/Forms/ClampsForm.cs @@ -63,9 +63,10 @@ public sealed class ClampsForm : Form MaximumSize = new Size(450, 0), Padding = new Padding(0, 0, 0, 8), Text = - "Fixed clamps along the plate edge through the origin. Parts and nesting keep " - + "clear of each clamp by the plate's bottom edge spacing. Clamps that do not " - + "reach a shorter plate are left off it.", + "Fixed clamps along the plate edge through the origin. Auto Nest keeps parts " + + "clear of each clamp by the plate's bottom edge spacing; clamps that do not " + + "reach a shorter plate are left off it. Interactive fill and push, the " + + "overlap check and cutoffs do not avoid clamps yet.", } ); diff --git a/OpenNest/Forms/MainForm.cs b/OpenNest/Forms/MainForm.cs index b44101f..5111cb4 100644 --- a/OpenNest/Forms/MainForm.cs +++ b/OpenNest/Forms/MainForm.cs @@ -198,16 +198,16 @@ namespace OpenNest.Forms var nest = new Nest(); LoadNestDefaults().ApplyTo(nest); // After the defaults so the rail is converted to the new nest's units. - LoadClampSettings().ApplyToNewNest(nest); + LoadClampSettings(this).ApplyToNewNest(nest); return nest; } /// - /// Loads the machine clamp settings (see ); an + /// Loads the machine clamp settings for creating new nests (New, BOM import); an /// unreadable or partly invalid file warns once per session, because the new nest's /// clamps may not match the machine. /// - private ClampSettings LoadClampSettings() + internal static ClampSettings LoadClampSettings(IWin32Window owner) { var settings = LoadSavedClampSettings(out var status); @@ -222,6 +222,7 @@ namespace OpenNest.Forms ? "could not be read, so new nests have no clamps" : "has invalid values that were ignored, so new nests may be missing clamps"; MessageBox.Show( + owner, $"The clamp settings file {problem}:\n{ClampSettings.DefaultPath}\n\nCheck the clamps in Nest > Clamps and use Save as Machine Defaults to rewrite the file.", "Clamps", MessageBoxButtons.OK, @@ -231,7 +232,7 @@ namespace OpenNest.Forms return settings; } - private bool clampSettingsWarned; + private static bool clampSettingsWarned; /// The single desktop entry point for the persisted machine clamp settings. internal static ClampSettings LoadSavedClampSettings(out ClampSettingsStatus status) =>