Files
OpenNest/OpenNest.Desktop/Forms/PlateWorkGuard.cs
T
ajandClaude Opus 5.5 021af04222 feat(desktop): share the status bar text, machine list and plate-work guard
MainStatusText words the main window's location, machine, material,
utilization and version labels as WinForms does, with the labels'
tooltips and the StatusBarLocationFollowsMouse setting both apps keep.
MachineMenu lists the machines for Nest > Machine and the machine label
(by name, the nest's checked, one no longer on file checked and
disabled), and MachineSettingsSource.ApplyMachine assigns one with its
support grid, cut-off defaults and spacing. PlateWorkGuard holds the
"Finish or cancel the current nesting or plate action first." check.
The WinForms main window delegates to them unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:10:34 -05:00

22 lines
965 B
C#

using System.Collections.Generic;
using System.Linq;
using OpenNest.Desktop.Interaction;
namespace OpenNest.Forms
{
/// <summary>
/// The guard for plate commands (WinForms IsPlateWorkBusy): a running nesting job, or a
/// busy active tool on any view of the nest. The Select tool counts as busy while anything
/// is selected, as the WinForms select action does.
/// </summary>
public static class PlateWorkGuard
{
/// <summary>What a refused plate command tells the user.</summary>
public const string BusyMessage = "Finish or cancel the current nesting or plate action first.";
/// <summary>Whether a plate command must wait: <paramref name="jobRunning"/>, or a busy tool among <paramref name="tools"/>.</summary>
public static bool IsBusy(bool jobRunning, IEnumerable<PlateTool> tools) =>
jobRunning || (tools ?? Enumerable.Empty<PlateTool>()).Any(tool => tool?.IsBusy == true);
}
}