diff --git a/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs b/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs index 91e34852..5a9c3026 100644 --- a/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs +++ b/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs @@ -3,10 +3,119 @@ using System.Collections.Generic; using System.Linq; using System.Text; using Crestron.SimplSharp; +using Crestron.SimplSharpPro.DM; + +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.DM.Config; namespace PepperDash.Essentials.DM.Chassis { - public class HdMdMxNController + public class HdMdNxM4kEController : Device, IRoutingInputsOutputs, IRouting { + public HdMdNxM Chassis { get; private set; } + + public RoutingPortCollection InputPorts { get; private set; } + public RoutingPortCollection OutputPorts { get; private set; } + + + + + /// + /// + /// + /// + /// + /// + public HdMdNxM4kEController(string key, string name, HdMdNxM chassis, + HdMdNxM4kEPropertiesConfig props) + : base(key, name) + { + Chassis = chassis; + + // logical ports + InputPorts = new RoutingPortCollection(); + for (int i = 1; i <= 4; i++) + { + InputPorts.Add(new RoutingInputPort("hdmiIn" + i, eRoutingSignalType.AudioVideo, + eRoutingPortConnectionType.Hdmi, 1, this, false)); + } + OutputPorts = new RoutingPortCollection(); + OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo, + eRoutingPortConnectionType.Hdmi, null, this)); + + // physical settings + if (props != null && props.Inputs != null) + { + foreach (var kvp in props.Inputs) + { + var inputNum = Convert.ToUInt32(kvp.Key); + + var port = chassis.HdmiInputs[inputNum].HdmiInputPort; + // set hdcp disables + if (kvp.Value.DisableHdcp) + port.HdcpSupportOff(); + else + port.HdcpSupportOn(); + } + } + } + + public override bool CustomActivate() + { + var result = Chassis.Register(); + if (result != Crestron.SimplSharpPro.eDeviceRegistrationUnRegistrationResponse.Success) + { + Debug.Console(0, this, "Device registration failed: {0}", result); + return false; + } + + return base.CustomActivate(); + } + + + + #region IRouting Members + + public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType) + { + Chassis.HdmiOutputs[1].VideoOut = Chassis.HdmiInputs[(uint)inputSelector]; + Chassis.VideoEnter.Pulse(); + } + + #endregion + + ///////////////////////////////////////////////////// + + /// + /// + /// + /// + /// + /// + /// + /// + public static HdMdNxM4kEController GetController(string key, string name, + string type, HdMdNxM4kEPropertiesConfig properties) + { + try + { + var ipid = properties.Control.IpIdInt; + var address = properties.Control.TcpSshProperties.Address; + + type = type.ToLower(); + if (type == "hdmd4x14ke") + { + var chassis = new HdMd4x14kE(ipid, address, Global.ControlSystem); + return new HdMdNxM4kEController(key, name, chassis, properties); + } + return null; + } + catch (Exception e) + { + Debug.Console(0, "ERROR Creating device key {0}: \r{1}", key, e); + return null; + } + } } } \ No newline at end of file diff --git a/Essentials DM/Essentials_DM/Config/DeviceFactory.cs b/Essentials DM/Essentials_DM/Config/DeviceFactory.cs index 6ccc13c4..6cec273a 100644 --- a/Essentials DM/Essentials_DM/Config/DeviceFactory.cs +++ b/Essentials DM/Essentials_DM/Config/DeviceFactory.cs @@ -47,6 +47,13 @@ namespace PepperDash.Essentials.DM return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props); } + else if (typeName.Equals("hdmd4x14ke")) + { + var props = JsonConvert.DeserializeObject + (properties.ToString()); + return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props); + } + return null; } diff --git a/Essentials DM/Essentials_DM/Essentials_DM.csproj b/Essentials DM/Essentials_DM/Essentials_DM.csproj index 47fdd32b..53be42d9 100644 --- a/Essentials DM/Essentials_DM/Essentials_DM.csproj +++ b/Essentials DM/Essentials_DM/Essentials_DM.csproj @@ -91,9 +91,12 @@ + + + diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 4663606e..c21fb4bf 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -245,8 +245,9 @@ namespace PepperDash.Essentials Debug.Console(1, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion"); DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1)); - var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom); - AddBridgePostActivationHelper(bridge); + Debug.Console(0, "******* RE-ENABLE COTIJA PROPERLY *******"); + //var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom); + //AddBridgePostActivationHelper(bridge); } else if (room is EssentialsHuddleVtc1Room) { diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 47f414ba..1684e71b 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ