using Newtonsoft.Json; using System; namespace PepperDash.Essentials.Core { /// /// Basic RoutingInput with no statuses. /// public class RoutingInputPort : RoutingPort { /// /// The IRoutingInputs object this lives on /// [JsonIgnore] public IRoutingInputs ParentDevice { get; private set; } /// /// Constructor for a basic RoutingInputPort /// /// An object used to refer to this port in the IRouting device's ExecuteSwitch method. /// May be string, number, whatever /// The IRoutingInputs object this lives on public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType, object selector, IRoutingInputs parent) : this (key, type, connType, selector, parent, false) { } /// /// Constructor for a virtual routing input port that lives inside a device. For example /// the ports that link a DM card to a DM matrix bus /// /// true for internal ports public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType, object selector, IRoutingInputs parent, bool isInternal) : base(key, type, connType, selector, isInternal) { if (parent == null) throw new ArgumentNullException(nameof(parent)); ParentDevice = parent; } public override string ToString() { return $"{ParentDevice.Key}|{Key}|{Type}|{ConnectionType}"; } } /*/// /// Basic RoutingInput with no statuses. /// public class RoutingInputPort : RoutingPort { /// /// The IRoutingInputs object this lives on /// public IRoutingInputs ParentDevice { get; private set; } /// /// Constructor for a basic RoutingInputPort /// /// An object used to refer to this port in the IRouting device's ExecuteSwitch method. /// May be string, number, whatever /// The IRoutingInputs object this lives on public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType, TSelector selector, IRoutingInputs parent) : this(key, type, connType, selector, parent, false) { } /// /// Constructor for a virtual routing input port that lives inside a device. For example /// the ports that link a DM card to a DM matrix bus /// /// true for internal ports public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType, TSelector selector, IRoutingInputs parent, bool isInternal) : base(key, type, connType, selector, isInternal) { ParentDevice = parent ?? throw new ArgumentNullException(nameof(parent)); } }*/ }