Add MagFlux Zeroflow
This commit is contained in:
@@ -155,7 +155,7 @@
|
||||
</site>
|
||||
<site name="MeterProcessState" id="2">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\laa_production\Common\Service\MeterProcessState" />
|
||||
<virtualDirectory path="/" physicalPath="C:\Users\drabesch_ro\Repo\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation="*:56011:localhost" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Xylem.Common.Ui.CordonelPreadjustmentUi</RootNamespace>
|
||||
<AssemblyName>Xylem.Common.Ui.CordonelPreadjustmentUi</AssemblyName>
|
||||
@@ -103,9 +103,7 @@
|
||||
<PropertyGroup />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup>
|
||||
<NoWin32Manifest>true</NoWin32Manifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup />
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
@@ -159,6 +157,7 @@
|
||||
<DependentUpon>PreAdjustmentControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PreAdjustmentSettingsContainer.cs" />
|
||||
<Compile Include="Processes\Actions\MagFluxZeroFlow.cs" />
|
||||
<Compile Include="Processes\Actions\PressureTestProcess.cs" />
|
||||
<Compile Include="Processes\Actions\FlushProcess.cs" />
|
||||
<Compile Include="Processes\Actions\PrepareTestProcess.cs" />
|
||||
|
||||
@@ -1676,6 +1676,11 @@ namespace CordonelPreadjustmentUi
|
||||
|
||||
List<IProcess> listOfProgrammParts = new List<IProcess>();
|
||||
|
||||
if ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
listOfProgrammParts.Add(new PrepareTestProcess("PrepareTest", StatusPanelItems.Detect, string.Empty, string.Empty, 1 * 60));
|
||||
|
||||
listOfProgrammParts.Add(new LoginProcess("Login", StatusPanelItems.Detect, PredefinedMessages.WaitUntilLoginFinished(pp.Setting.Culture), PredefinedMessages.LoginFailed(pp.Setting.Culture), 1 * 60));
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
using CordonelPreadjustmentUi.Processes;
|
||||
using CordonelPreadjustmentUi.Processes.Itinerary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static CordonelPreadjustmentUi.PreAdjustmentControl;
|
||||
|
||||
namespace Xylem.Common.Ui.CordonelPreadjustmentUi.Processes.Actions
|
||||
{
|
||||
public class MagFluxZeroFlowProcess : BaseProcess
|
||||
{
|
||||
public MagFluxZeroFlowProcess(string processName, StatusPanelItems panelState, string performMessage, string failedMessage, int? expectedTimeS) : base(processName, panelState, performMessage, failedMessage, expectedTimeS)
|
||||
{
|
||||
}
|
||||
public override List<Task> StartWork()
|
||||
{
|
||||
return doWorkProcess(base.CurrentProcessProgress);
|
||||
}
|
||||
|
||||
private List<Task> doWorkProcess(ProcessProgress currentProcessProgress)
|
||||
{
|
||||
private List<Task> doWorkProcess(ProcessProgress pp)
|
||||
{
|
||||
|
||||
|
||||
var MetersToProcess = MeterStateCtls.Where(e => e.IsEnabled).ToList();
|
||||
|
||||
var listOfProcessTask = new List<Task>();
|
||||
|
||||
listOfProcessTask.Add(new Task<bool>(() =>
|
||||
{
|
||||
|
||||
pp.DebugMessage($"Performing {ProcessName} procedure", null, "APP");
|
||||
|
||||
var ZeroOffsetTime = DateTimeOffset.UtcNow.AddMinutes(2);
|
||||
|
||||
var MetersToProcess = MeterStateCtls.Where(e => e.IsEnabled).ToList();
|
||||
|
||||
|
||||
|
||||
while (FlushTime > DateTimeOffset.UtcNow)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}));
|
||||
|
||||
|
||||
return listOfProcessTask;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
|
||||
using Xylem.Common.Utils.Logging;
|
||||
using XYLEM.Device;
|
||||
|
||||
|
||||
namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1a3d4919c9c702245832d925951f2b7cb72fc333
|
||||
5ed75d99ee45ff67821090f1b3dbb001dd9e4fe3
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
f64d563def603c89cafafa61a3219ba97e1e344c
|
||||
0d85a5b3a7561b41163c20e5dc7713bcd0d65555
|
||||
|
||||
@@ -8,10 +8,12 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using Xylem.Common.CommonCore.Consts;
|
||||
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
|
||||
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
|
||||
using Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore;
|
||||
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
||||
using Xylem.Common.Ui.CordonelPreadjustmentUi.Parameters;
|
||||
using Xylem.Common.Utils.Logging;
|
||||
using XylemCommonUiLegacyGenCtl.DataPackage;
|
||||
@@ -30,6 +32,9 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
private ILogger _logger = null;
|
||||
private List<int> MetersFinallyPassed = new List<int>();
|
||||
private TestSetupContainer TestsetuptContainer;
|
||||
|
||||
public MeterTypes Mode { get; private set; }
|
||||
|
||||
public PreAdjWr()
|
||||
{
|
||||
try
|
||||
@@ -169,6 +174,8 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
TestsetuptContainer.ProductionMode = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var numberOfPaths = (TestsetuptContainer.AllChanelsRequired ? 3 : 1);
|
||||
|
||||
_logger.Info($"PrepareAction [numberOfPaths = {numberOfPaths},slotCount = {slotCount},cultureStr = {cultureStr}, size = { TestsetuptContainer.MeterSize}]");
|
||||
@@ -195,6 +202,8 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// s.TempSouce = TestsetuptContainer.TempSouce;
|
||||
_logger.Info($"SetSettings [{s.ToString()}]");
|
||||
wrappedControl.SetSettings(s);
|
||||
@@ -206,6 +215,13 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
{
|
||||
EnableMeter(item.Slot, true, item.SerialNr);
|
||||
}
|
||||
Mode = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.Cordonel;
|
||||
|
||||
if (TestsetuptContainer.meterTestSettings.All(a => a.meterType == Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.MagFlux))
|
||||
{
|
||||
Mode = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.MagFlux;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -236,6 +252,10 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Mode == MeterTypes.Cordonel)
|
||||
{
|
||||
|
||||
|
||||
foreach (var item in TestsetuptContainer?.meterTestSettings)
|
||||
{
|
||||
if (item != null && item.PreAdjustment)
|
||||
@@ -246,6 +266,59 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
|
||||
wrappedControl.AutoStart();
|
||||
}
|
||||
else if (Mode == MeterTypes.MagFlux)
|
||||
{
|
||||
var meterBatch = new MeterBatch();
|
||||
|
||||
foreach (var item in TestsetuptContainer?.meterTestSettings)
|
||||
{
|
||||
if (item != null && item.PreAdjustment && item.meterType == MeterTypes.MagFlux)
|
||||
{
|
||||
var newMeter = new MagFluxMeter();
|
||||
newMeter.Login();
|
||||
newMeter.SerialNumber = item.SerialNr;
|
||||
meterBatch.AddMeter(newMeter);
|
||||
}
|
||||
}
|
||||
|
||||
meterBatch.MetersStartMeasurement();
|
||||
var testTime = 60;
|
||||
var ZeroOffsetTime = DateTimeOffset.UtcNow.AddSeconds(testTime);
|
||||
while (ZeroOffsetTime > DateTimeOffset.UtcNow)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
meterBatch.MetersStopMeasurement();
|
||||
ZeroOffsetTime = DateTimeOffset.UtcNow.AddSeconds(10);
|
||||
while (ZeroOffsetTime > DateTimeOffset.UtcNow)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
var c = TestsetuptContainer.meterTestSettings.Count();
|
||||
|
||||
TestsetuptContainer.meterTestResults = new MeterTestResults[c];
|
||||
for (int i = 0; i <= c; i++)
|
||||
{
|
||||
TestsetuptContainer.meterTestResults[c] = new MeterTestResults();
|
||||
TestsetuptContainer.meterTestResults[c].Results = new List<Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.MeasurementRecords.FlowDeviations>();
|
||||
}
|
||||
|
||||
|
||||
foreach (var meter in meterBatch.ListOfMeters)
|
||||
{
|
||||
var resU = meter.GetMainMeasurementResult(0, testTime);
|
||||
|
||||
TestsetuptContainer.meterTestResults[meter.Slot - 1].meterType = MeterTypes.MagFlux;
|
||||
TestsetuptContainer.meterTestResults[meter.Slot - 1].Slot = meter.Slot;
|
||||
TestsetuptContainer.meterTestResults[meter.Slot - 1].SerialNr = meter.SerialNumber;
|
||||
TestsetuptContainer.meterTestResults[meter.Slot - 1].Results.Add(new Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages.MeasurementRecords.FlowDeviations() { RefTimeS = testTime, MeasuredRefFlowQmPerH = 0, RequierdTimeS = testTime, RequierdFlowQmPerH = 0, MeasuredDutFlowQmPerH = resU.DutFlowRateCmPh.Value, DutTimeS = resU.DutTimeS });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Fatal(ex);
|
||||
@@ -259,30 +332,30 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
}
|
||||
|
||||
public void SetFlushIsDone()
|
||||
{
|
||||
{
|
||||
wrappedControl?.SetFlushIsDone();
|
||||
pollingAction = PollingAction.IsBusy;
|
||||
|
||||
}
|
||||
public void SetTestBenchTemp(double Temp)
|
||||
{
|
||||
}
|
||||
public void SetTestBenchTemp(double Temp)
|
||||
{
|
||||
wrappedControl?.SetTestBenchTemp(Temp);
|
||||
pollingAction = PollingAction.IsBusy;
|
||||
|
||||
}
|
||||
public PollingAction GetPollingAction()
|
||||
{
|
||||
}
|
||||
public PollingAction GetPollingAction()
|
||||
{
|
||||
return pollingAction;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
|
||||
if (wrappedControl != null)
|
||||
{
|
||||
@@ -296,19 +369,19 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetMeterIsDone(int Slot)
|
||||
{
|
||||
public bool GetMeterIsDone(int Slot)
|
||||
{
|
||||
if (MetersFinallyPassed.Contains(Slot))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTestSetupContainer(dynamic vbContainer)
|
||||
{
|
||||
public void SetTestSetupContainer(dynamic vbContainer)
|
||||
{
|
||||
if (vbContainer is TestSetupContainer container)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -320,6 +393,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
sb.AppendLine($"AllChanelsRequired={container.AllChanelsRequired}");
|
||||
sb.AppendLine($"ProductionMode={container.ProductionMode}");
|
||||
|
||||
|
||||
foreach (var item in container.meterTestSettings)
|
||||
{
|
||||
if (item == null)
|
||||
@@ -332,11 +406,13 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
sb.AppendLine($"PreAdjustment={item.PreAdjustment}");
|
||||
sb.AppendLine($"FlowAdjustment={item.FlowAdjustment}");
|
||||
sb.AppendLine($"FlowAdjustmentTarget={item.FlowAdjustmentTarget}");
|
||||
sb.AppendLine($"FlowAdjustmentTarget={item.meterType}");
|
||||
|
||||
}
|
||||
|
||||
_logger.Info($"SetTestSetupContainer ({sb}) ");
|
||||
TestsetuptContainer = vbContainer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
testSetup.meterTestSettings[Slot - 1].FlowAdjustmentTarget = Convert.ToDecimal(FlowAdjustmentTarget);
|
||||
testSetup.meterTestSettings[Slot - 1].PreAdjustment = PreAdjustment;
|
||||
testSetup.meterTestSettings[Slot - 1].FlowTesting = FlowTesting;
|
||||
testSetup.meterTestSettings[Slot - 1].meterType = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.Cordonel ;
|
||||
testSetup.meterTestSettings[Slot - 1].meterType = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.Cordonel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -765,7 +765,6 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
}
|
||||
|
||||
|
||||
|
||||
meter.SerialNumber = item.SerialNr;
|
||||
meter.CurrentActionText = "FlowTest";
|
||||
meter.SetupFromConfigFile(item.Slot, false, _useRequest, true);
|
||||
@@ -1098,14 +1097,20 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
|
||||
_logger.Debug($"Add Meter To Grid {meter.Slot}");
|
||||
|
||||
if (!(meter is GenesisMeter genesisMeter))
|
||||
if ((meter is GenesisMeter genesisMeter))
|
||||
{
|
||||
AddMeterToGrid(meter.Slot, meter.SerialNumber, "-", IsFlyingStartStop);
|
||||
AddMeterToGrid(meter.Slot, meter.SerialNumber, genesisMeter.PcbId, IsFlyingStartStop);
|
||||
|
||||
}
|
||||
else if ((meter is MagFluxMeter fluxMeter))
|
||||
{
|
||||
AddMeterToGrid(meter.Slot, meter.SerialNumber, fluxMeter.PcbId, IsFlyingStartStop);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
AddMeterToGrid(meter.Slot, meter.SerialNumber, "-", IsFlyingStartStop);
|
||||
|
||||
AddMeterToGrid(meter.Slot, meter.SerialNumber, genesisMeter.PcbId, IsFlyingStartStop);
|
||||
}
|
||||
//todo : roland check SkipPrepearationForTestBench
|
||||
//((GenesisMeter)meter).SkipPrepearationForTestBench = true;
|
||||
@@ -2260,9 +2265,10 @@ namespace XylemCommonUiLegacyGenCtl
|
||||
sb.AppendLine($"PreAdjustment={item.PreAdjustment}");
|
||||
sb.AppendLine($"FlowAdjustment={item.FlowAdjustment}");
|
||||
sb.AppendLine($"FlowAdjustmentTarget={item.FlowAdjustmentTarget}");
|
||||
sb.AppendLine($"meterType={item.meterType}");
|
||||
}
|
||||
_logger.Info($"SetTestSetupContainer ({sb}) ");
|
||||
//MessageBox.Show(sb.ToString());
|
||||
MessageBox.Show(sb.ToString());
|
||||
TestSetupContainer = vbContainer;
|
||||
_currentState = BatchState.TestContainerIsReady;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user