diff --git a/Common/Production/ProductionUiCordonel/Event/StringArgs.cs b/Common/Production/ProductionUiCordonel/Event/StringArgs.cs
deleted file mode 100644
index 06808c93..00000000
--- a/Common/Production/ProductionUiCordonel/Event/StringArgs.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace Xylem.Common.Production.ProductionUiCordonel.Event
-{
- public class StringArgs : EventArgs
- {
- public readonly String Content;
- public StringArgs(String content)
- {
- Content = content;
- }
- }
-}
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs
index 46bf77d6..1491b865 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProductionProcess.cs
@@ -168,6 +168,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
///
public event EventHandler OnProcessProgressChanged;
+
+ ///
+ public event EventHandler OnGuiMessageDispatcher;
#endregion --------------------------------------- Variables --------------------------------------------------
#region ------------------------------------------ Init -------------------------------------------------------
@@ -290,6 +293,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
OnProcessStateChanged?.Invoke(sender, new SingleProcessStateArgs(state));
}
+ ///
+ /// Fire event for GUI messages
+ ///
+ ///
+ protected void DispatchGuiMessage(GuiMessageArgs args)
+ {
+ OnGuiMessageDispatcher?.Invoke(this, args);
+ }
+
///
public void StartProcess(ProcessState? successExitState, ProcessState errorExitState = ProcessState.Error,
ProcessState breakExitState = ProcessState.AbortTest)
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/Enum/GuiItem.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/Enum/GuiItem.cs
new file mode 100644
index 00000000..846dd084
--- /dev/null
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/Enum/GuiItem.cs
@@ -0,0 +1,17 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum
+{
+ ///
+ /// Items to dispatch as message to the GUI
+ ///
+ public enum GuiItem
+ {
+ ///
+ /// Order amount of Cordonels
+ ///
+ OrderAmount,
+ ///
+ /// Counter of Cordonels for this order
+ ///
+ OrderCounter
+ }
+}
\ No newline at end of file
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/GuiMessageArgs.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/GuiMessageArgs.cs
new file mode 100644
index 00000000..965ca3ec
--- /dev/null
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/GuiMessageArgs.cs
@@ -0,0 +1,27 @@
+using System;
+using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum;
+
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EventArgs
+{
+ ///
+ /// Logging messages with a specific color for output to GUI as user information.
+ ///
+ public class GuiMessageArgs : System.EventArgs
+ {
+ public readonly String Message;
+ public readonly GuiItem GuiItem;
+ public readonly Int64? Int64Value;
+ ///
+ /// Message dispatcher event arguments for GUI display
+ ///
+ /// identifier to specify the GUI item
+ ///
+ ///
+ public GuiMessageArgs(GuiItem guiItem, String message = "", Int64? int64Value = null)
+ {
+ GuiItem = guiItem;
+ Message = message;
+ Int64Value = int64Value;
+ }
+ }
+ }
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessLogArgs.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessLogArgs.cs
index a6fa781d..fefebe57 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessLogArgs.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessLogArgs.cs
@@ -2,7 +2,11 @@
using System.Windows.Media;
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EventArgs
-{ public class ProcessLogArgs : System.EventArgs
+{
+ ///
+ /// Logging a text with a specific color for output to GUI as user information.
+ ///
+ public class ProcessLogArgs : System.EventArgs
{
public readonly String Data;
public readonly SolidColorBrush Color;
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessProgressArgs.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessProgressArgs.cs
index 46a18003..c918ab77 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessProgressArgs.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EventArgs/ProcessProgressArgs.cs
@@ -2,6 +2,9 @@
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EventArgs
{
+ ///
+ /// Process progress to feed the progress bar.
+ ///
public class ProcessProgressArgs : System.EventArgs
{
public enum ProcessProgressType
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/IProductionProcess.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/IProductionProcess.cs
index 9bf5a649..62cb3390 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/IProductionProcess.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/IProductionProcess.cs
@@ -39,6 +39,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
///
event EventHandler OnProcessProgressChanged;
+ ///
+ /// Send messages to GUI
+ ///
+ event EventHandler OnGuiMessageDispatcher;
+
///
/// State of single production process
///
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckOrderNumber.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckOrderNumber.cs
index 5dec885d..ff7ec872 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckOrderNumber.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/CheckOrderNumber.cs
@@ -5,6 +5,7 @@ using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Logic.SoftwareAccessHelper;
using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum;
+using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EventArgs;
using Xylem.Common.Production.ProductionUiCordonel.Properties;
using Xylem.Common.Production.ProductionUiCordonel.UserControls;
@@ -111,6 +112,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Picki
ActualProcessProgress++;
// Display order overview in GUI
+ DispatchGuiMessage(new GuiMessageArgs(GuiItem.OrderAmount, null, orderSize ));
+ DispatchGuiMessage(new GuiMessageArgs(GuiItem.OrderCounter, null, assignedPicking ));
// Exit if order is complete
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs
index b0aef037..64d76e62 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessController.cs
@@ -85,6 +85,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
///
public event EventHandler OnProcessProgressChanged;
+ ///
+ /// Dispatch a message to the GUI
+ ///
+ public event EventHandler OnGuiMessageDispatcher;
+
// cancellation token
private CancellationTokenSource _cancellationTokenSource;
private CancellationToken _cancellationToken;
@@ -254,6 +259,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
OnProcessProgressChanged?.Invoke(sender, e);
}
+ private void GuiMessageDispatcher_Handler(Object sender, GuiMessageArgs e)
+ {
+ OnGuiMessageDispatcher?.Invoke(sender, e);
+ }
+
private void ProcessLog_Handler(Object sender, ProcessLogArgs e)
{
OnProcessLogRequest?.Invoke(sender, e);
@@ -812,6 +822,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
if (process == null)
return;
+ process.OnGuiMessageDispatcher += GuiMessageDispatcher_Handler;
process.OnProcessProgressChanged += ProcessProgress_Handler;
process.OnProcessLogRequest += ProcessLog_Handler;
process.OnProcessStateChanged += ProcessStateChanged_Handler;
@@ -827,6 +838,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
if (process == null)
return;
+ process.OnGuiMessageDispatcher -= GuiMessageDispatcher_Handler;
process.OnProcessProgressChanged -= ProcessProgress_Handler;
process.OnProcessLogRequest -= ProcessLog_Handler;
process.OnProcessStateChanged -= ProcessStateChanged_Handler;
diff --git a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
index 3ad7c80c..cad615af 100644
--- a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
+++ b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
@@ -141,8 +141,10 @@
Properties\SharedAssemblyInfo.cs
+
+
@@ -162,7 +164,6 @@
-
diff --git a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml
index 55b92026..e48305ac 100644
--- a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml
+++ b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml
@@ -105,25 +105,27 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
@@ -136,7 +138,7 @@
-
+
diff --git a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs
index 35ccd8ad..079f440f 100644
--- a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs
@@ -44,11 +44,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel
private readonly String _strSoftwareNameVersion;
private RegisterLDAPUser _registerForm;
private Boolean _lockGenesisInfo;
-
- private Int32 Slot
- {
- get; set;
- }
+ private Int32 OrderAmount { get; set; }
+ private Int32 OrderCounter { get; set; }
+ private Int32 Slot { get; set; }
// maximum processing steps for calculation of progress bar
private Int32 _maxOverallProcessSteps;
@@ -82,7 +80,10 @@ namespace Xylem.Common.Production.ProductionUiCordonel
///
/// - Auto start.
///
- public ProductionWindow(String softwareName, String projectName, IProcessStateDef processStateDef,
+ ///
+ /// - Order counter.
+ ///
+ public ProductionWindow(String softwareName, String projectName, IProcessStateDef processStateDef,
Boolean autoStartFirstProductionProcess)
{
_logger = NLogHelper.CreateOrGetLogger(projectName);
@@ -124,6 +125,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
UpdateContentControl(lblSerialNumberTxt, Properties.Resources.StrLblSerialNumberTxt + ":");
UpdateContentControl(lblRadioAddressText, Properties.Resources.StrLblRadioAddressTxt + ":");
UpdateContentControl(lblOrderNumberText, Properties.Resources.StrLblOrderNumberTxt + ":");
+ UpdateContentControl(lblOrderCounterText, Properties.Resources.StrLblOrderCounterTxt + ":");
UpdateContentControl(lblMeterSizeText, Properties.Resources.StrLblMeterSizeTxt + ":");
UpdateContentControl(lblMeterLengthText, Properties.Resources.StrLblMeterLengthTxt + ":");
UpdateContentControl(lblSingleProcessText, Properties.Resources.StrLblSingleProcessText + ":");
@@ -137,7 +139,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
// buttons
UpdateContentControl(btnStart, Properties.Resources.StrBtnStart);
UpdateContentControl(btnStop, Properties.Resources.StrBtnStop);
-
+
InitializeFormState();
}
@@ -215,6 +217,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
_processCtrl.OnProcessLogRequest += ProcessLog_Handler;
_processCtrl.OnProcessProgressChanged += ProcessProgress_Handler;
_processCtrl.OnStateMachineStateChanged += StateMachineStateChanged_Handler;
+ _processCtrl.OnGuiMessageDispatcher += GuiMessageDispatcher_Handler;
_timer = new DispatcherTimer();
_timer.Tick += TmrProgressUpdate_Tick;
@@ -230,6 +233,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
_processCtrl.OnProcessLogRequest -= ProcessLog_Handler;
_processCtrl.OnProcessProgressChanged -= ProcessProgress_Handler;
_processCtrl.OnStateMachineStateChanged -= StateMachineStateChanged_Handler;
+ _processCtrl.OnGuiMessageDispatcher -= GuiMessageDispatcher_Handler;
_userAccessWindow = null;
_processCtrl.Dispose();
@@ -252,7 +256,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
cbxSlotBox.SelectedValue = 0;
}
}
-
+
///
/// Enable/disable the controls
///
@@ -286,8 +290,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel
? $"{Properties.Resources.StrLblOperatorNameText}: {Software.UserName}"
: $"{Properties.Resources.StrLblOperatorNameText}: ?");
// Start first production process if required, user is authenticated and state machine is idle
- if (_autoStartFirstProductionProcess &&
- Software.IsAutenticated &&
+ if (_autoStartFirstProductionProcess &&
+ Software.IsAutenticated &&
ProcessState.Idle == _processCtrl?.GetProcessState())
{
BtnStart_Click(this, null);
@@ -437,7 +441,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
ProcessProgressArgs.ProcessProgressType.OverallProcessesSteps));
ProcessProgress_Handler(this, new ProcessProgressArgs(0,
ProcessProgressArgs.ProcessProgressType.ActualProcessSteps));
-
+
// Start first production process if required and user is authenticated
if (_autoStartFirstProductionProcess && Software.IsAutenticated)
{
@@ -518,6 +522,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel
// Enable timer with first automatic process
if (e.State == ProcessState.DetectCordonel)
{
+ if (_timer != null && !_timer.IsEnabled)
+ _startTime = DateTimeOffset.UtcNow;
_timer?.Start();
}
}
@@ -589,6 +595,30 @@ namespace Xylem.Common.Production.ProductionUiCordonel
));
}
+ ///
+ /// Dispatch GUI messages
+ ///
+ ///
+ ///
+ ///
+ /// - Initial
+ ///
+ private void GuiMessageDispatcher_Handler(Object sender, GuiMessageArgs e)
+ {
+ if (e != null)
+ {
+ switch (e.GuiItem)
+ {
+ case GuiItem.OrderAmount:
+ OrderAmount = e.Int64Value != null ? (Int32)e.Int64Value : 0;
+ break;
+ case GuiItem.OrderCounter:
+ OrderCounter = e.Int64Value != null ? (Int32)e.Int64Value : 0;
+ break;
+ }
+ }
+ }
+
///
/// Set values for progress bar, maximum and actual for single process and overall process.
/// - Limit values to 0.0..100.0.
@@ -785,6 +815,12 @@ namespace Xylem.Common.Production.ProductionUiCordonel
UpdateContentControl(lblOrderNumberValue,
genesisMeter.OrderNumber != 0 ? genesisMeter.OrderNumber.ToString() : "?");
+ UpdateContentControl(lblOrderCounterValue,
+ OrderAmount != 0 && genesisMeter.OrderNumber != 0 ? $"{OrderCounter} / " +
+ $"{OrderAmount} {Properties.Resources.StrLblPieces}" : "");
+ UpdateContentControl(lblOrderCounterText,
+ OrderAmount != 0 && genesisMeter.OrderNumber != 0 ? Properties.Resources.StrLblOrderCounterTxt + ":" : "");
+
UpdateContentControl(lblRadioAddressValue,
genesisMeter.RadioAddress != 0 ? genesisMeter.RadioAddress.ToString() : "");
UpdateContentControl(lblRadioAddressText,
@@ -797,8 +833,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel
!string.IsNullOrEmpty(genesisMeter.MeterSize) ? genesisMeter.MeterSize : "?");
UpdateContentControl(lblMeterLengthValue,
- (!string.IsNullOrEmpty(genesisMeter.MeterLength) && !genesisMeter.MeterLength.Equals("?")) ?
- genesisMeter.MeterLength + " mm": "?");
+ (!string.IsNullOrEmpty(genesisMeter.MeterLength) && !genesisMeter.MeterLength.Equals("?")) ?
+ genesisMeter.MeterLength + " mm" : "?");
UpdateContentControl(lblInterfaceVersionValue,
!string.IsNullOrEmpty(genesisMeter.InterfaceVersion) ? genesisMeter.InterfaceVersion : "?");
@@ -806,7 +842,6 @@ namespace Xylem.Common.Production.ProductionUiCordonel
UpdateContentControl(lblLutValue,
!string.IsNullOrEmpty(genesisMeter.LutCrc) ? genesisMeter.LutCrc : "?");
-
UpdateContentControl(lblSerialNumberValue,
!string.IsNullOrEmpty(genesisMeter.CustomerSerialNumber) ? genesisMeter.CustomerSerialNumber : "?");
@@ -884,6 +919,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel
_timer?.Start();
// Avoid display of genesis info before the detect new meter has been executed
_lockGenesisInfo = true;
+ OrderAmount = 0;
rtbLog.Dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() =>
@@ -896,6 +932,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel
UpdateContentControl(lblOrderNumberValue, "?");
UpdateContentControl(lblRadioAddressValue, "");
UpdateContentControl(lblRadioAddressText, "");
+ UpdateContentControl(lblOrderCounterValue, "");
+ UpdateContentControl(lblOrderCounterText, "");
UpdateContentControl(lblFwValue, "?");
UpdateContentControl(lblMeterSizeValue, "?");
UpdateContentControl(lblInterfaceVersionValue, "?");
diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs
index b7b00a41..e81449b8 100644
--- a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs
+++ b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs
@@ -1176,6 +1176,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Progress.
+ ///
+ internal static string StrLblOrderCounterTxt {
+ get {
+ return ResourceManager.GetString("StrLblOrderCounterTxt", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Order.
///
@@ -1185,6 +1194,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to pcs..
+ ///
+ internal static string StrLblPieces {
+ get {
+ return ResourceManager.GetString("StrLblPieces", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Pressure Sensor Assembled.
///
diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx
index 6b428171..e1f4f687 100644
--- a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx
+++ b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx
@@ -418,9 +418,15 @@
Fertigungsauftragsnummer
-
+
Baugröße
+
+ Stk.
+
+
+ Fortschritt
+
Baulänge
diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.resx
index 9455e12d..d65813ba 100644
--- a/Common/Production/ProductionUiCordonel/Properties/Resources.resx
+++ b/Common/Production/ProductionUiCordonel/Properties/Resources.resx
@@ -421,6 +421,12 @@
Meter Size
+
+ pcs.
+
+
+ Progress
+
Meter Length