Compare commits

...

6 Commits

Author SHA1 Message Date
Kimdiego2098
71ebb36fe9 更新文档 2023-10-19 20:36:28 +08:00
Kimdiego2098
78a0b86327 更新版本:3.0.0.20 2023-10-19 20:27:31 +08:00
Kimdiego2098
2636c16a97 优化modbusServer内存管理 2023-10-19 20:24:39 +08:00
Kimdiego2098
fd77c0242d update touchsocket 2023-10-19 20:23:43 +08:00
Kimdiego2098
e74819a900 update toucksocket 2023-10-18 21:51:49 +08:00
Kimdiego2098
9b7f696c9b 更新文档 2023-10-18 20:42:10 +08:00
73 changed files with 370 additions and 244 deletions

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.18</Version>
<Version>3.0.0.20</Version>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>Diego</Authors>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.19</Version>
<Version>3.0.0.20</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net45;netstandard2.0;net6.0;net7.0</TargetFrameworks>

View File

@@ -409,13 +409,9 @@ public class ModbusSerialServer : ReadWriteDevicesSerialSessionBase
private void Init(ModbusAddress mAddress)
{
if (ModbusServer01ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer01ByteBlocks[mAddress.Station].SetLength(1024 * 128);
if (ModbusServer02ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer02ByteBlocks[mAddress.Station].SetLength(1024 * 128);
if (ModbusServer03ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer03ByteBlocks[mAddress.Station].SetLength(1024 * 128);
if (ModbusServer04ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer04ByteBlocks[mAddress.Station].SetLength(1024 * 128);
ModbusServer01ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
ModbusServer02ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
ModbusServer03ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
ModbusServer04ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
}
}

View File

@@ -429,13 +429,9 @@ public class ModbusTcpServer : ReadWriteDevicesTcpServerBase
private void Init(ModbusAddress mAddress)
{
if (ModbusServer01ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer01ByteBlocks[mAddress.Station].SetLength(1024 * 128);
if (ModbusServer02ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer02ByteBlocks[mAddress.Station].SetLength(1024 * 128);
if (ModbusServer03ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer03ByteBlocks[mAddress.Station].SetLength(1024 * 128);
if (ModbusServer04ByteBlocks.TryAdd(mAddress.Station, new(1024 * 128)))
ModbusServer04ByteBlocks[mAddress.Station].SetLength(1024 * 128);
ModbusServer01ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
ModbusServer02ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
ModbusServer03ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
ModbusServer04ByteBlocks.GetOrAdd(mAddress.Station, a => new ByteBlock(1024 * 128));
}
}

View File

@@ -27,8 +27,7 @@ using System.Runtime.CompilerServices;
namespace ThingsGateway.Foundation.Core
{
/// <summary>
/// 具有释放的对象。
/// 并未实现析构函数相关。
/// 具有释放的对象。内部实现了GC.SuppressFinalize但不包括析构函数相关。
/// </summary>
public partial class DisposableObject : IDisposable
{
@@ -65,11 +64,12 @@ namespace ThingsGateway.Foundation.Core
}
/// <summary>
/// 释放资源。
/// 释放资源。内部已经处理了<see cref="GC.SuppressFinalize(object)"/>
/// </summary>
public void Dispose()
{
this.Dispose(disposing: true);
GC.SuppressFinalize(this);
}
}
}

View File

@@ -70,6 +70,15 @@ namespace ThingsGateway.Foundation.Core
return isPeriod;
}
/// <summary>
/// 累计增加一个计数
/// </summary>
/// <returns></returns>
public bool Increment()
{
return this.Increment(1);
}
/// <summary>
/// 重置<see cref="Count"/>和<see cref="LastIncrement"/>
/// </summary>

View File

@@ -47,14 +47,7 @@ namespace ThingsGateway.Foundation.Core
/// </summary>
public TimeSpan Period { get; set; }
/// <summary>
/// 重置<see cref="Count"/>和<see cref="LastIncrement"/>
/// </summary>
public void Reset()
{
this.m_count = 0;
this.m_lastIncrement = default;
}
/// <summary>
/// 累计增加计数
@@ -78,5 +71,26 @@ namespace ThingsGateway.Foundation.Core
Interlocked.Add(ref this.m_count, value);
return isPeriod;
}
/// <summary>
/// 累计增加一个计数
/// </summary>
/// <returns></returns>
public bool Increment()
{
return this.Increment(1);
}
/// <summary>
/// 重置<see cref="Count"/>和<see cref="LastIncrement"/>
/// </summary>
public void Reset()
{
this.m_count = 0;
this.m_lastIncrement = default;
}
}
}

View File

@@ -760,7 +760,15 @@ public class SerialSessionBase : BaseSerial, ISerialSession
this.m_serialCore.Reset(serialPort);
this.m_serialCore.OnReceived = this.HandleReceived;
this.m_serialCore.OnBreakOut = this.BreakOut;
if (this.Config.GetValue(TouchSocketConfigExtension.MinBufferSizeProperty) is int minValue)
{
this.m_serialCore.MinBufferSize = minValue;
}
if (this.Config.GetValue(TouchSocketConfigExtension.MaxBufferSizeProperty) is int maxValue)
{
this.m_serialCore.MaxBufferSize = maxValue;
}
}
private void HandleReceived(SerialCore core, ByteBlock byteBlock)

View File

@@ -227,6 +227,15 @@ namespace ThingsGateway.Foundation.Sockets
tcpCore.Reset(socket);
tcpCore.OnReceived = this.HandleReceived;
tcpCore.OnBreakOut = this.BreakOut;
if (this.Config.GetValue(TouchSocketConfigExtension.MinBufferSizeProperty) is int minValue)
{
tcpCore.MinBufferSize = minValue;
}
if (this.Config.GetValue(TouchSocketConfigExtension.MaxBufferSizeProperty) is int maxValue)
{
tcpCore.MaxBufferSize = maxValue;
}
this.m_tcpCore = tcpCore;
}

View File

@@ -497,6 +497,11 @@ namespace ThingsGateway.Foundation.Sockets
#endregion
/// <inheritdoc/>
public override string ToString()
{
return this.GetIPPort();
}
private void BreakOut(TcpCore core, bool manual, string msg)
{
lock (this.SyncRoot)
@@ -931,7 +936,15 @@ namespace ThingsGateway.Foundation.Sockets
this.m_tcpCore.Reset(socket);
this.m_tcpCore.OnReceived = this.HandleReceived;
this.m_tcpCore.OnBreakOut = this.BreakOut;
if (this.Config.GetValue(TouchSocketConfigExtension.MinBufferSizeProperty) is int minValue)
{
this.m_tcpCore.MinBufferSize = minValue;
}
if (this.Config.GetValue(TouchSocketConfigExtension.MaxBufferSizeProperty) is int maxValue)
{
this.m_tcpCore.MaxBufferSize = maxValue;
}
}
private void HandleReceived(TcpCore core, ByteBlock byteBlock)

View File

@@ -209,7 +209,7 @@ namespace ThingsGateway.Foundation.Sockets
/// <param name="e"></param>
protected virtual Task OnDisconnecting(TClient socketClient, DisconnectEventArgs e)
{
if (this.Disconnected != null)
if (this.Disconnecting != null)
{
return this.Disconnecting.Invoke(socketClient, e);
}

View File

@@ -155,6 +155,11 @@ namespace ThingsGateway.Foundation.Sockets
/// <param name="tcpCore"></param>
public void ReturnTcpCore(TcpCore tcpCore)
{
if (this.DisposedValue)
{
tcpCore.SafeDispose();
return;
}
this.m_tcpCores.Push(tcpCore);
}

View File

@@ -51,6 +51,54 @@ namespace ThingsGateway.Foundation.Sockets
public static readonly DependencyProperty<Func<UdpDataHandlingAdapter>> UdpDataHandlingAdapterProperty = DependencyProperty<Func<UdpDataHandlingAdapter>>.Register("UdpDataHandlingAdapter", () => { return new NormalUdpDataHandlingAdapter(); });
/// <summary>
/// 最小缓存池尺寸
/// 所需类型<see cref="int"/>
/// </summary>
public static readonly DependencyProperty<int?> MinBufferSizeProperty = DependencyProperty<int?>.Register("MinBufferSize", default);
/// <summary>
/// 最大缓存池尺寸
/// 所需类型<see cref="int"/>
/// </summary>
public static readonly DependencyProperty<int?> MaxBufferSizeProperty = DependencyProperty<int?>.Register("MinBufferSize", default);
/// <summary>
/// 最小缓存容量,默认缺省。
/// <list type="number">
/// </list>
/// </summary>
/// <param name="config"></param>
/// <param name="value"></param>
/// <returns></returns>
public static TouchSocketConfig MinBufferSize(this TouchSocketConfig config, int value)
{
if (value < 1024)
{
throw new ArgumentOutOfRangeException(nameof(value), value, "数值不能小于1024");
}
config.SetValue(MinBufferSizeProperty, value);
return config;
}
/// <summary>
/// 最大缓存容量,默认缺省。
/// <list type="number">
/// </list>
/// </summary>
/// <param name="config"></param>
/// <param name="value"></param>
/// <returns></returns>
public static TouchSocketConfig MaxBufferSize(this TouchSocketConfig config, int value)
{
if (value < 1024)
{
throw new ArgumentOutOfRangeException(nameof(value), value, "数值不能小于1024");
}
config.SetValue(MaxBufferSizeProperty, value);
return config;
}
/// <summary>
/// 发送超时设定单位毫秒默认为0。意为禁用该配置。
/// </summary>

View File

@@ -22,7 +22,13 @@ namespace ThingsGateway.Foundation.Sockets
private readonly AsyncAutoResetEvent m_resetEventForRead = new AsyncAutoResetEvent(false);
private ByteBlock m_byteBlock;
private IRequestInfo m_requestInfo;
/// <summary>
/// Receiver
/// </summary>
~Receiver()
{
this.Dispose(false);
}
/// <summary>
/// Receiver
/// </summary>
@@ -74,9 +80,15 @@ namespace ThingsGateway.Foundation.Sockets
/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
this.m_client.ClearReceiver();
//this.m_resetEventForComplateRead.SafeDispose();
this.m_resetEventForRead.SafeDispose();
if (disposing)
{
this.m_client.ClearReceiver();
}
else
{
this.m_resetEventForRead.SafeDispose();
}
this.m_byteBlock = null;
base.Dispose(disposing);
}

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.18</Version>
<Version>3.0.0.20</Version>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.18</Version>
<Version>3.0.0.20</Version>
<LangVersion>latest</LangVersion>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>Diego</Authors>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.0.0.18</Version>
<Version>3.0.0.20</Version>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>

View File

@@ -6,7 +6,7 @@ export const language = ["en","zh"];
export const removeDefaultStopWordFilter = false;
export const removeDefaultStemmer = false;
export { default as Mark } from "E:\\Tg\\ThingsGateway\\ThingsGateway-DEV\\handbook\\node_modules\\mark.js\\dist\\mark.js"
export const searchIndexUrl = "search-index{dir}.json?_=590a19da";
export const searchIndexUrl = "search-index{dir}.json?_=5f24d3ee";
export const searchResultLimits = 8;
export const searchResultContextMaxLength = 50;
export const explicitSearchResultPath = true;

View File

@@ -227,9 +227,9 @@
"179": {
"js": [
{
"file": "assets/js/main.4e65a7c4.js",
"hash": "7245ddb629dafe73",
"publicPath": "/thingsgateway-docs/assets/js/main.4e65a7c4.js"
"file": "assets/js/main.cf42840d.js",
"hash": "41e8aa8c7cbe401b",
"publicPath": "/thingsgateway-docs/assets/js/main.cf42840d.js"
}
]
},
@@ -299,9 +299,9 @@
"1303": {
"js": [
{
"file": "assets/js/runtime~main.7f6e9c09.js",
"hash": "aedff306f0f845ba",
"publicPath": "/thingsgateway-docs/assets/js/runtime~main.7f6e9c09.js"
"file": "assets/js/runtime~main.2b19bbf8.js",
"hash": "e48e0c0408aa1c4e",
"publicPath": "/thingsgateway-docs/assets/js/runtime~main.2b19bbf8.js"
}
]
},
@@ -326,9 +326,9 @@
"1822": {
"js": [
{
"file": "assets/js/f05a39b7.bfb8e652.js",
"hash": "3d8f498000b417cb",
"publicPath": "/thingsgateway-docs/assets/js/f05a39b7.bfb8e652.js"
"file": "assets/js/f05a39b7.a300eca8.js",
"hash": "67b94ba06477a5ab",
"publicPath": "/thingsgateway-docs/assets/js/f05a39b7.a300eca8.js"
}
]
},
@@ -619,9 +619,9 @@
"8707": {
"js": [
{
"file": "assets/js/4c79e569.3f1e7d8c.js",
"hash": "5ca0c0dec325073e",
"publicPath": "/thingsgateway-docs/assets/js/4c79e569.3f1e7d8c.js"
"file": "assets/js/4c79e569.5c5c0d05.js",
"hash": "e9c712a478ed50e6",
"publicPath": "/thingsgateway-docs/assets/js/4c79e569.5c5c0d05.js"
}
]
},

View File

@@ -12,8 +12,8 @@
"tags": [],
"version": "current",
"lastUpdatedBy": "Kimdiego2098",
"lastUpdatedAt": 1695729838,
"formattedLastUpdatedAt": "Sep 26, 2023",
"lastUpdatedAt": 1697449154,
"formattedLastUpdatedAt": "Oct 16, 2023",
"frontMatter": {
"id": "enterprise",
"title": "Pro版相关"

View File

@@ -11,9 +11,9 @@
"editUrl": "https://gitee.com/diego2098/ThingsGateway/tree/master/handbook/docs/upgrade.mdx",
"tags": [],
"version": "current",
"lastUpdatedBy": "Diego2098",
"lastUpdatedAt": 1691418711,
"formattedLastUpdatedAt": "Aug 7, 2023",
"lastUpdatedBy": "Kimdiego2098",
"lastUpdatedAt": 1697632930,
"formattedLastUpdatedAt": "Oct 18, 2023",
"frontMatter": {
"id": "upgrade",
"title": "历史更新"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -18,15 +18,31 @@ import Tag from "@site/src/components/Tag.js";
:::
## v2.1.0(未发布)
- &nbsp;<Tag>新增</Tag> 添加TDengine时序库存储
## v3.0.0.20(已发布)
- &nbsp;<Tag>新增</Tag> 添加报警延时逻辑
- &nbsp;<Tag>优化</Tag> 优化ModbusServer GC频繁的问题
- &nbsp;<Tag>新增</Tag> 添加采集数据延时确认逻辑
- &nbsp;<Tag>优化</Tag> 去除DateTimeOffset类型
## v3.0.0.19(已发布)
- &nbsp;<Tag>新增</Tag> 添加TDengineDB时序库上传插件
- &nbsp;<Tag>新增</Tag> 添加QuestDB时序库上传插件
- &nbsp;<Tag>新增</Tag> 添加DLT645采集插件
- &nbsp;<Tag>新增</Tag> 添加调试软件
- &nbsp;<Tag>新增</Tag> 添加远程更新软件
- &nbsp;<Tag>优化</Tag> 优化OPCUA驱动
- &nbsp;<Tag>优化</Tag> 优化Modbus驱动
- &nbsp;<Tag>优化</Tag> 优化S7驱动
- &nbsp;<Tag>优化</Tag> RPC服务
- &nbsp;<Tag>优化</Tag> 其他人性化操作
- &nbsp;<Tag>调整</Tag> 内嵌TouckSocket
- &nbsp;<Tag>修复</Tag> 内存泄露
- &nbsp;<Tag>修复</Tag> 串口断连/拔出/断电等情况,重新连接
- &nbsp;<Tag>修复</Tag> 其他bug
## v2.0.0(已发布)