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);
|
||||
}
|
||||
|
||||
|
||||
/// <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>
|
||||
/// Setup water meter from configuration file:
|
||||
/// -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show($"FATAL {ex.Message}");
|
||||
MessageBox.Show($"FATAL Ctor {ex.Message}");
|
||||
}
|
||||
|
||||
|
||||
@@ -167,12 +167,16 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
if (TestsetuptContainer == null)
|
||||
{
|
||||
TestsetuptContainer = new TestSetupContainer();
|
||||
TestsetuptContainer.TempSouce = Enums.TempSouceType.PtOverSps;
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -226,7 +230,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Fatal(ex);
|
||||
MessageBox.Show($"FATAL {ex.Message}");
|
||||
MessageBox.Show($"FATAL internalPrep {ex.Message}");
|
||||
}
|
||||
}
|
||||
public void PrepareAction(Int32 slotCount, String cultureStr)
|
||||
@@ -244,7 +248,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
catch (Exception 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)
|
||||
{
|
||||
var newMeter = new MagFluxMeter();
|
||||
newMeter.SetupFromConfigFile(item.Slot);
|
||||
newMeter.Login();
|
||||
newMeter.SerialNumber = item.SerialNr;
|
||||
|
||||
@@ -301,7 +306,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
var c = TestsetuptContainer.meterTestSettings.Count();
|
||||
|
||||
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].Results = new List<Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations>();
|
||||
@@ -325,7 +330,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Fatal(ex);
|
||||
MessageBox.Show($"FATAL {ex.Message}");
|
||||
MessageBox.Show($"FATAL Start Action {ex.Message}");
|
||||
pollingAction = PollingAction.IsOnError;
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -654,7 +654,7 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
||||
return;
|
||||
|
||||
_magFluxMeter?.WriteCalibration(_calibPointsCmPerH);
|
||||
SetControlsDownloadIsFinished();
|
||||
btnReadCalibration_Click(this, null);
|
||||
}
|
||||
|
||||
private void btnAbortCalibration_Click(Object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user