diff --git a/Library/Enums/NodeType.cs b/Library/Enums/NodeType.cs
index 2b23cb6..10d2c56 100644
--- a/Library/Enums/NodeType.cs
+++ b/Library/Enums/NodeType.cs
@@ -9,15 +9,15 @@ namespace Serein.Library.Enums
public enum NodeType
{
///
- /// 初始化(事件,不生成节点)
+ /// 初始化,流程启动时执行(不生成节点)
///
Init,
///
- /// 开始载入(事件,不生成节点)
+ /// 开始载入,流程启动时执行(不生成节点)
///
Loading,
///
- /// 结束(事件,不生成节点)
+ /// 结束,流程结束时执行(不生成节点)
///
Exit,
diff --git a/Net462DllTest/LogicControl/ParkingLogicControl.cs b/Net462DllTest/LogicControl/ParkingLogicControl.cs
index 37aabaa..8976855 100644
--- a/Net462DllTest/LogicControl/ParkingLogicControl.cs
+++ b/Net462DllTest/LogicControl/ParkingLogicControl.cs
@@ -1,7 +1,4 @@
-
-using Net462DllTest.Signal;
-using Net462DllTest.Trigger;
-using Net462DllTest.ViewModel;
+using Net462DllTest.Trigger;
using Serein.Library.Api;
using Serein.Library.Attributes;
using Serein.Library.Enums;
@@ -9,9 +6,6 @@ using Serein.Library.Ex;
using Serein.Library.Framework.NodeFlow;
using Serein.Library.NodeFlow.Tool;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
namespace Net462DllTest.LogicControl
@@ -79,5 +73,7 @@ namespace Net462DllTest.LogicControl
Console.WriteLine("发送命令失败:调取车位" + spaceNum);
}
}
+
+
}
}
diff --git a/Net462DllTest/LogicControl/PlcLogicControl.cs b/Net462DllTest/LogicControl/PlcLogicControl.cs
index 52c8b36..d7a575e 100644
--- a/Net462DllTest/LogicControl/PlcLogicControl.cs
+++ b/Net462DllTest/LogicControl/PlcLogicControl.cs
@@ -41,7 +41,7 @@ namespace Net462DllTest.LogicControl
}
#region 初始化、初始化完成以及退出的事件
- [NodeAction(NodeType.Init)] // Init : 初始化事件,流程启动时执行
+ [NodeAction(NodeType.Init)]
public void Init(IDynamicContext context)
{
context.Env.IOC.Register();
@@ -108,6 +108,15 @@ namespace Net462DllTest.LogicControl
#region 动作节点
+ [NodeAction(NodeType.Action, "等待")]
+ public async Task Delay(int ms = 5000)
+ {
+ await Console.Out.WriteLineAsync("开始等待");
+ await Task.Delay(ms);
+ await Console.Out.WriteLineAsync("不再等待");
+
+ }
+
[NodeAction(NodeType.Action, "PLC初始化")]
public SiemensPlcDevice PlcInit(SiemensVersion version = SiemensVersion.None,
string ip = "192.168.10.100",
@@ -153,7 +162,7 @@ namespace Net462DllTest.LogicControl
}
[NodeAction(NodeType.Action, "PLC写入变量")]
- public SiemensPlcDevice WriteVar2(object value, PlcVarName varName)
+ public SiemensPlcDevice WriteVar(object value, PlcVarName varName)
{
var varInfo = varName.ToVarInfo();
if (MyPlc.State == PlcState.Runing)
@@ -176,7 +185,6 @@ namespace Net462DllTest.LogicControl
return MyPlc;
}
-
[NodeAction(NodeType.Action, "批量读取")]
public void BatchReadVar()
{
diff --git a/Net462DllTest/Main.cs b/Net462DllTest/Main.cs
new file mode 100644
index 0000000..578a642
--- /dev/null
+++ b/Net462DllTest/Main.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Net462DllTest.Properties
+{
+ /*
+ 理想的项目架构:
+ FlowEnv - LoginControl:
+
+
+ LoginControl
+ ↙ ↘
+ (View-Interaction) (Node-Interaction)
+ ↓ ↕
+ View ←→ ViewModel ←→ Trigger ← SingleEnum
+ ↓
+ Model
+ · DataChanged → Trigger
+
+
+ 视图驱动触发器,触发器驱动数据。
+ 数据驱动触发器,触发器驱动视图。
+
+ 所以,这个结构≈事件驱动。
+
+
+ 动态的配置事件触发的原因、过程与结果。
+
+ */
+}
diff --git a/Net462DllTest/Model/PlcVarModel.cs b/Net462DllTest/Model/PlcVarModel.cs
index e0222f7..90ac957 100644
--- a/Net462DllTest/Model/PlcVarModel.cs
+++ b/Net462DllTest/Model/PlcVarModel.cs
@@ -9,21 +9,6 @@ using System.Threading.Tasks;
namespace Net462DllTest.Model
{
-
- [AttributeUsage(AttributeTargets.Property)]
- public class PlcValueAttribute : Attribute
- {
- ///
- /// 变量类型
- ///
- public PlcVarName PlcVarEnum { get; }
- public PlcValueAttribute(PlcVarName plcVarEnum)
- {
- this.PlcVarEnum = plcVarEnum;
- }
- }
-
-
///
/// PLC变量
///
diff --git a/Net462DllTest/Net462DllTest.csproj b/Net462DllTest/Net462DllTest.csproj
index 29a2c0e..d3e5791 100644
--- a/Net462DllTest/Net462DllTest.csproj
+++ b/Net462DllTest/Net462DllTest.csproj
@@ -61,6 +61,7 @@
+
diff --git a/Net462DllTest/Trigger/PrakingDevice.cs b/Net462DllTest/Trigger/PrakingDevice.cs
index 9da1b17..10420a6 100644
--- a/Net462DllTest/Trigger/PrakingDevice.cs
+++ b/Net462DllTest/Trigger/PrakingDevice.cs
@@ -12,7 +12,6 @@ namespace Net462DllTest.Trigger
[AutoRegister]
public class PrakingDevice : ChannelFlowTrigger
{
-
}
}
diff --git a/Net462DllTest/Utils/GSModel.cs b/Net462DllTest/Utils/GSModel.cs
index a94919c..a751c50 100644
--- a/Net462DllTest/Utils/GSModel.cs
+++ b/Net462DllTest/Utils/GSModel.cs
@@ -53,6 +53,8 @@ namespace Net462DllTest.Utils
il.Emit(OpCodes.Callvirt, property.GetSetMethod()); // 调用属性的Setter方法
il.Emit(OpCodes.Ret); // 返回
+
+
return (Action)method.CreateDelegate(typeof(Action));
}
diff --git a/Net462DllTest/Utils/RelayCommand.cs b/Net462DllTest/Utils/RelayCommand.cs
index e3a77f3..3ae40cf 100644
--- a/Net462DllTest/Utils/RelayCommand.cs
+++ b/Net462DllTest/Utils/RelayCommand.cs
@@ -7,6 +7,9 @@ using System.Windows.Input;
namespace Net462DllTest.Utils
{
+ ///
+ /// 用于窗体View与ViewModel进行交互
+ ///
public class RelayCommand : ICommand
{
private readonly Action