From fdffdf8a085a671d2835953cd6bae1ce683d0f2a Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Tue, 8 Jul 2025 16:00:39 +0200 Subject: [PATCH] ProductionUiCordonel: - new assembly line processes --- .../ProductionProcesses/Enum/ProcessState.cs | 8 ++ .../EolProcesses/CheckAttachments.cs | 2 +- .../EolProcesses/PrepareShipping.cs | 2 +- .../EolProcesses/VisualInspection.cs | 2 +- .../PickingProcessStatesDef.cs | 17 ++- .../PrepareAssemblyRelease.cs | 105 ++++++++++++++++++ .../ProductionUiCordonel.csproj | 1 + .../ProductionWindow.xaml.cs | 24 +++- .../Properties/Resources.Designer.cs | 40 ++++++- .../Properties/Resources.de.resx | 16 ++- .../Properties/Resources.resx | 18 ++- 11 files changed, 222 insertions(+), 13 deletions(-) create mode 100644 Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PrepareAssemblyRelease.cs diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/Enum/ProcessState.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/Enum/ProcessState.cs index e59153b8..2f514072 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/Enum/ProcessState.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/Enum/ProcessState.cs @@ -99,6 +99,14 @@ /// ReadyForShipping, /// + /// Prepare for assembly line release + /// + PrepareAssemblyLineRelease, + /// + /// Completed to release the assembly line + /// + AssemblyLineRelease, + /// /// Print return report /// PrintReturnReport, diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckAttachments.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckAttachments.cs index 5f95d63e..46f08d13 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckAttachments.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/CheckAttachments.cs @@ -40,7 +40,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { UserControl = new UcDialog { - lblHeadLine = { Content = Resources.StrStateCheckAttachments }, + lblHeadLine = { Content = ProcessName }, tbxMessage = { Text = "" } }; } diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs index 014adf81..ac8d4208 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/PrepareShipping.cs @@ -37,7 +37,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { UserControl = new UcDialog { - lblHeadLine = { Content = Resources.StrStatePrepareShipping }, + lblHeadLine = { Content = ProcessName }, tbxMessage = { Text = "" } }; } diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/VisualInspection.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/VisualInspection.cs index feb6b362..dce92910 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/VisualInspection.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/VisualInspection.cs @@ -27,7 +27,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr { UserControl = new UcDialog { - lblHeadLine = { Content = Resources.StrStateVisualInspection }, + lblHeadLine = { Content = ProcessName }, tbxMessage = { Text = "" } }; } diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PickingProcessStatesDef.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PickingProcessStatesDef.cs index dbb899fc..5be28f50 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PickingProcessStatesDef.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PickingProcessStatesDef.cs @@ -155,10 +155,25 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Picki processState: ProcessState.CheckProductionState, processInfo: Resources.StrStateCheckProductionState, productionProcessNo: 4, - nextStateOnSuccess: ProcessState.Idle, + nextStateOnSuccess: ProcessState.PrepareAssemblyLineRelease, // Wait before starting this process until this process has been successfully completed waitForSingleProcess: ProcessState.GetProgrammingParameters), + // Precondition: - All checks have to be executed with positive result + new ProcessStateStruct( + productionProcess: new PrepareAssemblyRelease(Resources.StrStatePrepareAssemblyRelease), + processState: ProcessState.PrepareAssemblyLineRelease, + processInfo: Resources.StrStatePrepareAssemblyRelease, + productionProcessNo: 5, + nextStateOnSuccess: ProcessState.AssemblyLineRelease), + + new ProcessStateStruct( + productionProcess: null, + processState: ProcessState.AssemblyLineRelease, + processInfo: Resources.StrStateAssemblyLineRelease, + productionProcessNo: null, + nextStateOnSuccess: ProcessState.Idle), + //TODO Roland: implement your states here #endregion -------------------------------- PICKING-STATES -------------------------------------------- diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PrepareAssemblyRelease.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PrepareAssemblyRelease.cs new file mode 100644 index 00000000..79c3ac73 --- /dev/null +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/PickingProcesses/PrepareAssemblyRelease.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using Xylem.Common.CommonCore.Consts; +using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum; +using Xylem.Common.Production.ProductionUiCordonel.Properties; +using Xylem.Common.Production.ProductionUiCordonel.UserControls; + +namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.PickingProcesses +{ + public class PrepareAssemblyRelease : BaseProductionProcess + { + /// + /// Maximum of expected processing steps for this process to feed the GUI progress bar. + /// Use the sleep 250 to create x seconds timeout; + /// + private const Int32 TimeoutLoop_ms = 250; + private const Int32 Timeout_s = 30; + private const Int32 MaxActualProgressSteps = 1000 / TimeoutLoop_ms * Timeout_s + 5; + + /// + /// Test finished can be good or abort by done button to exit this production process + /// + private Boolean _waitOnUserFeedback; + + /// + /// Ctor + /// + public PrepareAssemblyRelease(String name) : base(name) + { + } + + /// + protected override void InitUserControl() + { + UserControl = new UcDialog + { + lblHeadLine = { Content = ProcessName }, + tbxMessage = { Text = "" } + }; + } + + + /// + /// Store all information to DB. + /// + /// + /// + /// - Initial. + /// + public override StatusReturn ExecuteProcess() + { + try + { + _waitOnUserFeedback = true; + SignalRunningState(MaxActualProgressSteps); + + var ucDialog = (UcDialog)UserControl; + + // Push progress will publish all application versions and the core version + var retVal = Meter.PushProgress("Assembly", Version.ToString()); + if (retVal == StatusReturn.Failed) + { + return retVal; + } + ActualProcessProgress++; + + + // Initialize the ucDialog + ucDialog.SetHeadline(Resources.StrStateAssemblyLineRelease); + ucDialog.SetMessage(Resources.StrInfoMeterBoxing); + var OptionList = new List(); + var okay = new UcDialog.DialogOption("Ok", Resources.StrInstructionMeterReady, () => + { + ForcedSuccessExitState = ProcessState.AssemblyLineRelease; + _waitOnUserFeedback = false; + }); + OptionList.Add(okay); + var print = new UcDialog.DialogOption(Resources.StrBtnPrintSuccessReport, Resources.StrInstructionSuccessPapers, + () => + { + ForcedSuccessExitState = ProcessState.PrintSuccessReport; + _waitOnUserFeedback = false; + }); + OptionList.Add(print); + + ucDialog.SetDialogOptions(OptionList); + + ActualProcessProgress = MaxActualProgressSteps; + SetProcessProgressTo100Percent(); + + while (_waitOnUserFeedback && SingleProcessState != SingleProcessState.Idle) + { + } + + // Always use okay to kick off ForcedSuccessExitState + return StatusReturn.Okay; + } + catch (Exception e) + { + ErrorMsgDispatcher(e.Message); + return StatusReturn.Failed; + } + } + } +} diff --git a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj index a7f82f4a..db762e7d 100644 --- a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj +++ b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj @@ -303,6 +303,7 @@ + diff --git a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs index aba03a87..c4d720b1 100644 --- a/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs +++ b/Common/Production/ProductionUiCordonel/ProductionWindow.xaml.cs @@ -478,11 +478,25 @@ namespace Xylem.Common.Production.ProductionUiCordonel UiElmEnable(btnStart, false, !_autoStartFirstProductionProcess); UiElmEnable(btnStop, false); } + // Prepare assembly line release + if (e.State == ProcessState.PrepareAssemblyLineRelease) + { + _timer?.Stop(); + UiElmEnable(btnStart, false, !_autoStartFirstProductionProcess); + UiElmEnable(btnStop, false); + } // Ready for shipping if (e.State == ProcessState.ReadyForShipping) { // Create extended report including all steps and each register write, read and comparison - CreateFile(Properties.Resources.StrInfoSuccessPapers); + CreateFile(Properties.Resources.StrInfoSuccessShipping); + BtnStop_Click(this, null); + } + // Ready after assembly + if (e.State == ProcessState.AssemblyLineRelease) + { + // Create extended report including all steps and each register write, read and comparison + CreateFile(Properties.Resources.StrInfoSuccessAssembly); BtnStop_Click(this, null); } // Print return report @@ -901,7 +915,13 @@ namespace Xylem.Common.Production.ProductionUiCordonel private void PrintSuccessNote() { // Safe report to file - CreateFile(Properties.Resources.StrInfoSuccessPapers, true, true); + var msg = ""; + if (_strSoftwareNameVersion.Contains(Properties.Resources.StrEolSoftwareNameVersion)) + msg = Properties.Resources.StrInfoSuccessShipping; + else if (_strSoftwareNameVersion.Contains(Properties.Resources.StrPickingSoftwareNameVersion)) + msg = Properties.Resources.StrInfoSuccessAssembly; + + CreateFile(msg, true, true); } /// diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs index 83d24a30..c5938999 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.Designer.cs @@ -978,12 +978,21 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to Cordonel assembly successfully finished! This report is for informational use.. + /// + internal static string StrInfoSuccessAssembly { + get { + return ResourceManager.GetString("StrInfoSuccessAssembly", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cordonel is ready for shipment! This report is for informational use.. /// - internal static string StrInfoSuccessPapers { + internal static string StrInfoSuccessShipping { get { - return ResourceManager.GetString("StrInfoSuccessPapers", resourceCulture); + return ResourceManager.GetString("StrInfoSuccessShipping", resourceCulture); } } @@ -996,6 +1005,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to Cordonel completed!. + /// + internal static string StrInstructionMeterReady { + get { + return ResourceManager.GetString("StrInstructionMeterReady", resourceCulture); + } + } + /// /// Looks up a localized string similar to Attach return report to Cordonel and wait for clarification by QS!. /// @@ -1599,6 +1617,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to Cordonel assembly completed. + /// + internal static string StrStateAssemblyLineRelease { + get { + return ResourceManager.GetString("StrStateAssemblyLineRelease", resourceCulture); + } + } + /// /// Looks up a localized string similar to Check attachments and assemblies. /// @@ -1734,6 +1761,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.Properties { } } + /// + /// Looks up a localized string similar to Prepare for assembly line release. + /// + internal static string StrStatePrepareAssemblyRelease { + get { + return ResourceManager.GetString("StrStatePrepareAssemblyRelease", resourceCulture); + } + } + /// /// Looks up a localized string similar to Prepare for shipping. /// diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx index 2483d97d..0cb16a89 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.de.resx @@ -250,12 +250,18 @@ Versandbereitschaft herstellen + + Montageabschlußbestätigung + Funktest Cordonel ist versandfertig + + Cordonel Montage erfolgreich + Cordonel Neustart @@ -769,7 +775,10 @@ Rückläuferschein beim Cordonel lassen und auf Klärung durch QS warten! - + + Cordonel Montage erfolgreich beendet! Dieser Bericht dient der Information. + + Cordonel ist fertig zum Versenden! Dieser Bericht dient der Information. @@ -781,9 +790,12 @@ Abbruch ohne Bericht! - + Cordonel verpacken! + + Cordonel ist fertig! + Cordonel hat alle Tests bestanden! diff --git a/Common/Production/ProductionUiCordonel/Properties/Resources.resx b/Common/Production/ProductionUiCordonel/Properties/Resources.resx index e3e5c2b6..dace6dd0 100644 --- a/Common/Production/ProductionUiCordonel/Properties/Resources.resx +++ b/Common/Production/ProductionUiCordonel/Properties/Resources.resx @@ -247,15 +247,21 @@ Log off from Cordonel - + Prepare for shipping + + Prepare for assembly line release + Check radio - + Cordonel is ready for shipping + + Cordonel assembly completed + Reboot Cordonel @@ -769,7 +775,10 @@ Attach return report to Cordonel and wait for clarification by QS! - + + Cordonel assembly successfully finished! This report is for informational use. + + Cordonel is ready for shipment! This report is for informational use. @@ -784,6 +793,9 @@ Pack Cordonel! + + Cordonel completed! + Cordonel successfully passed all tests!