diff --git a/Essentials Core/PepperDashEssentialsBase/Touchpanels/Keyboards/HabaneroKeyboardController.cs b/Essentials Core/PepperDashEssentialsBase/Touchpanels/Keyboards/HabaneroKeyboardController.cs index 8422ed0a..b69f9887 100644 --- a/Essentials Core/PepperDashEssentialsBase/Touchpanels/Keyboards/HabaneroKeyboardController.cs +++ b/Essentials Core/PepperDashEssentialsBase/Touchpanels/Keyboards/HabaneroKeyboardController.cs @@ -9,13 +9,28 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards { public class HabaneroKeyboardController { + /// + /// Single-key press events, rather than using a built-up text string on the OutputFeedback + /// + public event EventHandler 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"; } /// @@ -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 /// /// /// - public void Append(char c) + public void Press(char c) { + OnKeyPress(c.ToString()); Output.Append(c); OutputFeedback.FireUpdate(); + ResetShift(); } /// /// /// /// - public void Append(string s) + public void Press(string s) { + OnKeyPress(s); Output.Append(s); OutputFeedback.FireUpdate(); + ResetShift(); + } + + /// + /// + /// + public void EnableGoButton() + { + TriList.SetBool(GoButtonEnableJoin, true); + } + + /// + /// + /// + 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 + } + + /// + /// Event fire helper for text + /// + /// + void OnKeyPress(string text) + { + var handler = KeyPress; + if (handler != null) + KeyPress(this, new KeyboardControllerPressEventArgs(text)); + } + + /// + /// event helper for special keys + /// + /// + 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 /// /// 2902 /// - public const uint KeyboardClosePress = 2902; + public const uint ClosePressJoin = 2902; /// /// 2903 /// - public const uint KeyboardButton1Press = 2903; + public const uint GoButtonPressJoin = 2903; + /// + /// 2903 + /// + public const uint GoButtonTextJoin = 2903; /// /// 2904 /// - public const uint KeyboardButton2Press = 2904; + public const uint SecondaryButtonPressJoin = 2904; + /// + /// 2904 + /// + public const uint SecondaryButtonTextJoin = 2904; + /// + /// 2905 + /// + public const uint GoButtonVisibleJoin = 2905; + /// + /// 2906 + /// + public const uint SecondaryButtonVisibleJoin = 2906; + /// + /// 2907 + /// + public const uint GoButtonEnableJoin = 2907; /// /// 2910 /// - public const uint KeyboardClearPress = 2910; + public const uint ClearPressJoin = 2910; /// /// 2911 /// - 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 - */ + /// + /// + /// + 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 + } } \ No newline at end of file diff --git a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs index 47da3076..26cc59ea 100644 --- a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs +++ b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs @@ -164,6 +164,18 @@ namespace PepperDash.Essentials /// 1236 /// public const uint VCStagingConnectEnable = 1236; + /// + /// 1237 - When the user touches the text field, should trigger keyboard + /// + public const uint VCKeypadTextPress = 1237; + /// + /// 1238 + /// + public const uint VCKeypadBackspacePress = 1238; + /// + /// 1239 + /// + public const uint VCKeypadBackspaceVisible = 1239; //****************************************************** // Keyboard @@ -183,16 +195,14 @@ namespace PepperDash.Essentials /// 2904 /// public const uint KeyboardButton2Press = 2904; - - /// /// 2910 /// - public const uint KeyboardClearPress = 2910; + //public const uint KeyboardClearPress = 2910; /// /// 2911 /// - public const uint KeyboardClearVisible = 2911; + //public const uint KeyboardClearVisible = 2911; // Letter joins start at 2921; @@ -535,6 +545,10 @@ namespace PepperDash.Essentials /// public const uint HeaderActiveCallsListVisible = 15066; /// + /// 15067 + /// + public const uint NotificationRibbonVisible = 15067; + /// /// 15083 - Press for Call help desk on AC/VC /// public const uint HelpPageShowCallButtonPress = 15083; diff --git a/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs b/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs index bb709aad..c49fae06 100644 --- a/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs +++ b/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs @@ -13,12 +13,20 @@ namespace PepperDash.Essentials /// public class UIStringJoin { + //****************************************************** + // Codec + /// + /// 1001 + /// + public const uint CodecAddressEntryText = 1001; + + //****************************************************** // Keyboard /// /// 1901 /// - public const uint KeyboardText = 2901; + //public const uint KeypadText = 2901; /// /// 3812 @@ -86,6 +94,11 @@ namespace PepperDash.Essentials /// public const uint SourceBackgroundOverlayTitle = 3914; + /// + /// 3915 + /// + public const uint NotificationRibbonText = 3915; + /// /// 3922 /// diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs index 60745dec..3a0f6183 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/HuddleVTCPanelAvFunctionsDriver.cs @@ -85,11 +85,6 @@ namespace PepperDash.Essentials /// SubpageReferenceList ActivityFooterSrl; - /// - /// Tracks which audio page group the UI is in - /// - UiDisplayMode CurrentDisplayMode; - /// /// The AV page mangagers that have been used, to keep them alive for later /// @@ -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; } /// @@ -347,6 +344,39 @@ namespace PepperDash.Essentials base.Hide(); } + /// + /// Reveals a message on the notification ribbon until cleared + /// + /// Text to display + /// Time in ms to display. 0 to keep on screen + 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); + } + } + + /// + /// Hides the notification ribbon + /// + public void HideNotificationRibbon() + { + TriList.SetBool(UIBoolJoin.NotificationRibbonVisible, false); + if (RibbonTimer != null) + { + RibbonTimer.Stop(); + RibbonTimer = null; + } + } + /// /// When the room is off, set the footer SRL /// @@ -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(); } } diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 78cf336c..0ef34d84 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -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 /// VideoCodecBase Codec; - /// - /// - /// - SmartObjectDynamicList DirectorySrl; // ***************** SRL ??? - - /// /// To drive UI elements outside of this driver that may be dependent on this. /// @@ -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); } /// @@ -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); } + /// + /// + /// + void RevealKeyboard() + { + if (KeypadMode == eKeypadMode.Dial) + { + var kb = Parent.Keyboard; + kb.KeyPress += new EventHandler(Keyboard_KeyPress); + kb.HideAction = this.DetachKeyboard; + kb.GoButtonText = "Connect"; + kb.GoButtonVisible = true; + DialStringKeypadCheckEnables(); + kb.Show(); + } + } + + /// + /// + /// + 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; + } + /// /// /// @@ -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(DirectoryKeyboardChange); - kb.HideAction += () => - { - kb.OutputFeedback.OutputChange -= DirectoryKeyboardChange; - }; - - }); - } - - /// - /// - /// - 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(); + } + + /// + /// Clears the dial keypad + /// + void DialKeypadClear() + { + DialStringBuilder.Remove(0, DialStringBuilder.Length); + DialStringFeedback.FireUpdate(); + DialStringKeypadCheckEnables(); + } + + /// + /// Checks the enabled states of various elements around the keypad + /// + 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(); + } + + /// + /// + /// + /// + 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 diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 67efe333..2b9a781e 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index e104408c..a4dee1dd 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ