From c967270815141faefb957c0c1dfc7bf63bdf15fc Mon Sep 17 00:00:00 2001 From: Matho Camara Date: Mon, 11 Sep 2023 14:07:42 +0200 Subject: [PATCH] Removed IPublicResource references --- src/Moryx.ControlSystem/Cells/Cell.cs | 17 ++++++++++++++++- src/Moryx.ControlSystem/Cells/ICell.cs | 2 +- .../Materials/IMaterialContainer.cs | 2 +- .../Processes/IProcessReporter.cs | 2 +- .../Transport/ITransportSystem.cs | 2 +- .../IVisualInstructionSource.cs | 2 +- src/Moryx.Factory/IMachineGroup.cs | 2 +- src/Moryx.Factory/IMachineLocation.cs | 4 ++-- src/Moryx.Factory/IManufacturingFactory.cs | 2 +- src/Moryx.Factory/MachineGroup.cs | 2 +- src/Moryx.Factory/MachineLocation.cs | 4 ++-- src/Moryx.Factory/ManufacturingFactory.cs | 2 +- 12 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/Moryx.ControlSystem/Cells/Cell.cs b/src/Moryx.ControlSystem/Cells/Cell.cs index d61bec4..42e35c1 100644 --- a/src/Moryx.ControlSystem/Cells/Cell.cs +++ b/src/Moryx.ControlSystem/Cells/Cell.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.ComponentModel; using Moryx.AbstractionLayer; +using Moryx.AbstractionLayer.Capabilities; using Moryx.AbstractionLayer.Resources; namespace Moryx.ControlSystem.Cells @@ -13,7 +14,7 @@ namespace Moryx.ControlSystem.Cells /// Base type for all implementations of /// [Description("Base type for all cells within a production system")] - public abstract class Cell : PublicResource, ICell + public abstract class Cell : Resource, ICell { /// public abstract IEnumerable ControlSystemAttached(); @@ -29,7 +30,20 @@ public virtual void ProcessAborting(IActivity affectedActivity) { } /// public abstract void SequenceCompleted(SequenceCompleted completed); + private ICapabilities _capabilities = NullCapabilities.Instance; + public ICapabilities Capabilities + { + get + { + return _capabilities; + } + protected set + { + _capabilities = value; + this.CapabilitiesChanged?.Invoke(this, _capabilities); + } + } /// /// Publish a from the resource /// @@ -63,5 +77,6 @@ public void PublishActivityCompleted(ActivityCompleted activityResult) /// public event EventHandler ActivityCompleted; + public event EventHandler CapabilitiesChanged; } } diff --git a/src/Moryx.ControlSystem/Cells/ICell.cs b/src/Moryx.ControlSystem/Cells/ICell.cs index 631a30b..d619183 100644 --- a/src/Moryx.ControlSystem/Cells/ICell.cs +++ b/src/Moryx.ControlSystem/Cells/ICell.cs @@ -10,7 +10,7 @@ namespace Moryx.ControlSystem.Cells /// /// Interface for all cells /// - public interface ICell : IPublicResource, IControlSystemBound + public interface ICell : IResource, IControlSystemBound { /// /// Start an activity in the cell diff --git a/src/Moryx.ControlSystem/Materials/IMaterialContainer.cs b/src/Moryx.ControlSystem/Materials/IMaterialContainer.cs index 6037ad6..731f730 100644 --- a/src/Moryx.ControlSystem/Materials/IMaterialContainer.cs +++ b/src/Moryx.ControlSystem/Materials/IMaterialContainer.cs @@ -11,7 +11,7 @@ namespace Moryx.ControlSystem.Materials /// /// Public API of resources that represent material containers of different types /// - public interface IMaterialContainer : IPublicResource + public interface IMaterialContainer : IResource { /// /// Identifier of this material container diff --git a/src/Moryx.ControlSystem/Processes/IProcessReporter.cs b/src/Moryx.ControlSystem/Processes/IProcessReporter.cs index c12ecf6..43ad376 100644 --- a/src/Moryx.ControlSystem/Processes/IProcessReporter.cs +++ b/src/Moryx.ControlSystem/Processes/IProcessReporter.cs @@ -10,7 +10,7 @@ namespace Moryx.ControlSystem.Processes /// /// Specialized cell that can detect and publish process events /// - public interface IProcessReporter : IPublicResource + public interface IProcessReporter : IResource { /// /// Event raised, when execution of the process failed outside diff --git a/src/Moryx.ControlSystem/Transport/ITransportSystem.cs b/src/Moryx.ControlSystem/Transport/ITransportSystem.cs index 8f1b40f..d68fba6 100644 --- a/src/Moryx.ControlSystem/Transport/ITransportSystem.cs +++ b/src/Moryx.ControlSystem/Transport/ITransportSystem.cs @@ -11,7 +11,7 @@ namespace Moryx.ControlSystem.Transport /// /// Resource that can route products or workpiece groups within the machine /// - public interface ITransportSystem : IPublicResource + public interface ITransportSystem : IResource { /// /// Modes supported by this routing resource diff --git a/src/Moryx.ControlSystem/VisualInstructions/IVisualInstructionSource.cs b/src/Moryx.ControlSystem/VisualInstructions/IVisualInstructionSource.cs index 778df15..fa77bb4 100644 --- a/src/Moryx.ControlSystem/VisualInstructions/IVisualInstructionSource.cs +++ b/src/Moryx.ControlSystem/VisualInstructions/IVisualInstructionSource.cs @@ -10,7 +10,7 @@ namespace Moryx.ControlSystem.VisualInstructions /// /// Source of visual instructions within the resource graph /// - public interface IVisualInstructionSource : IPublicResource + public interface IVisualInstructionSource : IResource { /// /// Identifier of this instruction source diff --git a/src/Moryx.Factory/IMachineGroup.cs b/src/Moryx.Factory/IMachineGroup.cs index ce28323..447de7a 100644 --- a/src/Moryx.Factory/IMachineGroup.cs +++ b/src/Moryx.Factory/IMachineGroup.cs @@ -8,7 +8,7 @@ namespace Moryx.Factory /// /// Group of resources inside the factory /// - public interface IMachineGroup : IPublicResource + public interface IMachineGroup : IResource { /// /// Default icon for this resource group diff --git a/src/Moryx.Factory/IMachineLocation.cs b/src/Moryx.Factory/IMachineLocation.cs index d9fb48c..5611a9d 100644 --- a/src/Moryx.Factory/IMachineLocation.cs +++ b/src/Moryx.Factory/IMachineLocation.cs @@ -8,12 +8,12 @@ namespace Moryx.Factory /// /// A resource/machine location inside the factory /// - public interface IMachineLocation : ILocation, IPublicResource + public interface IMachineLocation : ILocation, IResource { /// /// Resource/Machine at this location /// - IPublicResource Machine { get; } + IResource Machine { get; } /// /// Icon for the machine at this location diff --git a/src/Moryx.Factory/IManufacturingFactory.cs b/src/Moryx.Factory/IManufacturingFactory.cs index 7e4f275..9aec0da 100644 --- a/src/Moryx.Factory/IManufacturingFactory.cs +++ b/src/Moryx.Factory/IManufacturingFactory.cs @@ -8,7 +8,7 @@ namespace Moryx.Factory /// /// A manufacturing factory interface /// - public interface IManufacturingFactory : IPublicResource + public interface IManufacturingFactory : IResource { /// /// Background URL of the factory monitor diff --git a/src/Moryx.Factory/MachineGroup.cs b/src/Moryx.Factory/MachineGroup.cs index 28bf77a..a191ba8 100644 --- a/src/Moryx.Factory/MachineGroup.cs +++ b/src/Moryx.Factory/MachineGroup.cs @@ -11,7 +11,7 @@ namespace Moryx.Factory /// /// Class for all machine groups in manufacturing factory /// - public class MachineGroup : PublicResource, IMachineGroup + public class MachineGroup : Resource, IMachineGroup { [DataMember, EntrySerialize, DefaultValue("settings")] public string DefaultIcon { get; set; } diff --git a/src/Moryx.Factory/MachineLocation.cs b/src/Moryx.Factory/MachineLocation.cs index a5aff79..efd2a22 100644 --- a/src/Moryx.Factory/MachineLocation.cs +++ b/src/Moryx.Factory/MachineLocation.cs @@ -14,9 +14,9 @@ namespace Moryx.Factory /// /// Class for MachineLocation in the factory /// - public class MachineLocation : PublicResource, IMachineLocation + public class MachineLocation : Resource, IMachineLocation { - public IPublicResource Machine => Children.OfType().FirstOrDefault(); + public IResource Machine => Children.OfType().FirstOrDefault(); [DataMember, EntrySerialize] public string SpecificIcon { get; set; } diff --git a/src/Moryx.Factory/ManufacturingFactory.cs b/src/Moryx.Factory/ManufacturingFactory.cs index a0f94db..b1a45c2 100644 --- a/src/Moryx.Factory/ManufacturingFactory.cs +++ b/src/Moryx.Factory/ManufacturingFactory.cs @@ -9,7 +9,7 @@ namespace Moryx.Factory { - public class ManufacturingFactory : PublicResource, IManufacturingFactory + public class ManufacturingFactory : Resource, IManufacturingFactory { [DataMember, EntrySerialize, DefaultValue("assets/Fabrik_Hintergrund.png"), Description("URL of the background picture of the Factory Monitor")] public string BackgroundUrl { get; set; }