diff --git a/csharp/App/SinexcelCommunication/DataTypes/Configuration.cs b/csharp/App/SinexcelCommunication/DataTypes/Configuration.cs index 705698450..ea5dea85d 100644 --- a/csharp/App/SinexcelCommunication/DataTypes/Configuration.cs +++ b/csharp/App/SinexcelCommunication/DataTypes/Configuration.cs @@ -4,10 +4,17 @@ namespace InnovEnergy.App.SinexcelCommunication.DataTypes; public class Configuration { - public Double MinimumSoC { get; set; } - public Double MaximumDischargingCurrent { get; set; } - public Double MaximumChargingCurrent { get; set; } - public WorkingMode OperatingPriority { get; set; } - public Int16 BatteriesCount { get; set; } + public Double MinimumSoC { get; set; } + public Double MaximumDischargingCurrent { get; set; } + public Double MaximumChargingCurrent { get; set; } + public WorkingMode OperatingPriority { get; set; } + public Int16 BatteriesCount { get; set; } + public Int16 ClusterNumber { get; set; } + public Int16 PvNumber { get; set; } + public DateTime StartTimeChargeandDischargeDayandTime { get; set; } + public DateTime StopTimeChargeandDischargeDayandTime { get; set; } + public Single TimeChargeandDischargePower { get; set; } + public Boolean ControlPermission { get; set; } } + diff --git a/csharp/Lib/Protocols/Modbus/Channels/ConnectionChannel.cs b/csharp/Lib/Protocols/Modbus/Channels/ConnectionChannel.cs index bafbe947c..1502ed0ee 100644 --- a/csharp/Lib/Protocols/Modbus/Channels/ConnectionChannel.cs +++ b/csharp/Lib/Protocols/Modbus/Channels/ConnectionChannel.cs @@ -22,7 +22,11 @@ public abstract class ConnectionChannel : Channel, IDisposable _CloseAfterSuccessfulWrite = closeAfterSuccessfulWrite; _CloseAfterException = closeAfterException ?? (_ => true); } - + // 👇 NEW: optional per-connection buffer clear + protected virtual void ClearBuffers(T connection) + { + // default: do nothing + } public override IReadOnlyList Read(Int32 nBytes) { try @@ -66,7 +70,7 @@ public abstract class ConnectionChannel : Channel, IDisposable private T Connection => _Connection ??= Open(); - + private void Close() {