From 3897a41dd1c9551553c3ce8d9bd6dd75b5757a49 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Sun, 22 Oct 2017 12:39:57 -0600 Subject: [PATCH] Fixed Stop Sharing button visible feedback on call list --- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 19 +- .../CiscoCodec/PhonebookDataClasses.cs | 166 ++++++++++-------- .../VideoCodec/CiscoCodec/xStatus.cs | 21 +++ .../VideoCodec/MockVC/MockVC.cs | 2 +- .../PepperDashEssentials/ControlSystem.cs | 6 +- .../UI/JoinConstants/UIBoolJoin.cs | 6 +- ...entialsHuddleVtc1PanelAvFunctionsDriver.cs | 3 + .../VC/EssentialsVideoCodecUiDriver.cs | 24 +-- 8 files changed, 152 insertions(+), 95 deletions(-) diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index 3fc6185f..2eb023df 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -82,7 +82,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco private CiscoCodecConfiguration.RootObject CodecConfiguration; - private CiscoCodecStatus.RootObject CodecStatus; + private CiscoCodecStatus.RootObject CodecStatus = new CiscoCodecStatus.RootObject(); public CodecCallHistory CallHistory { get; private set; } @@ -133,7 +133,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco protected override Func SharingContentIsOnFeedbackFunc { get - { + { return () => CodecStatus.Status.Conference.Presentation.Mode.BoolValue; } } @@ -272,12 +272,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco PortGather.IncludeDelimiter = true; PortGather.LineReceived += this.Port_LineReceived; - //CodecObtp = new CiscoOneButtonToPush(); - - //PhoneBook = new Corporate_Phone_Book(); - CodecConfiguration = new CiscoCodecConfiguration.RootObject(); - CodecStatus = new CiscoCodecStatus.RootObject(); + //CodecStatus = new CiscoCodecStatus.RootObject(); CodecInfo = new CiscoCodecInfo(CodecStatus, CodecConfiguration); @@ -304,6 +300,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate; CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus; CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout; + CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = SharingContentIsOnFeedback.FireUpdate; CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(StopSharing), this); @@ -998,6 +995,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco SelectPresentationSource(2); } + /// + /// Starts presentation sharing + /// public override void StartSharing() { string sendingMode = string.Empty; @@ -1010,9 +1010,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco SendText(string.Format("xCommand Presentation Start PresentationSource: {0} SendingMode: {1}", PresentationSource, sendingMode)); } + /// + /// Stops sharing the current presentation + /// public override void StopSharing() { - SendText(string.Format("xCommand Presentation Stop PresentationSource: {0}", PresentationSource)); + SendText("xCommand Presentation Stop"); } public override void PrivacyModeOn() diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/PhonebookDataClasses.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/PhonebookDataClasses.cs index d7b4f152..0bd000bd 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/PhonebookDataClasses.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/PhonebookDataClasses.cs @@ -109,6 +109,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public Number Number { get; set; } public Device Device { get; set; } public CallType CallType { get; set; } + + public ContactMethod() + { + ContactMethodId = new ContactMethodId(); + Number = new Number(); + Device = new Device(); + CallType = new CallType(); + } } public class Contact @@ -119,6 +127,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public FolderId2 FolderId { get; set; } public Title Title { get; set; } public List ContactMethod { get; set; } + + public Contact() + { + Name = new Name2(); + ContactId = new ContactId(); + FolderId = new FolderId2(); + Title = new Title(); + ContactMethod = new List(); + } } public class PhonebookSearchResult @@ -209,12 +226,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec { var contact = new DirectoryContact(); - if (c.FolderId == null) + if (string.IsNullOrEmpty(c.FolderId.Value)) { contact.Name = c.Name.Value; contact.ContactId = c.ContactId.Value; - if(c.Title != null) + if(!string.IsNullOrEmpty(c.Title.Value)) contact.Title = c.Title.Value; if (Debug.Level > 0) @@ -225,10 +242,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec var tempContactMethod = new PepperDash.Essentials.Devices.Common.Codec.ContactMethod(); - if (m.CallType != null) + eContactMethodCallType callType = eContactMethodCallType.Unknown; + if (!string.IsNullOrEmpty(m.CallType.Value)) { - eContactMethodCallType callType = eContactMethodCallType.Unknown; - if (m.CallType != null) + if (!string.IsNullOrEmpty(m.CallType.Value)) { if (m.CallType.Value.ToLower() == "audio") callType = eContactMethodCallType.Audio; @@ -239,9 +256,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } } - if (m.Device != null) + eContactMethodDevice device = eContactMethodDevice.Unknown; + if (!string.IsNullOrEmpty(m.Device.Value)) { - eContactMethodDevice device = eContactMethodDevice.Unknown; if (m.Device.Value.ToLower() == "mobile") device = eContactMethodDevice.Mobile; @@ -288,81 +305,90 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec var contacts = new List(); - if (result.Folder.Count > 0) + try { - foreach (Folder f in result.Folder) + if (result.Folder.Count > 0) { - var folder = new DirectoryFolder(); - - folder.Name = f.Name.Value; - folder.FolderId = f.FolderId.Value; - - if (f.ParentFolderId != null) + foreach (Folder f in result.Folder) { - // - folder.ParentFolderId = f.ParentFolderId.Value; - } + var folder = new DirectoryFolder(); - folders.Add(folder); - } + folder.Name = f.Name.Value; + folder.FolderId = f.FolderId.Value; - folders.OrderBy(f => f.Name); - - directory.AddFoldersToDirectory(folders); - } - - if (result.Contact.Count > 0) - { - foreach (Contact c in result.Contact) - { - var contact = new DirectoryContact(); - - contact.Name = c.Name.Value; - contact.ContactId = c.ContactId.Value; - if (c.Title != null) - contact.Title = c.Title.Value; - - if(c.FolderId != null) - { - contact.FolderId = c.FolderId.Value; - } - - foreach (ContactMethod m in c.ContactMethod) - { - eContactMethodCallType callType = eContactMethodCallType.Unknown; - if(m.CallType != null) + if (f.ParentFolderId != null) { - if(m.CallType.Value.ToLower() == "audio") - callType = eContactMethodCallType.Audio; - else if (m.CallType.Value.ToLower() == "video") - callType = eContactMethodCallType.Video; + folder.ParentFolderId = f.ParentFolderId.Value; } - - eContactMethodDevice device = eContactMethodDevice.Unknown; - if (m.Device.Value.ToLower() == "mobile") - device = eContactMethodDevice.Mobile; - else if (m.Device.Value.ToLower() == "telephone") - device = eContactMethodDevice.Telephone; - else if (m.Device.Value.ToLower() == "video") - device = eContactMethodDevice.Video; - else if (m.Device.Value.ToLower() == "other") - device = eContactMethodDevice.Other; - - contact.ContactMethods.Add(new PepperDash.Essentials.Devices.Common.Codec.ContactMethod() - { - Number = m.Number.Value, - ContactMethodId = m.ContactMethodId.Value, - CallType = callType, - Device = device - }); + folders.Add(folder); } - contacts.Add(contact); + + folders.OrderBy(f => f.Name); + + directory.AddFoldersToDirectory(folders); } - contacts.OrderBy(c => c.Name); + if (result.Contact.Count > 0) + { + foreach (Contact c in result.Contact) + { + var contact = new DirectoryContact(); - directory.AddContactsToDirectory(contacts); + contact.Name = c.Name.Value; + contact.ContactId = c.ContactId.Value; + if (!string.IsNullOrEmpty(c.Title.Value)) + contact.Title = c.Title.Value; + + if (c.FolderId != null) + { + contact.FolderId = c.FolderId.Value; + } + + foreach (ContactMethod m in c.ContactMethod) + { + eContactMethodCallType callType = eContactMethodCallType.Unknown; + if (!string.IsNullOrEmpty(m.CallType.Value)) + { + if (m.CallType.Value.ToLower() == "audio") + callType = eContactMethodCallType.Audio; + else if (m.CallType.Value.ToLower() == "video") + callType = eContactMethodCallType.Video; + } + + eContactMethodDevice device = eContactMethodDevice.Unknown; + + if (!string.IsNullOrEmpty(m.Device.Value)) + { + if (m.Device.Value.ToLower() == "mobile") + device = eContactMethodDevice.Mobile; + else if (m.Device.Value.ToLower() == "telephone") + device = eContactMethodDevice.Telephone; + else if (m.Device.Value.ToLower() == "video") + device = eContactMethodDevice.Video; + else if (m.Device.Value.ToLower() == "other") + device = eContactMethodDevice.Other; + } + + contact.ContactMethods.Add(new PepperDash.Essentials.Devices.Common.Codec.ContactMethod() + { + Number = m.Number.Value, + ContactMethodId = m.ContactMethodId.Value, + CallType = callType, + Device = device + }); + } + contacts.Add(contact); + } + + contacts.OrderBy(c => c.Name); + + directory.AddContactsToDirectory(contacts); + } + } + catch (Exception e) + { + Debug.Console(1, "Error converting Cisco Phonebook results to generic: {0}", e); } return directory; diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs index 69ecae86..46b1dcfb 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs @@ -5,6 +5,8 @@ using System.Text; using Crestron.SimplSharp; using Crestron.SimplSharp.CrestronXml.Serialization; +using PepperDash.Core; + namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { /// @@ -395,15 +397,34 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco public RequestFloorAvailability RequestFloorAvailability { get; set; } } + public class Source2 + { + public string Value { get; set; } + } + + public class SendingMode + { + public string Value { get; set; } + } + + public class LocalInstance + { + public string id { get; set; } + public SendingMode SendingMode {get; set;} + public Source2 Source { get; set; } + } + public class Presentation { public CallId2 CallId { get; set; } public Mode2 Mode { get; set; } public Whiteboard Whiteboard { get; set; } + public List LocalInstance { get; set; } public Presentation() { Mode = new Mode2(); + LocalInstance = new List(); } } diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs index d41a0d6b..803b64a8 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs @@ -187,6 +187,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public override void StartSharing() { _SharingIsOn = true; + SharingContentIsOnFeedback.FireUpdate(); } /// @@ -201,7 +202,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public override void StandbyActivate() { _StandbyIsOn = true; - SharingContentIsOnFeedback.FireUpdate(); } public override void StandbyDeactivate() diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 6aa94ab2..6c74b9bc 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -30,8 +30,8 @@ namespace PepperDash.Essentials /// public override void InitializeSystem() { - CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file", - ConsoleAccessLevelEnum.AccessOperator); + //CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file", + // ConsoleAccessLevelEnum.AccessOperator); //CrestronConsole.AddNewConsoleCommand(s => TearDown(), "ungo", "Unloads configuration file", // ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(s => @@ -41,7 +41,7 @@ namespace PepperDash.Essentials }, "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator); - //GoWithLoad(); + GoWithLoad(); } /// diff --git a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs index 977095a5..8dc56709 100644 --- a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs +++ b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs @@ -44,7 +44,7 @@ namespace PepperDash.Essentials /// /// 1005 /// - public const uint CallSharedSourceInfoEnable = 1005; + public const uint CallSharedSourceInfoVisible = 1005; /// /// 1006 /// @@ -487,6 +487,10 @@ namespace PepperDash.Essentials /// public const uint HeaderCallStatusRightPositionVisible = 15025; /// + /// 15027 + /// + public const uint HeaderCallStatusLabelPress = 15027; + /// /// 15028 The gear button in header /// public const uint FIXFIX_HeaderGearButtonPress_FIXFIX = 15028; diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 56a64fed..2926110b 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -1076,6 +1076,9 @@ namespace PepperDash.Essentials TriList.SetSigFalseAction(i, () => { }); } + + TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, ShowActiveCallsList); + // Set Call Status Subpage Position if (nextJoin == 3951) diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 2f8e987a..5bba7331 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -112,8 +112,6 @@ namespace PepperDash.Essentials.UIDrivers.VC codec.CallStatusChange += new EventHandler(Codec_CallStatusChange); - codec.SharingSourceFeedback.OutputChange += new EventHandler(SharingSourceFeedback_OutputChange); - // If the codec is ready, then get the values we want, otherwise wait if (Codec.IsReady) Codec_IsReady(); @@ -182,8 +180,9 @@ namespace PepperDash.Essentials.UIDrivers.VC TriList.SetSigHeldAction(UIBoolJoin.VCDirectoryBackspacePress, 500, StartSearchBackspaceRepeat, StopSearchBackspaceRepeat, SearchKeypadBackspacePress); - CallSharingInfoVisibleFeedback = new BoolFeedback(() => !string.IsNullOrEmpty(Codec.SharingSourceFeedback.StringValue)); - CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoEnable]); + CallSharingInfoVisibleFeedback = new BoolFeedback(() => Codec.SharingContentIsOnFeedback.BoolValue); + codec.SharingContentIsOnFeedback.OutputChange += new EventHandler(SharingContentIsOnFeedback_OutputChange); + CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoVisible]); CallSharingInfoTextFeedback = new StringFeedback(() => GetCurrentSourceName(Codec.SharingSourceFeedback.StringValue)); CallSharingInfoTextFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CallSharedSourceNameText]); @@ -198,9 +197,14 @@ namespace PepperDash.Essentials.UIDrivers.VC /// string GetCurrentSourceName(string key) { + Debug.Console(1, "GetCurrentSource: Attempting to get device with key: {0}", key); + var device = DeviceManager.GetDeviceForKey(key); - return (device as SourceListItem).Name; + if (device != null) + return (device as SourceListItem).Name; + else + return "None"; } /// @@ -208,14 +212,10 @@ namespace PepperDash.Essentials.UIDrivers.VC /// /// /// - void SharingSourceFeedback_OutputChange(object sender, EventArgs e) + void SharingContentIsOnFeedback_OutputChange(object sender, EventArgs e) { - if (!string.IsNullOrEmpty((sender as IHasContentSharing).SharingSourceFeedback.StringValue)) - { - // Source is being shared - - - } + CallSharingInfoVisibleFeedback.FireUpdate(); + CallSharingInfoTextFeedback.FireUpdate(); } ///