From 3b32b8a6dc741d2e9b96c378fed10bbeac24a415 Mon Sep 17 00:00:00 2001 From: atef Date: Fri, 13 Feb 2026 09:40:21 +0100 Subject: [PATCH] update the config file sinexcel --- .../DataTypes/Configuration.cs | 17 ++++++++++++----- .../Modbus/Channels/ConnectionChannel.cs | 8 ++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) 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() {