This commit is contained in:
Roland Drabesch 2023-06-01 13:21:39 +02:00
commit 3bee36749c
2 changed files with 6 additions and 2 deletions

View File

@ -258,7 +258,6 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol
if (_magFluxRequestProtocol == null) return false;
var retVal = _magFluxRequestProtocol.GetCalibrationPoints(out var calibrations);
calibPoints = calibrations?.calibrations?.ToList();
calibPoints?.Sort();
_logger.Debug(retVal ? $"{_ident} MagFlux calibration successfully read" :
$"{_ident} MagFlux calibration read failed!");
return retVal;

View File

@ -8,7 +8,6 @@ using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;
using Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.EventArguments;
using Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
@ -641,13 +640,16 @@ namespace Xylem.Common.Ui.MagFluxToolBox
#region Buttons
private void btnPrepareCalibration_Click(Object sender, EventArgs e)
{
SetControlsDownloadIsOngoing();
_magFluxMeter?.InitCalibration();
btnAbortCalibration.Enabled = true;
btnReadCalibration_Click(this, null);
SetControlsDownloadIsFinished();
}
private void btnReadCalibration_Click(Object sender, EventArgs e)
{
SetControlsDownloadIsOngoing();
var calibPoints = new List<CalibrationPoint>();
_magFluxMeter?.ReadCalibration(out calibPoints);
if (calibPoints == null) return;
@ -663,10 +665,12 @@ namespace Xylem.Common.Ui.MagFluxToolBox
_dataTableCalibPoints?.Clear();
FillDataGridWithCalibInfos();
SetControlsDownloadIsFinished();
}
private void btnWriteCalibration_Click(Object sender, EventArgs e)
{
SetControlsDownloadIsOngoing();
if (_calibPointsCmPerH == null)
return;
var calibPoints = new List<CalibrationPoint>();
@ -682,6 +686,7 @@ namespace Xylem.Common.Ui.MagFluxToolBox
}
_magFluxMeter?.WriteCalibration(calibPoints);
SetControlsDownloadIsFinished();
}
private void btnAbortCalibration_Click(Object sender, EventArgs e)