diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo index 95c9dcb8..ca8de72b 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 Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs b/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs index 8ebec477..96987237 100644 --- a/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs +++ b/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; + +using Crestron.SimplSharp; using Crestron.SimplSharpPro; using Crestron.SimplSharpPro.DeviceSupport; @@ -59,6 +61,36 @@ namespace PepperDash.Essentials.Core return sig.SetBoolSigAction(b => { if (!b) a(); }); } + /// + /// + /// + /// + /// + /// + /// + public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction) + { + CTimer heldTimer = null; + return tl.SetBoolSigAction(sigNum, press => + { + 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) + // Hold action here + heldAction(); + }, heldMs); + } + + else if (heldTimer != null) // released + heldTimer.Stop(); + // could also revise this else to fire a released action as well as cancel the timer + }); + } + /// /// diff --git a/Essentials DM/Essentials_DM/Essentials_DM.projectinfo b/Essentials DM/Essentials_DM/Essentials_DM.projectinfo index aefade70..2fd062fe 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/Essentials Devices Common.projectinfo b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo index 43170c84..3c2613d0 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/PepperDashEssentials/PepperDashEssentials.projectinfo b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo index dadd6b89..d044573c 100644 Binary files a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo and b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo differ diff --git a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs index dc9c861e..e55be61a 100644 --- a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs @@ -215,20 +215,11 @@ namespace PepperDash.Essentials //TriList.SetSigFalseAction(UIBoolJoin.RoomHeaderButtonPress, () => // ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible)); -#warning Add press and hold to gear button here #warning CHANGE BACK THIS JOIN NUMBER to GearHeaderButtonPress!!!!!! - // Hold button - CTimer GearButtonHoldTimer = null; - TriList.SetBoolSigAction(UIBoolJoin.GearButtonVisible, b => { //GearHeaderButtonPress - if (b) - GearButtonHoldTimer = new CTimer(o => - { - if (TriList.BooleanInput[UIBoolJoin.GearButtonVisible].BoolValue) //GearHeaderButtonPress - ShowInterlockedModal(UIBoolJoin.TechPanelSetupVisible); - }, 2000); - else if (GearButtonHoldTimer != null) - GearButtonHoldTimer.Stop(); - }); + + TriList.SetSigHeldAction(UIBoolJoin.GearButtonVisible, 2000, + () => ShowInterlockedModal(UIBoolJoin.TechPanelSetupVisible)); + TriList.SetSigFalseAction(UIBoolJoin.TechPagesExitButton, () => HideCurrentInterlockedModal()); TriList.BooleanInput[UIBoolJoin.GearButtonVisible].BoolValue = true; diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 315af71b..82f09a0d 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 2705067e..0738384d 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ