From 38959414ffa40dbc0679cb8012f696cd900f2204 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 11 May 2021 10:16:03 -0600 Subject: [PATCH 1/3] Fix USB Routing issue --- .../Essentials_DM/Chassis/DmChassisController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index c74aea2b..30056082 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -1349,8 +1349,10 @@ namespace PepperDash.Essentials.DM DMInputOutputBase dmCard; + //Routing Input to Input or Output to Input if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) { + Debug.Console(2, this, "Executing USB Input switch.\r\n in:{0} output: {1}", inputSelector, outputSelector); if (outputSelector > chassisSize) { uint outputIndex; @@ -1370,13 +1372,14 @@ namespace PepperDash.Essentials.DM dmCard = Chassis.Inputs[inputSelector]; } - ExecuteSwitch(dmCard, Chassis.Outputs[outputSelector], sigType); + ExecuteSwitch(dmCard, Chassis.Inputs[outputSelector], sigType); return; } if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) { Debug.Console(2, this, "Executing USB Output switch.\r\n in:{0} output: {1}", inputSelector, outputSelector); + //routing Output to Output or Input to Output if (inputSelector > chassisSize) { //wanting to route an output to an output. Subtract chassis size and get output, unless it's 8x8 From 16369e31cf7a514f8610aff41599fa4f6693083f Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 11 May 2021 12:05:28 -0600 Subject: [PATCH 2/3] fix USB routing --- .../Chassis/DmChassisController.cs | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 30056082..016bb15d 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -1285,7 +1285,10 @@ namespace PepperDash.Essentials.DM var output = outputSelector as DMOutput; - if (output == null) + var isUsbInput = (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput; + var isUsbOutput = (sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput; + + if (output == null && !(isUsbOutput || isUsbInput)) { Debug.Console(0, this, Debug.ErrorLogLevel.Warning, "Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector, @@ -1330,13 +1333,31 @@ namespace PepperDash.Essentials.DM //Chassis.Outputs[output].AudioOut = inCard; } - if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput || (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) + if ((sigType & eRoutingSignalType.UsbOutput) != eRoutingSignalType.UsbOutput && + (sigType & eRoutingSignalType.UsbInput) != eRoutingSignalType.UsbInput) { - Chassis.USBEnter.BoolValue = true; - output.USBRoutedTo = input; + return; } + Chassis.USBEnter.BoolValue = true; + if (output != null) + { + output.USBRoutedTo = input; + return; + } + var tempOutput = outputSelector as DMInput; + + if (tempOutput == null) + { + Debug.Console(0, this, Debug.ErrorLogLevel.Warning, + "Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector, + outputSelector); + return; + } + + tempOutput.USBRoutedTo = input; } + #endregion #region IRoutingNumeric Members From cef9e0a9a66cdbcc9b825d1fd9e6d22fb9d3d3ac Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 12 May 2021 09:16:54 -0600 Subject: [PATCH 3/3] Update UsbOutput routing --- .../Chassis/DmChassisController.cs | 44 ++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 016bb15d..030536df 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -1319,7 +1319,10 @@ namespace PepperDash.Essentials.DM if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) { Chassis.VideoEnter.BoolValue = true; - output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard; + if (output != null) + { + output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard; + } } if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio) @@ -1329,12 +1332,43 @@ namespace PepperDash.Essentials.DM { dmMdMnxn.AudioEnter.BoolValue = true; } - output.AudioOut = input; - //Chassis.Outputs[output].AudioOut = inCard; + if (output != null) + { + output.AudioOut = input; + } } - if ((sigType & eRoutingSignalType.UsbOutput) != eRoutingSignalType.UsbOutput && - (sigType & eRoutingSignalType.UsbInput) != eRoutingSignalType.UsbInput) + if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) + + { + Chassis.USBEnter.BoolValue = true; + if (inputSelector == null && output != null) + { + //clearing the route is intended + output.USBRoutedTo = null; + return; + } + + if (inputSelector != null && input == null) + { + //input selector is DMOutput...we're doing a out to out route + var tempInput = inputSelector as DMOutput; + + if (tempInput == null || output == null) + { + return; + } + output.USBRoutedTo = tempInput; + return; + } + + if (input != null & output != null) + { + output.USBRoutedTo = input; + } + } + + if((sigType & eRoutingSignalType.UsbInput) != eRoutingSignalType.UsbInput) { return; }