mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-15 04:16:34 +08:00
增加流程运行特性:支持异步节点
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Net462DllTest.LogicControl
|
||||
}
|
||||
|
||||
#region 初始化、初始化完成以及退出的事件
|
||||
[NodeAction(NodeType.Init)] // Init : 初始化事件,流程启动时执行
|
||||
[NodeAction(NodeType.Init)]
|
||||
public void Init(IDynamicContext context)
|
||||
{
|
||||
context.Env.IOC.Register<IRouter, Router>();
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user