wip: update XML comments

This commit is contained in:
Erik Meyer
2026-01-28 14:39:52 -05:00
parent 88feeaa5be
commit 92059aa43c
28 changed files with 786 additions and 132 deletions

View File

@@ -15,6 +15,10 @@ namespace PepperDash.Essentials.Core.Fusion
{ {
//public static Dictionary<int, ProcessorProgramItem> Programs { get; private set; } //public static Dictionary<int, ProcessorProgramItem> Programs { get; private set; }
/// <summary>
/// Gets the processor program registry
/// </summary>
/// <returns></returns>
public static Dictionary<int, ProcessorProgramItem> GetProcessorProgReg() public static Dictionary<int, ProcessorProgramItem> GetProcessorProgReg()
{ {
var programs = new Dictionary<int, ProcessorProgramItem>(); var programs = new Dictionary<int, ProcessorProgramItem>();

View File

@@ -17,18 +17,47 @@ namespace PepperDash.Essentials.Core.Fusion
/// </summary> /// </summary>
public class FusionRoomGuids public class FusionRoomGuids
{ {
/// <summary>
/// Gets or sets the RoomName
/// </summary>
public string RoomName { get; set; } public string RoomName { get; set; }
/// <summary>
/// Gets or sets the IpId
/// </summary>
public uint IpId { get; set; } public uint IpId { get; set; }
/// <summary>
/// Gets or sets the RoomGuid
/// </summary>
public string RoomGuid { get; set; } public string RoomGuid { get; set; }
/// <summary>
/// Gets or sets the OccupancyAsset
/// </summary>
public FusionOccupancySensorAsset OccupancyAsset { get; set; } public FusionOccupancySensorAsset OccupancyAsset { get; set; }
/// <summary>
/// Gets or sets the StaticAssets
/// </summary>
public Dictionary<int, FusionAsset> StaticAssets { get; set; } public Dictionary<int, FusionAsset> StaticAssets { get; set; }
/// <summary>
/// FusionRoomGuids constructor
/// </summary>
public FusionRoomGuids() public FusionRoomGuids()
{ {
StaticAssets = new Dictionary<int, FusionAsset>(); StaticAssets = new Dictionary<int, FusionAsset>();
OccupancyAsset = new FusionOccupancySensorAsset(); OccupancyAsset = new FusionOccupancySensorAsset();
} }
/// <summary>
/// FusionRoomGuids constructor
/// </summary>
/// <param name="roomName">name of the fusion room</param>
/// <param name="ipId">ipID of the fusion room</param>
/// <param name="roomGuid">room GUID</param>
/// <param name="staticAssets">dictionary of assets</param>
public FusionRoomGuids(string roomName, uint ipId, string roomGuid, Dictionary<int, FusionAsset> staticAssets) public FusionRoomGuids(string roomName, uint ipId, string roomGuid, Dictionary<int, FusionAsset> staticAssets)
{ {
RoomName = roomName; RoomName = roomName;
@@ -39,6 +68,14 @@ namespace PepperDash.Essentials.Core.Fusion
OccupancyAsset = new FusionOccupancySensorAsset(); OccupancyAsset = new FusionOccupancySensorAsset();
} }
/// <summary>
/// FusionRoomGuids constructor
/// </summary>
/// <param name="roomName">name of the fusion room</param>
/// <param name="ipId">ipID of the fusion room</param>
/// <param name="roomGuid">room GUID</param>
/// <param name="staticAssets">dictionary of assets</param>
/// <param name="occAsset">occupancy asset</param>
public FusionRoomGuids(string roomName, uint ipId, string roomGuid, Dictionary<int, FusionAsset> staticAssets, FusionOccupancySensorAsset occAsset) public FusionRoomGuids(string roomName, uint ipId, string roomGuid, Dictionary<int, FusionAsset> staticAssets, FusionOccupancySensorAsset occAsset)
{ {
RoomName = roomName; RoomName = roomName;
@@ -143,10 +180,17 @@ namespace PepperDash.Essentials.Core.Fusion
/// </summary> /// </summary>
public string InstanceId { get; set; } public string InstanceId { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public FusionOccupancySensorAsset() public FusionOccupancySensorAsset()
{ {
} }
/// <summary>
/// FusionOccupancySensorAsset constructor
/// </summary>
/// <param name="type">asset type</param>
public FusionOccupancySensorAsset(eAssetType type) public FusionOccupancySensorAsset(eAssetType type)
{ {
Type = type; Type = type;
@@ -177,11 +221,21 @@ namespace PepperDash.Essentials.Core.Fusion
/// </summary> /// </summary>
public string InstanceId { get;set; } public string InstanceId { get;set; }
/// <summary>
/// Default constructor
/// </summary>
public FusionAsset() public FusionAsset()
{ {
} }
/// <summary>
/// FusionAsset constructor
/// </summary>
/// <param name="slotNum">slot number of asset</param>
/// <param name="assetName">name of the asset</param>
/// <param name="type">type of the asset</param>
/// <param name="instanceId">instance ID of the asset</param>
public FusionAsset(uint slotNum, string assetName, string type, string instanceId) public FusionAsset(uint slotNum, string assetName, string type, string instanceId)
{ {
SlotNumber = slotNum; SlotNumber = slotNum;
@@ -210,6 +264,9 @@ namespace PepperDash.Essentials.Core.Fusion
/// </summary> /// </summary>
public List<Event> Meetings { get; set; } public List<Event> Meetings { get; set; }
/// <summary>
/// RoomSchedule constructor
/// </summary>
public RoomSchedule() public RoomSchedule()
{ {
Meetings = new List<Event>(); Meetings = new List<Event>();
@@ -224,6 +281,9 @@ namespace PepperDash.Essentials.Core.Fusion
/// </summary> /// </summary>
public class LocalTimeRequest public class LocalTimeRequest
{ {
/// <summary>
/// Gets or sets the RequestID
/// </summary>
public string RequestID { get; set; } public string RequestID { get; set; }
} }
@@ -238,13 +298,30 @@ namespace PepperDash.Essentials.Core.Fusion
/// Gets or sets the RequestID /// Gets or sets the RequestID
/// </summary> /// </summary>
public string RequestID { get; set; } public string RequestID { get; set; }
//[XmlElement(ElementName = "RoomID")] //[XmlElement(ElementName = "RoomID")]
/// <summary>
/// Gets or sets the RoomID
/// </summary>
public string RoomID { get; set; } public string RoomID { get; set; }
//[XmlElement(ElementName = "Start")] //[XmlElement(ElementName = "Start")]
/// <summary>
/// Gets or sets the Start
/// </summary>
public DateTime Start { get; set; } public DateTime Start { get; set; }
//[XmlElement(ElementName = "HourSpan")] //[XmlElement(ElementName = "HourSpan")]
/// <summary>
/// Gets or sets the HourSpan
/// </summary>
public double HourSpan { get; set; } public double HourSpan { get; set; }
/// <summary>
/// RequestSchedule constructor
/// </summary>
/// <param name="requestID">id of the request</param>
/// <param name="roomID">id of the room</param>
public RequestSchedule(string requestID, string roomID) public RequestSchedule(string requestID, string roomID)
{ {
RequestID = requestID; RequestID = requestID;
@@ -282,6 +359,12 @@ namespace PepperDash.Essentials.Core.Fusion
/// </summary> /// </summary>
public List<Parameter> Parameters { get; set; } public List<Parameter> Parameters { get; set; }
/// <summary>
/// RequestAction constructor
/// </summary>
/// <param name="roomID">id of the room</param>
/// <param name="actionID">id of the action</param>
/// <param name="parameters">list of parameters</param>
public RequestAction(string roomID, string actionID, List<Parameter> parameters) public RequestAction(string roomID, string actionID, List<Parameter> parameters)
{ {
RoomID = roomID; RoomID = roomID;
@@ -301,11 +384,13 @@ namespace PepperDash.Essentials.Core.Fusion
/// Gets or sets the RequestID /// Gets or sets the RequestID
/// </summary> /// </summary>
public string RequestID { get; set; } public string RequestID { get; set; }
//[XmlElement(ElementName = "ActionID")] //[XmlElement(ElementName = "ActionID")]
/// <summary> /// <summary>
/// Gets or sets the ActionID /// Gets or sets the ActionID
/// </summary> /// </summary>
public string ActionID { get; set; } public string ActionID { get; set; }
//[XmlElement(ElementName = "Parameters")] //[XmlElement(ElementName = "Parameters")]
/// <summary> /// <summary>
/// Gets or sets the Parameters /// Gets or sets the Parameters
@@ -324,6 +409,7 @@ namespace PepperDash.Essentials.Core.Fusion
/// Gets or sets the ID /// Gets or sets the ID
/// </summary> /// </summary>
public string ID { get; set; } public string ID { get; set; }
//[XmlAttribute(AttributeName = "Value")] //[XmlAttribute(AttributeName = "Value")]
/// <summary> /// <summary>
/// Gets or sets the Value /// Gets or sets the Value
@@ -345,14 +431,32 @@ namespace PepperDash.Essentials.Core.Fusion
public class ScheduleResponse public class ScheduleResponse
{ {
//[XmlElement(ElementName = "RequestID")] //[XmlElement(ElementName = "RequestID")]
/// <summary>
/// Gets or sets the RequestID
/// </summary>
public string RequestID { get; set; } public string RequestID { get; set; }
//[XmlElement(ElementName = "RoomID")] //[XmlElement(ElementName = "RoomID")]
/// <summary>
/// Gets or sets the RoomID
/// </summary>
public string RoomID { get; set; } public string RoomID { get; set; }
//[XmlElement(ElementName = "RoomName")] //[XmlElement(ElementName = "RoomName")]
/// <summary>
/// Gets or sets the RoomName
/// </summary>
public string RoomName { get; set; } public string RoomName { get; set; }
//[XmlElement("Event")] //[XmlElement("Event")]
/// <summary>
/// Gets or sets the Events
/// </summary>
public List<Event> Events { get; set; } public List<Event> Events { get; set; }
/// <summary>
/// ScheduleResponse constructor
/// </summary>
public ScheduleResponse() public ScheduleResponse()
{ {
Events = new List<Event>(); Events = new List<Event>();

View File

@@ -22,6 +22,9 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
/// <summary>
/// Global static class for Essentials
/// </summary>
public static class Global public static class Global
{ {
/// <summary> /// <summary>
@@ -34,6 +37,9 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public static eDevicePlatform Platform { get { return CrestronEnvironment.DevicePlatform; } } public static eDevicePlatform Platform { get { return CrestronEnvironment.DevicePlatform; } }
/// <summary>
/// Gets the collection of Ethernet Adapter Info
/// </summary>
public static Dictionary<short, EthernetAdapterInfo> EthernetAdapterInfoCollection { get; private set; } public static Dictionary<short, EthernetAdapterInfo> EthernetAdapterInfoCollection { get; private set; }
/// <summary> /// <summary>
@@ -47,6 +53,9 @@ namespace PepperDash.Essentials.Core
public static eCrestronSeries ProcessorSeries { get { return CrestronEnvironment.ProgramCompatibility; } } public static eCrestronSeries ProcessorSeries { get { return CrestronEnvironment.ProgramCompatibility; } }
// TODO: consider making this configurable later // TODO: consider making this configurable later
/// <summary>
/// The CultureInfo for formatting
/// </summary>
public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US"); public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US");
/// <summary> /// <summary>
@@ -182,6 +191,13 @@ namespace PepperDash.Essentials.Core
AssemblyVersion = assemblyVersion; AssemblyVersion = assemblyVersion;
} }
/// <summary>
/// Checks to see if the running version is in the list of development versions. If so, checks to see if it meets the minimum version requirement.
/// If not in the list, returns false. For beta versions (0.xx.yy), will always return true.
/// </summary>
/// <param name="developmentVersions">list of development versions</param>
/// <param name="minimumVersion">minimum version</param>
/// <returns></returns>
public static bool IsRunningDevelopmentVersion(List<string> developmentVersions, string minimumVersion) public static bool IsRunningDevelopmentVersion(List<string> developmentVersions, string minimumVersion)
{ {
if (Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*").Groups[1].Value == "0") if (Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*").Groups[1].Value == "0")

View File

@@ -6,6 +6,9 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
/// <summary>
/// Represents a JobTimer
/// </summary>
public static class JobTimer public static class JobTimer
{ {
static CTimer MinuteTimer; static CTimer MinuteTimer;
@@ -13,25 +16,18 @@ namespace PepperDash.Essentials.Core
static List<JobTimerItem> Items = new List<JobTimerItem>(); static List<JobTimerItem> Items = new List<JobTimerItem>();
/// <summary> /// <summary>
/// /// AddAction method
/// </summary> /// </summary>
/// <param name="act"></param> /// <param name="act">action to add</param>
/// <summary>
/// AddAction method
/// </summary>
public static void AddAction(Action act) public static void AddAction(Action act)
{ {
} }
/// <summary> /// <summary>
/// /// AddJobTimerItem method
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="item">JobTimerItem to add</param>
/// <param name="act"></param>
/// <summary>
/// AddJobTimerItem method
/// </summary>
public static void AddJobTimerItem(JobTimerItem item) public static void AddJobTimerItem(JobTimerItem item)
{ {
var existing = Items.FirstOrDefault(i => i.Key == item.Key); var existing = Items.FirstOrDefault(i => i.Key == item.Key);
@@ -62,25 +58,61 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public class JobTimerItem public class JobTimerItem
{ {
public string Key { get; private set; }
public Action JobAction { get; private set; }
public eJobTimerCycleTypes CycleType { get; private set; }
/// <summary> /// <summary>
/// /// Key property
/// </summary>
public string Key { get; private set; }
/// <summary>
/// JobAction property
/// </summary>
public Action JobAction { get; private set; }
/// <summary>
/// CycleType property
/// </summary>
public eJobTimerCycleTypes CycleType { get; private set; }
/// <summary>
/// RunNextAt property
/// </summary> /// </summary>
public DateTime RunNextAt { get; set; } public DateTime RunNextAt { get; set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">item key</param>
/// <param name="cycle">cycle type</param>
/// <param name="act">action to run</param>
public JobTimerItem(string key, eJobTimerCycleTypes cycle, Action act) public JobTimerItem(string key, eJobTimerCycleTypes cycle, Action act)
{ {
} }
} }
/// <summary>
/// JobTimerCycleTypes enum
/// </summary>
public enum eJobTimerCycleTypes public enum eJobTimerCycleTypes
{ {
/// <summary>
/// RunEveryDay property
/// </summary>
RunEveryDay, RunEveryDay,
/// <summary>
/// RunEveryHour property
/// </summary>
RunEveryHour, RunEveryHour,
/// <summary>
/// RunEveryHalfHour property
/// </summary>
RunEveryHalfHour, RunEveryHalfHour,
/// <summary>
/// RunEveryMinute property
/// </summary>
RunEveryMinute RunEveryMinute
} }
} }

View File

@@ -138,6 +138,11 @@ Recurrence Days: {evt.Value.Recurrence.RecurrenceDays}
EventGroups.Remove(eventGroup.Name); EventGroups.Remove(eventGroup.Name);
} }
/// <summary>
/// Gets the event group by key
/// </summary>
/// <param name="key">key of the event group</param>
/// <returns></returns>
public static ScheduledEventGroup GetEventGroup(string key) public static ScheduledEventGroup GetEventGroup(string key)
{ {
ScheduledEventGroup returnValue; ScheduledEventGroup returnValue;
@@ -146,6 +151,9 @@ Recurrence Days: {evt.Value.Recurrence.RecurrenceDays}
} }
} }
/// <summary>
/// SchedulerUtilities class
/// </summary>
public static class SchedulerUtilities public static class SchedulerUtilities
{ {
/// <summary> /// <summary>

View File

@@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public interface IInUseTracking public interface IInUseTracking
{ {
/// <summary>
/// Gets the InUseTracker
/// </summary>
InUseTracking InUseTracker { get; } InUseTracking InUseTracker { get; }
} }
} }

View File

@@ -28,6 +28,9 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public IntFeedback InUseCountFeedback { get; private set; } public IntFeedback InUseCountFeedback { get; private set; }
/// <summary>
/// Constructor
/// </summary>
public InUseTracking() public InUseTracking()
{ {
InUseFeedback = new BoolFeedback(() => _Users.Count > 0); InUseFeedback = new BoolFeedback(() => _Users.Count > 0);
@@ -39,9 +42,7 @@ namespace PepperDash.Essentials.Core
/// multiple times, provided that the label is different /// multiple times, provided that the label is different
/// </summary> /// </summary>
/// <param name="label">A label to identify the instance of the user. Treated like a "role", etc.</param> /// <param name="label">A label to identify the instance of the user. Treated like a "role", etc.</param>
/// <summary> /// <param name="objectToAdd">The object to add</param>
/// AddUser method
/// </summary>
public void AddUser(object objectToAdd, string label) public void AddUser(object objectToAdd, string label)
{ {
// check if an exact object/label pair exists and ignore if so. No double-registers. // check if an exact object/label pair exists and ignore if so. No double-registers.
@@ -56,9 +57,11 @@ namespace PepperDash.Essentials.Core
InUseCountFeedback.FireUpdate(); InUseCountFeedback.FireUpdate();
} }
/// <summary> /// <summary>
/// RemoveUser method /// RemoveUser method
/// </summary> /// </summary>
/// <param name="label">The label of the user to remove</param>
/// <param name="objectToRemove">The object to remove</param>
public void RemoveUser(object objectToRemove, string label) public void RemoveUser(object objectToRemove, string label)
{ {
// Find the user object if exists and remove it // Find the user object if exists and remove it
@@ -73,14 +76,26 @@ namespace PepperDash.Essentials.Core
} }
} }
/// <summary> /// <summary>
/// Represents a InUseTrackingObject /// Represents a InUseTrackingObject
/// </summary> /// </summary>
public class InUseTrackingObject public class InUseTrackingObject
{ {
/// <summary>
/// The label of the user
/// </summary>
public string Label { get; private set; } public string Label { get; private set; }
/// <summary>
/// The user object
/// </summary>
public object User { get; private set; } public object User { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="user">user using the object</param>
/// <param name="label">label for the object</param>
public InUseTrackingObject(object user, string label) public InUseTrackingObject(object user, string label)
{ {
User = user; User = user;

View File

@@ -17,6 +17,9 @@ using Serilog.Events;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
/// <summary>
/// JoinMapHelper class
/// </summary>
public static class JoinMapHelper public static class JoinMapHelper
{ {
/// <summary> /// <summary>
@@ -93,6 +96,9 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public abstract class JoinMapBaseAdvanced public abstract class JoinMapBaseAdvanced
{ {
/// <summary>
/// The join offset
/// </summary>
protected uint JoinOffset; protected uint JoinOffset;
/// <summary> /// <summary>
@@ -100,6 +106,10 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public Dictionary<string, JoinDataComplete> Joins { get; private set; } public Dictionary<string, JoinDataComplete> Joins { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="joinStart">join start offset</param>
protected JoinMapBaseAdvanced(uint joinStart) protected JoinMapBaseAdvanced(uint joinStart)
{ {
Joins = new Dictionary<string, JoinDataComplete>(); Joins = new Dictionary<string, JoinDataComplete>();
@@ -107,11 +117,20 @@ namespace PepperDash.Essentials.Core
JoinOffset = joinStart - 1; JoinOffset = joinStart - 1;
} }
/// <summary>
/// Constructor
/// </summary>
/// <param name="joinStart">join start offset</param>
/// <param name="type">type of joinstart</param>
protected JoinMapBaseAdvanced(uint joinStart, Type type):this(joinStart) protected JoinMapBaseAdvanced(uint joinStart, Type type):this(joinStart)
{ {
AddJoins(type); AddJoins(type);
} }
/// <summary>
/// AddJoins method
/// </summary>
/// <param name="type">type of join to add</param>
protected void AddJoins(Type type) protected void AddJoins(Type type)
{ {
var fields = var fields =
@@ -303,18 +322,11 @@ namespace PepperDash.Essentials.Core
PrintJoinMapInfo(); PrintJoinMapInfo();
} }
/// <summary> // /// <summary>
/// Returns the join span for the join with the specified key // /// Returns the join span for the join with the specified key
/// </summary> // /// </summary>
/// <param name="key"></param> // /// <param name="key"></param>
/// <returns></returns> // /// <returns></returns>
/// <summary>
/// Returns the join span for the join with the specified key
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
//public uint GetJoinSpanForKey(string key) //public uint GetJoinSpanForKey(string key)
//{ //{
// return Joins.ContainsKey(key) ? Joins[key].JoinSpan : 0; // return Joins.ContainsKey(key) ? Joins[key].JoinSpan : 0;
@@ -328,28 +340,86 @@ namespace PepperDash.Essentials.Core
[Flags] [Flags]
public enum eJoinCapabilities public enum eJoinCapabilities
{ {
/// <summary>
/// No capabilities
/// </summary>
None = 0, None = 0,
/// <summary>
/// To SIMPL
/// </summary>
ToSIMPL = 1, ToSIMPL = 1,
/// <summary>
/// From SIMPL
/// </summary>
FromSIMPL = 2, FromSIMPL = 2,
/// <summary>
/// To and From SIMPL
/// </summary>
ToFromSIMPL = ToSIMPL | FromSIMPL, ToFromSIMPL = ToSIMPL | FromSIMPL,
/// <summary>
/// To Fusion
/// </summary>
ToFusion = 4, ToFusion = 4,
/// <summary>
/// From Fusion
/// </summary>
FromFusion = 8, FromFusion = 8,
/// <summary>
/// To and From Fusion
/// </summary>
ToFromFusion = ToFusion | FromFusion, ToFromFusion = ToFusion | FromFusion,
} }
[Flags]
/// <summary> /// <summary>
/// Enumeration of eJoinType values /// Enumeration of eJoinType values
/// </summary> /// </summary>
[Flags]
public enum eJoinType public enum eJoinType
{ {
/// <summary>
/// No join type
/// </summary>
None = 0, None = 0,
/// <summary>
/// Digital join
/// </summary>
Digital = 1, Digital = 1,
/// <summary>
/// Analog join
/// </summary>
Analog = 2, Analog = 2,
/// <summary>
/// Serial join
/// </summary>
Serial = 4, Serial = 4,
/// <summary>
/// Digital and Analog join
/// </summary>
DigitalAnalog = Digital | Analog, DigitalAnalog = Digital | Analog,
/// <summary>
/// Digital and Serial join
/// </summary>
DigitalSerial = Digital | Serial, DigitalSerial = Digital | Serial,
/// <summary>
/// Analog and Serial join
/// </summary>
AnalogSerial = Analog | Serial, AnalogSerial = Analog | Serial,
/// <summary>
/// Digital, Analog and Serial join
/// </summary>
DigitalAnalogSerial = Digital | Analog | Serial, DigitalAnalogSerial = Digital | Analog | Serial,
} }
@@ -364,29 +434,23 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
[JsonProperty("description")] [JsonProperty("description")]
public string Description { get { return _description; } set { _description = value; } } public string Description { get { return _description; } set { _description = value; } }
/// <summary>
/// Signal type(s)
/// </summary>
[JsonProperty("joinType")]
/// <summary> /// <summary>
/// Gets or sets the JoinType /// Gets or sets the JoinType
/// </summary> /// </summary>
[JsonProperty("joinType")]
public eJoinType JoinType { get; set; } public eJoinType JoinType { get; set; }
/// <summary>
/// Indicates whether the join is read and/or write
/// </summary>
[JsonProperty("joinCapabilities")]
/// <summary> /// <summary>
/// Gets or sets the JoinCapabilities /// Gets or sets the JoinCapabilities
/// </summary> /// </summary>
[JsonProperty("joinCapabilities")]
public eJoinCapabilities JoinCapabilities { get; set; } public eJoinCapabilities JoinCapabilities { get; set; }
/// <summary>
/// Indicates a set of valid values (particularly if this translates to an enum
/// </summary>
[JsonProperty("validValues")]
/// <summary> /// <summary>
/// Gets or sets the ValidValues /// Gets or sets the ValidValues
/// </summary> /// </summary>
[JsonProperty("validValues")]
public string[] ValidValues { get; set; } public string[] ValidValues { get; set; }
} }
@@ -401,18 +465,17 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
[JsonProperty("joinNumber")] [JsonProperty("joinNumber")]
public uint JoinNumber { get; set; } public uint JoinNumber { get; set; }
/// <summary> /// <summary>
/// Join range span. If join indicates the start of a range of joins, this indicated the maximum number of joins in the range /// Join range span. If join indicates the start of a range of joins, this indicated the maximum number of joins in the range
/// </summary> /// </summary>
[JsonProperty("joinSpan")] [JsonProperty("joinSpan")]
public uint JoinSpan { get; set; } public uint JoinSpan { get; set; }
/// <summary>
/// Fusion Attribute Name (optional)
/// </summary>
[JsonProperty("attributeName")]
/// <summary> /// <summary>
/// Gets or sets the AttributeName /// Gets or sets the AttributeName
/// </summary> /// </summary>
[JsonProperty("attributeName")]
public string AttributeName { get; set; } public string AttributeName { get; set; }
} }
@@ -424,18 +487,34 @@ namespace PepperDash.Essentials.Core
private uint _joinOffset; private uint _joinOffset;
private JoinData _data; private JoinData _data;
/// <summary>
/// Gets or sets the JoinMetadata
/// </summary>
public JoinMetadata Metadata { get; set; } public JoinMetadata Metadata { get; set; }
/// <summary> /// <summary>
/// To store some future information as you please /// To store some future information as you please
/// </summary> /// </summary>
public object UserObject { get; private set; } public object UserObject { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="data"></param>
/// <param name="metadata"></param>
public JoinDataComplete(JoinData data, JoinMetadata metadata) public JoinDataComplete(JoinData data, JoinMetadata metadata)
{ {
_data = data; _data = data;
Metadata = metadata; Metadata = metadata;
} }
/// <summary>
/// GetMarkdownFormattedData method
/// </summary>
/// <param name="stringFormatter">formatter to use</param>
/// <param name="descriptionLen">length of the description</param>
/// <returns></returns>
public string GetMarkdownFormattedData(string stringFormatter, int descriptionLen) public string GetMarkdownFormattedData(string stringFormatter, int descriptionLen)
{ {
@@ -498,9 +577,6 @@ namespace PepperDash.Essentials.Core
/// Sets the join offset value /// Sets the join offset value
/// </summary> /// </summary>
/// <param name="joinOffset"></param> /// <param name="joinOffset"></param>
/// <summary>
/// SetJoinOffset method
/// </summary>
public void SetJoinOffset(uint joinOffset) public void SetJoinOffset(uint joinOffset)
{ {
_joinOffset = joinOffset; _joinOffset = joinOffset;
@@ -515,11 +591,17 @@ namespace PepperDash.Essentials.Core
set { _data.JoinNumber = value; } set { _data.JoinNumber = value; }
} }
/// <summary>
/// The join span
/// </summary>
public uint JoinSpan public uint JoinSpan
{ {
get { return _data.JoinSpan; } get { return _data.JoinSpan; }
} }
/// <summary>
/// The attribute name
/// </summary>
public string AttributeName public string AttributeName
{ {
get { return _data.AttributeName; } get { return _data.AttributeName; }
@@ -551,20 +633,27 @@ namespace PepperDash.Essentials.Core
[AttributeUsage(AttributeTargets.All)]
/// <summary> /// <summary>
/// Represents a JoinNameAttribute /// Represents a JoinNameAttribute
/// </summary> /// </summary>
[AttributeUsage(AttributeTargets.All)]
public class JoinNameAttribute : Attribute public class JoinNameAttribute : Attribute
{ {
private string _Name; private string _Name;
/// <summary>
/// Constructor
/// </summary>
/// <param name="name">name of the attribute</param>
public JoinNameAttribute(string name) public JoinNameAttribute(string name)
{ {
Debug.LogMessage(LogEventLevel.Verbose, "Setting Attribute Name: {0}",null, name); Debug.LogMessage(LogEventLevel.Verbose, "Setting Attribute Name: {0}",null, name);
_Name = name; _Name = name;
} }
/// <summary>
/// Gets the Name
/// </summary>
public string Name public string Name
{ {
get { return _Name; } get { return _Name; }

View File

@@ -8,12 +8,25 @@ namespace PepperDash.Essentials.Core.Lighting
/// </summary> /// </summary>
public interface ILightingScenes public interface ILightingScenes
{ {
/// <summary>
/// Fires when the lighting scene changes
/// </summary>
event EventHandler<LightingSceneChangeEventArgs> LightingSceneChange; event EventHandler<LightingSceneChangeEventArgs> LightingSceneChange;
/// <summary>
/// Gets the list of LightingScenes
/// </summary>
List<LightingScene> LightingScenes { get; } List<LightingScene> LightingScenes { get; }
/// <summary>
/// Selects the given LightingScene
/// </summary>
/// <param name="scene">scene to select</param>
void SelectScene(LightingScene scene); void SelectScene(LightingScene scene);
/// <summary>
/// Gets the currently selected LightingScene
/// </summary>
LightingScene CurrentLightingScene { get; } LightingScene CurrentLightingScene { get; }
} }
@@ -23,6 +36,9 @@ namespace PepperDash.Essentials.Core.Lighting
/// </summary> /// </summary>
public interface ILightingScenesDynamic : ILightingScenes public interface ILightingScenesDynamic : ILightingScenes
{ {
/// <summary>
/// Fires when the lighting scenes are updated
/// </summary>
event EventHandler LightingScenesUpdated; event EventHandler LightingScenesUpdated;
} }
@@ -31,8 +47,19 @@ namespace PepperDash.Essentials.Core.Lighting
/// </summary> /// </summary>
public interface ILightingMasterRaiseLower public interface ILightingMasterRaiseLower
{ {
/// <summary>
/// Raises the master level
/// </summary>
void MasterRaise(); void MasterRaise();
/// <summary>
/// Lowers the master level
/// </summary>
void MasterLower(); void MasterLower();
/// <summary>
/// Stops raising or lowering the master level
/// </summary>
void MasterRaiseLowerStop(); void MasterRaiseLowerStop();
} }
@@ -41,11 +68,30 @@ namespace PepperDash.Essentials.Core.Lighting
/// </summary> /// </summary>
public interface ILightingLoad public interface ILightingLoad
{ {
/// <summary>
/// Sets the load level
/// </summary>
/// <param name="level">level to set</param>
void SetLoadLevel(int level); void SetLoadLevel(int level);
/// <summary>
/// Raises the load level
/// </summary>
void Raise(); void Raise();
/// <summary>
/// Lowers the load level
/// </summary>
void Lower(); void Lower();
/// <summary>
/// feedback of the current load level
/// </summary>
IntFeedback LoadLevelFeedback { get; } IntFeedback LoadLevelFeedback { get; }
/// <summary>
/// feedback of whether the load is on
/// </summary>
BoolFeedback LoadIsOnFeedback { get; } BoolFeedback LoadIsOnFeedback { get; }
} }
@@ -59,6 +105,10 @@ namespace PepperDash.Essentials.Core.Lighting
/// </summary> /// </summary>
public LightingScene CurrentLightingScene { get; private set; } public LightingScene CurrentLightingScene { get; private set; }
/// <summary>
/// Constructor for LightingSceneChangeEventArgs
/// </summary>
/// <param name="scene">The lighting scene that changed</param>
public LightingSceneChangeEventArgs(LightingScene scene) public LightingSceneChangeEventArgs(LightingScene scene)
{ {
CurrentLightingScene = scene; CurrentLightingScene = scene;

View File

@@ -10,17 +10,23 @@ namespace PepperDash.Essentials.Core.Lighting
/// </summary> /// </summary>
public class LightingScene public class LightingScene
{ {
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
/// <summary> /// <summary>
/// Gets or sets the Name /// Gets or sets the Name
/// </summary> /// </summary>
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
/// <summary> /// <summary>
/// Gets or sets the ID /// Gets or sets the ID
/// </summary> /// </summary>
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
public string ID { get; set; } public string ID { get; set; }
bool _IsActive; bool _IsActive;
/// <summary>
/// Gets or sets whether the scene is active
/// </summary>
[JsonProperty("isActive", NullValueHandling = NullValueHandling.Ignore)] [JsonProperty("isActive", NullValueHandling = NullValueHandling.Ignore)]
public bool IsActive public bool IsActive
{ {
@@ -35,18 +41,22 @@ namespace PepperDash.Essentials.Core.Lighting
} }
} }
[JsonProperty("sortOrder", NullValueHandling = NullValueHandling.Ignore)]
/// <summary> /// <summary>
/// Gets or sets the SortOrder /// Gets or sets the SortOrder
/// </summary> /// </summary>
[JsonProperty("sortOrder", NullValueHandling = NullValueHandling.Ignore)]
public int SortOrder { get; set; } public int SortOrder { get; set; }
[JsonIgnore]
/// <summary> /// <summary>
/// Gets or sets the IsActiveFeedback /// Gets or sets the IsActiveFeedback
/// </summary> /// </summary>
[JsonIgnore]
public BoolFeedback IsActiveFeedback { get; set; } public BoolFeedback IsActiveFeedback { get; set; }
/// <summary>
/// Constructor for LightingScene
/// </summary>
public LightingScene() public LightingScene()
{ {
IsActiveFeedback = new BoolFeedback(new Func<bool>(() => IsActive)); IsActiveFeedback = new BoolFeedback(new Func<bool>(() => IsActive));

View File

@@ -23,6 +23,9 @@ namespace PepperDash.Essentials.Core.Privacy
bool initialized; bool initialized;
/// <summary>
/// Gets or sets whether LED control is enabled
/// </summary>
public bool EnableLeds public bool EnableLeds
{ {
get get
@@ -69,6 +72,11 @@ namespace PepperDash.Essentials.Core.Privacy
/// </summary> /// </summary>
public IPrivacy PrivacyDevice { get; private set; } public IPrivacy PrivacyDevice { get; private set; }
/// <summary>
/// Constructor for MicrophonePrivacyController
/// </summary>
/// <param name="key">key of the controller device</param>
/// <param name="config">configuration for the controller device</param>
public MicrophonePrivacyController(string key, MicrophonePrivacyControllerConfig config) : public MicrophonePrivacyController(string key, MicrophonePrivacyControllerConfig config) :
base(key) base(key)
{ {
@@ -264,6 +272,9 @@ namespace PepperDash.Essentials.Core.Privacy
/// </summary> /// </summary>
public class MicrophonePrivacyControllerFactory : EssentialsDeviceFactory<MicrophonePrivacyController> public class MicrophonePrivacyControllerFactory : EssentialsDeviceFactory<MicrophonePrivacyController>
{ {
/// <summary>
/// Constructor for MicrophonePrivacyControllerFactory
/// </summary>
public MicrophonePrivacyControllerFactory() public MicrophonePrivacyControllerFactory()
{ {
TypeNames = new List<string>() { "microphoneprivacycontroller" }; TypeNames = new List<string>() { "microphoneprivacycontroller" };

View File

@@ -20,6 +20,13 @@ namespace PepperDash.Essentials.Core
{ {
GenericBase Device; GenericBase Device;
/// <summary>
/// Constructor for CrestronGenericBaseCommunicationMonitor
/// </summary>
/// <param name="parent">parent device</param>
/// <param name="device">device to monitor</param>
/// <param name="warningTime">time before warning status</param>
/// <param name="errorTime">time before error status</param>
public CrestronGenericBaseCommunicationMonitor(IKeyed parent, GenericBase device, long warningTime, long errorTime) public CrestronGenericBaseCommunicationMonitor(IKeyed parent, GenericBase device, long warningTime, long errorTime)
: base(parent, warningTime, errorTime) : base(parent, warningTime, errorTime)
{ {

View File

@@ -12,6 +12,9 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public class GenericCommunicationMonitor : StatusMonitorBase public class GenericCommunicationMonitor : StatusMonitorBase
{ {
/// <summary>
/// Gets the Client being monitored
/// </summary>
public IBasicCommunication Client { get; private set; } public IBasicCommunication Client { get; private set; }
/// <summary> /// <summary>
@@ -281,17 +284,29 @@ namespace PepperDash.Essentials.Core
} }
} }
/// <summary> /// <summary>
/// Represents a CommunicationMonitorConfig /// Represents a CommunicationMonitorConfig
/// </summary> /// </summary>
public class CommunicationMonitorConfig public class CommunicationMonitorConfig
{ {
/// <summary> /// <summary>
/// Gets or sets the PollInterval /// Gets or sets the PollInterval
/// </summary> /// </summary>
public int PollInterval { get; set; } public int PollInterval { get; set; }
/// <summary>
/// Gets or sets the TimeToWarning
/// </summary>
public int TimeToWarning { get; set; } public int TimeToWarning { get; set; }
/// <summary>
/// Gets or sets the TimeToError
/// </summary>
public int TimeToError { get; set; } public int TimeToError { get; set; }
/// <summary>
/// Gets or sets the PollString
/// </summary>
public string PollString { get; set; } public string PollString { get; set; }
/// <summary> /// <summary>

View File

@@ -11,12 +11,39 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public interface IStatusMonitor public interface IStatusMonitor
{ {
/// <summary>
/// Gets the Parent
/// </summary>
IKeyed Parent { get; } IKeyed Parent { get; }
/// <summary>
/// Fires when the status changes
/// </summary>
event EventHandler<MonitorStatusChangeEventArgs> StatusChange; event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
/// <summary>
/// Gets the Status
/// </summary>
MonitorStatus Status { get; } MonitorStatus Status { get; }
/// <summary>
/// Gets the Message
/// </summary>
string Message { get; } string Message { get; }
/// <summary>
/// Gets or sets the IsOnlineFeedback
/// </summary>
BoolFeedback IsOnlineFeedback { get; set; } BoolFeedback IsOnlineFeedback { get; set; }
/// <summary>
/// Start method
/// </summary>
void Start(); void Start();
/// <summary>
/// Stop method
/// </summary>
void Stop(); void Stop();
} }
@@ -26,6 +53,9 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public interface ICommunicationMonitor public interface ICommunicationMonitor
{ {
/// <summary>
/// Gets the CommunicationMonitor
/// </summary>
StatusMonitorBase CommunicationMonitor { get; } StatusMonitorBase CommunicationMonitor { get; }
} }
@@ -34,29 +64,57 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public enum MonitorStatus public enum MonitorStatus
{ {
/// <summary>
/// Status Unknown
/// </summary>
StatusUnknown = 0, StatusUnknown = 0,
IsOk = 1,
InWarning = 2, /// <summary>
/// Is Ok
/// </summary>
IsOk = 1,
/// <summary>
/// In Warning
/// </summary>
InWarning = 2,
/// <summary>
/// In Error
/// </summary>
InError = 3 InError = 3
} }
/// <summary>
/// Represents a MonitorStatusChangeEventArgs
/// </summary>
public class MonitorStatusChangeEventArgs : EventArgs public class MonitorStatusChangeEventArgs : EventArgs
{ {
/// <summary> /// <summary>
/// Gets or sets the Status /// Gets or sets the Status
/// </summary> /// </summary>
public MonitorStatus Status { get; private set; } public MonitorStatus Status { get; private set; }
/// <summary>
/// Gets or sets the Message /// <summary>
/// </summary> /// Gets or sets the Message
/// </summary>
public string Message { get; private set; } public string Message { get; private set; }
/// <summary>
/// Constructor for MonitorStatusChangeEventArgs
/// </summary>
/// <param name="status">monitor status</param>
public MonitorStatusChangeEventArgs(MonitorStatus status) public MonitorStatusChangeEventArgs(MonitorStatus status)
{ {
Status = status; Status = status;
Message = status == MonitorStatus.IsOk ? "" : status.ToString(); Message = status == MonitorStatus.IsOk ? "" : status.ToString();
} }
/// <summary>
/// Constructor for MonitorStatusChangeEventArgs
/// </summary>
/// <param name="status">monitor status</param>
/// <param name="message">status message</param>
public MonitorStatusChangeEventArgs(MonitorStatus status, string message) public MonitorStatusChangeEventArgs(MonitorStatus status, string message)
{ {
Status = status; Status = status;

View File

@@ -13,8 +13,14 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
/// <summary>
/// Base class for status monitors
/// </summary>
public abstract class StatusMonitorBase : IStatusMonitor, IKeyName public abstract class StatusMonitorBase : IStatusMonitor, IKeyName
{ {
/// <summary>
/// Event fired when status changes
/// </summary>
public event EventHandler<MonitorStatusChangeEventArgs> StatusChange; public event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
/// <summary> /// <summary>
@@ -27,15 +33,24 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public string Name { get { return "Comm. monitor"; } } public string Name { get { return "Comm. monitor"; } }
/// <summary> /// <summary>
/// Gets or sets the Parent /// Gets or sets the Parent
/// </summary> /// </summary>
public IKeyed Parent { get; private set; } public IKeyed Parent { get; private set; }
/// <summary>
/// Bool feedback for online status
/// </summary>
public BoolFeedback IsOnlineFeedback { get; set; } public BoolFeedback IsOnlineFeedback { get; set; }
/// <summary>
/// Indicates whether the monitored device is online
/// </summary>
public bool IsOnline; public bool IsOnline;
/// <summary>
/// Current monitor status
/// </summary>
public MonitorStatus Status public MonitorStatus Status
{ {
get { return _Status; } get { return _Status; }
@@ -51,6 +66,9 @@ namespace PepperDash.Essentials.Core
} }
MonitorStatus _Status; MonitorStatus _Status;
/// <summary>
/// Current status message
/// </summary>
public string Message public string Message
{ {
get { return _Message; } get { return _Message; }
@@ -69,6 +87,12 @@ namespace PepperDash.Essentials.Core
CTimer WarningTimer; CTimer WarningTimer;
CTimer ErrorTimer; CTimer ErrorTimer;
/// <summary>
/// Constructor
/// </summary>
/// <param name="parent">parent device</param>
/// <param name="warningTime">time in milliseconds before warning status</param>
/// <param name="errorTime">time in milliseconds before error status</param>
public StatusMonitorBase(IKeyed parent, long warningTime, long errorTime) public StatusMonitorBase(IKeyed parent, long warningTime, long errorTime)
{ {
Parent = parent; Parent = parent;
@@ -83,9 +107,20 @@ namespace PepperDash.Essentials.Core
ErrorTime = errorTime; ErrorTime = errorTime;
} }
/// <summary>
/// Starts the monitor
/// </summary>
public abstract void Start(); public abstract void Start();
/// <summary>
/// Stops the monitor
/// </summary>
public abstract void Stop(); public abstract void Stop();
/// <summary>
/// Fires the StatusChange event
/// </summary>
/// <param name="status">monitor status</param>
protected void OnStatusChange(MonitorStatus status) protected void OnStatusChange(MonitorStatus status)
{ {
if (_Status == MonitorStatus.IsOk) if (_Status == MonitorStatus.IsOk)
@@ -98,6 +133,11 @@ namespace PepperDash.Essentials.Core
handler(this, new MonitorStatusChangeEventArgs(status)); handler(this, new MonitorStatusChangeEventArgs(status));
} }
/// <summary>
/// Fires the StatusChange event with message
/// </summary>
/// <param name="status">monitor status</param>
/// <param name="message">status message</param>
protected void OnStatusChange(MonitorStatus status, string message) protected void OnStatusChange(MonitorStatus status, string message)
{ {
if (_Status == MonitorStatus.IsOk) if (_Status == MonitorStatus.IsOk)
@@ -110,12 +150,18 @@ namespace PepperDash.Essentials.Core
handler(this, new MonitorStatusChangeEventArgs(status, message)); handler(this, new MonitorStatusChangeEventArgs(status, message));
} }
/// <summary>
/// Starts the error timers
/// </summary>
protected void StartErrorTimers() protected void StartErrorTimers()
{ {
if (WarningTimer == null) WarningTimer = new CTimer(o => { Status = MonitorStatus.InWarning; }, WarningTime); if (WarningTimer == null) WarningTimer = new CTimer(o => { Status = MonitorStatus.InWarning; }, WarningTime);
if (ErrorTimer == null) ErrorTimer = new CTimer(o => { Status = MonitorStatus.InError; }, ErrorTime); if (ErrorTimer == null) ErrorTimer = new CTimer(o => { Status = MonitorStatus.InError; }, ErrorTime);
} }
/// <summary>
/// Stops the error timers
/// </summary>
protected void StopErrorTimers() protected void StopErrorTimers()
{ {
if (WarningTimer != null) WarningTimer.Stop(); if (WarningTimer != null) WarningTimer.Stop();
@@ -124,6 +170,9 @@ namespace PepperDash.Essentials.Core
ErrorTimer = null; ErrorTimer = null;
} }
/// <summary>
/// Resets the error timers
/// </summary>
protected void ResetErrorTimers() protected void ResetErrorTimers()
{ {
if(WarningTimer != null) if(WarningTimer != null)

View File

@@ -14,41 +14,51 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
/// <summary> /// <summary>
/// /// Collection class for multiple status monitors
/// </summary> /// </summary>
public class StatusMonitorCollection : IStatusMonitor public class StatusMonitorCollection : IStatusMonitor
{ {
/// <summary>
/// Gets or sets the Parent
/// </summary>
public IKeyed Parent { get; private set; } public IKeyed Parent { get; private set; }
List<IStatusMonitor> Monitors = new List<IStatusMonitor>(); List<IStatusMonitor> Monitors = new List<IStatusMonitor>();
#region IStatusMonitor Members #region IStatusMonitor Members
/// <summary>
/// Event fired when status changes
/// </summary>
public event EventHandler<MonitorStatusChangeEventArgs> StatusChange; public event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
/// <summary> /// <summary>
/// Gets or sets the Status /// Gets or sets the Status
/// </summary> /// </summary>
public MonitorStatus Status { get; protected set; } public MonitorStatus Status { get; protected set; }
/// <summary> /// <summary>
/// Gets or sets the Message /// Gets or sets the Message
/// </summary> /// </summary>
public string Message { get; private set; } public string Message { get; private set; }
/// <summary> /// <summary>
/// Gets or sets the IsOnlineFeedback /// Gets or sets the IsOnlineFeedback
/// </summary> /// </summary>
public BoolFeedback IsOnlineFeedback { get; set; } public BoolFeedback IsOnlineFeedback { get; set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="parent">parent device</param>
public StatusMonitorCollection(IKeyed parent) public StatusMonitorCollection(IKeyed parent)
{ {
Parent = parent; Parent = parent;
} }
/// <summary> /// <summary>
/// Start method /// Start method
/// </summary> /// </summary>
public void Start() public void Start()
{ {
foreach (var mon in Monitors) foreach (var mon in Monitors)
@@ -135,7 +145,11 @@ namespace PepperDash.Essentials.Core
Monitors.Add(monitor); Monitors.Add(monitor);
} }
/// <summary>
/// Fires the StatusChange event
/// </summary>
/// <param name="status">monitor status</param>
/// <param name="message">status message</param>
protected void OnStatusChange(MonitorStatus status, string message) protected void OnStatusChange(MonitorStatus status, string message)
{ {
var handler = StatusChange; var handler = StatusChange;

View File

@@ -14,10 +14,16 @@ namespace PepperDash.Essentials.Core
{ {
private IPartitionStateProvider _partitionSensor; private IPartitionStateProvider _partitionSensor;
/// <summary>
/// Indicates whether the controller is in Auto mode or Manual mode
/// </summary>
public bool IsInAutoMode { get; private set; } public bool IsInAutoMode { get; private set; }
private bool _partitionPresent; private bool _partitionPresent;
/// <summary>
/// Gets or sets the PartitionPresent state
/// </summary>
public bool PartitionPresent public bool PartitionPresent
{ {
get get
@@ -45,6 +51,14 @@ namespace PepperDash.Essentials.Core
} }
} }
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key for the partition controller</param>
/// <param name="name">name of the partition controller</param>
/// <param name="sensor">partition state provider sensor</param>
/// <param name="defaultToManualMode">whether to default to manual mode</param>
/// <param name="adjacentRoomKeys">list of adjacent room keys</param>
public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List<string> adjacentRoomKeys) public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List<string> adjacentRoomKeys)
{ {
Key = key; Key = key;

View File

@@ -9,9 +9,15 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public interface IPartitionStateProvider : IKeyName public interface IPartitionStateProvider : IKeyName
{ {
/// <summary>
/// Feedback indicating whether the partition is present
/// </summary>
[JsonIgnore] [JsonIgnore]
BoolFeedback PartitionPresentFeedback { get; } BoolFeedback PartitionPresentFeedback { get; }
/// <summary>
/// Indicates whether the partition is present
/// </summary>
[JsonProperty("partitionPresent")] [JsonProperty("partitionPresent")]
bool PartitionPresent { get; } bool PartitionPresent { get; }
} }
@@ -21,20 +27,41 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public interface IPartitionController : IPartitionStateProvider public interface IPartitionController : IPartitionStateProvider
{ {
/// <summary>
/// List of adjacent room keys
/// </summary>
[JsonProperty("adjacentRoomKeys")] [JsonProperty("adjacentRoomKeys")]
List<string> AdjacentRoomKeys { get; } List<string> AdjacentRoomKeys { get; }
/// <summary>
/// Indicates whether the controller is in Auto mode or Manual mode
/// </summary>
[JsonProperty("isInAutoMode")] [JsonProperty("isInAutoMode")]
bool IsInAutoMode { get; } bool IsInAutoMode { get; }
/// <summary>
/// Sets the PartitionPresent state
/// </summary>
void SetPartitionStatePresent(); void SetPartitionStatePresent();
/// <summary>
/// Sets the PartitionPresent state to not present
/// </summary>
void SetPartitionStateNotPresent(); void SetPartitionStateNotPresent();
/// <summary>
/// Toggles the PartitionPresent state
/// </summary>
void ToggglePartitionState(); void ToggglePartitionState();
/// <summary>
/// Sets the controller to Manual mode
/// </summary>
void SetManualMode(); void SetManualMode();
/// <summary>
/// Sets the controller to Auto mode
/// </summary>
void SetAutoMode(); void SetAutoMode();
} }
} }

View File

@@ -19,8 +19,17 @@ namespace PepperDash.Essentials.Core.Presets
/// </summary> /// </summary>
public class DevicePresetsModel : Device public class DevicePresetsModel : Device
{ {
/// <summary>
/// Delegate for preset recalled event
/// </summary>
/// <param name="device">device that recalled a preset</param>
/// <param name="channel">channel that was recalled</param>
public delegate void PresetRecalledCallback(ISetTopBoxNumericKeypad device, string channel); public delegate void PresetRecalledCallback(ISetTopBoxNumericKeypad device, string channel);
/// <summary>
/// Delegate for presets saved event
/// </summary>
/// <param name="presets">list of presets that were saved</param>
public delegate void PresetsSavedCallback(List<PresetChannel> presets); public delegate void PresetsSavedCallback(List<PresetChannel> presets);
private readonly CCriticalSection _fileOps = new CCriticalSection(); private readonly CCriticalSection _fileOps = new CCriticalSection();
@@ -37,6 +46,12 @@ namespace PepperDash.Essentials.Core.Presets
private Action<bool> _enterFunction; private Action<bool> _enterFunction;
private string _filePath; private string _filePath;
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key for the device</param>
/// <param name="setTopBox">set top box device</param>
/// <param name="fileName">file name for presets</param>
public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName) public DevicePresetsModel(string key, ISetTopBoxNumericKeypad setTopBox, string fileName)
: this(key, fileName) : this(key, fileName)
{ {
@@ -71,6 +86,11 @@ namespace PepperDash.Essentials.Core.Presets
_enterFunction = setTopBox.KeypadEnter; _enterFunction = setTopBox.KeypadEnter;
} }
/// <summary>
/// Constructor
/// </summary>
/// <param name="key">key for the device</param>
/// <param name="fileName">file name for presets</param>
public DevicePresetsModel(string key, string fileName) : base(key) public DevicePresetsModel(string key, string fileName) : base(key)
{ {
PulseTime = 150; PulseTime = 150;
@@ -88,17 +108,26 @@ namespace PepperDash.Essentials.Core.Presets
_initSuccess = true; _initSuccess = true;
} }
/// <summary>
/// Event fired when a preset is recalled
/// </summary>
public event PresetRecalledCallback PresetRecalled; public event PresetRecalledCallback PresetRecalled;
/// <summary>
/// Event fired when presets are saved
/// </summary>
public event PresetsSavedCallback PresetsSaved; public event PresetsSavedCallback PresetsSaved;
/// <summary> /// <summary>
/// Gets or sets the PulseTime /// Gets or sets the PulseTime
/// </summary> /// </summary>
public int PulseTime { get; set; } public int PulseTime { get; set; }
/// <summary> /// <summary>
/// Gets or sets the DigitSpacingMs /// Gets or sets the DigitSpacingMs
/// </summary> /// </summary>
public int DigitSpacingMs { get; set; } public int DigitSpacingMs { get; set; }
/// <summary> /// <summary>
/// Gets or sets the PresetsAreLoaded /// Gets or sets the PresetsAreLoaded
/// </summary> /// </summary>
@@ -109,6 +138,9 @@ namespace PepperDash.Essentials.Core.Presets
/// </summary> /// </summary>
public List<PresetChannel> PresetsList { get; private set; } public List<PresetChannel> PresetsList { get; private set; }
/// <summary>
/// Gets the Count of presets
/// </summary>
public int Count public int Count
{ {
get { return PresetsList != null ? PresetsList.Count : 0; } get { return PresetsList != null ? PresetsList.Count : 0; }
@@ -118,18 +150,25 @@ namespace PepperDash.Essentials.Core.Presets
/// Gets or sets the UseLocalImageStorage /// Gets or sets the UseLocalImageStorage
/// </summary> /// </summary>
public bool UseLocalImageStorage { get; set; } public bool UseLocalImageStorage { get; set; }
/// <summary> /// <summary>
/// Gets or sets the ImagesLocalHostPrefix /// Gets or sets the ImagesLocalHostPrefix
/// </summary> /// </summary>
public string ImagesLocalHostPrefix { get; set; } public string ImagesLocalHostPrefix { get; set; }
/// <summary> /// <summary>
/// Gets or sets the ImagesPathPrefix /// Gets or sets the ImagesPathPrefix
/// </summary> /// </summary>
public string ImagesPathPrefix { get; set; } public string ImagesPathPrefix { get; set; }
/// <summary> /// <summary>
/// Gets or sets the ListPathPrefix /// Gets or sets the ListPathPrefix
/// </summary> /// </summary>
public string ListPathPrefix { get; set; } public string ListPathPrefix { get; set; }
/// <summary>
/// Event fired when presets are loaded
/// </summary>
public event EventHandler PresetsLoaded; public event EventHandler PresetsLoaded;

View File

@@ -15,36 +15,37 @@ namespace PepperDash.Essentials.Core.Presets
/// </summary> /// </summary>
public class PresetBase public class PresetBase
{ {
[JsonProperty("id")]
/// <summary> /// <summary>
/// Gets or sets the ID /// Gets or sets the ID
/// </summary> /// </summary>
[JsonProperty("id")]
public int ID { get; set; } public int ID { get; set; }
/// <summary>
/// Used to store the name of the preset
/// </summary>
[JsonProperty("description")]
/// <summary> /// <summary>
/// Gets or sets the Description /// Gets or sets the Description
/// </summary> /// </summary>
[JsonProperty("description")]
public string Description { get; set; } public string Description { get; set; }
/// <summary> /// <summary>
/// Indicates if the preset is defined(stored) in the codec /// Gets or sets Defined
/// </summary> /// </summary>
[JsonProperty("defined")] [JsonProperty("defined")]
/// <summary>
/// Gets or sets the Defined
/// </summary>
public bool Defined { get; set; } public bool Defined { get; set; }
/// <summary>
/// Indicates if the preset has the capability to be defined
/// </summary>
[JsonProperty("isDefinable")]
/// <summary> /// <summary>
/// Gets or sets the IsDefinable /// Gets or sets the IsDefinable
/// </summary> /// </summary>
[JsonProperty("isDefinable")]
public bool IsDefinable { get; set; } public bool IsDefinable { get; set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="id">id of the preset</param>
/// <param name="description">description of the preset</param>
/// <param name="def">whether the preset is defined</param>
/// <param name="isDef">whether the preset is definable</param>
public PresetBase(int id, string description, bool def, bool isDef) public PresetBase(int id, string description, bool def, bool isDef)
{ {
ID = id; ID = id;

View File

@@ -15,40 +15,40 @@ namespace PepperDash.Essentials.Core.Presets
public class PresetChannel public class PresetChannel
{ {
/// <summary>
/// Gets or sets the Name
/// </summary>
[JsonProperty(Required = Required.Always,PropertyName = "name")] [JsonProperty(Required = Required.Always,PropertyName = "name")]
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary>
/// Gets or sets the IconUrl
/// </summary>
[JsonProperty(Required = Required.Always, PropertyName = "iconUrl")] [JsonProperty(Required = Required.Always, PropertyName = "iconUrl")]
/// <summary>
/// Gets or sets the IconUrl
/// </summary>
public string IconUrl { get; set; } public string IconUrl { get; set; }
/// <summary>
/// Gets or sets the Channel
/// </summary>
[JsonProperty(Required = Required.Always, PropertyName = "channel")] [JsonProperty(Required = Required.Always, PropertyName = "channel")]
/// <summary>
/// Gets or sets the Channel
/// </summary>
public string Channel { get; set; } public string Channel { get; set; }
} }
/// <summary> /// <summary>
/// Represents a PresetsList /// Represents a PresetsList
/// </summary> /// </summary>
public class PresetsList public class PresetsList
{ {
/// <summary>
/// Gets or sets the Name
/// </summary>
[JsonProperty(Required=Required.Always,PropertyName = "name")] [JsonProperty(Required=Required.Always,PropertyName = "name")]
/// <summary>
/// Gets or sets the Name
/// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary>
/// Gets or sets the Channels
/// </summary>
[JsonProperty(Required = Required.Always, PropertyName = "channels")] [JsonProperty(Required = Required.Always, PropertyName = "channels")]
/// <summary>
/// Gets or sets the Channels
/// </summary>
public List<PresetChannel> Channels { get; set; } public List<PresetChannel> Channels { get; set; }
} }
} }

View File

@@ -20,6 +20,13 @@ namespace PepperDash.Essentials.Core.Presets
DevicePresetsView View; DevicePresetsView View;
PresetChannel Channel; PresetChannel Channel;
/// <summary>
/// Constructor
/// </summary>
/// <param name="chan">preset channel</param>
/// <param name="index">index of the preset</param>
/// <param name="owner">owner of the subpage reference list item</param>
/// <param name="view">device presets view</param>
public PresetsListSubpageReferenceListItem(PresetChannel chan, uint index, public PresetsListSubpageReferenceListItem(PresetChannel chan, uint index,
SubpageReferenceList owner, DevicePresetsView view) SubpageReferenceList owner, DevicePresetsView view)
: base(index, owner) : base(index, owner)
@@ -30,10 +37,10 @@ namespace PepperDash.Essentials.Core.Presets
Refresh(); Refresh();
} }
/// <summary> /// <summary>
/// Clear method /// Clear method
/// </summary> /// </summary>
/// <inheritdoc /> /// <inheritdoc />
public override void Clear() public override void Clear()
{ {
Owner.GetBoolFeedbackSig(Index, 1).UserObject = null; Owner.GetBoolFeedbackSig(Index, 1).UserObject = null;
@@ -42,10 +49,10 @@ namespace PepperDash.Essentials.Core.Presets
Owner.StringInputSig(Index, 3).StringValue = ""; Owner.StringInputSig(Index, 3).StringValue = "";
} }
/// <summary> /// <summary>
/// Refresh method /// Refresh method
/// </summary> /// </summary>
/// <inheritdoc /> /// <inheritdoc />
public override void Refresh() public override void Refresh()
{ {
var name = View.ShowName ? Channel.Name : ""; var name = View.ShowName ? Channel.Name : "";

View File

@@ -14,8 +14,20 @@ namespace PepperDash.Essentials.Core.Queues
public class GenericQueue : IQueue<IQueueMessage> public class GenericQueue : IQueue<IQueueMessage>
{ {
private readonly string _key; private readonly string _key;
/// <summary>
/// The internal queue
/// </summary>
protected readonly ConcurrentQueue<IQueueMessage> _queue; protected readonly ConcurrentQueue<IQueueMessage> _queue;
/// <summary>
/// The worker thread
/// </summary>
protected readonly Thread _worker; protected readonly Thread _worker;
/// <summary>
/// The wait handle for the queue
/// </summary>
protected readonly CEvent _waitHandle = new CEvent(); protected readonly CEvent _waitHandle = new CEvent();
private bool _delayEnabled; private bool _delayEnabled;
@@ -256,6 +268,9 @@ namespace PepperDash.Essentials.Core.Queues
Disposed = true; Disposed = true;
} }
/// <summary>
/// Finalizer
/// </summary>
~GenericQueue() ~GenericQueue()
{ {
Dispose(true); Dispose(true);

View File

@@ -8,7 +8,15 @@ namespace PepperDash.Essentials.Core.Queues
/// </summary> /// </summary>
public interface IQueue<T> : IKeyed, IDisposable where T : class public interface IQueue<T> : IKeyed, IDisposable where T : class
{ {
/// <summary>
/// Enqueues an item
/// </summary>
/// <param name="item">item to be queued</param>
void Enqueue(T item); void Enqueue(T item);
/// <summary>
/// gets the disposed status of the queue
/// </summary>
bool Disposed { get; } bool Disposed { get; }
} }
} }

View File

@@ -7,6 +7,9 @@ namespace PepperDash.Essentials.Core.Queues
/// </summary> /// </summary>
public interface IQueueMessage public interface IQueueMessage
{ {
/// <summary>
/// Dispatches the message
/// </summary>
void Dispatch(); void Dispatch();
} }
} }

View File

@@ -4,6 +4,9 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core.Queues namespace PepperDash.Essentials.Core.Queues
{ {
/// <summary>
/// Processes string responses from a communication port or gather using a queue to ensure thread safety
/// </summary>
public sealed class StringResponseProcessor : IKeyed, IDisposable public sealed class StringResponseProcessor : IKeyed, IDisposable
{ {
private readonly Action<string> _processStringAction; private readonly Action<string> _processStringAction;
@@ -98,6 +101,9 @@ namespace PepperDash.Essentials.Core.Queues
/// </summary> /// </summary>
public bool Disposed { get; private set; } public bool Disposed { get; private set; }
/// <summary>
/// Finalizer
/// </summary>
~StringResponseProcessor() ~StringResponseProcessor()
{ {
Dispose(false); Dispose(false);

View File

@@ -15,10 +15,29 @@ namespace PepperDash.Essentials.Core
/// </summary> /// </summary>
public class ActionIncrementer public class ActionIncrementer
{ {
/// <summary>
/// The amount to change the value by each increment
/// </summary>
public int ChangeAmount { get; set; } public int ChangeAmount { get; set; }
/// <summary>
/// The maximum value for the incrementer
/// </summary>
public int MaxValue { get; set; } public int MaxValue { get; set; }
/// <summary>
/// The minimum value for the incrementer
/// </summary>
public int MinValue { get; set; } public int MinValue { get; set; }
/// <summary>
/// The delay before repeating starts
/// </summary>
public uint RepeatDelay { get; set; } public uint RepeatDelay { get; set; }
/// <summary>
/// The time between repeats
/// </summary>
public uint RepeatTime { get; set; } public uint RepeatTime { get; set; }
Action<int> SetAction; Action<int> SetAction;

View File

@@ -16,14 +16,44 @@ namespace PepperDash.Essentials.Core
public class UshortSigIncrementer public class UshortSigIncrementer
{ {
UShortInputSig TheSig; UShortInputSig TheSig;
/// <summary>
/// The amount to change the value by each increment
/// </summary>
public ushort ChangeAmount { get; set; } public ushort ChangeAmount { get; set; }
/// <summary>
/// The maximum value for the incrementer
/// </summary>
public int MaxValue { get; set; } public int MaxValue { get; set; }
/// <summary>
/// The minimum value for the incrementer
/// </summary>
public int MinValue { get; set; } public int MinValue { get; set; }
/// <summary>
/// The delay before repeating starts
/// </summary>
public uint RepeatDelay { get; set; } public uint RepeatDelay { get; set; }
/// <summary>
/// The time between repeats
/// </summary>
public uint RepeatTime { get; set; } public uint RepeatTime { get; set; }
bool SignedMode; bool SignedMode;
CTimer Timer; CTimer Timer;
/// <summary>
/// Constructor
/// </summary>
/// <param name="sig">the signal toi be incremented</param>
/// <param name="changeAmount">the amount to increment by</param>
/// <param name="minValue">the minimum value of the signal</param>
/// <param name="maxValue">the maximum value of the signal</param>
/// <param name="repeatDelay">the delay before repeating starts</param>
/// <param name="repeatTime">the time between repeats</param>
public UshortSigIncrementer(UShortInputSig sig, ushort changeAmount, int minValue, int maxValue, uint repeatDelay, uint repeatTime) public UshortSigIncrementer(UShortInputSig sig, ushort changeAmount, int minValue, int maxValue, uint repeatDelay, uint repeatTime)
{ {
TheSig = sig; TheSig = sig;