From 55213252636f82ca4080b312158cd068976fe99d Mon Sep 17 00:00:00 2001
From: SL <123@123.com>
Date: Sun, 8 Oct 2023 21:18:59 +0800
Subject: [PATCH] =?UTF-8?q?[Common]=20=E5=A2=9E=E5=8A=A0DataRecorderManage?=
=?UTF-8?q?r=E5=8F=8A=E5=85=B6=E7=9B=B8=E5=85=B3=E5=AF=B9=E8=B1=A1?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Aitex/Core/RT/DBCore/PostgresqlHelper.cs | 24 +-
.../HighPerformance/DataHolder.cs | 99 +++++
.../HighPerformance/DataRecorderCache.cs | 304 ++++++++++++++
.../DataRecorderDataTableCache.cs | 150 +++++++
.../HighPerformance/DataRecorderManager.cs | 371 ++++++++++++++++++
.../DefaultDataRecorderCallback.cs | 37 ++
.../HighPerformance/IDataRecorderCache.cs | 20 +
.../HighPerformance/IDataRecorderCallback.cs | 13 +
.../MECF.Framework.Common.csproj | 7 +
9 files changed, 1018 insertions(+), 7 deletions(-)
create mode 100644 MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DataHolder.cs
create mode 100644 MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DataRecorderCache.cs
create mode 100644 MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DataRecorderDataTableCache.cs
create mode 100644 MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DataRecorderManager.cs
create mode 100644 MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DefaultDataRecorderCallback.cs
create mode 100644 MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/IDataRecorderCache.cs
create mode 100644 MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/IDataRecorderCallback.cs
diff --git a/MECF.Framework.Common/Aitex/Core/RT/DBCore/PostgresqlHelper.cs b/MECF.Framework.Common/Aitex/Core/RT/DBCore/PostgresqlHelper.cs
index c3ea492..5f622d9 100644
--- a/MECF.Framework.Common/Aitex/Core/RT/DBCore/PostgresqlHelper.cs
+++ b/MECF.Framework.Common/Aitex/Core/RT/DBCore/PostgresqlHelper.cs
@@ -5,9 +5,6 @@ using System.Collections.Generic;
using System.Configuration;
using System.Data.Common;
using System.Data;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Aitex.Core.RT.DBCore
{
@@ -16,17 +13,30 @@ namespace Aitex.Core.RT.DBCore
///
/// 数据库名称
///
- public string DBName;
+ private readonly string _dbName;
///
/// 连接字符串
///
- private string _connString = ConfigurationManager.ConnectionStrings["PostgreSQL"].ConnectionString;
+ private readonly string _connString;
+
+ #region Constructors
public PostgreSQLHelper(string dBName)
{
- DBName = dBName;
- }
+ _dbName = dBName;
+ _connString = ConfigurationManager.ConnectionStrings["PostgreSQL"].ConnectionString;
+ }
+
+ #endregion
+
+ #region Properties
+
+ public string DBName => _dbName;
+
+ public string ConnectionString => _connString;
+
+ #endregion
public string GetSqlByNameType(string name, Type type)
{
diff --git a/MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DataHolder.cs b/MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DataHolder.cs
new file mode 100644
index 0000000..7ba3a53
--- /dev/null
+++ b/MECF.Framework.Common/Aitex/Core/RT/DataCollection/HighPerformance/DataHolder.cs
@@ -0,0 +1,99 @@
+using Aitex.Core.RT.Log;
+using Aitex.Core.Util;
+using System;
+using System.Collections.Generic;
+
+namespace Aitex.Core.RT.DataCollection.HighPerformance
+{
+ ///
+ /// 数据收集器对象,用于收集在中注册的数据源的数据。
+ ///
+ public class DataHolder
+ {
+ #region Variables
+
+ private readonly Dictionary _buffer = new ();
+ private readonly R_TRIG _rTrigReadFailed = new ();
+
+ #endregion
+
+ #region Constructors
+
+ public DataHolder(int index, string name, Func