diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs index 86e59be2..74122905 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/GenericComm.cs @@ -27,7 +27,16 @@ namespace PepperDash.Essentials.Core { PropertiesConfig = CommFactory.GetControlPropertiesConfig(config); - CommPort = CommFactory.CreateCommForDevice(config); + var commPort = CommFactory.CreateCommForDevice(config); + + //Fixing decision to require '-comPorts' in delcaration for DGE in order to get a device with comports included + if (commPort == null) + { + config.Key = config.Key + "-comPorts"; + commPort = CommFactory.CreateCommForDevice(config); + } + + CommPort = commPort; } diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs index 2780b7b1..19aba276 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/Dge100Controller.cs @@ -88,7 +88,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs var comm = CommFactory.GetControlPropertiesConfig(dc); var props = JsonConvert.DeserializeObject(dc.Properties.ToString()); - Debug.Console(1, "Factory Attempting to create new DgeControllerm Device"); + Debug.Console(1, "Factory Attempting to create new DgeController Device"); Dge100 dgeDevice = null; if (typeName == "dge100") @@ -100,7 +100,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs return null; } - var dgeController = new Dge100Controller(dc.Key + "-comPorts", dc.Name, dgeDevice, dc, props); + var dgeController = new Dge100Controller(dc.Key, dc.Name, dgeDevice, dc, props); return dgeController; } diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DmDge200CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DmDge200CController.cs index 6aa153c5..26f6fc39 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DmDge200CController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/DGEs/DmDge200CController.cs @@ -20,12 +20,10 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs /// /// Wrapper class for DGE-100 and DM-DGE-200-C /// - public class DmDge200CController : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, - IHasBasicTriListWithSmartObject, IRoutingInputsOutputs, ICec + public class DmDge200CController : Dge100Controller, IRoutingInputsOutputs { private readonly DmDge200C _dge; - public BasicTriListWithSmartObject Panel { get { return _dge; } } public RoutingInputPort DmIn { get; private set; } public RoutingOutputPort HdmiOut { get; private set; } @@ -42,19 +40,13 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs } - public DeviceConfig _dc; - CrestronTouchpanelPropertiesConfig PropertiesConfig; public DmDge200CController(string key, string name, DmDge200C device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props) - : base(key, name, device) + : base(key, name, device, dc, props) { _dge = device; - _dc = dc; - - PropertiesConfig = props; - DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat, 0, this); HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo, @@ -69,69 +61,36 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs } - #region IComPorts Members - - public CrestronCollection ComPorts + public class DmDge200CControllerFactory : EssentialsDeviceFactory { - get { return _dge.ComPorts; } - } - - public int NumberOfComPorts - { - get { return _dge.NumberOfComPorts; } - } - - #endregion - - #region IIROutputPorts Members - - public CrestronCollection IROutputPorts - { - get { return _dge.IROutputPorts; } - } - - public int NumberOfIROutputPorts - { - get { return _dge.NumberOfIROutputPorts; } - } - - #endregion - - #region ICec Members - public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } } - #endregion - - } - - public class DmDge200CControllerFactory : EssentialsDeviceFactory - { - public DmDge200CControllerFactory() - { - TypeNames = new List() { "dmdge200c" }; - } - - public override EssentialsDevice BuildDevice(DeviceConfig dc) - { - var typeName = dc.Type.ToLower(); - var comm = CommFactory.GetControlPropertiesConfig(dc); - var props = JsonConvert.DeserializeObject(dc.Properties.ToString()); - - Debug.Console(1, "Factory Attempting to create new DgeControllerm Device"); - - DmDge200C dgeDevice = null; - - if (typeName == "dmdge200c") - dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem); - - if (dgeDevice == null) + public DmDge200CControllerFactory() { - Debug.Console(1, "Unable to create DGE device"); - return null; + TypeNames = new List() { "dmdge200c" }; } - var dgeController = new DmDge200CController(dc.Key + "-comPorts", dc.Name, dgeDevice, dc, props); + public override EssentialsDevice BuildDevice(DeviceConfig dc) + { + var typeName = dc.Type.ToLower(); + var comm = CommFactory.GetControlPropertiesConfig(dc); + var props = JsonConvert.DeserializeObject(dc.Properties.ToString()); - return dgeController; + Debug.Console(1, "Factory Attempting to create new DgeController Device"); + + DmDge200C dgeDevice = null; + + if (typeName == "dmdge200c") + dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem); + + if (dgeDevice == null) + { + Debug.Console(1, "Unable to create DGE device"); + return null; + } + + var dgeController = new DmDge200CController(dc.Key , dc.Name, dgeDevice, dc, props); + + return dgeController; + } } } } \ No newline at end of file