docs: fill missing XML docs and strip tracking IDs from src comments
Clears CommentChecker findings in src/ (3,280 -> 209, the remainder being false positives like PLC-5/IEEE-754/M0.0) by adding missing summaries/params/returns, normalising inheritdoc usage, and removing Gitea/review tracking IDs while keeping the rationale they annotated. Comment-only: comment-stripped sources are identical to the parent commit.
This commit is contained in:
@@ -56,7 +56,8 @@ public sealed class CapturedTreeBrowseSession(CapturedTree tree) : IBrowseSessio
|
||||
return Task.FromResult<IReadOnlyList<AttributeInfo>>(attrs);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Drops this session's reference to the captured tree; the tree itself may be shared.</summary>
|
||||
/// <returns>A completed <see cref="ValueTask"/>.</returns>
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_tree = null; // drop this session's reference only — tree may be shared (coalescing)
|
||||
@@ -68,7 +69,7 @@ public sealed class CapturedTreeBrowseSession(CapturedTree tree) : IBrowseSessio
|
||||
/// <summary>
|
||||
/// Surfaces a leaf's driver-native type name as the <c>dataType</c> address field, so a
|
||||
/// browse-commit can stamp the driver-typed <c>TagConfig</c> with the type the controller
|
||||
/// actually reported (Gitea #536).
|
||||
/// actually reported.
|
||||
/// </summary>
|
||||
/// <param name="a">The captured attribute.</param>
|
||||
/// <returns>The address fields, or null when the driver reported no native type.</returns>
|
||||
@@ -80,7 +81,7 @@ public sealed class CapturedTreeBrowseSession(CapturedTree tree) : IBrowseSessio
|
||||
/// reverse map would bind a 16-bit INT as a 32-bit DINT and read four bytes for two.
|
||||
/// <para>
|
||||
/// Null when the driver stamped nothing — the mapper then leaves the model's own default in
|
||||
/// place, which is exactly the pre-#536 behaviour rather than a guess.
|
||||
/// place, which is exactly the previous behaviour rather than a guess.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
private static IReadOnlyDictionary<string, string>? NativeTypeFields(DriverAttributeInfo a)
|
||||
|
||||
@@ -17,6 +17,8 @@ public sealed class CapturingAddressSpaceBuilder : IAddressSpaceBuilder
|
||||
public bool Truncated;
|
||||
public readonly int NodeCap = nodeCap;
|
||||
public readonly Dictionary<string, CapturedNode> ById = new(StringComparer.Ordinal);
|
||||
/// <summary>Reserves a slot for one more node, marking the capture truncated when the cap is reached.</summary>
|
||||
/// <returns><see langword="true"/> when the node may be recorded; <see langword="false"/> when the cap is reached.</returns>
|
||||
public bool TryReserve()
|
||||
{
|
||||
if (Count >= NodeCap) { Truncated = true; return false; }
|
||||
@@ -96,7 +98,10 @@ public sealed class CapturingAddressSpaceBuilder : IAddressSpaceBuilder
|
||||
|
||||
private sealed class CapturedVariableHandle(CapturedNode node) : IVariableHandle
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string FullReference => node.Id;
|
||||
|
||||
/// <inheritdoc />
|
||||
public IAlarmConditionSink MarkAsAlarmCondition(AlarmConditionInfo info)
|
||||
{
|
||||
node.IsAlarmMarked = true;
|
||||
@@ -107,6 +112,7 @@ public sealed class CapturingAddressSpaceBuilder : IAddressSpaceBuilder
|
||||
private sealed class NoopAlarmSink : IAlarmConditionSink
|
||||
{
|
||||
public static readonly NoopAlarmSink Instance = new();
|
||||
/// <inheritdoc />
|
||||
public void OnTransition(AlarmEventArgs args) { } // browse never delivers live transitions
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public sealed class DiscoveryDriverBrowser : IUniversalDriverBrowser
|
||||
/// 20 s per-call browse timeout, which only covers serving from memory.</summary>
|
||||
public static readonly TimeSpan OpenTimeout = TimeSpan.FromSeconds(60);
|
||||
|
||||
/// <summary>Bound on the cleanup ShutdownAsync (R2-01: no unbounded waits — a driver wedged
|
||||
/// <summary>Bound on the cleanup ShutdownAsync (no unbounded waits — a driver wedged
|
||||
/// in discovery may be equally wedged in shutdown).</summary>
|
||||
public static readonly TimeSpan ShutdownTimeout = TimeSpan.FromSeconds(10);
|
||||
|
||||
@@ -46,7 +46,11 @@ public sealed class DiscoveryDriverBrowser : IUniversalDriverBrowser
|
||||
public DiscoveryDriverBrowser(IDriverFactory driverFactory, ILogger<DiscoveryDriverBrowser> logger)
|
||||
: this(driverFactory, logger, OpenTimeout, ShutdownTimeout) { }
|
||||
|
||||
// Test seam: short timeouts.
|
||||
/// <summary>Test seam: constructor with explicit open and shutdown bounds.</summary>
|
||||
/// <param name="driverFactory">Factory used to construct throwaway/capture driver instances.</param>
|
||||
/// <param name="logger">Logger for shutdown-timeout warnings.</param>
|
||||
/// <param name="openTimeout">Upper bound on opening a capture driver and running discovery.</param>
|
||||
/// <param name="shutdownTimeout">Upper bound on the cleanup shutdown of a capture driver.</param>
|
||||
internal DiscoveryDriverBrowser(IDriverFactory driverFactory, ILogger<DiscoveryDriverBrowser> logger,
|
||||
TimeSpan openTimeout, TimeSpan shutdownTimeout)
|
||||
{
|
||||
@@ -111,6 +115,10 @@ public sealed class DiscoveryDriverBrowser : IUniversalDriverBrowser
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Builds the in-flight de-duplication key for a capture request.</summary>
|
||||
/// <param name="driverType">The driver type name.</param>
|
||||
/// <param name="configJson">The driver configuration JSON.</param>
|
||||
/// <returns>A key combining the lower-cased driver type and a hash of the configuration.</returns>
|
||||
internal static string CaptureKey(string driverType, string configJson) =>
|
||||
driverType.ToLowerInvariant() + ":" +
|
||||
Convert.ToHexString(System.Security.Cryptography.SHA256.HashData(
|
||||
@@ -195,6 +203,10 @@ public sealed class DiscoveryDriverBrowser : IUniversalDriverBrowser
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Applies the driver-specific browse-time patch (if any) to the configuration JSON.</summary>
|
||||
/// <param name="driverType">The driver type name.</param>
|
||||
/// <param name="configJson">The driver configuration JSON.</param>
|
||||
/// <returns>The patched configuration JSON, or the input unchanged when the driver type has no patch.</returns>
|
||||
internal static string PatchForBrowse(string driverType, string configJson)
|
||||
{
|
||||
if (!BrowsePatches.TryGetValue(driverType, out var patch)) return configJson;
|
||||
|
||||
Reference in New Issue
Block a user