diff --git a/Essentials Core/PepperDashEssentialsBase/Devices/IUsageTracking.cs b/Essentials Core/PepperDashEssentialsBase/Devices/IUsageTracking.cs index 1dbc123d..d453802f 100644 --- a/Essentials Core/PepperDashEssentialsBase/Devices/IUsageTracking.cs +++ b/Essentials Core/PepperDashEssentialsBase/Devices/IUsageTracking.cs @@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Core if (handler != null) { - Debug.Console(1, "Device Usage Ended at {1}. In use for {2} minutes.", UsageEndTime, timeUsed.Minutes); + Debug.Console(1, "Device Usage Ended at {0}. In use for {1} minutes.", UsageEndTime, timeUsed.Minutes); handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes }); } } diff --git a/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs b/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs index 96987237..690bdacf 100644 --- a/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs +++ b/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs @@ -7,6 +7,8 @@ using Crestron.SimplSharp; using Crestron.SimplSharpPro; using Crestron.SimplSharpPro.DeviceSupport; +using PepperDash.Core; + namespace PepperDash.Essentials.Core { /// @@ -75,11 +77,12 @@ namespace PepperDash.Essentials.Core { if (press) { + // Could insert a pressed action here heldTimer = new CTimer(o => { // if still held and there's an action - if (tl.BooleanInput[sigNum].BoolValue && heldAction != null) + if (tl.BooleanOutput[sigNum].BoolValue && heldAction != null) // Hold action here heldAction(); }, heldMs); diff --git a/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs b/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs index 559073e3..f3a9329b 100644 --- a/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs +++ b/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs @@ -242,7 +242,8 @@ namespace PepperDash.Essentials.Devices.Displays CrestronInvoke.BeginInvoke(o => { CrestronEnvironment.Sleep(2500); - Debug.Console(2, this, "*#* NEW POWER STATE AFTER PAUSE={0} CURRENT={1}", _PowerValueIncomingWaitingForCheck, _PowerIsOn); + Debug.Console(2, this, "*#* NEW POWER STATE AFTER PAUSE={0} CURRENT={1}", + _PowerValueIncomingWaitingForCheck, _PowerIsOn); if (_PowerValueIncomingWaitingForCheck != _PowerIsOn) { _PowerIsOn = _PowerValueIncomingWaitingForCheck; diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 06816ff6..ec83f224 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -66,18 +66,6 @@ namespace PepperDash.Essentials DeviceManager.ActivateAll(); Debug.Console(0, "Essentials load complete\r" + "-------------------------------------------------------------"); - - //******************************************************************** -#warning Remove these test things: - - var cdt = new SecondsCountdownTimer("timer") { SecondsToCount = 20 }; - cdt.WasCancelled += (o,a) => Debug.Console(0, "TIMER CANCELLED FOOLS!"); - cdt.IsRunningFeedback.OutputChange += (o, a) => Debug.Console(0, "TIMER Running={0}", cdt.IsRunningFeedback); - cdt.PercentFeedback.OutputChange += (o, a) => Debug.Console(0, "TIMER {0}%", cdt.PercentFeedback); - cdt.TimeRemainingFeedback.OutputChange += (o,a) => Debug.Console(0, "TIMER time: {0}", cdt.TimeRemainingFeedback); - DeviceManager.AddDevice(cdt); - - //******************************************************************** } catch (Exception e) { diff --git a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs index 895a4c04..331d9729 100644 --- a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs +++ b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs @@ -880,7 +880,7 @@ namespace PepperDash.Essentials.Fusion /// /// void UsageTracker_DeviceUsageEnded(object sender, DeviceUsageEventArgs e) - { + { var device = sender as Device; var configDevice = ConfigReader.ConfigObject.Devices.Where(d => d.Key.Equals(device.Key)); diff --git a/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs b/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs index 1ce65f0b..9fce49ad 100644 --- a/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs +++ b/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs @@ -246,8 +246,16 @@ namespace PepperDash.Essentials { var lastSource = dict[LastSourceKey].SourceDevice; - if (lastSource != null && lastSource is IUsageTracking) - (lastSource as IUsageTracking).UsageTracker.EndDeviceUsage(); + try + { + if (lastSource != null && lastSource is IUsageTracking) + (lastSource as IUsageTracking).UsageTracker.EndDeviceUsage(); + } + catch (Exception e) + { + Debug.Console(1, this, "EXCEPTION in end usage tracking (257):\r{0}", e); + } + } // Let's run it diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index c4b615c3..b08b8cc3 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 7004baed..8fd2918c 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ