Various tech page framework items

This commit is contained in:
Heath Volmer
2017-09-27 20:19:28 -06:00
parent 58d22abd5a
commit b57582feea
14 changed files with 286 additions and 18 deletions

View File

@@ -220,7 +220,7 @@ namespace PepperDash.Essentials
// Setup button
TriList.SetSigHeldAction(UIBoolJoin.GearHeaderButtonPress, 2000,
() => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.TechPanelSetupVisible));// ShowInterlockedModal(UIBoolJoin.TechPanelSetupVisible));
TriList.SetSigFalseAction(UIBoolJoin.TechPagesExitButton, () =>
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
PopupInterlock.HideAndClear()); // HideCurrentInterlockedModal());
#warning This gets overridden by config after NYU demo
if(TriList is CrestronApp)

View File

@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
namespace PepperDash.Essentials.UIDrivers
{
public class EssentialsHuddleTechPageDriver : PanelDriverBase
{
SmartObjectDynamicList MenuList;
IAVDriver Parent;
JoinedSigInterlock PagesInterlock;
/// <summary>
///
/// </summary>
/// <param name="trilist"></param>
/// <param name="parent"></param>
public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, IAVDriver parent)
: base(trilist)
{
Parent = parent;
PagesInterlock = new JoinedSigInterlock(trilist);
PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible);
trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide);
MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList],
true, 3100);
MenuList.SetFeedback(1, true); // initial fb
MenuList.SetItemMainText(1, "System Status");
MenuList.SetItemButtonAction(1, b => {
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible);
MenuList.SetFeedback(1, true);
});
MenuList.SetItemMainText(2, "Panel Setup");
MenuList.SetItemButtonAction(2, b => {
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
MenuList.SetFeedback(2, true);
});
MenuList.SetItemMainText(3, "System Status");
MenuList.SetItemButtonAction(3, b => {
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible);
MenuList.SetFeedback(3, true);
});
MenuList.Count = 3;
}
public override void Show()
{
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true);
PagesInterlock.Show();
base.Show();
}
public override void Hide()
{
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false);
PagesInterlock.Hide();
base.Hide();
}
}
}

View File

@@ -121,16 +121,47 @@ namespace PepperDash.Essentials
/// </summary>
JoinedSigInterlock StagingBarInterlock;
/// <summary>
/// Interlocks the various call-related subpages
/// </summary>
JoinedSigInterlock CallPagesInterlock;
/// <summary>
/// The Video codec driver
/// </summary>
PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver VCDriver;
/// <summary>
/// The driver for the tech page. Lazy getter for memory usage
/// </summary>
PepperDash.Essentials.UIDrivers.EssentialsHuddleTechPageDriver TechDriver
{
get
{
if (_TechDriver == null)
_TechDriver = new PepperDash.Essentials.UIDrivers.EssentialsHuddleTechPageDriver(TriList, this);
return _TechDriver;
}
}
PepperDash.Essentials.UIDrivers.EssentialsHuddleTechPageDriver _TechDriver;
/// <summary>
/// Controls timeout of notification ribbon timer
/// </summary>
CTimer RibbonTimer;
/// <summary>
/// The keyboard
/// </summary>
public PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; private set; }
/// <summary>
/// The mode showing. Presentation or call.
/// </summary>
UiDisplayMode CurrentMode = UiDisplayMode.Start;
/// <summary>
/// Constructor
/// </summary>
@@ -277,9 +308,9 @@ namespace PepperDash.Essentials
// Setup button - shows volumes with default button OR hold for tech page
TriList.SetSigHeldAction(UIBoolJoin.GearHeaderButtonPress, 2000,
() => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.TechPanelSetupVisible),
ShowTech,
() => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible));
TriList.SetSigFalseAction(UIBoolJoin.TechPagesExitButton, () =>
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
PopupInterlock.HideAndClear());
// Volume related things
@@ -379,6 +410,15 @@ namespace PepperDash.Essentials
}
}
/// <summary>
/// Reveals the tech page and puts away anything that's in the way.
/// </summary>
void ShowTech()
{
PopupInterlock.HideAndClear();
TechDriver.Show();
}
/// <summary>
/// When the room is off, set the footer SRL
/// </summary>

View File

@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials
{
/// <summary>
/// Used for interlocking sigs, using a set-clears-last-set model.
/// </summary>
public class SigInterlock
{
/// <summary>
///
/// </summary>
public BoolInputSig CurrentSig { get; private set; }
/// <summary>
///
/// </summary>
public SigInterlock()
{
}
/// <summary>
/// Hides CurrentJoin and shows join. Does nothing when resending CurrentJoin
/// </summary>
public void ShowInterlocked(BoolInputSig sig)
{
if (CurrentSig == sig)
return;
SetButDontShow(sig);
sig.BoolValue = true;
}
/// <summary>
///
/// </summary>
/// <param name="join"></param>
public void ShowInterlockedWithToggle(BoolInputSig sig)
{
if(CurrentSig == sig)
HideAndClear();
else
{
if(CurrentSig != null)
CurrentSig.BoolValue = false;
CurrentSig = sig;
CurrentSig.BoolValue = true;
}
}
/// <summary>
/// Hides current Sig and clears CurrentSig
/// </summary>
public void HideAndClear()
{
Hide();
CurrentSig = null;
}
/// <summary>
/// Hides the current Sig but does not clear the selected Sig in case
/// it needs to be reshown
/// </summary>
public void Hide()
{
if(CurrentSig != null)
CurrentSig.BoolValue = false;
}
/// <summary>
/// If CurrentSig is set, it restores that Sig
/// </summary>
public void Show()
{
if(CurrentSig != null)
CurrentSig.BoolValue = true;
}
/// <summary>
/// Useful for pre-setting the interlock but not enabling it. Sets CurrentSig
/// </summary>
/// <param name="join"></param>
public void SetButDontShow(BoolInputSig sig)
{
if (CurrentSig != null)
CurrentSig.BoolValue = false;
CurrentSig = sig;
}
}
}