docs(xml): fill missing XML doc comments + strip task-tracking refs across src (fixdocs)
Add missing <summary>/<param>/<returns>/<typeparam> tags and switch interface implementations to <inheritdoc/> across 106 files; strip project bookkeeping identifiers (Task NN, #05-TNN, PLAN-04, StoreAndForward-0NN) from shipped code comments while preserving the descriptive rationale. Comment-only: zero code-logic lines changed; solution builds 0/0. Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
@@ -22,6 +22,7 @@ public static class DebugTreeBuilder
|
||||
/// <see cref="AttributeValueChanged.AttributeName"/>). Null/empty/whitespace
|
||||
/// keeps everything; matching leaves carry along their ancestor branches.
|
||||
/// </param>
|
||||
/// <returns>The root nodes of the attribute composition forest.</returns>
|
||||
/// <remarks>
|
||||
/// The caller is expected to pass at most one <see cref="AttributeValueChanged"/>
|
||||
/// per <see cref="AttributeValueChanged.AttributeName"/>. The DebugView page
|
||||
@@ -74,6 +75,7 @@ public static class DebugTreeBuilder
|
||||
/// keeps everything; kept items carry along their ancestor branches and, for native
|
||||
/// conditions, their binding node.
|
||||
/// </param>
|
||||
/// <returns>The root nodes of the alarm composition forest.</returns>
|
||||
/// <remarks>
|
||||
/// Two flavours are placed differently:
|
||||
/// <list type="bullet">
|
||||
|
||||
@@ -18,18 +18,26 @@ public sealed class DebugTreeNode
|
||||
/// <summary>Display label (the last path segment).</summary>
|
||||
public required string Segment { get; init; }
|
||||
|
||||
/// <summary>Child nodes, one per next path segment. Empty on a leaf.</summary>
|
||||
public List<DebugTreeNode> Children { get; } = new();
|
||||
|
||||
// Leaf payloads — exactly one is set on a leaf; both null on a pure branch.
|
||||
/// <summary>The attribute value payload when this node is an attribute leaf; null otherwise.</summary>
|
||||
public AttributeValueChanged? Attribute { get; init; }
|
||||
/// <summary>The alarm state payload when this node is an alarm leaf (computed, native condition, or placeholder); null otherwise.</summary>
|
||||
public AlarmStateChanged? Alarm { get; init; } // computed leaf, native condition, or placeholder
|
||||
|
||||
/// <summary>True when this is a branch node grouping native alarm conditions.</summary>
|
||||
public bool IsNativeBinding { get; init; } // branch grouping native conditions
|
||||
|
||||
// Roll-up (set by the builder for branch nodes).
|
||||
/// <summary>The worst alarm state rolled up from this node's descendants.</summary>
|
||||
public AlarmState WorstState { get; set; } = AlarmState.Normal;
|
||||
/// <summary>The count of active alarms rolled up from this node's descendants.</summary>
|
||||
public int ActiveCount { get; set; }
|
||||
/// <summary>True when any descendant attribute has bad quality.</summary>
|
||||
public bool HasBadQuality { get; set; }
|
||||
|
||||
/// <summary>True when this node is a branch (has one or more children).</summary>
|
||||
public bool HasChildren => Children.Count > 0;
|
||||
}
|
||||
|
||||
+2
@@ -53,6 +53,8 @@ public partial class InstanceConfigure
|
||||
/// </summary>
|
||||
/// <param name="parsed">The result of <see cref="OverrideCsvParser.Parse"/>.</param>
|
||||
/// <param name="overridableAttributes">The instance's non-locked attributes (the page's <c>_overrideAttrs</c>).</param>
|
||||
/// <returns>The validated override outcome; <see cref="CsvOverrideImportOutcome.Overrides"/> is
|
||||
/// empty and errors are populated when any row fails validation.</returns>
|
||||
internal static CsvOverrideImportOutcome BuildCsvOverrideImport(
|
||||
OverrideCsvParseResult parsed,
|
||||
IReadOnlyList<TemplateAttribute> overridableAttributes)
|
||||
|
||||
@@ -613,6 +613,8 @@ public partial class TransportImport : ComponentBase, IDisposable
|
||||
/// summary instead). Tolerant of malformed/absent JSON — a parse failure
|
||||
/// simply yields null so the row degrades to the coarse field-diff view.
|
||||
/// </summary>
|
||||
/// <param name="fieldDiffJson">The item's raw <c>FieldDiffJson</c> value, or null/blank.</param>
|
||||
/// <returns>The first <c>lineDiff</c> element found, or null if none is present.</returns>
|
||||
internal static JsonElement? TryExtractLineDiff(string? fieldDiffJson)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(fieldDiffJson))
|
||||
|
||||
+4
@@ -12,6 +12,10 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Operations;
|
||||
/// </summary>
|
||||
internal static class SecuredWriteDataTypeMapper
|
||||
{
|
||||
/// <summary>Attempts to map a Galaxy/MxGateway free-form type name to a ScadaBridge <see cref="DataType"/>.</summary>
|
||||
/// <param name="galaxyTypeName">The free-form Galaxy attribute type name, or null/blank.</param>
|
||||
/// <param name="dataType">The mapped data type when the mapping succeeds; otherwise <c>default</c>.</param>
|
||||
/// <returns><c>true</c> when the name was recognized; otherwise <c>false</c>.</returns>
|
||||
public static bool TryMap(string? galaxyTypeName, out DataType dataType)
|
||||
{
|
||||
dataType = default;
|
||||
|
||||
@@ -89,6 +89,9 @@ public partial class KpiTrendChart
|
||||
/// </summary>
|
||||
private string DataTest => $"kpi-trend-{Slugify(Title)}";
|
||||
|
||||
/// <summary>Slugifies a title: lowercased, with each run of non-alphanumerics collapsed to a single dash and trimmed. Falls back to "chart" for an empty/symbol-only title.</summary>
|
||||
/// <param name="title">The title to slugify, or <c>null</c>.</param>
|
||||
/// <returns>The slugified title, or <c>"chart"</c> as a fallback.</returns>
|
||||
internal static string Slugify(string? title)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(title))
|
||||
|
||||
@@ -329,6 +329,13 @@ public class SandboxAttributeAccessor
|
||||
/// for editor/compile parity, throws <see cref="ScriptSandboxException"/> when run
|
||||
/// in Test Run (no device batch-write transport here).
|
||||
/// </summary>
|
||||
/// <param name="values">The attribute values to write as a batch.</param>
|
||||
/// <param name="flagKey">The flag attribute key to set to signal completion.</param>
|
||||
/// <param name="flagValue">The value to set on the flag attribute.</param>
|
||||
/// <param name="responseKey">The attribute key to observe for the device's response.</param>
|
||||
/// <param name="responseValue">The response value to wait for.</param>
|
||||
/// <param name="timeout">The maximum time to wait for the response.</param>
|
||||
/// <returns>Never returns; always throws <see cref="ScriptSandboxException"/> in the sandbox.</returns>
|
||||
public Task<bool> WriteBatchAndWaitAsync(
|
||||
IReadOnlyDictionary<string, object?> values, string flagKey, object? flagValue,
|
||||
string responseKey, object? responseValue, TimeSpan timeout)
|
||||
@@ -338,6 +345,11 @@ public class SandboxAttributeAccessor
|
||||
/// Sandbox stand-in for <c>AttributeAccessor.WaitAsync</c> (value-equality form);
|
||||
/// see <see cref="WriteBatchAndWaitAsync"/>.
|
||||
/// </summary>
|
||||
/// <param name="key">The attribute key to observe.</param>
|
||||
/// <param name="targetValue">The value to wait for.</param>
|
||||
/// <param name="timeout">The maximum time to wait.</param>
|
||||
/// <param name="requireGoodQuality">Whether the attribute must also have good quality to satisfy the wait.</param>
|
||||
/// <returns>Never returns; always throws <see cref="ScriptSandboxException"/> in the sandbox.</returns>
|
||||
public Task<bool> WaitAsync(string key, object? targetValue, TimeSpan timeout, bool requireGoodQuality = false)
|
||||
=> throw NotInSandbox(nameof(WaitAsync));
|
||||
|
||||
@@ -345,6 +357,11 @@ public class SandboxAttributeAccessor
|
||||
/// Sandbox stand-in for <c>AttributeAccessor.WaitAsync</c> (predicate form);
|
||||
/// see <see cref="WriteBatchAndWaitAsync"/>.
|
||||
/// </summary>
|
||||
/// <param name="key">The attribute key to observe.</param>
|
||||
/// <param name="predicate">The predicate the attribute value must satisfy.</param>
|
||||
/// <param name="timeout">The maximum time to wait.</param>
|
||||
/// <param name="requireGoodQuality">Whether the attribute must also have good quality to satisfy the wait.</param>
|
||||
/// <returns>Never returns; always throws <see cref="ScriptSandboxException"/> in the sandbox.</returns>
|
||||
public Task<bool> WaitAsync(string key, Func<object?, bool> predicate, TimeSpan timeout, bool requireGoodQuality = false)
|
||||
=> throw NotInSandbox(nameof(WaitAsync));
|
||||
|
||||
@@ -352,6 +369,11 @@ public class SandboxAttributeAccessor
|
||||
/// Sandbox stand-in for <c>AttributeAccessor.WaitForAsync</c> (value-equality form);
|
||||
/// see <see cref="WriteBatchAndWaitAsync"/>.
|
||||
/// </summary>
|
||||
/// <param name="key">The attribute key to observe.</param>
|
||||
/// <param name="targetValue">The value to wait for.</param>
|
||||
/// <param name="timeout">The maximum time to wait.</param>
|
||||
/// <param name="requireGoodQuality">Whether the attribute must also have good quality to satisfy the wait.</param>
|
||||
/// <returns>Never returns; always throws <see cref="ScriptSandboxException"/> in the sandbox.</returns>
|
||||
public Task<WaitResult> WaitForAsync(string key, object? targetValue, TimeSpan timeout, bool requireGoodQuality = false)
|
||||
=> throw NotInSandbox(nameof(WaitForAsync));
|
||||
|
||||
@@ -359,6 +381,11 @@ public class SandboxAttributeAccessor
|
||||
/// Sandbox stand-in for <c>AttributeAccessor.WaitForAsync</c> (predicate form);
|
||||
/// see <see cref="WriteBatchAndWaitAsync"/>.
|
||||
/// </summary>
|
||||
/// <param name="key">The attribute key to observe.</param>
|
||||
/// <param name="predicate">The predicate the attribute value must satisfy.</param>
|
||||
/// <param name="timeout">The maximum time to wait.</param>
|
||||
/// <param name="requireGoodQuality">Whether the attribute must also have good quality to satisfy the wait.</param>
|
||||
/// <returns>Never returns; always throws <see cref="ScriptSandboxException"/> in the sandbox.</returns>
|
||||
public Task<WaitResult> WaitForAsync(string key, Func<object?, bool> predicate, TimeSpan timeout, bool requireGoodQuality = false)
|
||||
=> throw NotInSandbox(nameof(WaitForAsync));
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
|
||||
public sealed class PollGate
|
||||
{
|
||||
private int _inFlight;
|
||||
|
||||
/// <summary>Attempts to enter the gate for a new poll tick.</summary>
|
||||
/// <returns><see langword="true"/> if no refresh is currently in flight and the caller
|
||||
/// may proceed; <see langword="false"/> if a previous refresh is still running.</returns>
|
||||
public bool TryEnter() => Interlocked.CompareExchange(ref _inFlight, 1, 0) == 0;
|
||||
|
||||
/// <summary>Releases the gate after a poll tick's refresh has completed.</summary>
|
||||
public void Exit() => Volatile.Write(ref _inFlight, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user