CUST: - FwUpdateSw: - start implementation of power correction
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
{
|
||||
@@ -10,14 +12,19 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
/// <summary>
|
||||
/// Drive and name for power correction file stored on meter
|
||||
/// </summary>
|
||||
public const String StrMeterPowerCorrectionFilePathName = "1\\powcorr";
|
||||
public const String StrMeterPowCorrFileName = "1\\powcorr";
|
||||
|
||||
|
||||
private readonly GenesisMeter _currentGenesis;
|
||||
private readonly MeterFile _meterFile;
|
||||
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;
|
||||
|
||||
private List<Byte>_meterBinData = new List<Byte>();
|
||||
|
||||
/// <summary>
|
||||
/// Detected FW version before maintenance
|
||||
/// </summary>
|
||||
@@ -97,5 +104,39 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
|
||||
/// CRC of power correction file
|
||||
/// </summary>
|
||||
public UInt32 MeterPowerCorrectionCRC { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ctor
|
||||
/// </summary>
|
||||
/// <param name="currentGenesis"></param>
|
||||
/// <remarks date="2024-May-08" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
public MeterPowerCorrectionFile(GenesisMeter currentGenesis)
|
||||
{
|
||||
_currentGenesis = currentGenesis;
|
||||
_meterFile = new MeterFile(_currentGenesis);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read power correction meter file.
|
||||
/// </summary>
|
||||
/// <returns>true: file found</returns>
|
||||
/// <remarks date="2024-May-08" author="Thomas Wiedebusch">
|
||||
/// - Initial
|
||||
/// </remarks>
|
||||
public Boolean ReadPowCorrMeterFile()
|
||||
{
|
||||
if (_currentGenesis == null || _meterFile == null)
|
||||
return false;
|
||||
|
||||
var retVal = _currentGenesis.ReLogin();
|
||||
if (retVal)
|
||||
{
|
||||
retVal = _meterFile.ReadMeterFile(StrMeterPowCorrFileName, out _meterBinData);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user