mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +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:
@@ -9,13 +9,28 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
{
|
||||
public class HabaneroKeyboardController
|
||||
{
|
||||
/// <summary>
|
||||
/// Single-key press events, rather than using a built-up text string on the OutputFeedback
|
||||
/// </summary>
|
||||
public event EventHandler<KeyboardControllerPressEventArgs> KeyPress;
|
||||
|
||||
public BasicTriList TriList { get; private set; }
|
||||
|
||||
public StringFeedback OutputFeedback { get; private set; }
|
||||
|
||||
public bool IsVisible { get; private set; }
|
||||
|
||||
int ShiftMode;
|
||||
public string DotComButtonString { get; set; }
|
||||
|
||||
public string GoButtonText { get; set; }
|
||||
|
||||
public string SecondaryButtonText { get; set; }
|
||||
|
||||
public bool GoButtonVisible { get; set; }
|
||||
|
||||
public bool SecondaryButtonVisible { get; set; }
|
||||
|
||||
int ShiftMode = 0;
|
||||
|
||||
StringBuilder Output;
|
||||
|
||||
@@ -30,7 +45,7 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
TriList = trilist;
|
||||
Output = new StringBuilder();
|
||||
OutputFeedback = new StringFeedback(() => Output.ToString());
|
||||
|
||||
DotComButtonString = ".com";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -41,42 +56,51 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
if (IsVisible)
|
||||
return;
|
||||
|
||||
TriList.SetSigTrueAction(KeyboardClosePress, Hide);
|
||||
TriList.SetSigTrueAction(2921, () => Append(A(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2922, () => Append(B(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2923, () => Append(C(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2924, () => Append(D(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2925, () => Append(E(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2926, () => Append(F(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2927, () => Append(G(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2928, () => Append(H(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2929, () => Append(I(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2930, () => Append(J(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2931, () => Append(K(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2932, () => Append(L(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2933, () => Append(M(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2934, () => Append(N(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2935, () => Append(O(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2936, () => Append(P(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2937, () => Append(Q(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2938, () => Append(R(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2939, () => Append(S(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2940, () => Append(T(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2941, () => Append(U(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2942, () => Append(V(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2943, () => Append(W(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2944, () => Append(X(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2945, () => Append(Y(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2946, () => Append(Z(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2947, () => Append('.'));
|
||||
TriList.SetSigTrueAction(2948, () => Append('@'));
|
||||
TriList.SetSigTrueAction(2949, () => Append(' '));
|
||||
TriList.SetSigTrueAction(ClosePressJoin, Hide);
|
||||
TriList.SetSigTrueAction(GoButtonPressJoin, () => OnKeyPress(KeyboardSpecialKey.GoButton));
|
||||
TriList.SetSigTrueAction(SecondaryButtonPressJoin, () => OnKeyPress(KeyboardSpecialKey.SecondaryButton));
|
||||
TriList.SetSigTrueAction(2921, () => Press(A(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2922, () => Press(B(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2923, () => Press(C(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2924, () => Press(D(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2925, () => Press(E(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2926, () => Press(F(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2927, () => Press(G(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2928, () => Press(H(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2929, () => Press(I(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2930, () => Press(J(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2931, () => Press(K(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2932, () => Press(L(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2933, () => Press(M(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2934, () => Press(N(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2935, () => Press(O(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2936, () => Press(P(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2937, () => Press(Q(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2938, () => Press(R(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2939, () => Press(S(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2940, () => Press(T(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2941, () => Press(U(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2942, () => Press(V(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2943, () => Press(W(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2944, () => Press(X(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2945, () => Press(Y(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2946, () => Press(Z(ShiftMode)));
|
||||
TriList.SetSigTrueAction(2947, () => Press('.'));
|
||||
TriList.SetSigTrueAction(2948, () => Press('@'));
|
||||
TriList.SetSigTrueAction(2949, () => Press(' '));
|
||||
TriList.SetSigTrueAction(2950, Backspace);
|
||||
TriList.SetSigTrueAction(2951, Clear);
|
||||
TriList.SetSigTrueAction(2952, Shift);
|
||||
TriList.SetSigTrueAction(2953, NumShift);
|
||||
TriList.SetSigTrueAction(2951, Shift);
|
||||
TriList.SetSigTrueAction(2952, NumShift);
|
||||
TriList.SetSigTrueAction(2953, Clear);
|
||||
TriList.SetSigTrueAction(2954, () => Press(DotComButtonString));
|
||||
|
||||
TriList.SetBool(GoButtonVisibleJoin, GoButtonVisible);
|
||||
TriList.SetString(GoButtonTextJoin, GoButtonText);
|
||||
TriList.SetBool(SecondaryButtonVisibleJoin, SecondaryButtonVisible);
|
||||
TriList.SetString(SecondaryButtonTextJoin, SecondaryButtonText);
|
||||
|
||||
TriList.SetBool(KeyboardVisible, true);
|
||||
ShowKeys();
|
||||
IsVisible = true;
|
||||
}
|
||||
|
||||
@@ -103,20 +127,54 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="c"></param>
|
||||
public void Append(char c)
|
||||
public void Press(char c)
|
||||
{
|
||||
OnKeyPress(c.ToString());
|
||||
Output.Append(c);
|
||||
OutputFeedback.FireUpdate();
|
||||
ResetShift();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
public void Append(string s)
|
||||
public void Press(string s)
|
||||
{
|
||||
OnKeyPress(s);
|
||||
Output.Append(s);
|
||||
OutputFeedback.FireUpdate();
|
||||
ResetShift();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void EnableGoButton()
|
||||
{
|
||||
TriList.SetBool(GoButtonEnableJoin, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void DisableGoButton()
|
||||
{
|
||||
TriList.SetBool(GoButtonEnableJoin, false);
|
||||
}
|
||||
|
||||
void ResetShift()
|
||||
{
|
||||
if (ShiftMode == 1)
|
||||
{
|
||||
ShiftMode = 0;
|
||||
ShowKeys();
|
||||
}
|
||||
else if (ShiftMode == 3)
|
||||
{
|
||||
ShiftMode = 2;
|
||||
ShowKeys();
|
||||
}
|
||||
}
|
||||
|
||||
char A(int i) { return new char[] { 'a', 'A', '?', '?' }[i]; }
|
||||
@@ -146,8 +204,11 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
char Y(int i) { return new char[] { 'y', 'Y', '6', '^' }[i]; }
|
||||
char Z(int i) { return new char[] { 'z', 'Z', ',', ',' }[i]; }
|
||||
|
||||
|
||||
void Backspace()
|
||||
{
|
||||
OnKeyPress(KeyboardSpecialKey.Backspace);
|
||||
|
||||
if (Output.Length > 0)
|
||||
{
|
||||
Output.Remove(Output.Length - 1, 1);
|
||||
@@ -157,10 +218,46 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
|
||||
void Clear()
|
||||
{
|
||||
OnKeyPress(KeyboardSpecialKey.Clear);
|
||||
|
||||
Output.Remove(0, Output.Length);
|
||||
OutputFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/* When in mode 0 (lowercase):
|
||||
* shift button: up arrow 0
|
||||
* numShift button: 123/#$@#$ 0
|
||||
*
|
||||
* - shift --> mode 1
|
||||
* - double-tap shift --> caps lock
|
||||
* - numShift --> mode 2
|
||||
*
|
||||
* mode 1 (uppercase)
|
||||
* shift button: down arrow 1
|
||||
* numShift button: 123/##$# 0
|
||||
*
|
||||
* - shift --> mode 0
|
||||
* - numShift --> mode 2
|
||||
*
|
||||
* - Tapping any key will go back to mode 0
|
||||
*
|
||||
* mode 2 (numbers-sym)
|
||||
* Shift button: #$#$#$ 2
|
||||
* numShift: ABC 1
|
||||
*
|
||||
* - shift --> mode 3
|
||||
* - double-tap shift --> caps lock
|
||||
* - numShift --> mode 0
|
||||
*
|
||||
* mode 3 (sym)
|
||||
* Shift button: 123 3
|
||||
* numShift: ABC 1
|
||||
*
|
||||
* - shift --> mode 2
|
||||
* - numShift --> mode 0
|
||||
*
|
||||
* - Tapping any key will go back to mode 2
|
||||
*/
|
||||
void Shift()
|
||||
{
|
||||
if (ShiftMode == 0)
|
||||
@@ -172,18 +269,72 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
else
|
||||
ShiftMode = 2;
|
||||
|
||||
TriList.SetUshort(2951, 0); // 0 = up, 1 = down, 2 = #, 3 = 123
|
||||
TriList.SetUshort(2952, 0); // 0 = #, 1 = abc
|
||||
ShowKeys();
|
||||
}
|
||||
|
||||
void NumShift()
|
||||
{
|
||||
if (ShiftMode == 0 || ShiftMode == 1)
|
||||
ShiftMode = 2;
|
||||
else if (ShiftMode == 2)
|
||||
ShiftMode = 3;
|
||||
else
|
||||
else if (ShiftMode == 2 || ShiftMode == 3)
|
||||
ShiftMode = 0;
|
||||
ShowKeys();
|
||||
}
|
||||
|
||||
void ShowKeys()
|
||||
{
|
||||
TriList.SetString(2921, A(ShiftMode).ToString());
|
||||
TriList.SetString(2922, B(ShiftMode).ToString());
|
||||
TriList.SetString(2923, C(ShiftMode).ToString());
|
||||
TriList.SetString(2924, D(ShiftMode).ToString());
|
||||
TriList.SetString(2925, E(ShiftMode).ToString());
|
||||
TriList.SetString(2926, F(ShiftMode).ToString());
|
||||
TriList.SetString(2927, G(ShiftMode).ToString());
|
||||
TriList.SetString(2928, H(ShiftMode).ToString());
|
||||
TriList.SetString(2929, I(ShiftMode).ToString());
|
||||
TriList.SetString(2930, J(ShiftMode).ToString());
|
||||
TriList.SetString(2931, K(ShiftMode).ToString());
|
||||
TriList.SetString(2932, L(ShiftMode).ToString());
|
||||
TriList.SetString(2933, M(ShiftMode).ToString());
|
||||
TriList.SetString(2934, N(ShiftMode).ToString());
|
||||
TriList.SetString(2935, O(ShiftMode).ToString());
|
||||
TriList.SetString(2936, P(ShiftMode).ToString());
|
||||
TriList.SetString(2937, Q(ShiftMode).ToString());
|
||||
TriList.SetString(2938, R(ShiftMode).ToString());
|
||||
TriList.SetString(2939, S(ShiftMode).ToString());
|
||||
TriList.SetString(2940, T(ShiftMode).ToString());
|
||||
TriList.SetString(2941, U(ShiftMode).ToString());
|
||||
TriList.SetString(2942, V(ShiftMode).ToString());
|
||||
TriList.SetString(2943, W(ShiftMode).ToString());
|
||||
TriList.SetString(2944, X(ShiftMode).ToString());
|
||||
TriList.SetString(2945, Y(ShiftMode).ToString());
|
||||
TriList.SetString(2946, Z(ShiftMode).ToString());
|
||||
TriList.SetString(2954, DotComButtonString);
|
||||
|
||||
TriList.SetUshort(2951, (ushort)ShiftMode); // 0 = up, 1 = down, 2 = #, 3 = 123
|
||||
TriList.SetUshort(2952, (ushort)(ShiftMode < 2 ? 0 : 1)); // 0 = #, 1 = abc
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event fire helper for text
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
void OnKeyPress(string text)
|
||||
{
|
||||
var handler = KeyPress;
|
||||
if (handler != null)
|
||||
KeyPress(this, new KeyboardControllerPressEventArgs(text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// event helper for special keys
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
void OnKeyPress(KeyboardSpecialKey key)
|
||||
{
|
||||
var handler = KeyPress;
|
||||
if (handler != null)
|
||||
KeyPress(this, new KeyboardControllerPressEventArgs(key));
|
||||
}
|
||||
|
||||
|
||||
@@ -194,58 +345,67 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
|
||||
/// <summary>
|
||||
/// 2902
|
||||
/// </summary>
|
||||
public const uint KeyboardClosePress = 2902;
|
||||
public const uint ClosePressJoin = 2902;
|
||||
/// <summary>
|
||||
/// 2903
|
||||
/// </summary>
|
||||
public const uint KeyboardButton1Press = 2903;
|
||||
public const uint GoButtonPressJoin = 2903;
|
||||
/// <summary>
|
||||
/// 2903
|
||||
/// </summary>
|
||||
public const uint GoButtonTextJoin = 2903;
|
||||
/// <summary>
|
||||
/// 2904
|
||||
/// </summary>
|
||||
public const uint KeyboardButton2Press = 2904;
|
||||
public const uint SecondaryButtonPressJoin = 2904;
|
||||
/// <summary>
|
||||
/// 2904
|
||||
/// </summary>
|
||||
public const uint SecondaryButtonTextJoin = 2904;
|
||||
/// <summary>
|
||||
/// 2905
|
||||
/// </summary>
|
||||
public const uint GoButtonVisibleJoin = 2905;
|
||||
/// <summary>
|
||||
/// 2906
|
||||
/// </summary>
|
||||
public const uint SecondaryButtonVisibleJoin = 2906;
|
||||
/// <summary>
|
||||
/// 2907
|
||||
/// </summary>
|
||||
public const uint GoButtonEnableJoin = 2907;
|
||||
/// <summary>
|
||||
/// 2910
|
||||
/// </summary>
|
||||
public const uint KeyboardClearPress = 2910;
|
||||
public const uint ClearPressJoin = 2910;
|
||||
/// <summary>
|
||||
/// 2911
|
||||
/// </summary>
|
||||
public const uint KeyboardClearVisible = 2911;
|
||||
public const uint ClearVisibleJoin = 2911;
|
||||
|
||||
}
|
||||
|
||||
/* When in mode 0 (lowercase):
|
||||
* shift button: up arrow 0
|
||||
* numShift button: 123/#$@#$ 0
|
||||
*
|
||||
* - shift --> mode 1
|
||||
* - double-tap shift --> caps lock
|
||||
* - numShift --> mode 2
|
||||
*
|
||||
* mode 1 (uppercase)
|
||||
* shift button: down arrow 1
|
||||
* numShift button: 123/##$# 0
|
||||
*
|
||||
* - shift --> mode 0
|
||||
* - numShift --> mode 2
|
||||
*
|
||||
* - Tapping any key will go back to mode 0
|
||||
*
|
||||
* mode 2 (numbers-sym)
|
||||
* Shift button: #$#$#$ 2
|
||||
* numShift: ABC 1
|
||||
*
|
||||
* - shift --> mode 3
|
||||
* - double-tap shift --> caps lock
|
||||
* - numShift --> mode 0
|
||||
*
|
||||
* mode 3 (sym)
|
||||
* Shift button: 123 3
|
||||
* numShift: ABC 1
|
||||
*
|
||||
* - shift --> mode 2
|
||||
* - numShift --> mode 0
|
||||
*
|
||||
* - Tapping any key will go back to mode 2
|
||||
*/
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class KeyboardControllerPressEventArgs : EventArgs
|
||||
{
|
||||
public string Text { get; private set; }
|
||||
public KeyboardSpecialKey SpecialKey { get; private set; }
|
||||
|
||||
public KeyboardControllerPressEventArgs(string text)
|
||||
{
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public KeyboardControllerPressEventArgs(KeyboardSpecialKey key)
|
||||
{
|
||||
SpecialKey = key;
|
||||
}
|
||||
}
|
||||
|
||||
public enum KeyboardSpecialKey
|
||||
{
|
||||
None = 0, Backspace, Clear, GoButton, SecondaryButton
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user