5a878b78d4
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
44 lines
2.3 KiB
C#
44 lines
2.3 KiB
C#
using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming;
|
|
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; // AlarmState
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deployment;
|
|
|
|
/// <summary>
|
|
/// A node in a Debug View composition tree. Attribute (and alarm)
|
|
/// names are path-qualified canonical names (e.g. <c>Motor1.Compressor.Pump</c>);
|
|
/// the tree is derived by splitting those names on <c>'.'</c>. A node is either a
|
|
/// branch (composition member, no payload, has children) or a leaf (one attribute
|
|
/// or one alarm). Consumed by the generic <c>TreeView<TItem></c> component.
|
|
/// </summary>
|
|
public sealed class DebugTreeNode
|
|
{
|
|
/// <summary>Full canonical path — stable TreeView key.</summary>
|
|
public required string Key { get; init; }
|
|
|
|
/// <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;
|
|
}
|