mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-03 14:55:05 +00:00
Basic scaffold of VC driver.
This commit is contained in:
@@ -6,6 +6,8 @@ using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.SmartObjects
|
||||
{
|
||||
public class SmartObjectHelperBase
|
||||
@@ -33,13 +35,37 @@ namespace PepperDash.Essentials.Core.SmartObjects
|
||||
SmartObject.SigChange -= this.SmartObject_SigChange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper to get a sig name with debugging when fail
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public BoolOutputSig GetBoolOutputNamed(string name)
|
||||
{
|
||||
if (SmartObject.BooleanOutput.Contains(name))
|
||||
return SmartObject.BooleanOutput[name];
|
||||
else
|
||||
Debug.Console(0, "WARNING: Cannot get signal. Smart object {0} on trilist {1:x2} does not contain signal '{2}'",
|
||||
SmartObject.ID, SmartObject.Device.ID, name);
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets action on signal after checking for existence.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="a"></param>
|
||||
public void SetBoolAction(string name, Action<bool> a)
|
||||
{
|
||||
if (SmartObject.BooleanOutput.Contains(name))
|
||||
SmartObject.BooleanOutput[name].UserObject = a;
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "WARNING: Cannot set action. Smart object {0} on trilist {1:x2} does not contain signal '{2}'",
|
||||
SmartObject.ID, SmartObject.Device.ID, name);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Standard Action listener
|
||||
/// </summary>
|
||||
|
||||
@@ -10,6 +10,14 @@ namespace PepperDash.Essentials.Core.SmartObjects
|
||||
{
|
||||
public class SmartObjectNumeric : SmartObjectHelperBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Defaults to "Misc_1". The name of the button in VTPro (Usually the text)
|
||||
/// </summary>
|
||||
public string Misc1SigName { get; set; }
|
||||
/// <summary>
|
||||
/// Defaults to "Misc_2". The name of the button in VTPro (Usually the text)
|
||||
/// </summary>
|
||||
public string Misc2SigName { get; set; }
|
||||
|
||||
public BoolOutputSig Digit1 { get { return GetBoolOutputNamed("1"); } }
|
||||
public BoolOutputSig Digit2 { get { return GetBoolOutputNamed("2"); } }
|
||||
@@ -21,11 +29,13 @@ namespace PepperDash.Essentials.Core.SmartObjects
|
||||
public BoolOutputSig Digit8 { get { return GetBoolOutputNamed("8"); } }
|
||||
public BoolOutputSig Digit9 { get { return GetBoolOutputNamed("9"); } }
|
||||
public BoolOutputSig Digit0 { get { return GetBoolOutputNamed("0"); } }
|
||||
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed("Misc_1"); } }
|
||||
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed("Misc_2"); } }
|
||||
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed(Misc1SigName); } }
|
||||
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed(Misc2SigName); } }
|
||||
|
||||
public SmartObjectNumeric(SmartObject so, bool useUserObjectHandler) : base(so, useUserObjectHandler)
|
||||
{
|
||||
Misc1SigName = "Misc_1";
|
||||
Misc2SigName = "Misc_2";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,8 @@ namespace PepperDash.Essentials.Core
|
||||
public static class SigAndTriListExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Attaches Action to Sig's user object and returns the same Sig.
|
||||
/// Attaches Action to Sig's user object and returns the same Sig. This provides no protection
|
||||
/// from null sigs
|
||||
/// </summary>
|
||||
/// <param name="sig">The BoolOutputSig to attach the Action to</param>
|
||||
/// <param name="a">An action to run when sig is pressed and when released</param>
|
||||
|
||||
@@ -139,6 +139,10 @@ namespace PepperDash.Essentials
|
||||
/// 1234
|
||||
/// </summary>
|
||||
public const uint VCStagingConnectPress = 1234;
|
||||
/// <summary>
|
||||
/// 1235
|
||||
/// </summary>
|
||||
public const uint VCStagingCameraPress = 1235;
|
||||
|
||||
//******************************************************
|
||||
// Keyboard
|
||||
|
||||
@@ -385,36 +385,7 @@ namespace PepperDash.Essentials
|
||||
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1);
|
||||
|
||||
ShareButtonSig.BoolValue = CurrentRoom.OnFeedback.BoolValue;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Builds the call stage
|
||||
///// </summary>
|
||||
//void SetupCallStagingSrl()
|
||||
//{
|
||||
// CallStagingSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.CallStagingSrl, 3, 3, 3);
|
||||
// var c = CallStagingSrl;
|
||||
// c.AddItem(new SubpageReferenceListButtonAndModeItem(1, c, 1, b => { if (!b) { } })); //************ Camera
|
||||
// c.AddItem(new SubpageReferenceListButtonAndModeItem(2, c, 2, b => { if (!b) { } })); //************ Directory
|
||||
// c.AddItem(new SubpageReferenceListButtonAndModeItem(3, c, 3, b => { if (!b) { } })); //************ Keypad
|
||||
// c.AddItem(new SubpageReferenceListButtonAndModeItem(4, c, 4, b => { if (!b) { } })); //************ End Call
|
||||
// c.Count = 3;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// This may need to be part of an event handler routine from codec feedback.
|
||||
/// Adds End Call to Call Staging list
|
||||
/// </summary>
|
||||
void SetupEndCall()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Part of event handler? Removes End Call from Call Staging
|
||||
/// </summary>
|
||||
void HideEndCall()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -424,6 +395,7 @@ namespace PepperDash.Essentials
|
||||
if (VCDriver.IsVisible)
|
||||
return;
|
||||
CallButtonSig.BoolValue = true;
|
||||
ShareButtonSig.BoolValue = false;
|
||||
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
||||
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
|
||||
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
|
||||
@@ -438,6 +410,7 @@ namespace PepperDash.Essentials
|
||||
if (VCDriver.IsVisible)
|
||||
VCDriver.Hide();
|
||||
ShareButtonSig.BoolValue = true;
|
||||
CallButtonSig.BoolValue = false;
|
||||
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
||||
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
|
||||
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
|
||||
|
||||
@@ -44,6 +44,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
/// </summary>
|
||||
JoinedSigInterlock StagingBarInterlock;
|
||||
|
||||
/// <summary>
|
||||
/// For the staging button feedbacks
|
||||
/// </summary>
|
||||
JoinedSigInterlock StagingButtonFeedbackInterlock;
|
||||
|
||||
SmartObjectNumeric DialKeypad;
|
||||
|
||||
/// <summary>
|
||||
@@ -65,8 +70,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
VCControlsInterlock = new JoinedSigInterlock(triList);
|
||||
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCRecentsVisible);
|
||||
|
||||
StagingBarInterlock = new JoinedSigInterlock(triList);
|
||||
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
|
||||
StagingBarInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
|
||||
|
||||
StagingButtonFeedbackInterlock = new JoinedSigInterlock(triList);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -118,7 +127,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
DialKeypad.Digit7.SetBoolSigAction(b => ___DialPlaceholder___(7));
|
||||
DialKeypad.Digit8.SetBoolSigAction(b => ___DialPlaceholder___(8));
|
||||
DialKeypad.Digit9.SetBoolSigAction(b => ___DialPlaceholder___(9));
|
||||
DialKeypad.Misc1SigName = "*";
|
||||
DialKeypad.Misc1.SetBoolSigAction(b => { });
|
||||
DialKeypad.Misc2SigName = "#";
|
||||
DialKeypad.Misc2.SetBoolSigAction(b => { });
|
||||
}
|
||||
else
|
||||
@@ -132,21 +143,27 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
void ShowCameraControls()
|
||||
{
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraVisible);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingCameraPress);
|
||||
}
|
||||
|
||||
void ShowKeypad()
|
||||
{
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
|
||||
}
|
||||
|
||||
void ShowDirectory()
|
||||
{
|
||||
// populate directory
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingDirectoryPress);
|
||||
}
|
||||
|
||||
void ShowRecents()
|
||||
{
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
|
||||
//populate recents
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress);
|
||||
}
|
||||
|
||||
void CallHasStarted()
|
||||
@@ -166,20 +183,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
void ___DialPlaceholder___(int i)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class BoolJoin
|
||||
{
|
||||
public const uint CameraControlsVisible = 3001;
|
||||
|
||||
public const uint KeypadVisbile = 3002;
|
||||
|
||||
public const uint DirectoryVisible = 3003;
|
||||
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user