mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-11 12:04:13 -04:00
fix(report): rename plate copies to quantity
This commit is contained in:
1 parent
afa50c5a12
commit
8ebb48694f
4 files changed
+7
-6
No files matched your search
@@ -131,7 +131,7 @@ public static class NestPdfWriter
|
||||
else
|
||||
{
|
||||
var plates = AddTable(section, 60, 200, 80, 100, 100);
|
||||
AddHeader(plates, "Plate", "Stock size", "Copies", "Parts/sheet", "Utilization");
|
||||
AddHeader(plates, "Plate", "Stock size", "Quantity", "Parts/sheet", "Utilization");
|
||||
foreach (var plate in snapshot.Plates)
|
||||
AddRow(plates, $"Plate {plate.Number}", false, plate.Number.ToString(Invariant), SheetSize(snapshot, plate),
|
||||
plate.Copies.ToString(Invariant), plate.Parts.Length.ToString(Invariant), Percent(plate.Utilization));
|
||||
@@ -175,7 +175,7 @@ public static class NestPdfWriter
|
||||
var info = AddTable(section, 80, 280, 90, 270);
|
||||
info.Borders.Visible = false;
|
||||
AddInfoRow(info, "Nest:", snapshot.Name, "Sheet size:", SheetSize(snapshot, plate));
|
||||
AddInfoRow(info, "Material:", Material(snapshot), "Copies:", plate.Copies.ToString(Invariant));
|
||||
AddInfoRow(info, "Material:", Material(snapshot), "Quantity:", plate.Copies.ToString(Invariant));
|
||||
AddInfoRow(info, "Thickness:", Thickness(snapshot), "Part spacing:",
|
||||
$"{Number(plate.PartSpacing)} {snapshot.Units}");
|
||||
AddInfoRow(info, "Parts/sheet:", plate.Parts.Length.ToString(Invariant), "Utilization:",
|
||||
@@ -204,7 +204,7 @@ public static class NestPdfWriter
|
||||
var perSheet = plate.Parts.GroupBy(part => part.ReportId, StringComparer.Ordinal)
|
||||
.ToDictionary(group => group.Key, group => (long)group.Count(), StringComparer.Ordinal);
|
||||
var parts = AddTable(section, 60, 400, 110, 150);
|
||||
AddHeader(parts, "ID", "Drawing", "Qty/sheet", $"Total ({plate.Copies} copies)");
|
||||
AddHeader(parts, "ID", "Drawing", "Qty/sheet", $"Total ({plate.Copies} plates)");
|
||||
foreach (var drawing in snapshot.Drawings.Where(drawing => perSheet.ContainsKey(drawing.Id)))
|
||||
{
|
||||
var count = perSheet[drawing.Id];
|
||||
|
||||
@@ -85,7 +85,7 @@ public sealed class NestPdfLayoutTests : IDisposable
|
||||
// Every page carrying plate-table rows repeats the table heading.
|
||||
var tablePages = platePages.Where(page => Regex.IsMatch(page, @"(?m)^R\d{3}\s+Demand \d{2}\s+1\s+2$")).ToList();
|
||||
Assert.True(tablePages.Count >= 2, $"plate table pages: {tablePages.Count}");
|
||||
Assert.All(tablePages, page => Assert.Matches(@"ID\s+Drawing\s+Qty/sheet\s+Total \(2 copies\)", page));
|
||||
Assert.All(tablePages, page => Assert.Matches(@"ID\s+Drawing\s+Qty/sheet\s+Total \(2 plates\)", page));
|
||||
var plateText = string.Join("\n", platePages);
|
||||
for (var i = 0; i < 40; i++)
|
||||
Assert.Matches($@"R{i + 4:D3}\s+Demand {i:D2}\s+1\s+2", plateText);
|
||||
|
||||
@@ -53,10 +53,11 @@ public sealed class NestPdfWriterTests : IDisposable
|
||||
Assert.Matches(@"R003\s+Bracket\s+7\s+2\s+5\s+0\s+1", summary);
|
||||
Assert.Matches(@"R004\s+Unplaced\s+3\s+0\s+3\s+0\s+-", summary);
|
||||
Assert.Contains("Page 1 of 2", summary);
|
||||
Assert.DoesNotContain("Copies", summary + plate);
|
||||
|
||||
Assert.Contains("Plate 1", plate);
|
||||
Assert.Contains("Report test job", plate);
|
||||
Assert.Matches(@"Copies:\s+2", plate);
|
||||
Assert.Matches(@"Quantity:\s+2", plate);
|
||||
Assert.Matches(@"R001\s+Bracket\s+2\s+4", plate);
|
||||
Assert.Matches(@"R002\s+Rotated\s+1\s+2", plate);
|
||||
Assert.Matches(@"R003\s+Bracket\s+1\s+2", plate);
|
||||
|
||||
@@ -54,7 +54,7 @@ each plate's part table across pages with the heading row repeated, and notes
|
||||
flow as an ordinary paragraph. No row, table or note text is ever dropped or
|
||||
truncated to fit a page.
|
||||
|
||||
Stock sizes read **width x length** in job units.
|
||||
Stock sizes read **width x length** in job units. Plate counts use **Quantity**.
|
||||
|
||||
Each part ID is centered on its part's pole of inaccessibility (`PolyLabel`,
|
||||
the same method `PlateView`'s `LayoutPart` uses), computed on a
|
||||
|
||||
Reference in new issue
Block a user