From 969ba3c87cd9aed23746d256a34352895cb5983e Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 26 Aug 2019 15:28:02 -0600 Subject: [PATCH] Addresses exceptions in DmTx401CController constructor --- .../Bridges/DmChassisControllerBridge.cs | 12 +++- .../Chassis/DmChassisController.cs | 68 ++++++++++--------- .../Transmitters/DmTx401CController.cs | 2 + .../Endpoints/Transmitters/DmTxHelpers.cs | 4 +- 4 files changed, 49 insertions(+), 37 deletions(-) diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs index 20d5303c..14fa580c 100644 --- a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs @@ -106,11 +106,16 @@ namespace PepperDash.Essentials.Bridges { dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); - var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}-hdmiIn", ioSlot)].Port as EndpointHdmiInput; - + var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)]; if (inputPort != null) { - //trilist.SetUShortSigAction((joinMap.HdcpSupport + ioSlot), u => + var hdmiPort = inputPort.Port as EndpointHdmiInput; + + if (hdmiPort != null) + { + SetHdcpCapabilityAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist); + dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); + } } } if (dmChassis.RxDictionary.ContainsKey(ioSlot)) @@ -129,6 +134,7 @@ namespace PepperDash.Essentials.Bridges RxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]); } } + // Feedback dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]); dmChassis.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]); diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index a9db3344..277c2e16 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -287,7 +287,9 @@ namespace PepperDash.Essentials.DM { Debug.Console(2, this, "Adding input card '{0}', slot {1}", type, number); - if (type == "dmcHd") + type = type.ToLower(); + + if (type == "dmchd") { var inputCard = new DmcHd(number, this.Chassis); var cecPort = inputCard.HdmiInput as ICec; @@ -299,7 +301,7 @@ namespace PepperDash.Essentials.DM var cecPort = inputCard.HdmiInput as ICec; AddHdmiInCardPorts(number, cecPort); } - else if (type == "dmc4kHd") + else if (type == "dmc4khd") { var inputCard = new Dmc4kHd(number, this.Chassis); var cecPort = inputCard.HdmiInput as ICec; @@ -311,125 +313,125 @@ namespace PepperDash.Essentials.DM var cecPort = inputCard.HdmiInput as ICec; AddHdmiInCardPorts(number, cecPort); } - else if (type == "dmc4kzHd") + else if (type == "dmc4kzhd") { var inputCard = new Dmc4kzHd(number, this.Chassis); var cecPort = inputCard.HdmiInput as ICec; AddHdmiInCardPorts(number, cecPort); } - else if (type == "dmc4kzHdDsp") + else if (type == "dmc4kzhddsp") { var inputCard = new Dmc4kzHdDsp(number, this.Chassis); var cecPort = inputCard.HdmiInput as ICec; AddHdmiInCardPorts(number, cecPort); } - else if (type == "dmcC") + else if (type == "dmcc") { new DmcC(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmcCDsp") + else if (type == "dmccdsp") { new DmcCDsp(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmc4kC") + else if (type == "dmc4kc") { new Dmc4kC(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmc4kCDsp") + else if (type == "dmc4kcdsp") { new Dmc4kCDsp(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmc4kzC") + else if (type == "dmc4kzc") { new Dmc4kzC(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmc4kzCDsp") + else if (type == "dmc4kzcdsp") { new Dmc4kzCDsp(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmcCat") + else if (type == "dmccat") { new DmcCat(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmcCatDsp") + else if (type == "dmccatdsp") { new DmcCatDsp(number, this.Chassis); AddDmInCardPorts(number); } - else if (type == "dmcS") + else if (type == "dmcs") { new DmcS(number, Chassis); AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber); AddInCardHdmiAndAudioLoopPorts(number); } - else if (type == "dmcSDsp") + else if (type == "dmcsdsp") { new DmcSDsp(number, Chassis); AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber); AddInCardHdmiAndAudioLoopPorts(number); } - else if (type == "dmcS2") + else if (type == "dmcs2") { new DmcS2(number, Chassis); AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber); AddInCardHdmiAndAudioLoopPorts(number); } - else if (type == "dmcS2Dsp") + else if (type == "dmcs2dsp") { new DmcS2Dsp(number, Chassis); AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber); AddInCardHdmiAndAudioLoopPorts(number); } - else if (type == "dmcSdi") + else if (type == "dmcsdi") { new DmcSdi(number, Chassis); AddInputPortWithDebug(number, "sdiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Sdi); AddOutputPortWithDebug(string.Format("inputCard{0}", number), "sdiOut", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Sdi, null); AddInCardHdmiAndAudioLoopPorts(number); } - else if (type == "dmcDvi") + else if (type == "dmcdvi") { new DmcDvi(number, Chassis); AddInputPortWithDebug(number, "dviIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Dvi); AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio); AddInCardHdmiLoopPort(number); } - else if (type == "dmcVga") + else if (type == "dmcvga") { new DmcVga(number, Chassis); AddInputPortWithDebug(number, "vgaIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Vga); AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio); AddInCardHdmiLoopPort(number); } - else if (type == "dmcVidBnc") + else if (type == "dmcvidbnc") { new DmcVidBnc(number, Chassis); AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component); AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio); AddInCardHdmiLoopPort(number); } - else if (type == "dmcVidRcaA") + else if (type == "dmcvidrcaa") { new DmcVidRcaA(number, Chassis); AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component); AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio); AddInCardHdmiLoopPort(number); } - else if (type == "dmcVidRcaD") + else if (type == "dmcvidrcad") { new DmcVidRcaD(number, Chassis); AddInputPortWithDebug(number, "componentIn", eRoutingSignalType.Video, eRoutingPortConnectionType.Component); AddInputPortWithDebug(number, "audioIn", eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio); AddInCardHdmiLoopPort(number); } - else if (type == "dmcVid4") + else if (type == "dmcvid4") { new DmcVid4(number, Chassis); AddInputPortWithDebug(number, "compositeIn1", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite); @@ -438,7 +440,7 @@ namespace PepperDash.Essentials.DM AddInputPortWithDebug(number, "compositeIn4", eRoutingSignalType.Video, eRoutingPortConnectionType.Composite); AddInCardHdmiLoopPort(number); } - else if (type == "dmcStr") + else if (type == "dmcstr") { new DmcStr(number, Chassis); AddInputPortWithDebug(number, "streamIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming); @@ -476,46 +478,48 @@ namespace PepperDash.Essentials.DM /// public void AddOutputCard(string type, uint number) { + type = type.ToLower(); + Debug.Console(2, this, "Adding output card '{0}', slot {1}", type, number); - if (type == "dmc4kHdo") + if (type == "dmc4khdo") { var outputCard = new Dmc4kHdoSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; var cecPort2 = outputCard.Card2.HdmiOutput; AddDmcHdoPorts(number, cecPort1, cecPort2); } - else if (type == "dmcHdo") + else if (type == "dmchdo") { var outputCard = new DmcHdoSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; var cecPort2 = outputCard.Card2.HdmiOutput; AddDmcHdoPorts(number, cecPort1, cecPort2); } - else if (type == "dmc4kCoHd") + else if (type == "dmc4kcohd") { var outputCard = new Dmc4kCoHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; AddDmcCoPorts(number, cecPort1); } - else if (type == "dmc4kzCoHd") + else if (type == "dmc4kzcohd") { var outputCard = new Dmc4kzCoHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; AddDmcCoPorts(number, cecPort1); } - else if (type == "dmcCoHd") + else if (type == "dmccohd") { var outputCard = new DmcCoHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; AddDmcCoPorts(number, cecPort1); } - else if (type == "dmCatoHd") + else if (type == "dmccatohd") { var outputCard = new DmcCatoHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; AddDmcCoPorts(number, cecPort1); } - else if (type == "dmcSoHd") + else if (type == "dmcsohd") { var outputCard = new DmcSoHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; @@ -524,7 +528,7 @@ namespace PepperDash.Essentials.DM AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, 2 * (number - 1) + 2); } - else if (type == "dmcS2oHd") + else if (type == "dmcs2ohd") { var outputCard = new DmcS2oHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs index e242e318..b4b3ddff 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs @@ -168,6 +168,8 @@ namespace PepperDash.Essentials.DM && tx.CvbsInput.SyncDetectedFeedback.BoolValue) }; + AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn, + eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs); DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this); 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 fef29b49..ec07662c 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTxHelpers.cs @@ -55,7 +55,7 @@ namespace PepperDash.Essentials.DM } catch (Exception e) { - Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e.Message); + Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e); } } else @@ -132,7 +132,7 @@ namespace PepperDash.Essentials.DM } catch (Exception e) { - Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e.Message); + Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e); } }