docs: add xml comments for Essentials routing

This commit is contained in:
Andrew Welker
2025-05-02 12:27:16 -05:00
parent 81a01b7960
commit 13cd84b73d
18 changed files with 421 additions and 44 deletions

View File

@@ -4,29 +4,46 @@ using System;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Represents a basic routing output port on a device.
/// </summary>
public class RoutingOutputPort : RoutingPort
{
/// <summary>
/// The IRoutingOutputs object this port lives on
/// The IRoutingOutputs object this port lives on.
/// </summary>
///
[JsonIgnore]
public IRoutingOutputs ParentDevice { get; private set; }
/// <summary>
/// Tracks which destinations are currently using this output port.
/// </summary>
public InUseTracking InUseTracker { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="RoutingOutputPort"/> class.
/// </summary>
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
/// May be string, number, whatever</param>
/// <param name="parent">The IRoutingOutputs object this port lives on</param>
/// <param name="key">The unique key for this port.</param>
/// <param name="type">The signal type supported by this port.</param>
/// <param name="connType">The physical connection type of this port.</param>
/// <param name="selector">An object used to refer to this port in the parent device's ExecuteSwitch method.</param>
/// <param name="parent">The <see cref="IRoutingOutputs"/> device this port belongs to.</param>
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingOutputs parent)
: this(key, type, connType, selector, parent, false)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="RoutingOutputPort"/> class, potentially marking it as internal.
/// </summary>
/// <param name="key">The unique key for this port.</param>
/// <param name="type">The signal type supported by this port.</param>
/// <param name="connType">The physical connection type of this port.</param>
/// <param name="selector">An object used to refer to this port in the parent device's ExecuteSwitch method.</param>
/// <param name="parent">The <see cref="IRoutingOutputs"/> device this port belongs to.</param>
/// <param name="isInternal">True if this port represents an internal connection within a device (e.g., card to backplane).</param>
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingOutputs parent, bool isInternal)
: base(key, type, connType, selector, isInternal)
@@ -35,6 +52,10 @@ namespace PepperDash.Essentials.Core
InUseTracker = new InUseTracking();
}
/// <summary>
/// Returns a string representation of the output port.
/// </summary>
/// <returns>A string in the format "ParentDeviceKey|PortKey|SignalType|ConnectionType".</returns>
public override string ToString()
{
return $"{ParentDevice.Key}|{Key}|{Type}|{ConnectionType}";