fix(reports): take the thickness name from the machine config

Each machine thickness already has a Name / Gauge field the shop fills in, so
the report now shows that name instead of guessing one from the standard
gauge table. It is matched the way the machine cutting defaults match the
nest's material, grade and thickness; a thickness without a name shows just
the decimal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 5.5 committed 2026-11-12 07:25:40 -05:00
1 parent 21c1e0f2c7
commit 76e1acbc51
4 files changed
+13 -11

No files matched your search

+1 -1
View File
@@ -729,7 +729,7 @@ public static class NestPdfWriter
}
// Zero thickness means "unset" in a new nest; never present it as a genuine value.
// A standard gauge or plate fraction leads, as the thickness box lists it: "16 ga - 0.0598 in".
// The machine config's name for the thickness leads: "16 ga - 0.0598 in".
private static string Thickness(NestReportSnapshot snapshot) =>
snapshot.Thickness <= 0 ? "Not specified"
: snapshot.ThicknessName.Length > 0 ? $"{snapshot.ThicknessName} - {Number(snapshot.Thickness)} {snapshot.Units}"
+3 -3
View File
@@ -63,9 +63,9 @@ public sealed record NestReportSnapshot(string Name, string Customer, string Not
public long TotalSheets => Plates.Aggregate(0L, (total, plate) => checked(total + plate.Copies));
/// <summary>
/// The standard gauge or plate fraction the thickness matches ("16 ga", "1/4\""), shown
/// before the decimal; empty when it matches none. Reporting has no thickness table of its
/// own, so the caller supplies it.
/// The name the nest machine's config gives this thickness ("16 ga"), shown before the
/// decimal; empty when it has none. Reporting does not read machine configs, so the caller
/// supplies it.
/// </summary>
public string ThicknessName { get; init; } = "";
+4 -3
View File
@@ -848,10 +848,11 @@ namespace OpenNest.Forms
// Reporting must have no accounting side effects: no quantity refresh, no
// selection or dirty-state change. Only the detached snapshot reaches the writer.
var material = targets.Nest.Material;
var machine = MachineSettings.FindMachine(targets.Nest.Machine);
var catalogDensity = Data.MaterialDensityLookup.Resolve(
material?.Name,
material?.Grade,
MachineSettings.FindMachine(targets.Nest.Machine),
machine,
MachineSettings.LoadMaterials()
);
var snapshot = NestReportBuilder.Capture(
@@ -861,8 +862,8 @@ namespace OpenNest.Forms
catalogDensity
) with
{
ThicknessName =
Data.StandardThicknesses.Find(targets.Nest.Thickness, targets.Nest.Units)?.Name ?? "",
// The name the machine config gives the nest's thickness ("16 ga"), if any.
ThicknessName = Data.MachineCuttingDefaults.Find(machine, targets.Nest)?.Name?.Trim() ?? "",
};
NestPdfWriter.Write(snapshot, destination);
}
+5 -4
View File
@@ -112,10 +112,11 @@ beside the ID; complete drawings show no status. Cards without a weight show
a table row, so a card never splits across pages.
The summary's header lists the job and material on the left and the totals on
the right, to leave room for part cards on the first page. A thickness that
matches a standard gauge or plate fraction leads with its name, as the
thickness box lists it ("16 ga - 0.0598 in"); the desktop supplies the name,
since Reporting has no thickness table of its own.
the right, to leave room for part cards on the first page. When the nest
machine's config names the thickness (its **Name / Gauge**, matched as the
[machine cutting defaults](machine-cutting-defaults.md) match it), the name
leads the decimal: "16 ga - 0.0598 in". The desktop supplies it, since
Reporting does not read machine configs.
Stock sizes read **width x length** in job units. Plate tables use **Quantity**
and **Parts per plate**; the plate quantity multiplies per-plate part counts for