feat: add SubPrograms dictionary to Program with deep-copy support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 14:28:37 -04:00
parent c270d8ea76
commit f3b27c32c3
2 changed files with 41 additions and 0 deletions

View File

@@ -12,6 +12,8 @@ namespace OpenNest.CNC
public Dictionary<string, VariableDefinition> Variables { get; } = new(StringComparer.OrdinalIgnoreCase);
public Dictionary<int, Program> SubPrograms { get; } = new();
private Mode mode;
public Program(Mode mode = Mode.Absolute)
@@ -460,6 +462,9 @@ namespace OpenNest.CNC
foreach (var kvp in Variables)
pgm.Variables[kvp.Key] = kvp.Value;
foreach (var kvp in SubPrograms)
pgm.SubPrograms[kvp.Key] = (Program)kvp.Value.Clone();
return pgm;
}