mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-29 06:33:58 +08:00
fix: 转换器实例初始化方法
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<PluginVersion>10.0.1.4</PluginVersion>
|
||||
<ProPluginVersion>10.0.1.4</ProPluginVersion>
|
||||
<PluginVersion>10.0.1.5</PluginVersion>
|
||||
<ProPluginVersion>10.0.1.5</ProPluginVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -874,7 +874,7 @@ public abstract class DeviceBase : DisposableObject, IDevice
|
||||
try
|
||||
{
|
||||
//只关闭,不释放
|
||||
Channel.SafeClose();
|
||||
_ = Channel.CloseAsync();
|
||||
if (Channel is IClientChannel client)
|
||||
{
|
||||
client.WaitHandlePool.SafeDispose();
|
||||
|
||||
@@ -118,6 +118,7 @@ public class Device : BaseDataEntity, IValidatableObject
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "冗余扫描间隔")]
|
||||
[AutoGenerateColumn(Visible = true, Filterable = true, Sortable = true)]
|
||||
[MinValue(30000)]
|
||||
public virtual int RedundantScanIntervalTime { get; set; } = 30000;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -21,10 +21,10 @@ public class Dlt645_2007Master : DeviceBase, IDtu
|
||||
public override void InitChannel(IChannel channel, ILog? deviceLog = null)
|
||||
{
|
||||
base.InitChannel(channel, deviceLog);
|
||||
ThingsGatewayBitConverter = new Dlt645_2007BitConverter(EndianType.Big);
|
||||
RegisterByteLength = 2;
|
||||
channel.MaxSign = ushort.MaxValue;
|
||||
}
|
||||
public override IThingsGatewayBitConverter ThingsGatewayBitConverter { get; protected set; } = new Dlt645_2007BitConverter(EndianType.Big) { };
|
||||
|
||||
/// <summary>
|
||||
/// 客户端连接滑动过期时间(TCP服务通道时)
|
||||
|
||||
@@ -18,10 +18,10 @@ public partial class ModbusMaster : DeviceBase, IDtu
|
||||
{
|
||||
base.InitChannel(channel, deviceLog);
|
||||
|
||||
ThingsGatewayBitConverter = new ThingsGatewayBitConverter(EndianType.Big);
|
||||
RegisterByteLength = 2;
|
||||
channel.MaxSign = ushort.MaxValue;
|
||||
}
|
||||
public override IThingsGatewayBitConverter ThingsGatewayBitConverter { get; protected set; } = new ThingsGatewayBitConverter(EndianType.Big) { };
|
||||
|
||||
/// <summary>
|
||||
/// 客户端连接滑动过期时间(TCP服务通道时)
|
||||
|
||||
@@ -48,10 +48,10 @@ public class ModbusSlave : DeviceBase, ITcpService, IDtuClient
|
||||
public override void InitChannel(IChannel channel, ILog? deviceLog = null)
|
||||
{
|
||||
base.InitChannel(channel, deviceLog);
|
||||
ThingsGatewayBitConverter = new ThingsGatewayBitConverter(EndianType.Big);
|
||||
RegisterByteLength = 2;
|
||||
channel.MaxSign = ushort.MaxValue;
|
||||
}
|
||||
public override IThingsGatewayBitConverter ThingsGatewayBitConverter { get; protected set; } = new ThingsGatewayBitConverter(EndianType.Big) { };
|
||||
|
||||
public override bool SupportMultipleDevice()
|
||||
{
|
||||
|
||||
@@ -24,9 +24,9 @@ public partial class SiemensS7Master : DeviceBase
|
||||
base.InitChannel(channel, deviceLog);
|
||||
|
||||
RegisterByteLength = 1;
|
||||
ThingsGatewayBitConverter = new S7BitConverter(EndianType.Big);
|
||||
|
||||
}
|
||||
public override IThingsGatewayBitConverter ThingsGatewayBitConverter { get; protected set; } = new S7BitConverter(EndianType.Big) { };
|
||||
|
||||
/// <summary>
|
||||
/// PduLength
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>10.0.1.4</Version>
|
||||
<Version>10.0.1.5</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user