From 7a6f8c407b58c4f31e5ae0cb8b42545672e7f554 Mon Sep 17 00:00:00 2001
From: fengjiayi <12821976+ning_xi@user.noreply.gitee.com>
Date: Thu, 26 Dec 2024 16:42:05 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BA=86=E4=B8=AD=E6=96=AD?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E5=90=8E=E5=8F=B0=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E4=B8=8EUI=E4=BA=A4=E4=BA=92=EF=BC=88=E5=BE=85=E9=87=8D?=
=?UTF-8?q?=E5=86=99=EF=BC=89=EF=BC=9B=E9=87=8D=E5=86=99=E8=BF=90=E8=A1=8C?=
=?UTF-8?q?=E6=97=B6=E8=8A=82=E7=82=B9=E8=8E=B7=E5=8F=96=E5=8F=82=E6=95=B0?=
=?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=9B=E9=87=8D=E5=86=99=E4=BA=86?=
=?UTF-8?q?=E8=8A=82=E7=82=B9=E5=AE=B9=E5=99=A8=E7=9A=84=E4=BA=92=E5=8A=A8?=
=?UTF-8?q?=EF=BC=9B=E5=AE=8C=E5=96=84=E4=BA=86WebSocket=E8=BF=9C=E7=A8=8B?=
=?UTF-8?q?=E4=BA=A4=E4=BA=92=EF=BC=9B=E5=AE=8C=E5=96=84=E4=BA=86=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E6=96=87=E4=BB=B6=E7=9A=84=E5=8A=A0=E8=BD=BD=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Library.Core/FlipflopContext.cs | 1 +
Library.Framework/FlipflopContext.cs | 1 +
Library/Api/IFlipflopContext.cs | 1 +
Library/Api/IFlowEnvironment.cs | 21 +-
Library/Api/IFlowTrigger.cs | 12 +-
Library/Api/INodeContainer.cs | 4 +-
Library/FlowNode/NodeDebugSetting.cs | 5 +-
Library/FlowNode/NodeModelBaseFunc.cs | 364 +++--------------
Library/FlowNode/ParameterDetails.cs | 139 ++++++-
Library/Network/WebSocket/Handle/Attribute.cs | 2 +-
Library/Serein.Library.csproj | 2 +
Library/Utils/ChannelFlowInterrupt.cs | 353 -----------------
.../ChannelFlowInterrupt.cs} | 57 +--
.../{ => FlowTrigger}/ChannelFlowTrigger.cs | 6 +-
Library/Utils/FlowTrigger/TaskFlowTrigger.cs | 160 ++++++++
Library/Utils/FlowTrigger/TriggerResult.cs | 112 ++++++
Net462DllTest/Trigger/PrakingDevice.cs | 1 +
Net462DllTest/Trigger/SiemensPlcDevice.cs | 1 +
Net462DllTest/Trigger/ViewManagement.cs | 1 +
NodeFlow/Env/FlowEnvironment.cs | 366 ++++++------------
NodeFlow/Env/FlowEnvironmentDecorator.cs | 39 +-
NodeFlow/Env/MsgControllerOfClient.cs | 21 +
NodeFlow/Env/MsgControllerOfServer.cs | 43 +-
NodeFlow/Env/RemoteFlowEnvironment.cs | 59 ++-
NodeFlow/FlowStarter.cs | 10 +-
NodeFlow/Model/SingleActionNode.cs | 9 -
NodeFlow/Model/SingleFlipflopNode.cs | 7 +-
NodeFlow/Model/SingleGlobalDataNode.cs | 59 +--
NodeFlow/Model/SingleScriptNode.cs | 2 +-
.../ParameterDetailsPropertyGenerator.cs | 2 +-
WorkBench/App.xaml.cs | 2 +-
WorkBench/MainWindow.xaml.cs | 80 ++--
WorkBench/Themes/NodeTreeViewControl.xaml.cs | 2 +-
WorkBench/Themes/ObjectViewerControl.xaml.cs | 22 +-
Workbench/Node/INodeContainerControl.cs | 4 +-
Workbench/Node/NodeControlBase.cs | 22 +-
Workbench/Node/View/GlobalDataControl.xaml.cs | 15 +-
37 files changed, 880 insertions(+), 1127 deletions(-)
delete mode 100644 Library/Utils/ChannelFlowInterrupt.cs
rename Library/Utils/{TaskFlowTrigger.cs => FlowTrigger/ChannelFlowInterrupt.cs} (79%)
rename Library/Utils/{ => FlowTrigger}/ChannelFlowTrigger.cs (98%)
create mode 100644 Library/Utils/FlowTrigger/TaskFlowTrigger.cs
create mode 100644 Library/Utils/FlowTrigger/TriggerResult.cs
diff --git a/Library.Core/FlipflopContext.cs b/Library.Core/FlipflopContext.cs
index cabf969..2b59544 100644
--- a/Library.Core/FlipflopContext.cs
+++ b/Library.Core/FlipflopContext.cs
@@ -1,4 +1,5 @@
using Serein.Library.Api;
+using Serein.Library.Utils;
namespace Serein.Library.Core
{
diff --git a/Library.Framework/FlipflopContext.cs b/Library.Framework/FlipflopContext.cs
index c3fa51a..c4a9e2c 100644
--- a/Library.Framework/FlipflopContext.cs
+++ b/Library.Framework/FlipflopContext.cs
@@ -1,4 +1,5 @@
using Serein.Library.Api;
+using Serein.Library.Utils;
using System;
using System.Threading.Tasks;
diff --git a/Library/Api/IFlipflopContext.cs b/Library/Api/IFlipflopContext.cs
index 10be21e..5931213 100644
--- a/Library/Api/IFlipflopContext.cs
+++ b/Library/Api/IFlipflopContext.cs
@@ -1,4 +1,5 @@
using Serein.Library;
+using Serein.Library.Utils;
namespace Serein.Library.Api
diff --git a/Library/Api/IFlowEnvironment.cs b/Library/Api/IFlowEnvironment.cs
index 3da5c7b..81da808 100644
--- a/Library/Api/IFlowEnvironment.cs
+++ b/Library/Api/IFlowEnvironment.cs
@@ -6,7 +6,6 @@ using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
-using static Serein.Library.Utils.ChannelFlowInterrupt;
namespace Serein.Library.Api
{
@@ -203,7 +202,7 @@ namespace Serein.Library.Api
///
/// 移除
///
- Remote,
+ Remove,
}
///
@@ -311,9 +310,9 @@ namespace Serein.Library.Api
//}
///
- /// 节点Model对象,目前需要手动转换对应的类型
+ /// 节点Model对象
///
- public object NodeModel { get; private set; }
+ public NodeModelBase NodeModel { get; private set; }
public PositionOfUI Position { get; private set; }
//public bool IsAddInRegion { get; private set; }
public string RegeionGuid { get; private set; }
@@ -934,13 +933,17 @@ namespace Serein.Library.Api
void TerminateFlipflopNode(string nodeGuid);
- ///
+
+ #region 节点中断、表达式
+#if false
+
+///
/// 设置节点中断
///
/// 更改中断状态的节点Guid
/// 是否中断
///
- Task SetNodeInterruptAsync(string nodeGuid,bool isInterrup);
+ Task SetNodeInterruptAsync(string nodeGuid, bool isInterrup);
///
/// 添加作用于某个对象的中断表达式
@@ -955,7 +958,7 @@ namespace Serein.Library.Api
///
/// 需要监视的对象
/// 是否启用监视
- void SetMonitorObjState(string key,bool isMonitor);
+ void SetMonitorObjState(string key, bool isMonitor);
///
/// 检查一个对象是否处于监听状态,如果是,则传出与该对象相关的表达式(用于中断),如果不是,则返回false。
@@ -971,7 +974,9 @@ namespace Serein.Library.Api
///
///
///
- Task GetOrCreateGlobalInterruptAsync();
+ Task InterruptNode();
+#endif
+ #endregion
///
/// (用于远程)通知节点属性变更
diff --git a/Library/Api/IFlowTrigger.cs b/Library/Api/IFlowTrigger.cs
index 33b07bb..844547e 100644
--- a/Library/Api/IFlowTrigger.cs
+++ b/Library/Api/IFlowTrigger.cs
@@ -1,11 +1,15 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using Serein.Library.Utils;
+using System;
using System.Threading.Tasks;
namespace Serein.Library.Api
{
+
+
+
+
+
+
///
/// 触发器接口
///
diff --git a/Library/Api/INodeContainer.cs b/Library/Api/INodeContainer.cs
index 5473605..777902d 100644
--- a/Library/Api/INodeContainer.cs
+++ b/Library/Api/INodeContainer.cs
@@ -15,13 +15,13 @@ namespace Serein.Library.Api
/// 放置一个节点
///
///
- void PlaceNode(NodeModelBase nodeModel);
+ bool PlaceNode(NodeModelBase nodeModel);
///
/// 取出一个节点
///
///
- void TakeOutNode(NodeModelBase nodeModel);
+ bool TakeOutNode(NodeModelBase nodeModel);
///
/// 取出所有节点(用于删除容器)
diff --git a/Library/FlowNode/NodeDebugSetting.cs b/Library/FlowNode/NodeDebugSetting.cs
index e7e3edd..492aa70 100644
--- a/Library/FlowNode/NodeDebugSetting.cs
+++ b/Library/FlowNode/NodeDebugSetting.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
-using static Serein.Library.Utils.ChannelFlowInterrupt;
namespace Serein.Library
{
@@ -42,7 +41,7 @@ namespace Serein.Library
///
/// 中断级别,暂时停止继续执行后继分支。
///
- [PropertyInfo(IsNotification = true, CustomCodeAtEnd = "NodeModel?.Env?.SetNodeInterruptAsync(NodeModel?.Guid, value);")] // CustomCode = "NodeModel?.Env?.SetNodeInterruptAsync(NodeModel?.Guid, value);"
+ [PropertyInfo(IsNotification = true, CustomCodeAtEnd = "// NodeModel?.Env?.SetNodeInterruptAsync(NodeModel?.Guid, value);")] // CustomCode = "NodeModel?.Env?.SetNodeInterruptAsync(NodeModel?.Guid, value);"
private bool _isInterrupt = false;
///
@@ -55,7 +54,7 @@ namespace Serein.Library
/// 中断Task(用来中断)
///
[PropertyInfo]
- private Func> _getInterruptTask;
+ private Func _getInterruptTask;
}
diff --git a/Library/FlowNode/NodeModelBaseFunc.cs b/Library/FlowNode/NodeModelBaseFunc.cs
index 11407b6..fb8746d 100644
--- a/Library/FlowNode/NodeModelBaseFunc.cs
+++ b/Library/FlowNode/NodeModelBaseFunc.cs
@@ -16,7 +16,6 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;
-using static Serein.Library.Utils.ChannelFlowInterrupt;
namespace Serein.Library
{
@@ -366,16 +365,15 @@ namespace Serein.Library
/// 节点传回数据对象
public virtual async Task