mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
Try catch on some Fusion usage bugs; Fixed press-hold on TriListExtensions
This commit is contained in:
@@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
if (handler != null)
|
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 });
|
handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ using Crestron.SimplSharp;
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -75,11 +77,12 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
if (press)
|
if (press)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Could insert a pressed action here
|
// Could insert a pressed action here
|
||||||
heldTimer = new CTimer(o =>
|
heldTimer = new CTimer(o =>
|
||||||
{
|
{
|
||||||
// if still held and there's an action
|
// 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
|
// Hold action here
|
||||||
heldAction();
|
heldAction();
|
||||||
}, heldMs);
|
}, heldMs);
|
||||||
|
|||||||
@@ -242,7 +242,8 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
CrestronInvoke.BeginInvoke(o =>
|
CrestronInvoke.BeginInvoke(o =>
|
||||||
{
|
{
|
||||||
CrestronEnvironment.Sleep(2500);
|
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)
|
if (_PowerValueIncomingWaitingForCheck != _PowerIsOn)
|
||||||
{
|
{
|
||||||
_PowerIsOn = _PowerValueIncomingWaitingForCheck;
|
_PowerIsOn = _PowerValueIncomingWaitingForCheck;
|
||||||
|
|||||||
@@ -66,18 +66,6 @@ namespace PepperDash.Essentials
|
|||||||
DeviceManager.ActivateAll();
|
DeviceManager.ActivateAll();
|
||||||
Debug.Console(0, "Essentials load complete\r" +
|
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)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -246,8 +246,16 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var lastSource = dict[LastSourceKey].SourceDevice;
|
var lastSource = dict[LastSourceKey].SourceDevice;
|
||||||
|
|
||||||
if (lastSource != null && lastSource is IUsageTracking)
|
try
|
||||||
(lastSource as IUsageTracking).UsageTracker.EndDeviceUsage();
|
{
|
||||||
|
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
|
// Let's run it
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user