diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index c89f4948..65848f71 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -17,6 +17,8 @@ using PepperDash.Essentials.Fusion; using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Room.Cotija; +using Newtonsoft.Json; + namespace PepperDash.Essentials { public class ControlSystem : CrestronControlSystem @@ -359,21 +361,7 @@ namespace PepperDash.Essentials DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor")); - // Check if the processor is a DMPS model - if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1) - { - Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt); - var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, new DM.Config.DmpsRoutingPropertiesConfig()); - - DeviceManager.AddDevice(dmpsRoutingController); - - - } - else - { - Debug.Console(2, "************Processor is not DMPS type***************"); - } // Add global System Monitor device DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor")); @@ -390,7 +378,26 @@ namespace PepperDash.Essentials if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower()) Debug.Console(0, "WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available", - devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper()); + devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper()); + + // Check if the processor is a DMPS model + if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1) + { + Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt); + + var propertiesConfig = JsonConvert.DeserializeObject(devConf.Properties.ToString()); + + if(propertiesConfig == null) + propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig(); + + var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig); + + DeviceManager.AddDevice(dmpsRoutingController); + } + else + { + Debug.Console(2, "************Processor is not DMPS type***************"); + } continue; } diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs index 3c6b7ea3..10322ac6 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs @@ -629,10 +629,10 @@ namespace PepperDash.Essentials.DM } DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; - Card.Dmps3OutputBase outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase; + DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase; - if (inCard != null) - { + //if (inCard != null) + //{ // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video) { @@ -659,11 +659,11 @@ namespace PepperDash.Essentials.DM if (inCard != null && inCard.USBRoutedTo != null) inCard.USBRoutedTo = outCard; } - } - else - { - Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector); - } + //} + //else + //{ + // Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector); + //} } else