From 41b42dbc8ffca79fa92a82097b9bd8edd5d92497 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 12 Oct 2017 17:51:04 -0600 Subject: [PATCH] Added Directory Search, bug fixes and updates to recents and meeting list. Made Meeting list modal/srl reusable for directory dial contact method modal. --- .../CiscoCodec/BookingsDataClasses.cs | 28 ++- .../Room/Config/EssentialsRoomConfig.cs | 7 +- .../Room/Types/EssentialsHuddleVtc1Room.cs | 4 +- .../UI/JoinConstants/UIBoolJoin.cs | 31 +-- .../UI/JoinConstants/UIStringlJoin.cs | 19 +- ...entialsHuddleVtc1PanelAvFunctionsDriver.cs | 25 ++- .../VC/EssentialsVideoCodecUiDriver.cs | 200 +++++++++++++++--- 7 files changed, 239 insertions(+), 75 deletions(-) diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/BookingsDataClasses.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/BookingsDataClasses.cs index 999e1a21..405b5047 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/BookingsDataClasses.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/BookingsDataClasses.cs @@ -211,12 +211,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public class Call { + public string id { get; set; } public Number Number { get; set; } public Protocol Protocol { get; set; } public CallRate CallRate { get; set; } public CallType CallType { get; set; } } + public class Calls + { + public List Call {get; set;} + } + public class ConnectMode { public string Value { get; set; } @@ -224,12 +230,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public class DialInfo { - public List Calls { get; set; } + public Calls Calls { get; set; } public ConnectMode ConnectMode { get; set; } public DialInfo() { - Calls = new List(); + Calls = new Calls(); + ConnectMode = new ConnectMode(); } } @@ -319,15 +326,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec if (b.DialInfo.ConnectMode.Value.ToLower() == "obtp" || b.DialInfo.ConnectMode.Value.ToLower() == "manual") meeting.IsOneButtonToPushMeeting = true; - foreach (Call c in b.DialInfo.Calls) + if (b.DialInfo.Calls.Call != null) { - meeting.Calls.Add(new PepperDash.Essentials.Devices.Common.Codec.Call() + foreach (Call c in b.DialInfo.Calls.Call) { - Number = c.Number.Value, - Protocol = c.Protocol.Value, - CallRate = c.CallRate.Value, - CallType = c.CallType.Value - }); + meeting.Calls.Add(new PepperDash.Essentials.Devices.Common.Codec.Call() + { + Number = c.Number.Value, + Protocol = c.Protocol.Value, + CallRate = c.CallRate.Value, + CallType = c.CallType.Value + }); + } } diff --git a/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index 9b2e9d34..78263679 100644 --- a/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -64,6 +64,8 @@ namespace PepperDash.Essentials.Room.Config PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase; var rm = new EssentialsHuddleVtc1Room(Key, Name, disp, codec, codec, props); + // Add Occupancy object from config +#warning Add in occupancy object from confic if found and link up device to occupancy feedback rm.LogoUrl = props.Logo.GetUrl(); rm.SourceListKey = props.SourceListKey; rm.DefaultSourceItem = props.DefaultSourceItem; @@ -108,7 +110,7 @@ namespace PepperDash.Essentials.Room.Config public EssentialsHelpPropertiesConfig Help { get; set; } public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; } public EssentialsRoomAddressPropertiesConfig Addresses { get; set; } - public EssentialsRoomOccSensorConfig OccupancySensors { get; set; } + public EssentialsRoomOccSensorConfig Occupancy { get; set; } public EssentialsLogoPropertiesConfig Logo { get; set; } public EssentialsRoomTechConfig Tech { get; set; } public EssentialsRoomVolumesConfig Volumes { get; set; } @@ -173,8 +175,7 @@ namespace PepperDash.Essentials.Room.Config /// public class EssentialsRoomOccSensorConfig { - public string Mode { get; set; } - public List Types { get; set; } + public string DeviceKey { get; set; } } public class EssentialsRoomTechConfig diff --git a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 51c55374..af3cc065 100644 --- a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -234,13 +234,11 @@ namespace PepperDash.Essentials { IsWarmingUpFeedback.FireUpdate(); if (!IsWarmingUpFeedback.BoolValue) - (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); + (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); }; disp.IsCoolingDownFeedback.OutputChange += (o, a) => { IsCoolingDownFeedback.FireUpdate(); - if (IsCoolingDownFeedback.BoolValue) - (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); }; } diff --git a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs index a20bd3e8..3a383381 100644 --- a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs +++ b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs @@ -190,17 +190,23 @@ namespace PepperDash.Essentials /// /// 1241 For touching the text area to bring up keyboard /// - public const uint VCDirectoryTextEntryPress = 1241; + public const uint VCDirectorySearchTextPress = 1241; /// /// 1242 /// public const uint VCStagingSelfViewLayoutPress = 1242; - /// /// 1243 /// public const uint VCDirectoryBackVisible = 1243; - + /// + /// 1244 + /// + public const uint VCDirectoryBackspacePress = 1244; + /// + /// 1245 + /// + public const uint VCDirectoryBackspaceVisible = 1245; /// /// 1251 /// @@ -215,23 +221,6 @@ namespace PepperDash.Essentials public const uint VCSelfViewPipTogglePress = 1253; //****************************************************** - // Keyboard - /// - /// 2901 - /// - public const uint KeyboardVisible = 2901; - /// - /// 2902 - /// - public const uint KeyboardClosePress = 2902; - /// - /// 2903 - /// - public const uint KeyboardButton1Press = 2903; - /// - /// 2904 - /// - public const uint KeyboardButton2Press = 2904; // Letter joins start at 2921; @@ -550,7 +539,7 @@ namespace PepperDash.Essentials /// /// 15046 /// - public const uint MeetingsListVisible = 15046; + public const uint MeetingsOrContacMethodsListVisible = 15046; /// /// 15047 The "Join" button on the next meeting ribbon /// diff --git a/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs b/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs index af461fb9..d4f16a2b 100644 --- a/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs +++ b/Essentials/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs @@ -18,7 +18,11 @@ namespace PepperDash.Essentials /// /// 1001 /// - public const uint CodecAddressEntryText = 1001; + public const uint CodecAddressEntryText = 1001; + /// + /// 1002 + /// + public const uint CodecDirectorySearchEntryText = 1002; /// /// 1201 - 1230 range of joins for recents list @@ -217,6 +221,17 @@ namespace PepperDash.Essentials /// /// 3972 /// - public const uint NextMeetingFollowingMeetingText = 3972; + public const uint NextMeetingFollowingMeetingText = 3972; + + /// + /// 3996 + /// + public const uint MeetingsOrContactMethodListIcon = 3996; + + /// + /// 3997 + /// + public const uint MeetingsOrContactMethodListTitleText = 3997; + } } \ No newline at end of file diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 8c95fa94..6dfd7ed8 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -93,7 +93,7 @@ namespace PepperDash.Essentials /// /// /// - SubpageReferenceList MeetingsSrl; + public SubpageReferenceList MeetingOrContactMethodModalSrl { get; set; } /// /// The list of buttons on the header. Managed with visibility only @@ -199,7 +199,7 @@ namespace PepperDash.Essentials ShareButtonSig = ActivityFooterSrl.BoolInputSig(1, 1); EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1); - MeetingsSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.MeetingListSRL, 3, 3, 5); + MeetingOrContactMethodModalSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.MeetingListSRL, 3, 3, 5); // buttons are added in SetCurrentRoom @@ -454,7 +454,7 @@ namespace PepperDash.Essentials void CalendarPress() { RefreshMeetingsList(); - PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsListVisible); + PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible); } /// @@ -968,17 +968,21 @@ namespace PepperDash.Essentials /// void RefreshMeetingsList() { + TriList.SetString(UIStringJoin.MeetingsOrContactMethodListIcon, "Calendar"); + TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Today's Meetings"); + ushort i = 0; foreach (var m in CurrentRoom.ScheduleSource.CodecSchedule.Meetings) { i++; - MeetingsSrl.StringInputSig(i, 1).StringValue = m.StartTime.ToShortTimeString(); - MeetingsSrl.StringInputSig(i, 2).StringValue = m.EndTime.ToShortTimeString(); - MeetingsSrl.StringInputSig(i, 3).StringValue = m.Title; - MeetingsSrl.StringInputSig(i, 4).StringValue = "Join"; - MeetingsSrl.BoolInputSig(i, 2).BoolValue = m.Joinable; + MeetingOrContactMethodModalSrl.StringInputSig(i, 1).StringValue = m.StartTime.ToShortTimeString(); + MeetingOrContactMethodModalSrl.StringInputSig(i, 2).StringValue = m.EndTime.ToShortTimeString(); + MeetingOrContactMethodModalSrl.StringInputSig(i, 3).StringValue = m.Title; + MeetingOrContactMethodModalSrl.StringInputSig(i, 4).StringValue = string.Format("
{0}",m.Organizer); + MeetingOrContactMethodModalSrl.StringInputSig(i, 5).StringValue = "Join"; + MeetingOrContactMethodModalSrl.BoolInputSig(i, 2).BoolValue = m.Joinable; var mm = m; // lambda scope - MeetingsSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() => + MeetingOrContactMethodModalSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() => { PopupInterlock.Hide(); var d = CurrentRoom.ScheduleSource as VideoCodecBase; @@ -986,7 +990,7 @@ namespace PepperDash.Essentials RoomOnAndDialMeeting(mm); }); } - MeetingsSrl.Count = i; + MeetingOrContactMethodModalSrl.Count = i; } /// @@ -1247,5 +1251,6 @@ namespace PepperDash.Essentials void HideNotificationRibbon(); HeaderListButton HeaderGearButton { get; } HeaderListButton HeaderCallButton { get; } + SubpageReferenceList MeetingOrContactMethodModalSrl { get; } } } diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 7f261001..9f236f3e 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -70,6 +70,10 @@ namespace PepperDash.Essentials.UIDrivers.VC StringBuilder DialStringBuilder = new StringBuilder(); BoolFeedback DialStringBackspaceVisibleFeedback; + StringFeedback SearchStringFeedback; + StringBuilder SearchStringBuilder = new StringBuilder(); + BoolFeedback SearchStringBackspaceVisibleFeedback; + ModalDialog IncomingCallModal; eKeypadMode KeypadMode; @@ -134,6 +138,24 @@ namespace PepperDash.Essentials.UIDrivers.VC DialStringBackspaceVisibleFeedback .LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCKeypadBackspaceVisible]); + SearchStringFeedback = new StringFeedback(() => + { + if (SearchStringBuilder.Length > 0) + { + Parent.Keyboard.EnableGoButton(); + return SearchStringBuilder.ToString(); + } + else + { + Parent.Keyboard.DisableGoButton(); + return "Touch to Search"; + } + }); + SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]); + + SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0); + SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]); + TriList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents); DirectoryBackButtonVisibleFeedback = new BoolFeedback(() => CurrentDirectoryResult != (codec as IHasDirectory).DirectoryRoot); @@ -142,6 +164,10 @@ namespace PepperDash.Essentials.UIDrivers.VC TriList.SetSigFalseAction(UIBoolJoin.VCKeypadTextPress, RevealKeyboard); + TriList.SetSigFalseAction(UIBoolJoin.VCDirectorySearchTextPress, RevealKeyboard); + + TriList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackspacePress, SearchKeypadBackspacePress); + // Address and number } @@ -400,9 +426,9 @@ namespace PepperDash.Essentials.UIDrivers.VC string iconName = null; if (c.OccurenceType == eCodecOccurrenceType.Received) - iconName = "Left"; + iconName = "Misc-18_Light"; else if (c.OccurenceType == eCodecOccurrenceType.Placed) - iconName = "Right"; + iconName = "Misc-17_Light"; else iconName = "Help"; RecentCallsList.SetItemIcon(i, iconName); @@ -522,7 +548,10 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void GetDirectoryFolderContents(DirectoryFolder folder) { - LastFolderRequestedParentFolderId = folder.ParentFolderId; + if (!string.IsNullOrEmpty(folder.ParentFolderId)) + LastFolderRequestedParentFolderId = folder.ParentFolderId; + else + LastFolderRequestedParentFolderId = string.Empty; (Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId); } @@ -567,16 +596,17 @@ namespace PepperDash.Essentials.UIDrivers.VC DirectoryList.SetItemMainText(i, r.Name); var dc = r as DirectoryContact; - // if more than one contact method, pop up modal to choose - // otherwiese dial 0 entry - if (dc.ContactMethods.Count == 1) - { - DirectoryList.SetItemButtonAction(i, b => { if (!b) Codec.Dial(dc.ContactMethods[0].Number); }); - } - else - { - } + DirectoryList.SetItemButtonAction(i, b => + { + if (!b) + { + // Refresh the contact methods list + RefreshContactMethodsModalList(dc); + Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible); + } + }); + } else // is DirectoryFolder { @@ -597,6 +627,34 @@ namespace PepperDash.Essentials.UIDrivers.VC DirectoryList.Count = i; } + void RefreshContactMethodsModalList(DirectoryContact contact) + { + TriList.SetString(UIStringJoin.MeetingsOrContactMethodListIcon, "Users"); + TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Contact Methods"); + + ushort i = 0; + foreach (var c in contact.ContactMethods) + { + i++; + Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 1).StringValue = c.Device.ToString(); + Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 2).StringValue = c.CallType.ToString(); + Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 3).StringValue = c.Number; + Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 4).StringValue = ""; + Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 5).StringValue = "Connect"; + Parent.MeetingOrContactMethodModalSrl.BoolInputSig(i, 2).BoolValue = true; + var cc = c; // lambda scope + Parent.MeetingOrContactMethodModalSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() => + { + Parent.PopupInterlock.Hide(); + var codec = Codec as VideoCodecBase; + if (codec != null) + codec.Dial(c.Number); + }); + } + Parent.MeetingOrContactMethodModalSrl.Count = i; + + } + /// /// /// @@ -624,7 +682,7 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void RevealKeyboard() { - if (KeypadMode == eKeypadMode.Dial) + if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCKeypadVisible && KeypadMode == eKeypadMode.Dial) { var kb = Parent.Keyboard; kb.KeyPress += new EventHandler(Keyboard_KeyPress); @@ -634,6 +692,16 @@ namespace PepperDash.Essentials.UIDrivers.VC DialStringKeypadCheckEnables(); kb.Show(); } + else if(VCControlsInterlock.CurrentJoin == UIBoolJoin.VCDirectoryVisible) + { + var kb = Parent.Keyboard; + kb.KeyPress += Keyboard_KeyPress; + kb.HideAction = this.DetachKeyboard; + kb.GoButtonText = "Search"; + kb.GoButtonVisible = true; + SearchStringKeypadCheckEnables(); + kb.Show(); + } } /// @@ -641,22 +709,47 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void Keyboard_KeyPress(object sender, PepperDash.Essentials.Core.Touchpanels.Keyboards.KeyboardControllerPressEventArgs e) { - if (e.Text != null) - DialStringBuilder.Append(e.Text); - else + if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCKeypadVisible) { - if (e.SpecialKey == KeyboardSpecialKey.Backspace) - DialKeypadBackspacePress(); - else if (e.SpecialKey == KeyboardSpecialKey.Clear) - DialKeypadClear(); - else if (e.SpecialKey == KeyboardSpecialKey.GoButton) - { - ConnectPress(); - Parent.Keyboard.Hide(); - } + if (KeypadMode == eKeypadMode.Dial) + 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(); } - DialStringFeedback.FireUpdate(); - DialStringKeypadCheckEnables(); + else if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCDirectoryVisible) + { + if (e.Text != null) + SearchStringBuilder.Append(e.Text); + else + { + if (e.SpecialKey == KeyboardSpecialKey.Backspace) + SearchKeypadBackspacePress(); + else if (e.SpecialKey == KeyboardSpecialKey.Clear) + SearchKeypadClear(); + else if (e.SpecialKey == KeyboardSpecialKey.GoButton) + { + SearchPress(); + Parent.Keyboard.Hide(); + } + } + SearchStringFeedback.FireUpdate(); + SearchStringKeypadCheckEnables(); + } + + } void DetachKeyboard() @@ -778,6 +871,59 @@ namespace PepperDash.Essentials.UIDrivers.VC Parent.Keyboard.DisableGoButton(); } + + void SearchPress() + { + (Codec as IHasDirectory).SearchDirectory(SearchStringBuilder.ToString()); + } + + void SearchKeypadPress(string i) + { + SearchStringBuilder.Append(i); + SearchStringFeedback.FireUpdate(); + SearchStringKeypadCheckEnables(); + } + + /// + /// + /// + void SearchKeypadBackspacePress() + { + SearchStringBuilder.Remove(SearchStringBuilder.Length - 1, 1); + + if (SearchStringBuilder.Length == 0) + SetCurrentDirectoryToRoot(); + + SearchStringFeedback.FireUpdate(); + SearchStringKeypadCheckEnables(); + } + + /// + /// Clears the Search keypad + /// + void SearchKeypadClear() + { + SearchStringBuilder.Remove(0, SearchStringBuilder.Length); + SearchStringFeedback.FireUpdate(); + SearchStringKeypadCheckEnables(); + + SetCurrentDirectoryToRoot(); + } + + /// + /// Checks the enabled states of various elements around the keypad + /// + void SearchStringKeypadCheckEnables() + { + var textIsEntered = SearchStringBuilder.Length > 0; + TriList.SetBool(UIBoolJoin.VCDirectoryBackspaceVisible, textIsEntered); + if (textIsEntered) + Parent.Keyboard.EnableGoButton(); + else + Parent.Keyboard.DisableGoButton(); + } + + /// /// ///