diff --git a/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs b/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
index 6979dded..da6127fd 100644
--- a/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
+++ b/Essentials Core/PepperDashEssentialsBase/Crestron/CrestronGenericBaseDevice.cs
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials.Core
///
/// A bridge class to cover the basic features of GenericBase hardware
///
- public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor
+ public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{
public virtual GenericBase Hardware { get; protected set; }
@@ -87,7 +87,13 @@ namespace PepperDash.Essentials.Core
#region IStatusMonitor Members
public StatusMonitorBase CommunicationMonitor { get; private set; }
- #endregion
+ #endregion
+
+ #region IUsageTracking Members
+
+ public UsageTracking UsageTracker { get; set; }
+
+ #endregion
}
//***********************************************************************************
diff --git a/Essentials Core/PepperDashEssentialsBase/Devices/IUsageTracking.cs b/Essentials Core/PepperDashEssentialsBase/Devices/IUsageTracking.cs
new file mode 100644
index 00000000..2f7cc084
--- /dev/null
+++ b/Essentials Core/PepperDashEssentialsBase/Devices/IUsageTracking.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+namespace PepperDash.Essentials.Core
+{
+ public interface IUsageTracking
+ {
+ UsageTracking UsageTracker { get; set; }
+ }
+
+ //public static class IUsageTrackingExtensions
+ //{
+ // public static void EnableUsageTracker(this IUsageTracking device)
+ // {
+ // device.UsageTracker = new UsageTracking();
+ // }
+ //}
+
+ public class UsageTracking
+ {
+ public event EventHandler DeviceUsageEnded;
+
+ public InUseTracking InUseTracker { get; protected set; }
+
+ public bool UsageIsTracked { get; set; }
+ public DateTime UsageStartTime { get; protected set; }
+ public DateTime UsageEndTime { get; protected set; }
+
+ public UsageTracking()
+ {
+ InUseTracker.InUseFeedback.OutputChange +=new EventHandler(InUseFeedback_OutputChange);
+ }
+
+ void InUseFeedback_OutputChange(object sender, EventArgs e)
+ {
+ if(InUseTracker.InUseFeedback.BoolValue)
+ {
+ StartDeviceUsage();
+ }
+ else
+ {
+ EndDeviceUsage();
+ }
+ }
+
+
+ ///
+ /// Stores the usage start time
+ ///
+ public void StartDeviceUsage()
+ {
+ UsageStartTime = DateTime.Now;
+ }
+
+ ///
+ /// Calculates the difference between the usage start and end times, gets the total minutes used and fires an event to pass that info to a consumer
+ ///
+ public void EndDeviceUsage()
+ {
+ UsageEndTime = DateTime.Now;
+
+ var timeUsed = UsageEndTime - UsageStartTime;
+
+ var handler = DeviceUsageEnded;
+
+ if (handler != null)
+ {
+ handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
+ }
+ }
+ }
+
+ public class DeviceUsageEventArgs : EventArgs
+ {
+ public DateTime UsageEndTime { get; set; }
+ public int MinutesUsed { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs b/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
index 83d77cea..e4d18584 100644
--- a/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
+++ b/Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
@@ -16,12 +16,14 @@ namespace PepperDash.Essentials.Core
///
///
///
- public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling
+ public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
{
public BoolFeedback PowerIsOnFeedback { get; protected set; }
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
public BoolFeedback IsWarmingUpFeedback { get; private set; }
+ public UsageTracking UsageTracker { get; set; }
+
public uint WarmupTime { get; set; }
public uint CooldownTime { get; set; }
@@ -77,7 +79,7 @@ namespace PepperDash.Essentials.Core
///
///
///
- public abstract class TwoWayDisplayBase : DisplayBase
+ public abstract class TwoWayDisplayBase : DisplayBase
{
public StringFeedback CurrentInputFeedback { get; private set; }
@@ -104,6 +106,8 @@ namespace PepperDash.Essentials.Core
CooldownTime = 15000;
Feedbacks.Add(CurrentInputFeedback);
+
+
}
}
diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
index 47d70573..4bc855c7 100644
--- a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
+++ b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
@@ -115,6 +115,7 @@
+
diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo
index 06b51cc0..ed841c4e 100644
Binary files a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo and b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo differ
diff --git a/Essentials DM/Essentials_DM/Essentials_DM.projectinfo b/Essentials DM/Essentials_DM/Essentials_DM.projectinfo
index b4d4c1b8..ac557c07 100644
Binary files a/Essentials DM/Essentials_DM/Essentials_DM.projectinfo and b/Essentials DM/Essentials_DM/Essentials_DM.projectinfo differ
diff --git a/Essentials Devices Common/Essentials Devices Common/DiscPlayer/IRDiscPlayerBase.cs b/Essentials Devices Common/Essentials Devices Common/DiscPlayer/IRDiscPlayerBase.cs
index 95b3eda8..f4d3c241 100644
--- a/Essentials Devices Common/Essentials Devices Common/DiscPlayer/IRDiscPlayerBase.cs
+++ b/Essentials Devices Common/Essentials Devices Common/DiscPlayer/IRDiscPlayerBase.cs
@@ -1,308 +1,314 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Routing;
-
-namespace PepperDash.Essentials.Devices.Common
-{
- public class IRBlurayBase : Device, IDiscPlayerControls, IUiDisplayInfo, IRoutingOutputs
- {
- public IrOutputPortController IrPort { get; private set; }
-
- public uint DisplayUiType { get { return DisplayUiConstants.TypeBluray; } }
-
- public IRBlurayBase(string key, string name, IrOutputPortController portCont)
- : base(key, name)
- {
- IrPort = portCont;
- DeviceManager.AddDevice(portCont);
-
- HasKeypadAccessoryButton1 = true;
- KeypadAccessoryButton1Command = "Clear";
- KeypadAccessoryButton1Label = "Clear";
-
- HasKeypadAccessoryButton2 = true;
- KeypadAccessoryButton2Command = "NumericEnter";
- KeypadAccessoryButton2Label = "Enter";
-
- PowerIsOnFeedback = new BoolFeedback(() => _PowerIsOn);
-
- HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.AudioVideo,
- eRoutingPortConnectionType.Hdmi, null, this);
- AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
- eRoutingPortConnectionType.DigitalAudio, null, this);
- OutputPorts = new RoutingPortCollection { HdmiOut, AnyAudioOut };
- }
-
-
- #region IDPad Members
-
- public void Up(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_UP_ARROW, pressRelease);
- }
-
- public void Down(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_DN_ARROW, pressRelease);
- }
-
- public void Left(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_LEFT_ARROW, pressRelease);
- }
-
- public void Right(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_RIGHT_ARROW, pressRelease);
- }
-
- public void Select(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
- }
-
- public void Menu(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_MENU, pressRelease);
- }
-
- public void Exit(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_EXIT, pressRelease);
- }
-
- #endregion
-
- #region INumericKeypad Members
-
- public void Digit0(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_0, pressRelease);
- }
-
- public void Digit1(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_1, pressRelease);
- }
-
- public void Digit2(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_2, pressRelease);
- }
-
- public void Digit3(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_3, pressRelease);
- }
-
- public void Digit4(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_4, pressRelease);
- }
-
- public void Digit5(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_5, pressRelease);
- }
-
- public void Digit6(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_6, pressRelease);
- }
-
- public void Digit7(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_7, pressRelease);
- }
-
- public void Digit8(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_8, pressRelease);
- }
-
- public void Digit9(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_9, pressRelease);
- }
-
- ///
- /// Defaults to true
- ///
- public bool HasKeypadAccessoryButton1 { get; set; }
-
- ///
- /// Defaults to "-"
- ///
- public string KeypadAccessoryButton1Label { get; set; }
-
-
- ///
- /// Defaults to "Dash"
- ///
- public string KeypadAccessoryButton1Command { get; set; }
-
- public void KeypadAccessoryButton1(bool pressRelease)
- {
- IrPort.PressRelease(KeypadAccessoryButton1Command, pressRelease);
- }
-
- ///
- /// Defaults to true
- ///
- public bool HasKeypadAccessoryButton2 { get; set; }
-
- ///
- /// Defaults to "Enter"
- ///
- public string KeypadAccessoryButton2Label { get; set; }
-
-
- ///
- /// Defaults to "Enter"
- ///
- public string KeypadAccessoryButton2Command { get; set; }
-
- public void KeypadAccessoryButton2(bool pressRelease)
- {
- IrPort.PressRelease(KeypadAccessoryButton2Command, pressRelease);
- }
-
- #endregion
-
- #region IChannelFunctions Members
-
- public void ChannelUp(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_CH_PLUS, pressRelease);
- }
-
- public void ChannelDown(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_CH_MINUS, pressRelease);
- }
-
- public void LastChannel(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_LAST, pressRelease);
- }
-
- public void Guide(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_GUIDE, pressRelease);
- }
-
- public void Info(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_INFO, pressRelease);
- }
-
- #endregion
-
- #region IColorFunctions Members
-
- public void Red(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_RED, pressRelease);
- }
-
- public void Green(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_GREEN, pressRelease);
- }
-
- public void Yellow(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_YELLOW, pressRelease);
- }
-
- public void Blue(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_BLUE, pressRelease);
- }
-
- #endregion
-
- #region IRoutingOutputs Members
-
- public RoutingOutputPort HdmiOut { get; private set; }
- public RoutingOutputPort AnyAudioOut { get; private set; }
- public RoutingPortCollection OutputPorts { get; private set; }
-
- #endregion
-
- #region IPower Members
-
- public void PowerOn()
- {
- IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, 200);
- _PowerIsOn = true;
- }
-
- public void PowerOff()
- {
- IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, 200);
- _PowerIsOn = false;
- }
-
- public void PowerToggle()
- {
- IrPort.Pulse(IROutputStandardCommands.IROut_POWER, 200);
- _PowerIsOn = false;
- }
-
- public BoolFeedback PowerIsOnFeedback { get; set; }
- bool _PowerIsOn;
-
- #endregion
-
- #region ITransport Members
-
- public void Play(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_PLAY, pressRelease);
- }
-
- public void Pause(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_PAUSE, pressRelease);
- }
-
- public void Rewind(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease);
- }
-
- public void FFwd(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_FSCAN, pressRelease);
- }
-
- public void ChapMinus(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease);
- }
-
- public void ChapPlus(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease);
- }
-
- public void Stop(bool pressRelease)
- {
- IrPort.PressRelease(IROutputStandardCommands.IROut_STOP, pressRelease);
- }
-
- public void Record(bool pressRelease)
- {
- }
-
- #endregion
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Routing;
+
+namespace PepperDash.Essentials.Devices.Common
+{
+ public class IRBlurayBase : Device, IDiscPlayerControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
+ {
+ public IrOutputPortController IrPort { get; private set; }
+
+ public uint DisplayUiType { get { return DisplayUiConstants.TypeBluray; } }
+
+ public IRBlurayBase(string key, string name, IrOutputPortController portCont)
+ : base(key, name)
+ {
+ IrPort = portCont;
+ DeviceManager.AddDevice(portCont);
+
+ HasKeypadAccessoryButton1 = true;
+ KeypadAccessoryButton1Command = "Clear";
+ KeypadAccessoryButton1Label = "Clear";
+
+ HasKeypadAccessoryButton2 = true;
+ KeypadAccessoryButton2Command = "NumericEnter";
+ KeypadAccessoryButton2Label = "Enter";
+
+ PowerIsOnFeedback = new BoolFeedback(() => _PowerIsOn);
+
+ HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.Hdmi, null, this);
+ AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
+ eRoutingPortConnectionType.DigitalAudio, null, this);
+ OutputPorts = new RoutingPortCollection { HdmiOut, AnyAudioOut };
+ }
+
+
+ #region IDPad Members
+
+ public void Up(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_UP_ARROW, pressRelease);
+ }
+
+ public void Down(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_DN_ARROW, pressRelease);
+ }
+
+ public void Left(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_LEFT_ARROW, pressRelease);
+ }
+
+ public void Right(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_RIGHT_ARROW, pressRelease);
+ }
+
+ public void Select(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
+ }
+
+ public void Menu(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_MENU, pressRelease);
+ }
+
+ public void Exit(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_EXIT, pressRelease);
+ }
+
+ #endregion
+
+ #region INumericKeypad Members
+
+ public void Digit0(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_0, pressRelease);
+ }
+
+ public void Digit1(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_1, pressRelease);
+ }
+
+ public void Digit2(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_2, pressRelease);
+ }
+
+ public void Digit3(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_3, pressRelease);
+ }
+
+ public void Digit4(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_4, pressRelease);
+ }
+
+ public void Digit5(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_5, pressRelease);
+ }
+
+ public void Digit6(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_6, pressRelease);
+ }
+
+ public void Digit7(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_7, pressRelease);
+ }
+
+ public void Digit8(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_8, pressRelease);
+ }
+
+ public void Digit9(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_9, pressRelease);
+ }
+
+ ///
+ /// Defaults to true
+ ///
+ public bool HasKeypadAccessoryButton1 { get; set; }
+
+ ///
+ /// Defaults to "-"
+ ///
+ public string KeypadAccessoryButton1Label { get; set; }
+
+
+ ///
+ /// Defaults to "Dash"
+ ///
+ public string KeypadAccessoryButton1Command { get; set; }
+
+ public void KeypadAccessoryButton1(bool pressRelease)
+ {
+ IrPort.PressRelease(KeypadAccessoryButton1Command, pressRelease);
+ }
+
+ ///
+ /// Defaults to true
+ ///
+ public bool HasKeypadAccessoryButton2 { get; set; }
+
+ ///
+ /// Defaults to "Enter"
+ ///
+ public string KeypadAccessoryButton2Label { get; set; }
+
+
+ ///
+ /// Defaults to "Enter"
+ ///
+ public string KeypadAccessoryButton2Command { get; set; }
+
+ public void KeypadAccessoryButton2(bool pressRelease)
+ {
+ IrPort.PressRelease(KeypadAccessoryButton2Command, pressRelease);
+ }
+
+ #endregion
+
+ #region IChannelFunctions Members
+
+ public void ChannelUp(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_CH_PLUS, pressRelease);
+ }
+
+ public void ChannelDown(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_CH_MINUS, pressRelease);
+ }
+
+ public void LastChannel(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_LAST, pressRelease);
+ }
+
+ public void Guide(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_GUIDE, pressRelease);
+ }
+
+ public void Info(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_INFO, pressRelease);
+ }
+
+ #endregion
+
+ #region IColorFunctions Members
+
+ public void Red(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_RED, pressRelease);
+ }
+
+ public void Green(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_GREEN, pressRelease);
+ }
+
+ public void Yellow(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_YELLOW, pressRelease);
+ }
+
+ public void Blue(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_BLUE, pressRelease);
+ }
+
+ #endregion
+
+ #region IRoutingOutputs Members
+
+ public RoutingOutputPort HdmiOut { get; private set; }
+ public RoutingOutputPort AnyAudioOut { get; private set; }
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ #endregion
+
+ #region IPower Members
+
+ public void PowerOn()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, 200);
+ _PowerIsOn = true;
+ }
+
+ public void PowerOff()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, 200);
+ _PowerIsOn = false;
+ }
+
+ public void PowerToggle()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_POWER, 200);
+ _PowerIsOn = false;
+ }
+
+ public BoolFeedback PowerIsOnFeedback { get; set; }
+ bool _PowerIsOn;
+
+ #endregion
+
+ #region ITransport Members
+
+ public void Play(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_PLAY, pressRelease);
+ }
+
+ public void Pause(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_PAUSE, pressRelease);
+ }
+
+ public void Rewind(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_RSCAN, pressRelease);
+ }
+
+ public void FFwd(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_FSCAN, pressRelease);
+ }
+
+ public void ChapMinus(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease);
+ }
+
+ public void ChapPlus(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease);
+ }
+
+ public void Stop(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_STOP, pressRelease);
+ }
+
+ public void Record(bool pressRelease)
+ {
+ }
+
+ #endregion
+
+ #region IUsageTracking Members
+
+ public UsageTracking UsageTracker { get; set; }
+
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo
index 860463e5..988b4159 100644
Binary files a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo and b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo differ
diff --git a/Essentials Devices Common/Essentials Devices Common/PC/InRoomPc.cs b/Essentials Devices Common/Essentials Devices Common/PC/InRoomPc.cs
index ee43356b..cc8c5121 100644
--- a/Essentials Devices Common/Essentials Devices Common/PC/InRoomPc.cs
+++ b/Essentials Devices Common/Essentials Devices Common/PC/InRoomPc.cs
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Devices.Common
///
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
///
- public class InRoomPc : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo
+ public class InRoomPc : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
public string IconName { get; set; }
@@ -50,6 +50,12 @@ namespace PepperDash.Essentials.Devices.Common
get { return this.GetVideoStatuses().ToList(); }
}
- #endregion
+ #endregion
+
+ #region IUsageTracking Members
+
+ public UsageTracking UsageTracker { get; set; }
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/Essentials Devices Common/Essentials Devices Common/PC/Laptop.cs b/Essentials Devices Common/Essentials Devices Common/PC/Laptop.cs
index 3d6f2834..e8a67705 100644
--- a/Essentials Devices Common/Essentials Devices Common/PC/Laptop.cs
+++ b/Essentials Devices Common/Essentials Devices Common/PC/Laptop.cs
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Devices.Common
///
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
///
- public class Laptop : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo
+ public class Laptop : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
public string IconName { get; set; }
@@ -50,6 +50,12 @@ namespace PepperDash.Essentials.Devices.Common
get { return this.GetVideoStatuses().ToList(); }
}
- #endregion
+ #endregion
+
+ #region IUsageTracking Members
+
+ public UsageTracking UsageTracker { get; set; }
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs b/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs
index a5e730c1..671272f5 100644
--- a/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs
+++ b/Essentials Devices Common/Essentials Devices Common/SetTopBox/IRSetTopBoxBase.cs
@@ -12,7 +12,7 @@ using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Devices.Common
{
- public class IRSetTopBoxBase : Device, ISetTopBoxControls, IUiDisplayInfo, IRoutingOutputs
+ public class IRSetTopBoxBase : Device, ISetTopBoxControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
{
public IrOutputPortController IrPort { get; private set; }
@@ -332,6 +332,12 @@ namespace PepperDash.Essentials.Devices.Common
IrPort.PressRelease(IROutputStandardCommands.IROut_STOP, pressRelease);
}
- #endregion
+ #endregion
+
+ #region IUsageTracking Members
+
+ public UsageTracking UsageTracker { get; set; }
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs
index 70844526..08ab826a 100644
--- a/Essentials/PepperDashEssentials/ControlSystem.cs
+++ b/Essentials/PepperDashEssentials/ControlSystem.cs
@@ -175,8 +175,6 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(room);
}
-#warning Add Fusion connector to room factory?
-
}
else
Debug.Console(0, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
diff --git a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs
index 13726008..49b8af1f 100644
--- a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs
+++ b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs
@@ -14,10 +14,9 @@ using Crestron.SimplSharpPro.Fusion;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core;
-
using PepperDash.Core;
using PepperDash.Essentials;
+using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common;
@@ -314,6 +313,7 @@ namespace PepperDash.Essentials.Fusion
NetMask1 = FusionRoom.CreateOffsetStringSig(63, "Info - Processor - Net Mask 1", eSigIoMask.InputSigOnly);
NetMask2 = FusionRoom.CreateOffsetStringSig(64, "Info - Processor - Net Mask 2", eSigIoMask.InputSigOnly);
+ SetProcessorEthernetValues();
CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(CrestronEnvironment_EthernetEventHandler);
}
@@ -815,6 +815,18 @@ namespace PepperDash.Essentials.Fusion
break;
}
+
+ foreach (var kvp in dict)
+ {
+ var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
+
+ if (usageDevice != null)
+ {
+ usageDevice.UsageTracker = new UsageTracking();
+
+ usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_SourceUsageEnded);
+ }
+ }
}
else
@@ -824,6 +836,31 @@ namespace PepperDash.Essentials.Fusion
}
}
+
+ ///
+ /// Collects usage data from source and sends to Fusion
+ ///
+ ///
+ ///
+ void UsageTracker_SourceUsageEnded(object sender, DeviceUsageEventArgs e)
+ {
+ var device = sender as Device;
+
+ var configDevice = ConfigReader.ConfigObject.Devices.Where(d => d.Key.Equals(device.Key));
+
+ string group = "";
+
+#warning Figure out how to get the group value from the device config
+
+
+ //Double check my time and date formatting in the ToString() methods
+ string deviceUsage = string.Format("USAGE||{0}||{1}||TIME||{2}||{3}||{4}||{5}||{6})", e.UsageEndTime.ToString("YYYY-MM-DD"), e.UsageEndTime.ToString("HH-mm-ss"),
+ group, device.Name, e.MinutesUsed, "asset_id", CurrentMeeting.MeetingID);
+
+
+ FusionRoom.DeviceUsage.InputSig.StringValue = deviceUsage;
+ }
+
void TryAddRouteActionSigs(string attrName, uint attrNum, string routeKey, Device pSrc)
{
Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}",
@@ -924,6 +961,10 @@ namespace PepperDash.Essentials.Fusion
void SetUpDisplay()
{
+ //Setup Display Usage Monitoring
+
+#warning Somehow get list of room's displays and activate Usage tracking and subscribe to event
+
var display = Room.DefaultDisplay as DisplayBase;
if (display == null)
{
@@ -984,9 +1025,6 @@ namespace PepperDash.Essentials.Fusion
}
-
-
-
///
/// Helper to get the number from the end of a device's key string
///
diff --git a/Essentials/PepperDashEssentials/PepperDashEssentials.csproj b/Essentials/PepperDashEssentials/PepperDashEssentials.csproj
index ff171731..fc5a780d 100644
--- a/Essentials/PepperDashEssentials/PepperDashEssentials.csproj
+++ b/Essentials/PepperDashEssentials/PepperDashEssentials.csproj
@@ -83,7 +83,7 @@
False
..\..\..\pepperdash-simplsharp-core\Pepperdash Core\CLZ Builds\PepperDash_Core.dll
-
+
False
..\..\Essentials Core\PepperDashEssentialsBase\bin\PepperDash_Essentials_Core.dll
diff --git a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo
index 7b82a91e..53797766 100644
Binary files a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo and b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo differ
diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz
index 789f026a..12d9c516 100644
Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ
diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll
index c06df6d4..ae0efbfe 100644
Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ