Fixed end all not working - many hours chasing error

This commit is contained in:
Heath Volmer
2017-09-22 13:20:50 -06:00
parent f498d55dd6
commit 1c63e506b8
8 changed files with 124 additions and 51 deletions

View File

@@ -11,11 +11,15 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
{
public BasicTriList TriList { get; private set; }
int ShiftMode;
public StringFeedback OutputFeedback { get; private set; }
StringBuilder Output;
public bool IsVisible { get; private set; }
int ShiftMode;
StringBuilder Output;
public Action HideAction { get; set; }
/// <summary>
///
@@ -30,12 +34,14 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
}
/// <summary>
/// Puts actions on buttons
/// Shows the keyboard and attaches sig handlers in the range of 2901-2969
/// </summary>
void SetUp()
public void Show()
{
TriList.SetSigTrueAction(KeyboardClosePress, Hide);
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)));
@@ -70,24 +76,49 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
TriList.SetSigTrueAction(2952, Shift);
TriList.SetSigTrueAction(2953, NumShift);
}
public void Show()
{
TriList.SetBool(KeyboardVisible, true);
IsVisible = true;
}
/// <summary>
/// Hides the keyboard and disconnects ALL sig handlers from 2901 - 2969
/// </summary>
public void Hide()
{
if (!IsVisible)
return;
for (uint i = 2901; i < 2970; i++)
TriList.ClearBoolSigAction(i);
// run attached actions
if(HideAction != null)
HideAction();
TriList.SetBool(KeyboardVisible, false);
IsVisible = false;
}
void Append(char c)
/// <summary>
///
/// </summary>
/// <param name="c"></param>
public void Append(char c)
{
Output.Append(c);
OutputFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
/// <param name="s"></param>
public void Append(string s)
{
Output.Append(s);
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]; }
@@ -171,7 +202,7 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
/// <summary>
/// 2904
/// </summary>
public const uint KeyboardButton1Press = 2904;
public const uint KeyboardButton2Press = 2904;
/// <summary>
/// 2910
/// </summary>
@@ -182,4 +213,39 @@ namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
public const uint KeyboardClearVisible = 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
*/
}

View File

@@ -91,8 +91,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public override void EndAllCalls()
{
Debug.Console(1, this, "EndAllCalls");
foreach (var call in ActiveCalls)
for(int i = ActiveCalls.Count - 1; i >= 0; i--)
{
var call = ActiveCalls[i];
ActiveCalls.Remove(call);
SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, call);
}

View File

@@ -33,6 +33,10 @@ namespace PepperDash.Essentials
/// 1002
/// </summary>
public const uint CallEndAllConfirmPress = 1002;
/// <summary>
/// 1003 - For tapping the text field to reveal the keyboard
/// </summary>
public const uint CodecDirectorySearchTextPress = 1003;
// Audio Conference
@@ -178,7 +182,7 @@ namespace PepperDash.Essentials
/// <summary>
/// 2904
/// </summary>
public const uint KeyboardButton1Press = 2904;
public const uint KeyboardButton2Press = 2904;
/// <summary>

View File

@@ -16,7 +16,7 @@ namespace PepperDash.Essentials
/// <summary>
///
/// </summary>
public class EssentialsHuddleVtc1PanelAvFunctionsDriver : PanelDriverBase, IHasPopupInterlock
public class EssentialsHuddleVtc1PanelAvFunctionsDriver : PanelDriverBase, IAVDriver
{
CrestronTouchpanelPropertiesConfig Config;
@@ -130,6 +130,8 @@ namespace PepperDash.Essentials
PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver VCDriver;
public PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; private set; }
/// <summary>
/// Constructor
/// </summary>
@@ -152,9 +154,7 @@ namespace PepperDash.Essentials
SetupActivityFooterWhenRoomOff();
ShowVolumeGauge = true;
//PowerOffTimeout = 30000;
//TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below";
Keyboard = new PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController(TriList);
}
/// <summary>
@@ -306,34 +306,6 @@ namespace PepperDash.Essentials
base.Show();
}
///// <summary>
///// Puts the UI into the "start" mode. System is off. Logo shows. Activity SRL is clear
///// </summary>
//void ShowStartMode()
//{
// SetupActivityFooterWhenRoomOff();
// ShareButtonSig.BoolValue = false;
// CallButtonSig.BoolValue = false;
// ShowLogo();
// StagingBarInterlock.ShowInterlocked(UIBoolJoin.StartPageVisible);
// StagingBarInterlock.HideAndClear();
//}
//void ShowShareMode()
//{
// ShareButtonSig.BoolValue = true;
// CallButtonSig.BoolValue = false;
// StagingBarInterlock.ShowInterlocked(UIBoolJoin.SourceStagingBarVisible);
//}
//void ShowVideoCallMode()
//{
// ShareButtonSig.BoolValue = false;
// CallButtonSig.BoolValue = true;
// StagingBarInterlock.ShowInterlocked(UIBoolJoin.CallStagingBarVisible);
//}
/// <summary>
///
/// </summary>
@@ -978,8 +950,12 @@ namespace PepperDash.Essentials
}
}
public interface IHasPopupInterlock
/// <summary>
/// For hanging off various common things that child drivers might need from a parent AV driver
/// </summary>
public interface IAVDriver
{
PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; }
JoinedSigInterlock PopupInterlock { get; }
}
}

View File

@@ -5,6 +5,9 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials
{
public class JoinedSigInterlock
@@ -26,7 +29,7 @@ namespace PepperDash.Essentials
if (CurrentJoin == join)
return;
SetButDontShow(join);
TriList.BooleanInput[CurrentJoin].BoolValue = true;
TriList.SetBool(CurrentJoin, true);
}
/// <summary>
@@ -74,7 +77,7 @@ namespace PepperDash.Essentials
}
/// <summary>
/// Useful for pre-setting the interlock but not enabling it.
/// Useful for pre-setting the interlock but not enabling it. Sets CurrentJoin
/// </summary>
/// <param name="join"></param>
public void SetButDontShow(uint join)

View File

@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
public class EssentialsVideoCodecUiDriver : PanelDriverBase
{
IHasPopupInterlock Parent;
IAVDriver Parent;
/// <summary>
///
@@ -76,10 +76,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
/// <param name="triList"></param>
/// <param name="codec"></param>
public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, IHasPopupInterlock parent, VideoCodecBase codec)
public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, IAVDriver parent, VideoCodecBase codec)
: base(triList)
{
Codec = codec;
Parent = parent;
SetupCallStagingPopover();
SetupDialKeypad();
ActiveCallsSRL = new SubpageReferenceList(TriList, UISmartObjectJoin.CodecActiveCallsHeaderList, 3, 3, 3);
@@ -264,7 +265,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetSigFalseAction(UIBoolJoin.CallEndPress, () =>
{
if (Codec.ActiveCalls.Count > 1)
{
Debug.Console(1, "#*#*#*# FUCK ME!!!!");
Parent.PopupInterlock.ShowInterlocked(UIBoolJoin.HeaderActiveCallsListVisible);
}
else
Codec.EndAllCalls();
});
@@ -320,6 +324,25 @@ namespace PepperDash.Essentials.UIDrivers.VC
// populate directory
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()