mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-30 04:44:49 +00:00
wip: update XML comments
This commit is contained in:
@@ -15,6 +15,10 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
{
|
||||
//public static Dictionary<int, ProcessorProgramItem> Programs { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the processor program registry
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<int, ProcessorProgramItem> GetProcessorProgReg()
|
||||
{
|
||||
var programs = new Dictionary<int, ProcessorProgramItem>();
|
||||
|
||||
@@ -17,18 +17,47 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// </summary>
|
||||
public class FusionRoomGuids
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomName
|
||||
/// </summary>
|
||||
public string RoomName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IpId
|
||||
/// </summary>
|
||||
public uint IpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomGuid
|
||||
/// </summary>
|
||||
public string RoomGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the OccupancyAsset
|
||||
/// </summary>
|
||||
public FusionOccupancySensorAsset OccupancyAsset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the StaticAssets
|
||||
/// </summary>
|
||||
public Dictionary<int, FusionAsset> StaticAssets { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FusionRoomGuids constructor
|
||||
/// </summary>
|
||||
public FusionRoomGuids()
|
||||
{
|
||||
StaticAssets = new Dictionary<int, FusionAsset>();
|
||||
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)
|
||||
{
|
||||
RoomName = roomName;
|
||||
@@ -39,6 +68,14 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
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)
|
||||
{
|
||||
RoomName = roomName;
|
||||
@@ -143,10 +180,17 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// </summary>
|
||||
public string InstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
public FusionOccupancySensorAsset()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FusionOccupancySensorAsset constructor
|
||||
/// </summary>
|
||||
/// <param name="type">asset type</param>
|
||||
public FusionOccupancySensorAsset(eAssetType type)
|
||||
{
|
||||
Type = type;
|
||||
@@ -177,11 +221,21 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// </summary>
|
||||
public string InstanceId { get;set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
SlotNumber = slotNum;
|
||||
@@ -210,6 +264,9 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// </summary>
|
||||
public List<Event> Meetings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RoomSchedule constructor
|
||||
/// </summary>
|
||||
public RoomSchedule()
|
||||
{
|
||||
Meetings = new List<Event>();
|
||||
@@ -224,6 +281,9 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// </summary>
|
||||
public class LocalTimeRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the RequestID
|
||||
/// </summary>
|
||||
public string RequestID { get; set; }
|
||||
}
|
||||
|
||||
@@ -238,13 +298,30 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// Gets or sets the RequestID
|
||||
/// </summary>
|
||||
public string RequestID { get; set; }
|
||||
|
||||
//[XmlElement(ElementName = "RoomID")]
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomID
|
||||
/// </summary>
|
||||
public string RoomID { get; set; }
|
||||
|
||||
//[XmlElement(ElementName = "Start")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Start
|
||||
/// </summary>
|
||||
public DateTime Start { get; set; }
|
||||
|
||||
//[XmlElement(ElementName = "HourSpan")]
|
||||
/// <summary>
|
||||
/// Gets or sets the HourSpan
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
RequestID = requestID;
|
||||
@@ -282,6 +359,12 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
RoomID = roomID;
|
||||
@@ -301,11 +384,13 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// Gets or sets the RequestID
|
||||
/// </summary>
|
||||
public string RequestID { get; set; }
|
||||
|
||||
//[XmlElement(ElementName = "ActionID")]
|
||||
/// <summary>
|
||||
/// Gets or sets the ActionID
|
||||
/// </summary>
|
||||
public string ActionID { get; set; }
|
||||
|
||||
//[XmlElement(ElementName = "Parameters")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Parameters
|
||||
@@ -324,6 +409,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// Gets or sets the ID
|
||||
/// </summary>
|
||||
public string ID { get; set; }
|
||||
|
||||
//[XmlAttribute(AttributeName = "Value")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Value
|
||||
@@ -345,14 +431,32 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
public class ScheduleResponse
|
||||
{
|
||||
//[XmlElement(ElementName = "RequestID")]
|
||||
/// <summary>
|
||||
/// Gets or sets the RequestID
|
||||
/// </summary>
|
||||
public string RequestID { get; set; }
|
||||
|
||||
//[XmlElement(ElementName = "RoomID")]
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomID
|
||||
/// </summary>
|
||||
public string RoomID { get; set; }
|
||||
|
||||
//[XmlElement(ElementName = "RoomName")]
|
||||
/// <summary>
|
||||
/// Gets or sets the RoomName
|
||||
/// </summary>
|
||||
public string RoomName { get; set; }
|
||||
|
||||
//[XmlElement("Event")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Events
|
||||
/// </summary>
|
||||
public List<Event> Events { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ScheduleResponse constructor
|
||||
/// </summary>
|
||||
public ScheduleResponse()
|
||||
{
|
||||
Events = new List<Event>();
|
||||
|
||||
@@ -22,6 +22,9 @@ using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Global static class for Essentials
|
||||
/// </summary>
|
||||
public static class Global
|
||||
{
|
||||
/// <summary>
|
||||
@@ -34,6 +37,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
@@ -47,6 +53,9 @@ namespace PepperDash.Essentials.Core
|
||||
public static eCrestronSeries ProcessorSeries { get { return CrestronEnvironment.ProgramCompatibility; } }
|
||||
|
||||
// TODO: consider making this configurable later
|
||||
/// <summary>
|
||||
/// The CultureInfo for formatting
|
||||
/// </summary>
|
||||
public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US");
|
||||
|
||||
/// <summary>
|
||||
@@ -182,6 +191,13 @@ namespace PepperDash.Essentials.Core
|
||||
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)
|
||||
{
|
||||
if (Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*").Groups[1].Value == "0")
|
||||
|
||||
@@ -6,6 +6,9 @@ using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a JobTimer
|
||||
/// </summary>
|
||||
public static class JobTimer
|
||||
{
|
||||
static CTimer MinuteTimer;
|
||||
@@ -13,25 +16,18 @@ namespace PepperDash.Essentials.Core
|
||||
static List<JobTimerItem> Items = new List<JobTimerItem>();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="act"></param>
|
||||
/// <summary>
|
||||
/// AddAction method
|
||||
/// </summary>
|
||||
/// AddAction method
|
||||
/// </summary>
|
||||
/// <param name="act">action to add</param>
|
||||
public static void AddAction(Action act)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// AddJobTimerItem method
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="act"></param>
|
||||
/// <summary>
|
||||
/// AddJobTimerItem method
|
||||
/// </summary>
|
||||
/// <param name="item">JobTimerItem to add</param>
|
||||
public static void AddJobTimerItem(JobTimerItem item)
|
||||
{
|
||||
var existing = Items.FirstOrDefault(i => i.Key == item.Key);
|
||||
@@ -62,25 +58,61 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public class JobTimerItem
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
public Action JobAction { get; private set; }
|
||||
public eJobTimerCycleTypes CycleType { get; private set; }
|
||||
/// <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>
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// JobTimerCycleTypes enum
|
||||
/// </summary>
|
||||
public enum eJobTimerCycleTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// RunEveryDay property
|
||||
/// </summary>
|
||||
RunEveryDay,
|
||||
|
||||
/// <summary>
|
||||
/// RunEveryHour property
|
||||
/// </summary>
|
||||
RunEveryHour,
|
||||
|
||||
/// <summary>
|
||||
/// RunEveryHalfHour property
|
||||
/// </summary>
|
||||
RunEveryHalfHour,
|
||||
|
||||
/// <summary>
|
||||
/// RunEveryMinute property
|
||||
/// </summary>
|
||||
RunEveryMinute
|
||||
}
|
||||
}
|
||||
@@ -138,6 +138,11 @@ Recurrence Days: {evt.Value.Recurrence.RecurrenceDays}
|
||||
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)
|
||||
{
|
||||
ScheduledEventGroup returnValue;
|
||||
@@ -146,6 +151,9 @@ Recurrence Days: {evt.Value.Recurrence.RecurrenceDays}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SchedulerUtilities class
|
||||
/// </summary>
|
||||
public static class SchedulerUtilities
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IInUseTracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the InUseTracker
|
||||
/// </summary>
|
||||
InUseTracking InUseTracker { get; }
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public IntFeedback InUseCountFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public InUseTracking()
|
||||
{
|
||||
InUseFeedback = new BoolFeedback(() => _Users.Count > 0);
|
||||
@@ -39,9 +42,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// multiple times, provided that the label is different
|
||||
/// </summary>
|
||||
/// <param name="label">A label to identify the instance of the user. Treated like a "role", etc.</param>
|
||||
/// <summary>
|
||||
/// AddUser method
|
||||
/// </summary>
|
||||
/// <param name="objectToAdd">The object to add</param>
|
||||
public void AddUser(object objectToAdd, string label)
|
||||
{
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RemoveUser method
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// RemoveUser method
|
||||
/// </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)
|
||||
{
|
||||
// Find the user object if exists and remove it
|
||||
@@ -73,14 +76,26 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a InUseTrackingObject
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Represents a InUseTrackingObject
|
||||
/// </summary>
|
||||
public class InUseTrackingObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The label of the user
|
||||
/// </summary>
|
||||
public string Label { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The user object
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
User = user;
|
||||
|
||||
@@ -17,6 +17,9 @@ using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// JoinMapHelper class
|
||||
/// </summary>
|
||||
public static class JoinMapHelper
|
||||
{
|
||||
/// <summary>
|
||||
@@ -93,6 +96,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public abstract class JoinMapBaseAdvanced
|
||||
{
|
||||
/// <summary>
|
||||
/// The join offset
|
||||
/// </summary>
|
||||
protected uint JoinOffset;
|
||||
|
||||
/// <summary>
|
||||
@@ -100,6 +106,10 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public Dictionary<string, JoinDataComplete> Joins { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="joinStart">join start offset</param>
|
||||
protected JoinMapBaseAdvanced(uint joinStart)
|
||||
{
|
||||
Joins = new Dictionary<string, JoinDataComplete>();
|
||||
@@ -107,11 +117,20 @@ namespace PepperDash.Essentials.Core
|
||||
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)
|
||||
{
|
||||
AddJoins(type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AddJoins method
|
||||
/// </summary>
|
||||
/// <param name="type">type of join to add</param>
|
||||
protected void AddJoins(Type type)
|
||||
{
|
||||
var fields =
|
||||
@@ -303,18 +322,11 @@ namespace PepperDash.Essentials.Core
|
||||
PrintJoinMapInfo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the join span for the join with the specified key
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the join span for the join with the specified key
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <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)
|
||||
//{
|
||||
// return Joins.ContainsKey(key) ? Joins[key].JoinSpan : 0;
|
||||
@@ -328,28 +340,86 @@ namespace PepperDash.Essentials.Core
|
||||
[Flags]
|
||||
public enum eJoinCapabilities
|
||||
{
|
||||
/// <summary>
|
||||
/// No capabilities
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// To SIMPL
|
||||
/// </summary>
|
||||
ToSIMPL = 1,
|
||||
|
||||
/// <summary>
|
||||
/// From SIMPL
|
||||
/// </summary>
|
||||
FromSIMPL = 2,
|
||||
|
||||
/// <summary>
|
||||
/// To and From SIMPL
|
||||
/// </summary>
|
||||
ToFromSIMPL = ToSIMPL | FromSIMPL,
|
||||
|
||||
/// <summary>
|
||||
/// To Fusion
|
||||
/// </summary>
|
||||
ToFusion = 4,
|
||||
|
||||
/// <summary>
|
||||
/// From Fusion
|
||||
/// </summary>
|
||||
FromFusion = 8,
|
||||
|
||||
/// <summary>
|
||||
/// To and From Fusion
|
||||
/// </summary>
|
||||
ToFromFusion = ToFusion | FromFusion,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
/// <summary>
|
||||
/// Enumeration of eJoinType values
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum eJoinType
|
||||
{
|
||||
/// <summary>
|
||||
/// No join type
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Digital join
|
||||
/// </summary>
|
||||
Digital = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Analog join
|
||||
/// </summary>
|
||||
Analog = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Serial join
|
||||
/// </summary>
|
||||
Serial = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Digital and Analog join
|
||||
/// </summary>
|
||||
DigitalAnalog = Digital | Analog,
|
||||
|
||||
/// <summary>
|
||||
/// Digital and Serial join
|
||||
/// </summary>
|
||||
DigitalSerial = Digital | Serial,
|
||||
|
||||
/// <summary>
|
||||
/// Analog and Serial join
|
||||
/// </summary>
|
||||
AnalogSerial = Analog | Serial,
|
||||
|
||||
/// <summary>
|
||||
/// Digital, Analog and Serial join
|
||||
/// </summary>
|
||||
DigitalAnalogSerial = Digital | Analog | Serial,
|
||||
}
|
||||
|
||||
@@ -364,29 +434,23 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get { return _description; } set { _description = value; } }
|
||||
/// <summary>
|
||||
/// Signal type(s)
|
||||
/// </summary>
|
||||
[JsonProperty("joinType")]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JoinType
|
||||
/// </summary>
|
||||
[JsonProperty("joinType")]
|
||||
public eJoinType JoinType { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates whether the join is read and/or write
|
||||
/// </summary>
|
||||
[JsonProperty("joinCapabilities")]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JoinCapabilities
|
||||
/// </summary>
|
||||
[JsonProperty("joinCapabilities")]
|
||||
public eJoinCapabilities JoinCapabilities { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates a set of valid values (particularly if this translates to an enum
|
||||
/// </summary>
|
||||
[JsonProperty("validValues")]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ValidValues
|
||||
/// </summary>
|
||||
[JsonProperty("validValues")]
|
||||
public string[] ValidValues { get; set; }
|
||||
|
||||
}
|
||||
@@ -401,18 +465,17 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
[JsonProperty("joinNumber")]
|
||||
public uint JoinNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Join range span. If join indicates the start of a range of joins, this indicated the maximum number of joins in the range
|
||||
/// </summary>
|
||||
[JsonProperty("joinSpan")]
|
||||
public uint JoinSpan { get; set; }
|
||||
/// <summary>
|
||||
/// Fusion Attribute Name (optional)
|
||||
/// </summary>
|
||||
[JsonProperty("attributeName")]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AttributeName
|
||||
/// </summary>
|
||||
[JsonProperty("attributeName")]
|
||||
public string AttributeName { get; set; }
|
||||
}
|
||||
|
||||
@@ -424,18 +487,34 @@ namespace PepperDash.Essentials.Core
|
||||
private uint _joinOffset;
|
||||
|
||||
private JoinData _data;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JoinMetadata
|
||||
/// </summary>
|
||||
public JoinMetadata Metadata { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// To store some future information as you please
|
||||
/// </summary>
|
||||
public object UserObject { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="metadata"></param>
|
||||
public JoinDataComplete(JoinData data, JoinMetadata metadata)
|
||||
{
|
||||
_data = data;
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -498,9 +577,6 @@ namespace PepperDash.Essentials.Core
|
||||
/// Sets the join offset value
|
||||
/// </summary>
|
||||
/// <param name="joinOffset"></param>
|
||||
/// <summary>
|
||||
/// SetJoinOffset method
|
||||
/// </summary>
|
||||
public void SetJoinOffset(uint joinOffset)
|
||||
{
|
||||
_joinOffset = joinOffset;
|
||||
@@ -515,11 +591,17 @@ namespace PepperDash.Essentials.Core
|
||||
set { _data.JoinNumber = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The join span
|
||||
/// </summary>
|
||||
public uint JoinSpan
|
||||
{
|
||||
get { return _data.JoinSpan; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The attribute name
|
||||
/// </summary>
|
||||
public string AttributeName
|
||||
{
|
||||
get { return _data.AttributeName; }
|
||||
@@ -551,20 +633,27 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
|
||||
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
/// <summary>
|
||||
/// Represents a JoinNameAttribute
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class JoinNameAttribute : Attribute
|
||||
{
|
||||
private string _Name;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="name">name of the attribute</param>
|
||||
public JoinNameAttribute(string name)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Verbose, "Setting Attribute Name: {0}",null, name);
|
||||
_Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Name
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get { return _Name; }
|
||||
|
||||
@@ -8,12 +8,25 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
/// </summary>
|
||||
public interface ILightingScenes
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when the lighting scene changes
|
||||
/// </summary>
|
||||
event EventHandler<LightingSceneChangeEventArgs> LightingSceneChange;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of LightingScenes
|
||||
/// </summary>
|
||||
List<LightingScene> LightingScenes { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Selects the given LightingScene
|
||||
/// </summary>
|
||||
/// <param name="scene">scene to select</param>
|
||||
void SelectScene(LightingScene scene);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the currently selected LightingScene
|
||||
/// </summary>
|
||||
LightingScene CurrentLightingScene { get; }
|
||||
|
||||
}
|
||||
@@ -23,6 +36,9 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
/// </summary>
|
||||
public interface ILightingScenesDynamic : ILightingScenes
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when the lighting scenes are updated
|
||||
/// </summary>
|
||||
event EventHandler LightingScenesUpdated;
|
||||
}
|
||||
|
||||
@@ -31,8 +47,19 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
/// </summary>
|
||||
public interface ILightingMasterRaiseLower
|
||||
{
|
||||
/// <summary>
|
||||
/// Raises the master level
|
||||
/// </summary>
|
||||
void MasterRaise();
|
||||
|
||||
/// <summary>
|
||||
/// Lowers the master level
|
||||
/// </summary>
|
||||
void MasterLower();
|
||||
|
||||
/// <summary>
|
||||
/// Stops raising or lowering the master level
|
||||
/// </summary>
|
||||
void MasterRaiseLowerStop();
|
||||
}
|
||||
|
||||
@@ -41,11 +68,30 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
/// </summary>
|
||||
public interface ILightingLoad
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the load level
|
||||
/// </summary>
|
||||
/// <param name="level">level to set</param>
|
||||
void SetLoadLevel(int level);
|
||||
|
||||
/// <summary>
|
||||
/// Raises the load level
|
||||
/// </summary>
|
||||
void Raise();
|
||||
|
||||
/// <summary>
|
||||
/// Lowers the load level
|
||||
/// </summary>
|
||||
void Lower();
|
||||
|
||||
/// <summary>
|
||||
/// feedback of the current load level
|
||||
/// </summary>
|
||||
IntFeedback LoadLevelFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// feedback of whether the load is on
|
||||
/// </summary>
|
||||
BoolFeedback LoadIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
@@ -59,6 +105,10 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
/// </summary>
|
||||
public LightingScene CurrentLightingScene { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for LightingSceneChangeEventArgs
|
||||
/// </summary>
|
||||
/// <param name="scene">The lighting scene that changed</param>
|
||||
public LightingSceneChangeEventArgs(LightingScene scene)
|
||||
{
|
||||
CurrentLightingScene = scene;
|
||||
|
||||
@@ -10,17 +10,23 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
/// </summary>
|
||||
public class LightingScene
|
||||
{
|
||||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ID
|
||||
/// </summary>
|
||||
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string ID { get; set; }
|
||||
|
||||
bool _IsActive;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the scene is active
|
||||
/// </summary>
|
||||
[JsonProperty("isActive", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool IsActive
|
||||
{
|
||||
@@ -35,18 +41,22 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("sortOrder", NullValueHandling = NullValueHandling.Ignore)]
|
||||
/// <summary>
|
||||
/// Gets or sets the SortOrder
|
||||
/// </summary>
|
||||
[JsonProperty("sortOrder", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsActiveFeedback
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public BoolFeedback IsActiveFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for LightingScene
|
||||
/// </summary>
|
||||
public LightingScene()
|
||||
{
|
||||
IsActiveFeedback = new BoolFeedback(new Func<bool>(() => IsActive));
|
||||
|
||||
@@ -23,6 +23,9 @@ namespace PepperDash.Essentials.Core.Privacy
|
||||
|
||||
bool initialized;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether LED control is enabled
|
||||
/// </summary>
|
||||
public bool EnableLeds
|
||||
{
|
||||
get
|
||||
@@ -69,6 +72,11 @@ namespace PepperDash.Essentials.Core.Privacy
|
||||
/// </summary>
|
||||
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) :
|
||||
base(key)
|
||||
{
|
||||
@@ -264,6 +272,9 @@ namespace PepperDash.Essentials.Core.Privacy
|
||||
/// </summary>
|
||||
public class MicrophonePrivacyControllerFactory : EssentialsDeviceFactory<MicrophonePrivacyController>
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor for MicrophonePrivacyControllerFactory
|
||||
/// </summary>
|
||||
public MicrophonePrivacyControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "microphoneprivacycontroller" };
|
||||
|
||||
@@ -20,6 +20,13 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
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)
|
||||
: base(parent, warningTime, errorTime)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public class GenericCommunicationMonitor : StatusMonitorBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Client being monitored
|
||||
/// </summary>
|
||||
public IBasicCommunication Client { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -281,17 +284,29 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a CommunicationMonitorConfig
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Represents a CommunicationMonitorConfig
|
||||
/// </summary>
|
||||
public class CommunicationMonitorConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the PollInterval
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Gets or sets the PollInterval
|
||||
/// </summary>
|
||||
public int PollInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TimeToWarning
|
||||
/// </summary>
|
||||
public int TimeToWarning { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the TimeToError
|
||||
/// </summary>
|
||||
public int TimeToError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the PollString
|
||||
/// </summary>
|
||||
public string PollString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,12 +11,39 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IStatusMonitor
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Parent
|
||||
/// </summary>
|
||||
IKeyed Parent { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when the status changes
|
||||
/// </summary>
|
||||
event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Status
|
||||
/// </summary>
|
||||
MonitorStatus Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Message
|
||||
/// </summary>
|
||||
string Message { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsOnlineFeedback
|
||||
/// </summary>
|
||||
BoolFeedback IsOnlineFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Start method
|
||||
/// </summary>
|
||||
void Start();
|
||||
|
||||
/// <summary>
|
||||
/// Stop method
|
||||
/// </summary>
|
||||
void Stop();
|
||||
}
|
||||
|
||||
@@ -26,6 +53,9 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface ICommunicationMonitor
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the CommunicationMonitor
|
||||
/// </summary>
|
||||
StatusMonitorBase CommunicationMonitor { get; }
|
||||
}
|
||||
|
||||
@@ -34,29 +64,57 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public enum MonitorStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// Status Unknown
|
||||
/// </summary>
|
||||
StatusUnknown = 0,
|
||||
IsOk = 1,
|
||||
InWarning = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Is Ok
|
||||
/// </summary>
|
||||
IsOk = 1,
|
||||
|
||||
/// <summary>
|
||||
/// In Warning
|
||||
/// </summary>
|
||||
InWarning = 2,
|
||||
|
||||
/// <summary>
|
||||
/// In Error
|
||||
/// </summary>
|
||||
InError = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a MonitorStatusChangeEventArgs
|
||||
/// </summary>
|
||||
public class MonitorStatusChangeEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Status
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Gets or sets the Status
|
||||
/// </summary>
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for MonitorStatusChangeEventArgs
|
||||
/// </summary>
|
||||
/// <param name="status">monitor status</param>
|
||||
public MonitorStatusChangeEventArgs(MonitorStatus status)
|
||||
{
|
||||
Status = status;
|
||||
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)
|
||||
{
|
||||
Status = status;
|
||||
|
||||
@@ -13,8 +13,14 @@ using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for status monitors
|
||||
/// </summary>
|
||||
public abstract class StatusMonitorBase : IStatusMonitor, IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when status changes
|
||||
/// </summary>
|
||||
public event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
|
||||
|
||||
/// <summary>
|
||||
@@ -27,15 +33,24 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public string Name { get { return "Comm. monitor"; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Parent
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Gets or sets the Parent
|
||||
/// </summary>
|
||||
public IKeyed Parent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bool feedback for online status
|
||||
/// </summary>
|
||||
public BoolFeedback IsOnlineFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the monitored device is online
|
||||
/// </summary>
|
||||
public bool IsOnline;
|
||||
|
||||
/// <summary>
|
||||
/// Current monitor status
|
||||
/// </summary>
|
||||
public MonitorStatus Status
|
||||
{
|
||||
get { return _Status; }
|
||||
@@ -51,6 +66,9 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
MonitorStatus _Status;
|
||||
|
||||
/// <summary>
|
||||
/// Current status message
|
||||
/// </summary>
|
||||
public string Message
|
||||
{
|
||||
get { return _Message; }
|
||||
@@ -69,6 +87,12 @@ namespace PepperDash.Essentials.Core
|
||||
CTimer WarningTimer;
|
||||
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)
|
||||
{
|
||||
Parent = parent;
|
||||
@@ -83,9 +107,20 @@ namespace PepperDash.Essentials.Core
|
||||
ErrorTime = errorTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the monitor
|
||||
/// </summary>
|
||||
public abstract void Start();
|
||||
|
||||
/// <summary>
|
||||
/// Stops the monitor
|
||||
/// </summary>
|
||||
public abstract void Stop();
|
||||
|
||||
/// <summary>
|
||||
/// Fires the StatusChange event
|
||||
/// </summary>
|
||||
/// <param name="status">monitor status</param>
|
||||
protected void OnStatusChange(MonitorStatus status)
|
||||
{
|
||||
if (_Status == MonitorStatus.IsOk)
|
||||
@@ -98,6 +133,11 @@ namespace PepperDash.Essentials.Core
|
||||
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)
|
||||
{
|
||||
if (_Status == MonitorStatus.IsOk)
|
||||
@@ -110,12 +150,18 @@ namespace PepperDash.Essentials.Core
|
||||
handler(this, new MonitorStatusChangeEventArgs(status, message));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the error timers
|
||||
/// </summary>
|
||||
protected void StartErrorTimers()
|
||||
{
|
||||
if (WarningTimer == null) WarningTimer = new CTimer(o => { Status = MonitorStatus.InWarning; }, WarningTime);
|
||||
if (ErrorTimer == null) ErrorTimer = new CTimer(o => { Status = MonitorStatus.InError; }, ErrorTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops the error timers
|
||||
/// </summary>
|
||||
protected void StopErrorTimers()
|
||||
{
|
||||
if (WarningTimer != null) WarningTimer.Stop();
|
||||
@@ -124,6 +170,9 @@ namespace PepperDash.Essentials.Core
|
||||
ErrorTimer = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the error timers
|
||||
/// </summary>
|
||||
protected void ResetErrorTimers()
|
||||
{
|
||||
if(WarningTimer != null)
|
||||
|
||||
@@ -14,41 +14,51 @@ using PepperDash.Core;
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Collection class for multiple status monitors
|
||||
/// </summary>
|
||||
public class StatusMonitorCollection : IStatusMonitor
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Parent
|
||||
/// </summary>
|
||||
public IKeyed Parent { get; private set; }
|
||||
|
||||
List<IStatusMonitor> Monitors = new List<IStatusMonitor>();
|
||||
|
||||
#region IStatusMonitor Members
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when status changes
|
||||
/// </summary>
|
||||
public event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Status
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Gets or sets the Status
|
||||
/// </summary>
|
||||
public MonitorStatus Status { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Message
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Gets or sets the Message
|
||||
/// </summary>
|
||||
public string Message { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsOnlineFeedback
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Gets or sets the IsOnlineFeedback
|
||||
/// </summary>
|
||||
public BoolFeedback IsOnlineFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="parent">parent device</param>
|
||||
public StatusMonitorCollection(IKeyed parent)
|
||||
{
|
||||
Parent = parent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start method
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Start method
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
foreach (var mon in Monitors)
|
||||
@@ -135,7 +145,11 @@ namespace PepperDash.Essentials.Core
|
||||
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)
|
||||
{
|
||||
var handler = StatusChange;
|
||||
|
||||
@@ -14,10 +14,16 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
private IPartitionStateProvider _partitionSensor;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the controller is in Auto mode or Manual mode
|
||||
/// </summary>
|
||||
public bool IsInAutoMode { get; private set; }
|
||||
|
||||
private bool _partitionPresent;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the PartitionPresent state
|
||||
/// </summary>
|
||||
public bool PartitionPresent
|
||||
{
|
||||
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)
|
||||
{
|
||||
Key = key;
|
||||
|
||||
@@ -9,9 +9,15 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IPartitionStateProvider : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Feedback indicating whether the partition is present
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
BoolFeedback PartitionPresentFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the partition is present
|
||||
/// </summary>
|
||||
[JsonProperty("partitionPresent")]
|
||||
bool PartitionPresent { get; }
|
||||
}
|
||||
@@ -21,20 +27,41 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IPartitionController : IPartitionStateProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// List of adjacent room keys
|
||||
/// </summary>
|
||||
[JsonProperty("adjacentRoomKeys")]
|
||||
List<string> AdjacentRoomKeys { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the controller is in Auto mode or Manual mode
|
||||
/// </summary>
|
||||
[JsonProperty("isInAutoMode")]
|
||||
bool IsInAutoMode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the PartitionPresent state
|
||||
/// </summary>
|
||||
void SetPartitionStatePresent();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the PartitionPresent state to not present
|
||||
/// </summary>
|
||||
void SetPartitionStateNotPresent();
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the PartitionPresent state
|
||||
/// </summary>
|
||||
void ToggglePartitionState();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the controller to Manual mode
|
||||
/// </summary>
|
||||
void SetManualMode();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the controller to Auto mode
|
||||
/// </summary>
|
||||
void SetAutoMode();
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,17 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
/// <summary>
|
||||
/// Delegate for presets saved event
|
||||
/// </summary>
|
||||
/// <param name="presets">list of presets that were saved</param>
|
||||
public delegate void PresetsSavedCallback(List<PresetChannel> presets);
|
||||
|
||||
private readonly CCriticalSection _fileOps = new CCriticalSection();
|
||||
@@ -37,6 +46,12 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
private Action<bool> _enterFunction;
|
||||
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)
|
||||
: this(key, fileName)
|
||||
{
|
||||
@@ -71,6 +86,11 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
_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)
|
||||
{
|
||||
PulseTime = 150;
|
||||
@@ -88,17 +108,26 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
_initSuccess = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when a preset is recalled
|
||||
/// </summary>
|
||||
public event PresetRecalledCallback PresetRecalled;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when presets are saved
|
||||
/// </summary>
|
||||
public event PresetsSavedCallback PresetsSaved;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the PulseTime
|
||||
/// </summary>
|
||||
public int PulseTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DigitSpacingMs
|
||||
/// </summary>
|
||||
public int DigitSpacingMs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the PresetsAreLoaded
|
||||
/// </summary>
|
||||
@@ -109,6 +138,9 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
/// </summary>
|
||||
public List<PresetChannel> PresetsList { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Count of presets
|
||||
/// </summary>
|
||||
public int Count
|
||||
{
|
||||
get { return PresetsList != null ? PresetsList.Count : 0; }
|
||||
@@ -118,18 +150,25 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
/// Gets or sets the UseLocalImageStorage
|
||||
/// </summary>
|
||||
public bool UseLocalImageStorage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ImagesLocalHostPrefix
|
||||
/// </summary>
|
||||
public string ImagesLocalHostPrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ImagesPathPrefix
|
||||
/// </summary>
|
||||
public string ImagesPathPrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ListPathPrefix
|
||||
/// </summary>
|
||||
public string ListPathPrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when presets are loaded
|
||||
/// </summary>
|
||||
public event EventHandler PresetsLoaded;
|
||||
|
||||
|
||||
|
||||
@@ -15,36 +15,37 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
/// </summary>
|
||||
public class PresetBase
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
/// <summary>
|
||||
/// Gets or sets the ID
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public int ID { get; set; }
|
||||
/// <summary>
|
||||
/// Used to store the name of the preset
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Description
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the preset is defined(stored) in the codec
|
||||
/// Gets or sets Defined
|
||||
/// </summary>
|
||||
[JsonProperty("defined")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Defined
|
||||
/// </summary>
|
||||
public bool Defined { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if the preset has the capability to be defined
|
||||
/// </summary>
|
||||
[JsonProperty("isDefinable")]
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsDefinable
|
||||
/// </summary>
|
||||
[JsonProperty("isDefinable")]
|
||||
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)
|
||||
{
|
||||
ID = id;
|
||||
|
||||
@@ -15,40 +15,40 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
public class PresetChannel
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
[JsonProperty(Required = Required.Always,PropertyName = "name")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IconUrl
|
||||
/// </summary>
|
||||
[JsonProperty(Required = Required.Always, PropertyName = "iconUrl")]
|
||||
/// <summary>
|
||||
/// Gets or sets the IconUrl
|
||||
/// </summary>
|
||||
public string IconUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Channel
|
||||
/// </summary>
|
||||
[JsonProperty(Required = Required.Always, PropertyName = "channel")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Channel
|
||||
/// </summary>
|
||||
public string Channel { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a PresetsList
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Represents a PresetsList
|
||||
/// </summary>
|
||||
public class PresetsList
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
[JsonProperty(Required=Required.Always,PropertyName = "name")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Name
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Channels
|
||||
/// </summary>
|
||||
[JsonProperty(Required = Required.Always, PropertyName = "channels")]
|
||||
/// <summary>
|
||||
/// Gets or sets the Channels
|
||||
/// </summary>
|
||||
public List<PresetChannel> Channels { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,13 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
DevicePresetsView View;
|
||||
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,
|
||||
SubpageReferenceList owner, DevicePresetsView view)
|
||||
: base(index, owner)
|
||||
@@ -30,10 +37,10 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
Refresh();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear method
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Clear method
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public override void Clear()
|
||||
{
|
||||
Owner.GetBoolFeedbackSig(Index, 1).UserObject = null;
|
||||
@@ -42,10 +49,10 @@ namespace PepperDash.Essentials.Core.Presets
|
||||
Owner.StringInputSig(Index, 3).StringValue = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refresh method
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Refresh method
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public override void Refresh()
|
||||
{
|
||||
var name = View.ShowName ? Channel.Name : "";
|
||||
|
||||
@@ -14,8 +14,20 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
public class GenericQueue : IQueue<IQueueMessage>
|
||||
{
|
||||
private readonly string _key;
|
||||
|
||||
/// <summary>
|
||||
/// The internal queue
|
||||
/// </summary>
|
||||
protected readonly ConcurrentQueue<IQueueMessage> _queue;
|
||||
|
||||
/// <summary>
|
||||
/// The worker thread
|
||||
/// </summary>
|
||||
protected readonly Thread _worker;
|
||||
|
||||
/// <summary>
|
||||
/// The wait handle for the queue
|
||||
/// </summary>
|
||||
protected readonly CEvent _waitHandle = new CEvent();
|
||||
|
||||
private bool _delayEnabled;
|
||||
@@ -256,6 +268,9 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
Disposed = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizer
|
||||
/// </summary>
|
||||
~GenericQueue()
|
||||
{
|
||||
Dispose(true);
|
||||
|
||||
@@ -8,7 +8,15 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
/// <summary>
|
||||
/// gets the disposed status of the queue
|
||||
/// </summary>
|
||||
bool Disposed { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
/// </summary>
|
||||
public interface IQueueMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Dispatches the message
|
||||
/// </summary>
|
||||
void Dispatch();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@ using PepperDash.Core;
|
||||
|
||||
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
|
||||
{
|
||||
private readonly Action<string> _processStringAction;
|
||||
@@ -98,6 +101,9 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
/// </summary>
|
||||
public bool Disposed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Finalizer
|
||||
/// </summary>
|
||||
~StringResponseProcessor()
|
||||
{
|
||||
Dispose(false);
|
||||
|
||||
@@ -15,10 +15,29 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public class ActionIncrementer
|
||||
{
|
||||
/// <summary>
|
||||
/// The amount to change the value by each increment
|
||||
/// </summary>
|
||||
public int ChangeAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum value for the incrementer
|
||||
/// </summary>
|
||||
public int MaxValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The minimum value for the incrementer
|
||||
/// </summary>
|
||||
public int MinValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The delay before repeating starts
|
||||
/// </summary>
|
||||
public uint RepeatDelay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The time between repeats
|
||||
/// </summary>
|
||||
public uint RepeatTime { get; set; }
|
||||
|
||||
Action<int> SetAction;
|
||||
|
||||
@@ -16,14 +16,44 @@ namespace PepperDash.Essentials.Core
|
||||
public class UshortSigIncrementer
|
||||
{
|
||||
UShortInputSig TheSig;
|
||||
|
||||
/// <summary>
|
||||
/// The amount to change the value by each increment
|
||||
/// </summary>
|
||||
public ushort ChangeAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum value for the incrementer
|
||||
/// </summary>
|
||||
public int MaxValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The minimum value for the incrementer
|
||||
/// </summary>
|
||||
public int MinValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The delay before repeating starts
|
||||
/// </summary>
|
||||
public uint RepeatDelay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The time between repeats
|
||||
/// </summary>
|
||||
public uint RepeatTime { get; set; }
|
||||
|
||||
bool SignedMode;
|
||||
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)
|
||||
{
|
||||
TheSig = sig;
|
||||
|
||||
Reference in New Issue
Block a user