diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProcessStates.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProcessStates.cs index e82b993a..c3d6a409 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProcessStates.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/BaseProcessStates.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum; namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses @@ -11,7 +12,7 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses /// /// - Initial /// - public class BaseProcessStates : IProcessStates + public class BaseProcessStates { /// /// Collection of state information @@ -35,9 +36,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses /// public IProductionProcess GetProcessOfState(ProcessState stateMachineState) { - return (from stateContainer in StateContainer - where stateContainer.State == stateMachineState - select stateContainer.Process).FirstOrDefault(); + return (from stateContainer in StateContainer + where stateContainer.State == stateMachineState + select stateContainer.Process).FirstOrDefault(); } /// @@ -57,8 +58,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses stateMachineState = ProcessState.Error; return (from stateContainer in StateContainer - where stateContainer.State == stateMachineState - select stateContainer.Info).FirstOrDefault(); + where stateContainer.State == stateMachineState + select stateContainer.Info).FirstOrDefault(); } /// @@ -72,8 +73,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses public String GetStateInfoOfProcess(IProductionProcess process) { return (from stateContainer in StateContainer - where stateContainer.Process == process - select stateContainer.Info).FirstOrDefault(); + where stateContainer.Process == process + select stateContainer.Info).FirstOrDefault(); } /// @@ -87,8 +88,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses public ProcessState GetStateOfInfoText(String text) { return (from stateContainer in StateContainer - where stateContainer.Info == text - select stateContainer.State).FirstOrDefault(); + where stateContainer.Info == text + select stateContainer.State).FirstOrDefault(); } /// @@ -102,8 +103,8 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses public ProcessState GetStateOfProcess(IProductionProcess process) { return (from stateContainer in StateContainer - where stateContainer.Process == process - select stateContainer.State).FirstOrDefault(); + where stateContainer.Process == process + select stateContainer.State).FirstOrDefault(); } /// @@ -118,9 +119,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses /// public Int32 GetNumberOfInitializedProcesses() { - return StateContainer.Count(stateContainer => stateContainer.ProductionRelevant ); + return StateContainer.Count(stateContainer => stateContainer.ProductionProcessNo != null); } - + /// /// Get all EOL relevant states /// @@ -131,10 +132,15 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses /// /// - Used marker for production relevant processes /// + /// + /// - Changed to sorted list by production process number + /// public List GetAllEolRelevantProcesses() { - return (from state in StateContainer where state.ProductionRelevant - select state.Process).ToList(); + var sortedList = StateContainer + .Where(y => y.ProductionProcessNo != null) + .OrderBy(x => x.ProductionProcessNo); + return (from state in sortedList select state.Process).ToList(); } - } + } } diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStates.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStates.cs index 6cad814d..ad05f59f 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStates.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/EolProcesses/EolProcessStates.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum; using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.GenericProcesses; using Xylem.Common.Production.ProductionUiCordonel.Properties; @@ -33,156 +31,156 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.EolPr null, ProcessState.Idle, Resources.StrStateIdle, - false), + null), new ProcessStateStruct( null, ProcessState.CheckNewMeter, Resources.StrProcessStateCheckNewMeter, - false), + null), new ProcessStateStruct( new ErrorHandler(null), ProcessState.Error, Resources.StrProcessStateError, - false), + null), new ProcessStateStruct( null, ProcessState.RepeatFailedTests, Resources.StrStateRepeatFinalTest, - false), + null), new ProcessStateStruct( null, ProcessState.AbortTest, Resources.StrStateSkipping, - false), + null), new ProcessStateStruct( null, ProcessState.Stop, Resources.StrStateUserStop, - false), + null), new ProcessStateStruct( null, ProcessState.TestFailed, Resources.StrStateFinalTestFailed, - false), + null), new ProcessStateStruct( null, ProcessState.ReadyForShipping, Resources.StrStateReadyForShipping, - false), + null), new ProcessStateStruct( null, ProcessState.PrintSuccessReport, Resources.StrStatePrintSuccessReport, - false), + null), new ProcessStateStruct( null, ProcessState.PrintReturnReport, Resources.StrStatePrintReturnReport, - false), + null), new ProcessStateStruct( new DetectCordonel(Resources.StrStateDetectCordonel), ProcessState.DetectCordonel, Resources.StrStateDetectCordonel, - true), + 0), new ProcessStateStruct( new ConnectCordonel(Resources.StrStateConnectCordonel), ProcessState.ConnectCordonel, Resources.StrStateConnectCordonel, - true), + 1), new ProcessStateStruct( new GetSerialNumberAndRadioAddress(Resources.StrStateGetSerialAndRadioAddress), ProcessState.GetSerialNumberAndRadioAddress, Resources.StrStateGetSerialAndRadioAddress, - true), + 2), new ProcessStateStruct( new GetFinalParametrization(Resources.StrStateGetProgrammingParameters), ProcessState.GetProgrammingParameters, Resources.StrStateGetProgrammingParameters, - true), + 3), new ProcessStateStruct( new CheckProductionState(Resources.StrStateCheckProductionState), ProcessState.CheckProductionState, Resources.StrStateCheckProductionState, - true), + 4), new ProcessStateStruct( new ExecPasswordFile(Resources.StrStatePasswordFile), ProcessState.ProcessPasswordFile, Resources.StrStatePasswordFile, - true), + 5), new ProcessStateStruct( new ExecFinalParametrization(Resources.StrStateFinalParametrization), ProcessState.ExecFinalParametrization, Resources.StrStateFinalParametrization, - true), + 6), new ProcessStateStruct( new ExecStoreConfiguration(Resources.StrStateStoreConfiguration), ProcessState.ExecStoreConfiguration, Resources.StrStateStoreConfiguration, - true), + 7), new ProcessStateStruct( new ExecRebootCordonel(Resources.StrStateRebootCordonel), ProcessState.RebootCordonel, Resources.StrStateRebootCordonel, - true), + 8), new ProcessStateStruct( new CheckFinalParametrization(Resources.StrStateCheckParametrization), ProcessState.CheckFinalParametrization, Resources.StrStateCheckParametrization, - true), + 9), new ProcessStateStruct( new CheckRadio(Resources.StrStateRadioCheck), ProcessState.CheckRadio, Resources.StrStateRadioCheck, - true), + 10), new ProcessStateStruct( new CheckOrderNumber(Resources.StrStateCheckOrderNumber), ProcessState.CheckOrderNumber, Resources.StrStateCheckOrderNumber, - true), + 11), new ProcessStateStruct( new CheckSerialNumber( Resources.StrStateCheckSerialNumber), ProcessState.CheckSerialNumber, Resources.StrStateCheckSerialNumber, - true), + 12), new ProcessStateStruct( new CheckAttachments(Resources.StrStateCheckAttachments), ProcessState.CheckAttachments, Resources.StrStateCheckAttachments, - true), + 13), new ProcessStateStruct( new VisualInspection(Resources.StrStateVisualInspection), ProcessState.ExecVisualInspection, Resources.StrStateVisualInspection, - true), + 14), new ProcessStateStruct( new PrepareShipping(Resources.StrStatePrepareShipping), ProcessState.PrepareShippingMode, Resources.StrStatePrepareShipping, - true) + 15) }; } } diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessStateStruct.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessStateStruct.cs index b28abf73..b635aa12 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessStateStruct.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/ProcessStateStruct.cs @@ -11,19 +11,21 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses /// /// Assign process state information /// - /// production process - /// assigned state for call of this process - /// name for process to display a message - /// all processes which are relevant for the EOL production + /// production process, set to null for "invisible" states + /// assigned state for call of this process used by the state machine + /// name for process to display a message in the GUI + /// set a unique number to sort the table of production processes, + /// set to null for all hidden processes which are not a production process /// /// - Initial /// - public ProcessStateStruct(IProductionProcess process, ProcessState state, String info, Boolean productionRelevant) + public ProcessStateStruct(IProductionProcess process, ProcessState state, String info, + UInt32? productionProcessNo) { Process = process; State = state; Info = info; - ProductionRelevant = productionRelevant; + ProductionProcessNo = productionProcessNo; } /// /// The state of the final test @@ -38,8 +40,9 @@ namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses /// public String Info { get; } /// - /// Processes which are relevant for the EOL production + /// Processes which are relevant for the production have a number for the sequence they should be displayed + /// in the GUI, all hidden (non-)production processes are set to null /// - public Boolean ProductionRelevant { get; } + public UInt32? ProductionProcessNo { get; } } }