feat(core,io): persist nest status and made-by in nest files
Add NestStatus (Quote/ToBeCut/HasBeenCut) plus MadeBy on Nest, written as additive camelCase nest.json fields with PascalCase enum strings matching the units convention. Legacy files and unknown status values fall back to Quote. The nest info dialog gains a Status dropdown and Made By box.
This commit is contained in:
@@ -24,6 +24,8 @@ namespace OpenNest.IO
|
||||
public string DateLastModified { get; init; } = "";
|
||||
public string Notes { get; init; } = "";
|
||||
public string AssistGas { get; init; } = "";
|
||||
public string Status { get; init; } = "Quote";
|
||||
public string MadeBy { get; init; } = "";
|
||||
public double Thickness { get; init; }
|
||||
public MaterialDto Material { get; init; } = new();
|
||||
public PlateDefaultsDto PlateDefaults { get; init; } = new();
|
||||
|
||||
@@ -341,6 +341,11 @@ namespace OpenNest.IO
|
||||
nest.DateLastModified = DateTime.Parse(dto.DateLastModified);
|
||||
nest.Notes = dto.Notes;
|
||||
nest.AssistGas = dto.AssistGas ?? "";
|
||||
// Additive v2 fields: absent or unknown values keep the defaults.
|
||||
nest.Status = Enum.TryParse<NestStatus>(dto.Status, true, out var status)
|
||||
? status
|
||||
: NestStatus.Quote;
|
||||
nest.MadeBy = dto.MadeBy ?? "";
|
||||
|
||||
// Nest-level material and thickness (fall back to PlateDefaults for old files)
|
||||
var pd = dto.PlateDefaults;
|
||||
|
||||
@@ -88,6 +88,8 @@ namespace OpenNest.IO
|
||||
DateLastModified = nest.DateLastModified.ToString("o"),
|
||||
Notes = nest.Notes ?? "",
|
||||
AssistGas = nest.AssistGas ?? "",
|
||||
Status = nest.Status.ToString(),
|
||||
MadeBy = nest.MadeBy ?? "",
|
||||
Thickness = nest.Thickness,
|
||||
Material = new MaterialDto
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user