mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-01 01:11:36 -05:00
feat(library): redesign Edit Drawing with drop-downs, color modes and a rotation dial
Typing customer, material, grade and thickness by hand let near-duplicate spellings into the library, which then split drawings that should match. The fields are now drop-downs of the values the library and the machine material catalog already use, while still accepting new values; thicknesses already used for the material are listed ahead of the standard gauges. A library color could be set but never cleared back to the color scheme's, so Automatic and Reset are added. The rotation start/end/step boxes gave no sense of the range, so a dial shades it, ticks the angles the engines try (via RotationPolicy) and lets either end be dragged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0ba5539fab
commit
6e40c2e6ed
10 files changed
+1524
-177
No files matched your search
@@ -99,6 +99,34 @@ public sealed class DrawingLibraryEditSession
|
||||
return matches.Where(m => m.Id != Listed.Id).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The drop-down choices for this edit: the customers, materials, grades and thicknesses
|
||||
/// of the active library drawings (the newest <see cref="DrawingLibrarySaveSession.MaxScannedDrawings"/>
|
||||
/// when there are more) and of the listed drawing, plus <paramref name="catalog"/>'s materials.
|
||||
/// </summary>
|
||||
public async Task<DrawingLibraryChoices> LoadChoicesAsync(IEnumerable<MaterialConfig>? catalog = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var records = new List<DrawingLibraryRecord>();
|
||||
var offset = 0;
|
||||
while (offset < DrawingLibrarySaveSession.MaxScannedDrawings)
|
||||
{
|
||||
var page = await _library.QueryAsync(new DrawingLibraryQuery
|
||||
{
|
||||
Sort = DrawingSortField.SavedAt,
|
||||
Descending = true,
|
||||
Offset = offset,
|
||||
Limit = DrawingLibraryQuery.MaxLimit,
|
||||
}, cancellationToken);
|
||||
records.AddRange(page.Items);
|
||||
offset += page.Items.Count;
|
||||
if (page.Items.Count == 0 || offset >= page.Total)
|
||||
break;
|
||||
}
|
||||
records.Add(Listed);
|
||||
return DrawingLibraryChoices.From(records, Listed.Units, catalog);
|
||||
}
|
||||
|
||||
// The record with the edited details and the listed notes and settings, for identity checks.
|
||||
private DrawingLibraryRecord BuildDetails(DrawingLibraryDetails details) =>
|
||||
Build(details, Listed.Notes, Listed.Settings ?? new DrawingNestingSettings());
|
||||
|
||||
Reference in new issue
Block a user