From 6ddbdd90c7b9ebc503044b176156e1c48461bba6 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 26 Apr 2023 13:32:18 -0600 Subject: [PATCH 1/2] feat: add new interface and update Chassis controllers --- .../Essentials_DM/Chassis/DmBladeChassisController.cs | 2 +- .../Essentials_DM/Chassis/DmChassisController.cs | 2 +- .../Essentials DM/Essentials_DM/IDmSwitch.cs | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs index 412dee6b..3898201d 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs @@ -22,7 +22,7 @@ namespace PepperDash.Essentials.DM /// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions /// /// - public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback + public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback { private const string NonePortKey = "inputCard0--None"; diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 60ef9d69..ca8b3dd8 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -23,7 +23,7 @@ namespace PepperDash.Essentials.DM /// /// [Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")] - public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback + public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback { private const string NonePortKey = "inputCard0--None"; public DMChassisPropertiesConfig PropertiesConfig { get; set; } diff --git a/essentials-framework/Essentials DM/Essentials_DM/IDmSwitch.cs b/essentials-framework/Essentials DM/Essentials_DM/IDmSwitch.cs index fdbe4956..cf3f963e 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/IDmSwitch.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/IDmSwitch.cs @@ -16,10 +16,17 @@ using PepperDash.Essentials.Core; using PepperDash.Essentials.DM.Config; namespace PepperDash.Essentials.DM { - public interface IDmSwitch { + public interface IDmSwitch + { Switch Chassis { get; } Dictionary TxDictionary { get; } Dictionary RxDictionary { get; } } + + public interface IDmSwitchWithEndpointOnlineFeedback : IDmSwitch + { + Dictionary InputEndpointOnlineFeedbacks { get; } + Dictionary OutputEndpointOnlineFeedbacks { get; } + } } \ No newline at end of file From 0df315426b1f0064cfa0dcfe19a4822b13e73059 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 26 Apr 2023 13:32:49 -0600 Subject: [PATCH 2/2] fix: use new interface for parentDev The GetDmRmcController & GetDmTxController methods were previously ignoring the `DmBladeChassisController` type. This was causing transmitters connected to a DM blade chassis to not be built, --- .../Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs | 4 ++-- .../Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index bb8aec65..57f522fd 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -436,9 +436,9 @@ namespace PepperDash.Essentials.DM } return rx; } - else if (parentDev is DmChassisController) + else if (parentDev is IDmSwitchWithEndpointOnlineFeedback) { - var controller = parentDev as DmChassisController; + var controller = parentDev as IDmSwitchWithEndpointOnlineFeedback; var chassis = controller.Chassis; var num = props.ParentOutputNumber; Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num); diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs index 84007032..140f0f45 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs @@ -127,10 +127,10 @@ namespace PepperDash.Essentials.DM BasicDmTxControllerBase tx; bool useChassisForOfflineFeedback = false; - if (parentDev is DmChassisController) + if (parentDev is IDmSwitchWithEndpointOnlineFeedback) { // Get the Crestron chassis and link stuff up - var switchDev = (parentDev as DmChassisController); + var switchDev = (parentDev as IDmSwitchWithEndpointOnlineFeedback); var chassis = switchDev.Chassis; //Check that the input is within range of this chassis' possible inputs @@ -179,6 +179,7 @@ namespace PepperDash.Essentials.DM return null; } } + if (parentDev is DmpsRoutingController) { // Get the DMPS chassis and link stuff up