Implemented the knot node save load issues
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
This commit is contained in:
@@ -255,6 +255,9 @@ namespace Nodify.Calculator
|
||||
info.Output.Add("");
|
||||
info.IsFlowNode = true;
|
||||
break;
|
||||
case SystemOperations.KNOT:
|
||||
// Knot nodes manage their own connectors; don't add any here
|
||||
break;
|
||||
default:
|
||||
info.Output.Add("");
|
||||
info.IsFlowNode = true;
|
||||
@@ -414,6 +417,28 @@ namespace Nodify.Calculator
|
||||
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(),
|
||||
DataType = c.DataType ?? string.Empty,
|
||||
IsCopyConnector = c.IsCopyConnector,
|
||||
IsTakeListConnector = c.IsTakeListConnector
|
||||
IsTakeListConnector = c.IsTakeListConnector,
|
||||
IsKnotConnector = c.IsKnotConnector
|
||||
};
|
||||
}
|
||||
|
||||
@@ -440,6 +466,7 @@ namespace Nodify.Calculator
|
||||
DataType = cd.DataType,
|
||||
IsCopyConnector = cd.IsCopyConnector,
|
||||
IsTakeListConnector = cd.IsTakeListConnector,
|
||||
IsKnotConnector = cd.IsKnotConnector,
|
||||
IsInput = isInput
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace Nodify.Calculator.Models
|
||||
public string DataType { get; set; } = string.Empty;
|
||||
public bool IsCopyConnector { get; set; }
|
||||
public bool IsTakeListConnector { get; set; }
|
||||
public bool IsKnotConnector { get; set; }
|
||||
}
|
||||
|
||||
public class ConnectionData
|
||||
|
||||
@@ -464,6 +464,11 @@ namespace Nodify.Calculator
|
||||
return assertOp;
|
||||
}
|
||||
|
||||
if (info.sysOp == SystemOperations.KNOT)
|
||||
{
|
||||
return new KnotOperationViewModel();
|
||||
}
|
||||
|
||||
if (info.sysOp == SystemOperations.DEBUG)
|
||||
{
|
||||
var debugOp = new SystemOperationViewModel
|
||||
|
||||
Reference in New Issue
Block a user