mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-01 05:56:35 +08:00
准备区分节点、参数、返回值的连接,做个备份
This commit is contained in:
@@ -13,7 +13,13 @@ namespace Serein.Library
|
||||
public partial class MethodDetails
|
||||
{
|
||||
private readonly IFlowEnvironment env;
|
||||
private readonly NodeModelBase nodeModel;
|
||||
|
||||
/// <summary>
|
||||
/// 对应的节点
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private NodeModelBase _nodeModel;
|
||||
|
||||
/// <summary>
|
||||
/// 是否保护参数(目前仅视觉效果参数,不影响运行实现,后续将设置作用在运行逻辑中)
|
||||
/// </summary>
|
||||
@@ -88,7 +94,7 @@ namespace Serein.Library
|
||||
/// <param name="nodeModel">标识属于哪个节点</param>
|
||||
public MethodDetails(IFlowEnvironment env, NodeModelBase nodeModel)
|
||||
{
|
||||
this.nodeModel = nodeModel;
|
||||
NodeModel = nodeModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,14 +12,19 @@ namespace Serein.Library
|
||||
[NodeProperty(ValuePath = NodeValuePath.DebugSetting)]
|
||||
public partial class NodeDebugSetting
|
||||
{
|
||||
private readonly NodeModelBase nodeModel;
|
||||
/// <summary>
|
||||
/// 对应的节点
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private NodeModelBase _nodeModel;
|
||||
|
||||
/// <summary>
|
||||
/// 创建属于某个节点的调试设置
|
||||
/// </summary>
|
||||
/// <param name="nodeModel"></param>
|
||||
public NodeDebugSetting(NodeModelBase nodeModel)
|
||||
{
|
||||
this.nodeModel = nodeModel;
|
||||
NodeModel = nodeModel;
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否使能
|
||||
|
||||
@@ -14,61 +14,60 @@ namespace Serein.Library
|
||||
[NodeProperty(ValuePath = NodeValuePath.None)]
|
||||
public abstract partial class NodeModelBase : IDynamicFlowNode
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 节点运行环境
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private IFlowEnvironment _env;
|
||||
|
||||
/// <summary>
|
||||
/// 标识节点对象全局唯一
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private string _guid;
|
||||
|
||||
/// <summary>
|
||||
/// 描述节点对应的控件类型
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private NodeControlType _controlType;
|
||||
|
||||
/// <summary>
|
||||
/// 在画布中的位置
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private PositionOfUI _position ;
|
||||
|
||||
/// <summary>
|
||||
/// 显示名称
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private string _displayName;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为起点控件
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private bool _isStart;
|
||||
|
||||
/// <summary>
|
||||
/// 附加的调试功能
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private NodeDebugSetting _debugSetting ;
|
||||
|
||||
/// <summary>
|
||||
/// 描述节点对应的控件类型
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private NodeControlType _controlType ;
|
||||
|
||||
/// <summary>
|
||||
/// 方法描述。不包含Method与委托,需要通过MethodName从环境中获取委托进行调用。
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private MethodDetails _methodDetails ;
|
||||
|
||||
/// <summary>
|
||||
/// 标识节点对象全局唯一
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private string _guid ;
|
||||
|
||||
/// <summary>
|
||||
/// 显示名称
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private string _displayName ;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为起点控件
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private bool _isStart ;
|
||||
|
||||
/// <summary>
|
||||
/// 运行时的上一节点
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private NodeModelBase _previousNode ;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当前节点执行完毕后需要执行的下一个分支的类别
|
||||
/// </summary>
|
||||
@@ -81,10 +80,11 @@ namespace Serein.Library
|
||||
[PropertyInfo]
|
||||
private Exception _runingException ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public abstract partial class NodeModelBase : IDynamicFlowNode
|
||||
@@ -112,6 +112,7 @@ namespace Serein.Library
|
||||
/// </summary>
|
||||
public Dictionary<ConnectionType, List<NodeModelBase>> SuccessorNodes { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 控制FlowData在同一时间只会被同一个线程更改。
|
||||
/// </summary>
|
||||
|
||||
@@ -15,7 +15,13 @@ namespace Serein.Library
|
||||
public partial class ParameterDetails
|
||||
{
|
||||
private readonly IFlowEnvironment env;
|
||||
private readonly NodeModelBase nodeModel;
|
||||
|
||||
/// <summary>
|
||||
/// 对应的节点
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private NodeModelBase _nodeModel;
|
||||
|
||||
/// <summary>
|
||||
/// 参数索引
|
||||
/// </summary>
|
||||
@@ -83,7 +89,7 @@ namespace Serein.Library
|
||||
public ParameterDetails(IFlowEnvironment env, NodeModelBase nodeModel)
|
||||
{
|
||||
this.env = env;
|
||||
this.nodeModel = nodeModel;
|
||||
this.NodeModel = nodeModel;
|
||||
}
|
||||
/// <summary>
|
||||
/// 通过参数信息加载实体,用于加载项目文件、远程连接的场景
|
||||
|
||||
@@ -244,26 +244,30 @@ namespace Serein.Library
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 节点于画布中的位置
|
||||
/// 节点于画布中的位置(通用类)
|
||||
/// </summary>
|
||||
public class PositionOfUI
|
||||
{ /// <summary>
|
||||
/// 构造一个坐标
|
||||
/// </summary>
|
||||
public PositionOfUI()
|
||||
{
|
||||
|
||||
}
|
||||
[NodeProperty]
|
||||
public partial class PositionOfUI
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个坐标
|
||||
/// </summary>
|
||||
public PositionOfUI(double x, double y)
|
||||
{
|
||||
X = x; Y = y;
|
||||
_x = x; _y = y;
|
||||
}
|
||||
|
||||
public double X { get; set; } = 0;
|
||||
public double Y { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 指示控件在画布的横向向方向上的位置
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _x = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 指示控件在画布的纵向方向上的位置
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _y = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user