From 6798c76caaefeb74f2b0e911273f1859926ad68e Mon Sep 17 00:00:00 2001 From: Marcel Vielhaus Date: Thu, 25 Sep 2025 06:51:10 +0200 Subject: [PATCH 1/2] Merge pull request [#109](https://github.com/PHOENIXCONTACT/MORYX-Factory/pull/109) from PHOENIXCONTACT/feature/process-report-broken-removed Extend the `IProcessControl` facade to support direct process reporting (Broken, Removed) (cherry picked from commit 9456b2d297d4285a169b84887b3abdd53b6349c6) --- .../Processes/IProcessControlReporting.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs diff --git a/src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs b/src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs new file mode 100644 index 000000000..0cced39aa --- /dev/null +++ b/src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG +// Licensed under the Apache License, Version 2.0 + +using Moryx.AbstractionLayer; + +namespace Moryx.ControlSystem.Processes +{ + /// + /// Actions to report a running process + /// + public enum ReportAction + { + /// + /// The process is broken or damaged + /// + Broken, + /// + /// The process was physically removed + /// + Removed + } + + /// + /// Facade interface to get more information from the control system. + /// + public interface IProcessControlReporting : IProcessControl + { + + /// + /// Report a specific to have been executed on the + /// + /// The process to report + /// The action to perform + void Report(IProcess process, ReportAction action); + + /// + /// Get the running process with the given + /// + /// Id of the running process + /// + IProcess GetProcess(long processId); + } +} From e4f5f3565e2d08f2f60fabf4af3136fe28482f25 Mon Sep 17 00:00:00 2001 From: Marcel Vielhaus Date: Thu, 25 Sep 2025 07:00:58 +0200 Subject: [PATCH 2/2] Merge `IProcessControlReporting` interface into `IProcessControl` To add the related feature without breaking changes in MORYX 8 an additional interface was added. This has now been merged into the original. --- docs/migrations/v8_to_v10.md | 7 ++- .../Processes/IProcessControl.cs | 14 ++++++ .../Processes/IProcessControlReporting.cs | 43 ------------------- .../Processes/ReportAction.cs | 20 +++++++++ 4 files changed, 40 insertions(+), 44 deletions(-) delete mode 100644 src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs create mode 100644 src/Moryx.ControlSystem/Processes/ReportAction.cs diff --git a/docs/migrations/v8_to_v10.md b/docs/migrations/v8_to_v10.md index e81fd2ea2..b42f78ef0 100644 --- a/docs/migrations/v8_to_v10.md +++ b/docs/migrations/v8_to_v10.md @@ -2,4 +2,9 @@ ## Replaced result of visual instructions with dedicated result object -In *Moryx.Factory* **6.3** and **8.1** we introduced the new result object and optional extended APIs. The result object solved issues caused by localization of the different results. With **Moryx 10** we remove all old APIs based on strings. \ No newline at end of file +In *Moryx.Factory* **6.3** and **8.1** we introduced the new result object and optional extended APIs. The result object solved issues caused by localization of the different results. With **Moryx 10** we remove all old APIs based on strings. + +## Merged `IProcessControlReporting` into `IProcessControl` + +The `IProcessControlReporting` interface has been merged into `IProcessControl`. All reporting-related methods and the `ReportAction` enum are now part of `IProcessControl`. Remove usages of `IProcessControlReporting` and update your code to use the unified `IProcessControl` interface. + diff --git a/src/Moryx.ControlSystem/Processes/IProcessControl.cs b/src/Moryx.ControlSystem/Processes/IProcessControl.cs index 71c289a08..758e536e7 100644 --- a/src/Moryx.ControlSystem/Processes/IProcessControl.cs +++ b/src/Moryx.ControlSystem/Processes/IProcessControl.cs @@ -20,6 +20,13 @@ public interface IProcessControl /// IReadOnlyList RunningProcesses { get; } + /// + /// Get the running process with the given + /// + /// Id of the running process + /// + IProcess GetProcess(long processId); + /// /// Retrieve all processes for a product instance /// @@ -35,6 +42,13 @@ public interface IProcessControl /// IReadOnlyList Targets(IActivity activity); + /// + /// Report a specific to have been executed on the + /// + /// The process to report + /// The action to perform + void Report(IProcess process, ReportAction action); + /// /// A process has changed /// diff --git a/src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs b/src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs deleted file mode 100644 index 0cced39aa..000000000 --- a/src/Moryx.ControlSystem/Processes/IProcessControlReporting.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG -// Licensed under the Apache License, Version 2.0 - -using Moryx.AbstractionLayer; - -namespace Moryx.ControlSystem.Processes -{ - /// - /// Actions to report a running process - /// - public enum ReportAction - { - /// - /// The process is broken or damaged - /// - Broken, - /// - /// The process was physically removed - /// - Removed - } - - /// - /// Facade interface to get more information from the control system. - /// - public interface IProcessControlReporting : IProcessControl - { - - /// - /// Report a specific to have been executed on the - /// - /// The process to report - /// The action to perform - void Report(IProcess process, ReportAction action); - - /// - /// Get the running process with the given - /// - /// Id of the running process - /// - IProcess GetProcess(long processId); - } -} diff --git a/src/Moryx.ControlSystem/Processes/ReportAction.cs b/src/Moryx.ControlSystem/Processes/ReportAction.cs new file mode 100644 index 000000000..c41d58a17 --- /dev/null +++ b/src/Moryx.ControlSystem/Processes/ReportAction.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG +// Licensed under the Apache License, Version 2.0 + +namespace Moryx.ControlSystem.Processes +{ + /// + /// Actions to report a running process + /// + public enum ReportAction + { + /// + /// The process is broken or damaged + /// + Broken, + /// + /// The process was physically removed + /// + Removed + } +}