Add register watch on pui

This commit is contained in:
Roland Drabesch
2023-01-26 11:12:09 +01:00
parent 43a29dd57e
commit 3dea2d19a1
5 changed files with 101 additions and 2 deletions
@@ -933,7 +933,16 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
StartKeepSession();
return responseRecord;
}
/// <summary>
/// Clear password to force new password reading
/// </summary>
/// <remarks date="2023JAN21" author="R.Drabesch">
/// - Initial.
/// </remarks>
public void ClearPassword()
{
_password = string.Empty;
}
/// <summary>
/// Acquires the password from WEB-API.
/// </summary>
@@ -422,14 +422,20 @@ namespace ProductionUiCordonel
pc.Processes.Add(serialBarcode); //[x] [x] [x]
//pc.Processes.Add(new ProductionProcessFullReadOut()); //[x] [x] [x]
pc.Processes.Add(new ProductionCheckShippingState()); //[x] [x] [x]
pc.Processes.Add(new ProductionProcessRegisterWatch());
pc.Processes.Add(new ProductionProcessPasswordFile()); //[x] [x] [x]
pc.Processes.Add(new ProductionProcessRegisterWatch());
//pc.Processes.Add(new ProductionProcessFinalParametrizationFix()); //[x] [x] []
pc.Processes.Add(new ProductionProcessFinalParametrizationVakoCsd(connectProcess, RadioAddress != 0)); //[x] [x] []
pc.Processes.Add(new ProductionProcessRegisterWatch());
//if (RadioAddress != 0)
//{
@@ -442,13 +448,17 @@ namespace ProductionUiCordonel
pc.Processes.Add(radioCheck); //[] [] []
//}
pc.Processes.Add(new ProductionProcessRegisterWatch());
//pc.Processes.Add(new ProductionProcessSpecialConfig()); //[x] [x] []
pc.Processes.Add(new ProductionProcessShippingMode(true, RadioAddress != 0)); //[] [] []
pc.Processes.Add(new ProductionProcessRegisterWatch());
pc.Processes.Add(new ProductionProcessFinalParametrizationVakoCsd(connectProcess, RadioAddress != 0)); //[x] [x] []
pc.Processes.Add(new ProductionProcessRegisterWatch());
pc.Processes.Add(new ProductionProcessShippingMode(false, RadioAddress != 0)); //[] [] []
pc.Processes.Add(new ProductionProcessRegisterWatch());
pc.Processes.Add(new ProductionProcessFullReadOut()); //[x] [x] [x]
pc.Processes.Add(new ProductionProcessLogOff()); //[] [] []
@@ -103,6 +103,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//test the production database password
if (ret)
{
Meter.ClearPassword();
ret = Meter.Login();
}
updateImage(UserControl.CheckNewPassword, ret);
@@ -0,0 +1,78 @@
using ProductionUiCordonel.ProductionProcesses.Enum;
using ProductionUiCordonel.UserControls.FinalTest;
using System;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
namespace ProductionUiCordonel.ProductionProcesses.Actions
{
public class ProductionProcessRegisterWatch : BaseProductionProcess
{
private UcFullReadOut UserControl;
public ProductionProcessRegisterWatch()
{
name = "Sicherung des Zählerzustandes";
currentProcessState = ProductionProcessState.Waiting;
}
public override void InitUserControl()
{
UserControl = new UcFullReadOut();
}
public override UserControl GetControl()
{
if (UserControl == null)
{
throw new Exception($"UserControl {GetType()} not Ready");
}
return UserControl;
}
public override void ProcessDone()
{
//clear
}
public override void StartProcess()
{
UserControl.lblHl.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() => { UserControl.lblHl.Content = "Read out Registers"; }
));
var total = Meter.GetRegistersDic().Keys.Where(n => n.RegisterName == "TemperatureMeasurePeriod" || n.RegisterName == "PressureMeasurePeriod" || n.RegisterName == "METROLOGYASST_PressureRate").ToList();
var done = 0;
foreach (var dic in total)
{
var ret = Meter.ReadRegister(dic.GetIdent());
if (dic.AppName == "SENSUSRADIO")
{
Meter.WriteLog($"Register Watch: {dic.RegisterName} = { RegisterConverter.ConvertTo<UInt16>(ret)}");
}
else
{
Meter.WriteLog($"Register Watch: {dic.RegisterName} = { RegisterConverter.ConvertTo<UInt32>(ret)}");
}
}
done += 1;
//Meter.StoreCurrentRegisterDic();
//Meter.Configuration.UseRegisterWatchService = oldConfigEntry;
currentProcessState = ProductionProcessState.Done;
}
}
}
@@ -163,6 +163,7 @@
<Compile Include="ProductionProcesses\Actions\ProductionProcessCheckOrderNumber.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessCheckAttachment.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionCheckShippingState.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessRegisterWatch.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessGetFinalParametrizationVakoCsd.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessFinalParametrizationVakoCsd.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessLogOff.cs" />