From f7bf728263e1061a2001adee9e956d7e7d517219 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 7 Oct 2021 09:48:02 -0600 Subject: [PATCH 1/4] fix(Devices_Common): Clear meeting list and fire event if no meetings are scheduled --- .../VideoCodec/VideoCodecBase.cs | 17 +++++++++++++++++ .../VideoCodec/ZoomRoom/ZoomRoom.cs | 15 ++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index d34c9e3b..79b05046 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -298,6 +298,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } LinkVideoCodecToApi(codec, trilist, joinMap); + + trilist.OnlineStatusChange += (device, args) => + { + if (!args.DeviceOnLine) return; + + trilist.SetString(joinMap.Schedule.JoinNumber, "\xFC"); + }; } /// @@ -785,6 +792,16 @@ ScreenIndexIsPinnedTo: {8} (a{17}) _currentMeetings = codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList(); + if (_currentMeetings.Count == 0) + { + var emptyXSigByteArray = XSigHelpers.ClearOutputs(); + var emptyXSigString = Encoding.GetEncoding(XSigEncoding) + .GetString(emptyXSigByteArray, 0, emptyXSigByteArray.Length); + + trilist.SetString(joinMap.Schedule.JoinNumber, emptyXSigString); + return; + } + var meetingsData = UpdateMeetingsListXSig(_currentMeetings); trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData); trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)_currentMeetings.Count); diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs index 32a24a28..a43ea79c 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs @@ -1306,11 +1306,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom var codecBookings = JsonConvert.DeserializeObject>( responseObj.ToString()); - if (codecBookings != null && codecBookings.Count > 0) - { - CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult( - codecBookings, CodecSchedule.MeetingWarningMinutes); - } + if (codecBookings != null && codecBookings.Count > 0) + { + CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult( + codecBookings, CodecSchedule.MeetingWarningMinutes); + } + else + { + //need to clear the list if it's empty + CodecSchedule.Meetings = new List(); + } break; } From 38959414ffa40dbc0679cb8012f696cd900f2204 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 11 May 2021 10:16:03 -0600 Subject: [PATCH 2/4] 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 3/4] 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 4/4] 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; }