CUST: - prepared for power correction

This commit is contained in:
Thomas Wiedebusch
2024-04-29 17:31:45 +02:00
parent da1bac1989
commit 9acd6cccbb
6 changed files with 171 additions and 0 deletions
@@ -219,6 +219,7 @@
<Compile Include="..\..\..\..\.shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="PowerCorrection.cs" />
<Compile Include="Consts\ErrorState.cs" />
<Compile Include="Consts\LedMode.cs" />
<Compile Include="GenesisMeter.cs" />
@@ -0,0 +1,159 @@
using System;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
{
/// <summary>
/// Power correction parameters used for overestimated power consumption on
/// Cordonel FW update from:
/// EMEA below R1.3.x
/// NA below R2.0.07
/// </summary>
public class PowerCorrection
{
#region Data Base at EOL - Production
/// <summary>
/// Unique identification of PCB
/// </summary>
public String PcbId { get; set; }
/// <summary>
/// Date time UTC at EOL - Production
/// </summary>
public DateTime? ProductionDateTimeUtc { get; set; }
/// <summary>
/// Total used seconds at EOL - Production
/// </summary>
public UInt32 ProductionTotalUsedSeconds_s { get; set; }
/// <summary>
/// Total used charge of batteries at EOL - Production
/// </summary>
public UInt64 ProductionTotalUsedCharge_uAs { get; set; }
/// <summary>
/// Radio system state at EOL - Production
/// </summary>
public Byte? ProductionRadioSystemState { get; set; }
/// <summary>
/// Pulse adapter was installed during at EOL - Production
/// </summary>
public Boolean ProductionPulseAdapterIsInstalled { get; set; }
/// <summary>
/// Pulse mode during at EOL - Production
/// </summary>
public Byte ProductionPulseMode { get; set; }
/// <summary>
/// Pulse distribution at EOL - Production
/// </summary>
public Boolean ProductionPulseEvenDistribution { get; set; }
/// <summary>
/// Detected region at EOL - Production
/// </summary>
public String ProductionRegion { get; set; }
#endregion
#region Maintenance readout
/// <summary>
/// Drive and name for power correction file stored on meter
/// </summary>
public const String StrMeterPowerCorrectionFilePathName = "1\\powcorr";
private const Int32 MeterPwrCorrFileLengthIndex = 0;
private const Int32 MeterPwrCorrFileLengthSize = 2;
private const Int32 MeterPwrCorrFileCrcIndex = MeterPwrCorrFileLengthIndex + MeterPwrCorrFileLengthSize;
private const Int32 MeterPwrCorrFileCrcSize= 2;
private const Int32 MeterPwrCorrFileDataIndex = MeterPwrCorrFileCrcIndex + MeterPwrCorrFileCrcSize;
/// <summary>
/// Detected FW version before maintenance
/// </summary>
public UInt32 ActualFwVersion { get; set; }
/// <summary>
/// Date time UTC at time of maintenance
/// </summary>
public DateTime? ActualDateTimeUtc { get; set; }
/// <summary>
/// Total used seconds before maintenance
/// </summary>
public UInt32 ActualTotalUsedSeconds_s { get; set; }
/// <summary>
/// Total used charge of batteries before maintenance
/// </summary>
public UInt64 ActualTotalUsedCharge_uAs { get; set; }
/// <summary>
/// Actual detected radio system state at maintenance
/// </summary>
public Byte? ActualRadioSystemState { get; set; }
/// <summary>
/// Detection of pulse adapter installation
/// </summary>
public Boolean ActualPulseAdapterIsInstalled { get; set; }
/// <summary>
/// Pulse mode during maintenance
/// </summary>
public Byte ActualPulseMode { get; set; }
/// <summary>
/// Pulse distribution during maintenance
/// </summary>
public Boolean ActualPulseEvenDistribution { get; set; }
#endregion
#region Maintenance calculation
/// <summary>
/// FW version for the update
/// </summary>
public UInt32 RequiredFwVersion { get; set; }
/// <summary>
/// Calculated pulse report length
/// </summary>
public UInt32 PulseReportLength { get; set; }
/// <summary>
/// Total used seconds after EOL and before maintenance
/// </summary>
public UInt32 AfterProductionTotalUsedSeconds_s { get; set; }
/// <summary>
/// Overestimated total used charge before maintenance
/// </summary>
public UInt64 OverestimatedTotalUsedCharge_uAs { get; set; }
/// <summary>
/// Lowest threshold for total used charge calculated during maintenance
/// </summary>
public UInt64 MinimumTotalUsedCharge_uAs { get; set; }
/// <summary>
/// Corrected total used charge during maintenance
/// </summary>
public UInt64 CorrectedTotalUsedCharge_uAs { get; set; }
/// <summary>
/// Size of power correction file
/// </summary>
public UInt32 MeterPowerCorrectionFileSize { get; set; }
/// <summary>
/// CRC of power correction file
/// </summary>
public UInt32 MeterPowerCorrectionCRC { get; set; }
#endregion
}
}