From 1990201215a01fd9d71009f2956c22c75cb2ea74 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 22 Feb 2021 10:11:57 -0700 Subject: [PATCH] add none ports to DMPS & Blade chassis --- .../Chassis/DmBladeChassisController.cs | 6 +++ .../Chassis/DmpsRoutingController.cs | 40 +++++++++---------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs index e4126411..5b2995da 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs @@ -23,6 +23,8 @@ namespace PepperDash.Essentials.DM { /// public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback { + private const string NonePortKey = "inputCard0--None"; + public DMChassisPropertiesConfig PropertiesConfig { get; set; } public Switch Chassis { get; private set; } @@ -112,6 +114,10 @@ namespace PepperDash.Essentials.DM { controller.AddVolumeControl(outNum, audio); } + controller.InputPorts.Add(new RoutingInputPort(NonePortKey, eRoutingSignalType.Video, + eRoutingPortConnectionType.None, null, controller)); + + controller.InputNames = properties.InputNames; controller.OutputNames = properties.OutputNames; controller.PropertiesConfig = properties; diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs index e6bec335..4c110905 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs @@ -21,6 +21,8 @@ namespace PepperDash.Essentials.DM { public class DmpsRoutingController : EssentialsBridgeableDevice, IRoutingNumericWithFeedback, IHasFeedback { + private const string NonePortKey = "none"; + public CrestronControlSystem Dmps { get; set; } public ISystemControl SystemControl { get; private set; } @@ -75,20 +77,18 @@ namespace PepperDash.Essentials.DM { try { - - ISystemControl systemControl = null; - - systemControl = Global.ControlSystem.SystemControl as ISystemControl; + var systemControl = Global.ControlSystem.SystemControl; if (systemControl == null) { return null; } - var controller = new DmpsRoutingController(key, name, systemControl); - - controller.InputNames = properties.InputNames; - controller.OutputNames = properties.OutputNames; + var controller = new DmpsRoutingController(key, name, systemControl) + { + InputNames = properties.InputNames, + OutputNames = properties.OutputNames + }; if (!string.IsNullOrEmpty(properties.NoRouteText)) controller.NoRouteText = properties.NoRouteText; @@ -96,9 +96,9 @@ namespace PepperDash.Essentials.DM return controller; } - catch (System.Exception e) + catch (Exception e) { - Debug.Console(0, "Error getting DMPS Controller:\r{0}", e); + Debug.Console(0, "Error getting DMPS Controller:\r\n{0}", e); } return null; } @@ -113,6 +113,7 @@ namespace PepperDash.Essentials.DM public DmpsRoutingController(string key, string name, ISystemControl systemControl) : base(key, name) { + Dmps = Global.ControlSystem; SystemControl = systemControl; @@ -427,14 +428,11 @@ namespace PepperDash.Essentials.DM { Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString()); - InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; }); + InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.EndpointOnlineFeedback); if (inputCard.VideoDetectedFeedback != null) { - VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() => - { - return inputCard.VideoDetectedFeedback.BoolValue; - }); + VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.VideoDetectedFeedback.BoolValue); } InputNameFeedbacks[inputCard.Number] = new StringFeedback(() => @@ -443,13 +441,10 @@ namespace PepperDash.Essentials.DM { Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue); return inputCard.NameFeedback.StringValue; + } - } - else - { - Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number); - return ""; - } + Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number); + return ""; }); AddInputCard(inputCard.Number, inputCard); @@ -459,6 +454,9 @@ namespace PepperDash.Essentials.DM Debug.Console(2, this, "***********Input Card of type {0} is cannot be cast as DMInput*************", card.CardInputOutputType); } } + + InputPorts.Add(new RoutingInputPort(NonePortKey, eRoutingSignalType.AudioVideo, + eRoutingPortConnectionType.None, null, this)); } ///