mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +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;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.SmartObjects
|
namespace PepperDash.Essentials.Core.SmartObjects
|
||||||
{
|
{
|
||||||
public class SmartObjectHelperBase
|
public class SmartObjectHelperBase
|
||||||
@@ -33,13 +35,37 @@ namespace PepperDash.Essentials.Core.SmartObjects
|
|||||||
SmartObject.SigChange -= this.SmartObject_SigChange;
|
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)
|
public BoolOutputSig GetBoolOutputNamed(string name)
|
||||||
{
|
{
|
||||||
if (SmartObject.BooleanOutput.Contains(name))
|
if (SmartObject.BooleanOutput.Contains(name))
|
||||||
return SmartObject.BooleanOutput[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;
|
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>
|
/// <summary>
|
||||||
/// Standard Action listener
|
/// Standard Action listener
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ namespace PepperDash.Essentials.Core.SmartObjects
|
|||||||
{
|
{
|
||||||
public class SmartObjectNumeric : SmartObjectHelperBase
|
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 Digit1 { get { return GetBoolOutputNamed("1"); } }
|
||||||
public BoolOutputSig Digit2 { get { return GetBoolOutputNamed("2"); } }
|
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 Digit8 { get { return GetBoolOutputNamed("8"); } }
|
||||||
public BoolOutputSig Digit9 { get { return GetBoolOutputNamed("9"); } }
|
public BoolOutputSig Digit9 { get { return GetBoolOutputNamed("9"); } }
|
||||||
public BoolOutputSig Digit0 { get { return GetBoolOutputNamed("0"); } }
|
public BoolOutputSig Digit0 { get { return GetBoolOutputNamed("0"); } }
|
||||||
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed("Misc_1"); } }
|
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed(Misc1SigName); } }
|
||||||
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed("Misc_2"); } }
|
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed(Misc2SigName); } }
|
||||||
|
|
||||||
public SmartObjectNumeric(SmartObject so, bool useUserObjectHandler) : base(so, useUserObjectHandler)
|
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
|
public static class SigAndTriListExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
/// <param name="sig">The BoolOutputSig to attach the Action to</param>
|
/// <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>
|
/// <param name="a">An action to run when sig is pressed and when released</param>
|
||||||
|
|||||||
@@ -139,6 +139,10 @@ namespace PepperDash.Essentials
|
|||||||
/// 1234
|
/// 1234
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint VCStagingConnectPress = 1234;
|
public const uint VCStagingConnectPress = 1234;
|
||||||
|
/// <summary>
|
||||||
|
/// 1235
|
||||||
|
/// </summary>
|
||||||
|
public const uint VCStagingCameraPress = 1235;
|
||||||
|
|
||||||
//******************************************************
|
//******************************************************
|
||||||
// Keyboard
|
// Keyboard
|
||||||
|
|||||||
@@ -387,35 +387,6 @@ namespace PepperDash.Essentials
|
|||||||
ShareButtonSig.BoolValue = CurrentRoom.OnFeedback.BoolValue;
|
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>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -424,6 +395,7 @@ namespace PepperDash.Essentials
|
|||||||
if (VCDriver.IsVisible)
|
if (VCDriver.IsVisible)
|
||||||
return;
|
return;
|
||||||
CallButtonSig.BoolValue = true;
|
CallButtonSig.BoolValue = true;
|
||||||
|
ShareButtonSig.BoolValue = false;
|
||||||
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
||||||
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
|
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
|
||||||
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
|
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
|
||||||
@@ -438,6 +410,7 @@ namespace PepperDash.Essentials
|
|||||||
if (VCDriver.IsVisible)
|
if (VCDriver.IsVisible)
|
||||||
VCDriver.Hide();
|
VCDriver.Hide();
|
||||||
ShareButtonSig.BoolValue = true;
|
ShareButtonSig.BoolValue = true;
|
||||||
|
CallButtonSig.BoolValue = false;
|
||||||
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
|
||||||
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
|
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
|
||||||
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
|
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
JoinedSigInterlock StagingBarInterlock;
|
JoinedSigInterlock StagingBarInterlock;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For the staging button feedbacks
|
||||||
|
/// </summary>
|
||||||
|
JoinedSigInterlock StagingButtonFeedbackInterlock;
|
||||||
|
|
||||||
SmartObjectNumeric DialKeypad;
|
SmartObjectNumeric DialKeypad;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -65,8 +70,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
|
|
||||||
VCControlsInterlock = new JoinedSigInterlock(triList);
|
VCControlsInterlock = new JoinedSigInterlock(triList);
|
||||||
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCRecentsVisible);
|
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCRecentsVisible);
|
||||||
|
|
||||||
StagingBarInterlock = new JoinedSigInterlock(triList);
|
StagingBarInterlock = new JoinedSigInterlock(triList);
|
||||||
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
|
StagingBarInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
|
||||||
|
|
||||||
|
StagingButtonFeedbackInterlock = new JoinedSigInterlock(triList);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -118,7 +127,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
DialKeypad.Digit7.SetBoolSigAction(b => ___DialPlaceholder___(7));
|
DialKeypad.Digit7.SetBoolSigAction(b => ___DialPlaceholder___(7));
|
||||||
DialKeypad.Digit8.SetBoolSigAction(b => ___DialPlaceholder___(8));
|
DialKeypad.Digit8.SetBoolSigAction(b => ___DialPlaceholder___(8));
|
||||||
DialKeypad.Digit9.SetBoolSigAction(b => ___DialPlaceholder___(9));
|
DialKeypad.Digit9.SetBoolSigAction(b => ___DialPlaceholder___(9));
|
||||||
|
DialKeypad.Misc1SigName = "*";
|
||||||
DialKeypad.Misc1.SetBoolSigAction(b => { });
|
DialKeypad.Misc1.SetBoolSigAction(b => { });
|
||||||
|
DialKeypad.Misc2SigName = "#";
|
||||||
DialKeypad.Misc2.SetBoolSigAction(b => { });
|
DialKeypad.Misc2.SetBoolSigAction(b => { });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -132,21 +143,27 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
void ShowCameraControls()
|
void ShowCameraControls()
|
||||||
{
|
{
|
||||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraVisible);
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingCameraPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowKeypad()
|
void ShowKeypad()
|
||||||
{
|
{
|
||||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible);
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowDirectory()
|
void ShowDirectory()
|
||||||
{
|
{
|
||||||
|
// populate directory
|
||||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingDirectoryPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowRecents()
|
void ShowRecents()
|
||||||
{
|
{
|
||||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
|
//populate recents
|
||||||
|
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||||
|
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallHasStarted()
|
void CallHasStarted()
|
||||||
@@ -166,20 +183,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
|
|
||||||
void ___DialPlaceholder___(int i)
|
void ___DialPlaceholder___(int i)
|
||||||
{
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class BoolJoin
|
|
||||||
{
|
|
||||||
public const uint CameraControlsVisible = 3001;
|
|
||||||
|
|
||||||
public const uint KeypadVisbile = 3002;
|
|
||||||
|
|
||||||
public const uint DirectoryVisible = 3003;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user