CUST: power correction preparation

This commit is contained in:
Thomas Wiedebusch
2024-04-30 13:40:52 +02:00
parent 9acd6cccbb
commit e1e1f8fbd0
6 changed files with 163 additions and 11 deletions
@@ -46,6 +46,11 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
/// </summary>
public Byte ProductionPulseMode { get; set; }
/// <summary>
/// Pulse sequence counter during at EOL - Production
/// </summary>
public Byte ProductionPulseSequenceCounter { get; set; }
/// <summary>
/// Pulse distribution at EOL - Production
/// </summary>
@@ -60,17 +65,6 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
#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>
@@ -116,6 +116,7 @@
<Compile Include="MeterLutUpdate.cs" />
<Compile Include="MeterFwUpdate.cs" />
<Compile Include="MeterFwUpdateCapability.cs" />
<Compile Include="MeterPowerCorrectionFile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="MeterFile.cs" />
<Compile Include="MeterPwdFile.cs" />
@@ -0,0 +1,101 @@
using System;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
{
/// <summary>
/// Power correction file stored as reminder and log to meter
/// </summary>
public class MeterPowerCorrectionFile
{
/// <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; }
/// <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; }
}
}