mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-12-03 03:09:25 -05:00
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>
This commit is contained in:
1 parent
db18075bec
commit
021af04222
12 files changed
+386
-65
No files matched your search
@@ -218,6 +218,23 @@ public sealed class MachineSettingsSource
|
||||
nest.SetSupportBed(grid.Enabled ? grid.BedFor(nest.Units) : null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nest > Machine: assigns <paramref name="machine"/> with its support grid
|
||||
/// (<see cref="AssignMachine"/>), gives each of <paramref name="cutOffSettings"/> (the nest's
|
||||
/// views) its cut-off defaults and the nest its spacing. Plates' own cutting parameters are
|
||||
/// kept, and of the sheets only an untouched trailing one takes the spacing. The caller
|
||||
/// records it as one nest edit.
|
||||
/// </summary>
|
||||
public void ApplyMachine(Nest nest, MachineConfig machine, PlateManager plates, IEnumerable<CutOffSettings> cutOffSettings)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(nest);
|
||||
ArgumentNullException.ThrowIfNull(plates);
|
||||
AssignMachine(nest, machine);
|
||||
foreach (var settings in cutOffSettings ?? Enumerable.Empty<CutOffSettings>())
|
||||
ApplyCutOffDefaults(settings, nest);
|
||||
plates.ChangePlateDefaults(() => MachineCuttingDefaults.ApplySpacingTo(nest, machine));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The cutting parameters a plate of <paramref name="nest"/> without its own starts from:
|
||||
/// the last ones applied (or the built-in defaults), with the lead-ins, lead-outs and kerf
|
||||
|
||||
Reference in new issue
Block a user