ProductionUiCordonel: - order counter
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,6 +168,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
|
||||
|
||||
///<inheritdoc/>
|
||||
public event EventHandler<ProcessProgressArgs> OnProcessProgressChanged;
|
||||
|
||||
///<inheritdoc/>
|
||||
public event EventHandler<GuiMessageArgs> OnGuiMessageDispatcher;
|
||||
|
||||
#endregion --------------------------------------- Variables --------------------------------------------------
|
||||
#region ------------------------------------------ Init -------------------------------------------------------
|
||||
@@ -290,6 +293,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
|
||||
OnProcessStateChanged?.Invoke(sender, new SingleProcessStateArgs(state));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fire event for GUI messages
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
protected void DispatchGuiMessage(GuiMessageArgs args)
|
||||
{
|
||||
OnGuiMessageDispatcher?.Invoke(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IProductionProcess"/>
|
||||
public void StartProcess(ProcessState? successExitState, ProcessState errorExitState = ProcessState.Error,
|
||||
ProcessState breakExitState = ProcessState.AbortTest)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// Items to dispatch as message to the GUI
|
||||
/// </summary>
|
||||
public enum GuiItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Order amount of Cordonels
|
||||
/// </summary>
|
||||
OrderAmount,
|
||||
/// <summary>
|
||||
/// Counter of Cordonels for this order
|
||||
/// </summary>
|
||||
OrderCounter
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum;
|
||||
|
||||
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Logging messages with a specific color for output to GUI as user information.
|
||||
/// </summary>
|
||||
public class GuiMessageArgs : System.EventArgs
|
||||
{
|
||||
public readonly String Message;
|
||||
public readonly GuiItem GuiItem;
|
||||
public readonly Int64? Int64Value;
|
||||
/// <summary>
|
||||
/// Message dispatcher event arguments for GUI display
|
||||
/// </summary>
|
||||
/// <param name="guiItem">identifier to specify the GUI item</param>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="int64Value"></param>
|
||||
public GuiMessageArgs(GuiItem guiItem, String message = "", Int64? int64Value = null)
|
||||
{
|
||||
GuiItem = guiItem;
|
||||
Message = message;
|
||||
Int64Value = int64Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -2,7 +2,11 @@
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EventArgs
|
||||
{ public class ProcessLogArgs : System.EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Logging a text with a specific color for output to GUI as user information.
|
||||
/// </summary>
|
||||
public class ProcessLogArgs : System.EventArgs
|
||||
{
|
||||
public readonly String Data;
|
||||
public readonly SolidColorBrush Color;
|
||||
|
||||
+3
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Process progress to feed the progress bar.
|
||||
/// </summary>
|
||||
public class ProcessProgressArgs : System.EventArgs
|
||||
{
|
||||
public enum ProcessProgressType
|
||||
|
||||
@@ -39,6 +39,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
|
||||
/// </summary>
|
||||
event EventHandler<ProcessProgressArgs> OnProcessProgressChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Send messages to GUI
|
||||
/// </summary>
|
||||
event EventHandler<GuiMessageArgs> OnGuiMessageDispatcher;
|
||||
|
||||
/// <summary>
|
||||
/// State of single production process
|
||||
/// </summary>
|
||||
|
||||
+3
@@ -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
|
||||
|
||||
|
||||
@@ -85,6 +85,11 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
|
||||
/// </summary>
|
||||
public event EventHandler<ProcessProgressArgs> OnProcessProgressChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Dispatch a message to the GUI
|
||||
/// </summary>
|
||||
public event EventHandler<GuiMessageArgs> 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;
|
||||
|
||||
@@ -141,8 +141,10 @@
|
||||
<Link>Properties\SharedAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Model\EOLHandler.cs" />
|
||||
<Compile Include="ProductionProcesses\Enum\GuiItem.cs" />
|
||||
<Compile Include="ProductionProcesses\EolProcesses\CreateEolProgress.cs" />
|
||||
<Compile Include="ProductionProcesses\EolProcesses\VisualInspection.cs" />
|
||||
<Compile Include="ProductionProcesses\EventArgs\GuiMessageArgs.cs" />
|
||||
<Compile Include="ProductionProcesses\GenericModules\GenericChecks.cs" />
|
||||
<Compile Include="ProductionProcesses\IProcessStateDef.cs" />
|
||||
<Compile Include="ProductionProcesses\BaseProcessStatesDef.cs" />
|
||||
@@ -162,7 +164,6 @@
|
||||
<Compile Include="ProductionProcesses\PickingProcesses\PickingProcessStatesDef.cs" />
|
||||
<Compile Include="ProductionProcesses\PickingProcesses\PrepareAssemblyRelease.cs" />
|
||||
<Compile Include="ProductionProcesses\ProcessStateStruct.cs" />
|
||||
<Compile Include="Event\StringArgs.cs" />
|
||||
<Compile Include="ProductionProcesses\EolProcesses\CheckSerialNumber.cs" />
|
||||
<Compile Include="ProductionProcesses\EolProcesses\CheckOrderNumber.cs" />
|
||||
<Compile Include="ProductionProcesses\EolProcesses\CheckAttachments.cs" />
|
||||
|
||||
@@ -105,25 +105,27 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--Cordonel information-->
|
||||
<Label x:Name="lblSerialNumberTxt" Content="SerialNumber:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="0" Grid.Column="2"/>
|
||||
<Label x:Name="lblOrderNumberText" Content="OrderNumber:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="1" Grid.Column="2"/>
|
||||
<Label Content="Region:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="2" Grid.Column="2"/>
|
||||
<Label x:Name="lblRadioAddressText" Content="RadioAddress:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="3" Grid.Column="2"/>
|
||||
<Label Content="Firmware:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="0" Grid.Column="5"/>
|
||||
<Label Content="LUT CRC:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="1" Grid.Column="5"/>
|
||||
<Label x:Name="lblMeterSizeText" Content="Meter Size:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="2" Grid.Column="5"/>
|
||||
<Label x:Name="lblMeterLengthText" Content="Meter Length:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="3" Grid.Column="5"/>
|
||||
<Label x:Name="lblInterfaceVersionText" Content="Interface Version:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="4" Grid.Column="5"/>
|
||||
<Label x:Name="lblSerialNumberTxt" Content="Serial Number:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="0" Grid.Column="2"/>
|
||||
<Label x:Name="lblOrderNumberText" Content="Order Number:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="1" Grid.Column="2"/>
|
||||
<Label x:Name="lblOrderCounterText" Content="Order Counter:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="2" Grid.Column="2"/>
|
||||
<Label Content="Region:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="3" Grid.Column="2"/>
|
||||
<Label Content="Firmware:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="0" Grid.Column="5"/>
|
||||
<Label Content="LUT CRC:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="1" Grid.Column="5"/>
|
||||
<Label x:Name="lblMeterSizeText" Content="Meter Size:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="2" Grid.Column="5"/>
|
||||
<Label x:Name="lblMeterLengthText" Content="Meter Length:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="3" Grid.Column="5"/>
|
||||
<Label x:Name="lblRadioAddressText" Content="Radio Address:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="4" Grid.Column="5"/>
|
||||
<Label Content="Interface Version:" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="5" Grid.Column="5"/>
|
||||
|
||||
<Label Content="" x:Name="lblSerialNumberValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="0" Grid.Column="3"/>
|
||||
<Label Content="" x:Name="lblOrderNumberValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="1" Grid.Column="3"/>
|
||||
<Label Content="" x:Name="lblRegionValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="2" Grid.Column="3"/>
|
||||
<Label Content="" x:Name="lblRadioAddressValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="3" Grid.Column="3"/>
|
||||
<Label Content="" x:Name="lblOrderCounterValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="2" Grid.Column="3"/>
|
||||
<Label Content="" x:Name="lblRegionValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="3" Grid.Column="3"/>
|
||||
<Label Content="" x:Name="lblFwValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="0" Grid.Column="6"/>
|
||||
<Label Content="" x:Name="lblLutValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="1" Grid.Column="6"/>
|
||||
<Label Content="" x:Name="lblMeterSizeValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="2" Grid.Column="6"/>
|
||||
<Label Content="" x:Name="lblMeterLengthValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="3" Grid.Column="6"/>
|
||||
<Label Content="" x:Name="lblInterfaceVersionValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="4" Grid.Column="6"/>
|
||||
<Label Content="" x:Name="lblRadioAddressValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="4" Grid.Column="6"/>
|
||||
<Label Content="" x:Name="lblInterfaceVersionValue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="5" Grid.Column="6"/>
|
||||
|
||||
<!--Pictures-->
|
||||
<Border Grid.Row="0" Grid.RowSpan="4" Grid.Column="0" Margin="2,2,2,2" BorderThickness="1" BorderBrush="Black" Grid.ColumnSpan="2">
|
||||
@@ -136,7 +138,7 @@
|
||||
<!--Process Information-->
|
||||
<DataGrid x:Name="dgTotalProcess" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="4" Grid.RowSpan="11" Grid.Column="0" Grid.ColumnSpan="4" ItemsSource="{Binding}"
|
||||
AutoGenerateColumns="True" SelectionMode="Single" IsReadOnly="True" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" IsEnabled="True" />
|
||||
<StackPanel x:Name="dpSubProcess" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="5" Grid.RowSpan="10" Grid.Column="5" Grid.ColumnSpan="3" />
|
||||
<StackPanel x:Name="dpSubProcess" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,2,2,2" Grid.Row="6" Grid.RowSpan="9" Grid.Column="5" Grid.ColumnSpan="3" />
|
||||
<GroupBox Header="Info" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="15" Grid.RowSpan="4" Grid.Column="0" Grid.ColumnSpan="11" >
|
||||
<RichTextBox x:Name="rtbLog" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
|
||||
</GroupBox>
|
||||
|
||||
@@ -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
|
||||
/// <remarks date="2025-Jul-01" author="Thomas Wiedebusch">
|
||||
/// - Auto start.
|
||||
/// </remarks>
|
||||
public ProductionWindow(String softwareName, String projectName, IProcessStateDef processStateDef,
|
||||
/// <remarks date="2025-Sep-15" author="Thomas Wiedebusch">
|
||||
/// - Order counter.
|
||||
/// </remarks>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Enable/disable the controls
|
||||
/// </summary>
|
||||
@@ -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
|
||||
));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispatch GUI messages
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <remarks date="2025-Sep-15" author="Thomas Wiedebusch">
|
||||
/// - Initial
|
||||
/// </remarks>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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, "?");
|
||||
|
||||
@@ -1176,6 +1176,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Progress.
|
||||
/// </summary>
|
||||
internal static string StrLblOrderCounterTxt {
|
||||
get {
|
||||
return ResourceManager.GetString("StrLblOrderCounterTxt", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Order.
|
||||
/// </summary>
|
||||
@@ -1185,6 +1194,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to pcs..
|
||||
/// </summary>
|
||||
internal static string StrLblPieces {
|
||||
get {
|
||||
return ResourceManager.GetString("StrLblPieces", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Pressure Sensor Assembled.
|
||||
/// </summary>
|
||||
|
||||
@@ -418,9 +418,15 @@
|
||||
<data name="StrPrintOrderNumberTxt" xml:space="preserve">
|
||||
<value>Fertigungsauftragsnummer</value>
|
||||
</data>
|
||||
<data name="StrLblMeterSizeTxt" xml:space="preserve">
|
||||
<data name="StrLblMeterSizeTxt" xml:space="preserve">
|
||||
<value>Baugröße</value>
|
||||
</data>
|
||||
<data name="StrLblPieces" xml:space="preserve">
|
||||
<value>Stk.</value>
|
||||
</data>
|
||||
<data name="StrLblOrderCounterTxt" xml:space="preserve">
|
||||
<value>Fortschritt</value>
|
||||
</data>
|
||||
<data name="StrLblMeterLengthTxt" xml:space="preserve">
|
||||
<value>Baulänge</value>
|
||||
</data>
|
||||
|
||||
@@ -421,6 +421,12 @@
|
||||
<data name="StrLblMeterSizeTxt" xml:space="preserve">
|
||||
<value>Meter Size</value>
|
||||
</data>
|
||||
<data name="StrLblPieces" xml:space="preserve">
|
||||
<value>pcs.</value>
|
||||
</data>
|
||||
<data name="StrLblOrderCounterTxt" xml:space="preserve">
|
||||
<value>Progress</value>
|
||||
</data>
|
||||
<data name="StrLblMeterLengthTxt" xml:space="preserve">
|
||||
<value>Meter Length</value>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user