GenesisStatus: - taken POWERMON_RemainingSeconds,
ProductionUiCordonel: - check EOL remaining lifetime from firmware POWERMON_RemainingSeconds
This commit is contained in:
@@ -18469,7 +18469,7 @@
|
||||
},
|
||||
"description": "",
|
||||
"version": {
|
||||
"first": 69,
|
||||
"first": 72,
|
||||
"last": 72
|
||||
},
|
||||
"statictype": "dynamic",
|
||||
|
||||
@@ -7,6 +7,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
|
||||
/// </summary>
|
||||
public class GenesisStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// Remaining lifetime for Cordonel in years based on FW calculation.
|
||||
/// </summary>
|
||||
public Double? FwCalculatedRemainingLifeTimeYears { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Remaining lifetime for Cordonel in seconds based on FW calculation.
|
||||
/// </summary>
|
||||
public UInt64? FwCalculatedRemainingLifeTime_s { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Remaining lifetime for Cordonel in years based on battery drainage.
|
||||
/// </summary>
|
||||
|
||||
@@ -280,6 +280,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
|
||||
/// <remarks date="2024-Nov-15" author="Thomas Wiedebusch">
|
||||
/// - errorMsg.
|
||||
/// </remarks>
|
||||
/// <remarks date="2025-Aug-11" author="Thomas Wiedebusch">
|
||||
/// - Readout FW based calculation of remaining lifetime in seconds.
|
||||
/// </remarks>
|
||||
public static Boolean BuildLifeTimeInformation(IGenesisMeter currentGenesis, GenesisStatus status, out String errorMsg)
|
||||
{
|
||||
Boolean retVal;
|
||||
@@ -302,6 +305,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
|
||||
status.InitialBatteryLoad_mAh = RegisterConverter.ByteArrayToValue<UInt32>(
|
||||
currentGenesis.ReadRegister(Register.Powermon.BatteryInitialLoad));
|
||||
|
||||
var nullCheck = currentGenesis.ReadRegister(Register.Powermon.RemainingSeconds);
|
||||
if (nullCheck == null)
|
||||
status.FwCalculatedRemainingLifeTime_s = null;
|
||||
else
|
||||
status.FwCalculatedRemainingLifeTime_s =
|
||||
RegisterConverter.ByteArrayToValue<UInt32>(nullCheck);
|
||||
|
||||
currentGenesis.Logout();
|
||||
|
||||
retVal = CalculateLifeTime(status);
|
||||
@@ -337,6 +347,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
|
||||
/// <remarks date="2025-Mar-25" author="Thomas Wiedebusch">
|
||||
/// - Calculate storage months.
|
||||
/// </remarks>
|
||||
/// <remarks date="2025-Aug-11" author="Thomas Wiedebusch">
|
||||
/// - Calculate FW based calculation of remaining lifetime in years.
|
||||
/// </remarks>
|
||||
public static Boolean CalculateLifeTime(GenesisStatus status)
|
||||
{
|
||||
// Mark as false if the basic inputs are missed
|
||||
@@ -361,6 +374,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
|
||||
var estimatedLifeTime_s = status.ExceededLifeTime_s / drainedBatteryLoad_rel;
|
||||
var remainingLifetime_s = estimatedLifeTime_s - status.ExceededLifeTime_s;
|
||||
status.RemainingLifeTimeYears = remainingLifetime_s * YEARS_PER_SECONDS;
|
||||
status.FwCalculatedRemainingLifeTimeYears = status.FwCalculatedRemainingLifeTime_s * YEARS_PER_SECONDS;
|
||||
|
||||
// Calculate an alternative threshold for remaining battery load based on the quiescent current and a supplement
|
||||
// for production purpose. Those values can be assigned in the Cordonel requirements.
|
||||
|
||||
@@ -94,6 +94,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.Registers
|
||||
public static readonly String BatteryInitialLoad = "POWERMON_BatteryMilliAHrRating";
|
||||
public static readonly String BatteryExceededSeconds = "POWERMON_TotalUsedSeconds";
|
||||
public static readonly String StoreConfiguration = "POWERMON_StoreConfiguration";
|
||||
public static readonly String RemainingSeconds = "POWERMON_RemainingSeconds";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user