mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 03:57:27 +00:00
Refactor obsolete comport instantiation method for DGE devices
This commit is contained in:
parent
4c5b60bddb
commit
d11e0db14a
3 changed files with 39 additions and 71 deletions
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,10 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||
/// <summary>
|
||||
/// Wrapper class for DGE-100 and DM-DGE-200-C
|
||||
/// </summary>
|
||||
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,41 +61,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||
|
||||
}
|
||||
|
||||
#region IComPorts Members
|
||||
|
||||
public CrestronCollection<ComPort> ComPorts
|
||||
{
|
||||
get { return _dge.ComPorts; }
|
||||
}
|
||||
|
||||
public int NumberOfComPorts
|
||||
{
|
||||
get { return _dge.NumberOfComPorts; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IIROutputPorts Members
|
||||
|
||||
public CrestronCollection<IROutputPort> 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<Dge100Controller>
|
||||
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
|
||||
{
|
||||
public DmDge200CControllerFactory()
|
||||
{
|
||||
|
|
@ -116,7 +74,7 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
||||
|
||||
Debug.Console(1, "Factory Attempting to create new DgeControllerm Device");
|
||||
Debug.Console(1, "Factory Attempting to create new DgeController Device");
|
||||
|
||||
DmDge200C dgeDevice = null;
|
||||
|
||||
|
|
@ -129,9 +87,10 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||
return null;
|
||||
}
|
||||
|
||||
var dgeController = new DmDge200CController(dc.Key + "-comPorts", dc.Name, dgeDevice, dc, props);
|
||||
var dgeController = new DmDge200CController(dc.Key , dc.Name, dgeDevice, dc, props);
|
||||
|
||||
return dgeController;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue