From f2e21661469b8080d338cf810a504576e749440d Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 27 Nov 2019 10:32:21 -0700 Subject: [PATCH 1/6] Corrects issues with order of operations so that InCallFeedback isn't null when dependent routines check it's state. --- .../Room/Types/EssentialsHuddleVtc1Room.cs | 132 ++++++++++-------- .../Routing/RoutingPort.cs | 6 +- .../SubpageReferenceList.cs | 7 +- .../MIcrophone/MicrophonePrivacyController.cs | 8 +- 4 files changed, 83 insertions(+), 70 deletions(-) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index d83c8e9a..991a3470 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -231,64 +231,25 @@ namespace PepperDash.Essentials void Initialize() { - if (DefaultAudioDevice is IBasicVolumeControls) - DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls; - else if (DefaultAudioDevice is IHasVolumeDevice) - DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice; - CurrentVolumeControls = DefaultVolumeControls; - - - var disp = DefaultDisplay as DisplayBase; - if (disp != null) + try { - // Link power, warming, cooling to display - disp.PowerIsOnFeedback.OutputChange += (o, a) => - { - if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue) - { - if (!disp.PowerIsOnFeedback.BoolValue) - CurrentSourceInfo = null; - OnFeedback.FireUpdate(); - } - if (disp.PowerIsOnFeedback.BoolValue) - { - SetDefaultLevels(); - } - }; - - disp.IsWarmingUpFeedback.OutputChange += (o, a) => - { - IsWarmingUpFeedback.FireUpdate(); - if (!IsWarmingUpFeedback.BoolValue) - (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); - }; - disp.IsCoolingDownFeedback.OutputChange += (o, a) => - { - 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."); - } + if (DefaultAudioDevice is IBasicVolumeControls) + DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls; + else if (DefaultAudioDevice is IHasVolumeDevice) + DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice; + CurrentVolumeControls = DefaultVolumeControls; - // Combines call feedback from both codecs if available - InCallFeedback = new BoolFeedback(() => + // Combines call feedback from both codecs if available + InCallFeedback = new BoolFeedback(() => { bool inAudioCall = false; bool inVideoCall = false; - if(AudioCodec != null) + if (AudioCodec != null) inAudioCall = AudioCodec.IsInCall; - if(VideoCodec != null) + if (VideoCodec != null) inVideoCall = VideoCodec.IsInCall; if (inAudioCall || inVideoCall) @@ -297,22 +258,71 @@ namespace PepperDash.Essentials return false; }); - VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); + var disp = DefaultDisplay as DisplayBase; + if (disp != null) + { + // Link power, warming, cooling to display + disp.PowerIsOnFeedback.OutputChange += (o, a) => + { + if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue) + { + if (!disp.PowerIsOnFeedback.BoolValue) + CurrentSourceInfo = null; + OnFeedback.FireUpdate(); + } + if (disp.PowerIsOnFeedback.BoolValue) + { + SetDefaultLevels(); + } + }; - if (AudioCodec != null) - AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); + disp.IsWarmingUpFeedback.OutputChange += (o, a) => + { + IsWarmingUpFeedback.FireUpdate(); + if (!IsWarmingUpFeedback.BoolValue) + (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); + }; + disp.IsCoolingDownFeedback.OutputChange += (o, a) => + { + IsCoolingDownFeedback.FireUpdate(); + }; - IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue); - VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate(); + } - // link privacy to VC (for now?) - PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue); - VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate(); - CallTypeFeedback = new IntFeedback(() => 0); - - SourceListKey = "default"; - EnablePowerOnToLastSource = true; + + // Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback + 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."); + + + VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); + + if (AudioCodec != null) + AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); + + IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue); + VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate(); + + // link privacy to VC (for now?) + PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue); + VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate(); + + CallTypeFeedback = new IntFeedback(() => 0); + + SourceListKey = "default"; + EnablePowerOnToLastSource = true; + } + catch (Exception e) + { + Debug.Console(0, this, "Error Initializing Room: {0}", e); + } } protected override void CustomSetConfig(DeviceConfig config) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs index a6a16e08..12edb104 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs @@ -33,9 +33,9 @@ namespace PepperDash.Essentials.Core { Audio = 1, Video = 2, - //AudioVideo = 4, - UsbOutput = 4, - UsbInput = 8 + AudioVideo = 4, + UsbOutput = 8, + UsbInput = 16 } public enum eRoutingPortConnectionType diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs index 2f8794f0..fe69e4ca 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/SmartObjects/SubpageReferencList/SubpageReferenceList.cs @@ -33,7 +33,7 @@ namespace PepperDash.Essentials.Core public ushort Count { get { return SetNumberOfItemsSig.UShortValue; } - set { SetNumberOfItemsSig.UShortValue = value; } + set { SetNumberOfItemsSig.UShortValue = value; } } public ushort MaxDefinedItems { get; private set; } @@ -100,8 +100,9 @@ namespace PepperDash.Essentials.Core // Empty the list Items.Clear(); // Clean up the SRL - Count = 0; - ScrollToItemSig.UShortValue = 1; + Count = 1; + + ScrollToItemSig.UShortValue = 1; } /// diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs index 177fffd1..d8a7f543 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/MIcrophone/MicrophonePrivacyController.cs @@ -87,7 +87,11 @@ namespace PepperDash.Essentials.Devices.Common.Microphones else Debug.Console(0, this, "Unable to add Red LED device"); - CheckPrivacyMode(); + AddPostActivationAction(() => { + CheckPrivacyMode(); + PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange; + PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange; + }); initialized = true; @@ -97,8 +101,6 @@ namespace PepperDash.Essentials.Devices.Common.Microphones public void SetPrivacyDevice(IPrivacy privacyDevice) { PrivacyDevice = privacyDevice; - - PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange; } void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e) From 74de1c2475ab54f04a44c7439b49bd354ade2822 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 27 Nov 2019 11:16:14 -0700 Subject: [PATCH 2/6] Updates PD.Core version --- essentials-framework/pepperdashcore-builds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/pepperdashcore-builds b/essentials-framework/pepperdashcore-builds index de8b9f59..45949f09 160000 --- a/essentials-framework/pepperdashcore-builds +++ b/essentials-framework/pepperdashcore-builds @@ -1 +1 @@ -Subproject commit de8b9f592ee7918691ad3a88359c93ffe0ec39c5 +Subproject commit 45949f09bdcf6548be7fdf5c860ea4e3a5cf152d From 10104e2a09a3c9f3ea2e46a177a9f1714c9db5b5 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 27 Nov 2019 11:36:56 -0700 Subject: [PATCH 3/6] Corrects issue where if relay state was already Registered, DeviceFactory did not return a GenericRelayDevice --- .../Essentials Devices Common/Factory/DeviceFactory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs index 671dec12..004a2579 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs @@ -292,6 +292,10 @@ namespace PepperDash.Essentials.Devices.Common else Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey); } + else + { + return new GenericRelayDevice(key, relay); + } // Future: Check if portDevice is 3-series card or other non control system that supports versiports } From 5fc93ca2515759495af92fd004a0bbfc4cd5b3ab Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 16 Dec 2019 14:44:34 -0700 Subject: [PATCH 4/6] Fixed to DGE to allow use of Com ports via EfS bridge. Updates PD.Core version --- PepperDashEssentials/Factory/UiDeviceFactory.cs | 8 +++++++- .../UI/EssentialsTouchpanelController.cs | 13 +++++++++---- .../Essentials_DM/Endpoints/DGEs/DgeController.cs | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/PepperDashEssentials/Factory/UiDeviceFactory.cs b/PepperDashEssentials/Factory/UiDeviceFactory.cs index e1b00caa..6176b6d1 100644 --- a/PepperDashEssentials/Factory/UiDeviceFactory.cs +++ b/PepperDashEssentials/Factory/UiDeviceFactory.cs @@ -38,7 +38,13 @@ namespace PepperDash.Essentials else if (typeName == "dmdge200c") dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem); - var dgeController = new DgeController(config.Key, config.Name, dgeDevice, config, props); + if (dgeDevice == null) + { + Debug.Console(1, "Unable to create DGE device"); + return null; + } + + var dgeController = new DgeController(config.Key + "-comPorts", config.Name, dgeDevice, config, props); DeviceManager.AddDevice(dgeController); diff --git a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs index 678355e3..11f720a3 100644 --- a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs +++ b/PepperDashEssentials/UI/EssentialsTouchpanelController.cs @@ -30,12 +30,17 @@ namespace PepperDash.Essentials tsw.SigChange += Panel_SigChange; } - public EssentialsTouchpanelController(string key, string name, Dge100 panel, string projectName, string sgdPath) + public EssentialsTouchpanelController(string key, string name, Dge100 dge, string projectName, string sgdPath) : base(key, name) { - Panel = panel; - panel.LoadSmartObjects(sgdPath); - panel.SigChange += Panel_SigChange; + Panel = dge; + + if (!string.IsNullOrEmpty(sgdPath)) + dge.LoadSmartObjects(sgdPath); + else + Debug.Console(1, this, "No SGD file path defined"); + + dge.SigChange += Panel_SigChange; } /// diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs index f8cf0938..0fc00323 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DgeController.cs @@ -28,6 +28,8 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs public DgeController(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props) :base(key, name, device) { + DigitalGraphicsEngine = device; + DeviceConfig = dc; PropertiesConfig = props; From 5987b5b078f1c9f7abda01591b3e44de7efc6bb0 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 17 Dec 2019 10:59:54 -0700 Subject: [PATCH 5/6] Update PD.Core version --- essentials-framework/pepperdashcore-builds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/pepperdashcore-builds b/essentials-framework/pepperdashcore-builds index 45949f09..2d9c383d 160000 --- a/essentials-framework/pepperdashcore-builds +++ b/essentials-framework/pepperdashcore-builds @@ -1 +1 @@ -Subproject commit 45949f09bdcf6548be7fdf5c860ea4e3a5cf152d +Subproject commit 2d9c383db02ef3ef69dee8d42201c746fdfe79ea From fe14d543d6bee0b28b791b776e04e14e7f8a30d0 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 20 Dec 2019 14:17:21 -0700 Subject: [PATCH 6/6] Fixes issue with OutputAudioRouteNameFeebdack not being fired --- .../Essentials_DM/Chassis/DmChassisController.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 632e555a..136f3c86 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -747,13 +747,19 @@ namespace PepperDash.Essentials.DM case DMInputEventIds.UsbRoutedToEventId: { Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number); - UsbInputRoutedToFeebacks[args.Number].FireUpdate(); + if(UsbInputRoutedToFeebacks[args.Number] != null) + UsbInputRoutedToFeebacks[args.Number].FireUpdate(); + else + Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks"); break; } case DMInputEventIds.HdcpCapabilityFeedbackEventId: { Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number); - InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate(); + if (InputCardHdcpCapabilityFeedbacks[args.Number] != null) + InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate(); + else + Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks"); break; } default: @@ -818,6 +824,10 @@ namespace PepperDash.Essentials.DM { AudioOutputFeedbacks[output].FireUpdate(); } + if (OutputAudioRouteNameFeedbacks.ContainsKey(output)) + { + OutputAudioRouteNameFeedbacks[output].FireUpdate(); + } break; } case DMOutputEventIds.OutputNameEventId: