FM2014: - status decoding based on measurement or entire status

This commit is contained in:
Thomas Wiedebusch
2026-02-25 17:29:20 +01:00
parent 582de5408d
commit 1c3f071291
7 changed files with 67 additions and 24 deletions
@@ -199,6 +199,11 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
#endregion ---------------------------------------- events ----------------------------------------------------
#region ------------------------------------------- static properties -----------------------------------------
/// <summary>
/// Force to decode the entire status even if it is not important for this measurement sequence.
/// </summary>
public static Boolean DecodeEntireStatus { get; set; } = false;
/// <summary>
/// Reminder of actual ongoing measurement information
/// </summary>
@@ -1000,9 +1005,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
if (firstActiveFm2014 == null)
return false;
// Setup status mask to ignore unimportant settings and feedbacks for the time and regulation measurement
StatusDecodingMask = GetBitMask(CyclicMeasSequ.PulseCounterMeasurement);
// Publish setting to all connected and logged in FM2014s as those will be delivered
// for all via broadcast
foreach (var fm2014 in RegisteredFm2014s.Where(fm2014 => fm2014.IsLoggedOn))
@@ -1065,6 +1067,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
do
{
// Setup status mask to ignore unimportant settings and feedbacks for the time and regulation measurement
StatusDecodingMask = GetBitMaskForSequence(DecodeEntireStatus ? CyclicMeasSequ.Idle :
CyclicMeasSequ.PulseCounterMeasurement);
CmdName cmdNameRef;
CmdName cmdNameDut;
Boolean syncPulseCtr;
@@ -1192,9 +1198,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
if (firstActiveFm2014 == null)
return false;
// Setup status mask to ignore unimportant settings and feedbacks for the time measurement
StatusDecodingMask = GetBitMask(CyclicMeasSequ.RegulationMeasurement);
// Publish setting to all connected and logged in FM2014s as those will be delivered
// for all via broadcast
foreach (var fm2014 in RegisteredFm2014s.Where(fm2014 => fm2014.IsLoggedOn))
@@ -1255,6 +1258,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
do
{
// Setup status mask to ignore unimportant settings and feedbacks for the time measurement
StatusDecodingMask = GetBitMaskForSequence(DecodeEntireStatus ? CyclicMeasSequ.Idle :
CyclicMeasSequ.RegulationMeasurement);
foreach (var fm2014 in RegisteredFm2014s.Where(fm2014 => fm2014.IsLoggedOn))
{
try
@@ -1460,9 +1467,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
return false;
}
// Setup status mask to ignore unimportant settings for this measurement 'T' and 'K'
StatusDecodingMask = GetBitMask(CyclicMeasSequ.TimeMeasurement);
// Publish setting to all connected and logged in FM2014s as those will be delivered
// for all via broadcast
foreach (var fm2014 in RegisteredFm2014s.Where(fm2014 => fm2014.IsLoggedOn))
@@ -1534,6 +1538,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
do
{
// Setup status mask to ignore unimportant settings for this measurement 'T' and 'K'
StatusDecodingMask = GetBitMaskForSequence(DecodeEntireStatus ? CyclicMeasSequ.Idle :
CyclicMeasSequ.TimeMeasurement);
foreach (var fm2014 in RegisteredFm2014s.Where(fm2014 => fm2014.IsLoggedOn && !fm2014.MeasurementIsReady))
{
try
@@ -695,7 +695,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
/// </summary>
/// <param name="sequence"></param>
/// <returns></returns>
public static UInt32 GetBitMask(CyclicMeasSequ sequence)
public static UInt32 GetBitMaskForSequence(CyclicMeasSequ sequence)
{
if (sequence == CyclicMeasSequ.TimeMeasurement)
return 0xF8074D10;