ProductionUiCordonel: -ReSharper

This commit is contained in:
Thomas Wiedebusch
2023-01-23 13:18:54 +01:00
parent a1df7a2fec
commit 0230ea7554
49 changed files with 305 additions and 548 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
<s:Boolean x:Key="/Default/Environment/ExcludedFiles/FilesAndFoldersToSkip/=1057AD21_002DBA22_002D4CAB_002DB3FE_002D88C5C9980E6A_002Fd_003AScripts_002Ff_003Ajquery_002D1_002E10_002E2_002Eintellisense_002Ejs/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/ExcludedFiles/FilesAndFoldersToSkip/=1057AD21_002DBA22_002D4CAB_002DB3FE_002D88C5C9980E6A_002Fd_003AScripts_002Ff_003Ajquery_002D1_002E10_002E2_002Eintellisense_002Ejs/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/Hierarchy/Build/SolBuilderDuo/UseMsbuildSolutionBuilder/@EntryValue">NewVersion</s:String> <s:String x:Key="/Default/Environment/Hierarchy/Build/SolBuilderDuo/UseMsbuildSolutionBuilder/@EntryValue">NewVersion</s:String>
<s:Boolean x:Key="/Default/Environment/Hierarchy/EntityFrameworkOptions/IsAlreadyNotifiedAboutEntityFramework/@EntryValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/Hierarchy/EntityFrameworkOptions/IsAlreadyNotifiedAboutEntityFramework/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\Thomas\AppData\Local\Temp\JetBrains\ReSharperPlatformVs15\vAny_33007af5\CoverageData\_Common.-1885154465\Snapshot\snapshot.utdcvr</s:String>
-1
View File
@@ -1,6 +1,5 @@
using System; using System;
using System.Windows; using System.Windows;
using System.Windows.Input;
namespace ProductionUiCordonel namespace ProductionUiCordonel
{ {
@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
@@ -42,7 +42,7 @@ namespace ProductionUiCordonel.Data
public String PcbId; public String PcbId;
private Int32 rev = 0; private Int32 rev;
public Int32 Rev public Int32 Rev
{ {
@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProductionUiCordonel.Event namespace ProductionUiCordonel.Event
{ {
+2 -2
View File
@@ -14,7 +14,7 @@
<ComboBox Name="cbxSlotBox" Margin="0,5,0,0" VerticalAlignment="Top" SelectionChanged="CbxSlotBox_SelectionChanged" /> <ComboBox Name="cbxSlotBox" Margin="0,5,0,0" VerticalAlignment="Top" SelectionChanged="CbxSlotBox_SelectionChanged" />
<Button Name="BtnConntect" VerticalAlignment="Top" Click="BtnConntect_Click" HorizontalAlignment="Right" ToolTip="Force connect to meter"> <Button Name="BtnConnect" VerticalAlignment="Top" Click="BtnConntect_Click" HorizontalAlignment="Right" ToolTip="Force connect to meter">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Image Source="/Resources/Connect_16x.png" /> <Image Source="/Resources/Connect_16x.png" />
<TextBlock Margin="3,0,0,0">Connect</TextBlock> <TextBlock Margin="3,0,0,0">Connect</TextBlock>
@@ -89,7 +89,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!--<Button Name="btnStart" IsEnabled="False" Content="Start" Click="ButtonBase_OnClick" HorizontalAlignment="Left" Height="58" Margin="0,0,0,1" VerticalAlignment="Bottom" Width="122" Grid.Row="0" Grid.Column="4" Grid.RowSpan="2" />--> <!--<Button Name="btnStart" IsEnabled="False" Content="Start" Click="ButtonBase_OnClick" HorizontalAlignment="Left" Height="58" Margin="0,0,0,1" VerticalAlignment="Bottom" Width="122" Grid.Row="0" Grid.Column="4" Grid.RowSpan="2" />-->
<Label Content="SerialNumber" HorizontalAlignment="Left" Margin="10,1,0,0" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" Height="26" Width="82" /> <Label Content="SerialNumber" HorizontalAlignment="Left" Margin="10,1,0,0" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" Height="26" Width="82" />
<Label Content="RadioAdress" HorizontalAlignment="Left" Margin="10,2,0,0" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" Height="26" Width="76" /> <Label Content="RadioAddress" HorizontalAlignment="Left" Margin="10,2,0,0" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" Height="26" Width="76" />
<Label Content="OrderNumber" HorizontalAlignment="Left" Margin="10,3,0,0" VerticalAlignment="Top" Grid.Row="2" Grid.Column="0" Height="26" Width="84" /> <Label Content="OrderNumber" HorizontalAlignment="Left" Margin="10,3,0,0" VerticalAlignment="Top" Grid.Row="2" Grid.Column="0" Height="26" Width="84" />
+33 -49
View File
@@ -30,12 +30,12 @@ namespace ProductionUiCordonel
/// <summary> /// <summary>
/// Interaction logic for FinalRadioTest.xaml /// Interaction logic for FinalRadioTest.xaml
/// </summary> /// </summary>
public partial class FinalRadioTest : Window public partial class FinalRadioTest
{ {
public event EventHandler OnLockMeter; public event EventHandler OnLockMeter;
public event EventHandler OnReleaseMeter; public event EventHandler OnReleaseMeter;
public event EventHandler OrderHasChanged; public event EventHandler OrderHasChanged;
public event EventHandler KeyInputMainFrom; //public event EventHandler KeyInputMainFrom;
#region prop #region prop
private GenesisMeter genesisMeter; private GenesisMeter genesisMeter;
@@ -67,7 +67,7 @@ namespace ProductionUiCordonel
} }
} }
private Int64 radioAddress; private Int64 radioAddress;
public Int64 RadioAdress public Int64 RadioAddress
{ {
get => radioAddress; get => radioAddress;
set set
@@ -281,10 +281,7 @@ namespace ProductionUiCordonel
var responseJson = LocalWebRequest.GetRequest(url); var responseJson = LocalWebRequest.GetRequest(url);
var a = JsonConvert.DeserializeObject<String[]>(responseJson); var a = JsonConvert.DeserializeObject<String[]>(responseJson);
int.TryParse(a[1], out var tmpInt);
var tmpInt = 0;
int.TryParse(a[1], out tmpInt);
OrderNumber = tmpInt; OrderNumber = tmpInt;
Int64 tmpLong = 0; Int64 tmpLong = 0;
if (a.Length > 2) if (a.Length > 2)
@@ -293,7 +290,7 @@ namespace ProductionUiCordonel
} }
RadioAdress = tmpLong; RadioAddress = tmpLong;
SerialNumber = a[0]; SerialNumber = a[0];
if (a.Length > 3 && a[3] != SerialNumber) if (a.Length > 3 && a[3] != SerialNumber)
{ {
@@ -415,7 +412,7 @@ namespace ProductionUiCordonel
pc.ProcessLogHandler += PcOnProcessLogHandler; pc.ProcessLogHandler += PcOnProcessLogHandler;
pc.ProcessProgressHandler += Pc_ProcessProgressHandler; pc.ProcessProgressHandler += Pc_ProcessProgressHandler;
var connectProcess = new ProductionProcessConnect(); var connectProcess = new ProductionProcessConnect(CurrentGenesisMeter);
pc.Processes.Add(connectProcess); //[x] [x] [x] pc.Processes.Add(connectProcess); //[x] [x] [x]
@@ -427,7 +424,7 @@ namespace ProductionUiCordonel
pc.Processes.Add(orderBarcode); //[x] [x] [x] pc.Processes.Add(orderBarcode); //[x] [x] [x]
serialBarcode = new ProductionProcessCheckSerialNumber(SerialNumber, RadioAdress.ToString()); serialBarcode = new ProductionProcessCheckSerialNumber(SerialNumber, RadioAddress.ToString());
pc.Processes.Add(serialBarcode); //[x] [x] [x] pc.Processes.Add(serialBarcode); //[x] [x] [x]
//pc.Processes.Add(new ProductionProcessFullReadOut()); //[x] [x] [x] //pc.Processes.Add(new ProductionProcessFullReadOut()); //[x] [x] [x]
@@ -436,10 +433,10 @@ namespace ProductionUiCordonel
pc.Processes.Add(new ProductionProcessPasswordFile()); //[x] [x] [x] pc.Processes.Add(new ProductionProcessPasswordFile()); //[x] [x] [x]
//pc.Processes.Add(new ProductionProcessFinalParameterizationFix()); //[x] [x] [] //pc.Processes.Add(new ProductionProcessFinalParametrizationFix()); //[x] [x] []
pc.Processes.Add(new ProductionProcessFinalParameterizationVakoCsd(connectProcess, RadioAdress != 0)); //[x] [x] [] pc.Processes.Add(new ProductionProcessFinalParameterizationVakoCsd(connectProcess, RadioAddress != 0)); //[x] [x] []
//if (RadioAdress != 0) //if (RadioAddress != 0)
//{ //{
var radioCheck = new ProductionProcessRadioCheck(); var radioCheck = new ProductionProcessRadioCheck();
@@ -452,11 +449,11 @@ namespace ProductionUiCordonel
//} //}
//pc.Processes.Add(new ProductionProcessSpecialConfig()); //[x] [x] [] //pc.Processes.Add(new ProductionProcessSpecialConfig()); //[x] [x] []
pc.Processes.Add(new ProductionProcessShippingMode(true, RadioAdress != 0)); //[] [] [] pc.Processes.Add(new ProductionProcessShippingMode(true, RadioAddress != 0)); //[] [] []
pc.Processes.Add(new ProductionProcessFinalParameterizationVakoCsd(connectProcess, RadioAdress != 0)); //[x] [x] [] pc.Processes.Add(new ProductionProcessFinalParameterizationVakoCsd(connectProcess, RadioAddress != 0)); //[x] [x] []
pc.Processes.Add(new ProductionProcessShippingMode(false, RadioAdress != 0)); //[] [] [] pc.Processes.Add(new ProductionProcessShippingMode(false, RadioAddress != 0)); //[] [] []
pc.Processes.Add(new ProductionProcessFullReadOut()); //[x] [x] [x] pc.Processes.Add(new ProductionProcessFullReadOut()); //[x] [x] [x]
pc.Processes.Add(new ProductionProcessLogOff()); //[] [] [] pc.Processes.Add(new ProductionProcessLogOff()); //[] [] []
@@ -464,7 +461,7 @@ namespace ProductionUiCordonel
var checkAttach = new ProductionProcessCheckAttachment(OrderNumber); var checkAttach = new ProductionProcessCheckAttachment(OrderNumber);
orderBarcode.isDone += (x, g) => orderBarcode.isDone += (x, g) =>
{ {
checkAttach.OrderNumber = ((ProductionProcessCheckOrderNumber)x).Ordernumber; ; checkAttach.OrderNumber = ((ProductionProcessCheckOrderNumber)x).Ordernumber;
}; };
pc.Processes.Add(checkAttach); //[] [] [] pc.Processes.Add(checkAttach); //[] [] []
@@ -527,7 +524,7 @@ namespace ProductionUiCordonel
{ {
return; return;
} }
if (newMeter == null && oldMeter != null) if (newMeter == null)
{ {
//remove all //remove all
CurrentProcess = "Warte auf Zähler"; CurrentProcess = "Warte auf Zähler";
@@ -536,7 +533,7 @@ namespace ProductionUiCordonel
return; return;
} }
if (oldMeter?.PcbId == newMeter?.PcbId && newMeter?.PcbId == lastPcbID) if (oldMeter?.PcbId == newMeter.PcbId && newMeter.PcbId == lastPcbID)
{ {
return; return;
} }
@@ -544,13 +541,6 @@ namespace ProductionUiCordonel
UiElmEnable(btnDetect, false); UiElmEnable(btnDetect, false);
CurrentProcess = "Bitte den Startknopf drücken"; CurrentProcess = "Bitte den Startknopf drücken";
Task.Run(() => { LoadDetails(); }); Task.Run(() => { LoadDetails(); });
//real change
} }
private void UiElmEnable(UIElement elm, Boolean isEnabled) private void UiElmEnable(UIElement elm, Boolean isEnabled)
@@ -583,10 +573,7 @@ namespace ProductionUiCordonel
pbTotalProgress.Dispatcher.Invoke(DispatcherPriority.Normal, pbTotalProgress.Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() => new Action(() =>
{ {
if (e != null) pbTotalProgress.Value = e.Progress;
{
pbTotalProgress.Value = e.Progress;
}
} }
)); ));
} }
@@ -595,10 +582,7 @@ namespace ProductionUiCordonel
pbSubProgress.Dispatcher.Invoke(DispatcherPriority.Normal, pbSubProgress.Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() => new Action(() =>
{ {
if (e != null) pbSubProgress.Value = e.Progress;
{
pbSubProgress.Value = e.Progress;
}
} }
)); ));
} }
@@ -609,13 +593,14 @@ namespace ProductionUiCordonel
ctl.Dispatcher.Invoke(DispatcherPriority.Normal, ctl.Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() => new Action(() =>
{ {
if (ctl != null) // table is a DataTable if (true) // table is a DataTable
{ {
ctl.Content = text; ctl.Content = text;
} }
} }
)); ));
} }
private void updateStatusGrid() private void updateStatusGrid()
{ {
var dt = new DataTable(); var dt = new DataTable();
@@ -633,14 +618,12 @@ namespace ProductionUiCordonel
dgTotalProcess.Dispatcher.Invoke(DispatcherPriority.Normal, dgTotalProcess.Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() => new Action(() =>
{ {
if (dt != null) // table is a DataTable if (true) // table is a DataTable
{ {
dgTotalProcess.DataContext = dt; dgTotalProcess.DataContext = dt;
} }
} }
)); ));
} }
@@ -651,19 +634,17 @@ namespace ProductionUiCordonel
{ {
dpSubProcess.Children.Clear(); dpSubProcess.Children.Clear();
dpSubProcess.Children.Add(c); dpSubProcess.Children.Add(c);
DockPanel.SetDock(c, Dock.Top & Dock.Left); DockPanel.SetDock(c, Dock.Top); // & Dock.Left);
} }
)); ));
} }
private void Pc_ProcessStateChangedHandler(Object sender, EventArgs e) private void Pc_ProcessStateChangedHandler(Object sender, EventArgs e)
{ {
if (sender is IProductionProcess) if (sender is IProductionProcess)
{ {
var currentProcess = ((IProductionProcess)sender); var process = ((IProductionProcess)sender);
updateProcessControl(currentProcess.GetUserControl()); updateProcessControl(process.GetUserControl());
} }
updateStatusGrid(); updateStatusGrid();
@@ -684,7 +665,7 @@ namespace ProductionUiCordonel
currentProcess = "Warte auf Zähler"; currentProcess = "Warte auf Zähler";
OrderNumber = 0; OrderNumber = 0;
SerialNumber = "-"; SerialNumber = "-";
RadioAdress = 0; RadioAddress = 0;
return; return;
} }
lastPcbID = CurrentGenesisMeter.PcbId; lastPcbID = CurrentGenesisMeter.PcbId;
@@ -711,7 +692,7 @@ namespace ProductionUiCordonel
private void BtnConntect_Click(Object sender, RoutedEventArgs e) private void BtnConntect_Click(Object sender, RoutedEventArgs e)
{ {
var hasDetect = Detect(false, (Int32)cbxSlotBox.SelectedValue); Detect(false, (Int32)cbxSlotBox.SelectedValue);
Settings.Slot = (Int32)cbxSlotBox.SelectedValue; Settings.Slot = (Int32)cbxSlotBox.SelectedValue;
storeSetting(); storeSetting();
@@ -759,16 +740,19 @@ namespace ProductionUiCordonel
{ {
if (serialBarcode?.GetUserControl() is UcBarcodeInput bar) if (serialBarcode?.GetUserControl() is UcBarcodeInput bar)
{ {
bar?.inputKey(txtInputHidden.Text); bar.inputKey(txtInputHidden.Text);
} }
if (orderBarcode?.GetUserControl() is UcBarcodeInput obar) if (orderBarcode?.GetUserControl() is UcBarcodeInput orderBar)
{ {
obar?.inputKey(txtInputHidden.Text); orderBar.inputKey(txtInputHidden.Text);
} }
txtInputHidden.Clear(); txtInputHidden.Clear();
} }
}
protected virtual void OnOnReleaseMeter()
{
OnReleaseMeter?.Invoke(this, EventArgs.Empty);
} }
} }
} }
+1 -1
View File
@@ -15,7 +15,7 @@
<ComboBox Name="cbxSlotBox" Margin="0,5,0,0" VerticalAlignment="Top" SelectionChanged="CbxSlotBox_SelectionChanged" /> <ComboBox Name="cbxSlotBox" Margin="0,5,0,0" VerticalAlignment="Top" SelectionChanged="CbxSlotBox_SelectionChanged" />
<Button Name="BtnConntect" VerticalAlignment="Top" Click="BtnConntect_Click" HorizontalAlignment="Right" ToolTip="Force connect to meter"> <Button Name="BtnConntect" VerticalAlignment="Top" Click="BtnConnect_Click" HorizontalAlignment="Right" ToolTip="Force connect to meter">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Image Source="/Resources/Connect_16x.png" /> <Image Source="/Resources/Connect_16x.png" />
<TextBlock Margin="3,0,0,0">Connect</TextBlock> <TextBlock Margin="3,0,0,0">Connect</TextBlock>
+6 -10
View File
@@ -1,24 +1,19 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using ProductionUiCordonel.Model; using ProductionUiCordonel.Model;
using System; using System;
using System.Data;
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers; using System.Timers;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Threading; using System.Windows.Threading;
using Xylem.Common.CommonCore.Configuration; using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.CommonCore.Consts; using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore; using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
using Xylem.Common.Logic.SoftwareAccessHelper; using Xylem.Common.Logic.SoftwareAccessHelper;
namespace ProductionUiCordonel namespace ProductionUiCordonel
@@ -162,7 +157,8 @@ namespace ProductionUiCordonel
public ApplicationSettings Settings { get; set; } public ApplicationSettings Settings { get; set; }
private void Window_Initialized(Object sender, EventArgs e) private void Window_Initialized(Object sender, EventArgs e)
{ {
var configfile = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(Xylem.Common.Hardware.WaterMeter.Genesis), ProgramConfig.SerialConfigFileName); var configfile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
nameof(Xylem.Common.Hardware.WaterMeter.Genesis), ProgramConfig.SerialConfigFileName);
if (!File.Exists(configfile)) if (!File.Exists(configfile))
{ {
@@ -205,7 +201,7 @@ namespace ProductionUiCordonel
} }
private void BtnConntect_Click(Object sender, RoutedEventArgs e) private void BtnConnect_Click(Object sender, RoutedEventArgs e)
{ {
var hasDetect = Detect(false, (Int32)cbxSlotBox.SelectedValue); var hasDetect = Detect(false, (Int32)cbxSlotBox.SelectedValue);
@@ -254,7 +250,7 @@ namespace ProductionUiCordonel
} }
} }
private Boolean Detect(Boolean IgnorErrors, Int32 slot) private Boolean Detect(Boolean ignoreErrors, Int32 slot)
{ {
if (!detectIsLocked) if (!detectIsLocked)
{ {
@@ -290,7 +286,7 @@ namespace ProductionUiCordonel
} }
catch (Exception e) catch (Exception e)
{ {
if (!IgnorErrors) if (!ignoreErrors)
{ {
MessageBox.Show($"Error occur.{ Environment.NewLine} {e.Message}"); MessageBox.Show($"Error occur.{ Environment.NewLine} {e.Message}");
} }
@@ -380,7 +376,7 @@ namespace ProductionUiCordonel
} }
ucFinalRadioTest.RadioAdress = tmpInt; ucFinalRadioTest.RadioAddress = tmpInt;
ucFinalRadioTest.SerialNumber = a[0] + "/" + a[3]; ucFinalRadioTest.SerialNumber = a[0] + "/" + a[3];
} }
@@ -1,12 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using ProductionUiCordonel.Data; using ProductionUiCordonel.Data;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.Consts;
using Xylem.Common.Utils.ProcessExec.EventArguments; using Xylem.Common.Utils.ProcessExec.EventArguments;
namespace ProductionUiCordonel.Model namespace ProductionUiCordonel.Model
@@ -1,10 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace ProductionUiCordonel.Model namespace ProductionUiCordonel.Model
{ {
@@ -1,18 +1,16 @@
using Newtonsoft.Json; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xylem.Common.CommonCore.Configuration; using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts; using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
using Xylem.Common.Logic.ProductionOrderCore;
using Xylem.Common.Logic.SoftwareAccessHelper; using Xylem.Common.Logic.SoftwareAccessHelper;
namespace ProductionUiCordonel.Model namespace ProductionUiCordonel.Model
{ {
public class MarriageMultiModeViewModel : BaseMultiModeChildViewModel public class MarriageMultiModeViewModel : BaseMultiModeChildViewModel
{ {
private Boolean canMarry = false; private Boolean canMarry;
public Boolean CanMarry public Boolean CanMarry
{ {
get { return canMarry; } get { return canMarry; }
@@ -12,7 +12,6 @@ using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore; using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
using Xylem.Common.Logic.SoftwareAccessHelper; using Xylem.Common.Logic.SoftwareAccessHelper;
namespace ProductionUiCordonel.Model namespace ProductionUiCordonel.Model
@@ -117,7 +116,7 @@ namespace ProductionUiCordonel.Model
private class BarScanner : IDisposable private class BarScanner : IDisposable
{ {
private Boolean isRuning = false; private Boolean isRuning;
public String Input = ""; public String Input = "";
private String Port; private String Port;
private CancellationToken Cancellation; private CancellationToken Cancellation;
@@ -8,7 +8,6 @@ using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using Xylem.Common.CommonCore.Configuration; using Xylem.Common.CommonCore.Configuration;
@@ -21,7 +20,7 @@ namespace ProductionUiCordonel.Model
public class PickingMultiModeViewModel : BaseMultiModeChildViewModel public class PickingMultiModeViewModel : BaseMultiModeChildViewModel
{ {
private Boolean inputIsEnabled = false; private Boolean inputIsEnabled;
public Boolean InputIsEnabled public Boolean InputIsEnabled
{ {
get { return inputIsEnabled; } get { return inputIsEnabled; }
@@ -34,7 +33,7 @@ namespace ProductionUiCordonel.Model
private Boolean locked = false; private Boolean locked;
public PickingMultiModeViewModel(String ctrName, Int32 slotNR, List<String> barcodeTrigger, Int32? stationID = null) : base(ctrName, slotNR, barcodeTrigger, stationID,false) public PickingMultiModeViewModel(String ctrName, Int32 slotNR, List<String> barcodeTrigger, Int32? stationID = null) : base(ctrName, slotNR, barcodeTrigger, stationID,false)
{ {
VisibilityPicking = Visibility.Visible; VisibilityPicking = Visibility.Visible;
@@ -30,7 +30,7 @@ namespace ProductionUiCordonel.Model
} }
private Boolean inputIsEnabled = false; private Boolean inputIsEnabled;
public Boolean InputIsEnabled public Boolean InputIsEnabled
{ {
get { return inputIsEnabled; } get { return inputIsEnabled; }
@@ -43,7 +43,7 @@ namespace ProductionUiCordonel.Model
public Boolean Locked { get; set; } = false; public Boolean Locked { get; set; } = false;
public Int32? StationID { get; set; } = null; public Int32? StationID { get; set; }
public PressureMultiModeViewModel(String ctrName, Int32 slotNR, List<String> barcodeTrigger, Int32? stationID = null) : base(ctrName, slotNR, barcodeTrigger, stationID) public PressureMultiModeViewModel(String ctrName, Int32 slotNR, List<String> barcodeTrigger, Int32? stationID = null) : base(ctrName, slotNR, barcodeTrigger, stationID)
{ {
@@ -1,13 +1,9 @@
using ProductionUiCordonel.Model; using ProductionUiCordonel.Model;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Windows; using System.Windows;
using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Interop;
namespace ProductionUiCordonel namespace ProductionUiCordonel
{ {
@@ -28,7 +28,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -42,12 +42,12 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private void doStartProcessLoop() private void doStartProcessLoop()
{ {
var reTrysLeft = 1; var retriesRemaining = 1;
while (reTrysLeft >= 0) while (retriesRemaining >= 0)
{ {
try try
{ {
base.Progress = 0; Progress = 0;
//var url = $"http://localhost:56011/api/FinalCheck/GetProgrammingParameters?PcbID={Meter.PcbId}"; //var url = $"http://localhost:56011/api/FinalCheck/GetProgrammingParameters?PcbID={Meter.PcbId}";
var url = $"{ServiceUrls.MeterInfoForTestBench()}{Meter.PcbId}"; var url = $"{ServiceUrls.MeterInfoForTestBench()}{Meter.PcbId}";
var csdRet = LocalWebRequest.GetRequest(url); var csdRet = LocalWebRequest.GetRequest(url);
@@ -56,12 +56,11 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
var CalibrationRun = res[4]; var CalibrationRun = res[4];
var LastTestBechState = 0; var LastTestBechState = 0;
Boolean? HyState = null; Boolean? HyState;
Boolean? preState = null; Boolean? preState = null;
if (!string.IsNullOrEmpty(res[5])) if (!string.IsNullOrEmpty(res[5]))
{ {
var tmp = 0; int.TryParse(res[5], out var tmp);
int.TryParse(res[5], out tmp);
LastTestBechState = tmp; LastTestBechState = tmp;
} }
@@ -93,7 +92,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
} }
)); ));
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
if (!preState.HasValue || !preState.Value) if (!preState.HasValue || !preState.Value)
{ {
@@ -103,10 +102,10 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
UserControl.lblText.Content = $"Zähler nicht erfolgreich vorbehandelt"; UserControl.lblText.Content = $"Zähler nicht erfolgreich vorbehandelt";
} }
)); ));
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
base.Progress = 50; Progress = 50;
var nowSeconds = Meter.ReadRegister("POWERMON_TotalUsedSeconds"); var nowSeconds = Meter.ReadRegister("POWERMON_TotalUsedSeconds");
var nowCharge = Meter.ReadRegister("POWERMON_TotalUsedCharge", 8); var nowCharge = Meter.ReadRegister("POWERMON_TotalUsedCharge", 8);
@@ -129,8 +128,9 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//// Time Span in h in mAhr In % with one battery is 100% //// Time Span in h in mAhr In % with one battery is 100%
////(((total used change difference / (Time span / 3600) ) / 3600000) / 19000)*100 ////(((total used change difference / (Time span / 3600) ) / 3600000) / 19000)*100
var loadAtH = ((((Double)nowChargeV / ((Double)nowSecondsV / 3600)) / 3600000) / (19000 * 2)) * 100; // ReSharper disable once UnusedVariable used for debug purposes
var totalUsed = (((Double)nowChargeV / 1000000 / 3.6) / ((19000 * 2))) * 100; var loadAtH = nowChargeV / ((Double)nowSecondsV / 3600) / 3600000 / (19000 * 2) * 100;
var totalUsed = (Double)nowChargeV / 1000000 / 3.6 / (19000 * 2) * 100;
//lastFrame //lastFrame
Meter.WriteLog($"totalUsed at EOL {totalUsed}"); Meter.WriteLog($"totalUsed at EOL {totalUsed}");
@@ -138,7 +138,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (totalUsed > 10) if (totalUsed > 10)
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
UserControl.lblText.Content = $"Batterie über 15% entladen"; UserControl.lblText.Content = $"Batterie über 15% entladen";
Meter.WriteLog($"Batterie über 15% entladen"); Meter.WriteLog($"Batterie über 15% entladen");
} }
@@ -148,20 +148,20 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
return; return;
} }
reTrysLeft = reTrysLeft - 1; retriesRemaining = retriesRemaining - 1;
currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
catch (Exception ex) catch (Exception ex)
{ {
Meter.WriteLog($"{ex}"); Meter.WriteLog($"{ex}");
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
reTrysLeft = reTrysLeft - 1; retriesRemaining = retriesRemaining - 1;
} }
} }
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
public override void StartProcess() public override void StartProcess()
@@ -1,14 +1,8 @@
using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using ProductionUiCordonel.UserControls.FinalTest; using ProductionUiCordonel.UserControls.FinalTest;
using System.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Logic.SoftwareAccessHelper; using Xylem.Common.Logic.SoftwareAccessHelper;
using Xylem.Common.CommonCore.Configuration; using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Logic.ProductionOrderCore.Vako; using Xylem.Common.Logic.ProductionOrderCore.Vako;
@@ -25,7 +19,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Error, Error,
Acknowledge Acknowledge
} }
public Boolean DialogIsDone { get; private set; } public Boolean DialogIsDone { get; }
public Int32 OrderNumber { get; set; } public Int32 OrderNumber { get; set; }
public ProductionProcessCheckAttachment(Int32 orderNumber) public ProductionProcessCheckAttachment(Int32 orderNumber)
{ {
@@ -43,7 +37,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -56,18 +50,18 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private void StepDone() private void StepDone()
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
isDone?.Invoke(null, EventArgs.Empty); isDone?.Invoke(null, EventArgs.Empty);
} }
private void StepError() private void StepError()
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
isDone?.Invoke(null, EventArgs.Empty); isDone?.Invoke(null, EventArgs.Empty);
} }
public override async void StartProcess() public override void StartProcess()
{ {
try try
{ {
@@ -1,14 +1,7 @@
using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using ProductionUiCordonel.UserControls.FinalTest; using ProductionUiCordonel.UserControls.FinalTest;
using System.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using System.IO; using System.IO;
using System.Net; using System.Net;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -28,13 +21,12 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Print, Print,
Abort Abort
} }
public Boolean DialogIsDone { get; private set; } public Boolean DialogIsDone { get; }
public Int32 SerialNumber { get; private set; } public Int32 SerialNumber { get; private set; }
public Int32 Ordernumber { get; private set; } public Int32 Ordernumber { get; private set; }
private Int32? OldOrderNumber { get; set; } private Int32? OldOrderNumber { get; }
private Boolean Error = false;
public ProductionProcessCheckOrderNumber(Int32? oldOrderNumber = null) public ProductionProcessCheckOrderNumber(Int32? oldOrderNumber = null)
{ {
@@ -53,7 +45,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -66,7 +58,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private void StepDone() private void StepDone()
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
isDone?.Invoke(this, EventArgs.Empty); isDone?.Invoke(this, EventArgs.Empty);
} }
@@ -101,7 +93,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//StepDone(); //StepDone();
} }
public override async void StartProcess() public override void StartProcess()
{ {
//get order number //get order number
@@ -132,7 +124,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
try try
{ {
var http = (HttpWebRequest)WebRequest.Create(url); var http = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = null; HttpWebResponse response;
try try
{ {
response = (HttpWebResponse)http.GetResponse(); response = (HttpWebResponse)http.GetResponse();
@@ -145,15 +137,16 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (response != null && response.StatusCode == HttpStatusCode.OK) if (response != null && response.StatusCode == HttpStatusCode.OK)
{ {
var responseStream = response.GetResponseStream(); var responseStream = response.GetResponseStream();
using (var sr = new StreamReader(responseStream)) if (responseStream != null)
{ using (var sr = new StreamReader(responseStream))
var responseJson = sr.ReadToEnd(); {
var a = JsonConvert.DeserializeObject<String[]>(responseJson); var responseJson = sr.ReadToEnd();
SerialNumber = Convert.ToInt32(a[0]); var a = JsonConvert.DeserializeObject<String[]>(responseJson);
Ordernumber = Convert.ToInt32(a[1]); SerialNumber = Convert.ToInt32(a[0]);
Ordernumber = Convert.ToInt32(a[1]);
Meter.SerialNumber = SerialNumber.ToString(); Meter.SerialNumber = SerialNumber.ToString();
} }
} }
else else
{ {
@@ -1,18 +1,7 @@
using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using ProductionUiCordonel.UserControls.FinalTest; using ProductionUiCordonel.UserControls.FinalTest;
using System.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using System.IO;
using System.Net;
using Newtonsoft.Json;
using Xylem.Common.CommonCore.Configuration;
namespace ProductionUiCordonel.ProductionProcesses.Actions namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
@@ -28,12 +17,11 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Print, Print,
Abort Abort
} }
public Boolean DialogIsDone { get; private set; } public Boolean DialogIsDone { get; }
public String PcbSerialNumber { get; private set; } public String PcbSerialNumber { get; private set; }
public String AltRadio { get; private set; } public String AltRadio { get; }
private Boolean Error = false;
public ProductionProcessCheckSerialNumber(String pcbSerialNumber, String altRadio = null) public ProductionProcessCheckSerialNumber(String pcbSerialNumber, String altRadio = null)
{ {
@@ -52,7 +40,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -65,14 +53,14 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private void StepDone() private void StepDone()
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
isDone?.Invoke(this, EventArgs.Empty); isDone?.Invoke(this, EventArgs.Empty);
} }
private void StepMismatch(String msg) private void StepMismatch(String msg)
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
base.NewStatus(msg); NewStatus(msg);
isDone?.Invoke(this, EventArgs.Empty); isDone?.Invoke(this, EventArgs.Empty);
@@ -114,7 +102,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//StepDone(); //StepDone();
} }
public override async void StartProcess() public override void StartProcess()
{ {
PcbSerialNumber = Meter.SerialNumber; PcbSerialNumber = Meter.SerialNumber;
UserControl.SetDesc($"Bitte den Deckel des Zählers Scannern{Environment.NewLine} Die Seriennummer muss abgeglichen werden."); UserControl.SetDesc($"Bitte den Deckel des Zählers Scannern{Environment.NewLine} Die Seriennummer muss abgeglichen werden.");
@@ -13,11 +13,11 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
public class ProductionProcessConnect : BaseProductionProcess public class ProductionProcessConnect : BaseProductionProcess
{ {
public Task<IList<ProgrammingParameters>> asyncprogrammingParametersTask; public Task<IList<ProgrammingParameters>> asyncProgrammingParametersTask;
private UcPlain UserControl; private UcPlain UserControl;
private GenesisMeter Meter; public ProductionProcessConnect(GenesisMeter meter)
public ProductionProcessConnect()
{ {
Meter = meter;
name = "Connect"; name = "Connect";
currentProcessState = ProductionProcessState.Waiting; currentProcessState = ProductionProcessState.Waiting;
} }
@@ -33,7 +33,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -46,48 +46,47 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
public override void StartProcess() public override void StartProcess()
{ {
base.NewStatus($"Prüfe Verbindung"); NewStatus($"Prüfe Verbindung");
base.Progress = 0; Progress = 0;
if (!base.Meter.IsLoggedOn) if (!Meter.IsLoggedOn)
{ {
base.NewStatus($"Login wird gestartet"); NewStatus($"Login wird gestartet");
base.Meter.Login(); Meter.Login();
} }
//Check access in //Check access in
base.Progress = 50; Progress = 50;
base.NewStatus($"Zugang wird überprüft"); NewStatus($"Zugang wird überprüft");
//var res = base.Meter.ReadRegister(Register.Genesisflow.LedMode); //var res = base.Meter.ReadRegister(Register.Genesisflow.LedMode);
//if (res != null && res.Length > 0) //if (res != null && res.Length > 0)
//{ //{
base.Progress = 100; Progress = 100;
base.NewStatus($"Zugang verifiziert"); NewStatus($"Zugang verifiziert");
currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
asyncprogrammingParametersTask = new Task<IList<ProgrammingParameters>>(() => asyncProgrammingParametersTask = new Task<IList<ProgrammingParameters>>(() =>
{ {
try try
{ {
//var url = $"http://localhost:56011/api/FinalCheck/GetProgrammingParameters?PcbID={base.Meter.PcbId}"; //var url = $"http://localhost:56011/api/FinalCheck/GetProgrammingParameters?PcbID={base.Meter.PcbId}";
var url = $"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetProgrammingParameters?PcbID={base.Meter.PcbId}"; var url = $"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetProgrammingParameters?PcbID={Meter.PcbId}";
var csdRet = LocalWebRequest.GetRequest(url, 80000); var csdRet = LocalWebRequest.GetRequest(url, 80000);
return Newtonsoft.Json.JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet); return Newtonsoft.Json.JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet);
} }
catch (Exception ex) catch (Exception )
{ {
return new List<ProgrammingParameters>() { }; return new List<ProgrammingParameters>
{
Capacity = 0
};
} }
}); });
asyncprogrammingParametersTask.Start();
asyncProgrammingParametersTask.Start();
return;
//}
currentProcessState = ProductionProcessState.Error;
// throw new Exception($"Not able to login");
} }
} }
} }
@@ -1,14 +1,8 @@
using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using ProductionUiCordonel.UserControls.FinalTest; using ProductionUiCordonel.UserControls.FinalTest;
using System.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
namespace ProductionUiCordonel.ProductionProcesses.Actions namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
@@ -24,8 +18,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Print, Print,
Abort Abort
} }
public Boolean DialogIsDone { get; private set; } public Boolean DialogIsDone { get; }
private Boolean Error = false; private Boolean Error;
public ProductionProcessDone(Boolean error = false) public ProductionProcessDone(Boolean error = false)
{ {
Error = error; Error = error;
@@ -42,7 +36,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -55,7 +49,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private void StepDone() private void StepDone()
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
var retry = false; var retry = false;
var abort = false; var abort = false;
var print = false; var print = false;
@@ -74,8 +68,6 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
case DialogResult.Abort: case DialogResult.Abort:
abort = true; abort = true;
break; break;
default:
break;
} }
} }
isDone?.Invoke(null, new Tuple<Boolean, Boolean,Boolean>(retry, abort, print)); isDone?.Invoke(null, new Tuple<Boolean, Boolean,Boolean>(retry, abort, print));
@@ -132,7 +124,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
UserControl.SetDialogOptions(OptionList); UserControl.SetDialogOptions(OptionList);
} }
public override async void StartProcess() public override void StartProcess()
{ {
if (Error) if (Error)
{ {
@@ -36,7 +36,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -88,18 +88,18 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
try try
{ {
while (connectProcess.asyncprogrammingParametersTask.Status == TaskStatus.Running) while (connectProcess.asyncProgrammingParametersTask.Status == TaskStatus.Running)
{ {
Thread.Sleep(500); Thread.Sleep(500);
} }
if (connectProcess.asyncprogrammingParametersTask.Status == TaskStatus.RanToCompletion if (connectProcess.asyncProgrammingParametersTask.Status == TaskStatus.RanToCompletion
&& connectProcess.asyncprogrammingParametersTask.Result != null && connectProcess.asyncProgrammingParametersTask.Result != null
&& connectProcess.asyncprogrammingParametersTask.Result.Any()) && connectProcess.asyncProgrammingParametersTask.Result.Any())
{ {
var myJsonResponse = connectProcess.asyncprogrammingParametersTask.Result; var myJsonResponse = connectProcess.asyncProgrammingParametersTask.Result;
base.Progress = 15; Progress = 15;
//fix //fix
// CUSTOMER_LeakFlowThreshold // CUSTOMER_LeakFlowThreshold
@@ -204,17 +204,17 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
cTask.RunSynchronously(); cTask.RunSynchronously();
if (cTask.Result.Item2) if (cTask.Result.Item2)
{ {
base.NewStatus($"Schreiben des Parameter {cTask.Result.Item1} war erfolgreich"); NewStatus($"Schreiben des Parameter {cTask.Result.Item1} war erfolgreich");
} }
else else
{ {
if (cTask.Result.Item1.ToLower().Contains("Metersize".ToLower()) || cTask.Result.Item1.ToLower().Contains("NFC_EraseRMA".ToLower()) || cTask.Result.Item1.ToLower().Contains("CUSTOMER_ExcessFlowVolumeThreshold".ToLower()) || cTask.Result.Item1.ToLower().Contains("CUSTOMER_LeakFlowThreshold".ToLower()) || cTask.Result.Item1.ToLower() == "SENSUSRADIO_MetroRadioLifeTimeCounter".ToLower()) if (cTask.Result.Item1.ToLower().Contains("Metersize".ToLower()) || cTask.Result.Item1.ToLower().Contains("NFC_EraseRMA".ToLower()) || cTask.Result.Item1.ToLower().Contains("CUSTOMER_ExcessFlowVolumeThreshold".ToLower()) || cTask.Result.Item1.ToLower().Contains("CUSTOMER_LeakFlowThreshold".ToLower()) || cTask.Result.Item1.ToLower() == "SENSUSRADIO_MetroRadioLifeTimeCounter".ToLower())
{ {
base.NewStatus($"Warnung!Schreiben des Parameter {cTask.Result.Item1} war nicht erfolgreich"); NewStatus($"Warnung!Schreiben des Parameter {cTask.Result.Item1} war nicht erfolgreich");
} }
else else
{ {
base.NewStatus($"Warnung!Schreiben des Parameter {cTask.Result.Item1} war nicht erfolgreich"); NewStatus($"Warnung!Schreiben des Parameter {cTask.Result.Item1} war nicht erfolgreich");
ret = false; ret = false;
break; break;
@@ -231,7 +231,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
} }
base.Progress = 15 + ((Int32)Math.Round(((Double)done / (Double)overAllResult.Count) * 85, 0)); Progress = 15 + ((Int32)Math.Round(((Double)done / (Double)overAllResult.Count) * 85, 0));
done = done + 1; done = done + 1;
} }
@@ -250,9 +250,9 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
} }
else else
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
reTrysLeft = -1; reTrysLeft = -1;
base.NewStatus($"Warnung!Fehler beim laden des Parametersatzes"); NewStatus($"Warnung!Fehler beim laden des Parametersatzes");
} }
@@ -260,8 +260,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
} }
catch (Exception ex) catch (Exception ex)
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
base.NewStatus($"Warnung!Fehler bei behandeln {ex.Message}"); NewStatus($"Warnung!Fehler bei behandeln {ex.Message}");
reTrysLeft = reTrysLeft - 1; reTrysLeft = reTrysLeft - 1;
} }
@@ -8,18 +8,17 @@ using System.Linq;
using System.Net; using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages; using Xylem.Common.Hardware.WaterMeter.Genesis.DataPackages;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
namespace ProductionUiCordonel.ProductionProcesses.Actions namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
public class ProductionProcessFinalParameterizationFix : BaseProductionProcess public class ProductionProcessFinalParametrizationFix : BaseProductionProcess
{ {
private UcPlain UserControl; private UcPlain UserControl;
public ProductionProcessFinalParameterizationFix() public ProductionProcessFinalParametrizationFix()
{ {
name = "Final Parameterization"; name = "Final Parametrization";
currentProcessState = ProductionProcessState.Waiting; currentProcessState = ProductionProcessState.Waiting;
} }
public override void InitUserControl() public override void InitUserControl()
@@ -31,7 +30,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -77,21 +76,12 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
public override void StartProcess() public override void StartProcess()
{ {
Progress = 0;
RadioConfigurationParams radioParams;
base.Progress = 0;
var useRadio = true;
var radioParams = new RadioConfigurationParams();
if (useRadio)
{ {
var url = "http://localhost:56011/api/FinalCheck/";
url += $"GetRadioConfiguration?PcbId={Meter.PcbId}&withPressure=false";
var url = ServiceUrls.GenesisFinalCheckServiceUrl();
url = "http://localhost:56011/api/FinalCheck/";
url = url + $"GetRadioConfiguration?PcbId={Meter.PcbId}&withPressure=false";
var http = (HttpWebRequest)WebRequest.Create(url); var http = (HttpWebRequest)WebRequest.Create(url);
http.Method = "GET"; http.Method = "GET";
@@ -108,7 +98,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
radioParams = JsonConvert.DeserializeObject<RadioConfigurationParams>(responseJson); radioParams = JsonConvert.DeserializeObject<RadioConfigurationParams>(responseJson);
} }
} }
base.Progress = 20; Progress = 20;
@@ -169,11 +159,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
(new Byte[] { 0x00, 0x00, 0x00, 0xFD }).Reverse().ToArray(), true, true)); (new Byte[] { 0x00, 0x00, 0x00, 0xFD }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_DisplayUnits", overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_DisplayUnits",
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true)); (new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
if (useRadio) overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_ForwardArrow",
{ (new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_ForwardArrow",
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
}
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_HardErrorLimit", overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_HardErrorLimit",
(new Byte[] { 0x00, 0x00, 0x00, 0x04 }).Reverse().ToArray(), true, true)); (new Byte[] { 0x00, 0x00, 0x00, 0x04 }).Reverse().ToArray(), true, true));
@@ -189,7 +176,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_PipeFillingDelay", overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_PipeFillingDelay",
(new Byte[] { 0x00, 0x00, 0x00, 0x1E }).Reverse().ToArray(), true, true)); (new Byte[] { 0x00, 0x00, 0x00, 0x1E }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_ResetAccumulators", overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_ResetAccumulators",
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray(), true, false)); (new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray()));
overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_SampleRate", overAllResult.Add(_currentGenesis_WriteRegister("GENESISFLOW_SampleRate",
(new Byte[] { 0x00, 0x00, 0x00, 0x02 }).Reverse().ToArray(), true, true)); (new Byte[] { 0x00, 0x00, 0x00, 0x02 }).Reverse().ToArray(), true, true));
@@ -226,26 +213,18 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
(new Byte[] { 0x00, 0x00, 0x27, 0x10 }).Reverse().ToArray(), true, true)); (new Byte[] { 0x00, 0x00, 0x27, 0x10 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("METROLOGYASST_TemperatureUnits", overAllResult.Add(_currentGenesis_WriteRegister("METROLOGYASST_TemperatureUnits",
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true)); (new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("POWERMON_BatterySelection", overAllResult.Add(_currentGenesis_WriteRegister("POWERMON_BatterySelection",
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, false)); (new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray()));
overAllResult.Add(_currentGenesis_WriteRegister("POWERMON_WarnFromClamp", overAllResult.Add(_currentGenesis_WriteRegister("POWERMON_WarnFromClamp",
(new Byte[] { 0x25, 0x89, 0x06, 0x00 }).Reverse().ToArray(), true, true)); (new Byte[] { 0x25, 0x89, 0x06, 0x00 }).Reverse().ToArray(), true, true));
//// just read later //overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_FrequencyIndicator}).Reverse(), true, true); //// just read later //overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_FrequencyIndicator}).Reverse(), true, true);
//Original //Original
//0x11, 0x12, 0x13, 0x14, 0x21, 0x22, 0x23, 0x24, 0x31, 0x32, 0x33, 0x34, 0x41, 0x42, 0x43, 0x44 //0x11, 0x12, 0x13, 0x14, 0x21, 0x22, 0x23, 0x24, 0x31, 0x32, 0x33, 0x34, 0x41, 0x42, 0x43, 0x44
//Write to register //Write to register
//0x14, 0x13, 0x12, 0x11, 0x24, 0x23, 0x22, 0x21, 0x34, 0x33, 0x32, 0x31, 0x44, 0x43, 0x42, 0x41 //0x14, 0x13, 0x12, 0x11, 0x24, 0x23, 0x22, 0x21, 0x34, 0x33, 0x32, 0x31, 0x44, 0x43, 0x42, 0x41
//good one //good one
//E6-C8-88-00-DE-B8-68-C0-D6-A8-48-80-CE-98-28-40 //E6-C8-88-00-DE-B8-68-C0-D6-A8-48-80-CE-98-28-40
//0E-05-04-04-00-14-30-68-D0-14-0E-80-40-63-93-73-22 //0E-05-04-04-00-14-30-68-D0-14-0E-80-40-63-93-73-22
@@ -253,85 +232,74 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//&bad one //&bad one
//0E-05-04-05-00-00-88-C8-E6-C0-68-B8-DE-80-48-A8-D6-40-28-98-CE //0E-05-04-05-00-00-88-C8-E6-C0-68-B8-DE-80-48-A8-D6-40-28-98-CE
//0E-05-04-04-00-22-73-93-63-40-80-0E-14-D0-68-30-14 //0E-05-04-04-00-22-73-93-63-40-80-0E-14-D0-68-30-14
if (useRadio)
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_WakeupInterval",
(new Byte[] { 0x00, 0x00, 0x00, 0x03 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_MbusState",
(new Byte[] { 0x00, 0x00, 0x00, 0x07 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_UtcTimeOffset",
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_HistoricalAlarmsDays",
(new Byte[] { 0x00, 0x00, 0x00, 0x1D }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_AverageFlowPeriod",
(new Byte[] { 0x00, 0x00, 0x00, 0x05 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_DataLogContents",
(new Byte[] { 0x0C, 0x00, 0x24, 0x03 }).Reverse().ToArray()));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_DataLogPeriod",
(new Byte[] { 0x00, 0x00, 0x00, 0x3C }).Reverse().ToArray()));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_FixedDateDayOfMonth",
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray()));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_FixedDateReadingContents",
(new Byte[] { 0x0C, 0x00, 0x24, 0x03 }).Reverse().ToArray()));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_PeriodicLogLifeTimeCounter",
(new Byte[] { 0x00, 0x00, 0x00, 0x0 }).Reverse().ToArray()));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_ResetCounter",
(new Byte[] { 0x00, 0x00, 0x00, 0x0 }).Reverse().ToArray(), true, true));
//var funkadresse = new List<byte>();
//funkadresse.AddRange((new Byte[] { 0xE6, 0xC8, 0x88, 0x00 }).ToArray());
//funkadresse.AddRange((new Byte[] { 0xDE, 0xB8, 0x68, 0xC0 }).ToArray());
//funkadresse.AddRange((new Byte[] { 0xD6, 0xA8, 0x48, 0x80 }).ToArray());
//funkadresse.AddRange((new Byte[] { 0xCE, 0x98, 0x28, 0x40 }).ToArray());
//overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_EncryptionKey", funkadresse.ToArray(),
// true, true));
//overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_EncryptionKey",
// (new Byte[]
// {
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
// }).ToArray(), true, true));
var funkadresse = new List<Byte>();
funkadresse.AddRange((new Byte[] { 0x0E, 0x9F, 0xAC, 0xC6 }).ToArray());
funkadresse.AddRange((new Byte[] { 0xA0, 0xE1, 0xEF, 0x1C }).ToArray());
funkadresse.AddRange((new Byte[] { 0x3B, 0x27, 0xA4, 0x9B }).ToArray());
funkadresse.AddRange((new Byte[] { 0xAC, 0x21, 0x65, 0x35 }).ToArray());
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_EncryptionKey", funkadresse.ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_RadioAddress", radioParams.RadioAddress, true, true));
if (radioParams.PowerLevel > 0 && radioParams.PowerLevelOption > 0 && radioParams.ImpedanceCodeNew > 0 && radioParams.ImpedanceCodeOption > 0)
{
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_PowerLevel", radioParams.PowerLevel, true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_PowerLevelOption", radioParams.PowerLevelOption, true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_ImpedanceCodeNew", radioParams.ImpedanceCodeNew, true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_ImpedanceCodeOption", radioParams.ImpedanceCodeOption, true, true));
}
else
{ {
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_WakeupInterval", currentProcessState = ProductionProcessState.Error;
(new Byte[] { 0x00, 0x00, 0x00, 0x03 }).Reverse().ToArray(), true, true)); return;
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_MbusState",
(new Byte[] { 0x00, 0x00, 0x00, 0x07 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_UtcTimeOffset",
(new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_HistoricalAlarmsDays",
(new Byte[] { 0x00, 0x00, 0x00, 0x1D }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_AverageFlowPeriod",
(new Byte[] { 0x00, 0x00, 0x00, 0x05 }).Reverse().ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_DataLogContents",
(new Byte[] { 0x0C, 0x00, 0x24, 0x03 }).Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_DataLogPeriod",
(new Byte[] { 0x00, 0x00, 0x00, 0x3C }).Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_FixedDateDayOfMonth",
(new Byte[] { 0x00, 0x00, 0x00, 0x01 }).Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_FixedDateReadingContents",
(new Byte[] { 0x0C, 0x00, 0x24, 0x03 }).Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_PeriodicLogLifeTimeCounter",
(new Byte[] { 0x00, 0x00, 0x00, 0x0 }).Reverse().ToArray(), true, false));
overAllResult.Add(_currentGenesis_WriteRegister("PERIODICLOG_ResetCounter",
(new Byte[] { 0x00, 0x00, 0x00, 0x0 }).Reverse().ToArray(), true, true));
//var funkadresse = new List<byte>();
//funkadresse.AddRange((new Byte[] { 0xE6, 0xC8, 0x88, 0x00 }).ToArray());
//funkadresse.AddRange((new Byte[] { 0xDE, 0xB8, 0x68, 0xC0 }).ToArray());
//funkadresse.AddRange((new Byte[] { 0xD6, 0xA8, 0x48, 0x80 }).ToArray());
//funkadresse.AddRange((new Byte[] { 0xCE, 0x98, 0x28, 0x40 }).ToArray());
//overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_EncryptionKey", funkadresse.ToArray(),
// true, true));
//overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_EncryptionKey",
// (new Byte[]
// {
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
// }).ToArray(), true, true));
var funkadresse = new List<Byte>();
funkadresse.AddRange((new Byte[] { 0x0E, 0x9F, 0xAC, 0xC6 }).ToArray());
funkadresse.AddRange((new Byte[] { 0xA0, 0xE1, 0xEF, 0x1C }).ToArray());
funkadresse.AddRange((new Byte[] { 0x3B, 0x27, 0xA4, 0x9B }).ToArray());
funkadresse.AddRange((new Byte[] { 0xAC, 0x21, 0x65, 0x35 }).ToArray());
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_EncryptionKey", funkadresse.ToArray(), true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_RadioAddress", radioParams.RadioAddress, true, true));
if (radioParams.PowerLevel > 0 && radioParams.PowerLevelOption > 0 && radioParams.ImpedanceCodeNew > 0 && radioParams.ImpedanceCodeOption > 0)
{
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_PowerLevel", radioParams.PowerLevel, true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_PowerLevelOption", radioParams.PowerLevelOption, true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_ImpedanceCodeNew", radioParams.ImpedanceCodeNew, true, true));
overAllResult.Add(_currentGenesis_WriteRegister("SENSUSRADIO_ImpedanceCodeOption", radioParams.ImpedanceCodeOption, true, true));
}
else
{
base.currentProcessState = ProductionProcessState.Error;
return;
}
//_currentGenesis_WriteRegister("SENSUSRADIO_CustomerText",
// (new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, false);
} }
//_currentGenesis_WriteRegister("SENSUSRADIO_CustomerText",
// (new Byte[] { 0x00, 0x00, 0x00, 0x00 }).Reverse().ToArray(), true, false);
var ts = DateTimeOffset.UtcNow - new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan(0)); var ts = DateTimeOffset.UtcNow - new DateTimeOffset(2000, 1, 1, 0, 0, 0, new TimeSpan(0));
overAllResult.Add(wirteRegisterInBetweenCheck("SYSTEM_CalendarSeconds", Convert.ToInt32(ts.TotalSeconds))); overAllResult.Add(wirteRegisterInBetweenCheck("SYSTEM_CalendarSeconds", Convert.ToInt32(ts.TotalSeconds)));
@@ -355,24 +323,24 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
cTask.RunSynchronously(); cTask.RunSynchronously();
if (cTask.Result.Item2) if (cTask.Result.Item2)
{ {
base.NewStatus($"set Parameter {cTask.Result.Item1} succeed"); NewStatus($"set Parameter {cTask.Result.Item1} succeed");
} }
else else
{ {
base.NewStatus($"set Parameter {cTask.Result.Item1} failed"); NewStatus($"set Parameter {cTask.Result.Item1} failed");
ret = false; ret = false;
break; break;
} }
base.Progress = 20 + ((Int32)Math.Round(((Double)done / (Double)overAllResult.Count) * 80, 0)); Progress = 20 + ((Int32)Math.Round((done / (Double)overAllResult.Count) * 80, 0));
done = done + 1; done += 1;
} }
if (!ret) if (!ret)
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
else else
{ {
@@ -26,7 +26,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -55,10 +55,11 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
try try
{ {
var done1 = done;
UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send, UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() => new Action(() =>
{ {
UserControl.lblText.Content = $"Read {dic.GetIdent()}({done}/{total.Count})"; UserControl.lblText.Content = $"Read {dic.GetIdent()}({done1}/{total.Count})";
} }
)); ));
if (dic.RegisterName.ToLower() != "password" && dic.RegisterDetail.Privilege.Lvl8 != Access.Wo) if (dic.RegisterName.ToLower() != "password" && dic.RegisterDetail.Privilege.Lvl8 != Access.Wo)
@@ -82,14 +83,14 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
} }
} }
base.Progress = (Int32)Math.Round(((Double)done / (Double)total.Count) * 100, 0); Progress = (Int32)Math.Round(((Double)done / total.Count) * 100, 0);
} }
catch (Exception e) catch (Exception )
{ {
//todo: error logger //todo: error logger
} }
done = done + 1; done += 1;
} }
Meter.StoreCurrentRegisterDic(); Meter.StoreCurrentRegisterDic();
@@ -97,13 +98,10 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
} }
catch (Exception e) catch (Exception )
{ {
currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
} }
} }
} }
@@ -3,21 +3,18 @@ using ProductionUiCordonel.UserControls.FinalTest;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using Xylem.Common.CommonCore.Configuration; using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Logic.ProductionOrderCore; using Xylem.Common.Logic.ProductionOrderCore;
using Xylem.Common.Logic.SoftwareAccessHelper; using Xylem.Common.Logic.SoftwareAccessHelper;
namespace ProductionUiCordonel.ProductionProcesses.Actions namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
public class ProductionProcessGetFinalParameterizationVakoCsd : BaseProductionProcess public class ProductionProcessGetFinalParametrizationVakoCsd : BaseProductionProcess
{ {
public IList<ProgrammingParameters> Result = new List<ProgrammingParameters>(); public IList<ProgrammingParameters> Result = new List<ProgrammingParameters>();
private UcPlain UserControl; private UcPlain UserControl;
public ProductionProcessGetFinalParameterizationVakoCsd() public ProductionProcessGetFinalParametrizationVakoCsd()
{ {
name = "Hole Kunden Parametrierung"; name = "Hole Kunden Parametrierung";
currentProcessState = ProductionProcessState.Waiting; currentProcessState = ProductionProcessState.Waiting;
@@ -33,7 +30,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -47,47 +44,42 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private void doStartProcessLoop() private void doStartProcessLoop()
{ {
var reTrysLeft = 2; var retriesRemaining = 2;
while (reTrysLeft >= 0) while (retriesRemaining >= 0)
{ {
try try
{ {
base.Progress = 0; Progress = 0;
//var url = $"http://localhost:56011/api/FinalCheck/GetProgrammingParameters?PcbID={Meter.PcbId}"; //var url = $"http://localhost:56011/api/FinalCheck/GetProgrammingParameters?PcbID={Meter.PcbId}";
var url = $"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetProgrammingParameters?PcbID={Meter.PcbId}"; var url = $"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetProgrammingParameters?PcbID={Meter.PcbId}";
var csdRet = LocalWebRequest.GetRequest(url, 60000); var csdRet = LocalWebRequest.GetRequest(url, 60000);
Result = Newtonsoft.Json.JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet); Result = Newtonsoft.Json.JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet);
base.Progress = 100; Progress = 100;
if (!Result.Any()) if (!Result.Any())
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
else else
{ {
currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
return; return;
} }
reTrysLeft = reTrysLeft - 1; retriesRemaining -= 1;
} }
catch (Exception ex) catch (Exception )
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
reTrysLeft = reTrysLeft - 1; retriesRemaining -= 1;
} }
} }
} }
public override void StartProcess() public override void StartProcess()
{ {
doStartProcessLoop(); doStartProcessLoop();
} }
} }
} }
@@ -30,7 +30,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -3,7 +3,6 @@ using ProductionUiCordonel.ProductionProcesses.Enum;
using ProductionUiCordonel.UserControls.FinalTest; using ProductionUiCordonel.UserControls.FinalTest;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Text; using System.Text;
@@ -33,42 +32,34 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
private void updateImage(Image ctlImage, Boolean? success = null) private void updateImage(Image ctlImage, Boolean? success = null)
{ {
String path = "/Resources/iconWating.png";
if (success.HasValue) if (success.HasValue)
{ {
if (success.Value) if (success.Value)
{ {
path = "/Resources/iconCheck.png";
}
else
{
path = "/Resources/iconWarn.png";
} }
} }
} }
public override void StartProcess() public override void StartProcess()
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
return; return;
Boolean ret = RequestPassword(); Boolean ret = RequestPassword();
updateImage(UserControl.RequestPassword, ret); updateImage(UserControl.RequestPassword, ret);
base.Progress = base.Progress + 16; Progress = Progress + 16;
if (Encoding.UTF8.GetString(pwContainer.listOfPasswords.Last()) == pwContainer.Skeleton)//pwContainer.Skeleton ) if (Encoding.UTF8.GetString(pwContainer.listOfPasswords.Last()) == pwContainer.Skeleton)//pwContainer.Skeleton )
{ {
NewStatus("Passwörter schon geschrieben. Prozess wird übersprungen"); NewStatus("Passwörter schon geschrieben. Prozess wird übersprungen");
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
return; return;
} }
@@ -81,14 +72,14 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
updateImage(UserControl.CreateFile, ret); updateImage(UserControl.CreateFile, ret);
base.Progress = base.Progress + 16; Progress = Progress + 16;
if (ret) if (ret)
{ {
ret = WritePasswordFileToMeter(); ret = WritePasswordFileToMeter();
} }
updateImage(UserControl.WriteToMeter, ret); updateImage(UserControl.WriteToMeter, ret);
base.Progress = base.Progress + 16; Progress = Progress + 16;
//Check if new password is in the meter ... even the file wirte wasnt succesfull //Check if new password is in the meter ... even the file wirte wasnt succesfull
if (!ret) if (!ret)
{ {
@@ -101,14 +92,14 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
ret = UpdatePasswordinDb(); ret = UpdatePasswordinDb();
} }
updateImage(UserControl.UpdatePassword, ret); updateImage(UserControl.UpdatePassword, ret);
base.Progress = base.Progress + 16; Progress = Progress + 16;
if (ret) if (ret)
{ {
ret = Meter.Logout(); ret = Meter.Logout();
} }
updateImage(UserControl.Logout, ret); updateImage(UserControl.Logout, ret);
base.Progress = base.Progress + 16; Progress = Progress + 16;
if (ret) if (ret)
@@ -116,15 +107,15 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
ret = Meter.Login(); ret = Meter.Login();
} }
updateImage(UserControl.CheckNewPassword, ret); updateImage(UserControl.CheckNewPassword, ret);
base.Progress = 100; Progress = 100;
if (!ret) if (!ret)
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
else else
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
} }
} }
public override void ProcessDone() public override void ProcessDone()
@@ -146,7 +137,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private MeterPwdFile meterPwdFile; private MeterPwdFile meterPwdFile;
public Boolean RequestPassword() public Boolean RequestPassword()
{ {
base.NewStatus($"Request Passwords"); NewStatus($"Request Passwords");
var url = ServiceUrls.GenesisGetPasswordContainerServiceUrl(); var url = ServiceUrls.GenesisGetPasswordContainerServiceUrl();
//url = "http://localhost:56011/api/Password/GetPasswordHashFileContent?PcbId="; //url = "http://localhost:56011/api/Password/GetPasswordHashFileContent?PcbId=";
url = ($"{url}{Meter.PcbId}"); url = ($"{url}{Meter.PcbId}");
@@ -159,7 +150,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (errorCode == HttpStatusCode.OK.GetHashCode()) if (errorCode == HttpStatusCode.OK.GetHashCode())
{ {
pwContainer = JsonConvert.DeserializeObject<MeterPasswordContainer>(resp); pwContainer = JsonConvert.DeserializeObject<MeterPasswordContainer>(resp);
base.NewStatus($"Passwörter verfügbar"); NewStatus($"Passwörter verfügbar");
return true; return true;
} }
return false; return false;
@@ -1,6 +1,5 @@
using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -9,8 +8,6 @@ using ProductionUiCordonel.UserControls.FinalTest;
using System.Threading; using System.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers; using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using System.Net;
using System.IO;
using Newtonsoft.Json; using Newtonsoft.Json;
using Xylem.Common.CommonCore.Configuration; using Xylem.Common.CommonCore.Configuration;
using System.Configuration; using System.Configuration;
@@ -52,7 +49,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -66,13 +63,13 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (!ret) if (!ret)
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
} }
//clear //clear
} }
private Byte[] SENSUSRADIO_WakeupInterval = null; private Byte[] SENSUSRADIO_WakeupInterval;
public override void StartProcess() public override void StartProcess()
{ {
@@ -104,7 +101,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
//} //}
BoxNr = Convert.ToByte(ConfigurationManager.AppSettings[$"SirtBoxNr"]); BoxNr = Convert.ToByte(ConfigurationManager.AppSettings[$"SirtBoxNr"]);
DebugMessage($"Start RadioCheck Comport:{Comport} ,BoxNr:{BoxNr}, freq: {freq}, RadioAdress:{RadioAdress}s\r\n", false); DebugMessage($"Start RadioCheck Comport:{Comport} ,BoxNr:{BoxNr}, freq: {freq}, RadioAddress:{RadioAdress}s\r\n", false);
Meter.WriteRegister("SENSUSRADIO_IrDAModulePresent", 1, true, true); Meter.WriteRegister("SENSUSRADIO_IrDAModulePresent", 1, true, true);
@@ -13,8 +13,8 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
public class ProductionProcessShippingMode : BaseProductionProcess public class ProductionProcessShippingMode : BaseProductionProcess
{ {
private UcPlain UserControl; private UcPlain UserControl;
private Boolean doRestart = false; private Boolean doRestart;
private Boolean hasRadio = false; private Boolean hasRadio;
public ProductionProcessShippingMode(Boolean restart = false, Boolean registerHasRadio = true) public ProductionProcessShippingMode(Boolean restart = false, Boolean registerHasRadio = true)
{ {
name = "Versandbereitschaft herstellen"; name = "Versandbereitschaft herstellen";
@@ -33,7 +33,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -58,12 +58,12 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (Meter.StoreAllConfigurations()) if (Meter.StoreAllConfigurations())
{ {
var writeList = new List<Boolean>(); var writeList = new List<Boolean>
{
writeList.Add(Meter.WriteRegister("SENSUSRADIO_SystemState", 1, true, false)); Meter.WriteRegister("SENSUSRADIO_SystemState", 1),
writeList.Add(Meter.WriteRegister("SENSUSRADIO_MainAlarmMask", 0, true, false)); Meter.WriteRegister("SENSUSRADIO_MainAlarmMask", 0),
writeList.Add(Meter.WriteRegister("SENSUSRADIO_ExtendedAlarmMask", 0, true, false)); Meter.WriteRegister("SENSUSRADIO_ExtendedAlarmMask", 0)
};
Thread.Sleep(15000); Thread.Sleep(15000);
@@ -86,16 +86,20 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
} }
} }
if (writeList.All(a => a == true)) if (writeList.All(a => a))
{ {
if (doRestart) if (doRestart)
{ {
var CheckValuesAufterBoot = new List<Tuple<String, Byte[]>>(); var CheckValuesAfterBoot = new List<Tuple<String, Byte[]>>
CheckValuesAufterBoot.Add(new Tuple<String, Byte[]>("METROLOGYASST_PulseLength", Meter.ReadRegister("METROLOGYASST_PulseLength"))); {
CheckValuesAufterBoot.Add(new Tuple<String, Byte[]>("POWERMON_BatteryQuantity", Meter.ReadRegister("POWERMON_BatteryQuantity"))); new Tuple<String, Byte[]>("METROLOGYASST_PulseLength",
CheckValuesAufterBoot.Add(new Tuple<String, Byte[]>("GENESISFLOW_MeterSize", Meter.ReadRegister("GENESISFLOW_MeterSize"))); Meter.ReadRegister("METROLOGYASST_PulseLength")),
CheckValuesAufterBoot.Add(new Tuple<String, Byte[]>("GENESISFLOW_CalFactor1", Meter.ReadRegister("GENESISFLOW_CalFactor1"))); new Tuple<String, Byte[]>("POWERMON_BatteryQuantity",
CheckValuesAufterBoot.Add(new Tuple<String, Byte[]>("SENSUSRADIO_RadioAddress", Meter.ReadRegister("SENSUSRADIO_RadioAddress"))); Meter.ReadRegister("POWERMON_BatteryQuantity")),
new Tuple<String, Byte[]>("GENESISFLOW_MeterSize", Meter.ReadRegister("GENESISFLOW_MeterSize")),
new Tuple<String, Byte[]>("GENESISFLOW_CalFactor1", Meter.ReadRegister("GENESISFLOW_CalFactor1")),
new Tuple<String, Byte[]>("SENSUSRADIO_RadioAddress", Meter.ReadRegister("SENSUSRADIO_RadioAddress"))
};
var _meterResetPsu = new MeterResetPsu(Meter) var _meterResetPsu = new MeterResetPsu(Meter)
{ {
StoreConfigEnable = true StoreConfigEnable = true
@@ -107,7 +111,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
Boolean? hasDiffrences = null; Boolean? hasDiffrences = null;
foreach (var item in CheckValuesAufterBoot) foreach (var item in CheckValuesAfterBoot)
{ {
if (!item.Item2.SequenceEqual(Meter.ReadRegister(item.Item1))) if (!item.Item2.SequenceEqual(Meter.ReadRegister(item.Item1)))
{ {
@@ -125,7 +129,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (rebootSucceeded && hasDiffrences.HasValue && !hasDiffrences.Value) if (rebootSucceeded && hasDiffrences.HasValue && !hasDiffrences.Value)
{ {
Meter.WriteRegister("SENSUSRADIO_SystemState", 0xFF, true, false); Meter.WriteRegister("SENSUSRADIO_SystemState", 0xFF);
Meter.Logout(); Meter.Logout();
Thread.Sleep(5000); Thread.Sleep(5000);
Meter.Login(); Meter.Login();
@@ -134,12 +138,12 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
var SENSUSRADIO_SystemState = Meter.ReadRegister("SENSUSRADIO_SystemState"); var SENSUSRADIO_SystemState = Meter.ReadRegister("SENSUSRADIO_SystemState");
if (SENSUSRADIO_SystemState[0] == 0x02 && SENSUSRADIO_MainAlarmMask[0] != 0) if (SENSUSRADIO_SystemState[0] == 0x02 && SENSUSRADIO_MainAlarmMask[0] != 0)
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
} }
else else
{ {
Meter.WriteLog("resetRadio Failed"); Meter.WriteLog("resetRadio Failed");
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
@@ -148,12 +152,12 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
else else
{ {
Meter.WriteLog("reboot compare failed"); Meter.WriteLog("reboot compare failed");
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
} }
else else
{ {
Meter.WriteRegister("SENSUSRADIO_SystemState", 0xFF, true, false); Meter.WriteRegister("SENSUSRADIO_SystemState", 0xFF);
Meter.Logout(); Meter.Logout();
Thread.Sleep(5000); Thread.Sleep(5000);
Meter.Login(); Meter.Login();
@@ -162,19 +166,19 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
var SENSUSRADIO_SystemState = Meter.ReadRegister("SENSUSRADIO_SystemState"); var SENSUSRADIO_SystemState = Meter.ReadRegister("SENSUSRADIO_SystemState");
if (SENSUSRADIO_SystemState[0] == 0x02 && SENSUSRADIO_MainAlarmMask[0] != 0) if (SENSUSRADIO_SystemState[0] == 0x02 && SENSUSRADIO_MainAlarmMask[0] != 0)
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
} }
else else
{ {
Meter.WriteLog("resetRadio Failed"); Meter.WriteLog("resetRadio Failed");
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
} }
} }
else else
{ {
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
@@ -221,23 +225,23 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (rebootSucceeded && hasDiffrences.HasValue && !hasDiffrences.Value) if (rebootSucceeded && hasDiffrences.HasValue && !hasDiffrences.Value)
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
} }
else else
{ {
Meter.WriteLog("reboot compare failed"); Meter.WriteLog("reboot compare failed");
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
} }
else else
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
} }
return; return;
} }
} }
base.currentProcessState = ProductionProcessState.Error; currentProcessState = ProductionProcessState.Error;
} }
@@ -2,13 +2,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using ProductionUiCordonel.UserControls.FinalTest; using ProductionUiCordonel.UserControls.FinalTest;
using System.Threading;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
namespace ProductionUiCordonel.ProductionProcesses.Actions namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
@@ -16,7 +11,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
private UcDialog UserControl; private UcDialog UserControl;
public Boolean DialogIsDone { get; private set; } public Boolean DialogIsDone { get; }
public ProductionProcessSpecialConfig() public ProductionProcessSpecialConfig()
{ {
@@ -33,7 +28,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{ {
if (UserControl == null) if (UserControl == null)
{ {
throw new Exception($"UserControl {this.GetType()} not Ready"); throw new Exception($"UserControl {GetType()} not Ready");
} }
return UserControl; return UserControl;
} }
@@ -46,7 +41,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
private void StepDone() private void StepDone()
{ {
base.currentProcessState = ProductionProcessState.Done; currentProcessState = ProductionProcessState.Done;
} }
private void StepRadio() private void StepRadio()
@@ -158,12 +153,9 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
UserControl.SetDialogOptions(pulseOptionList); UserControl.SetDialogOptions(pulseOptionList);
} }
public override async void StartProcess() public override void StartProcess()
{ {
StepPulse(); StepPulse();
} }
} }
@@ -1,7 +1,5 @@
using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -12,7 +10,7 @@ namespace ProductionUiCordonel.ProductionProcesses
{ {
public abstract class BaseProductionProcess : IProductionProcess public abstract class BaseProductionProcess : IProductionProcess
{ {
private Int32 _progress = 0; private Int32 _progress;
public Int32 Progress public Int32 Progress
{ {
get { return _progress; } get { return _progress; }
@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProductionUiCordonel.ProductionProcesses.Enum namespace ProductionUiCordonel.ProductionProcesses.Enum
{ {
@@ -1,10 +1,6 @@
using ProductionUiCordonel.ProductionProcesses.Enum; using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
@@ -1,9 +1,7 @@
using ProductionUiCordonel.ProductionProcesses.Actions; using ProductionUiCordonel.ProductionProcesses.Enum;
using ProductionUiCordonel.ProductionProcesses.Enum;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore; using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProductionUiCordonel.ProductionProcesses namespace ProductionUiCordonel.ProductionProcesses
{ {
@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProductionUiCordonel.ProductionProcesses namespace ProductionUiCordonel.ProductionProcesses
{ {
@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProductionUiCordonel.ProductionProcesses namespace ProductionUiCordonel.ProductionProcesses
{ {
@@ -163,14 +163,14 @@
<Compile Include="ProductionProcesses\Actions\ProductionProcessCheckOrderNumber.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessCheckOrderNumber.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessCheckAttachment.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessCheckAttachment.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionCheckShippingState.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionCheckShippingState.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessGetFinalParameterizationVakoCsd.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessGetFinalParametrizationVakoCsd.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessFinalParameterizationVakoCsd.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessFinalParameterizationVakoCsd.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessLogOff.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessLogOff.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessShippingMode.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessShippingMode.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessRadioCheck.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessRadioCheck.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessDone.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessDone.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessSpecialConfig.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessSpecialConfig.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessFinalParameterizationFix.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessFinalParametrizationFix.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessFullReadOut.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessFullReadOut.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessConnect.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessConnect.cs" />
<Compile Include="ProductionProcesses\Actions\ProductionProcessPasswordFile.cs" /> <Compile Include="ProductionProcesses\Actions\ProductionProcessPasswordFile.cs" />
@@ -1,6 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
@@ -9,7 +9,7 @@
<Grid Margin="0,0,0,0"> <Grid Margin="0,0,0,0">
<Label Content="" HorizontalAlignment="Left" Height="7" VerticalAlignment="Top" Width="264" Margin="10,0,0,0"/> <Label Content="" HorizontalAlignment="Left" Height="7" VerticalAlignment="Top" Width="264" Margin="10,0,0,0"/>
<Label Name="lblDescription" Content="" Margin="17,53,0,0" HorizontalAlignment="Left" Width="423" Height="237" VerticalAlignment="Top"/> <Label Name="lblDescription" Content="" Margin="17,53,0,0" HorizontalAlignment="Left" Width="423" Height="237" VerticalAlignment="Top"/>
<Label Content="Scanner Input" Margin="0,0,334,259" RenderTransformOrigin="0.5,0.5" MaxHeight="25" FontSize="10" Height="29" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="83" /> <Label Content="Scanner Input" Margin="0,0,334,259" RenderTransformOrigin="0.5,0.5" MaxHeight="25" FontSize="12" Height="29" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="83" />
<Label Name="lblInput" Background="Beige" Content="" Margin="0,0,161,259" FontSize="10" MaxHeight="25" MouseDown="LblInput_MouseDown" Height="24" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="168"/> <Label Name="lblInput" Background="Beige" Content="" Margin="0,0,161,259" FontSize="10" MaxHeight="25" MouseDown="LblInput_MouseDown" Height="24" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="168"/>
<TextBox Name="txtHiddenInput" KeyDown="txtHiddenInput_KeyDown" Margin="118,29,125,25" Width="0" > <TextBox Name="txtHiddenInput" KeyDown="txtHiddenInput_KeyDown" Margin="118,29,125,25" Width="0" >
@@ -1,18 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading; using System.Windows.Threading;
namespace ProductionUiCordonel.UserControls.FinalTest namespace ProductionUiCordonel.UserControls.FinalTest
@@ -1,17 +1,4 @@
using System; using System.Windows.Controls;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProductionUiCordonel.UserControls.FinalTest namespace ProductionUiCordonel.UserControls.FinalTest
{ {
@@ -1,17 +1,4 @@
using System; using System.Windows.Controls;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProductionUiCordonel.UserControls.FinalTest namespace ProductionUiCordonel.UserControls.FinalTest
{ {
@@ -1,17 +1,4 @@
using System; using System.Windows.Controls;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProductionUiCordonel.UserControls.FinalTest namespace ProductionUiCordonel.UserControls.FinalTest
{ {
@@ -1,25 +1,10 @@
using Newtonsoft.Json; using System;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading; using System.Windows.Threading;
using Xylem.Common.CommonCore.Configuration;
namespace ProductionUiCordonel.UserControls.FinalTest namespace ProductionUiCordonel.UserControls.FinalTest
{ {
@@ -30,7 +15,7 @@ namespace ProductionUiCordonel.UserControls.FinalTest
{ {
public class UIContainerElement public class UIContainerElement
{ {
public Int32? Value = null; public Int32? Value;
public System.Drawing.Color Color; public System.Drawing.Color Color;
public UIContainerElement(Int32? value) public UIContainerElement(Int32? value)
@@ -11,7 +11,7 @@ namespace ProductionUiCordonel.ctls
/// </summary> /// </summary>
public partial class ctlMultiModeMarriage : UserControl public partial class ctlMultiModeMarriage : UserControl
{ {
private MarriageMultiModeViewModel ViewModel = null; private MarriageMultiModeViewModel ViewModel;
public ctlMultiModeMarriage() public ctlMultiModeMarriage()
{ {
InitializeComponent(); InitializeComponent();
@@ -1,18 +1,7 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading; using System.Windows.Threading;
using ProductionUiCordonel.Data; using ProductionUiCordonel.Data;
using ProductionUiCordonel.Model; using ProductionUiCordonel.Model;
@@ -24,7 +13,7 @@ namespace ProductionUiCordonel.ctls
/// </summary> /// </summary>
public partial class ctlMultiModePicking : UserControl public partial class ctlMultiModePicking : UserControl
{ {
private PickingMultiModeViewModel ViewModel = null; private PickingMultiModeViewModel ViewModel;
public ctlMultiModePicking() public ctlMultiModePicking()
{ {
InitializeComponent(); InitializeComponent();
@@ -4,7 +4,6 @@ using System;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
using Xylem.Common.Logic.ProductionOrderCore.TestResults; using Xylem.Common.Logic.ProductionOrderCore.TestResults;
@@ -17,7 +16,7 @@ namespace ProductionUiCordonel.ctls
{ {
public event EventHandler<StringArgs> OnBarcodeInput; public event EventHandler<StringArgs> OnBarcodeInput;
private PressureMultiModeViewModel ViewModel = null; private PressureMultiModeViewModel ViewModel;
public ctlMultiModePressure() public ctlMultiModePressure()
{ {
InitializeComponent(); InitializeComponent();
@@ -79,7 +78,7 @@ namespace ProductionUiCordonel.ctls
{ {
MessageBox.Show(e.Content); MessageBox.Show(e.Content);
} }
private Int32? BarcodeInputActiveOffset = null; private Int32? BarcodeInputActiveOffset;
private String BarcodeInput = ""; private String BarcodeInput = "";
private void TextBox_TextChanged(Object sender, TextChangedEventArgs e) private void TextBox_TextChanged(Object sender, TextChangedEventArgs e)