From 24fb74701aafdec29c5b968ebfd37d078988b9d0 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 5 Mar 2019 16:31:13 -0700 Subject: [PATCH 01/13] Working on moving codec browsing data from UI into codec class --- .../Messengers/VideoCodecBaseMessenger.cs | 21 ++++++++++--- .../VC/EssentialsVideoCodecUiDriver.cs | 30 +++++++------------ essentials-framework | 2 +- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs index bd44e139..1f3f42b6 100644 --- a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs @@ -122,10 +122,23 @@ namespace PepperDash.Essentials.AppServer.Messengers if (call != null) Codec.AcceptCall(call); })); - appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot)); - appServerController.AddAction(MessagePath + "/directoryById", new Action(s => GetDirectory(s))); - appServerController.AddAction(MessagePath + "/directorySearch", new Action(s => DirectorySearch(s))); - appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory)); + + // Directory actions + var dirCodec = Codec as IHasDirectory; + if (dirCodec != null) + { + appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot)); + appServerController.AddAction(MessagePath + "/directoryById", new Action(s => GetDirectory(s))); + appServerController.AddAction(MessagePath + "/directorySearch", new Action(s => DirectorySearch(s))); + } + + // History actions + var recCodec = Codec as IHasCallHistory; + if (recCodec != null) + { + appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory)); + } + appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn)); appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff)); appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle)); diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 13bf6a85..998ccbd9 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -61,10 +61,10 @@ namespace PepperDash.Essentials.UIDrivers.VC CodecDirectory CurrentDirectoryResult; - /// - /// Tracks the directory browse history when browsing beyond the root directory - /// - List DirectoryBrowseHistory; + ///// + ///// Tracks the directory browse history when browsing beyond the root directory + ///// + //List DirectoryBrowseHistory; bool NextDirectoryResultIsFolderContents; @@ -532,8 +532,6 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void SetupDirectoryList() { - DirectoryBrowseHistory = new List(); - var codec = Codec as IHasDirectory; if (codec != null) { @@ -558,12 +556,10 @@ namespace PepperDash.Essentials.UIDrivers.VC } /// - /// Sets the current directory resutls to the DirectorRoot and updates Back Button visibiltiy + /// Sets the current directory results to the DirectoryRoot and updates Back Button visibiltiy /// void SetCurrentDirectoryToRoot() { - DirectoryBrowseHistory.Clear(); - CurrentDirectoryResult = (Codec as IHasDirectory).DirectoryRoot; SearchKeypadClear(); @@ -600,7 +596,6 @@ namespace PepperDash.Essentials.UIDrivers.VC if (NextDirectoryResultIsFolderContents) { NextDirectoryResultIsFolderContents = false; - DirectoryBrowseHistory.Add(e.Directory); } CurrentDirectoryResult = e.Directory; DirectoryBackButtonVisibleFeedback.FireUpdate(); @@ -625,18 +620,13 @@ namespace PepperDash.Essentials.UIDrivers.VC { var codec = Codec as IHasDirectory; - if (DirectoryBrowseHistory.Count > 0) + if (codec != null) { - var lastItemIndex = DirectoryBrowseHistory.Count - 1; - CurrentDirectoryResult = DirectoryBrowseHistory[lastItemIndex]; - DirectoryBrowseHistory.Remove(DirectoryBrowseHistory[lastItemIndex]); + CurrentDirectoryResult = codec.GetDirectoryParentFolderContents(); RefreshDirectory(); } - else - { - SetCurrentDirectoryToRoot(); - } + } /// @@ -725,13 +715,13 @@ namespace PepperDash.Essentials.UIDrivers.VC 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 + var cc = c; // to maintian lambda scope Parent.MeetingOrContactMethodModalSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() => { Parent.PopupInterlock.Hide(); var codec = Codec as VideoCodecBase; if (codec != null) - codec.Dial(c.Number); + codec.Dial(cc.Number); }); } Parent.MeetingOrContactMethodModalSrl.Count = i; diff --git a/essentials-framework b/essentials-framework index c40f3b40..d869bc92 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit c40f3b40d57a82b9191d4f8f6dbf89a4756af4e4 +Subproject commit d869bc92ce177a79dcc3c3e3f385246fca7692d7 From 84ee743ff5199c1186398a0a7339117f73bf5468 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 6 Mar 2019 16:33:00 -0700 Subject: [PATCH 02/13] Moved Directory browsing logic from VideoCodecUiDriver down to IHasDirectory Interface to sync better with VideoCodecBaseMessenger for MC --- .../AppServer/CotijaSystemController.cs | 10 +++--- .../Room/Types/EssentialsHuddleVtc1Room.cs | 2 +- .../VC/EssentialsVideoCodecUiDriver.cs | 32 +++++++------------ essentials-framework | 2 +- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/PepperDashEssentials/AppServer/CotijaSystemController.cs b/PepperDashEssentials/AppServer/CotijaSystemController.cs index 5fd5e958..4417debf 100644 --- a/PepperDashEssentials/AppServer/CotijaSystemController.cs +++ b/PepperDashEssentials/AppServer/CotijaSystemController.cs @@ -317,10 +317,12 @@ namespace PepperDash.Essentials CrestronConsole.ConsoleCommandResponse(@"Mobile Control Information: Server address: {0} System Name: {1} - System UUID: {2} - System User code: {3} - Connected?: {4} - Seconds Since Last Ack: {5}", url, name, SystemUuid, + System URL: {2} + System UUID: {3} + System User code: {4} + Connected?: {5} + Seconds Since Last Ack: {6}" + , url, name, ConfigReader.ConfigObject.SystemUrl, SystemUuid, code, conn, secSinceLastAck.Seconds); } diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 62b11e49..2c5ca160 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -279,7 +279,7 @@ namespace PepperDash.Essentials inAudioCall = AudioCodec.IsInCall; if(VideoCodec != null) - inVideoCall = AudioCodec.IsInCall; + inVideoCall = VideoCodec.IsInCall; if (inAudioCall || inVideoCall) return true; diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 998ccbd9..17eb18b6 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -59,7 +59,7 @@ namespace PepperDash.Essentials.UIDrivers.VC SmartObjectDynamicList DirectoryList; - CodecDirectory CurrentDirectoryResult; + //CodecDirectory CurrentDirectoryResult; ///// ///// Tracks the directory browse history when browsing beyond the root directory @@ -174,7 +174,7 @@ namespace PepperDash.Essentials.UIDrivers.VC triList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents); - DirectoryBackButtonVisibleFeedback = new BoolFeedback(() => CurrentDirectoryResult != (codec as IHasDirectory).DirectoryRoot); + DirectoryBackButtonVisibleFeedback = (codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot; DirectoryBackButtonVisibleFeedback .LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackVisible]); @@ -546,12 +546,8 @@ namespace PepperDash.Essentials.UIDrivers.VC codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler(PhonebookSyncState_InitialSyncCompleted); } - - // If there is something here now, show it otherwise wait for the event - if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0) - { - RefreshDirectory(); - } + RefreshDirectory(); + } } @@ -560,12 +556,10 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void SetCurrentDirectoryToRoot() { - CurrentDirectoryResult = (Codec as IHasDirectory).DirectoryRoot; + (Codec as IHasDirectory).SetCurrentDirectoryToRoot(); SearchKeypadClear(); - DirectoryBackButtonVisibleFeedback.FireUpdate(); - RefreshDirectory(); } @@ -580,10 +574,8 @@ namespace PepperDash.Essentials.UIDrivers.VC SetCurrentDirectoryToRoot(); - if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0) - { - RefreshDirectory(); - } + RefreshDirectory(); + } /// @@ -597,8 +589,6 @@ namespace PepperDash.Essentials.UIDrivers.VC { NextDirectoryResultIsFolderContents = false; } - CurrentDirectoryResult = e.Directory; - DirectoryBackButtonVisibleFeedback.FireUpdate(); RefreshDirectory(); } @@ -622,7 +612,7 @@ namespace PepperDash.Essentials.UIDrivers.VC if (codec != null) { - CurrentDirectoryResult = codec.GetDirectoryParentFolderContents(); + codec.GetDirectoryParentFolderContents(); RefreshDirectory(); } @@ -635,10 +625,10 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void RefreshDirectory() { - if (CurrentDirectoryResult.DirectoryResults.Count > 0) + if ((Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults.Count > 0) { ushort i = 0; - foreach (var r in CurrentDirectoryResult.DirectoryResults) + foreach (var r in (Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults) { if (i == DirectoryList.MaxCount) { @@ -1092,7 +1082,7 @@ namespace PepperDash.Essentials.UIDrivers.VC SearchStringFeedback.FireUpdate(); SearchStringKeypadCheckEnables(); - if(CurrentDirectoryResult != (Codec as IHasDirectory).DirectoryRoot) + if((Codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot.BoolValue) SetCurrentDirectoryToRoot(); } diff --git a/essentials-framework b/essentials-framework index d869bc92..efa39eb6 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit d869bc92ce177a79dcc3c3e3f385246fca7692d7 +Subproject commit efa39eb6fd171fc53c163a8d348d5af47bc5ccf0 From 52ac57c080fac908d67d5c929a51838b54e37f2b Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 7 Mar 2019 15:20:24 -0700 Subject: [PATCH 03/13] fixed vc directory browsing to properly sync between MC and Essentials UIs --- .../Messengers/VideoCodecBaseMessenger.cs | 53 ++++++++++++++++--- .../VC/EssentialsVideoCodecUiDriver.cs | 18 ++----- essentials-framework | 2 +- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs index 1f3f42b6..eb56c01e 100644 --- a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs @@ -40,6 +40,7 @@ namespace PepperDash.Essentials.AppServer.Messengers if (dirCodec != null) { dirCodec.DirectoryResultReturned += new EventHandler(dirCodec_DirectoryResultReturned); + } var recCodec = codec as IHasCallHistory; @@ -74,12 +75,30 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e) { - PostStatusMessage(new - { - currentDirectory = e.Directory - }); + SendDirectory((Codec as IHasDirectory).CurrentDirectoryResult, e.DirectoryIsOnRoot); } + /// + /// Posts the current directory + /// + void SendDirectory(CodecDirectory directory, bool isRoot) + { + var dirCodec = Codec as IHasDirectory; + + if (dirCodec != null) + { + var directoryMessage = new + { + currentDirectory = new + { + directoryResults = directory.CurrentDirectoryResults, + isRootDirectory = isRoot + } + }; + PostStatusMessage(directoryMessage); + } + } + /// /// /// @@ -130,6 +149,7 @@ namespace PepperDash.Essentials.AppServer.Messengers appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot)); appServerController.AddAction(MessagePath + "/directoryById", new Action(s => GetDirectory(s))); appServerController.AddAction(MessagePath + "/directorySearch", new Action(s => DirectorySearch(s))); + appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory)); } // History actions @@ -228,12 +248,28 @@ namespace PepperDash.Essentials.AppServer.Messengers return; } - PostStatusMessage(new - { - currentDirectory = dirCodec.DirectoryRoot - }); + dirCodec.SetCurrentDirectoryToRoot(); + + //PostStatusMessage(new + //{ + // currentDirectory = dirCodec.DirectoryRoot + //}); } + /// + /// Requests the parent folder contents + /// + void GetPreviousDirectory() + { + var dirCodec = Codec as IHasDirectory; + if (dirCodec == null) + { + return; + } + + dirCodec.GetDirectoryParentFolderContents(); + } + /// /// Handler for codec changes /// @@ -284,6 +320,7 @@ namespace PepperDash.Essentials.AppServer.Messengers }, showSelfViewByDefault = Codec.ShowSelfViewByDefault, hasDirectory = Codec is IHasDirectory, + hasDirectorySearch = true, hasRecents = Codec is IHasCallHistory, hasCameras = Codec is IHasCameraControl }); diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 17eb18b6..c9a2ae12 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -58,16 +58,7 @@ namespace PepperDash.Essentials.UIDrivers.VC SmartObjectDynamicList RecentCallsList; SmartObjectDynamicList DirectoryList; - - //CodecDirectory CurrentDirectoryResult; - - ///// - ///// Tracks the directory browse history when browsing beyond the root directory - ///// - //List DirectoryBrowseHistory; - bool NextDirectoryResultIsFolderContents; - BoolFeedback DirectoryBackButtonVisibleFeedback; // These are likely temp until we get a keyboard built @@ -558,6 +549,7 @@ namespace PepperDash.Essentials.UIDrivers.VC { (Codec as IHasDirectory).SetCurrentDirectoryToRoot(); +#warning Deal with this recursive issue SearchKeypadClear(); RefreshDirectory(); @@ -585,10 +577,7 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e) { - if (NextDirectoryResultIsFolderContents) - { - NextDirectoryResultIsFolderContents = false; - } + RefreshDirectory(); } @@ -600,7 +589,6 @@ namespace PepperDash.Essentials.UIDrivers.VC { (Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId); - NextDirectoryResultIsFolderContents = true; } /// @@ -614,7 +602,7 @@ namespace PepperDash.Essentials.UIDrivers.VC { codec.GetDirectoryParentFolderContents(); - RefreshDirectory(); + //RefreshDirectory(); } } diff --git a/essentials-framework b/essentials-framework index efa39eb6..3e7dbeb1 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit efa39eb6fd171fc53c163a8d348d5af47bc5ccf0 +Subproject commit 3e7dbeb111513cfed55db5012375bec1de7239a1 From 3a99c3bb304e1f9f4830ae7c84fd9594f3fd8c85 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 7 Mar 2019 16:31:56 -0700 Subject: [PATCH 04/13] Adds PrefixDictionaryFolderItems method to add "[+] " prefix to folder names for MC. --- .../Messengers/VideoCodecBaseMessenger.cs | 45 ++++++++++++++++++- .../VC/EssentialsVideoCodecUiDriver.cs | 1 - essentials-framework | 2 +- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs index eb56c01e..b8ca2dac 100644 --- a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs @@ -87,11 +87,13 @@ namespace PepperDash.Essentials.AppServer.Messengers if (dirCodec != null) { + var prefixedDirectoryResults = PrefixDirectoryFolderItems(directory); + var directoryMessage = new { currentDirectory = new { - directoryResults = directory.CurrentDirectoryResults, + directoryResults = prefixedDirectoryResults, isRootDirectory = isRoot } }; @@ -99,6 +101,47 @@ namespace PepperDash.Essentials.AppServer.Messengers } } + /// + /// Iterates a directory object and prefixes any folder items with "[+] " + /// + /// + /// + List PrefixDirectoryFolderItems (CodecDirectory directory) + { + var tempDirectoryList = new List(); + + if (directory.CurrentDirectoryResults.Count > 0) + { + foreach (var item in directory.CurrentDirectoryResults) + { + if (item is DirectoryFolder) + { + var newFolder = new DirectoryFolder(); + + newFolder = (DirectoryFolder)item.Clone(); + + string prefixName = "[+] " + newFolder.Name; + + newFolder.Name = prefixName; + + tempDirectoryList.Add(newFolder); + } + else + { + tempDirectoryList.Add(item); + } + } + } + //else + //{ + // DirectoryItem noResults = new DirectoryItem() { Name = "No Results Found" }; + + // tempDirectoryList.Add(noResults); + //} + + return tempDirectoryList; + } + /// /// /// diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index c9a2ae12..15f90ff4 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -549,7 +549,6 @@ namespace PepperDash.Essentials.UIDrivers.VC { (Codec as IHasDirectory).SetCurrentDirectoryToRoot(); -#warning Deal with this recursive issue SearchKeypadClear(); RefreshDirectory(); diff --git a/essentials-framework b/essentials-framework index 3e7dbeb1..713be9a7 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 3e7dbeb111513cfed55db5012375bec1de7239a1 +Subproject commit 713be9a794efcb48043ed784b214f11cf21e145c From 2121456d50d2883e33e718d69e40f81b34bb2e60 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 8 Mar 2019 16:56:37 -0700 Subject: [PATCH 05/13] Adds fake directory to MockVC with full features --- ...ssentialsHuddleVtc1PanelAvFunctionsDriver.cs | 5 ++++- .../VC/EssentialsVideoCodecUiDriver.cs | 17 ++++++++++++----- essentials-framework | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 4b1f2188..be51a4aa 100644 --- a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -927,7 +927,10 @@ namespace PepperDash.Essentials _CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange; RefreshSourceInfo(); - (_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged; + if (_CurrentRoom.VideoCodec is IHasScheduleAwareness) + { + (_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged; + } CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue); _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange; diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 15f90ff4..b035523e 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -1065,12 +1065,19 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void SearchKeypadClear() { - SearchStringBuilder.Remove(0, SearchStringBuilder.Length); - SearchStringFeedback.FireUpdate(); - SearchStringKeypadCheckEnables(); + try + { + SearchStringBuilder.Remove(0, SearchStringBuilder.Length); + SearchStringFeedback.FireUpdate(); + SearchStringKeypadCheckEnables(); - if((Codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot.BoolValue) - SetCurrentDirectoryToRoot(); + if ((Codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot.BoolValue) + SetCurrentDirectoryToRoot(); + } + catch (Exception e) + { + Debug.Console(1, "SearchKeypadClear() blew up!: {0}", e); + } } /// diff --git a/essentials-framework b/essentials-framework index 713be9a7..1a61f2b4 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 713be9a794efcb48043ed784b214f11cf21e145c +Subproject commit 1a61f2b4886bab143b71ce97cf29fe0e8ec0647e From 038e23289eeb1d37275de3863687ea42b2df31fb Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 12 Mar 2019 11:08:32 -0600 Subject: [PATCH 06/13] Adds inital ConfigMessenger --- .../AppServer/Messengers/ConfigMessenger.cs | 12 ++++++++++++ essentials-framework | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs diff --git a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs new file mode 100644 index 00000000..e4fd18fe --- /dev/null +++ b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.AppServer.Messengers +{ + public class ConfigMessenger + { + } +} \ No newline at end of file diff --git a/essentials-framework b/essentials-framework index 1a61f2b4..ea76dcbe 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 1a61f2b4886bab143b71ce97cf29fe0e8ec0647e +Subproject commit ea76dcbe5b8eb08f53e3047ba0516915140c7db1 From 43fd263ea1d6f865e7aaec928eaf6f5c63403487 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 13 Mar 2019 16:33:51 -0600 Subject: [PATCH 07/13] Config Update Working --- .../AppServer/CotijaSystemController.cs | 13 ++++- .../AppServer/Messengers/ConfigMessenger.cs | 47 ++++++++++++++++++- .../CotijaEssentialsHuddleSpaceRoomBridge.cs | 1 + .../PepperDashEssentials.csproj | 1 + .../VC/EssentialsVideoCodecUiDriver.cs | 20 +++----- 5 files changed, 66 insertions(+), 16 deletions(-) diff --git a/PepperDashEssentials/AppServer/CotijaSystemController.cs b/PepperDashEssentials/AppServer/CotijaSystemController.cs index 4417debf..44b007ef 100644 --- a/PepperDashEssentials/AppServer/CotijaSystemController.cs +++ b/PepperDashEssentials/AppServer/CotijaSystemController.cs @@ -17,6 +17,7 @@ using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Room.Cotija; +using PepperDash.Essentials.AppServer.Messengers; namespace PepperDash.Essentials { @@ -39,6 +40,8 @@ namespace PepperDash.Essentials Dictionary PushedActions = new Dictionary(); + public ConfigMessenger ConfigMessenger { get; private set; } + CTimer ServerHeartbeatCheckTimer; long ServerHeartbeatInterval = 20000; @@ -49,7 +52,7 @@ namespace PepperDash.Essentials DateTime LastAckMessage; - string SystemUuid; + public string SystemUuid; List RoomBridges = new List(); @@ -97,9 +100,15 @@ namespace PepperDash.Essentials CrestronConsole.AddNewConsoleCommand(s => CleanUpWebsocketClient(), "mobiledisco", "Disconnects websocket", ConsoleAccessLevelEnum.AccessOperator); + CrestronConsole.AddNewConsoleCommand(s => ParseStreamRx(s), "mobilesimulateaction", "Simulates a message from the server", ConsoleAccessLevelEnum.AccessOperator); + CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler); CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(CrestronEnvironment_EthernetEventHandler); - + + // Config Messenger + var cmKey = Key + "-config"; + ConfigMessenger = new ConfigMessenger(cmKey, "/config"); + ConfigMessenger.RegisterWithAppServer(this); } /// diff --git a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs index e4fd18fe..549bf17b 100644 --- a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs @@ -4,9 +4,54 @@ using System.Linq; using System.Text; using Crestron.SimplSharp; +using PepperDash.Core; +using PepperDash.Essentials.Core.Config; + namespace PepperDash.Essentials.AppServer.Messengers { - public class ConfigMessenger + + /// + /// Handles interactions with the app server to update the config + /// + public class ConfigMessenger : MessengerBase { + public ConfigMessenger(string key, string messagePath) + : base(key, messagePath) + { + ConfigUpdater.ConfigStatusChanged -= ConfigUpdater_ConfigStatusChanged; + ConfigUpdater.ConfigStatusChanged += new EventHandler(ConfigUpdater_ConfigStatusChanged); + } + + void ConfigUpdater_ConfigStatusChanged(object sender, ConfigStatusEventArgs e) + { + PostUpdateStatus(e.UpdateStatus.ToString()); + } + + protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController) + { + appServerController.AddAction(MessagePath + "/updateConfig", new Action(s => GetConfigFile(s))); + } + + void GetConfigFile(string url) + { + url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid); + + ConfigUpdater.GetConfigFromServer(url); + } + + /// + /// Posts a message with the current status of the config update + /// + /// + void PostUpdateStatus(string status) + { + PostStatusMessage(new + { + updateStatus = status + }); + } + } + + } \ No newline at end of file diff --git a/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs index 976cb484..eef8e167 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs @@ -25,6 +25,7 @@ namespace PepperDash.Essentials public AudioCodecBaseMessenger ACMessenger { get; private set; } + /// /// /// diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj index 10fad395..a4072766 100644 --- a/PepperDashEssentials/PepperDashEssentials.csproj +++ b/PepperDashEssentials/PepperDashEssentials.csproj @@ -108,6 +108,7 @@ + diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index b035523e..704a42d3 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -102,7 +102,6 @@ namespace PepperDash.Essentials.UIDrivers.VC SetupCallStagingPopover(); SetupDialKeypad(); ActiveCallsSRL = new SubpageReferenceList(triList, UISmartObjectJoin.CodecActiveCallsHeaderList, 5,5,5); - SetupDirectoryList(); SetupRecentCallsList(); SetupFavorites(); SetupLayoutControls(); @@ -160,6 +159,8 @@ namespace PepperDash.Essentials.UIDrivers.VC }); SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]); + SetupDirectoryList(); + SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0); SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]); @@ -1065,19 +1066,12 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void SearchKeypadClear() { - try - { - SearchStringBuilder.Remove(0, SearchStringBuilder.Length); - SearchStringFeedback.FireUpdate(); - SearchStringKeypadCheckEnables(); + SearchStringBuilder.Remove(0, SearchStringBuilder.Length); + SearchStringFeedback.FireUpdate(); + SearchStringKeypadCheckEnables(); - if ((Codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot.BoolValue) - SetCurrentDirectoryToRoot(); - } - catch (Exception e) - { - Debug.Console(1, "SearchKeypadClear() blew up!: {0}", e); - } + if ((Codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot.BoolValue) + SetCurrentDirectoryToRoot(); } /// From 90bbd65fdc73d967702679a694b8d6c06e7404f3 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 14 Mar 2019 10:41:07 -0600 Subject: [PATCH 08/13] Add lastest essentials framework --- essentials-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework b/essentials-framework index ea76dcbe..e1f26dc6 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit ea76dcbe5b8eb08f53e3047ba0516915140c7db1 +Subproject commit e1f26dc6e005cf4cd2e2401564dfb61b504f6b72 From 6235b44d8927cd6229ba380d22e5229298efcfa8 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 15 Mar 2019 12:16:01 -0600 Subject: [PATCH 09/13] Updates to delete any existing archived configs during update process to prevent name conflicts --- .../AppServer/Messengers/ConfigMessenger.cs | 12 +++++++++++- .../AppServer/Messengers/SystemMonitorMessenger.cs | 7 +++++-- essentials-framework | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs index 549bf17b..a54a9b9f 100644 --- a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs @@ -34,7 +34,17 @@ namespace PepperDash.Essentials.AppServer.Messengers void GetConfigFile(string url) { - url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid); + try + { + var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url); + + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url); + } + catch + { + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data"); + url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid); + } ConfigUpdater.GetConfigFromServer(url); } diff --git a/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs b/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs index 7b56ab29..12107ff5 100644 --- a/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs @@ -40,8 +40,11 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void ProgramInfoChanged(object sender, ProgramInfoEventArgs e) { - Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString()); - PostStatusMessage(e.ProgramInfo); + if (e.ProgramInfo != null) + { + //Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString()); + PostStatusMessage(e.ProgramInfo); + } } /// diff --git a/essentials-framework b/essentials-framework index e1f26dc6..1393abd8 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit e1f26dc6e005cf4cd2e2401564dfb61b504f6b72 +Subproject commit 1393abd812273e57b2802837331c23be5ccaf5a8 From e3a3a2cd2deaae48fbfc3ae21e47235c11bf489a Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 15 Mar 2019 14:42:47 -0600 Subject: [PATCH 10/13] Attempting to resolve exception in CotijaSystemController when SystemMonitor tries to notify AppServer of program start before WSClient is *really* connected. --- .../AppServer/CotijaSystemController.cs | 3 ++- .../AppServer/Messengers/ConfigMessenger.cs | 10 +++++++++- essentials-framework | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/PepperDashEssentials/AppServer/CotijaSystemController.cs b/PepperDashEssentials/AppServer/CotijaSystemController.cs index 44b007ef..92704711 100644 --- a/PepperDashEssentials/AppServer/CotijaSystemController.cs +++ b/PepperDashEssentials/AppServer/CotijaSystemController.cs @@ -458,10 +458,11 @@ namespace PepperDash.Essentials var result = WSClient.Send(messageBytes, (uint)messageBytes.Length, WebSocketClient.WEBSOCKET_PACKET_TYPES.LWS_WS_OPCODE_07__TEXT_FRAME); if (result != WebSocketClient.WEBSOCKET_RESULT_CODES.WEBSOCKET_CLIENT_SUCCESS) { +#warning It seems like this debug statement is throwing an exception when called Debug.Console(1, this, "Socket send result error: {0}", result); } } - else if (!WSClient.Connected) + else if (WSClient == null) { Debug.Console(1, this, "Cannot send. Not connected {0}"); } diff --git a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs index a54a9b9f..1e3cfa12 100644 --- a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs @@ -32,16 +32,24 @@ namespace PepperDash.Essentials.AppServer.Messengers appServerController.AddAction(MessagePath + "/updateConfig", new Action(s => GetConfigFile(s))); } + /// + /// Generates or passes the URL to make the request to GET the config from a server + /// + /// void GetConfigFile(string url) { try { + // Attempt to parse the URL var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url); } - catch + catch (Exception e) { + // If unable to parse the URL, generate it from config data + Debug.Console(2, "Error parsing URL: {0}", e); + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data"); url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid); } diff --git a/essentials-framework b/essentials-framework index 1393abd8..07171276 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 1393abd812273e57b2802837331c23be5ccaf5a8 +Subproject commit 071712762dba2d25c6ef186cc8b7237ea4aa774d From 3adee8bc304fe28947ce8b471c99dce9c0a1eb6e Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 18 Mar 2019 11:25:46 -0600 Subject: [PATCH 11/13] Resolves ecs-1042 --- PepperDashEssentials/AppServer/CotijaSystemController.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PepperDashEssentials/AppServer/CotijaSystemController.cs b/PepperDashEssentials/AppServer/CotijaSystemController.cs index 92704711..75592e38 100644 --- a/PepperDashEssentials/AppServer/CotijaSystemController.cs +++ b/PepperDashEssentials/AppServer/CotijaSystemController.cs @@ -458,13 +458,12 @@ namespace PepperDash.Essentials var result = WSClient.Send(messageBytes, (uint)messageBytes.Length, WebSocketClient.WEBSOCKET_PACKET_TYPES.LWS_WS_OPCODE_07__TEXT_FRAME); if (result != WebSocketClient.WEBSOCKET_RESULT_CODES.WEBSOCKET_CLIENT_SUCCESS) { -#warning It seems like this debug statement is throwing an exception when called Debug.Console(1, this, "Socket send result error: {0}", result); } } else if (WSClient == null) { - Debug.Console(1, this, "Cannot send. Not connected {0}"); + Debug.Console(1, this, "Cannot send. Not connected."); } } From 2655b8f7b805dc7585ad5fc8ddd6e422629ae08d Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 2 Apr 2019 15:58:12 -0600 Subject: [PATCH 12/13] Resolves issue with HuddleVtc1Room adding Emergency device in CustomActivate() which would throw an exception in DeviceManager.ActivateAll() when attempting to iterate the modified devices dictionary --- PepperDashEssentials/ControlSystem.cs | 4 ++-- .../Room/Config/EssentialsRoomConfig.cs | 2 +- .../Room/Types/EssentialsHuddleVtc1Room.cs | 16 ++++++++++------ essentials-framework | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 8463390a..4b75f046 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -71,7 +71,7 @@ namespace PepperDash.Essentials } /// - /// Determines if the program is running on a processor (appliance) or server (XiO Edge). + /// Determines if the program is running on a processor (appliance) or server (VC-4). /// /// Sets Global.FilePathPrefix based on platform /// @@ -176,7 +176,7 @@ namespace PepperDash.Essentials } - // Notify the + // Notify the OS that the program intitialization has completed SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true; } diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index 4ceb481d..7b7718eb 100644 --- a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Room.Config var microphonePrivacy = props.MicrophonePrivacy; if (microphonePrivacy == null) { - Debug.Console(0, "ERROR: Cannot create microphone privacy with null properties"); + Debug.Console(0, "Cannot create microphone privacy with null properties"); return null; } // Get the MicrophonePrivacy device from the device manager diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 2c5ca160..d83c8e9a 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -266,6 +266,16 @@ namespace PepperDash.Essentials { IsCoolingDownFeedback.FireUpdate(); }; + + // Get Microphone Privacy object, if any + this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this); + + Debug.Console(2, this, "Microphone Privacy Config evaluated."); + + // Get emergency object, if any + this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this); + + Debug.Console(2, this, "Emergency Config evaluated."); } @@ -327,12 +337,6 @@ namespace PepperDash.Essentials this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem; this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100); - // Get Microphone Privacy object, if any - this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this); - - // Get emergency object, if any - this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this); - return base.CustomActivate(); } diff --git a/essentials-framework b/essentials-framework index 07171276..f5cda527 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 071712762dba2d25c6ef186cc8b7237ea4aa774d +Subproject commit f5cda5276ef161625157983332aed48140ec2ac9 From 71a27027e7bc10217e81625513616e9efd7cf6b5 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 2 Apr 2019 16:04:46 -0600 Subject: [PATCH 13/13] Updates framework commit to development branch --- essentials-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework b/essentials-framework index f5cda527..d2326163 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit f5cda5276ef161625157983332aed48140ec2ac9 +Subproject commit d23261633943f87c4f8c7568f285f5de2a839667