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,14 +4,23 @@ using System.Collections.Generic;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Represents a connection (tie line) between a <see cref="RoutingOutputPort"/> and a <see cref="RoutingInputPort"/>.
/// </summary>
public class TieLine
{
/// <summary>
/// The source output port of the tie line.
/// </summary>
public RoutingOutputPort SourcePort { get; private set; }
/// <summary>
/// The destination input port of the tie line.
/// </summary>
public RoutingInputPort DestinationPort { get; private set; }
//public int InUseCount { get { return DestinationUsingThis.Count; } }
/// <summary>
/// Gets the type of this tie line. Will either be the type of the desination port
/// Gets the type of this tie line. Will either be the type of the destination port
/// or the type of OverrideType when it is set.
/// </summary>
public eRoutingSignalType Type
@@ -35,20 +44,27 @@ namespace PepperDash.Essentials.Core
//List<IRoutingInputs> DestinationUsingThis = new List<IRoutingInputs>();
/// <summary>
/// For tie lines that represent internal links, like from cards to the matrix in a DM.
/// This property is true if SourcePort and DestinationPort IsInternal
/// property are both true
/// Gets a value indicating whether this tie line represents an internal connection within a device (both source and destination ports are internal).
/// </summary>
public bool IsInternal { get { return SourcePort.IsInternal && DestinationPort.IsInternal; } }
/// <summary>
/// Gets a value indicating whether the signal types of the source and destination ports differ.
/// </summary>
public bool TypeMismatch { get { return SourcePort.Type != DestinationPort.Type; } }
/// <summary>
/// Gets a value indicating whether the connection types of the source and destination ports differ.
/// </summary>
public bool ConnectionTypeMismatch { get { return SourcePort.ConnectionType != DestinationPort.ConnectionType; } }
/// <summary>
/// A descriptive note about any type mismatch, if applicable.
/// </summary>
public string TypeMismatchNote { get; set; }
/// <summary>
///
/// Initializes a new instance of the <see cref="TieLine"/> class.
/// </summary>
/// <param name="sourcePort"></param>
/// <param name="destinationPort"></param>
/// <param name="sourcePort">The source output port.</param>
/// <param name="destinationPort">The destination input port.</param>
public TieLine(RoutingOutputPort sourcePort, RoutingInputPort destinationPort)
{
if (sourcePort == null || destinationPort == null)
@@ -58,9 +74,11 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
/// Creates a tie line with an overriding Type. See help for OverrideType property for info.
/// </summary>
/// <param name="overrideType">The signal type to limit the link to. Overrides DestinationPort.Type</param>
/// <param name="sourcePort">The source output port.</param>
/// <param name="destinationPort">The destination input port.</param>
/// <param name="overrideType">The signal type to limit the link to. Overrides DestinationPort.Type for routing calculations.</param>
public TieLine(RoutingOutputPort sourcePort, RoutingInputPort destinationPort, eRoutingSignalType? overrideType) :
this(sourcePort, destinationPort)
{
@@ -68,9 +86,11 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
/// Creates a tie line with an overriding Type. See help for OverrideType property for info.
/// </summary>
/// <param name="overrideType">The signal type to limit the link to. Overrides DestinationPort.Type</param>
/// <param name="sourcePort">The source output port.</param>
/// <param name="destinationPort">The destination input port.</param>
/// <param name="overrideType">The signal type to limit the link to. Overrides DestinationPort.Type for routing calculations.</param>
public TieLine(RoutingOutputPort sourcePort, RoutingInputPort destinationPort, eRoutingSignalType overrideType) :
this(sourcePort, destinationPort)
{
@@ -78,18 +98,25 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// Will link up video status from supporting inputs to connected outputs
/// Will link up video status from supporting inputs to connected outputs.
/// </summary>
public void Activate()
{
// Now does nothing
}
/// <summary>
/// Deactivates the tie line.
/// </summary>
public void Deactivate()
{
// Now does nothing
}
/// <summary>
/// Returns a string representation of the tie line.
/// </summary>
/// <returns>A string describing the source, destination, and type of the tie line.</returns>
public override string ToString()
{
return string.Format("Tie line: {0}:{1} --> {2}:{3} {4}", SourcePort.ParentDevice.Key, SourcePort.Key,
@@ -99,8 +126,14 @@ namespace PepperDash.Essentials.Core
//********************************************************************************
/// <summary>
/// Represents a collection of <see cref="TieLine"/> objects.
/// </summary>
public class TieLineCollection : List<TieLine>
{
/// <summary>
/// Gets the default singleton instance of the <see cref="TieLineCollection"/>.
/// </summary>
public static TieLineCollection Default
{
get
@@ -111,6 +144,9 @@ namespace PepperDash.Essentials.Core
}
}
/// <summary>
/// Backing field for the singleton instance.
/// </summary>
[JsonIgnore]
private static TieLineCollection _Default;
}