mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 19:54:59 +00:00
Updates device factory methodology for Essentials Core and Essential DM libraries
This commit is contained in:
@@ -365,10 +365,9 @@ namespace PepperDash.Essentials
|
|||||||
// Then associated library factories
|
// Then associated library factories
|
||||||
if (newDev == null)
|
if (newDev == null)
|
||||||
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
|
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
|
||||||
|
|
||||||
if (newDev == null)
|
if (newDev == null)
|
||||||
newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
|
newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
|
||||||
if (newDev == null)
|
|
||||||
newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
|
|
||||||
if (newDev == null)
|
if (newDev == null)
|
||||||
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
using Crestron.SimplSharpPro;
|
using System.Collections.Generic;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.GeneralIO;
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.CrestronIO
|
namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
{
|
{
|
||||||
public class C2nRthsController:CrestronGenericBridgeableBaseDevice
|
public class C2nRthsController : CrestronGenericBridgeableBaseDevice
|
||||||
{
|
{
|
||||||
private readonly C2nRths _device;
|
private readonly C2nRths _device;
|
||||||
|
|
||||||
@@ -65,4 +68,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
trilist.StringInput[joinMap.Name].StringValue = Name;
|
trilist.StringInput[joinMap.Name].StringValue = Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class C2nRthsControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
|
{
|
||||||
|
public C2nRthsControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "c2nrths" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new C2N-RTHS Device");
|
||||||
|
|
||||||
|
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
var cresnetId = control.CresnetIdInt;
|
||||||
|
|
||||||
|
return new C2nRthsController(dc.Key, dc.Name, new C2nRths(cresnetId, Global.ControlSystem));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,8 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.GeneralIO;
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
@@ -13,7 +15,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wrapper class for CEN-IO-DIGIN-104 digital input module
|
/// Wrapper class for CEN-IO-DIGIN-104 digital input module
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CenIoDigIn104Controller : Device, IDigitalInputPorts
|
public class CenIoDigIn104Controller : EssentialsDevice, IDigitalInputPorts
|
||||||
{
|
{
|
||||||
public CenIoDi104 Di104 { get; private set; }
|
public CenIoDi104 Di104 { get; private set; }
|
||||||
|
|
||||||
@@ -37,4 +39,23 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CenIoDigIn104ControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
|
{
|
||||||
|
public CenIoDigIn104ControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "ceniodigin104" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new CEN-DIGIN-104 Device");
|
||||||
|
|
||||||
|
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
var ipid = control.IpIdInt;
|
||||||
|
|
||||||
|
return new CenIoDigIn104Controller(dc.Key, dc.Name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.GeneralIO;
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.CrestronIO
|
namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
{
|
{
|
||||||
public class StatusSignController:CrestronGenericBridgeableBaseDevice
|
public class StatusSignController : CrestronGenericBridgeableBaseDevice
|
||||||
{
|
{
|
||||||
private readonly StatusSign _device;
|
private readonly StatusSign _device;
|
||||||
|
|
||||||
@@ -158,4 +160,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class StatusSignControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
|
{
|
||||||
|
public StatusSignControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "statussign" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new StatusSign Device");
|
||||||
|
|
||||||
|
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
var cresnetId = control.CresnetIdInt;
|
||||||
|
|
||||||
|
return new StatusSignController(dc.Key, dc.Name, new StatusSign(cresnetId, Global.ControlSystem));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
foreach (var typeName in TypeNames)
|
foreach (var typeName in TypeNames)
|
||||||
{
|
{
|
||||||
DeviceFactory.AddFactoryForType(typeName, BuildDevice);
|
DeviceFactory.AddFactoryForType(typeName.ToLower(), BuildDevice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,34 +55,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
return FactoryMethods[typeName](dc);
|
return FactoryMethods[typeName](dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check "core" types
|
|
||||||
//if (typeName == "genericcomm")
|
|
||||||
//{
|
|
||||||
// Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
|
||||||
// return new GenericComm(dc);
|
|
||||||
//}
|
|
||||||
if (typeName == "ceniodigin104")
|
|
||||||
{
|
|
||||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
var ipid = control.IpIdInt;
|
|
||||||
|
|
||||||
return new CenIoDigIn104Controller(key, name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
|
|
||||||
}
|
|
||||||
if (typeName == "statussign")
|
|
||||||
{
|
|
||||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
var cresnetId = control.CresnetIdInt;
|
|
||||||
|
|
||||||
return new StatusSignController(key, name, new StatusSign(cresnetId, Global.ControlSystem));
|
|
||||||
}
|
|
||||||
if (typeName == "c2nrths")
|
|
||||||
{
|
|
||||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
var cresnetId = control.CresnetIdInt;
|
|
||||||
|
|
||||||
return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,16 +84,24 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Responsible for loading all of the device types
|
/// Responsible for loading all of the device types for this library
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CoreDeviceFactory
|
public class CoreDeviceFactory
|
||||||
{
|
{
|
||||||
public CoreDeviceFactory()
|
public CoreDeviceFactory()
|
||||||
{
|
{
|
||||||
var genComm = new GenericCommFactory() as IDeviceFactory;
|
var genCommFactory = new GenericCommFactory() as IDeviceFactory;
|
||||||
genComm.LoadTypeFactories();
|
genCommFactory.LoadTypeFactories();
|
||||||
|
|
||||||
|
var c2nRthsFactory = new C2nRthsControllerFactory() as IDeviceFactory;
|
||||||
|
c2nRthsFactory.LoadTypeFactories();
|
||||||
|
|
||||||
|
var statusSignFactory = new StatusSignControllerFactory() as IDeviceFactory;
|
||||||
|
statusSignFactory.LoadTypeFactories();
|
||||||
|
|
||||||
|
var cenIoControllerFactory = new CenIoDigIn104ControllerFactory() as IDeviceFactory;
|
||||||
|
cenIoControllerFactory.LoadTypeFactories();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -260,4 +260,29 @@ namespace PepperDash.Essentials.DM.AirMedia
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AirMediaControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
|
{
|
||||||
|
public AirMediaControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "am200", "am300" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var type = dc.Type.ToLower();
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new AirMedia Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
AmX00 amDevice = null;
|
||||||
|
if (type == "am200")
|
||||||
|
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
||||||
|
else if (type == "am300")
|
||||||
|
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
||||||
|
|
||||||
|
return new AirMediaController(dc.Key, dc.Name, amDevice, dc, props);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
@@ -1275,4 +1276,41 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public class DmChassisControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
|
{
|
||||||
|
public DmChassisControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "dmmd8x8", "dmmd8x8rps", "dmmd8x8cpu3", "dmmd8x8cpu3rps",
|
||||||
|
"dmmd16x16", "dmmd16x16rps", "dmmd16x16cpu3", "dmmd16x16cpu3rps",
|
||||||
|
"dmmd32x32", "dmmd32x32rps", "dmmd32x32cpu3", "dmmd32x32cpu3rps",
|
||||||
|
"dmmd64x64", "dmmd128x128" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var type = dc.Type.ToLower();
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new DmChassisController Device");
|
||||||
|
|
||||||
|
if (type.StartsWith("dmmd8x") || type.StartsWith("dmmd16x") || type.StartsWith("dmmd32x"))
|
||||||
|
{
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject
|
||||||
|
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
return PepperDash.Essentials.DM.DmChassisController.
|
||||||
|
GetDmChassisController(dc.Key, dc.Name, type, props);
|
||||||
|
}
|
||||||
|
else if (type.StartsWith("dmmd128x") || type.StartsWith("dmmd64x"))
|
||||||
|
{
|
||||||
|
var props = JsonConvert.DeserializeObject
|
||||||
|
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
return PepperDash.Essentials.DM.DmBladeChassisController.
|
||||||
|
GetDmChassisController(dc.Key, dc.Name, type, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,85 +17,25 @@ using PepperDash.Essentials.DM.Endpoints.DGEs;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public class DeviceFactory
|
/// <summary>
|
||||||
|
/// Responsible for loading the type factories for this library
|
||||||
|
/// </summary>
|
||||||
|
public class DmDeviceFactory
|
||||||
{
|
{
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
public DmDeviceFactory()
|
||||||
{
|
{
|
||||||
var key = dc.Key;
|
var dmChassisFactory = new DmChassisControllerFactory() as IDeviceFactory;
|
||||||
var name = dc.Name;
|
dmChassisFactory.LoadTypeFactories();
|
||||||
var type = dc.Type;
|
|
||||||
var properties = dc.Properties;
|
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var dmTxFactory = new DmTxControllerFactory() as IDeviceFactory;
|
||||||
|
dmTxFactory.LoadTypeFactories();
|
||||||
|
|
||||||
if (typeName.StartsWith("am"))
|
var dmRxFactory = new DmRmcControllerFactory() as IDeviceFactory;
|
||||||
{
|
dmRxFactory.LoadTypeFactories();
|
||||||
if (typeName == "am200" || typeName == "am300")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
|
|
||||||
AmX00 amDevice = null;
|
|
||||||
if (typeName == "am200")
|
|
||||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
|
|
||||||
else if (typeName == "am300")
|
|
||||||
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
|
|
||||||
|
|
||||||
return new AirMediaController(key, name, amDevice, dc, props);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject
|
|
||||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
|
||||||
return PepperDash.Essentials.DM.DmChassisController.
|
|
||||||
GetDmChassisController(key, name, type, props);
|
|
||||||
}
|
|
||||||
else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x")) {
|
|
||||||
var props = JsonConvert.DeserializeObject
|
|
||||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
|
||||||
return PepperDash.Essentials.DM.DmBladeChassisController.
|
|
||||||
GetDmChassisController(key, name, type, props);
|
|
||||||
}
|
|
||||||
// Hand off to DmTxHelper class
|
|
||||||
else if (typeName.StartsWith("dmtx")) {
|
|
||||||
var props = JsonConvert.DeserializeObject
|
|
||||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
|
|
||||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hand off to DmRmcHelper class
|
|
||||||
else if (typeName.StartsWith("dmrmc")) {
|
|
||||||
var props = JsonConvert.DeserializeObject
|
|
||||||
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
|
|
||||||
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName.Equals("hdmd4x14ke")) {
|
|
||||||
var props = JsonConvert.DeserializeObject
|
|
||||||
<PepperDash.Essentials.DM.Config.HdMdNxM4kEPropertiesConfig>(properties.ToString());
|
|
||||||
return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge")) {
|
|
||||||
var props = JsonConvert.DeserializeObject
|
|
||||||
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
|
|
||||||
|
|
||||||
if (typeName.Equals("hdmd400ce"))
|
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
|
||||||
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
|
||||||
else if (typeName.Equals("hdmd300ce"))
|
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
|
||||||
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
|
||||||
else if (typeName.Equals("hdmd200ce"))
|
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
|
||||||
new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
|
||||||
else if (typeName.Equals("hdmd200c1ge"))
|
|
||||||
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
|
||||||
new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var hdMdFactory = new HdMdxxxCEControllerFactory() as IDeviceFactory;
|
||||||
|
hdMdFactory.LoadTypeFactories();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using Newtonsoft.Json;
|
|||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
@@ -268,4 +269,40 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
public ControlPropertiesConfig Control { get; set; }
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class HdMdxxxCEControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
|
{
|
||||||
|
public HdMdxxxCEControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "hdmd400ce", "hdmd300ce", "hdmd200ce", "hdmd200c1ge"};
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var typeName = dc.Type.ToLower();
|
||||||
|
var key = dc.Key;
|
||||||
|
var name = dc.Name;
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new HD-MD Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject
|
||||||
|
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
if (typeName.Equals("hdmd400ce"))
|
||||||
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
|
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
|
else if (typeName.Equals("hdmd300ce"))
|
||||||
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
|
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
|
else if (typeName.Equals("hdmd200ce"))
|
||||||
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
|
new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
|
else if (typeName.Equals("hdmd200c1ge"))
|
||||||
|
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
|
||||||
|
new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
@@ -281,4 +282,25 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DmRmcControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
|
{
|
||||||
|
public DmRmcControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "hdbasetrx", "dmrmc4k100c1g", "dmrmc100c", "dmrmc100s", "dmrmc4k100c", "dmrmc150s",
|
||||||
|
"dmrmc200c", "dmrmc200s", "dmrmc200s2", "dmrmcscalerc", "dmrmcscalers", "dmrmcscalers2", "dmrmc4kscalerc", "dmrmc4kscalercdsp" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var type = dc.Type.ToLower();
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new DM-RMC Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject
|
||||||
|
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,8 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.DM.Config;
|
using PepperDash.Essentials.DM.Config;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
@@ -319,12 +321,25 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//public enum ePdtHdcpSupport
|
|
||||||
//{
|
public class DmTxControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||||
// HdcpOff = 0,
|
{
|
||||||
// Hdcp1 = 1,
|
public DmTxControllerFactory()
|
||||||
// Hdcp2 = 2,
|
{
|
||||||
// Hdcp2_2= 3,
|
TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c", "dmtx401c", "dmtx401s" };
|
||||||
// Auto = 99
|
}
|
||||||
//}
|
|
||||||
}
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var type = dc.Type.ToLower();
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new DM-TX Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject
|
||||||
|
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user