From 08fcd7496f52ef1800416b5eec863895a30c5424 Mon Sep 17 00:00:00 2001 From: atef Date: Fri, 13 Feb 2026 09:29:08 +0100 Subject: [PATCH] Add Alarm and Warning to sinexcel product. Add time charge and discharge and control permession to config file --- .../SystemConfig/Config.cs | 31 ++++++++---- .../DataType/AlarmAndWarning.cs | 48 +++++++++++++++++++ 2 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 csharp/Sinexcel 12K TL/DataType/AlarmAndWarning.cs diff --git a/csharp/App/SinexcelCommunication/SystemConfig/Config.cs b/csharp/App/SinexcelCommunication/SystemConfig/Config.cs index b13920d0b..b1d244755 100644 --- a/csharp/App/SinexcelCommunication/SystemConfig/Config.cs +++ b/csharp/App/SinexcelCommunication/SystemConfig/Config.cs @@ -16,15 +16,23 @@ public class Config private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; - public required Double MinSoc { get; set; } - public required Double GridSetPoint { get; set; } - public required Double MaximumDischargingCurrent { get; set; } - public required Double MaximumChargingCurrent { get; set; } - public required WorkingMode OperatingPriority { get; set; } - public required Int16 BatteriesCount { get; set; } - public required Double ModbusProtcolNumber { get; set; } + public required Double MinSoc { get; set; } + public required Double GridSetPoint { get; set; } + public required Double MaximumDischargingCurrent { get; set; } + public required Double MaximumChargingCurrent { get; set; } + public required WorkingMode OperatingPriority { get; set; } + public required Int16 BatteriesCount { get; set; } + public required Int16 ClusterNumber { get; set; } + public required Int16 PvNumber { get; set; } + public required Double ModbusProtcolNumber { get; set; } + public required DateTime StartTimeChargeandDischargeDayandTime { get; set; } + public required DateTime StopTimeChargeandDischargeDayandTime { get; set; } - public required S3Config? S3 { get; set; } + public required Single TimeChargeandDischargePower { get; set; } + public required Boolean ControlPermission { get; set; } + + + public required S3Config? S3 { get; set; } private static String? LastSavedData { get; set; } @@ -36,7 +44,14 @@ public class Config MaximumDischargingCurrent = 180, OperatingPriority = WorkingMode.TimeChargeDischarge, BatteriesCount = 0, + ClusterNumber = 0, + PvNumber = 0, ModbusProtcolNumber = 1.2, + StartTimeChargeandDischargeDayandTime = DefaultDatetime, + StopTimeChargeandDischargeDayandTime = DefaultDatetime, + TimeChargeandDischargePower = 3, + ControlPermission = false, + S3 = new() { Bucket = "1-3e5b3069-214a-43ee-8d85-57d72000c19d", diff --git a/csharp/Sinexcel 12K TL/DataType/AlarmAndWarning.cs b/csharp/Sinexcel 12K TL/DataType/AlarmAndWarning.cs new file mode 100644 index 000000000..c78124ba2 --- /dev/null +++ b/csharp/Sinexcel 12K TL/DataType/AlarmAndWarning.cs @@ -0,0 +1,48 @@ +namespace InnovEnergy.Lib.Devices.Sinexcel_12K_TL.DataType; + +public enum SinexcelAbnormalFlag : ushort +{ + Normal = 0, + Abnormal = 1 +} + +public enum SinexcelInverterOperatingState : ushort +{ + Standby = 0, + Ready = 1, + OffGrid = 2, + OnGrid = 3 +} + +public enum SinexcelPvOperatingState : ushort +{ + Standby = 0, + Run = 1 +} + +public enum SinexcelBatteryOperatingState : ushort +{ + Standby = 0, + Charging = 1, + Discharging = 2, + FullyCharged = 3, + SelfInspection = 4 +} + +public enum SinexcelDcdcState : ushort +{ + Shutdown = 0, + Booting = 1 +} + +public enum SinexcelPowerGridStatus : ushort +{ + Normal = 0, + Abnormal = 1 +} + +public enum SinexcelOredState : ushort +{ + State0 = 0, State1, State2, State3, State4, + State5, State6, State7, State8, State9 +} \ No newline at end of file