Implemented the knot node save load issues
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
Ankitkumar Satapara
2026-04-20 20:59:56 +05:30
parent acdaecf8de
commit 4252cc6912
3 changed files with 34 additions and 1 deletions

View File

@@ -255,6 +255,9 @@ namespace Nodify.Calculator
info.Output.Add(""); info.Output.Add("");
info.IsFlowNode = true; info.IsFlowNode = true;
break; break;
case SystemOperations.KNOT:
// Knot nodes manage their own connectors; don't add any here
break;
default: default:
info.Output.Add(""); info.Output.Add("");
info.IsFlowNode = true; info.IsFlowNode = true;
@@ -414,6 +417,28 @@ namespace Nodify.Calculator
op.Output.Add(DeserializeConnector(sc, false)); op.Output.Add(DeserializeConnector(sc, false));
} }
} }
else if (sysVm.SystemOperationType == SystemOperations.KNOT)
{
// Restore knot connector shape/color/datatype from saved data
if (op is KnotOperationViewModel knotOp)
{
knotOp.Input.Clear();
knotOp.Output.Clear();
foreach (var ic in nd.InputConnectors)
{
var conn = DeserializeConnector(ic, true);
conn.IsKnotConnector = true;
knotOp.Input.Add(conn);
}
foreach (var oc in nd.OutputConnectors)
{
var conn = DeserializeConnector(oc, false);
conn.IsKnotConnector = true;
knotOp.Output.Add(conn);
}
}
}
} }
} }
@@ -426,7 +451,8 @@ namespace Nodify.Calculator
ColorArgb = c.RawColor.ToArgb(), ColorArgb = c.RawColor.ToArgb(),
DataType = c.DataType ?? string.Empty, DataType = c.DataType ?? string.Empty,
IsCopyConnector = c.IsCopyConnector, IsCopyConnector = c.IsCopyConnector,
IsTakeListConnector = c.IsTakeListConnector IsTakeListConnector = c.IsTakeListConnector,
IsKnotConnector = c.IsKnotConnector
}; };
} }
@@ -440,6 +466,7 @@ namespace Nodify.Calculator
DataType = cd.DataType, DataType = cd.DataType,
IsCopyConnector = cd.IsCopyConnector, IsCopyConnector = cd.IsCopyConnector,
IsTakeListConnector = cd.IsTakeListConnector, IsTakeListConnector = cd.IsTakeListConnector,
IsKnotConnector = cd.IsKnotConnector,
IsInput = isInput IsInput = isInput
}; };
} }

View File

@@ -53,6 +53,7 @@ namespace Nodify.Calculator.Models
public string DataType { get; set; } = string.Empty; public string DataType { get; set; } = string.Empty;
public bool IsCopyConnector { get; set; } public bool IsCopyConnector { get; set; }
public bool IsTakeListConnector { get; set; } public bool IsTakeListConnector { get; set; }
public bool IsKnotConnector { get; set; }
} }
public class ConnectionData public class ConnectionData

View File

@@ -464,6 +464,11 @@ namespace Nodify.Calculator
return assertOp; return assertOp;
} }
if (info.sysOp == SystemOperations.KNOT)
{
return new KnotOperationViewModel();
}
if (info.sysOp == SystemOperations.DEBUG) if (info.sysOp == SystemOperations.DEBUG)
{ {
var debugOp = new SystemOperationViewModel var debugOp = new SystemOperationViewModel