Skip to content

Commit

Permalink
doc additions and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
PTKu committed Aug 2, 2023
1 parent 24fa95e commit 0c784b3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docfx/articles/connectors/WebAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ Entry.Plc.Connector.SetLoggerConfiguration(new LoggerConfiguration()
.MinimumLevel.Debug()
.CreateLogger());
```

> [!WARNING]
> **Enabling monitoring will impact the connector perfomance.**
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ namespace AXSharp.Presentation.Blazor.Interfaces
{
public interface IRenderableComponent
{
/// <summary>
/// Adds <see cref="element"/> to the polling queue.
/// <param name="element">Element to be added to the polling queue.</param>
/// <param name="pollingInterval">Sets polling interval for the element.</param>
void AddToPolling(ITwinElement element, int pollingInterval = 250);

/// <summary>
/// Removes elements added for polling from this component.
/// </summary>
void RemovePolledElements();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ protected Connector()
IdentityProvider = new TwinIdentityProvider(this);
}

/// <summary>
/// Sets logger for this connector.
/// >![NOTE] The default logger is implemented. Default implementation will log into console and in simple text file.
/// </summary>
/// <param name="logger">Logger</param>
public void SetLoggerConfiguration(ILogger logger)
{
this._logger = logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ private Polling(ITwinElement twinObject,

private static Dictionary<int, Task> 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)
{
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public static async Task ShadowToOnlineAsync(this ITwinObject obj)
/// </summary>
/// <param name="obj">Object to be polled.</param>
/// <param name="interval">Polling interval in ms.</param>
/// <param name="holder">Object which owns this polling.</param>
public static void StartPolling(this ITwinElement obj, int interval, object holder)
{
Polling.Add(obj, interval, holder);
Expand All @@ -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.
/// </summary>
/// <param name="obj">Object for which the polling should be stopped.</param>
/// <param name="holder">Object which owns this polling.</param>
public static void StopPolling(this ITwinElement obj, object holder)
{
Polling.Remove(obj, holder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class OnlinerBase : ITwinPrimitive

internal string _humanReadable;

public ConcurrentDictionary<object, byte> PollingHolders = new ConcurrentDictionary<object, byte>();
internal ConcurrentDictionary<object, byte> PollingHolders = new ConcurrentDictionary<object, byte>();

public int PollingInterval { get; internal set; }

Expand Down

0 comments on commit 0c784b3

Please sign in to comment.