mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
wip: update XML comments
This commit is contained in:
@@ -9,8 +9,14 @@ using Serilog.Events;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Abstract base class for Crestron GenericBase devices
|
||||||
|
/// </summary>
|
||||||
public abstract class CrestronGenericBaseDevice : EssentialsDevice, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
|
public abstract class CrestronGenericBaseDevice : EssentialsDevice, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Hardware
|
||||||
|
/// </summary>
|
||||||
protected GenericBase Hardware;
|
protected GenericBase Hardware;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -18,24 +24,32 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public FeedbackCollection<Feedback> Feedbacks { get; private set; }
|
public FeedbackCollection<Feedback> Feedbacks { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the IsOnline
|
/// Gets or sets the IsOnline
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BoolFeedback IsOnline { get; private set; }
|
public BoolFeedback IsOnline { get; private set; }
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the IsRegistered
|
/// <summary>
|
||||||
/// </summary>
|
/// Gets or sets the IsRegistered
|
||||||
|
/// </summary>
|
||||||
public BoolFeedback IsRegistered { get; private set; }
|
public BoolFeedback IsRegistered { get; private set; }
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the IpConnectionsText
|
/// <summary>
|
||||||
/// </summary>
|
/// Gets or sets the IpConnectionsText
|
||||||
|
/// </summary>
|
||||||
public StringFeedback IpConnectionsText { get; private set; }
|
public StringFeedback IpConnectionsText { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the PreventRegistration
|
/// Gets or sets the PreventRegistration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool PreventRegistration { get; protected set; }
|
public bool PreventRegistration { get; protected set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">key of the device</param>
|
||||||
|
/// <param name="name">name of the device</param>
|
||||||
|
/// <param name="hardware">hardware instance</param>
|
||||||
protected CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
protected CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
@@ -50,6 +64,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor without hardware instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">key of the device</param>
|
||||||
|
/// <param name="name">name of the device</param>
|
||||||
protected CrestronGenericBaseDevice(string key, string name)
|
protected CrestronGenericBaseDevice(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
@@ -57,6 +76,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Registers the Crestron GenericBase hardware instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hardware">hardware instance</param>
|
||||||
protected void RegisterCrestronGenericBase(GenericBase hardware)
|
protected void RegisterCrestronGenericBase(GenericBase hardware)
|
||||||
{
|
{
|
||||||
Hardware = hardware;
|
Hardware = hardware;
|
||||||
@@ -68,10 +91,10 @@ namespace PepperDash.Essentials.Core
|
|||||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CustomActivate method
|
/// CustomActivate method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
Debug.LogMessage(LogEventLevel.Information, this, "Activating");
|
Debug.LogMessage(LogEventLevel.Information, this, "Activating");
|
||||||
@@ -118,11 +141,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This disconnects events and unregisters the base hardware device.
|
/// This disconnects events and unregisters the base hardware device.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns>true if successful, otherwise false</returns>
|
||||||
/// <summary>
|
|
||||||
/// Deactivate method
|
|
||||||
/// </summary>
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override bool Deactivate()
|
public override bool Deactivate()
|
||||||
{
|
{
|
||||||
CommunicationMonitor.Stop();
|
CommunicationMonitor.Stop();
|
||||||
@@ -138,10 +157,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds feedback(s) to the list
|
/// Adds feedback(s) to the list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newFbs"></param>
|
/// <param name="newFbs">feedback(s) to be added to the list</param>
|
||||||
/// <summary>
|
|
||||||
/// AddToFeedbackList method
|
|
||||||
/// </summary>
|
|
||||||
public void AddToFeedbackList(params Feedback[] newFbs)
|
public void AddToFeedbackList(params Feedback[] newFbs)
|
||||||
{
|
{
|
||||||
foreach (var f in newFbs)
|
foreach (var f in newFbs)
|
||||||
@@ -173,9 +189,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
#region IStatusMonitor Members
|
#region IStatusMonitor Members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the CommunicationMonitor
|
/// Gets or sets the CommunicationMonitor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -189,29 +205,57 @@ namespace PepperDash.Essentials.Core
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Abstract base class for Crestron GenericBase devices that are bridgeable
|
||||||
|
/// </summary>
|
||||||
public abstract class CrestronGenericBridgeableBaseDevice : CrestronGenericBaseDevice, IBridgeAdvanced
|
public abstract class CrestronGenericBridgeableBaseDevice : CrestronGenericBaseDevice, IBridgeAdvanced
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">key of the device</param>
|
||||||
|
/// <param name="name">name of the device</param>
|
||||||
|
/// <param name="hardware">hardware instance</param>
|
||||||
protected CrestronGenericBridgeableBaseDevice(string key, string name, GenericBase hardware) : base(key, name, hardware)
|
protected CrestronGenericBridgeableBaseDevice(string key, string name, GenericBase hardware) : base(key, name, hardware)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor without hardware instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">key of the device</param>
|
||||||
|
/// <param name="name">name of the device</param>
|
||||||
protected CrestronGenericBridgeableBaseDevice(string key, string name)
|
protected CrestronGenericBridgeableBaseDevice(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Links to API
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="trilist">the trilist</param>
|
||||||
|
/// <param name="joinStart">the starting join number</param>
|
||||||
|
/// <param name="joinMapKey">the join map key</param>
|
||||||
|
/// <param name="bridge">the bridge instance</param>
|
||||||
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
|
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//***********************************************************************************
|
//***********************************************************************************
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a CrestronGenericBaseDeviceEventIds
|
/// Represents a CrestronGenericBaseDeviceEventIds
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CrestronGenericBaseDeviceEventIds
|
public class CrestronGenericBaseDeviceEventIds
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// IsOnline event ID
|
||||||
|
/// </summary>
|
||||||
public const uint IsOnline = 1;
|
public const uint IsOnline = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IpConnectionsText event ID
|
||||||
|
/// </summary>
|
||||||
public const uint IpConnectionsText =2;
|
public const uint IpConnectionsText =2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,9 +264,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class GenericBaseExtensions
|
public static class GenericBaseExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// RegisterWithLogging method
|
/// RegisterWithLogging method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="device">the GenericBase device</param>
|
||||||
|
/// <param name="key">the device key</param>
|
||||||
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
|
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
|
||||||
{
|
{
|
||||||
var result = device.Register();
|
var result = device.Register();
|
||||||
|
|||||||
@@ -21,11 +21,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
[Description("Wrapper class for a Relay")]
|
[Description("Wrapper class for a Relay")]
|
||||||
public class GenericRelayDevice : EssentialsBridgeableDevice, ISwitchedOutput
|
public class GenericRelayDevice : EssentialsBridgeableDevice, ISwitchedOutput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The RelayOutput controlled by this device
|
||||||
|
/// </summary>
|
||||||
public Relay RelayOutput { get; private set; }
|
public Relay RelayOutput { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Feedback to indicate whether the output is on
|
||||||
|
/// </summary>
|
||||||
public BoolFeedback OutputIsOnFeedback { get; private set; }
|
public BoolFeedback OutputIsOnFeedback { get; private set; }
|
||||||
|
|
||||||
//Maintained for compatibility with PepperDash.Essentials.Core.Devices.CrestronProcessor
|
//Maintained for compatibility with PepperDash.Essentials.Core.Devices.CrestronProcessor
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor for GenericRelayDevice
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">key of the device</param>
|
||||||
|
/// <param name="relay">Relay output controlled by this device</param>
|
||||||
public GenericRelayDevice(string key, Relay relay) :
|
public GenericRelayDevice(string key, Relay relay) :
|
||||||
base(key)
|
base(key)
|
||||||
{
|
{
|
||||||
@@ -37,6 +48,13 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
RelayOutput.StateChange += RelayOutput_StateChange;
|
RelayOutput.StateChange += RelayOutput_StateChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor for GenericRelayDevice
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">key of the device</param>
|
||||||
|
/// <param name="name">name of the device</param>
|
||||||
|
/// <param name="postActivationFunc">function to get the relay output</param>
|
||||||
|
/// <param name="config">IO port configuration</param>
|
||||||
public GenericRelayDevice(string key, string name, Func<IOPortConfig, Relay> postActivationFunc,
|
public GenericRelayDevice(string key, string name, Func<IOPortConfig, Relay> postActivationFunc,
|
||||||
IOPortConfig config)
|
IOPortConfig config)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
@@ -212,6 +230,9 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class GenericRelayDeviceFactory : EssentialsDeviceFactory<GenericRelayDevice>
|
public class GenericRelayDeviceFactory : EssentialsDeviceFactory<GenericRelayDevice>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor for GenericRelayDeviceFactory
|
||||||
|
/// </summary>
|
||||||
public GenericRelayDeviceFactory()
|
public GenericRelayDeviceFactory()
|
||||||
{
|
{
|
||||||
TypeNames = new List<string>() { "relayoutput" };
|
TypeNames = new List<string>() { "relayoutput" };
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IDigitalInput
|
public interface IDigitalInput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Feedback to indicate the state of the input
|
||||||
|
/// </summary>
|
||||||
BoolFeedback InputStateFeedback { get; }
|
BoolFeedback InputStateFeedback { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,15 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IDigitalOutput
|
public interface IDigitalOutput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Feedback to indicate the state of the output
|
||||||
|
/// </summary>
|
||||||
BoolFeedback OutputStateFeedback { get; }
|
BoolFeedback OutputStateFeedback { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the output state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="state">The desired state of the output</param>
|
||||||
void SetOutput(bool state);
|
void SetOutput(bool state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IHasCresnetBranches
|
public interface IHasCresnetBranches
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Collection of Cresnet branches
|
||||||
|
/// </summary>
|
||||||
CrestronCollection<CresnetBranch> CresnetBranches { get; }
|
CrestronCollection<CresnetBranch> CresnetBranches { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,14 +13,30 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ISwitchedOutput
|
public interface ISwitchedOutput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Feedback to indicate whether the output is on
|
||||||
|
/// </summary>
|
||||||
BoolFeedback OutputIsOnFeedback {get;}
|
BoolFeedback OutputIsOnFeedback {get;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Turns the output on
|
||||||
|
/// </summary>
|
||||||
void On();
|
void On();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Turns the output off
|
||||||
|
/// </summary>
|
||||||
void Off();
|
void Off();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a collection of switched outputs
|
||||||
|
/// </summary>
|
||||||
public interface ISwitchedOutputCollection
|
public interface ISwitchedOutputCollection
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Dictionary of switched outputs by their port number
|
||||||
|
/// </summary>
|
||||||
Dictionary<uint, ISwitchedOutput> SwitchedOutputs { get; }
|
Dictionary<uint, ISwitchedOutput> SwitchedOutputs { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,11 +12,18 @@ namespace PepperDash.Essentials.Core.DeviceInfo
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DeviceInfo DeviceInfo { get; set; }
|
public DeviceInfo DeviceInfo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor
|
||||||
|
/// </summary>
|
||||||
public DeviceInfoEventArgs()
|
public DeviceInfoEventArgs()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor with DeviceInfo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="devInfo">the DeviceInfo instance</param>
|
||||||
public DeviceInfoEventArgs(DeviceInfo devInfo)
|
public DeviceInfoEventArgs(DeviceInfo devInfo)
|
||||||
{
|
{
|
||||||
DeviceInfo = devInfo;
|
DeviceInfo = devInfo;
|
||||||
|
|||||||
@@ -8,10 +8,19 @@ namespace PepperDash.Essentials.Core.DeviceInfo
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IDeviceInfoProvider:IKeyed
|
public interface IDeviceInfoProvider:IKeyed
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the DeviceInfo
|
||||||
|
/// </summary>
|
||||||
DeviceInfo DeviceInfo { get; }
|
DeviceInfo DeviceInfo { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event fired when DeviceInfo changes
|
||||||
|
/// </summary>
|
||||||
event DeviceInfoChangeHandler DeviceInfoChanged;
|
event DeviceInfoChangeHandler DeviceInfoChanged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the DeviceInfo
|
||||||
|
/// </summary>
|
||||||
void UpdateDeviceInfo();
|
void UpdateDeviceInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ using Serilog.Events;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Core.DeviceInfo
|
namespace PepperDash.Essentials.Core.DeviceInfo
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Static class NetworkDeviceHelpers
|
||||||
|
/// </summary>
|
||||||
public static class NetworkDeviceHelpers
|
public static class NetworkDeviceHelpers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -167,7 +170,14 @@ namespace PepperDash.Essentials.Core.DeviceInfo
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ArpEntry
|
public class ArpEntry
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The IP Address of the ARP Entry
|
||||||
|
/// </summary>
|
||||||
public readonly IPAddress IpAddress;
|
public readonly IPAddress IpAddress;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The MAC Address of the ARP Entry
|
||||||
|
/// </summary>
|
||||||
public readonly string MacAddress;
|
public readonly string MacAddress;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user