mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-10 22:31:11 -05:00
feat(report): lay the summary header out in two key/value columns
The one-column list took nine rows before the Plates table, pushing part cards onto later pages. Job and material now sit on the left and the report's totals on the right, five rows at most. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9c3a8a5063
commit
ae8e7c6e42
1 file changed
+25
-11
@@ -109,19 +109,33 @@ public static class NestPdfWriter
|
||||
title.Format.Font.Bold = true;
|
||||
title.Format.SpaceAfter = Unit.FromPoint(6);
|
||||
|
||||
var info = AddTable(section, 130, 410);
|
||||
info.Borders.Visible = false;
|
||||
AddInfoRow(info, "Nest:", snapshot.Name);
|
||||
// Two key/value columns keep the header short so more part cards fit on the first page:
|
||||
// the job and material on the left, the report's totals on the right.
|
||||
var left = new List<(string Key, string Value)> { ("Nest:", snapshot.Name) };
|
||||
if (snapshot.Customer.Length > 0)
|
||||
AddInfoRow(info, "Customer:", snapshot.Customer);
|
||||
AddInfoRow(info, "Material:", Material(snapshot));
|
||||
AddInfoRow(info, "Thickness:", Thickness(snapshot));
|
||||
AddInfoRow(info, "Units:", snapshot.Units == "mm" ? "millimeters (mm)" : "inches (in)");
|
||||
AddInfoRow(info, "Generated:", snapshot.GeneratedAt.ToString("yyyy-MM-dd HH:mm zzz", Invariant));
|
||||
AddInfoRow(info, "Distinct layouts:", snapshot.Plates.Length.ToString(Invariant));
|
||||
AddInfoRow(info, "Total physical sheets:", snapshot.TotalSheets.ToString(Invariant));
|
||||
left.Add(("Customer:", snapshot.Customer));
|
||||
left.Add(("Material:", Material(snapshot)));
|
||||
left.Add(("Thickness:", Thickness(snapshot)));
|
||||
left.Add(("Units:", snapshot.Units == "mm" ? "millimeters (mm)" : "inches (in)"));
|
||||
var right = new List<(string Key, string Value)>
|
||||
{
|
||||
("Generated:", snapshot.GeneratedAt.ToString("yyyy-MM-dd HH:mm zzz", Invariant)),
|
||||
("Distinct layouts:", snapshot.Plates.Length.ToString(Invariant)),
|
||||
("Total physical sheets:", snapshot.TotalSheets.ToString(Invariant)),
|
||||
};
|
||||
if (snapshot.TotalCutTime is { } total)
|
||||
AddInfoRow(info, "Estimated cut time:", Duration(total) + " (all sheets)");
|
||||
right.Add(("Estimated cut time:", Duration(total) + " (all sheets)"));
|
||||
|
||||
var info = AddTable(section, 72, 182, 136, 150);
|
||||
info.Borders.Visible = false;
|
||||
// The left column always has at least as many rows as the right.
|
||||
for (var index = 0; index < left.Count; index++)
|
||||
{
|
||||
string[] cells = index < right.Count
|
||||
? [left[index].Key, left[index].Value, right[index].Key, right[index].Value]
|
||||
: [left[index].Key, left[index].Value];
|
||||
AddInfoRow(info, cells);
|
||||
}
|
||||
if (snapshot.Notes.Length > 0)
|
||||
{
|
||||
// Free paragraphs split across pages; a table row taller than a page would be clipped.
|
||||
|
||||
Reference in new issue
Block a user