加入枚举类型

This commit is contained in:
zengwenjie
2025-09-15 18:41:55 +08:00
parent ddc87adedd
commit 51fc7b31ec
14 changed files with 379 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
/// <summary>
/// 放置位置
/// </summary>
public enum DropPlacement : int
{
/// <summary>
/// 不确定的
/// </summary>
Uncertain=0,
/// <summary>
/// 拒绝放置
/// </summary>
Rejected = 0,
/// <summary>
/// 在节点前
/// </summary>
BeforeMe = 1,
/// <summary>
/// 在节点内
/// </summary>
WithinMe = 2,
/// <summary>
/// 在节点后
/// </summary>
BehindMe = 3,
}
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
/// <summary>
/// 退出线位置(如果需要回归线则放置到相反方向)
/// </summary>
public enum ExitlinePosition : int
{
/// <summary>
/// 无退出线:没有退出线,一般用于跳转逻辑节点
/// </summary>
NoneLine = 0,
/// <summary>
/// 左下框线:自左侧画竖线向下后转右从中间退出
/// </summary>
LeftLower = 1,
/// <summary>
/// 右下框线:自右侧画竖线向下后转左从中间退出
/// </summary>
Rightlower = 2,
/// <summary>
/// 中间竖线:内容节点底部中间直接向下划线退出
/// </summary>
Centerline = 3,
/// <summary>
/// 下方直线:沿左下角向右下角画完整的直线退出
/// </summary>
Underline = 4
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
public enum InfoType : int
{
None = 0,
Info = 1,
Warn = 2,
Error = 3
}
}

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
/// <summary>
/// 逻辑控制行为的与定义选项
/// </summary>
public enum LogicalBehavior
{
/// <summary>
/// 不做控制
/// </summary>
NoControl=0,
/// <summary>
/// 自定义逻辑:不受运行时预置逻辑控制
/// </summary>
Customize = 1,
/// <summary>
/// 迭代跳出
/// </summary>
Break = 2,
/// <summary>
/// 迭代重入
/// </summary>
Continue = 3,
/// <summary>
/// 流程返回
/// </summary>
Return = 4,
/// <summary>
/// 程序退出
/// </summary>
Exit = 5
}
}

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
/// <summary>
/// 参数支持的编辑模式
/// </summary>
[Flags]
public enum ParamEditMode : int
{
/// <summary>
/// 不允许编辑
/// </summary>
None = 0,
/// <summary>
/// 从待选列表中选择
/// </summary>
Choice = 1,
/// <summary>
/// 允许自由编辑
/// </summary>
Edit = 2,
/// <summary>
/// 允许使用引用参数
/// </summary>
Link = 4,
/// <summary>
/// 允许弹出式编辑
/// </summary>
Popup = 8,
/// <summary>
/// 使用自定义编辑器
/// </summary>
Editor=16,
/// <summary>
/// 允许所有可支持的编辑模式
/// </summary>
All = 0xFF
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
public enum ParamType : int
{
Unknow = 0,
Char = 1, Byte = 2,
Int16 = 3, UInt16 = 4,
Int32 = 5, UInt32 = 6,
Int64 = 7, UInt64 = 8,
Half = 9, Float = 10, Double = 11,
String = 12, ByteArray = 13, IntArray = 14, DoubleArray = 15,
Condition = 16, Channel = 17, SyncSignal = 18,
}
}

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
/// <summary>
/// 执行结果代码
/// </summary>
public enum ReturnCode : int
{
/// <summary>
/// 执行成功:且执行结果满足期望
/// </summary>
Success = 0,
/// <summary>
/// 执行成功:但执行结果不满足期望
/// </summary>
Exception = 1,
/// <summary>
/// 局部异常:当前逻辑发生异常;要求终止当前块操作,但允许后续的逻辑块继续执行。
/// </summary>
Crash = 2,
/// <summary>
/// 局部异常:当前逻辑发生异常,无法正确执行,但不会引起整体的执行。
/// </summary>
Panic = 3,
/// <summary>
/// 致命错误:执行过程中产生致命错误,要求运行时退出执行;例如执行过程中发现设备过热,不能继续执行。
/// </summary>
Fatal = 4,
/// <summary>
/// 系统退出:通过人工交互要求正在执行的逻辑退出。
/// </summary>
Breakdown = 5
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
/// <summary>
/// 运行状态:用于多个线程之间的状态同步
/// </summary>
public enum RunningState : int
{
/// <summary>
/// 等待中:系统不在运行状态
/// </summary>
Waiting = 0,
/// <summary>
/// 运行中:所有指令都可以运行
/// </summary>
Running = 1,
/// <summary>
/// 暂停中:暂停所有逻辑的执行
/// </summary>
Pausing = 2,
/// <summary>
/// 停止中:正在停止,准备退出
/// </summary>
Stoping = 3
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
public enum ViewState : int
{
/// <summary>
/// 正常状态
/// </summary>
Normal = 0,
/// <summary>
/// 选中状态
/// </summary>
Selected = 1,
/// <summary>
/// 鼠标悬停
/// </summary>
NormalHover = 2,
/// <summary>
/// 鼠标悬停在选中项上
/// </summary>
SelectedHover = 3,
/// <summary>
/// 拖拽到正常状态项上
/// </summary>
NormalDragHover = 4,
/// <summary>
/// 拖拽到选中状态项上
/// </summary>
SelectedDragHover = 5,
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
public enum WorkMode : int
{
/// <summary>
/// 等待:后台耗时工作进行时的状态,此状态禁用所有交互
/// </summary>
Waiting = 0,
/// <summary>
/// 回显:用于持续回显数据的状态,此状态下禁用编辑功能,所有后台信息会被显示,包括过程信息
/// </summary>
Echoing = 1,
/// <summary>
/// 预览:用于浏览,只有鼠标悬停或选中时才会显示属性信息,但不会显示过程数据等其它信息
/// </summary>
Preview = 2,
/// <summary>
/// 编辑:编辑状态
/// </summary>
Editing = 3,
/// <summary>
/// 运行:运行状态
/// </summary>
Running = 4
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
public interface IJumpableUnit : INOPRunable
{
bool IsBreaking { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
internal interface ILogicController
{
public LogicalBehavior LogicalBehavior { get; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
public interface INOPRunable
{
bool IsNOPRunning { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Deedy.Activity
{
public interface IReentrantUnit : IJumpableUnit
{
public bool IsReentering { get; set; }
}
}