ecs-411: Most of keyboard driver

This commit is contained in:
Heath Volmer
2017-09-21 21:23:48 -06:00
parent 69e76bdb3a
commit f498d55dd6
14 changed files with 320 additions and 39 deletions

View File

@@ -184,6 +184,7 @@
<Compile Include="SmartObjects\SmartObjectHelperBase.cs" /> <Compile Include="SmartObjects\SmartObjectHelperBase.cs" />
<Compile Include="Routing\TieLine.cs" /> <Compile Include="Routing\TieLine.cs" />
<Compile Include="Timers\CountdownTimer.cs" /> <Compile Include="Timers\CountdownTimer.cs" />
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
<Compile Include="Touchpanels\MOVED LargeTouchpanelControllerBase.cs" /> <Compile Include="Touchpanels\MOVED LargeTouchpanelControllerBase.cs" />
<Compile Include="Touchpanels\TriListExtensions.cs" /> <Compile Include="Touchpanels\TriListExtensions.cs" />
<Compile Include="Touchpanels\MOVED UIControllers\DevicePageControllerBase.cs" /> <Compile Include="Touchpanels\MOVED UIControllers\DevicePageControllerBase.cs" />
@@ -208,7 +209,7 @@
<Compile Include="Room\Room.cs" /> <Compile Include="Room\Room.cs" />
<Compile Include="Room\RoomCues.cs" /> <Compile Include="Room\RoomCues.cs" />
<Compile Include="Room\MOVED RoomEventArgs.cs" /> <Compile Include="Room\MOVED RoomEventArgs.cs" />
<Compile Include="SubpageReferencList\SourceListSubpageReferenceList.cs" /> <Compile Include="SmartObjects\SubpageReferencList\SourceListSubpageReferenceList.cs" />
<Compile Include="Touchpanels\ModalDialog.cs" /> <Compile Include="Touchpanels\ModalDialog.cs" />
<Compile Include="Touchpanels\SmartGraphicsTouchpanelControllerBase.cs" /> <Compile Include="Touchpanels\SmartGraphicsTouchpanelControllerBase.cs" />
<Compile Include="TriListBridges\HandlerBridge.cs" /> <Compile Include="TriListBridges\HandlerBridge.cs" />
@@ -216,9 +217,9 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SigHelper.cs" /> <Compile Include="SigHelper.cs" />
<Compile Include="REMOVE SigId.cs" /> <Compile Include="REMOVE SigId.cs" />
<Compile Include="SubpageReferencList\DeviceStatusListController.cs" /> <Compile Include="SmartObjects\SubpageReferencList\DeviceStatusListController.cs" />
<Compile Include="SubpageReferencList\SubpageReferenceList.cs" /> <Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceList.cs" />
<Compile Include="SubpageReferencList\SubpageReferenceListItem.cs" /> <Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceListItem.cs" />
<None Include="app.config" /> <None Include="app.config" />
<None Include="Properties\ControlSystem.cfg" /> <None Include="Properties\ControlSystem.cfg" />
</ItemGroup> </ItemGroup>

View File

@@ -0,0 +1,185 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
{
public class HabaneroKeyboardController
{
public BasicTriList TriList { get; private set; }
int ShiftMode;
public StringFeedback OutputFeedback { get; private set; }
StringBuilder Output;
/// <summary>
///
/// </summary>
/// <param name="trilist"></param>
public HabaneroKeyboardController(BasicTriList trilist)
{
TriList = trilist;
Output = new StringBuilder();
OutputFeedback = new StringFeedback(() => Output.ToString());
}
/// <summary>
/// Puts actions on buttons
/// </summary>
void SetUp()
{
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(2950, Backspace);
TriList.SetSigTrueAction(2951, Clear);
TriList.SetSigTrueAction(2952, Shift);
TriList.SetSigTrueAction(2953, NumShift);
}
public void Show()
{
TriList.SetBool(KeyboardVisible, true);
}
public void Hide()
{
TriList.SetBool(KeyboardVisible, false);
}
void Append(char c)
{
Output.Append(c);
OutputFeedback.FireUpdate();
}
char A(int i) { return new char[] { 'a', 'A', '?', '?' }[i]; }
char B(int i) { return new char[] { 'b', 'B', ':', ':' }[i]; }
char C(int i) { return new char[] { 'c', 'C', '>', '>' }[i]; }
char D(int i) { return new char[] { 'd', 'D', '_', '_' }[i]; }
char E(int i) { return new char[] { 'e', 'E', '3', '#' }[i]; }
char F(int i) { return new char[] { 'f', 'F', '=', '=' }[i]; }
char G(int i) { return new char[] { 'g', 'G', '+', '+' }[i]; }
char H(int i) { return new char[] { 'h', 'H', '[', '[' }[i]; }
char I(int i) { return new char[] { 'i', 'I', '8', '*' }[i]; }
char J(int i) { return new char[] { 'j', 'J', ']', ']' }[i]; }
char K(int i) { return new char[] { 'k', 'K', '/', '/' }[i]; }
char L(int i) { return new char[] { 'l', 'L', '\\', '\\' }[i]; }
char M(int i) { return new char[] { 'm', 'M', '"', '"' }[i]; }
char N(int i) { return new char[] { 'n', 'N', '\'', '\'' }[i]; }
char O(int i) { return new char[] { 'o', 'O', '9', '(' }[i]; }
char P(int i) { return new char[] { 'p', 'P', '0', ')' }[i]; }
char Q(int i) { return new char[] { 'q', 'Q', '1', '!' }[i]; }
char R(int i) { return new char[] { 'r', 'R', '4', '$' }[i]; }
char S(int i) { return new char[] { 's', 'S', '-', '-' }[i]; }
char T(int i) { return new char[] { 't', 'T', '5', '%' }[i]; }
char U(int i) { return new char[] { 'u', 'U', '7', '&' }[i]; }
char V(int i) { return new char[] { 'v', 'V', ';', ';' }[i]; }
char W(int i) { return new char[] { 'w', 'W', '2', '@' }[i]; }
char X(int i) { return new char[] { 'x', 'X', '<', '<' }[i]; }
char Y(int i) { return new char[] { 'y', 'Y', '6', '^' }[i]; }
char Z(int i) { return new char[] { 'z', 'Z', ',', ',' }[i]; }
void Backspace()
{
if (Output.Length > 0)
{
Output.Remove(Output.Length - 1, 1);
OutputFeedback.FireUpdate();
}
}
void Clear()
{
Output.Remove(0, Output.Length);
OutputFeedback.FireUpdate();
}
void Shift()
{
if (ShiftMode == 0)
ShiftMode = 1;
else if (ShiftMode == 1)
ShiftMode = 0;
else if (ShiftMode == 2)
ShiftMode = 3;
else
ShiftMode = 2;
TriList.SetUshort(2951, 0); // 0 = up, 1 = down, 2 = #, 3 = 123
TriList.SetUshort(2952, 0); // 0 = #, 1 = abc
}
void NumShift()
{
if (ShiftMode == 0 || ShiftMode == 1)
ShiftMode = 2;
else if (ShiftMode == 2)
ShiftMode = 3;
else
ShiftMode = 0;
}
/// <summary>
/// 2901
/// </summary>
public const uint KeyboardVisible = 2901;
/// <summary>
/// 2902
/// </summary>
public const uint KeyboardClosePress = 2902;
/// <summary>
/// 2903
/// </summary>
public const uint KeyboardButton1Press = 2903;
/// <summary>
/// 2904
/// </summary>
public const uint KeyboardButton1Press = 2904;
/// <summary>
/// 2910
/// </summary>
public const uint KeyboardClearPress = 2910;
/// <summary>
/// 2911
/// </summary>
public const uint KeyboardClearVisible = 2911;
}
}

View File

@@ -26,8 +26,8 @@ namespace PepperDash.Essentials.Fusion
public class EssentialsHuddleSpaceFusionSystemController : Device public class EssentialsHuddleSpaceFusionSystemController : Device
{ {
public event EventHandler<ScheduleChangeEventArgs> ScheduleChange; public event EventHandler<ScheduleChangeEventArgs> ScheduleChange;
public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning; //public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning;
public event EventHandler<MeetingChangeEventArgs> NextMeetingBeginWarning; //public event EventHandler<MeetingChangeEventArgs> NextMeetingBeginWarning;
FusionRoom FusionRoom; FusionRoom FusionRoom;
EssentialsHuddleSpaceRoom Room; EssentialsHuddleSpaceRoom Room;

View File

@@ -154,7 +154,7 @@ namespace PepperDash.Essentials
{ {
Debug.Console(0, this, "Adding huddle space driver"); Debug.Console(0, this, "Adding huddle space driver");
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props); var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(Panel, var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(Panel, avDriver,
(room as EssentialsHuddleVtc1Room).VideoCodec); (room as EssentialsHuddleVtc1Room).VideoCodec);
avDriver.SetVideoCodecDriver(codecDriver); avDriver.SetVideoCodecDriver(codecDriver);
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room; avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;

View File

@@ -22,8 +22,21 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint VolumeDownPress = 902; public const uint VolumeDownPress = 902;
//****************************************************** //****************************************************
// Codec General
/// <summary>
/// 1001
/// </summary>
public const uint CallEndPress = 1001;
/// <summary>
/// 1002
/// </summary>
public const uint CallEndAllConfirmPress = 1002;
// Audio Conference // Audio Conference
#warning Move these to 1100's
/// <summary> /// <summary>
/// 1001 /// 1001
/// </summary> /// </summary>
@@ -153,7 +166,21 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// 2901 /// 2901
/// </summary> /// </summary>
public const uint KeyboardVisible = 2901; public const uint KeyboardVisible = 2901;
/// <summary>
/// 2902
/// </summary>
public const uint KeyboardClosePress = 2902;
/// <summary>
/// 2903
/// </summary>
public const uint KeyboardButton1Press = 2903;
/// <summary>
/// 2904
/// </summary>
public const uint KeyboardButton1Press = 2904;
/// <summary> /// <summary>
/// 2910 /// 2910
/// </summary> /// </summary>
@@ -163,6 +190,9 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint KeyboardClearVisible = 2911; public const uint KeyboardClearVisible = 2911;
// Letter joins start at 2921;
//******************************************************
/// <summary> /// <summary>
/// 3811 /// 3811
/// </summary> /// </summary>
@@ -476,32 +506,31 @@ namespace PepperDash.Essentials
/// 15060 /// 15060
/// </summary> /// </summary>
public const uint Display2AudioButtonPressAndFb = 15060; public const uint Display2AudioButtonPressAndFb = 15060;
/// <summary> /// <summary>
/// 15061 Reveals the dual-display subpage /// 15061 Reveals the dual-display subpage
/// </summary> /// </summary>
public const uint DualDisplayPageVisible = 15061; public const uint DualDisplayPageVisible = 15061;
/// <summary> /// <summary>
/// 15062 Reveals the toggle switch for the sharing mode /// 15062 Reveals the toggle switch for the sharing mode
/// </summary> /// </summary>
public const uint ToggleSharingModeVisible = 15062; public const uint ToggleSharingModeVisible = 15062;
/// <summary> /// <summary>
/// 15063 Press for the toggle mode switch /// 15063 Press for the toggle mode switch
/// </summary> /// </summary>
public const uint ToggleSharingModePress = 15063; public const uint ToggleSharingModePress = 15063;
/// <summary> /// <summary>
/// 15064 /// 15064
/// </summary> /// </summary>
public const uint LogoDefaultVisible = 15064; public const uint LogoDefaultVisible = 15064;
/// <summary> /// <summary>
/// 15065 /// 15065
/// </summary> /// </summary>
public const uint LogoUrlVisible = 15065; public const uint LogoUrlVisible = 15065;
/// <summary> /// <summary>
/// 15066 - Reveals the active calls header item
/// </summary>
public const uint HeaderActiveCallsListVisible = 15066;
/// <summary>
/// 15083 - Press for Call help desk on AC/VC /// 15083 - Press for Call help desk on AC/VC
/// </summary> /// </summary>
public const uint HelpPageShowCallButtonPress = 15083; public const uint HelpPageShowCallButtonPress = 15083;

View File

@@ -3,6 +3,12 @@
public class UISmartObjectJoin public class UISmartObjectJoin
{ {
//****************************************************** //******************************************************
// Conference
/// <summary>
/// 1001 - The list that reveals in header to show calls
/// </summary>
public const uint CodecActiveCallsHeaderList = 1001;
// Video Conference // Video Conference
/// <summary> /// <summary>

View File

@@ -16,7 +16,7 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class EssentialsHuddleVtc1PanelAvFunctionsDriver : PanelDriverBase public class EssentialsHuddleVtc1PanelAvFunctionsDriver : PanelDriverBase, IHasPopupInterlock
{ {
CrestronTouchpanelPropertiesConfig Config; CrestronTouchpanelPropertiesConfig Config;
@@ -118,7 +118,7 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// Represents /// Represents
/// </summary> /// </summary>
JoinedSigInterlock PopupInterlock; public JoinedSigInterlock PopupInterlock { get; private set; }
/// <summary> /// <summary>
/// Interlock for various source, camera, call control bars. The bar above the activity footer. This is also /// Interlock for various source, camera, call control bars. The bar above the activity footer. This is also
@@ -155,12 +155,6 @@ namespace PepperDash.Essentials
//PowerOffTimeout = 30000; //PowerOffTimeout = 30000;
//TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below"; //TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below";
// Reveal proper header buttons with/without lighting
if(false) // has lighting
TriList.SetBool(UIBoolJoin.CallLeftHeaderButtonVisible, true);
else
TriList.SetBool(UIBoolJoin.CallRightHeaderButtonVisible, true);
} }
/// <summary> /// <summary>
@@ -272,9 +266,14 @@ namespace PepperDash.Essentials
if(roomConf.OneButtonMeeting != null && roomConf.OneButtonMeeting.Enable) if(roomConf.OneButtonMeeting != null && roomConf.OneButtonMeeting.Enable)
{ {
TriList.SetBool(UIBoolJoin.CalendarHeaderButtonVisible, true); TriList.SetBool(UIBoolJoin.CalendarHeaderButtonVisible, true);
TriList.SetSigFalseAction(UIBoolJoin.CallHeaderButtonPress, () => TriList.SetBool(UIBoolJoin.CallLeftHeaderButtonVisible, true);
{ }); }
} else
TriList.SetBool(UIBoolJoin.CallRightHeaderButtonVisible, true);
TriList.SetSigFalseAction(UIBoolJoin.CallHeaderButtonPress, () =>
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HeaderActiveCallsListVisible));
// Setup button - shows volumes with default button OR hold for tech page // Setup button - shows volumes with default button OR hold for tech page
TriList.SetSigHeldAction(UIBoolJoin.GearHeaderButtonPress, 2000, TriList.SetSigHeldAction(UIBoolJoin.GearHeaderButtonPress, 2000,
@@ -978,4 +977,9 @@ namespace PepperDash.Essentials
RefreshSourceInfo(); RefreshSourceInfo();
} }
} }
public interface IHasPopupInterlock
{
JoinedSigInterlock PopupInterlock { get; }
}
} }

View File

@@ -16,8 +16,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
{ {
#warning When InCall, keypad text should clear. Keypad becomes DTMF only. Delete is gone and disabled. Send keypresses immediately to SendDTMF. Queue them in disaply string.
#warning when Call ends, clear keypad text.
#warning FOR SPARK - (GFX also) we need a staging bar for in call state where there is no camera button #warning FOR SPARK - (GFX also) we need a staging bar for in call state where there is no camera button
/// <summary> /// <summary>
/// This fella will likely need to interact with the room's source, although that is routed via the spark... /// This fella will likely need to interact with the room's source, although that is routed via the spark...
@@ -26,6 +24,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary> /// </summary>
public class EssentialsVideoCodecUiDriver : PanelDriverBase public class EssentialsVideoCodecUiDriver : PanelDriverBase
{ {
IHasPopupInterlock Parent;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -60,6 +60,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
SmartObjectNumeric DialKeypad; SmartObjectNumeric DialKeypad;
SubpageReferenceList ActiveCallsSRL;
// These are likely temp until we get a keyboard built // These are likely temp until we get a keyboard built
StringFeedback DialStringFeedback; StringFeedback DialStringFeedback;
StringBuilder DialStringBuilder = new StringBuilder(); StringBuilder DialStringBuilder = new StringBuilder();
@@ -67,17 +69,20 @@ namespace PepperDash.Essentials.UIDrivers.VC
ModalDialog IncomingCallModal; ModalDialog IncomingCallModal;
eKeypadMode KeypadMode;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="triList"></param> /// <param name="triList"></param>
/// <param name="codec"></param> /// <param name="codec"></param>
public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec) public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, IHasPopupInterlock parent, VideoCodecBase codec)
: base(triList) : base(triList)
{ {
Codec = codec; Codec = codec;
SetupCallStagingPopover(); SetupCallStagingPopover();
SetupDialKeypad(); SetupDialKeypad();
ActiveCallsSRL = new SubpageReferenceList(TriList, UISmartObjectJoin.CodecActiveCallsHeaderList, 3, 3, 3);
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange); codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
@@ -118,6 +123,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
case eCodecCallStatus.Connected: case eCodecCallStatus.Connected:
// fire at SRL item // fire at SRL item
Debug.Console(1, "*#* UI: Call Connected {0}", call.Name); Debug.Console(1, "*#* UI: Call Connected {0}", call.Name);
KeypadMode = eKeypadMode.DTMF;
DialStringBuilder.Remove(0, DialStringBuilder.Length);
DialStringFeedback.FireUpdate();
TriList.SetBool(UIBoolJoin.KeyboardClearVisible, false);
break; break;
case eCodecCallStatus.Connecting: case eCodecCallStatus.Connecting:
// fire at SRL item // fire at SRL item
@@ -128,6 +137,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
break; break;
case eCodecCallStatus.Disconnected: case eCodecCallStatus.Disconnected:
Debug.Console(1, "*#* UI: Call Disconnecting {0}", call.Name); Debug.Console(1, "*#* UI: Call Disconnecting {0}", call.Name);
if (!Codec.IsInCall)
{
KeypadMode = eKeypadMode.Dial;
DialStringBuilder.Remove(0, DialStringBuilder.Length);
DialStringFeedback.FireUpdate();
}
break; break;
case eCodecCallStatus.Disconnecting: case eCodecCallStatus.Disconnecting:
break; break;
@@ -153,6 +168,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0); TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0);
StagingBarInterlock.ShowInterlocked(Codec.IsInCall ? StagingBarInterlock.ShowInterlocked(Codec.IsInCall ?
UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible); UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible);
// Set mode of header button // Set mode of header button
if (!Codec.IsInCall) if (!Codec.IsInCall)
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 0); TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 0);
@@ -162,9 +178,29 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1); TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
// Update list of calls // Update list of calls
var activeList = Codec.ActiveCalls.Where(c => c.IsActiveCall).ToList(); UpdateCallsHeaderList(call);
Debug.Console(1, "*#* UI - Codec has {0} calls", activeList.Count); }
/// <summary>
/// Redraws the calls list on the header
/// </summary>
void UpdateCallsHeaderList(CodecActiveCallItem call)
{
var activeList = Codec.ActiveCalls.Where(c => c.IsActiveCall).ToList();
ActiveCallsSRL.Clear();
ushort i = 1;
foreach (var c in activeList)
{
var item = new SubpageReferenceListItem(1, ActiveCallsSRL);
ActiveCallsSRL.StringInputSig(i, 1).StringValue = c.Name;
ActiveCallsSRL.StringInputSig(i, 2).StringValue = c.Number;
ActiveCallsSRL.StringInputSig(i, 3).StringValue = c.Status.ToString();
ActiveCallsSRL.UShortInputSig(i, 1).UShortValue = (ushort)(c.Type == eCodecCallType.Video ? 2 : 1);
var cc = c; // for scope in lambda
ActiveCallsSRL.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() => Codec.EndCall(cc));
i++;
}
ActiveCallsSRL.Count = (ushort)activeList.Count;
} }
/// <summary> /// <summary>
@@ -222,9 +258,17 @@ namespace PepperDash.Essentials.UIDrivers.VC
void SetupCallStagingPopover() void SetupCallStagingPopover()
{ {
TriList.SetSigFalseAction(UIBoolJoin.VCStagingDirectoryPress, ShowDirectory); TriList.SetSigFalseAction(UIBoolJoin.VCStagingDirectoryPress, ShowDirectory);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingKeypadPress, ShowKeypad); TriList.SetSigFalseAction(UIBoolJoin.VCStagingKeypadPress, ShowKeypad);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents); TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress);
TriList.SetSigFalseAction(UIBoolJoin.CallEndPress, () =>
{
if (Codec.ActiveCalls.Count > 1)
Parent.PopupInterlock.ShowInterlocked(UIBoolJoin.HeaderActiveCallsListVisible);
else
Codec.EndAllCalls();
});
TriList.SetSigFalseAction(UIBoolJoin.CallEndAllConfirmPress, Codec.EndAllCalls);
} }
/// <summary> /// <summary>
@@ -290,10 +334,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary> /// </summary>
void ConnectPress() void ConnectPress()
{ {
if (Codec.IsInCall) Codec.Dial(DialStringBuilder.ToString());
Codec.EndAllCalls();
else
Codec.Dial(DialStringBuilder.ToString());
} }
@@ -303,10 +344,20 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// <param name="i"></param> /// <param name="i"></param>
void DialKeypadPress(string i) void DialKeypadPress(string i)
{ {
DialStringBuilder.Append(i); if (KeypadMode == eKeypadMode.Dial)
DialStringFeedback.FireUpdate(); {
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = DialStringBuilder.Append(i);
DialStringBuilder.Length > 0; DialStringFeedback.FireUpdate();
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue =
DialStringBuilder.Length > 0;
}
else
{
Codec.SendDtmf(i);
DialStringBuilder.Append(i);
DialStringFeedback.FireUpdate();
// no delete key in this mode!
}
} }
/// <summary> /// <summary>
@@ -320,5 +371,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialStringBuilder.Length > 0; DialStringBuilder.Length > 0;
TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0); TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0);
} }
enum eKeypadMode
{
Dial, DTMF
}
} }
} }