diff --git a/docfx/articles/connectors/WebAPI.md b/docfx/articles/connectors/WebAPI.md index 31e0fc27..fbaa9da2 100644 --- a/docfx/articles/connectors/WebAPI.md +++ b/docfx/articles/connectors/WebAPI.md @@ -40,3 +40,6 @@ Entry.Plc.Connector.SetLoggerConfiguration(new LoggerConfiguration() .MinimumLevel.Debug() .CreateLogger()); ``` + +> [!WARNING] +> **Enabling monitoring will impact the connector perfomance.** \ No newline at end of file diff --git a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor/Interfaces/IRenderableComponent.cs b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor/Interfaces/IRenderableComponent.cs index d3fcf9a5..a37fc71e 100644 --- a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor/Interfaces/IRenderableComponent.cs +++ b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor/Interfaces/IRenderableComponent.cs @@ -11,8 +11,15 @@ namespace AXSharp.Presentation.Blazor.Interfaces { public interface IRenderableComponent { + /// + /// Adds to the polling queue. + /// Element to be added to the polling queue. + /// Sets polling interval for the element. void AddToPolling(ITwinElement element, int pollingInterval = 250); + /// + /// Removes elements added for polling from this component. + /// void RemovePolledElements(); } diff --git a/src/AXSharp.connectors/src/AXSharp.Connector/Connector/Connector.cs b/src/AXSharp.connectors/src/AXSharp.Connector/Connector/Connector.cs index bae7a2c6..144ef2aa 100644 --- a/src/AXSharp.connectors/src/AXSharp.Connector/Connector/Connector.cs +++ b/src/AXSharp.connectors/src/AXSharp.Connector/Connector/Connector.cs @@ -65,6 +65,11 @@ protected Connector() IdentityProvider = new TwinIdentityProvider(this); } + /// + /// Sets logger for this connector. + /// >![NOTE] The default logger is implemented. Default implementation will log into console and in simple text file. + /// + /// Logger public void SetLoggerConfiguration(ILogger logger) { this._logger = logger; diff --git a/src/AXSharp.connectors/src/AXSharp.Connector/Polling/Polling.cs b/src/AXSharp.connectors/src/AXSharp.Connector/Polling/Polling.cs index af34dd51..cbced917 100644 --- a/src/AXSharp.connectors/src/AXSharp.Connector/Polling/Polling.cs +++ b/src/AXSharp.connectors/src/AXSharp.Connector/Polling/Polling.cs @@ -24,7 +24,8 @@ private Polling(ITwinElement twinObject, private static Dictionary PollingTasks { get; } = new(); - public static void Add(ITwinElement obj, int interval, object holder) + + internal static void Add(ITwinElement obj, int interval, object holder) { switch (obj) { @@ -124,7 +125,7 @@ private static void AddToPolling(int interval, OnlinerBase primitive, object hol AddHolder(primitive, holder); } - public static void Remove(ITwinElement obj, object holder) + internal static void Remove(ITwinElement obj, object holder) { byte dummy; switch (obj) diff --git a/src/AXSharp.connectors/src/AXSharp.Connector/TwinObjectExtensions.cs b/src/AXSharp.connectors/src/AXSharp.Connector/TwinObjectExtensions.cs index 4ad219e7..f3eae9c7 100644 --- a/src/AXSharp.connectors/src/AXSharp.Connector/TwinObjectExtensions.cs +++ b/src/AXSharp.connectors/src/AXSharp.Connector/TwinObjectExtensions.cs @@ -267,6 +267,7 @@ public static async Task ShadowToOnlineAsync(this ITwinObject obj) /// /// Object to be polled. /// Polling interval in ms. + /// Object which owns this polling. public static void StartPolling(this ITwinElement obj, int interval, object holder) { Polling.Add(obj, interval, holder); @@ -278,6 +279,7 @@ public static void StartPolling(this ITwinElement obj, int interval, object hold /// If there is any remaining instance active the polling will continue until the last instance is stopped. /// /// Object for which the polling should be stopped. + /// Object which owns this polling. public static void StopPolling(this ITwinElement obj, object holder) { Polling.Remove(obj, holder); diff --git a/src/AXSharp.connectors/src/AXSharp.Connector/ValueTypes/Onlines/OnlinerBase.cs b/src/AXSharp.connectors/src/AXSharp.Connector/ValueTypes/Onlines/OnlinerBase.cs index b069b351..bbe11384 100644 --- a/src/AXSharp.connectors/src/AXSharp.Connector/ValueTypes/Onlines/OnlinerBase.cs +++ b/src/AXSharp.connectors/src/AXSharp.Connector/ValueTypes/Onlines/OnlinerBase.cs @@ -33,7 +33,7 @@ public abstract class OnlinerBase : ITwinPrimitive internal string _humanReadable; - public ConcurrentDictionary PollingHolders = new ConcurrentDictionary(); + internal ConcurrentDictionary PollingHolders = new ConcurrentDictionary(); public int PollingInterval { get; internal set; }