mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-14 12:35:07 -05:00
Finding a part on the nest server meant scrolling 40k drawings: the library could only match an exact thickness or customer and knew nothing about a drawing's size or holes. The library browser gets a Filter dialog with inclusive ranges, and the query API takes them. The server never parses packages and stays off IO, so the server worker now measures each package beside its nest jobs (bounding sides, net area, closed cutouts inside the outline) and stores the summary keyed by package hash (schema v19). Identical geometry is measured once, an unreadable package is recorded once instead of retried forever, and size or hole limits match only measured drawings. Thickness ranges compare in inches across units and keep the library's rule that a drawing saved without a thickness suits any. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63 lines
2.3 KiB
C#
63 lines
2.3 KiB
C#
using OpenNest;
|
|
|
|
namespace OpenNest.Data;
|
|
|
|
/// <summary>
|
|
/// Server-side metadata for one revision of a shared library drawing. The geometry
|
|
/// travels separately as a drawing package (a single-drawing, zero-plate .nest archive).
|
|
/// </summary>
|
|
public sealed class DrawingLibraryRecord
|
|
{
|
|
/// <summary>Allocated by the client before the first upload; kept by every revision.</summary>
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>Immutable revision number, starting at 1. Ignored on upload.</summary>
|
|
public int Revision { get; set; }
|
|
|
|
public string Name { get; set; } = "";
|
|
|
|
public string Customer { get; set; } = "";
|
|
|
|
/// <summary>Post material name, for example "Carbon Steel".</summary>
|
|
public string MaterialName { get; set; } = "";
|
|
|
|
/// <summary>Alloy or grade within the material, for example "A36 HR".</summary>
|
|
public string MaterialGrade { get; set; } = "";
|
|
|
|
/// <summary>Thickness in <see cref="Units"/>, stored rounded to four decimals.</summary>
|
|
public double Thickness { get; set; }
|
|
|
|
public Units Units { get; set; } = Units.Inches;
|
|
|
|
public CutType CutType { get; set; } = CutType.Laser;
|
|
|
|
public string Notes { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Nesting settings applied when the drawing is added to a nest. Not part of the
|
|
/// package, so changing them adds a revision that reuses the same package.
|
|
/// </summary>
|
|
public DrawingNestingSettings Settings { get; set; } = new();
|
|
|
|
/// <summary>Hidden from browsing by default; still readable by id.</summary>
|
|
public bool Archived { get; set; }
|
|
|
|
/// <summary>Lower-case hex SHA-256 of the package bytes. Server-computed.</summary>
|
|
public string PackageSha256 { get; set; } = "";
|
|
|
|
/// <summary>Package size in bytes. Server-computed.</summary>
|
|
public long PackageSize { get; set; }
|
|
|
|
/// <summary>When the server stored this revision. Server-computed.</summary>
|
|
public DateTime SavedAt { get; set; }
|
|
|
|
/// <summary>Who saved this revision, as reported by the client.</summary>
|
|
public string SavedBy { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// The package's measured size and holes, returned by queries once the server worker has
|
|
/// measured it; null until then. Server-computed and ignored on upload.
|
|
/// </summary>
|
|
public DrawingGeometrySummary? Geometry { get; set; }
|
|
}
|