From 73a02cf30947c0808e326fd617bb8c68291f81b9 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Thu, 29 Oct 2026 19:07:34 -0400 Subject: [PATCH] feat(avalonia): run Auto Nest from the Nest menu and toolbar Auto Nest nests the remaining quantities on sheets like the shown plate with the saved engine selection (plug-ins loaded as in the desktop app), solving off the UI thread with shared progress text in the status bar. The button becomes Stop, which discards the whole proposal; Open is refused while it runs. A refused result changes nothing and says why. --auto-nest runs it on the opened nest before --snapshot renders, and the snapshot now writes the status line to .txt for headless checks. --- OpenNest.Avalonia/App.axaml.cs | 5 +- OpenNest.Avalonia/MainWindow.axaml | 8 +- OpenNest.Avalonia/MainWindow.axaml.cs | 116 +++++++++++++++++++- OpenNest.Desktop/Properties/AssemblyInfo.cs | 4 +- 4 files changed, 128 insertions(+), 5 deletions(-) diff --git a/OpenNest.Avalonia/App.axaml.cs b/OpenNest.Avalonia/App.axaml.cs index 2c1597ab..5716015f 100644 --- a/OpenNest.Avalonia/App.axaml.cs +++ b/OpenNest.Avalonia/App.axaml.cs @@ -17,7 +17,10 @@ namespace OpenNest.Avalonia var args = desktop.Args ?? System.Array.Empty(); if (args.Length > 0) window.OpenNest(args[0]); - // --snapshot [plate]: render the window to an image and exit, for checking the drawing. + // --auto-nest: run Auto Nest on the opened nest (with --snapshot, before rendering). + if (System.Array.IndexOf(args, "--auto-nest") >= 0) + window.AutoNestOnOpen(); + // --snapshot [plate]: render the window to an image (status line in .txt) and exit. var snapshot = System.Array.IndexOf(args, "--snapshot"); if (snapshot >= 0 && snapshot + 1 < args.Length) window.SaveSnapshotAndClose(args[snapshot + 1], diff --git a/OpenNest.Avalonia/MainWindow.axaml b/OpenNest.Avalonia/MainWindow.axaml index e20918a4..ad0b7284 100644 --- a/OpenNest.Avalonia/MainWindow.axaml +++ b/OpenNest.Avalonia/MainWindow.axaml @@ -8,10 +8,13 @@ - + + + + @@ -21,10 +24,11 @@ -