diff --git a/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs b/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs index 65499990..2f8794f0 100644 --- a/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs +++ b/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs @@ -68,7 +68,7 @@ namespace PepperDash.Essentials.Core // Count the enable lines to see what max items is MaxDefinedItems = (ushort)SRL.BooleanInput .Where(s => s.Name.Contains("Enable")).Count(); - Debug.Console(0, "SRL {0} contains max {1} items", SRL.ID, MaxDefinedItems); + Debug.Console(2, "SRL {0} contains max {1} items", SRL.ID, MaxDefinedItems); SRL.SigChange -= new SmartObjectSigChangeEventHandler(SRL_SigChange); SRL.SigChange += new SmartObjectSigChangeEventHandler(SRL_SigChange); 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 a23fe2a3..95c9c6af 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -33,6 +33,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco public StatusMonitorBase CommunicationMonitor { get; private set; } + public BoolFeedback PresentationViewMaximizedFeedback { get; private set; } + + string CurrentPresentationView; + public BoolFeedback RoomIsOccupiedFeedback { get; private set; } public IntFeedback PeopleCountFeedback { get; private set; } @@ -68,7 +72,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco /// public List LocalLayouts = new List() { - new CodecCommandWithLabel("auto", "Auto"), + //new CodecCommandWithLabel("auto", "Auto"), //new CiscoCodecLocalLayout("custom", "Custom"), // Left out for now new CodecCommandWithLabel("equal","Equal"), new CodecCommandWithLabel("overlay","Overlay"), @@ -242,6 +246,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc); LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc); + PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized"); + Communication = comm; if (props.CommunicationMonitorProperties != null) @@ -1230,6 +1236,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco } } + /// + /// + /// + public void MinMaxLayoutToggle() + { + if (PresentationViewMaximizedFeedback.BoolValue) + CurrentPresentationView = "Minimized"; + else + CurrentPresentationView = "Maximized"; + + SendText(string.Format("xCommand Video PresentationView Set View: {0}", CurrentPresentationView)); + PresentationViewMaximizedFeedback.FireUpdate(); + } + /// /// Calculates the current selfview PIP position /// diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasCodecLayouts.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasCodecLayouts.cs index 6246283a..613c2cbc 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasCodecLayouts.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasCodecLayouts.cs @@ -16,5 +16,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec StringFeedback LocalLayoutFeedback { get; } void LocalLayoutToggle(); + void MinMaxLayoutToggle(); } } \ No newline at end of file diff --git a/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs b/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs index 5134564c..fa43e857 100644 --- a/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs +++ b/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ [assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: AssemblyProduct("PepperDashEssentials")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")] -[assembly: AssemblyVersion("1.0.6.*")] +[assembly: AssemblyVersion("1.0.7.*")] diff --git a/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs b/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs index ccf34889..857c8e7c 100644 --- a/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs +++ b/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs @@ -22,7 +22,7 @@ namespace PepperDash.Essentials CotijaConfig Config; - //HttpClient Client; + HttpClient Client; Dictionary ActionDictionary = new Dictionary(StringComparer.InvariantCultureIgnoreCase); @@ -139,7 +139,7 @@ namespace PepperDash.Essentials /// URL of the server, including the port number, if not 80. Format: "serverUrlOrIp:port" void RegisterSystemToServer() { - try + try { string filePath = string.Format(@"\NVRAM\Program{0}\configurationFile.json", Global.ControlSystem.ProgramNumber); string postBody = null; @@ -169,9 +169,10 @@ namespace PepperDash.Essentials } else { - var client = new HttpClient(); - client.Verbose = true; - client.KeepAlive = true; + //if(Client == null) + Client = new HttpClient(); + Client.Verbose = true; + Client.KeepAlive = true; SystemUuid = Essentials.ConfigReader.ConfigObject.SystemUuid; @@ -184,7 +185,7 @@ namespace PepperDash.Essentials request.Header.SetHeaderValue("Content-Type", "application/json"); request.ContentString = postBody; - client.DispatchAsync(request, PostConnectionCallback); + Client.DispatchAsync(request, PostConnectionCallback); } } @@ -204,15 +205,14 @@ namespace PepperDash.Essentials { try { - var client = new HttpClient(); - - HttpClientRequest request = new HttpClientRequest(); - - client.Verbose = true; - client.KeepAlive = true; + if(Client == null) + Client = new HttpClient(); + Client.Verbose = true; + Client.KeepAlive = true; string url = string.Format("http://{0}/api/system/{1}/status", Config.ServerUrl, SystemUuid); + HttpClientRequest request = new HttpClientRequest(); request.Url.Parse(url); request.RequestType = RequestType.Post; request.Header.SetHeaderValue("Content-Type", "application/json"); @@ -225,7 +225,7 @@ namespace PepperDash.Essentials Debug.Console(1, this, "Posting to '{0}':\n{1}", url, request.ContentString); try { - client.DispatchAsync(request, (r, err) => { if (r != null) { Debug.Console(1, this, "Status Response Code: {0}", r.Code); } }); + Client.DispatchAsync(request, (r, err) => { if (r != null) { Debug.Console(1, this, "Status Response Code: {0}", r.Code); } }); } catch (Exception e) { @@ -276,10 +276,11 @@ namespace PepperDash.Essentials ServerReconnectTimer = null; } - if (SseClient == null) - { +#warning The SSE Client from a previous session might need to be killed... + //if (SseClient == null) + //{ ConnectSseClient(null); - } + //} } else { @@ -301,16 +302,13 @@ namespace PepperDash.Essentials /// void HeartbeatExpiredTimerCallback(object o) { - if (ServerHeartbeatCheckTimer != null) + Debug.Console(1, this, "Heartbeat Timer Expired."); + if (ServerHeartbeatCheckTimer != null) { - Debug.Console(1, this, "Heartbeat Timer Expired."); - ServerHeartbeatCheckTimer.Stop(); - ServerHeartbeatCheckTimer = null; } - - StartReconnectTimer(); + StartReconnectTimer(); } /// @@ -378,7 +376,11 @@ namespace PepperDash.Essentials SseClient.Connect(); } - + /// + /// + /// + /// + /// void LineGathered_LineReceived(object sender, GenericCommMethodReceiveTextArgs e) { //Debug.Console(1, this, "Received from Server: '{0}'", e.Text); diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index ea5e5f45..1cac022c 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -107,7 +107,7 @@ namespace PepperDash.Essentials.UIDrivers.VC SetupDirectoryList(); SetupRecentCallsList(); SetupFavorites(); - SetupSelfViewControls(); + SetupLayoutControls(); codec.CallStatusChange += new EventHandler(Codec_CallStatusChange); @@ -736,23 +736,51 @@ namespace PepperDash.Essentials.UIDrivers.VC /// /// /// - void SetupSelfViewControls() + void SetupLayoutControls() { - TriList.SetSigFalseAction(UIBoolJoin.VCStagingSelfViewLayoutPress, this.ShowSelfViewLayout); var svc = Codec as IHasCodecSelfview; if (svc != null) { TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle); svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]); - - //TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewPipTogglePress, () => { }); } var lc = Codec as IHasCodecLayouts; if (lc != null) { TriList.SetSigFalseAction(UIBoolJoin.VCLayoutTogglePress, lc.LocalLayoutToggle); lc.LocalLayoutFeedback.LinkInputSig(TriList.StringInput[UIStringJoin.VCLayoutModeText]); + + // attach to cisco special things to enable buttons + var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec; + if (cisco != null) + { + // Cisco has min/max buttons that need special sauce + cisco.SharingContentIsOnFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges; + cisco.PresentationViewMaximizedFeedback.OutputChange += CiscoSharingAndPresentation_OutputChanges; + + TriList.SetSigFalseAction(UIBoolJoin.VCMinMaxPress, cisco.MinMaxLayoutToggle); + } + + } + } + + /// + /// This should only be linked by cisco classes (spark initially) + /// + /// + /// + void CiscoSharingAndPresentation_OutputChanges(object sender, EventArgs e) + { + var cisco = Codec as PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec; + if (cisco != null) + { + var sharing = cisco.SharingContentIsOnFeedback.BoolValue; + var maximized = cisco.PresentationViewMaximizedFeedback.BoolValue; + //set feedback and enables + TriList.BooleanInput[UIBoolJoin.VCMinMaxEnable].BoolValue = sharing; + TriList.BooleanInput[UIBoolJoin.VCLayoutToggleEnable].BoolValue = sharing && maximized; + TriList.BooleanInput[UIBoolJoin.VCMinMaxPress].BoolValue = maximized; } } diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 44a47680..d22bcb3c 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index acfef35c..715ef6d2 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ