diff --git a/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs b/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs
index 690bdacf..63e0b1cb 100644
--- a/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs
+++ b/Essentials Core/PepperDashEssentialsBase/Touchpanels/TriListExtensions.cs
@@ -64,13 +64,20 @@ namespace PepperDash.Essentials.Core
}
///
- ///
+ /// Sets an action to a held sig
///
- ///
- ///
- ///
- ///
+ /// The sig
public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction)
+ {
+ return SetSigHeldAction(tl, sigNum, heldMs, heldAction, null);
+ }
+
+
+ ///
+ /// Sets an action to a held sig as well as a released-without-hold action
+ ///
+ /// The sig
+ public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction, Action releaseAction)
{
CTimer heldTimer = null;
return tl.SetBoolSigAction(sigNum, press =>
@@ -87,10 +94,12 @@ namespace PepperDash.Essentials.Core
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
+ if (releaseAction != null)
+ releaseAction();
+ }
});
}
@@ -143,5 +152,13 @@ namespace PepperDash.Essentials.Core
{
return ClearSigAction(tl.StringOutput[sigNum]) as StringOutputSig;
}
+
+ ///
+ /// Helper method to set the value of a bool Sig on tri list
+ ///
+ public static void SetBool(this BasicTriList tl, uint sigNum, bool value)
+ {
+ tl.BooleanInput[sigNum].BoolValue = value;
+ }
}
}
\ No newline at end of file
diff --git a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs
index 1e314bd6..72577ef4 100644
--- a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs
+++ b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs
@@ -41,10 +41,10 @@ namespace PepperDash.Essentials.Fusion
StringSigData CurrentRoomSourceNameSig;
#region System Info Sigs
- StringSigData SystemName;
- StringSigData Model;
- StringSigData SerialNumber;
- StringSigData Uptime;
+ //StringSigData SystemName;
+ //StringSigData Model;
+ //StringSigData SerialNumber;
+ //StringSigData Uptime;
#endregion
@@ -966,13 +966,13 @@ namespace PepperDash.Essentials.Fusion
}
// add xpanel here
- if (dev is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
- {
- if (attrNum > 10)
- continue;
- attrName = "Online - XPanel " + attrNum;
- attrNum += 160;
- }
+ //if (dev is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
+ //{
+ // if (attrNum > 10)
+ // continue;
+ // attrName = "Online - XPanel " + attrNum;
+ // attrNum += 160;
+ //}
//else
if (dev is DisplayBase)
diff --git a/Essentials/PepperDashEssentials/PepperDashEssentials.csproj b/Essentials/PepperDashEssentials/PepperDashEssentials.csproj
index 4e062dea..aebf06cc 100644
--- a/Essentials/PepperDashEssentials/PepperDashEssentials.csproj
+++ b/Essentials/PepperDashEssentials/PepperDashEssentials.csproj
@@ -160,19 +160,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -187,6 +189,7 @@
+
diff --git a/Essentials/PepperDashEssentials/UI/CrestronTouchpanelPropertiesConfig.cs b/Essentials/PepperDashEssentials/UI/CrestronTouchpanelPropertiesConfig.cs
new file mode 100644
index 00000000..f327e0d5
--- /dev/null
+++ b/Essentials/PepperDashEssentials/UI/CrestronTouchpanelPropertiesConfig.cs
@@ -0,0 +1,33 @@
+namespace PepperDash.Essentials
+{
+ public class CrestronTouchpanelPropertiesConfig
+ {
+ public string IpId { get; set; }
+ public string DefaultRoomKey { get; set; }
+ public string RoomListKey { get; set; }
+ public string SgdFile { get; set; }
+ public string ProjectName { get; set; }
+ public bool ShowVolumeGauge { get; set; }
+ public bool UsesSplashPage { get; set; }
+ public bool ShowDate { get; set; }
+ public bool ShowTime { get; set; }
+ public UiSetupPropertiesConfig Setup { get; set; }
+
+ ///
+ /// The count of sources that will trigger the "additional" arrows to show on the SRL.
+ /// Defaults to 5
+ ///
+ public int SourcesOverflowCount { get; set; }
+
+ public CrestronTouchpanelPropertiesConfig()
+ {
+ SourcesOverflowCount = 5;
+ }
+ }
+
+ public class UiSetupPropertiesConfig
+ {
+ public bool IsVisible { get; set; }
+ }
+
+}
\ No newline at end of file
diff --git a/Essentials/PepperDashEssentials/UI/DualDisplaySourceSRLController.cs b/Essentials/PepperDashEssentials/UI/DualDisplaySourceSRLController.cs
new file mode 100644
index 00000000..c91d72f1
--- /dev/null
+++ b/Essentials/PepperDashEssentials/UI/DualDisplaySourceSRLController.cs
@@ -0,0 +1,28 @@
+//using System;
+//using System.Collections.Generic;
+//using System.Linq;
+//using System.Text;
+//using Crestron.SimplSharp;
+//using Crestron.SimplSharpPro;
+//using Crestron.SimplSharpPro.DeviceSupport;
+//using Crestron.SimplSharpPro.UI;
+
+//using PepperDash.Essentials.Core;
+
+//namespace PepperDash.Essentials
+//{
+// public class DualDisplaySourceSRLController : SubpageReferenceList
+// {
+// public DualDisplaySourceSRLController(BasicTriListWithSmartObject triList,
+// uint smartObjectId, EssentialsPresentationRoom room)
+// : base(triList, smartObjectId, 3, 3, 3)
+// {
+// var srcList = room.s items.Values.ToList().OrderBy(s => s.Order);
+// foreach (var item in srcList)
+// {
+// GetBoolFeedbackSig(index, 1).UserObject = new Action(routeAction);
+
+// }
+// }
+// }
+//}
\ No newline at end of file
diff --git a/Essentials/PepperDashEssentials/UI/EssentialsTouchpanelController.cs b/Essentials/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
new file mode 100644
index 00000000..8ad6ab1a
--- /dev/null
+++ b/Essentials/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
@@ -0,0 +1,221 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.CrestronIO;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.UI;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.PageManagers;
+
+namespace PepperDash.Essentials
+{
+ public class EssentialsTouchpanelController : Device
+ {
+ public BasicTriListWithSmartObject Panel { get; private set; }
+
+ public PanelDriverBase PanelDriver { get; private set; }
+
+ CTimer BacklightTransitionedOnTimer;
+
+ public EssentialsTouchpanelController(string key, string name, Tswx52ButtonVoiceControl tsw,
+ string projectName, string sgdPath)
+ : base(key, name)
+ {
+ Panel = tsw;
+ tsw.LoadSmartObjects(sgdPath);
+ tsw.SigChange += new Crestron.SimplSharpPro.DeviceSupport.SigEventHandler(Tsw_SigChange);
+ }
+
+ ///
+ /// Config constructor
+ ///
+ public EssentialsTouchpanelController(string key, string name, string type, CrestronTouchpanelPropertiesConfig props, uint id)
+ : base(key, name)
+ {
+ AddPostActivationAction(() =>
+ {
+ Debug.Console(0, this, "post-activation linking");
+ type = type.ToLower();
+ try
+ {
+ if (type == "crestronapp")
+ {
+ var app = new CrestronApp(id, Global.ControlSystem);
+ app.ParameterProjectName.Value = props.ProjectName;
+ Panel = app;
+ }
+ else if (type == "tsw560")
+ Panel = new Tsw560(id, Global.ControlSystem);
+ else if (type == "tsw752")
+ Panel = new Tsw752(id, Global.ControlSystem);
+ else if (type == "tsw1052")
+ Panel = new Tsw1052(id, Global.ControlSystem);
+ else
+ {
+ Debug.Console(0, this, "WARNING: Cannot create TSW controller with type '{0}'", type);
+ return;
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, this, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message);
+ return;
+ }
+
+ // Reserved sigs
+ if (Panel is TswFt5ButtonSystem)
+ {
+ var tsw = Panel as TswFt5ButtonSystem;
+ tsw.ExtenderSystemReservedSigs.Use();
+ tsw.ExtenderSystemReservedSigs.DeviceExtenderSigChange
+ += ExtenderSystemReservedSigs_DeviceExtenderSigChange;
+ }
+
+ new CTimer(o =>
+ {
+ var regSuccess = Panel.Register();
+ if (regSuccess != eDeviceRegistrationUnRegistrationResponse.Success)
+ Debug.Console(0, this, "WARNING: Registration failed. Continuing, but panel may not function: {0}", regSuccess);
+
+ // Give up cleanly if SGD is not present.
+ var sgdName = @"\NVRAM\Program" + InitialParametersClass.ApplicationNumber
+ + @"\sgd\" + props.SgdFile;
+ if (!File.Exists(sgdName))
+ {
+ Debug.Console(0, this, "WARNING: Smart object file '{0}' not present. Exiting TSW load", sgdName);
+ return;
+ }
+
+ Panel.LoadSmartObjects(sgdName);
+ Panel.SigChange += Tsw_SigChange;
+
+ var mainDriver = new EssentialsPanelMainInterfaceDriver(Panel, props);
+ // Then the AV driver
+
+ // spin up different room drivers depending on room type
+ var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
+ if (room is EssentialsHuddleSpaceRoom)
+ {
+ Debug.Console(0, this, "Adding huddle space driver");
+ var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
+ avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
+ avDriver.DefaultRoomKey = props.DefaultRoomKey;
+ mainDriver.AvDriver = avDriver;
+ LoadAndShowDriver(mainDriver); // This is a little convoluted.
+
+ if (Panel is TswFt5ButtonSystem)
+ {
+ var tsw = Panel as TswFt5ButtonSystem;
+ // Wire up hard keys
+ tsw.Power.UserObject = new Action(b => { if (!b) avDriver.PowerButtonPressed(); });
+ //tsw.Home.UserObject = new Action(b => { if (!b) HomePressed(); });
+ tsw.Up.UserObject = new Action(avDriver.VolumeUpPress);
+ tsw.Down.UserObject = new Action(avDriver.VolumeDownPress);
+ tsw.ButtonStateChange += new ButtonEventHandler(Tsw_ButtonStateChange);
+ }
+ }
+ else if (room is EssentialsPresentationRoom)
+ {
+ Debug.Console(0, this, "Adding presentation room driver");
+ var avDriver = new EssentialsPresentationPanelAvFunctionsDriver(mainDriver, props);
+ avDriver.CurrentRoom = room as EssentialsPresentationRoom;
+ avDriver.DefaultRoomKey = props.DefaultRoomKey;
+ mainDriver.AvDriver = avDriver;
+ LoadAndShowDriver(mainDriver);
+
+ if (Panel is TswFt5ButtonSystem)
+ {
+ var tsw = Panel as TswFt5ButtonSystem;
+ // Wire up hard keys
+ tsw.Power.UserObject = new Action(b => { if (!b) avDriver.PowerButtonPressed(); });
+ //tsw.Home.UserObject = new Action(b => { if (!b) HomePressed(); });
+ tsw.Up.UserObject = new Action(avDriver.VolumeUpPress);
+ tsw.Down.UserObject = new Action(avDriver.VolumeDownPress);
+ tsw.ButtonStateChange += new ButtonEventHandler(Tsw_ButtonStateChange);
+ }
+ }
+ else
+ {
+ Debug.Console(0, this, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
+ }
+ }, 0);
+ });
+ }
+
+ public void LoadAndShowDriver(PanelDriverBase driver)
+ {
+ PanelDriver = driver;
+ driver.Show();
+ }
+
+ void HomePressed()
+ {
+ if (BacklightTransitionedOnTimer == null)
+ PanelDriver.BackButtonPressed();
+ }
+
+
+ void ExtenderSystemReservedSigs_DeviceExtenderSigChange(DeviceExtender currentDeviceExtender, SigEventArgs args)
+ {
+ // If the sig is transitioning on, mark it in case it was home button that transitioned it
+ var blOnSig = (Panel as TswFt5ButtonSystem).ExtenderSystemReservedSigs.BacklightOnFeedback;
+ if (args.Sig == blOnSig && blOnSig.BoolValue)
+ {
+ BacklightTransitionedOnTimer = new CTimer(o =>
+ {
+ BacklightTransitionedOnTimer = null;
+ }, 200);
+ }
+ }
+
+ public void PulseBool(uint join)
+ {
+ var act = Panel.BooleanInput[join].UserObject as Action;
+ if (act != null)
+ {
+ act(true);
+ act(false);
+ }
+ }
+
+ public void SetBoolSig(uint join, bool value)
+ {
+ var act = Panel.BooleanInput[join].UserObject as Action;
+ if (act != null)
+ act(value);
+ }
+
+ public void SetIntSig(uint join, ushort value)
+ {
+ var act = Panel.BooleanInput[join].UserObject as Action;
+ if (act != null)
+ {
+ act(value);
+ }
+ }
+
+ void Tsw_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
+ {
+ if (Debug.Level == 2)
+ Debug.Console(2, this, "Sig change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
+ var uo = args.Sig.UserObject;
+ if (uo is Action)
+ (uo as Action)(args.Sig.BoolValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.UShortValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.StringValue);
+ }
+
+ void Tsw_ButtonStateChange(GenericBase device, ButtonEventArgs args)
+ {
+ var uo = args.Button.UserObject;
+ if(uo is Action)
+ (uo as Action)(args.Button.State == eButtonState.Pressed);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Essentials/PepperDashEssentials/UI/SubpageReferenceListActivityItem.cs b/Essentials/PepperDashEssentials/UI/SubpageReferenceListActivityItem.cs
new file mode 100644
index 00000000..4747a61a
--- /dev/null
+++ b/Essentials/PepperDashEssentials/UI/SubpageReferenceListActivityItem.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.UI;
+
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials
+{
+ public class SubpageReferenceListActivityItem : SubpageReferenceListItem
+ {
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// 0=Share, 1=Phone Call, 2=Video Call, 3=End Meeting
+ ///
+ public SubpageReferenceListActivityItem(uint index, SubpageReferenceList owner,
+ ushort buttonMode, Action pressAction)
+ : base(index, owner)
+ {
+ Owner.GetBoolFeedbackSig(Index, 1).UserObject = pressAction;
+ Owner.UShortInputSig(Index, 1).UShortValue = buttonMode;
+ }
+
+ ///
+ /// Called by SRL to release all referenced objects
+ ///
+ public override void Clear()
+ {
+ Owner.BoolInputSig(Index, 1).UserObject = null;
+ Owner.UShortInputSig(Index, 1).UShortValue = 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Essentials/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs b/Essentials/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
new file mode 100644
index 00000000..73cc5e71
--- /dev/null
+++ b/Essentials/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.UI;
+
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials
+{
+ public class SubpageReferenceListSourceItem : SubpageReferenceListItem
+ {
+ public SourceListItem SourceItem { get; private set; }
+
+ public SubpageReferenceListSourceItem(uint index, SubpageReferenceList owner,
+ SourceListItem sourceItem, Action routeAction)
+ : base(index, owner)
+ {
+ SourceItem = sourceItem;
+ owner.GetBoolFeedbackSig(index, 1).UserObject = new Action(routeAction);
+ owner.StringInputSig(index, 1).StringValue = SourceItem.PreferredName;
+ }
+
+ public void RegisterForSourceChange(IHasCurrentSourceInfoChange room)
+ {
+ room.CurrentSingleSourceChange -= room_CurrentSourceInfoChange;
+ room.CurrentSingleSourceChange += room_CurrentSourceInfoChange;
+ }
+
+ void room_CurrentSourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
+ {
+ if (type == ChangeType.WillChange && info == SourceItem)
+ ClearFeedback();
+ else if (type == ChangeType.DidChange && info == SourceItem)
+ SetFeedback();
+ }
+
+ ///
+ /// Called by SRL to release all referenced objects
+ ///
+ public override void Clear()
+ {
+ Owner.BoolInputSig(Index, 1).UserObject = null;
+ Owner.StringInputSig(Index, 1).StringValue = "";
+ }
+
+ ///
+ /// Sets the selected feedback on the button
+ ///
+ public void SetFeedback()
+ {
+ Owner.BoolInputSig(Index, 1).BoolValue = true;
+ }
+
+ ///
+ /// Clears the selected feedback on the button
+ ///
+ public void ClearFeedback()
+ {
+ Owner.BoolInputSig(Index, 1).BoolValue = false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Essentials/PepperDashEssentials/UI Drivers/DualDisplayRouting.cs b/Essentials/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
similarity index 100%
rename from Essentials/PepperDashEssentials/UI Drivers/DualDisplayRouting.cs
rename to Essentials/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
diff --git a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/Essentials/EssentialsHuddlePanelAvFunctionsDriver.cs
similarity index 93%
rename from Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs
rename to Essentials/PepperDashEssentials/UIDrivers/Essentials/EssentialsHuddlePanelAvFunctionsDriver.cs
index 6c599488..6bdab840 100644
--- a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs
+++ b/Essentials/PepperDashEssentials/UIDrivers/Essentials/EssentialsHuddlePanelAvFunctionsDriver.cs
@@ -1,970 +1,973 @@
-using System;
-using System.Collections.Generic;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.UI;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.SmartObjects;
-using PepperDash.Essentials.Core.PageManagers;
-
-namespace PepperDash.Essentials
-{
- ///
- ///
- ///
- public class EssentialsHuddlePanelAvFunctionsDriver : PanelDriverBase
- {
- CrestronTouchpanelPropertiesConfig Config;
-
- public enum UiDisplayMode
- {
- PresentationMode, AudioSetup
- }
-
- ///
- /// Whether volume ramping from this panel will show the volume
- /// gauge popup.
- ///
- public bool ShowVolumeGauge { get; set; }
-
- ///
- /// The amount of time that the volume buttons stays on screen, in ms
- ///
- public uint VolumeButtonPopupTimeout
- {
- get { return VolumeButtonsPopupFeedback.TimeoutMs; }
- set { VolumeButtonsPopupFeedback.TimeoutMs = value; }
- }
-
- ///
- /// The amount of time that the volume gauge stays on screen, in ms
- ///
- public uint VolumeGaugePopupTimeout
- {
- get { return VolumeGaugeFeedback.TimeoutMs; }
- set { VolumeGaugeFeedback.TimeoutMs = value; }
- }
-
- ///
- ///
- ///
- public uint PowerOffTimeout { get; set; }
-
- ///
- ///
- ///
- public string DefaultRoomKey
- {
- get { return _DefaultRoomKey; }
- set
- {
- _DefaultRoomKey = value;
- //CurrentRoom = DeviceManager.GetDeviceForKey(value) as EssentialsHuddleSpaceRoom;
- }
- }
- string _DefaultRoomKey;
-
- ///
- ///
- ///
- public EssentialsHuddleSpaceRoom CurrentRoom
- {
- get { return _CurrentRoom; }
- set
- {
- SetCurrentRoom(value);
- }
- }
- EssentialsHuddleSpaceRoom _CurrentRoom;
-
- ///
- ///
- ///
- uint CurrentInterlockedModalJoin;
-
- ///
- /// For hitting feedback
- ///
- BoolInputSig ShareButtonSig;
- BoolInputSig EndMeetingButtonSig;
-
- ///
- /// Controls the extended period that the volume gauge shows on-screen,
- /// as triggered by Volume up/down operations
- ///
- BoolFeedbackPulseExtender VolumeGaugeFeedback;
-
- ///
- /// Controls the period that the volume buttons show on non-hard-button
- /// interfaces
- ///
- BoolFeedbackPulseExtender VolumeButtonsPopupFeedback;
-
- ///
- /// The parent driver for this
- ///
- PanelDriverBase Parent;
-
- ///
- /// All children attached to this driver. For hiding and showing as a group.
- ///
- List ChildDrivers = new List();
-
- List CurrentDisplayModeSigsInUse = new List();
-
- //// Important smart objects
-
- ///
- /// Smart Object 3200
- ///
- SubpageReferenceList SourcesSrl;
-
- ///
- /// Smart Object 15022
- ///
- SubpageReferenceList ActivityFooterSrl;
-
- ///
- /// Tracks which audio page group the UI is in
- ///
- UiDisplayMode CurrentDisplayMode;
-
- ///
- /// The AV page mangagers that have been used, to keep them alive for later
- ///
- Dictionary