common/Production/ProductionUiCordonel/ProductionProcesses/IProcessStateDef.cs
2026-04-23 17:50:07 +02:00

126 lines
5.2 KiB
C#

using System;
using System.Collections.Generic;
using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.Enum;
namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses
{
public interface IProcessStateDef
{
/// <summary>
/// Collection of state information
/// </summary>
List<ProcessStateStruct> StateContainer { get; }
/// <summary>
/// Get the process start struct linked to state of state machine
/// </summary>
/// <param name="stateMachineState">state to search for information text</param>
/// <returns>process state struct of the attached state</returns>
/// <remarks date="2025-Apr-15" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
ProcessStateStruct GetProcessStateStructOfState(ProcessState stateMachineState);
/// <summary>
/// Get the first production process state name to start the state machine with this.
/// It has to be a process labeled with ProductionProcessNo == 0.
/// </summary>
/// <returns>process attached to the state</returns>
/// <remarks date="2023-Feb-14" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
ProcessState GetStateOfFirstProcess();
/// <summary>
/// Get the production process number of this process
/// </summary>
/// <param name="process">process to look for state info text</param>
/// <returns>the production process number</returns>
/// <remarks date="2025-Jul-07" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
UInt32? GetProductionProcessNoOfProcess(IProductionProcess process);
/// <summary>
/// Get the process linked to state of state machine
/// </summary>
/// <param name="stateMachineState">state to search for information text</param>
/// <returns>process attached to the state</returns>
/// <remarks date="2023-Feb-14" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
IProductionProcess GetProcessOfState(ProcessState stateMachineState);
/// <summary>
/// Get the current information of the state machine state
/// </summary>
/// <param name="stateMachineState">state to search for information text</param>
/// <returns>information attached to state depending on region</returns>
/// <remarks date="2023-Feb-14" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
/// <remarks date="2024-Mar-18" author="Thomas Wiedebusch">
/// - If state == null return error message.
/// </remarks>
String GetStateInfoOfState(ProcessState? stateMachineState);
/// <summary>
/// Get the info text from production process
/// </summary>
/// <param name="process">process to look for state info text</param>
/// <returns>information attached to process depending on region</returns>
/// <remarks date="2023-Mar-20" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
String GetStateInfoOfProcess(IProductionProcess process);
/// <summary>
/// Get the state machine state of the text
/// </summary>
/// <param name="text">information text to search if state is assigned</param>
/// <returns>state attached to information text</returns>
/// <remarks date="2023-Feb-14" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
ProcessState GetStateOfInfoText(String text);
/// <summary>
/// Get the state machine state from for the process
/// </summary>
/// <param name="process">process to look for state info text</param>
/// <returns>state attached to process</returns>
/// <remarks date="2023-Mar-20" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
ProcessState GetStateOfProcess(IProductionProcess process);
/// <summary>
/// Get number of EOL relevant processes for statistic e.g. progress bar
/// </summary>
/// <returns>number of initialized processes</returns>
/// <remarks date="2023-Mar-20" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
/// <remarks date="2024-Sep-01" author="Thomas Wiedebusch">
/// - Used marker for production relevant processes
/// </remarks>
Int32 GetNumberOfInitializedProcesses();
/// <summary>
/// Get a sorted list of all production processes in order of the execution sequence
/// </summary>
/// <returns>list of initialized processes</returns>
/// <remarks date="2024-Jul-15" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
/// <remarks date="2024-Sep-01" author="Thomas Wiedebusch">
/// - Used marker for production relevant processes
/// </remarks>
/// <remarks date="2025-Apr-14" author="Thomas Wiedebusch">
/// - Changed to sorted list by production process number
/// </remarks>
List<IProductionProcess> GetAllProductionProcesses();
}
}