mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-31 09:51:35 -04:00
fix(ui): call set quantities sets in the release panel
The release panel was the only place that counted a set in kits; everywhere else in the drawing library calls them sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
889e33d179
commit
4ca8b0debf
4 files changed
+11
-11
No files matched your search
@@ -46,9 +46,9 @@ public class SetReleaseFormsTests
|
||||
Assert.True(Field<CheckBox>(panel, "includeArchivedCheckBox").Visible);
|
||||
Assert.Equal("Synthetic customer", Field<Label>(panel, "customerValue").Text);
|
||||
var lines = Field<DataGridView>(panel, "lineGrid");
|
||||
Assert.Equal(new object[] { "Synthetic kit", "1", "kit" }, lines.Rows[0].Cells.Cast<DataGridViewCell>().Take(3).Select(c => c.Value));
|
||||
Assert.Equal(new object[] { "Synthetic kit", "1", "set" }, lines.Rows[0].Cells.Cast<DataGridViewCell>().Take(3).Select(c => c.Value));
|
||||
lines.Rows[0].Cells["lineQuantityColumn"].Value = "3";
|
||||
Assert.Equal("kits", lines.Rows[0].Cells["lineUnitColumn"].Value);
|
||||
Assert.Equal("sets", lines.Rows[0].Cells["lineUnitColumn"].Value);
|
||||
Assert.Equal(new object[] { 12, 9 }, grid.Rows.Cast<DataGridViewRow>().Select(r => r.Cells["partsColumn"].Value));
|
||||
Assert.Equal("Synthetic Aluminum Grade A 0.25 in, Laser", grid.Rows[0].Cells["groupColumn"].Value);
|
||||
Assert.Equal(("Make Nests (2)", true), (release.Text, release.Enabled));
|
||||
@@ -737,7 +737,7 @@ public class SetReleaseFormsTests
|
||||
Assert.Equal("Added 1 drawing and 1 more of 1 listed.", picker.Status);
|
||||
|
||||
var lines = Field<DataGridView>(panel, "lineGrid");
|
||||
Assert.Equal(new object[] { "kit", "pcs", "pcs", "pc" },
|
||||
Assert.Equal(new object[] { "set", "pcs", "pcs", "pc" },
|
||||
lines.Rows.Cast<DataGridViewRow>().Select(r => r.Cells["lineUnitColumn"].Value));
|
||||
lines.Rows[2].Cells["lineQuantityColumn"].Value = "40";
|
||||
Assert.Equal(new[] { ("SYN-A", 5), ("SYN-C", 40), ("SYN-B", 1) }, panel.DrawingLines().Select(l => (l.Drawing.Name, l.Quantity)));
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ namespace OpenNest.Controls
|
||||
lineQuantityColumn.HeaderText = "Qty";
|
||||
lineQuantityColumn.Name = "lineQuantityColumn";
|
||||
lineQuantityColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
lineQuantityColumn.ToolTipText = "Kits of a set (every quantity in it is multiplied) or pieces of a drawing.";
|
||||
lineQuantityColumn.ToolTipText = "How many of a set (every quantity in it is multiplied) or pieces of a drawing.";
|
||||
lineQuantityColumn.Width = 55;
|
||||
//
|
||||
// lineUnitColumn
|
||||
|
||||
@@ -294,9 +294,9 @@ namespace OpenNest.Controls
|
||||
populating = false;
|
||||
}
|
||||
|
||||
// "kits" for a set, "pcs" for a drawing on its own.
|
||||
// "sets" for a set, "pcs" for a drawing on its own.
|
||||
private static string Unit(object tag, int quantity) =>
|
||||
tag is DrawingSetRecord ? (quantity == 1 ? "kit" : "kits") : (quantity == 1 ? "pc" : "pcs");
|
||||
tag is DrawingSetRecord ? (quantity == 1 ? "set" : "sets") : (quantity == 1 ? "pc" : "pcs");
|
||||
|
||||
private static int Quantity(DataGridViewRow row) =>
|
||||
int.TryParse(Convert.ToString(row.Cells["lineQuantityColumn"].Value, CultureInfo.CurrentCulture), NumberStyles.Integer,
|
||||
|
||||
@@ -535,7 +535,7 @@ shown, and Releases re-reads its page each time it is shown again. Sets lists se
|
||||
(`OpenNest.Data.DrawingSetBrowseSession`): search by name, customer or notes,
|
||||
sort by name, customer, revision or saved time, and **Show archived**. Selecting
|
||||
a set shows its notes. A double-click or Enter adds the set to the release at
|
||||
one kit (again adds another kit). Below the list are **New Set...**, **Edit...**,
|
||||
a quantity of 1 (again adds 1 more). Below the list are **New Set...**, **Edit...**,
|
||||
**More ▾** and **Add to Release** in bold, which adds every selected set
|
||||
(Ctrl- or Shift-click selects several). **More ▾**, also the list's right-click
|
||||
menu (the menu key or Shift+F10 opens it from the keyboard), holds **Add to
|
||||
@@ -657,12 +657,12 @@ review and Save; nothing is stored before then.
|
||||
The release panel (`OpenNest.Controls.ReleasePanel`) sits beside the Library and
|
||||
Sets tabs and holds one release in progress for both. Adding is a double-click
|
||||
(or Enter) in either list: a set is read with its members' current drawings and
|
||||
listed at one kit; a library drawing is read afresh and listed on its own at the
|
||||
listed at a quantity of 1; a library drawing is read afresh and listed on its own at the
|
||||
Library tab's **Quantity**. Adding a set or drawing already listed adds to its
|
||||
quantity instead, so double-clicking a set twice makes it ×2 kits. An archived
|
||||
quantity instead, so double-clicking a set twice makes it ×2. An archived
|
||||
set or drawing is refused. Each line shows its name, its quantity (edited in
|
||||
place: 1 to 1000 kits of a set, multiplying its quantities, or 1 to 100,000
|
||||
pieces of a drawing) and **kits** or **pcs**; **✕** (or Delete) removes it. A
|
||||
place: 1 to 1000 of a set, multiplying its quantities, or 1 to 100,000
|
||||
pieces of a drawing) and **sets** or **pcs**; **✕** (or Delete) removes it. A
|
||||
drawing that a set also lists becomes one item with both quantities. Above the
|
||||
lines, the heading reads as a sentence of what is listed, such as "Release set
|
||||
'Frame kit' ×2", or the first few lines when there are several. Below them are
|
||||
|
||||
Reference in new issue
Block a user