Innovenergy_trunk/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs

41 lines
1.8 KiB
C#
Raw Normal View History

2023-06-13 10:53:52 +00:00
using System.Diagnostics.CodeAnalysis;
using InnovEnergy.Lib.Devices.Battery48TL.DataTypes;
using InnovEnergy.Lib.Protocols.Modbus.Reflection.Attributes;
using InnovEnergy.Lib.SrcGen.Attributes;
namespace InnovEnergy.Lib.Devices.Battery48TL;
#pragma warning disable CS0169, CS0649
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "UnusedMember.Global")]
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local")]
[BigEndian]
[NestProperties("Battery48TlRecord")]
public partial class Battery48TlRecord
{
[InputRegister(1004)] private UInt16 _LedStates;
[InputRegister<UInt64>(1005)] private UInt64 _WarningFlags;
[InputRegister<UInt64>(1009)] private UInt64 _AlarmFlags;
[InputRegister(1013)] private UInt16 _IoStates;
[InputRegister(999, Scale = 0.01)] private Double _DcVoltage;
[InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _DcCurrent;
[InputRegister(1053, Scale = 0.1)] private Double _Soc;
[InputRegister(1014, Scale = 0.1, Offset = -400)] private Double _TemperaturesBoard;
[InputRegister(1015, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsCenter;
[InputRegister(1016, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsLeft;
[InputRegister(1017, Scale = 0.1, Offset = -400)] private Double _TemperaturesCellsRight;
private LedState ParseLed(LedColor led) => (LedState)((_LedStates >> (Int32)led) & 3);
// public Decimal CellsVoltage { get; init; }
//
// public Decimal MaxChargingPower { get; init; }
// public Decimal MaxDischargingPower { get; init; }
}