diff --git a/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FM2014Core/FM2014.cs b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FM2014Core/FM2014.cs
index 9a13a498..faa445a7 100644
--- a/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FM2014Core/FM2014.cs
+++ b/Common/Hardware/WaterMeter/MechanicalMeter/FM2014/FM2014Core/FM2014.cs
@@ -114,12 +114,12 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
///
/// Minimal value for attenuation.
///
- public const Byte ATTENUATION_MIN = 1;
+ public const Byte CURRENT_OUTPUT_ATTENUATION_MIN = 1;
///
/// Maximal value for attenuation.
///
- public const Byte ATTENUATION_MAX = 9;
+ public const Byte CURRENT_OUTPUT_ATTENUATION_MAX = 9;
///
/// Minimal value for double pulse lock time in milliseconds, 0.0 means it is disabled.
@@ -580,7 +580,8 @@ namespace Sensus.Common.Hardware.WaterMeter.MechanicalMeter.FM2014.FM2014Core
get => _currentOutputAttenuation;
private set
{
- if (value < ATTENUATION_MIN || value > ATTENUATION_MAX)
+ if (value < CURRENT_OUTPUT_ATTENUATION_MIN ||
+ value > CURRENT_OUTPUT_ATTENUATION_MAX)
return;
_currentOutputAttenuation = value;
diff --git a/FM2014TestApp/Fm2014TestApp.sln.DotSettings b/FM2014TestApp/Fm2014TestApp.sln.DotSettings
index 69c27719..a7196d6f 100644
--- a/FM2014TestApp/Fm2014TestApp.sln.DotSettings
+++ b/FM2014TestApp/Fm2014TestApp.sln.DotSettings
@@ -2,6 +2,7 @@
True
True
True
+ True
True
True
True
diff --git a/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml b/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml
index 7576ceb2..e4265026 100644
--- a/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml
+++ b/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml
@@ -338,7 +338,7 @@
-
+
@@ -437,7 +437,7 @@
-
+
diff --git a/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml.cs b/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml.cs
index 7cc4e7c9..b8192531 100644
--- a/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml.cs
+++ b/FM2014TestApp/Ui/Fm2014sTest/FM2014TestBenchWindow.xaml.cs
@@ -239,8 +239,8 @@ namespace Sensus.Ui.FM2014TestBench
MeasurementLabels.Add(lblMeasurement7Text);
// Preset attenuation
- var attenuation = FM2014.ATTENUATION_MIN;
- for (var idx = 0; idx < FM2014.ATTENUATION_MAX - FM2014.ATTENUATION_MIN; idx++)
+ var attenuation = FM2014.CURRENT_OUTPUT_ATTENUATION_MIN;
+ for (var idx = 0; idx < FM2014.CURRENT_OUTPUT_ATTENUATION_MAX - FM2014.CURRENT_OUTPUT_ATTENUATION_MIN; idx++)
{
cbxDisplayAttenuation.Items.Add(attenuation.ToString());
attenuation++;
@@ -1000,15 +1000,15 @@ namespace Sensus.Ui.FM2014TestBench
UiElmEnable(tbxDutToRefTolMin, false);
UiElmEnable(tbxRefPulsesPerCm, false);
UiElmEnable(tbxDutPulsesPerCm, false);
- UiElmEnable(tbxScaleRefToDut, false); // Additional scale is permanent read only
+ UiElmEnable(tbxScaleRefToDut, false); // Is permanent read only
UiElmEnable(cbxDisplayAttenuation, false);
UiElmEnable(cbxToleranceCalc, false);
UiElmEnable(cbxFM2014ComPort, false);
- UiElmEnable(tbxRefPulsesMeasured, false); // Additional scale is permanent read only
+ UiElmEnable(tbxRefPulsesMeasured, false); // Is permanent read only
UiElmEnable(chkDutPulsesMeasured, false);
- UiElmEnable(tbxDutPulsesMeasured, false); // Additional scale is permanent read only
+ UiElmEnable(tbxDutPulsesMeasured, false); // Is permanent read only
UiElmEnable(tbxVolumeMeasuredLiters, false);
- UiElmEnable(tbxRefPulsesPerCmCalib, false); // Additional scale is permanent read only
+ UiElmEnable(tbxRefPulsesPerCmCalib, false); // Is permanent read only
foreach (var slotSelector in SlotSelections)
{
UiElmEnable(slotSelector, false);
@@ -1022,7 +1022,7 @@ namespace Sensus.Ui.FM2014TestBench
{
// Enable buttons and display correct information
UiElmEnable(btnDutToRefCalibration, true);
- UiElmEnable(btnSaveRegulationSetup, _regulationSetupHasChanged); // activate if setup has changed
+ UiElmEnable(btnSaveRegulationSetup, _regulationSetupHasChanged); // Activate if setup has changed
UiElmEnable(btnDutToRefRegulation, true);
UiElmEnable(btnFM2014Connect, true);
UiElmEnable(btnRefToVolumeCalibration, true);
@@ -1032,9 +1032,12 @@ namespace Sensus.Ui.FM2014TestBench
UpdateContentControl(btnDutToRefCalibration, Properties.Resources.StrBtnStartCalibration);
UpdateContentControl(btnDutToRefRegulation, Properties.Resources.StrBtnStartRegulation);
+ var dutPulseMeasurementIsActive = false;
// Enable manual input
Dispatcher.Invoke(() =>
{
+ if (chkDutPulsesMeasured.IsChecked != null)
+ dutPulseMeasurementIsActive = (Boolean)chkDutPulsesMeasured.IsChecked;
tbxVolumeMeasuredLiters.IsReadOnly = false;
tbxRefPulsesPerCm.IsReadOnly = false;
tbxDutPulsesPerCm.IsReadOnly = false;
@@ -1048,15 +1051,15 @@ namespace Sensus.Ui.FM2014TestBench
UiElmEnable(tbxDutToRefTolMin, true);
UiElmEnable(tbxRefPulsesPerCm, true);
UiElmEnable(tbxDutPulsesPerCm, true);
- UiElmEnable(tbxScaleRefToDut, true); // Additional scale is permanent read only
+ UiElmEnable(tbxScaleRefToDut, true); // Is permanent read only
UiElmEnable(cbxDisplayAttenuation, true);
UiElmEnable(cbxToleranceCalc, true);
UiElmEnable(cbxFM2014ComPort, true);
- UiElmEnable(tbxRefPulsesMeasured, true); // Additional scale is permanent read only
+ UiElmEnable(tbxRefPulsesMeasured, true); // Is permanent read only
UiElmEnable(chkDutPulsesMeasured, true);
- UiElmEnable(tbxDutPulsesMeasured, true); // Additional scale is permanent read only
+ UiElmEnable(tbxDutPulsesMeasured, dutPulseMeasurementIsActive); // Is permanent read only
UiElmEnable(tbxVolumeMeasuredLiters, true);
- UiElmEnable(tbxRefPulsesPerCmCalib, true); // Additional scale is permanent read only
+ UiElmEnable(tbxRefPulsesPerCmCalib, true); // Is permanent read only
foreach (var slotSelector in SlotSelections)
{
@@ -1128,7 +1131,7 @@ namespace Sensus.Ui.FM2014TestBench
break;
case CmdName.CMD_REF_GET_PLS_CTR:
case CmdName.CMD_REF_GET_PLS_CTR_BU:
- if (firstFm2014 != null && firstFm2014.Address == fm2014.Address )
+ if (firstFm2014 != null && firstFm2014.Address == fm2014.Address)
UpdateTextBox(tbxRefPulsesMeasured, $"{resp.IntValue:D}");
ucFm2014.SetValue(CTR_LBL_IDX_REF_PLS, $"{resp.IntValue:D}");
break;
@@ -1408,8 +1411,8 @@ namespace Sensus.Ui.FM2014TestBench
}
if (byte.TryParse(cbxDisplayAttenuation.SelectedItem.ToString(), out var attenuation) &&
- attenuation >= FM2014.ATTENUATION_MIN &&
- attenuation <= FM2014.ATTENUATION_MAX)
+ attenuation >= FM2014.CURRENT_OUTPUT_ATTENUATION_MIN &&
+ attenuation <= FM2014.CURRENT_OUTPUT_ATTENUATION_MAX)
{
currentOutputAttenuation = attenuation;
}
@@ -1423,7 +1426,7 @@ namespace Sensus.Ui.FM2014TestBench
ucFM2014.EnableMeasurements(REG_MEASURE_COUNT);
}
- if (FM2014.RegulationMeasurement(refPulses_per_cm, dutPulses_per_cm, doublePulseDeadtime_ms,
+ if (FM2014.RegulationMeasurement(refPulses_per_cm, dutPulses_per_cm, doublePulseDeadtime_ms,
currentOutputAttenuation))
{
_autoProgressBar = true;
@@ -1584,8 +1587,8 @@ namespace Sensus.Ui.FM2014TestBench
Dispatcher.Invoke(() =>
{
if (byte.TryParse(cbxDisplayAttenuation.SelectedItem.ToString(), out var attenuation) &&
- attenuation >= FM2014.ATTENUATION_MIN &&
- attenuation <= FM2014.ATTENUATION_MAX &&
+ attenuation >= FM2014.CURRENT_OUTPUT_ATTENUATION_MIN &&
+ attenuation <= FM2014.CURRENT_OUTPUT_ATTENUATION_MAX &&
firstFm2014.CurrentOutputAttenuation != attenuation)
{
_regulationSetupHasChanged = true;
@@ -1656,6 +1659,21 @@ namespace Sensus.Ui.FM2014TestBench
}));
}
+ ///
+ /// Enable/Disable input
+ ///
+ ///
+ ///
+ private void chkDutPulseMeasurement_CheckChanged(Object sender, EventArgs e)
+ {
+ Dispatcher.Invoke(() =>
+ {
+ var isChecked = false;
+ if (chkDutPulsesMeasured.IsChecked != null)
+ isChecked = (Boolean)chkDutPulsesMeasured.IsChecked;
+ UiElmEnable(tbxDutPulsesMeasured, isChecked);
+ });
+ }
///
/// Common check for key input to edit an integer field:
/// - Allows Left, Right, Back, Delete and 0-9 keys . and ,
@@ -2228,7 +2246,7 @@ namespace Sensus.Ui.FM2014TestBench
FM2014.PULSES_PER_CM_REGULATION_SETUP_MIN <= pulses_per_cm &&
FM2014.REF_PULSES_PER_CM_REGULATION_INPUT_MAX >= pulses_per_cm)
{
- // During setup of the 'Ref_pulse_per_cm' the 'RefToDutScaleStr' will be generated
+ // During setup of the 'Ref_pulse_per_cm' the 'RefToDutScaleStr' will be generated
if (!UpdateRefToDutScale())
{
tbxRefPulsesPerCm.Background = ColorProcessFailed;
diff --git a/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.Designer.cs b/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.Designer.cs
index 6d931157..b565f1a5 100644
--- a/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.Designer.cs
+++ b/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.Designer.cs
@@ -70,7 +70,7 @@ namespace Sensus.Ui.Fm2014TestBench.Properties {
}
///
- /// Looks up a localized string similar to Save.
+ /// Looks up a localized string similar to Save to FM2014.
///
internal static string StrBtnSaveRegulationSetup {
get {
diff --git a/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.de.resx b/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.de.resx
index 07057e34..c5abe17d 100644
--- a/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.de.resx
+++ b/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.de.resx
@@ -184,7 +184,7 @@
Anzeigestabilisierung []:
- Speichern
+ In FM2014 speichern
REF zu Volumen Kalibrierung
diff --git a/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.resx b/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.resx
index 9fac0b3a..31109df2 100644
--- a/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.resx
+++ b/FM2014TestApp/Ui/Fm2014sTest/Properties/Resources.resx
@@ -184,7 +184,7 @@
Display Attenuation []:
- Save
+ Save to FM2014
REF to Volume Calibration