FM2014: - improvements
This commit is contained in:
parent
8998f9058f
commit
312195ef86
@ -814,6 +814,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
DisableWriteReadActualProcessIncreasing = disableWriteReadIncrease;
|
||||
MaxActualProcessProgress = 1;
|
||||
ActualProcessProgress = 0;
|
||||
ActualProcessProgress_percent = null;
|
||||
|
||||
if (maxInitProcesses != null)
|
||||
{
|
||||
@ -1363,6 +1364,7 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
fm2014.ErrorIsDetected = false;
|
||||
}
|
||||
|
||||
|
||||
var cmdName = CmdName.CMD_NA;
|
||||
MeasurementInfo = Resources.StrMeasMsgCalibration;
|
||||
|
||||
@ -1372,7 +1374,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
// Check if double pulse deadtime has been set or si switched off
|
||||
if (DOUBLE_PULSE_DEADTIME_MIN_ms == firstActiveFm2014.DoublePulseDeadtime_ms)
|
||||
{
|
||||
InitActualProcessProgress(3, broadcast: true);
|
||||
// This is a command without parameter
|
||||
cmdName = CmdName.CMD_SET_DBPL_UNLOCK;
|
||||
if (!Write(cmdName, firstActiveFm2014))
|
||||
@ -1382,7 +1383,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
}
|
||||
else
|
||||
{
|
||||
InitActualProcessProgress(4, broadcast: true);
|
||||
cmdName = CmdName.CMD_SET_DPLS_LOCK_TMR;
|
||||
if (!Write(cmdName, firstActiveFm2014, firstActiveFm2014.DoublePulseBaseDeadTime_ms))
|
||||
{
|
||||
@ -1458,9 +1458,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
// Read the remaining REF pulses if required
|
||||
if (fm2014.RefPulsesRequired != 0)
|
||||
{
|
||||
// Feed the progress counter
|
||||
ActualProcessProgress = (Int32)firstActiveFm2014.RefPulsesRequired -
|
||||
firstActiveFm2014.RefPulsesRemaining;
|
||||
cmdName = CmdName.CMD_REF_GET_PLS_RMN;
|
||||
info = GetCmdInfo(cmdName);
|
||||
if (SharedCyclicMeasSequ != CyclicMeasSequ.IDLE && Write(cmdName, fm2014))
|
||||
@ -1483,6 +1480,12 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
|
||||
var response = new CmdResponse(cmdName, info, pulses);
|
||||
ResponseEvent(fm2014, response, statusReturn);
|
||||
|
||||
// Feed the progress counter but only if not done for DUT pulses as with the first
|
||||
// DUT pulse the RefPulsesRemaining will be reset to the initial value
|
||||
if (firstActiveFm2014.DutPulsesRequired == 0)
|
||||
ActualProcessProgress = (Int32)firstActiveFm2014.RefPulsesRequired -
|
||||
firstActiveFm2014.RefPulsesRemaining;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1490,10 +1493,6 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
// Read the remaining DUT pulses if required
|
||||
if (fm2014.DutPulsesRequired != 0)
|
||||
{
|
||||
// Feed the progress counter but only if not done for REF pulses
|
||||
if (firstActiveFm2014.RefPulsesRequired == 0)
|
||||
ActualProcessProgress = (Int32)firstActiveFm2014.DutPulsesRequired -
|
||||
firstActiveFm2014.DutPulsesRemaining;
|
||||
cmdName = CmdName.CMD_DUT_GET_PLS_RMN;
|
||||
info = GetCmdInfo(cmdName);
|
||||
if (SharedCyclicMeasSequ != CyclicMeasSequ.IDLE && Write(cmdName, fm2014))
|
||||
@ -1516,6 +1515,10 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
|
||||
|
||||
var response = new CmdResponse(cmdName, info, pulses);
|
||||
ResponseEvent(fm2014, response, statusReturn);
|
||||
|
||||
// Feed the progress counter
|
||||
ActualProcessProgress = (Int32)firstActiveFm2014.DutPulsesRequired -
|
||||
firstActiveFm2014.DutPulsesRemaining;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -759,7 +759,7 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
/// <summary>
|
||||
/// Common method to (de-)activate controls and timer.
|
||||
/// </summary>
|
||||
/// <remarks date="2026-Jan-14..20" author="Thomas Wiedebusch">
|
||||
/// <remarks date="2026-Jan-14..Feb-14" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private void ActionControl(Boolean isActive)
|
||||
@ -771,7 +771,7 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
//UiElmEnable(lblTotalProcessText, true);
|
||||
//UiElmEnable(lblActualProcessLabel, true);
|
||||
//UiElmEnable(lblTotalProcessLabel, true);
|
||||
UiElmEnable(lblActualProgressPercent, true);
|
||||
UiElmEnable(lblActualProgressPercent, !_autoProgressBar, !_autoProgressBar);
|
||||
//UiElmEnable(lblTotalProgressPercent, true);
|
||||
UiElmEnable(pbActualProgress, true);
|
||||
//UiElmEnable(pbTotalProgress, true);
|
||||
@ -1076,7 +1076,7 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
/// <summary>
|
||||
/// Feedback from FM2014being parsed to GUI
|
||||
/// </summary>
|
||||
/// <remarks date="2026-Feb-02..13" author="Thomas Wiedebusch">
|
||||
/// <remarks date="2026-Feb-02..14" author="Thomas Wiedebusch">
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private void DataReceived_Handler(Object sender, ProcessExecEventArgs e)
|
||||
@ -1105,7 +1105,10 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
UpdateProgressBar(pbActualProgress, (Double)e.ActualProcessPercent);
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(() => lblActualProgressPercent.Content = $@"{pbActualProgress.Value:##0.0} %");
|
||||
// A circulating process bar will be used to observe an activity, but as it restarts at the beginning
|
||||
// after reaching the end, a value isn't of importance
|
||||
if (!_autoProgressBar)
|
||||
Dispatcher.Invoke(() => lblActualProgressPercent.Content = $@"{pbActualProgress.Value:##0.0} %");
|
||||
|
||||
SetTimeDisplay();
|
||||
|
||||
@ -1165,6 +1168,7 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
case CmdName.CMD_RST_MEAS:
|
||||
// Immediately lock all buttons and input fields until reset is finished
|
||||
SetFM2014AccessLocked();
|
||||
UiElmEnable(lblActualProgressPercent, true);
|
||||
// Check countdown of reset method
|
||||
if (resp.IntValue == 0)
|
||||
ActionControl(false);
|
||||
@ -1492,8 +1496,6 @@ namespace Sensus.Ui.FM2014TestBench
|
||||
var idx = fm2014.Address - 1;
|
||||
var ucFM2014 = (UcFM2014Device)UcFM2014s[idx];
|
||||
ucFM2014.EnableMeasurements(CTR_MEASURE_COUNT);
|
||||
//fm2014.RefPulseCtrOn = true;
|
||||
//fm2014.DutPulseCtrOn = measureDutPulses;
|
||||
}
|
||||
|
||||
if (FM2014.PulseCounterMeasurement(true, measureDutPulses))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user