wip: update XML comments

This commit is contained in:
Erik Meyer
2026-01-28 11:23:20 -05:00
parent edf5189055
commit 4db32e3720
26 changed files with 529 additions and 92 deletions

View File

@@ -11,15 +11,54 @@ namespace PepperDash.Essentials.Core.Devices.DeviceTypeInterfaces
/// </summary>
public interface IDisplayBasic
{
/// <summary>
/// Sets the input to HDMI 1
/// </summary>
void InputHdmi1();
/// <summary>
/// Sets the input to HDMI 2
/// </summary>
void InputHdmi2();
/// <summary>
/// Sets the input to HDMI 3
/// </summary>
void InputHdmi3();
/// <summary>
/// Sets the input to HDMI 4
/// </summary>
void InputHdmi4();
/// <summary>
/// Sets the input to DisplayPort 1
/// </summary>
void InputDisplayPort1();
/// <summary>
/// Sets the input to DVI 1
/// </summary>
void InputDvi1();
/// <summary>
/// Sets the input to Video 1
/// </summary>
void InputVideo1();
/// <summary>
/// Sets the input to VGA 1
/// </summary>
void InputVga1();
/// <summary>
/// Sets the input to VGA 2
/// </summary>
void InputVga2();
/// <summary>
/// Sets the input to RGB 1
/// </summary>
void InputRgb1();
}
}

View File

@@ -7,15 +7,15 @@ using System.Threading.Tasks;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Base class for audio control list items
/// </summary>
public abstract class AudioControlListItemBase
{
/// <summary>
/// Key of the parent device in the DeviceManager
/// </summary>
[JsonProperty("parentDeviceKey")]
/// <summary>
/// Gets or sets the ParentDeviceKey
/// </summary>
public string ParentDeviceKey { get; set; }
/// <summary>

View File

@@ -14,23 +14,37 @@ namespace PepperDash.Essentials.Core
/// </summary>
public enum AudioChangeType
{
Mute, Volume
/// <summary>
/// Mute change
/// </summary>
Mute,
/// <summary>
/// Volume change
/// </summary>
Volume
}
/// <summary>
/// Represents a AudioChangeEventArgs
/// </summary>
/// <summary>
/// Represents a AudioChangeEventArgs
/// </summary>
public class AudioChangeEventArgs
{
/// <summary>
/// Gets or sets the ChangeType
/// </summary>
/// <summary>
/// Gets or sets the ChangeType
/// </summary>
public AudioChangeType ChangeType { get; private set; }
/// <summary>
/// Gets or sets the AudioDevice
/// </summary>
/// <summary>
/// Gets or sets the AudioDevice
/// </summary>
public IBasicVolumeControls AudioDevice { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="device">device that changed</param>
/// <param name="changeType">type of change</param>
public AudioChangeEventArgs(IBasicVolumeControls device, AudioChangeType changeType)
{
ChangeType = changeType;

View File

@@ -8,10 +8,10 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class CameraListItem
{
[JsonProperty("deviceKey")]
/// <summary>
/// Gets or sets the DeviceKey
/// Key of the camera device
/// </summary>
[JsonProperty("deviceKey")]
public string DeviceKey { get; set; }
/// <summary>
@@ -52,9 +52,6 @@ namespace PepperDash.Essentials.Core
/// A name that will override the source's name on the UI
/// </summary>
[JsonProperty("name")]
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get; set; }

View File

@@ -12,11 +12,36 @@ namespace PepperDash.Essentials.Core
public interface IReceiveVolume
{
// Break this out into 3 interfaces
/// <summary>
/// Sets the receive volume level
/// </summary>
/// <param name="level">volume level to set</param>
void SetReceiveVolume(ushort level);
/// <summary>
/// Mutes the receive audio
/// </summary>
void ReceiveMuteOn();
/// <summary>
/// Unmutes the receive audio
/// </summary>
void ReceiveMuteOff();
/// <summary>
/// Toggles the receive mute state
/// </summary>
void ReceiveMuteToggle();
/// <summary>
/// Feedback for the receive volume level
/// </summary>
IntFeedback ReceiveLevelFeedback { get; }
/// <summary>
/// Feedback for the receive mute state
/// </summary>
BoolFeedback ReceiveMuteIsOnFeedback { get; }
}
@@ -25,11 +50,35 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface ITransmitVolume
{
/// <summary>
/// Sets the transmit volume level
/// </summary>
/// <param name="level">volume level to set</param>
void SetTransmitVolume(ushort level);
/// <summary>
/// Mutes the transmit audio
/// </summary>
void TransmitMuteOn();
/// <summary>
/// Unmutes the transmit audio
/// </summary>
void TransmitMuteOff();
/// <summary>
/// Toggles the transmit mute state
/// </summary>
void TransmitMuteToggle();
/// <summary>
/// Feedback for the transmit volume level
/// </summary>
IntFeedback TransmitLevelFeedback { get; }
/// <summary>
/// Feedback for the transmit mute state
/// </summary>
BoolFeedback TransmitMuteIsOnFeedback { get; }
}
@@ -38,9 +87,24 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IPrivacy
{
/// <summary>
/// Enables privacy mode
/// </summary>
void PrivacyModeOn();
/// <summary>
/// Disables privacy mode
/// </summary>
void PrivacyModeOff();
/// <summary>
/// Toggles privacy mode
/// </summary>
void PrivacyModeToggle();
/// <summary>
/// Feedback for the privacy mode state
/// </summary>
BoolFeedback PrivacyModeIsOnFeedback { get; }
}
}

View File

@@ -15,10 +15,20 @@ namespace PepperDash.Essentials.Core.Devices
/// </summary>
public class CrestronProcessor : Device, ISwitchedOutputCollection
{
/// <summary>
/// Collection of switched outputs (relays) on the processor
/// </summary>
public Dictionary<uint, ISwitchedOutput> SwitchedOutputs { get; private set; }
/// <summary>
/// The underlying CrestronControlSystem processor
/// </summary>
public Crestron.SimplSharpPro.CrestronControlSystem Processor { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key for the processor</param>
public CrestronProcessor(string key)
: base(key)
{

View File

@@ -11,7 +11,14 @@ namespace PepperDash.Essentials.Core.Devices
/// </summary>
public abstract class DeviceApiBase
{
/// <summary>
/// Action API dictionary
/// </summary>
public Dictionary<string, Object> ActionApi { get; protected set; }
/// <summary>
/// Feedback API dictionary
/// </summary>
public Dictionary<string, Feedback> FeedbackApi { get; protected set; }
}
}

View File

@@ -8,18 +8,18 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// DeviceFeedbackExtensions class
/// </summary>
public static class DeviceFeedbackExtensions
{
/// <summary>
/// Attempts to get and return a feedback property from a device by name.
/// If unsuccessful, returns null.
/// </summary>
/// <param name="device"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
/// <summary>
/// GetFeedbackProperty method
/// </summary>
/// <param name="device">device to get feedback from</param>
/// <param name="propertyName">name of the feedback property</param>
/// <returns>Feedback property if found, otherwise null</returns>
public static Feedback GetFeedbackProperty(this Device device, string propertyName)
{
var feedback = DeviceJsonApi.GetPropertyByName(device.Key, propertyName) as Feedback;

View File

@@ -16,13 +16,10 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class DeviceJsonApi
{
/// <summary>
///
/// </summary>
/// <param name="json"></param>
/// <summary>
/// DoDeviceActionWithJson method
/// </summary>
/// <param name="json">json method</param>
public static void DoDeviceActionWithJson(string json)
{
if (String.IsNullOrEmpty(json))
@@ -45,13 +42,10 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
///
/// </summary>
/// <param name="action"></param>
/// <summary>
/// DoDeviceAction method
/// </summary>
/// <param name="action">action method</param>
public static void DoDeviceAction(DeviceActionWrapper action)
{
var key = action.DeviceKey;
@@ -111,6 +105,10 @@ namespace PepperDash.Essentials.Core
}
}
/// <summary>
/// DoDeviceActionAsync method
/// </summary>
/// <param name="action">action method</param>
public static async Task DoDeviceActionAsync(DeviceActionWrapper action)
{
var key = action.DeviceKey;
@@ -194,11 +192,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Gets the properties on a device
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
/// <summary>
/// GetProperties method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the properties of the device</returns>
public static string GetProperties(string deviceObjectPath)
{
var obj = FindObjectOnPath(deviceObjectPath);
@@ -214,12 +209,9 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Gets a property from a device path by name
/// </summary>
/// <param name="deviceObjectPath"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
/// <summary>
/// GetPropertyByName method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <param name="propertyName">The name of the property to get</param>
/// <returns>The value of the property</returns>
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
{
var dev = FindObjectOnPath(deviceObjectPath);
@@ -243,11 +235,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Gets the methods on a device
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
/// <summary>
/// GetMethods method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the methods of the device</returns>
public static string GetMethods(string deviceObjectPath)
{
var obj = FindObjectOnPath(deviceObjectPath);
@@ -263,8 +252,10 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// GetApiMethods method
/// Gets the API methods on a device
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the API methods of the device</returns>
public static string GetApiMethods(string deviceObjectPath)
{
var obj = FindObjectOnPath(deviceObjectPath);
@@ -284,6 +275,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// FindObjectOnPath method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>The object found at the specified path</returns>
public static object FindObjectOnPath(string deviceObjectPath)
{
var path = deviceObjectPath.Split('.');
@@ -369,11 +362,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Sets a property on an object.
/// </summary>
/// <param name="deviceObjectPath"></param>
/// <returns></returns>
/// <summary>
/// SetProperty method
/// </summary>
/// <param name="deviceObjectPath">The path to the device object</param>
/// <returns>A JSON string representing the result of setting the property</returns>
public static string SetProperty(string deviceObjectPath)
{
throw new NotImplementedException("This could be really useful. Finish it please");
@@ -393,13 +383,21 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// Represents a DeviceActionWrapper
/// </summary>
public class DeviceActionWrapper
{
/// <summary>
/// Gets or sets the DeviceKey
/// </summary>
public string DeviceKey { get; set; }
/// <summary>
/// Gets or sets the MethodName
/// </summary>
public string MethodName { get; set; }
/// <summary>
/// Gets or sets the Params
/// </summary>
@@ -413,19 +411,25 @@ namespace PepperDash.Essentials.Core
{
private object Parent;
[JsonIgnore]
/// <summary>
/// Gets or sets the PropInfo
/// </summary>
[JsonIgnore]
public PropertyInfo PropInfo { get; private set; }
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get { return PropInfo.Name; } }
/// <summary>
/// Gets or sets the Type
/// </summary>
public string Type { get { return PropInfo.PropertyType.Name; } }
/// <summary>
/// Gets or sets the Value
/// </summary>
public string Value
{
get
@@ -450,12 +454,17 @@ namespace PepperDash.Essentials.Core
/// Gets or sets the CanRead
/// </summary>
public bool CanRead { get { return PropInfo.CanRead; } }
/// <summary>
/// Gets or sets the CanWrite
/// </summary>
public bool CanWrite { get { return PropInfo.CanWrite; } }
/// <summary>
/// PropertyNameType constructor
/// </summary>
/// <param name="info">property info</param>
/// <param name="parent">parent object</param>
public PropertyNameType(PropertyInfo info, object parent)
{
PropInfo = info;
@@ -468,16 +477,20 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class MethodNameParams
{
[JsonIgnore]
/// <summary>
/// Gets or sets the MethodInfo
/// </summary>
[JsonIgnore]
public MethodInfo MethodInfo { get; private set; }
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get { return MethodInfo.Name; } }
/// <summary>
/// Gets or sets the Params
/// </summary>
public IEnumerable<NameType> Params
{
get
@@ -487,6 +500,10 @@ namespace PepperDash.Essentials.Core
}
}
/// <summary>
/// MethodNameParams constructor
/// </summary>
/// <param name="info">method info</param>
public MethodNameParams(MethodInfo info)
{
MethodInfo = info;
@@ -508,10 +525,10 @@ namespace PepperDash.Essentials.Core
public string Type { get; set; }
}
[AttributeUsage(AttributeTargets.All)]
/// <summary>
/// Represents a ApiAttribute
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class ApiAttribute : Attribute
{

View File

@@ -13,16 +13,54 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class DisplayUiConstants
{
/// <summary>
/// TypeRadio constant
/// </summary>
public const uint TypeRadio = 1;
/// <summary>
/// TypeTv constant
/// </summary>
public const uint TypeDirecTv = 9;
/// <summary>
/// TypeBluray constant
/// </summary>
public const uint TypeBluray = 13;
/// <summary>
/// TypeStreamingDevice constant
/// </summary>
public const uint TypeChromeTv = 15;
/// <summary>
/// TypeStreamingDevice constant
/// </summary>
public const uint TypeFireTv = 16;
/// <summary>
/// TypeStreamingDevice constant
/// </summary>
public const uint TypeAppleTv = 17;
/// <summary>
/// TypeStreamingDevice constant
/// </summary>
public const uint TypeRoku = 18;
/// <summary>
/// TypeLaptop constant
/// </summary>
public const uint TypeLaptop = 31;
/// <summary>
/// TypePc constant
/// </summary>
public const uint TypePc = 32;
/// <summary>
/// TypeNoControls constant
/// </summary>
public const uint TypeNoControls = 49;
}
}

View File

@@ -2,6 +2,10 @@ using System.Collections.Generic;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// EssentialsPluginDevelopmentDeviceFactory class
/// </summary>
/// <typeparam name="T"></typeparam>
public abstract class EssentialsPluginDevelopmentDeviceFactory<T> : EssentialsDeviceFactory<T>, IPluginDevelopmentDeviceFactory where T : EssentialsDevice
{
/// <summary>

View File

@@ -31,6 +31,12 @@ namespace PepperDash.Essentials.Core.Devices
/// </summary>
public string[] IrCommands {get { return _port.IrFileCommands; }}
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key for the device</param>
/// <param name="name">name of the device</param>
/// <param name="irPort">IR output port controller</param>
public GenericIrController(string key, string name, IrOutputPortController irPort) : base(key, name)
{
_port = irPort;
@@ -105,9 +111,9 @@ namespace PepperDash.Essentials.Core.Devices
var joinNumber = bridgeJoin.Value.Value.JoinNumber;
Debug.LogMessage(LogEventLevel.Verbose, this, @"bridgeJoin: Key-'{0}'
Value.Key-'{1}'
Value.JoinNumber-'{2}'
Value.Metadata.Description-'{3}'",
Value.Key-'{1}'
Value.JoinNumber-'{2}'
Value.Metadata.Description-'{3}'",
key,
joinDataKey,
joinNumber,
@@ -172,6 +178,9 @@ Value.Metadata.Description-'{3}'",
/// </summary>
public class GenericIrControllerFactory : EssentialsDeviceFactory<GenericIrController>
{
/// <summary>
/// Constructor
/// </summary>
public GenericIrControllerFactory()
{
TypeNames = new List<string> {"genericIrController"};

View File

@@ -10,18 +10,28 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core.Devices
{
/// <summary>
/// Represents a GenericCommunicationMonitoredDevice
/// </summary>
/// <summary>
/// Represents a GenericCommunicationMonitoredDevice
/// </summary>
public class GenericCommunicationMonitoredDevice : Device, ICommunicationMonitor
{
IBasicCommunication Client;
/// <summary>
/// Gets or sets the CommunicationMonitor
/// </summary>
/// <summary>
/// Gets or sets the CommunicationMonitor
/// </summary>
public StatusMonitorBase CommunicationMonitor { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key of the device</param>
/// <param name="name">name of the device</param>
/// <param name="comm">communication client</param>
/// <param name="pollString">poll string</param>
/// <param name="pollTime">poll time</param>
/// <param name="warningTime">warning time</param>
/// <param name="errorTime">error time</param>
public GenericCommunicationMonitoredDevice(string key, string name, IBasicCommunication comm, string pollString,
long pollTime, long warningTime, long errorTime)
: base(key, name)
@@ -37,6 +47,13 @@ namespace PepperDash.Essentials.Core.Devices
}
/// <summary>
/// Constructor with default times
/// </summary>
/// <param name="key">key of the device</param>
/// <param name="name">name of the device</param>
/// <param name="comm">communication client</param>
/// <param name="pollString">poll string</param>
public GenericCommunicationMonitoredDevice(string key, string name, IBasicCommunication comm, string pollString)
: this(key, name, comm, pollString, 30000, 120000, 300000)
{

View File

@@ -6,16 +6,16 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// IAttachVideoStatusExtensions class
/// </summary>
public static class IAttachVideoStatusExtensions
{
/// <summary>
/// Gets the VideoStatusOutputs for the device
/// </summary>
/// <param name="attachDev"></param>
/// <param name="attachedDev"></param>
/// <returns>Attached VideoStatusOutputs or the default if none attached</returns>
/// <summary>
/// GetVideoStatuses method
/// </summary>
public static VideoStatusOutputs GetVideoStatuses(this IAttachVideoStatus attachedDev)
{
// See if this device is connected to a status-providing port

View File

@@ -5,6 +5,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IDisplayUsage
{
/// <summary>
/// Gets the LampHours
/// </summary>
IntFeedback LampHours { get; }
}
}

View File

@@ -8,8 +8,15 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IDspPresets
{
/// <summary>
/// Gets the Presets
/// </summary>
Dictionary<string, IKeyName> Presets { get; }
/// <summary>
/// Recalls the preset by key
/// </summary>
/// <param name="key">key of preset to recall</param>
void RecallPreset(string key);
}
}

View File

@@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IBasicVideoMute
{
/// <summary>
/// Toggles the video mute
/// </summary>
void VideoMuteToggle();
}
@@ -19,9 +22,19 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IBasicVideoMuteWithFeedback : IBasicVideoMute
{
/// <summary>
/// Gets the VideoMuteIsOn feedback
/// </summary>
BoolFeedback VideoMuteIsOn { get; }
/// <summary>
/// Sets the video mute on
/// </summary>
void VideoMuteOn();
/// <summary>
/// Sets the video mute off
/// </summary>
void VideoMuteOff();
}

View File

@@ -13,10 +13,20 @@ namespace PepperDash.Essentials.Core.Devices
/// </summary>
public interface IReconfigurableDevice
{
/// <summary>
/// Event fired when the configuration changes
/// </summary>
event EventHandler<EventArgs> ConfigChanged;
/// <summary>
/// Gets the current DeviceConfig
/// </summary>
DeviceConfig Config { get; }
/// <summary>
/// Sets the DeviceConfig
/// </summary>
/// <param name="config">config to set</param>
void SetConfig(DeviceConfig config);
}
}

View File

@@ -13,6 +13,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IUsageTracking
{
/// <summary>
/// Gets or sets the UsageTracker
/// </summary>
UsageTracking UsageTracker { get; set; }
}
@@ -29,6 +32,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class UsageTracking
{
/// <summary>
/// Event fired when device usage ends
/// </summary>
public event EventHandler<DeviceUsageEventArgs> DeviceUsageEnded;
/// <summary>
@@ -59,6 +65,10 @@ namespace PepperDash.Essentials.Core
/// </summary>
public Device Parent { get; private set; }
/// <summary>
/// Constructor for UsageTracking class
/// </summary>
/// <param name="parent">The parent device</param>
public UsageTracking(Device parent)
{
Parent = parent;

View File

@@ -26,10 +26,24 @@ namespace PepperDash.Essentials.Core
uint IrPortUid;
IROutputPort IrPort;
/// <summary>
/// Gets the DriverLoaded feedback
/// </summary>
public BoolFeedback DriverLoaded { get; private set; }
/// <summary>
/// Gets or sets the StandardIrPulseTime
/// </summary>
public ushort StandardIrPulseTime { get; set; }
/// <summary>
/// Gets or sets the DriverFilepath
/// </summary>
public string DriverFilepath { get; private set; }
/// <summary>
/// Gets or sets the DriverIsLoaded
/// </summary>
public bool DriverIsLoaded { get; private set; }
/// <summary>
@@ -37,9 +51,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
public string[] IrFileCommands { get { return IrPort.AvailableStandardIRCmds(IrPortUid); } }
/// <summary>
/// Gets or sets the UseBridgeJoinMap
/// </summary>
/// <summary>
/// Gets or sets the UseBridgeJoinMap
/// </summary>
public bool UseBridgeJoinMap { get; private set; }
/// <summary>
@@ -61,6 +75,12 @@ namespace PepperDash.Essentials.Core
LoadDriver(irDriverFilepath);
}
/// <summary>
/// Constructor for IrDevice base class using post activation function to get port
/// </summary>
/// <param name="key">key of the device</param>
/// <param name="postActivationFunc">function to call post activation</param>
/// <param name="config">config of the device</param>
public IrOutputPortController(string key, Func<DeviceConfig, IROutputPort> postActivationFunc,
DeviceConfig config)
: base(key)
@@ -105,9 +125,9 @@ namespace PepperDash.Essentials.Core
});
}
/// <summary>
/// PrintAvailableCommands method
/// </summary>
/// <summary>
/// PrintAvailableCommands method
/// </summary>
public void PrintAvailableCommands()
{
Debug.LogMessage(LogEventLevel.Verbose, this, "Available IR Commands in IR File {0}", IrPortUid);
@@ -121,10 +141,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Loads the IR driver at path
/// </summary>
/// <param name="path"></param>
/// <summary>
/// LoadDriver method
/// </summary>
/// <param name="path">path of the IR driver file</param>
public void LoadDriver(string path)
{
Debug.LogMessage(LogEventLevel.Verbose, this, "***Loading IR File***");
@@ -148,10 +165,12 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// PressRelease method
/// </summary>
/// <inheritdoc />
/// <summary>
/// PressRelease method
/// </summary>
/// <param name="command">IR command to send</param>
/// <param name="state">true to press, false to release</param>
/// <inheritdoc />
public virtual void PressRelease(string command, bool state)
{
Debug.LogMessage(LogEventLevel.Verbose, this, "IR:'{0}'={1}", command, state);
@@ -176,10 +195,12 @@ namespace PepperDash.Essentials.Core
IrPort.Release();
}
/// <summary>
/// Pulse method
/// </summary>
/// <inheritdoc />
/// <summary>
/// Pulse method
/// </summary>
/// <param name="command">IR command to send</param>
/// <param name="time">time to pulse the command</param>
/// <inheritdoc />
public virtual void Pulse(string command, ushort time)
{
if (IrPort == null)
@@ -201,6 +222,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Notifies the console when a bad command is used.
/// </summary>
/// <param name="command">command that was not found</param>
protected void NoIrCommandError(string command)
{
Debug.LogMessage(LogEventLevel.Verbose, this, "Device {0}: IR Driver {1} does not contain command {2}",

View File

@@ -8,12 +8,39 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IHasBatteryStats : IKeyName
{
/// <summary>
/// Gets the BatteryPercentage
/// </summary>
int BatteryPercentage { get; }
/// <summary>
/// Gets the BatteryCautionThresholdPercentage
/// </summary>
int BatteryCautionThresholdPercentage { get; }
/// <summary>
/// Gets the BatteryWarningThresholdPercentage
/// </summary>
int BatteryWarningThresholdPercentage { get; }
/// <summary>
/// Gets the BatteryIsWarningFeedback
/// </summary>
BoolFeedback BatteryIsWarningFeedback { get; }
/// <summary>
/// Gets the BatteryIsCautionFeedback
/// </summary>
BoolFeedback BatteryIsCautionFeedback { get; }
/// <summary>
/// Gets the BatteryIsOkFeedback
/// </summary>
BoolFeedback BatteryIsOkFeedback { get; }
/// <summary>
/// Gets the BatteryPercentageFeedback
/// </summary>
IntFeedback BatteryPercentageFeedback { get; }
}
@@ -22,6 +49,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IHasBatteryCharging : IHasBatteryStats
{
/// <summary>
/// Gets the BatteryIsCharging
/// </summary>
BoolFeedback BatteryIsCharging { get; }
}
@@ -30,19 +60,55 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IHasBatteries : IKeyName
{
/// <summary>
/// Collection of batteries
/// </summary>
ReadOnlyDictionary<string, IHasBatteryStats> Batteries { get; }
}
/// <summary>
/// Defines the contract for IHasBatteryStatsExtended
/// </summary>
public interface IHasBatteryStatsExtended : IHasBatteryStats
{
/// <summary>
/// Gets the InputVoltage in millivolts
/// </summary>
int InputVoltage { get; }
/// <summary>
/// Gets the OutputVoltage in millivolts
/// </summary>
int OutputVoltage { get; }
/// <summary>
/// Gets the InputCurrent in milliamps
/// </summary>
int InptuCurrent { get; }
/// <summary>
/// Gets the OutputCurrent in milliamps
/// </summary>
int OutputCurrent { get; }
/// <summary>
/// Gets the InputVoltageFeedback
/// </summary>
IntFeedback InputVoltageFeedback { get; }
/// <summary>
/// Gets the OutputVoltageFeedback
/// </summary>
IntFeedback OutputVoltageFeedback { get; }
/// <summary>
/// Gets the InputCurrentFeedback
/// </summary>
IntFeedback InputCurrentFeedback { get; }
/// <summary>
/// Gets the OutputCurrentFeedback
/// </summary>
IntFeedback OutputCurrentFeedback { get; }
}

View File

@@ -14,6 +14,34 @@ namespace PepperDash.Essentials.Core
/// </summary>
public enum PresentationSourceType
{
None, Dvd, Laptop, PC, SetTopBox, VCR
/// <summary>
/// No source type assigned
/// </summary>
None,
/// <summary>
/// DVD source type
/// </summary>
Dvd,
/// <summary>
/// Document Camera source type
/// </summary>
Laptop,
/// <summary>
/// PC source type
/// </summary>
PC,
/// <summary>
/// Set Top Box source type
/// </summary>
SetTopBox,
/// <summary>
/// VCR source type
/// </summary>
VCR
}
}

View File

@@ -14,6 +14,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class PresetListItem : AudioControlListItemBase
{
/// <summary>
/// Gets the preset associated with this list item
/// </summary>
[JsonIgnore]
public IKeyName Preset
{

View File

@@ -19,10 +19,20 @@ namespace PepperDash.Essentials.Core.Devices
/// </summary>
public abstract class ReconfigurableDevice : EssentialsDevice, IReconfigurableDevice
{
/// <summary>
/// Event fired when the configuration changes
/// </summary>
public event EventHandler<EventArgs> ConfigChanged;
/// <summary>
/// Gets the current DeviceConfig
/// </summary>
public DeviceConfig Config { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="config">config of the device</param>
protected ReconfigurableDevice(DeviceConfig config)
: base(config.Key)
{
@@ -64,19 +74,33 @@ namespace PepperDash.Essentials.Core.Devices
/// <summary>
/// Used by the extending class to allow for any custom actions to be taken (tell the ConfigWriter to write config, etc)
/// </summary>
/// <param name="config"></param>
/// <param name="config">config of the device</param>
protected virtual void CustomSetConfig(DeviceConfig config)
{
ConfigWriter.UpdateDeviceConfig(config);
}
}
/// <summary>
/// A ReconfigurableDevice that is also bridgeable
/// </summary>
public abstract class ReconfigurableBridgableDevice : ReconfigurableDevice, IBridgeAdvanced
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="config">config of the device</param>
protected ReconfigurableBridgableDevice(DeviceConfig config) : base(config)
{
}
/// <summary>
/// LinkToApi method
/// </summary>
/// <param name="trilist">trilist to link</param>
/// <param name="joinStart">the join to start at</param>
/// <param name="joinMapKey">key to the join map</param>
/// <param name="bridge">the bridge to use</param>
public abstract void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
}
}

View File

@@ -6,9 +6,19 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class SmartObjectJoinOffsets
{
/// <summary>
/// Dpad Join Offset
/// </summary>
public const ushort Dpad = 1;
/// <summary>
/// Numpad Join Offset
/// </summary>
public const ushort Numpad = 2;
/// <summary>
/// PresetList Join Offset
/// </summary>
public const ushort PresetList = 6;
}
}

View File

@@ -14,10 +14,27 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class VolumeDeviceChangeEventArgs : EventArgs
{
/// <summary>
/// The old device
/// </summary>
public IBasicVolumeControls OldDev { get; private set; }
/// <summary>
/// The new device
/// </summary>
public IBasicVolumeControls NewDev { get; private set; }
/// <summary>
/// The type of change
/// </summary>
public ChangeType Type { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="oldDev">the old device</param>
/// <param name="newDev">the new device</param>
/// <param name="type">the type of change</param>
public VolumeDeviceChangeEventArgs(IBasicVolumeControls oldDev, IBasicVolumeControls newDev, ChangeType type)
{
OldDev = oldDev;
@@ -31,6 +48,14 @@ namespace PepperDash.Essentials.Core
/// </summary>
public enum ChangeType
{
WillChange, DidChange
/// <summary>
/// Will change
/// </summary>
WillChange,
/// <summary>
/// Did change
/// </summary>
DidChange
}
}