FM2014: - status filter

This commit is contained in:
Thomas Wiedebusch 2026-02-26 09:42:01 +01:00
parent 1c3f071291
commit 7c3ad0ff0f
3 changed files with 44 additions and 15 deletions

View File

@ -202,7 +202,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
/// <summary> /// <summary>
/// Force to decode the entire status even if it is not important for this measurement sequence. /// Force to decode the entire status even if it is not important for this measurement sequence.
/// </summary> /// </summary>
public static Boolean DecodeEntireStatus { get; set; } = false; public static Boolean DecodeEntireStatus { get; set; }
/// <summary> /// <summary>
/// Reminder of actual ongoing measurement information /// Reminder of actual ongoing measurement information
@ -885,7 +885,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
StatusDecodingMask = 0; StatusDecodingMask = 0;
if (measMaskOn) StatusDecodingMask += STATUS_MEASURE_MASK; if (measMaskOn) StatusDecodingMask += STATUS_MEASURE_MASK;
if (errorMaskOn) StatusDecodingMask += STATUS_ERROR_MASK; if (errorMaskOn) StatusDecodingMask += STATUS_ERROR_MASK;
if (faultMaskOn) StatusDecodingMask += (STATUS_FAULT1_MASK + STATUS_FAULT2_MASK); if (faultMaskOn) StatusDecodingMask += STATUS_FAULT1_MASK + STATUS_FAULT2_MASK;
} }
/// <summary> /// <summary>
@ -1439,7 +1439,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
/// <param name="doublePulseDeadtime_ms">0 if double impulse deadtime detection is off</param> /// <param name="doublePulseDeadtime_ms">0 if double impulse deadtime detection is off</param>
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
/// <remarks date="2026-Jan-14..Feb-25" author="Thomas Wiedebusch"> /// <remarks date="2026-Jan-14..Feb-26" author="Thomas Wiedebusch">
/// - Initial. /// - Initial.
/// </remarks> /// </remarks>
public static Boolean PulseTimeMeasurement(UInt16? refPulsesRequired = null, UInt16? dutPulsesRequired = null, public static Boolean PulseTimeMeasurement(UInt16? refPulsesRequired = null, UInt16? dutPulsesRequired = null,
@ -1490,6 +1490,21 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
if (!BuildAndWriteDoubleImpulseDeadtime(firstActiveFm2014)) if (!BuildAndWriteDoubleImpulseDeadtime(firstActiveFm2014))
return false; return false;
// START FAKE setup for time measurement!
// Setup to get rid of the status message for missing 'Tolerance display attenuation missing' 'T' and
// missing 'Scale REF to DUT missing or out of range' 'K' even if these setting don't have any function
cmdName = CmdName.CmdSetCurrentOutputAttenuation;
if (!Write(cmdName, firstActiveFm2014, firstActiveFm2014.CurrentOutputAttenuation))
{
return false;
}
cmdName = CmdName.CmdRefToDutScale;
if (!Write(cmdName, firstActiveFm2014, firstActiveFm2014.RefToDutScaleStr))
{
return false;
}
// END FAKE setup for time measurement!
if (refPulsesRequired != null) if (refPulsesRequired != null)
{ {
cmdName = CmdName.CmdSetRefPulsesRequired; cmdName = CmdName.CmdSetRefPulsesRequired;

View File

@ -1290,19 +1290,19 @@ namespace Sensus.Ui.FM2014TestBench
} }
else if (resp.DoubleValue != null) else if (resp.DoubleValue != null)
{ {
LogText($"{timeUtcStr} - Ad: {fm2014.Address} - {resp.AnswerStr}: {resp.DoubleValue:F4} {resp.Unit}"); LogText($"{timeUtcStr} - Ad: {fm2014.Address} - {resp.AnswerStr}: {resp.DoubleValue:F6} {resp.Unit}");
switch (resp.CmdName) switch (resp.CmdName)
{ {
case CmdName.CmdGetRefTimerTicks: case CmdName.CmdGetRefTimerTicks:
valueStr = $"{resp.DoubleValue:F4}"; valueStr = $"{resp.DoubleValue:F3}";
ucFm2014?.SetValue(CAL_LBL_IDX_REF_MEAS_TMR, valueStr, statusColor); ucFm2014?.SetValue(CAL_LBL_IDX_REF_MEAS_TMR, valueStr, statusColor);
break; break;
case CmdName.CmdGetDutTimerTicks: case CmdName.CmdGetDutTimerTicks:
valueStr = $"{resp.DoubleValue:F4}"; valueStr = $"{resp.DoubleValue:F3}";
ucFm2014?.SetValue(CAL_LBL_IDX_DUT_MEAS_TMR, valueStr, statusColor); ucFm2014?.SetValue(CAL_LBL_IDX_DUT_MEAS_TMR, valueStr, statusColor);
break; break;
case CmdName.CmdCalculatedDutToRefTolerance: case CmdName.CmdCalculatedDutToRefTolerance:
valueStr = $"{resp.DoubleValue:F4}"; valueStr = $"{resp.DoubleValue:F3}";
ucFm2014?.SetValue(CAL_LBL_IDX_DUT_TO_REF_TOL, valueStr, statusColor); ucFm2014?.SetValue(CAL_LBL_IDX_DUT_TO_REF_TOL, valueStr, statusColor);
break; break;
case CmdName.CmdGetDutToRefToleranceUndamped: case CmdName.CmdGetDutToRefToleranceUndamped:
@ -1418,7 +1418,6 @@ namespace Sensus.Ui.FM2014TestBench
if (refPulsesRequired != null && dutPulsesRequired != null) if (refPulsesRequired != null && dutPulsesRequired != null)
{ {
UpdateContentControl(MeasurementLabels[CAL_LBL_IDX_DUT_TO_REF_TOL], UpdateContentControl(MeasurementLabels[CAL_LBL_IDX_DUT_TO_REF_TOL],
StrLblDutToRefToleranceMeasured); StrLblDutToRefToleranceMeasured);
} }
@ -1443,9 +1442,21 @@ namespace Sensus.Ui.FM2014TestBench
// Set initial required pulses as those are static upon the entire measurement // Set initial required pulses as those are static upon the entire measurement
if (refPulsesRequired != null) if (refPulsesRequired != null)
{
ucFM2014.SetValue(CAL_LBL_IDX_REF_REQ_PLS, $"{_fm2014Common.RefPulsesRequired:D}"); ucFM2014.SetValue(CAL_LBL_IDX_REF_REQ_PLS, $"{_fm2014Common.RefPulsesRequired:D}");
ucFM2014.SetValue(CAL_LBL_IDX_REF_MEAS_TMR, "---");
}
if (dutPulsesRequired != null) if (dutPulsesRequired != null)
{
ucFM2014.SetValue(CAL_LBL_IDX_DUT_REQ_PLS, $"{_fm2014Common.DutPulsesRequired:D}"); ucFM2014.SetValue(CAL_LBL_IDX_DUT_REQ_PLS, $"{_fm2014Common.DutPulsesRequired:D}");
ucFM2014.SetValue(CAL_LBL_IDX_DUT_MEAS_TMR, "---");
}
if (refPulsesRequired != null && dutPulsesRequired != null)
{
ucFM2014.SetValue(CAL_LBL_IDX_DUT_TO_REF_TOL, "---");
}
// Set thresholds for tolerance verification // Set thresholds for tolerance verification
fm2014.DutToRefCalibrationToleranceMax_percent = _fm2014Common.DutToRefCalibrationToleranceMax_percent; fm2014.DutToRefCalibrationToleranceMax_percent = _fm2014Common.DutToRefCalibrationToleranceMax_percent;
@ -1505,6 +1516,9 @@ namespace Sensus.Ui.FM2014TestBench
var ucFM2014 = (UcFM2014Device)UcFM2014s[idx]; var ucFM2014 = (UcFM2014Device)UcFM2014s[idx];
ucFM2014.EnableMeasurements(REG_MEASURE_COUNT); ucFM2014.EnableMeasurements(REG_MEASURE_COUNT);
fm2014.CurrentOutputDisplayRangeNominal_percent = _fm2014Common.CurrentOutputDisplayRangeNominal_percent; fm2014.CurrentOutputDisplayRangeNominal_percent = _fm2014Common.CurrentOutputDisplayRangeNominal_percent;
ucFM2014.SetValue(REG_LBL_IDX_REF_FREQU, "---");
ucFM2014.SetValue(REG_LBL_IDX_FLOW_RATE, "---");
ucFM2014.SetValue(REG_LBL_IDX_DUT_TO_REF_TOL, "---");
} }
// Backup if meanwhile anything has changed // Backup if meanwhile anything has changed

View File

@ -23,13 +23,13 @@
<!-- Bordered Static Labels --> <!-- Bordered Static Labels -->
<Label Name="lblStatus" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="OFFLINE" /> <Label Name="lblStatus" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="OFFLINE" />
<Label Name="lblMeasurement1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="0" /> <Label Name="lblMeasurement1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblMeasurement2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="0" /> <Label Name="lblMeasurement2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblMeasurement3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="0" /> <Label Name="lblMeasurement3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblMeasurement4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="0" /> <Label Name="lblMeasurement4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblMeasurement5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="0" /> <Label Name="lblMeasurement5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblMeasurement6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="0" /> <Label Name="lblMeasurement6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblMeasurement7" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="0" /> <Label Name="lblMeasurement7" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblFirmwareVersion" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" /> <Label Name="lblFirmwareVersion" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblSerialNumber" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" /> <Label Name="lblSerialNumber" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />
<Label Name="lblLifetime_h" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" /> <Label Name="lblLifetime_h" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" Content="---" />