Merge branch 'main' of https://slm.sms-esaap.com/la_operations/laa_production
This commit is contained in:
@@ -673,6 +673,32 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
SetupFromConfigFile(slot, ignoreCorruptedData, true, true);
|
SetupFromConfigFile(slot, ignoreCorruptedData, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Copy list of flow results to <see cref="MagFlux.DataPackages.DataTypes.Calibration"/> and kick off the
|
||||||
|
/// writing of calibrations to MagFlux.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="results">List of flow results</param>
|
||||||
|
public void WriteCalibrationTestBench(List<WaterMeter.DataPackages.MeasurementRecords.FlowDeviations> results)
|
||||||
|
{
|
||||||
|
if (RequestProtocol == null) return;
|
||||||
|
var calibrationsCmPerH = new List<Calibration>();
|
||||||
|
var calibrationCmPerH = new Calibration();
|
||||||
|
foreach (var result in results)
|
||||||
|
{
|
||||||
|
calibrationCmPerH.refFlowRate = (Single)result.MeasuredRefFlowQmPerH;
|
||||||
|
calibrationCmPerH.dutFlowRate = (Single)result.MeasuredDutFlowQmPerH;
|
||||||
|
calibrationsCmPerH.Add(calibrationCmPerH);
|
||||||
|
}
|
||||||
|
|
||||||
|
RequestProtocol.SetCalibrationPoints(calibrationsCmPerH);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
void IMeter.SetupFromConfigFile(Int32 slot, Boolean ignoreCorruptedData, Boolean useRequest, Boolean useStreaming)
|
||||||
|
{
|
||||||
|
SetupFromConfigFile(slot, ignoreCorruptedData);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Setup water meter from configuration file:
|
/// Setup water meter from configuration file:
|
||||||
/// -slot,
|
/// -slot,
|
||||||
@@ -1159,17 +1185,6 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WriteCalibrationTestBench(List<WaterMeter.DataPackages.MeasurementRecords.FlowDeviations> results)
|
|
||||||
{
|
|
||||||
//todo: convert to CalibrationPoints in L per H
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
void IMeter.SetupFromConfigFile(Int32 slot, Boolean ignoreCorruptedData, Boolean useRequest, Boolean useStreaming)
|
|
||||||
{
|
|
||||||
SetupFromConfigFile(slot, ignoreCorruptedData);
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show($"FATAL {ex.Message}");
|
MessageBox.Show($"FATAL Ctor {ex.Message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -167,12 +167,16 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (TestsetuptContainer == null)
|
if (TestsetuptContainer == null)
|
||||||
{
|
{
|
||||||
TestsetuptContainer = new TestSetupContainer();
|
TestsetuptContainer = new TestSetupContainer();
|
||||||
TestsetuptContainer.TempSouce = Enums.TempSouceType.PtOverSps;
|
TestsetuptContainer.TempSouce = Enums.TempSouceType.PtOverSps;
|
||||||
TestsetuptContainer.ProductionMode = false;
|
TestsetuptContainer.ProductionMode = false;
|
||||||
|
|
||||||
|
TestsetuptContainer.meterTestSettings = new MeterTestSettings[slotCount];
|
||||||
|
TestsetuptContainer.meterTestResults = new MeterTestResults[slotCount];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -217,7 +221,7 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
}
|
}
|
||||||
Mode = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.Cordonel;
|
Mode = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.Cordonel;
|
||||||
|
|
||||||
if (TestsetuptContainer.meterTestSettings.All(a => a.meterType == Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.MagFlux))
|
if (TestsetuptContainer.meterTestSettings.Any(a => a != null && a.meterType == Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.MagFlux))
|
||||||
{
|
{
|
||||||
Mode = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.MagFlux;
|
Mode = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.MagFlux;
|
||||||
}
|
}
|
||||||
@@ -226,7 +230,7 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Fatal(ex);
|
_logger.Fatal(ex);
|
||||||
MessageBox.Show($"FATAL {ex.Message}");
|
MessageBox.Show($"FATAL internalPrep {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void PrepareAction(Int32 slotCount, String cultureStr)
|
public void PrepareAction(Int32 slotCount, String cultureStr)
|
||||||
@@ -244,7 +248,7 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Fatal(ex);
|
_logger.Fatal(ex);
|
||||||
MessageBox.Show($"FATAL {ex.Message}");
|
MessageBox.Show($"FATAL EnableMeter {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,6 +280,7 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
if (item != null && item.PreAdjustment && item.meterType == MeterTypes.MagFlux)
|
if (item != null && item.PreAdjustment && item.meterType == MeterTypes.MagFlux)
|
||||||
{
|
{
|
||||||
var newMeter = new MagFluxMeter();
|
var newMeter = new MagFluxMeter();
|
||||||
|
newMeter.SetupFromConfigFile(item.Slot);
|
||||||
newMeter.Login();
|
newMeter.Login();
|
||||||
newMeter.SerialNumber = item.SerialNr;
|
newMeter.SerialNumber = item.SerialNr;
|
||||||
|
|
||||||
@@ -301,7 +306,7 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
var c = TestsetuptContainer.meterTestSettings.Count();
|
var c = TestsetuptContainer.meterTestSettings.Count();
|
||||||
|
|
||||||
TestsetuptContainer.meterTestResults = new MeterTestResults[c];
|
TestsetuptContainer.meterTestResults = new MeterTestResults[c];
|
||||||
for (int i = 0; i <= c; i++)
|
for (int i = 0; i < c; i++)
|
||||||
{
|
{
|
||||||
TestsetuptContainer.meterTestResults[c] = new MeterTestResults();
|
TestsetuptContainer.meterTestResults[c] = new MeterTestResults();
|
||||||
TestsetuptContainer.meterTestResults[c].Results = new List<Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations>();
|
TestsetuptContainer.meterTestResults[c].Results = new List<Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations>();
|
||||||
@@ -325,7 +330,7 @@ namespace XylemCommonUiLegacyGenCtl
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Fatal(ex);
|
_logger.Fatal(ex);
|
||||||
MessageBox.Show($"FATAL {ex.Message}");
|
MessageBox.Show($"FATAL Start Action {ex.Message}");
|
||||||
pollingAction = PollingAction.IsOnError;
|
pollingAction = PollingAction.IsOnError;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -654,7 +654,7 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_magFluxMeter?.WriteCalibration(_calibPointsCmPerH);
|
_magFluxMeter?.WriteCalibration(_calibPointsCmPerH);
|
||||||
SetControlsDownloadIsFinished();
|
btnReadCalibration_Click(this, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnAbortCalibration_Click(Object sender, EventArgs e)
|
private void btnAbortCalibration_Click(Object sender, EventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user