mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-12 03:05:01 +00:00
Merge branch 'feature/ecs-407' of http://code.pepperdash.net/scm/pec/essentials into feature/cisco-spark-2
This commit is contained in:
@@ -164,6 +164,18 @@ namespace PepperDash.Essentials
|
||||
/// 1236
|
||||
/// </summary>
|
||||
public const uint VCStagingConnectEnable = 1236;
|
||||
/// <summary>
|
||||
/// 1237 - When the user touches the text field, should trigger keyboard
|
||||
/// </summary>
|
||||
public const uint VCKeypadTextPress = 1237;
|
||||
/// <summary>
|
||||
/// 1238
|
||||
/// </summary>
|
||||
public const uint VCKeypadBackspacePress = 1238;
|
||||
/// <summary>
|
||||
/// 1239
|
||||
/// </summary>
|
||||
public const uint VCKeypadBackspaceVisible = 1239;
|
||||
|
||||
//******************************************************
|
||||
// Keyboard
|
||||
@@ -183,16 +195,14 @@ namespace PepperDash.Essentials
|
||||
/// 2904
|
||||
/// </summary>
|
||||
public const uint KeyboardButton2Press = 2904;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 2910
|
||||
/// </summary>
|
||||
public const uint KeyboardClearPress = 2910;
|
||||
//public const uint KeyboardClearPress = 2910;
|
||||
/// <summary>
|
||||
/// 2911
|
||||
/// </summary>
|
||||
public const uint KeyboardClearVisible = 2911;
|
||||
//public const uint KeyboardClearVisible = 2911;
|
||||
|
||||
// Letter joins start at 2921;
|
||||
|
||||
@@ -535,6 +545,10 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public const uint HeaderActiveCallsListVisible = 15066;
|
||||
/// <summary>
|
||||
/// 15067
|
||||
/// </summary>
|
||||
public const uint NotificationRibbonVisible = 15067;
|
||||
/// <summary>
|
||||
/// 15083 - Press for Call help desk on AC/VC
|
||||
/// </summary>
|
||||
public const uint HelpPageShowCallButtonPress = 15083;
|
||||
|
||||
@@ -13,12 +13,20 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public class UIStringJoin
|
||||
{
|
||||
//******************************************************
|
||||
// Codec
|
||||
/// <summary>
|
||||
/// 1001
|
||||
/// </summary>
|
||||
public const uint CodecAddressEntryText = 1001;
|
||||
|
||||
|
||||
//******************************************************
|
||||
// Keyboard
|
||||
/// <summary>
|
||||
/// 1901
|
||||
/// </summary>
|
||||
public const uint KeyboardText = 2901;
|
||||
//public const uint KeypadText = 2901;
|
||||
|
||||
/// <summary>
|
||||
/// 3812
|
||||
@@ -86,6 +94,11 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public const uint SourceBackgroundOverlayTitle = 3914;
|
||||
|
||||
/// <summary>
|
||||
/// 3915
|
||||
/// </summary>
|
||||
public const uint NotificationRibbonText = 3915;
|
||||
|
||||
/// <summary>
|
||||
/// 3922
|
||||
/// </summary>
|
||||
|
||||
@@ -85,11 +85,6 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
SubpageReferenceList ActivityFooterSrl;
|
||||
|
||||
/// <summary>
|
||||
/// Tracks which audio page group the UI is in
|
||||
/// </summary>
|
||||
UiDisplayMode CurrentDisplayMode;
|
||||
|
||||
/// <summary>
|
||||
/// The AV page mangagers that have been used, to keep them alive for later
|
||||
/// </summary>
|
||||
@@ -130,6 +125,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver VCDriver;
|
||||
|
||||
CTimer RibbonTimer;
|
||||
|
||||
public PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -347,6 +344,39 @@ namespace PepperDash.Essentials
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reveals a message on the notification ribbon until cleared
|
||||
/// </summary>
|
||||
/// <param name="message">Text to display</param>
|
||||
/// <param name="timeout">Time in ms to display. 0 to keep on screen</param>
|
||||
public void ShowNotificationRibbon(string message, int timeout)
|
||||
{
|
||||
TriList.SetString(UIStringJoin.NotificationRibbonText, message);
|
||||
TriList.SetBool(UIBoolJoin.NotificationRibbonVisible, true);
|
||||
if (timeout > 0)
|
||||
{
|
||||
if (RibbonTimer != null)
|
||||
RibbonTimer.Stop();
|
||||
RibbonTimer = new CTimer(o => {
|
||||
TriList.SetBool(UIBoolJoin.NotificationRibbonVisible, false);
|
||||
RibbonTimer = null;
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hides the notification ribbon
|
||||
/// </summary>
|
||||
public void HideNotificationRibbon()
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.NotificationRibbonVisible, false);
|
||||
if (RibbonTimer != null)
|
||||
{
|
||||
RibbonTimer.Stop();
|
||||
RibbonTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When the room is off, set the footer SRL
|
||||
/// </summary>
|
||||
@@ -957,5 +987,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; }
|
||||
JoinedSigInterlock PopupInterlock { get; }
|
||||
void ShowNotificationRibbon(string message, int timeout);
|
||||
void HideNotificationRibbon();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
@@ -9,6 +10,7 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
|
||||
@@ -31,12 +33,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
/// </summary>
|
||||
VideoCodecBase Codec;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
SmartObjectDynamicList DirectorySrl; // ***************** SRL ???
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// To drive UI elements outside of this driver that may be dependent on this.
|
||||
/// </summary>
|
||||
@@ -90,10 +86,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
InCall = new BoolFeedback(() => false);
|
||||
LocalPrivacyIsMuted = new BoolFeedback(() => false);
|
||||
|
||||
//DirectorySrl = new SubpageReferenceList(triList, UISmartObjectJoin.VCDirectoryList, 3, 3, 3);
|
||||
|
||||
VCControlsInterlock = new JoinedSigInterlock(triList);
|
||||
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCDirectoryVisible);
|
||||
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadVisible);
|
||||
|
||||
StagingBarInterlock = new JoinedSigInterlock(triList);
|
||||
StagingBarInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible);
|
||||
@@ -101,13 +95,22 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
StagingButtonFeedbackInterlock = new JoinedSigInterlock(triList);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
|
||||
|
||||
DialStringFeedback = new StringFeedback(() => DialStringBuilder.ToString());
|
||||
DialStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.KeyboardText]);
|
||||
// Return formatted when dialing, straight digits when in call
|
||||
DialStringFeedback = new StringFeedback(() =>
|
||||
{
|
||||
if (KeypadMode == eKeypadMode.Dial)
|
||||
return GetFormattedDialString(DialStringBuilder.ToString());
|
||||
else
|
||||
return DialStringBuilder.ToString();
|
||||
|
||||
});
|
||||
DialStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecAddressEntryText]);
|
||||
|
||||
DialStringBackspaceVisibleFeedback = new BoolFeedback(() => DialStringBuilder.Length > 0);
|
||||
DialStringBackspaceVisibleFeedback
|
||||
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]);
|
||||
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCKeypadBackspaceVisible]);
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.VCKeypadTextPress, RevealKeyboard);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -127,14 +130,17 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
KeypadMode = eKeypadMode.DTMF;
|
||||
DialStringBuilder.Remove(0, DialStringBuilder.Length);
|
||||
DialStringFeedback.FireUpdate();
|
||||
TriList.SetBool(UIBoolJoin.KeyboardClearVisible, false);
|
||||
TriList.SetBool(UIBoolJoin.VCKeypadBackspaceVisible, false);
|
||||
Parent.ShowNotificationRibbon("Connected", 2000);
|
||||
break;
|
||||
case eCodecCallStatus.Connecting:
|
||||
// fire at SRL item
|
||||
Debug.Console(1, "*#* UI: Call Connecting {0}", call.Name);
|
||||
Parent.ShowNotificationRibbon("Connecting", 0);
|
||||
break;
|
||||
case eCodecCallStatus.Dialing:
|
||||
Debug.Console(1, "*#* UI: Call Dialing {0}", call.Name);
|
||||
Parent.ShowNotificationRibbon("Dialing", 0);
|
||||
break;
|
||||
case eCodecCallStatus.Disconnected:
|
||||
Debug.Console(1, "*#* UI: Call Disconnecting {0}", call.Name);
|
||||
@@ -143,6 +149,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
KeypadMode = eKeypadMode.Dial;
|
||||
DialStringBuilder.Remove(0, DialStringBuilder.Length);
|
||||
DialStringFeedback.FireUpdate();
|
||||
Parent.ShowNotificationRibbon("Disonnected", 2000);
|
||||
}
|
||||
break;
|
||||
case eCodecCallStatus.Disconnecting:
|
||||
@@ -240,6 +247,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
{
|
||||
VCControlsInterlock.Show();
|
||||
StagingBarInterlock.Show();
|
||||
DialStringFeedback.FireUpdate();
|
||||
base.Show();
|
||||
}
|
||||
|
||||
@@ -297,13 +305,58 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*"));
|
||||
DialKeypad.Misc2SigName = "#";
|
||||
DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#"));
|
||||
TriList.SetSigFalseAction(UIBoolJoin.KeyboardClearPress, DialKeypadBackspacePress);
|
||||
TriList.SetSigFalseAction(UIBoolJoin.VCKeypadBackspacePress, DialKeypadBackspacePress);
|
||||
}
|
||||
else
|
||||
Debug.Console(0, "Trilist {0:x2}, VC dial keypad object {1} not found. Check SGD file or VTP",
|
||||
TriList.ID, UISmartObjectJoin.VCDialKeypad);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void RevealKeyboard()
|
||||
{
|
||||
if (KeypadMode == eKeypadMode.Dial)
|
||||
{
|
||||
var kb = Parent.Keyboard;
|
||||
kb.KeyPress += new EventHandler<PepperDash.Essentials.Core.Touchpanels.Keyboards.KeyboardControllerPressEventArgs>(Keyboard_KeyPress);
|
||||
kb.HideAction = this.DetachKeyboard;
|
||||
kb.GoButtonText = "Connect";
|
||||
kb.GoButtonVisible = true;
|
||||
DialStringKeypadCheckEnables();
|
||||
kb.Show();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void Keyboard_KeyPress(object sender, PepperDash.Essentials.Core.Touchpanels.Keyboards.KeyboardControllerPressEventArgs e)
|
||||
{
|
||||
if (e.Text != null)
|
||||
DialStringBuilder.Append(e.Text);
|
||||
else
|
||||
{
|
||||
if (e.SpecialKey == KeyboardSpecialKey.Backspace)
|
||||
DialKeypadBackspacePress();
|
||||
else if (e.SpecialKey == KeyboardSpecialKey.Clear)
|
||||
DialKeypadClear();
|
||||
else if (e.SpecialKey == KeyboardSpecialKey.GoButton)
|
||||
{
|
||||
ConnectPress();
|
||||
Parent.Keyboard.Hide();
|
||||
}
|
||||
}
|
||||
DialStringFeedback.FireUpdate();
|
||||
DialStringKeypadCheckEnables();
|
||||
}
|
||||
|
||||
void DetachKeyboard()
|
||||
{
|
||||
Parent.Keyboard.KeyPress -= Keyboard_KeyPress;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -325,24 +378,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
|
||||
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingDirectoryPress);
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.CodecDirectorySearchTextPress, () =>
|
||||
{
|
||||
var kb = Parent.Keyboard;
|
||||
kb.OutputFeedback.OutputChange += new EventHandler<EventArgs>(DirectoryKeyboardChange);
|
||||
kb.HideAction += () =>
|
||||
{
|
||||
kb.OutputFeedback.OutputChange -= DirectoryKeyboardChange;
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void DirectoryKeyboardChange(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ShowRecents()
|
||||
@@ -371,8 +406,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
{
|
||||
DialStringBuilder.Append(i);
|
||||
DialStringFeedback.FireUpdate();
|
||||
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue =
|
||||
DialStringBuilder.Length > 0;
|
||||
DialStringKeypadCheckEnables();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -390,9 +424,58 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
{
|
||||
DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1);
|
||||
DialStringFeedback.FireUpdate();
|
||||
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue =
|
||||
DialStringBuilder.Length > 0;
|
||||
TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0);
|
||||
DialStringKeypadCheckEnables();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears the dial keypad
|
||||
/// </summary>
|
||||
void DialKeypadClear()
|
||||
{
|
||||
DialStringBuilder.Remove(0, DialStringBuilder.Length);
|
||||
DialStringFeedback.FireUpdate();
|
||||
DialStringKeypadCheckEnables();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks the enabled states of various elements around the keypad
|
||||
/// </summary>
|
||||
void DialStringKeypadCheckEnables()
|
||||
{
|
||||
var textIsEntered = DialStringBuilder.Length > 0;
|
||||
TriList.SetBool(UIBoolJoin.VCKeypadBackspaceVisible, textIsEntered);
|
||||
TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, textIsEntered);
|
||||
if (textIsEntered)
|
||||
Parent.Keyboard.EnableGoButton();
|
||||
else
|
||||
Parent.Keyboard.DisableGoButton();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string GetFormattedDialString(string ds)
|
||||
{
|
||||
if (DialStringBuilder.Length == 0 && !Codec.IsInCall)
|
||||
{
|
||||
return "Dial or touch to enter address";
|
||||
}
|
||||
if(Regex.Match(ds, @"^\d{4,7}$").Success) // 456-7890
|
||||
return string.Format("{0}-{1}", ds.Substring(0, 3), ds.Substring(3));
|
||||
if (Regex.Match(ds, @"^9\d{4,7}$").Success) // 456-7890
|
||||
return string.Format("9 {0}-{1}", ds.Substring(1, 3), ds.Substring(4));
|
||||
if (Regex.Match(ds, @"^\d{8,10}$").Success) // 123-456-78
|
||||
return string.Format("({0}) {1}-{2}", ds.Substring(0, 3), ds.Substring(3, 3), ds.Substring(6));
|
||||
if (Regex.Match(ds, @"^\d{10}$").Success) // 123-456-7890 full
|
||||
return string.Format("({0}) {1}-{2}", ds.Substring(0, 3), ds.Substring(3, 3), ds.Substring(6));
|
||||
if (Regex.Match(ds, @"^1\d{10}$").Success)
|
||||
return string.Format("+1 ({0}) {1}-{2}", ds.Substring(1, 3), ds.Substring(4, 3), ds.Substring(7));
|
||||
if (Regex.Match(ds, @"^9\d{10}$").Success)
|
||||
return string.Format("9 ({0}) {1}-{2}", ds.Substring(1, 3), ds.Substring(4, 3), ds.Substring(7));
|
||||
if (Regex.Match(ds, @"^91\d{10}$").Success)
|
||||
return string.Format("9 +1 ({0}) {1}-{2}", ds.Substring(2, 3), ds.Substring(5, 3), ds.Substring(8));
|
||||
return ds;
|
||||
}
|
||||
|
||||
enum eKeypadMode
|
||||
|
||||
Reference in New Issue
Block a user