mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-03 06:51:34 -05:00
feat(ui): show each drawing's count on the current plate
The drawing list only showed nest-wide totals, so seeing how many of a drawing a layout holds meant counting parts by eye. Prefix the nested line with the current plate's count, e.g. "[78] 144 of 1 nested". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f597b06024
commit
d4e622271a
2 files changed
+15
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Size = System.Drawing.Size;
|
||||
|
||||
@@ -108,6 +109,12 @@ namespace OpenNest.Controls
|
||||
|
||||
public bool HideQuantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The plate shown beside the list; each drawing's count on it prefixes the nested
|
||||
/// quantity. Null omits the count.
|
||||
/// </summary>
|
||||
public Plate Plate { get; set; }
|
||||
|
||||
protected override void OnDrawItem(DrawItemEventArgs e)
|
||||
{
|
||||
if (e.Index >= Items.Count || e.Index <= -1)
|
||||
@@ -198,6 +205,11 @@ namespace OpenNest.Controls
|
||||
dwg.Quantity.Nested,
|
||||
dwg.Quantity.Required
|
||||
);
|
||||
var onPlate = Plate?.Parts.Count(part => part.BaseDrawing == dwg) ?? 0;
|
||||
|
||||
if (onPlate > 0)
|
||||
text1 = $"[{onPlate}] {text1}";
|
||||
|
||||
pt.Y += 22;
|
||||
e.Graphics.DrawString(text1, Font, detailBrush, pt);
|
||||
pt.Y += 18;
|
||||
|
||||
@@ -502,6 +502,7 @@ namespace OpenNest.Forms
|
||||
|
||||
Text = Nest.Name;
|
||||
drawingListBox1.Units = Nest.Units;
|
||||
drawingListBox1.Plate = PlateManager.CurrentPlate;
|
||||
}
|
||||
|
||||
private void UnbindNest()
|
||||
@@ -1627,6 +1628,8 @@ namespace OpenNest.Forms
|
||||
{
|
||||
PlateView.Plate = PlateManager.CurrentPlate;
|
||||
PlateView.ZoomToFit();
|
||||
drawingListBox1.Plate = PlateManager.CurrentPlate;
|
||||
drawingListBox1.Invalidate();
|
||||
SelectCurrentPlateInList();
|
||||
UpdatePlateHeader();
|
||||
UpdateRemovePlateButton();
|
||||
|
||||
Reference in new issue
Block a user