diff --git a/.gitmodules b/.gitmodules index e69de29b..185e02f3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "essentials-framework/pepperdashcore-builds"] + path = essentials-framework/pepperdashcore-builds + url = https://ndorin@bitbucket.org/Pepperdash_Products/pepperdashcore-builds.git + branch = development diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs index 231aa1fb..6bce77c4 100644 --- a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs @@ -88,40 +88,62 @@ namespace PepperDash.Essentials.Bridges } else if(advancedTxDevice == null || basicTxDevice != null) { + Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot); dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)]; if (inputPort != null) { + Debug.Console(1, "Port value for input card {0} is set", ioSlot); var port = inputPort.Port; if (port != null) { if (port is HdmiInputWithCEC) { + Debug.Console(1, "Port is HdmiInputWithCec"); + var hdmiInPortWCec = port as HdmiInputWithCEC; if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown) { - SetHdcpCapabilityAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); + SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); } dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); - trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; + if(dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot)) + trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; + else + trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1; } - else if (port is DMInputPortWithCec) + } + } + else + { + inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)]; + + if(inputPort != null) + { + var port = inputPort.Port; + + if (port is DMInputPortWithCec) { + Debug.Console(1, "Port is DMInputPortWithCec"); + var dmInPortWCec = port as DMInputPortWithCec; if (dmInPortWCec != null) { - SetHdcpCapabilityAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); + SetHdcpStateAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); } dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); - trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; + if (dmChassis.InputCardHdcpCapabilityTypes.ContainsKey(ioSlot)) + trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; + else + trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1; } } } @@ -138,7 +160,7 @@ namespace PepperDash.Essentials.Bridges if (hdmiPort != null) { - SetHdcpCapabilityAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist); + SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist); dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); } } @@ -175,7 +197,7 @@ namespace PepperDash.Essentials.Bridges } } - static void SetHdcpCapabilityAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist) + static void SetHdcpStateAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist) { if (hdcpTypeSimple) { @@ -195,14 +217,14 @@ namespace PepperDash.Essentials.Bridges else { trilist.SetUShortSigAction(join, - new Action(s => + new Action(u => { - port.HdcpReceiveCapability = (eHdcpCapabilityType)s; + port.HdcpReceiveCapability = (eHdcpCapabilityType)u; })); } } - static void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) + static void SetHdcpStateAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist) { if (hdcpTypeSimple) { @@ -222,14 +244,14 @@ namespace PepperDash.Essentials.Bridges else { trilist.SetUShortSigAction(join, - new Action(s => + new Action(u => { - port.HdcpCapability = (eHdcpCapabilityType)s; + port.HdcpCapability = (eHdcpCapabilityType)u; })); } } - static void SetHdcpCapabilityAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist) + static void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist) { if (!supportsHdcp2) { @@ -249,9 +271,9 @@ namespace PepperDash.Essentials.Bridges else { trilist.SetUShortSigAction(join, - new Action(s => + new Action(u => { - port.HdcpReceiveCapability = (eHdcpCapabilityType)s; + port.HdcpReceiveCapability = (eHdcpCapabilityType)u; })); } } diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj index d4d78631..6ef7e20f 100644 --- a/PepperDashEssentials/PepperDashEssentials.csproj +++ b/PepperDashEssentials/PepperDashEssentials.csproj @@ -71,9 +71,9 @@ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll - + False - ..\essentials-framework\references\PepperDash_Core.dll + ..\essentials-framework\pepperdashcore-builds\PepperDash_Core.dll False @@ -183,6 +183,7 @@ + diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs b/PepperDashEssentials/Properties/AssemblyInfo.cs index 015ff45a..83beada4 100644 --- a/PepperDashEssentials/Properties/AssemblyInfo.cs +++ b/PepperDashEssentials/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ [assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: AssemblyProduct("PepperDashEssentials")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")] -[assembly: AssemblyVersion("1.4.444.*")] +[assembly: AssemblyVersion("1.4.0.*")] diff --git a/PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs b/PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs index 6f51ae34..6bd2009e 100644 --- a/PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs +++ b/PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs @@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Room.Config public EssentialsNDisplayRoomPropertiesConfig() { - DisplayKeys = new List(); + Displays = new Dictionary(); } } } \ No newline at end of file diff --git a/PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs b/PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs index b3a14a85..9cdb14c9 100644 --- a/PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs +++ b/PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs @@ -4,13 +4,42 @@ using System.Linq; using System.Text; using Crestron.SimplSharp; +using Newtonsoft.Json; + +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.Devices; +using PepperDash.Essentials.Core.Config; +using PepperDash.Essentials.Room.Config; + namespace PepperDash.Essentials.Room.Types { /// - /// Base clas for rooms with more than a single display + /// Base class for rooms with more than a single display /// - //public abstract class EssentialsNDisplayRoomBase : EssentialsRoomBase - //{ + public abstract class EssentialsNDisplayRoomBase : EssentialsRoomBase + { + public event SourceInfoChangeHandler CurrentSingleSourceChange; - //} + public Dictionary Displays { get; protected set; } + + protected override Func IsWarmingFeedbackFunc { get { return () => false; ; } } + protected override Func IsCoolingFeedbackFunc { get { return () => false; } } + + public EssentialsNDisplayRoomBase(DeviceConfig config) + : base (config) + { + Displays = new Dictionary(); + + var propertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString()); + + foreach (var display in propertiesConfig.Displays) + { + var displayDevice = DeviceManager.GetDeviceForKey(display.Value) as IRoutingSinkWithSwitching; + + if (displayDevice != null) + Displays.Add(display.Key, displayDevice); + } + } + } } \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index f564d970..9eca4e25 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -71,9 +71,9 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll - + False - ..\..\references\PepperDash_Core.dll + ..\..\pepperdashcore-builds\PepperDash_Core.dll False diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 1655e431..99abf890 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -600,7 +600,7 @@ namespace PepperDash.Essentials.DM AddOutputPortWithDebug(string.Format("outputCard{0}", number), "hdmiOut1", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2 * (number - 1) + 1, cecPort1); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "dmOut2", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, 2 * (number - 1) + 2); } - else if (type == "dmcStro") + else if (type == "dmcstro") { var outputCard = new DmcStroSingle(number, Chassis); AddOutputPortWithDebug(string.Format("outputCard{0}", number), "streamOut", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Streaming, 2 * (number - 1) + 1); @@ -647,10 +647,15 @@ namespace PepperDash.Essentials.DM Debug.Console(2, this, "Adding input port '{0}'", portKey); var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this); - if (cecPort != null) - inputPort.Port = cecPort; + if (inputPort != null) + { + if (cecPort != null) + inputPort.Port = cecPort; - InputPorts.Add(inputPort); + InputPorts.Add(inputPort); + } + else + Debug.Console(2, this, "inputPort is null"); } /// diff --git a/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs b/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs index f4b2a141..22da6c44 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs @@ -34,6 +34,11 @@ namespace PepperDash.Essentials.DM.Config [JsonProperty("inputSlotSupportsHdcp2")] public Dictionary InputSlotSupportsHdcp2 { get; set; } + + public DMChassisPropertiesConfig() + { + InputSlotSupportsHdcp2 = new Dictionary(); + } } /// diff --git a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj index 721647ca..b66e5ab4 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj +++ b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj @@ -59,9 +59,9 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll - + False - ..\..\references\PepperDash_Core.dll + ..\..\pepperdashcore-builds\PepperDash_Core.dll False diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index 04fd9f53..ec276366 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -63,9 +63,9 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll - + False - ..\..\references\PepperDash_Core.dll + ..\..\pepperdashcore-builds\PepperDash_Core.dll False diff --git a/essentials-framework/pepperdashcore-builds b/essentials-framework/pepperdashcore-builds new file mode 160000 index 00000000..de8b9f59 --- /dev/null +++ b/essentials-framework/pepperdashcore-builds @@ -0,0 +1 @@ +Subproject commit de8b9f592ee7918691ad3a88359c93ffe0ec39c5 diff --git a/essentials-framework/references/PepperDash_Core.dll b/essentials-framework/references/PepperDash_Core.dll deleted file mode 100644 index 428b9249..00000000 Binary files a/essentials-framework/references/PepperDash_Core.dll and /dev/null differ