mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 20:47:04 +00:00
Merge branch 'development' into feature/C3ComIBridgeAdvanced
# Conflicts: # essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs
This commit is contained in:
commit
cfb3906427
72 changed files with 1666 additions and 1248 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
[submodule "essentials-framework/pepperdashcore-builds"]
|
[submodule "essentials-framework/pepperdashcore-builds"]
|
||||||
path = essentials-framework/pepperdashcore-builds
|
path = essentials-framework/pepperdashcore-builds
|
||||||
url = https://github.com/ndorin/PepperDashCore-Builds.git
|
url = https://github.com/ndorin/PepperDashCore-Builds.git
|
||||||
|
[submodule "Essentials-Template-UI"]
|
||||||
|
path = Essentials-Template-UI
|
||||||
|
url = https://github.com/PepperDash/Essentials-Template-UI.git
|
||||||
|
|
|
||||||
1
Essentials-Template-UI
Submodule
1
Essentials-Template-UI
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 8eaf88791b42318fbe7c64402af46d747516e4fa
|
||||||
|
|
@ -21,7 +21,7 @@ using PepperDash.Essentials.AppServer.Messengers;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class MobileControlSystemController : Device
|
public class MobileControlSystemController : EssentialsDevice
|
||||||
{
|
{
|
||||||
WebSocketClient WSClient;
|
WebSocketClient WSClient;
|
||||||
|
|
||||||
|
|
@ -865,4 +865,20 @@ namespace PepperDash.Essentials
|
||||||
CrestronConsole.ConsoleCommandResponse("Usage: mobilehttprequest:N get/post url\r");
|
CrestronConsole.ConsoleCommandResponse("Usage: mobilehttprequest:N get/post url\r");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MobileControlSystemControllerFactory : EssentialsDeviceFactory<MobileControlSystemController>
|
||||||
|
{
|
||||||
|
public MobileControlSystemControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "appserver" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new MobileControlSystemController Device");
|
||||||
|
var props = JsonConvert.DeserializeObject<MobileControlConfig>(dc.Properties.ToString());
|
||||||
|
return new MobileControlSystemController(dc.Key, dc.Name, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -12,7 +12,7 @@ namespace PepperDash.Essentials
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class MobileControlBridgeBase: Device
|
public abstract class MobileControlBridgeBase: EssentialsDevice
|
||||||
{
|
{
|
||||||
public MobileControlSystemController Parent { get; private set; }
|
public MobileControlSystemController Parent { get; private set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -825,4 +825,35 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||||
EISC.StringInput[JoinMap.ServerUrl.JoinNumber].StringValue = Parent.Config.ClientAppUrl;
|
EISC.StringInput[JoinMap.ServerUrl.JoinNumber].StringValue = Parent.Config.ClientAppUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MobileControlSIMPLRoomBridgeFactory : EssentialsDeviceFactory<MobileControlSIMPLRoomBridge>
|
||||||
|
{
|
||||||
|
public MobileControlSIMPLRoomBridgeFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "mobilecontrolbridge-ddvc01", "mobilecontrolbridge-simpl" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new MobileControlSIMPLRoomBridge Device");
|
||||||
|
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
|
||||||
|
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlSIMPLRoomBridge(dc.Key, dc.Name, comm.IpIdInt);
|
||||||
|
bridge.AddPreActivationAction(() =>
|
||||||
|
{
|
||||||
|
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
||||||
|
if (parent == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
|
||||||
|
}
|
||||||
|
Debug.Console(0, bridge, "Linking to parent controller");
|
||||||
|
bridge.AddParent(parent);
|
||||||
|
parent.AddBridge(bridge);
|
||||||
|
});
|
||||||
|
|
||||||
|
return bridge;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -16,25 +16,21 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Responsible for loading all of the device types for this library
|
||||||
|
/// </summary>
|
||||||
public class BridgeFactory
|
public class BridgeFactory
|
||||||
{
|
{
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
public BridgeFactory()
|
||||||
{
|
{
|
||||||
// ? why is this static JTA 2018-06-13?
|
var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
|
||||||
|
eiscApiAdvancedFactory.LoadTypeFactories();
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
|
||||||
|
eiscApiFactory.LoadTypeFactories();
|
||||||
//Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
|
|
||||||
|
|
||||||
if (typeName == "eiscapiadv" || typeName == "eiscapiadvanced")
|
|
||||||
{
|
|
||||||
return new EiscApiAdvanced(dc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return typeName == "eiscapi" ? new EiscApi(dc) : null;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class CommBridge : Device
|
public class CommBridge : Device
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -56,129 +56,19 @@ namespace PepperDash.Essentials.Bridges
|
||||||
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
||||||
|
|
||||||
var advDev = device as IBridgeAdvanced;
|
var advDev = device as IBridgeAdvanced;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
advDev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, null);
|
advDev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, null);
|
||||||
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
}
|
||||||
//{
|
catch (NullReferenceException)
|
||||||
// var bridge = device as IBridge;
|
{
|
||||||
|
Debug.ConsoleWithLog(0, this,
|
||||||
|
"Please update the bridge config to use EiscBridgeAdvanced with this device: {0}", device.Key);
|
||||||
|
}
|
||||||
|
|
||||||
// if (bridge == null)
|
|
||||||
// continue;
|
|
||||||
// Debug.Console(2, this, "Linking device {0} as IBridge");
|
|
||||||
// bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (!device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced))) continue;
|
|
||||||
|
|
||||||
//var bridgeAdvanced = device as IBridgeAdvanced;
|
|
||||||
|
|
||||||
//if (bridgeAdvanced == null) continue;
|
|
||||||
//Debug.Console(2, this, "Linking device {0} as IBridgeAdvanced");
|
|
||||||
//bridgeAdvanced.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
|
||||||
}
|
}
|
||||||
Debug.Console(1, this, "Devices Linked.");
|
Debug.Console(1, this, "Devices Linked.");
|
||||||
//
|
|
||||||
//else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
|
||||||
//{
|
|
||||||
// (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is GenericComm)
|
|
||||||
//{
|
|
||||||
// (device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is CameraBase)
|
|
||||||
//{
|
|
||||||
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is PepperDash.Essentials.Core.DisplayBase)
|
|
||||||
//{
|
|
||||||
// (device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmChassisController)
|
|
||||||
//{
|
|
||||||
// (device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmBladeChassisController)
|
|
||||||
//{
|
|
||||||
// (device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmpsRoutingController)
|
|
||||||
//{
|
|
||||||
// (device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmpsAudioOutputController)
|
|
||||||
//{
|
|
||||||
// (device as DmpsAudioOutputController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmTxControllerBase)
|
|
||||||
//{
|
|
||||||
// (device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmRmcControllerBase)
|
|
||||||
//{
|
|
||||||
// (device as DmRmcControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is GenericRelayDevice)
|
|
||||||
//{
|
|
||||||
// (device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is IRSetTopBoxBase)
|
|
||||||
//{
|
|
||||||
// (device as IRSetTopBoxBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is IDigitalInput)
|
|
||||||
//{
|
|
||||||
// (device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is AppleTV)
|
|
||||||
//{
|
|
||||||
// (device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is HdMdxxxCEController)
|
|
||||||
//{
|
|
||||||
// (device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is LightingBase)
|
|
||||||
//{
|
|
||||||
// (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DigitalLogger)
|
|
||||||
//{
|
|
||||||
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController)
|
|
||||||
//{
|
|
||||||
// (device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is StatusSignController)
|
|
||||||
//{
|
|
||||||
// (device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is C2nRthsController)
|
|
||||||
//{
|
|
||||||
// (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -323,4 +213,20 @@ namespace PepperDash.Essentials.Bridges
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EiscApiFactory : EssentialsDeviceFactory<EiscApiAdvanced>
|
||||||
|
{
|
||||||
|
public EiscApiFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "eiscapi" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new EiscApi Device");
|
||||||
|
|
||||||
|
return new EiscApi(dc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -81,12 +81,11 @@ namespace PepperDash.Essentials
|
||||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
|
|
||||||
if (!Debug.DoNotLoadOnNextBoot)
|
if (!Debug.DoNotLoadOnNextBoot)
|
||||||
GoWithLoad();
|
GoWithLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if the program is running on a processor (appliance) or server (VC-4).
|
/// Determines if the program is running on a processor (appliance) or server (VC-4).
|
||||||
///
|
///
|
||||||
|
|
@ -165,10 +164,15 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
Debug.SetDoNotLoadOnNextBoot(false);
|
Debug.SetDoNotLoadOnNextBoot(false);
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
|
|
||||||
|
|
||||||
PluginLoader.AddProgramAssemblies();
|
PluginLoader.AddProgramAssemblies();
|
||||||
|
|
||||||
|
new Core.DeviceFactory();
|
||||||
|
new Devices.Common.DeviceFactory();
|
||||||
|
new DM.DeviceFactory();
|
||||||
|
new DeviceFactory();
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
|
||||||
|
|
||||||
var filesReady = SetupFilesystem();
|
var filesReady = SetupFilesystem();
|
||||||
if (filesReady)
|
if (filesReady)
|
||||||
{
|
{
|
||||||
|
|
@ -291,9 +295,6 @@ namespace PepperDash.Essentials
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void LoadDevices()
|
public void LoadDevices()
|
||||||
{
|
{
|
||||||
// Instantiate the Device Factories
|
|
||||||
new CoreDeviceFactory();
|
|
||||||
|
|
||||||
|
|
||||||
// Build the processor wrapper class
|
// Build the processor wrapper class
|
||||||
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
|
||||||
|
|
@ -357,33 +358,15 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try local factories first
|
// Try local factories first
|
||||||
var newDev = DeviceFactory.GetDevice(devConf);
|
IKeyed newDev = null;
|
||||||
|
|
||||||
if (newDev == null)
|
|
||||||
newDev = BridgeFactory.GetDevice(devConf);
|
|
||||||
|
|
||||||
// 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)
|
|
||||||
newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
|
|
||||||
if (newDev == null)
|
|
||||||
newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
|
|
||||||
if (newDev == null)
|
|
||||||
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
|
||||||
|
|
||||||
//if (newDev == null) // might want to consider the ability to override an essentials "type"
|
//
|
||||||
//{
|
//if (newDev == null)
|
||||||
// // iterate plugin factories
|
// newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
||||||
// foreach (var f in FactoryObjects)
|
//
|
||||||
// {
|
|
||||||
// var cresFactory = f as IGetCrestronDevice;
|
|
||||||
// if (cresFactory != null)
|
|
||||||
// {
|
|
||||||
// newDev = cresFactory.GetDevice(devConf, this);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (newDev != null)
|
if (newDev != null)
|
||||||
DeviceManager.AddDevice(newDev);
|
DeviceManager.AddDevice(newDev);
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@ using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class Amplifier : Device, IRoutingSinkNoSwitching
|
public class Amplifier : EssentialsDevice, IRoutingSinkNoSwitching
|
||||||
{
|
{
|
||||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||||
|
|
||||||
|
|
@ -54,4 +55,18 @@ namespace PepperDash.Essentials
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AmplifierFactory : EssentialsDeviceFactory<Amplifier>
|
||||||
|
{
|
||||||
|
public AmplifierFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "amplifier" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Amplifier Device");
|
||||||
|
return new Amplifier(dc.Key, dc.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,94 +4,45 @@ using System.Linq;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Room.MobileControl;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Responsible for loading all of the device types for this library
|
||||||
|
/// </summary>
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
{
|
{
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
|
||||||
|
public DeviceFactory()
|
||||||
{
|
{
|
||||||
var key = dc.Key;
|
var assy = Assembly.GetExecutingAssembly();
|
||||||
var name = dc.Name;
|
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
||||||
var type = dc.Type;
|
|
||||||
var properties = dc.Properties;
|
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
||||||
|
|
||||||
if (typeName == "amplifier")
|
if (types != null)
|
||||||
{
|
{
|
||||||
return new Amplifier(dc.Key, dc.Name);
|
foreach (var type in types)
|
||||||
}
|
|
||||||
else if (dc.Group.ToLower() == "touchpanel") // typeName.StartsWith("tsw"))
|
|
||||||
{
|
{
|
||||||
return UiDeviceFactory.GetUiDevice(dc);
|
try
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "mockdisplay")
|
|
||||||
{
|
{
|
||||||
return new MockDisplay(key, name);
|
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||||
|
factory.LoadTypeFactories();
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
else if (typeName == "generic")
|
|
||||||
{
|
{
|
||||||
return new Device(key, name);
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//// MOVE into something else???
|
}
|
||||||
//else if (typeName == "basicirdisplay")
|
|
||||||
//{
|
|
||||||
// var ir = IRPortHelper.GetIrPort(properties);
|
|
||||||
// if (ir != null)
|
|
||||||
// return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
|
|
||||||
//}
|
|
||||||
|
|
||||||
else if (typeName == "commmock")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
var props = JsonConvert.DeserializeObject<ConsoleCommMockDevicePropertiesConfig>(
|
|
||||||
properties.ToString());
|
|
||||||
return new ConsoleCommMockDevice(key, name, props, comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "appserver")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<MobileControlConfig>(properties.ToString());
|
|
||||||
return new MobileControlSystemController(key, name, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "mobilecontrolbridge-ddvc01")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
|
|
||||||
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlSIMPLRoomBridge(key, name, comm.IpIdInt);
|
|
||||||
bridge.AddPreActivationAction(() =>
|
|
||||||
{
|
|
||||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
|
||||||
if (parent == null)
|
|
||||||
{
|
|
||||||
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
|
|
||||||
}
|
|
||||||
Debug.Console(0, bridge, "Linking to parent controller");
|
|
||||||
bridge.AddParent(parent);
|
|
||||||
parent.AddBridge(bridge);
|
|
||||||
});
|
|
||||||
|
|
||||||
return bridge;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "roomonwhenoccupancydetectedfeature")
|
|
||||||
{
|
|
||||||
return new RoomOnToDefaultSourceWhenOccupied(dc);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,191 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharpPro;
|
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
|
||||||
using Crestron.SimplSharpPro.UI;
|
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using PepperDash.Core;
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using PepperDash.Essentials.Core.Config;
|
|
||||||
using PepperDash.Essentials.Core.PageManagers;
|
|
||||||
using PepperDash.Essentials.DM.Endpoints.DGEs;
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
|
||||||
{
|
|
||||||
public class UiDeviceFactory
|
|
||||||
{
|
|
||||||
public static IKeyed GetUiDevice(DeviceConfig config)
|
|
||||||
{
|
|
||||||
var comm = CommFactory.GetControlPropertiesConfig(config);
|
|
||||||
|
|
||||||
var typeName = config.Type.ToLower();
|
|
||||||
|
|
||||||
EssentialsTouchpanelController panelController = null;
|
|
||||||
|
|
||||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(config.Properties.ToString());
|
|
||||||
|
|
||||||
if (typeName.Contains("dge"))
|
|
||||||
{
|
|
||||||
Dge100 dgeDevice = null;
|
|
||||||
if (typeName == "dge100")
|
|
||||||
dgeDevice = new Dge100(comm.IpIdInt, Global.ControlSystem);
|
|
||||||
else 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 DgeController(config.Key + "-comPorts", config.Name, dgeDevice, config, props);
|
|
||||||
|
|
||||||
DeviceManager.AddDevice(dgeController);
|
|
||||||
|
|
||||||
panelController = new EssentialsTouchpanelController(config.Key, config.Name, dgeController.DigitalGraphicsEngine,
|
|
||||||
props.ProjectName, props.SgdFile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
panelController = new EssentialsTouchpanelController(config.Key, config.Name, config.Type, props, comm.IpIdInt);
|
|
||||||
}
|
|
||||||
|
|
||||||
panelController.AddPostActivationAction(() =>
|
|
||||||
{
|
|
||||||
var mainDriver = new EssentialsPanelMainInterfaceDriver(panelController.Panel, props);
|
|
||||||
// Then the sub drivers
|
|
||||||
|
|
||||||
// spin up different room drivers depending on room type
|
|
||||||
var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
|
|
||||||
if (room is EssentialsHuddleSpaceRoom)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Header Driver
|
|
||||||
Debug.Console(0, panelController, "Adding header driver");
|
|
||||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
|
||||||
|
|
||||||
// AV Driver
|
|
||||||
Debug.Console(0, panelController, "Adding huddle space AV driver");
|
|
||||||
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
|
|
||||||
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
|
||||||
mainDriver.AvDriver = avDriver;
|
|
||||||
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
|
|
||||||
|
|
||||||
// Environment Driver
|
|
||||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
|
||||||
{
|
|
||||||
Debug.Console(0, panelController, "Adding environment driver");
|
|
||||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
|
||||||
|
|
||||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
|
||||||
}
|
|
||||||
|
|
||||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
|
||||||
|
|
||||||
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
|
||||||
|
|
||||||
if (panelController.Panel is TswFt5ButtonSystem)
|
|
||||||
{
|
|
||||||
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
|
||||||
// Wire up hard keys
|
|
||||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
|
|
||||||
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
|
||||||
if(mainDriver.EnvironmentDriver != null)
|
|
||||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
|
||||||
{
|
|
||||||
if (!b)
|
|
||||||
{
|
|
||||||
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
|
||||||
mainDriver.EnvironmentDriver.Toggle();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
|
||||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//else if (room is EssentialsPresentationRoom)
|
|
||||||
//{
|
|
||||||
// Debug.Console(0, panelController, "Adding presentation room driver");
|
|
||||||
// var avDriver = new EssentialsPresentationPanelAvFunctionsDriver(mainDriver, props);
|
|
||||||
// avDriver.CurrentRoom = room as EssentialsPresentationRoom;
|
|
||||||
// avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
|
||||||
// mainDriver.AvDriver = avDriver ;
|
|
||||||
// mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
|
||||||
// panelController.LoadAndShowDriver(mainDriver);
|
|
||||||
|
|
||||||
// if (panelController.Panel is TswFt5ButtonSystem)
|
|
||||||
// {
|
|
||||||
// var tsw = panelController.Panel as TswFt5ButtonSystem;
|
|
||||||
// // Wire up hard keys
|
|
||||||
// tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
|
|
||||||
// //tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
|
||||||
// tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
|
||||||
// tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
else if (room is EssentialsHuddleVtc1Room)
|
|
||||||
{
|
|
||||||
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
|
|
||||||
|
|
||||||
// Header Driver
|
|
||||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
|
||||||
|
|
||||||
// AV Driver
|
|
||||||
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
|
|
||||||
|
|
||||||
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
|
|
||||||
(room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
|
|
||||||
avDriver.SetVideoCodecDriver(codecDriver);
|
|
||||||
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
|
||||||
mainDriver.AvDriver = avDriver;
|
|
||||||
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
|
|
||||||
|
|
||||||
// Environment Driver
|
|
||||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
|
||||||
{
|
|
||||||
Debug.Console(0, panelController, "Adding environment driver");
|
|
||||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
|
||||||
|
|
||||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
|
||||||
}
|
|
||||||
|
|
||||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
|
||||||
|
|
||||||
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
|
||||||
|
|
||||||
if (panelController.Panel is TswFt5ButtonSystem)
|
|
||||||
{
|
|
||||||
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
|
||||||
// Wire up hard keys
|
|
||||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
|
|
||||||
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
|
||||||
if (mainDriver.EnvironmentDriver != null)
|
|
||||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
|
||||||
{
|
|
||||||
if (!b)
|
|
||||||
{
|
|
||||||
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
|
||||||
mainDriver.EnvironmentDriver.Toggle();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
|
||||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(0, panelController, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return panelController;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -151,7 +151,6 @@
|
||||||
<Compile Include="Factory\DeviceFactory.cs" />
|
<Compile Include="Factory\DeviceFactory.cs" />
|
||||||
<Compile Include="Devices\Amplifier.cs" />
|
<Compile Include="Devices\Amplifier.cs" />
|
||||||
<Compile Include="ControlSystem.cs" />
|
<Compile Include="ControlSystem.cs" />
|
||||||
<Compile Include="Factory\UiDeviceFactory.cs" />
|
|
||||||
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.UI;
|
using Crestron.SimplSharpPro.UI;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.PageManagers;
|
using PepperDash.Essentials.Core.PageManagers;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
public class EssentialsTouchpanelController : Device, IHasBasicTriListWithSmartObject
|
public class EssentialsTouchpanelController : EssentialsDevice, IHasBasicTriListWithSmartObject
|
||||||
{
|
{
|
||||||
public BasicTriListWithSmartObject Panel { get; private set; }
|
public BasicTriListWithSmartObject Panel { get; private set; }
|
||||||
|
|
||||||
|
|
@ -197,4 +198,132 @@ namespace PepperDash.Essentials
|
||||||
(uo as Action<bool>)(args.Button.State == eButtonState.Pressed);
|
(uo as Action<bool>)(args.Button.State == eButtonState.Pressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EssentialsTouchpanelControllerFactory : EssentialsDeviceFactory<EssentialsTouchpanelController>
|
||||||
|
{
|
||||||
|
public EssentialsTouchpanelControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "tsw550", "tsw750", "tsw1050", "tsw560", "tsw760", "tsw1060", "xpanel" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||||
|
|
||||||
|
var panelController = new EssentialsTouchpanelController(dc.Key, dc.Name, dc.Type, props, comm.IpIdInt);
|
||||||
|
|
||||||
|
panelController.AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
var mainDriver = new EssentialsPanelMainInterfaceDriver(panelController.Panel, props);
|
||||||
|
// Then the sub drivers
|
||||||
|
|
||||||
|
// spin up different room drivers depending on room type
|
||||||
|
var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
|
||||||
|
if (room is EssentialsHuddleSpaceRoom)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Header Driver
|
||||||
|
Debug.Console(0, panelController, "Adding header driver");
|
||||||
|
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||||
|
|
||||||
|
// AV Driver
|
||||||
|
Debug.Console(0, panelController, "Adding huddle space AV driver");
|
||||||
|
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
|
||||||
|
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||||
|
mainDriver.AvDriver = avDriver;
|
||||||
|
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
|
||||||
|
|
||||||
|
// Environment Driver
|
||||||
|
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||||
|
{
|
||||||
|
Debug.Console(0, panelController, "Adding environment driver");
|
||||||
|
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
||||||
|
|
||||||
|
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||||
|
}
|
||||||
|
|
||||||
|
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||||
|
|
||||||
|
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
||||||
|
|
||||||
|
if (panelController.Panel is TswFt5ButtonSystem)
|
||||||
|
{
|
||||||
|
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||||
|
// Wire up hard keys
|
||||||
|
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
|
||||||
|
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||||
|
if (mainDriver.EnvironmentDriver != null)
|
||||||
|
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||||
|
{
|
||||||
|
if (!b)
|
||||||
|
{
|
||||||
|
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
||||||
|
mainDriver.EnvironmentDriver.Toggle();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||||
|
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (room is EssentialsHuddleVtc1Room)
|
||||||
|
{
|
||||||
|
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
|
||||||
|
|
||||||
|
// Header Driver
|
||||||
|
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||||
|
|
||||||
|
// AV Driver
|
||||||
|
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
|
||||||
|
|
||||||
|
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
|
||||||
|
(room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
|
||||||
|
avDriver.SetVideoCodecDriver(codecDriver);
|
||||||
|
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||||
|
mainDriver.AvDriver = avDriver;
|
||||||
|
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
|
||||||
|
|
||||||
|
// Environment Driver
|
||||||
|
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||||
|
{
|
||||||
|
Debug.Console(0, panelController, "Adding environment driver");
|
||||||
|
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
||||||
|
|
||||||
|
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||||
|
}
|
||||||
|
|
||||||
|
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||||
|
|
||||||
|
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
||||||
|
|
||||||
|
if (panelController.Panel is TswFt5ButtonSystem)
|
||||||
|
{
|
||||||
|
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||||
|
// Wire up hard keys
|
||||||
|
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
|
||||||
|
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||||
|
if (mainDriver.EnvironmentDriver != null)
|
||||||
|
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||||
|
{
|
||||||
|
if (!b)
|
||||||
|
{
|
||||||
|
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
||||||
|
mainDriver.EnvironmentDriver.Toggle();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||||
|
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, panelController, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return panelController;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -110,139 +110,16 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
if (device == null) continue;
|
if (device == null) continue;
|
||||||
|
|
||||||
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
|
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
|
||||||
/*if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
//if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
||||||
|
//{
|
||||||
|
// Debug.Console(2, this, "'{0}' is IBridge", device.Key);
|
||||||
|
//}
|
||||||
|
if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced)))
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "'{0}' is IBridge", device.Key);
|
var bridge = device as IBridgeAdvanced;
|
||||||
|
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||||
var dev = device as IBridge;
|
}
|
||||||
|
|
||||||
dev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
}*/
|
|
||||||
if (!(device is IBridgeAdvanced)) continue;
|
|
||||||
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
|
||||||
(device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
|
||||||
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
|
||||||
//{
|
|
||||||
// var bridge = device as IBridge;
|
|
||||||
|
|
||||||
// if (bridge == null)
|
|
||||||
// continue;
|
|
||||||
// Debug.Console(2, this, "Linking device {0} as IBridge");
|
|
||||||
// bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (!device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced))) continue;
|
|
||||||
|
|
||||||
//var bridgeAdvanced = device as IBridgeAdvanced;
|
|
||||||
|
|
||||||
//if (bridgeAdvanced == null) continue;
|
|
||||||
//Debug.Console(2, this, "Linking device {0} as IBridgeAdvanced");
|
|
||||||
//bridgeAdvanced.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
|
||||||
}
|
}
|
||||||
Debug.Console(1, this, "Devices Linked.");
|
|
||||||
//
|
|
||||||
//else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
|
||||||
//{
|
|
||||||
// (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is GenericComm)
|
|
||||||
//{
|
|
||||||
// (device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is CameraBase)
|
|
||||||
//{
|
|
||||||
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is PepperDash.Essentials.Core.DisplayBase)
|
|
||||||
//{
|
|
||||||
// (device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmChassisController)
|
|
||||||
//{
|
|
||||||
// (device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmBladeChassisController)
|
|
||||||
//{
|
|
||||||
// (device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmpsRoutingController)
|
|
||||||
//{
|
|
||||||
// (device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmpsAudioOutputController)
|
|
||||||
//{
|
|
||||||
// (device as DmpsAudioOutputController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmTxControllerBase)
|
|
||||||
//{
|
|
||||||
// (device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DmRmcControllerBase)
|
|
||||||
//{
|
|
||||||
// (device as DmRmcControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is GenericRelayDevice)
|
|
||||||
//{
|
|
||||||
// (device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is IRSetTopBoxBase)
|
|
||||||
//{
|
|
||||||
// (device as IRSetTopBoxBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is IDigitalInput)
|
|
||||||
//{
|
|
||||||
// (device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is AppleTV)
|
|
||||||
//{
|
|
||||||
// (device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is HdMdxxxCEController)
|
|
||||||
//{
|
|
||||||
// (device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is LightingBase)
|
|
||||||
//{
|
|
||||||
// (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is DigitalLogger)
|
|
||||||
//{
|
|
||||||
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController)
|
|
||||||
//{
|
|
||||||
// (device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is StatusSignController)
|
|
||||||
//{
|
|
||||||
// (device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//else if (device is C2nRthsController)
|
|
||||||
//{
|
|
||||||
// (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
// continue;
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -411,5 +288,20 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EiscApiAdvancedFactory : EssentialsDeviceFactory<EiscApiAdvanced>
|
||||||
|
{
|
||||||
|
public EiscApiAdvancedFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "eiscapiadv", "eiscapiadvanced" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device");
|
||||||
|
|
||||||
|
return new EiscApiAdvanced(dc);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -5,10 +5,12 @@ using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
public class ConsoleCommMockDevice : Device, ICommunicationMonitor
|
public class ConsoleCommMockDevice : EssentialsDevice, ICommunicationMonitor
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
public CommunicationGather PortGather { get; private set; }
|
public CommunicationGather PortGather { get; private set; }
|
||||||
|
|
@ -71,4 +73,21 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ConsoleCommMockDeviceFactory : EssentialsDeviceFactory<ConsoleCommMockDevice>
|
||||||
|
{
|
||||||
|
public ConsoleCommMockDeviceFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "commmock" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Comm Mock Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<ConsoleCommMockDevicePropertiesConfig>(
|
||||||
|
dc.Properties.ToString());
|
||||||
|
return new ConsoleCommMockDevice(dc.Key, dc.Name, props, comm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -15,6 +15,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
|
/// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Generic communication wrapper class for any IBasicCommunication type")]
|
||||||
public class GenericComm : ReconfigurableBridgableDevice
|
public class GenericComm : ReconfigurableBridgableDevice
|
||||||
{
|
{
|
||||||
EssentialsControlPropertiesConfig PropertiesConfig;
|
EssentialsControlPropertiesConfig PropertiesConfig;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +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
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for the C2N-RTHS sensor")]
|
||||||
public class C2nRthsController : CrestronGenericBridgeableBaseDevice
|
public class C2nRthsController : CrestronGenericBridgeableBaseDevice
|
||||||
{
|
{
|
||||||
private readonly C2nRths _device;
|
private readonly C2nRths _device;
|
||||||
|
|
@ -65,4 +69,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
trilist.StringInput[joinMap.Name].StringValue = Name;
|
trilist.StringInput[joinMap.Name].StringValue = Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class C2nRthsControllerFactory : EssentialsDeviceFactory<C2nRthsController>
|
||||||
|
{
|
||||||
|
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,8 @@ 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
|
[Description("Wrapper class for the CEN-IO-DIGIN-104 diginal input module")]
|
||||||
|
public class CenIoDigIn104Controller : EssentialsDevice, IDigitalInputPorts
|
||||||
{
|
{
|
||||||
public CenIoDi104 Di104 { get; private set; }
|
public CenIoDi104 Di104 { get; private set; }
|
||||||
|
|
||||||
|
|
@ -37,4 +40,23 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CenIoDigIn104ControllerFactory : EssentialsDeviceFactory<CenIoDigIn104Controller>
|
||||||
|
{
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,8 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
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
|
||||||
{
|
{
|
||||||
|
|
@ -66,4 +68,95 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GenericDigitalInputDeviceFactory : EssentialsDeviceFactory<GenericDigitalInputDevice>
|
||||||
|
{
|
||||||
|
public GenericDigitalInputDeviceFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "digitalinput" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Digtal Input Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
IDigitalInputPorts portDevice;
|
||||||
|
|
||||||
|
if (props.PortDeviceKey == "processor")
|
||||||
|
portDevice = Global.ControlSystem as IDigitalInputPorts;
|
||||||
|
else
|
||||||
|
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IDigitalInputPorts;
|
||||||
|
|
||||||
|
if (portDevice == null)
|
||||||
|
Debug.Console(0, "ERROR: Unable to add digital input device with key '{0}'. Port Device does not support digital inputs", dc.Key);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var cs = (portDevice as CrestronControlSystem);
|
||||||
|
if (cs == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "ERROR: Port device for [{0}] is not control system", props.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cs.SupportsVersiport)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Attempting to add Digital Input device to Versiport port '{0}'", props.PortNumber);
|
||||||
|
|
||||||
|
if (props.PortNumber > cs.NumberOfVersiPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "WARNING: Cannot add Vesiport {0} on {1}. Out of range",
|
||||||
|
props.PortNumber, props.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Versiport vp = cs.VersiPorts[props.PortNumber];
|
||||||
|
|
||||||
|
if (!vp.Registered)
|
||||||
|
{
|
||||||
|
var regSuccess = vp.Register();
|
||||||
|
if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Successfully Created Digital Input Device on Versiport");
|
||||||
|
return new GenericVersiportDigitalInputDevice(dc.Key, vp, props);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed: {2}",
|
||||||
|
props.PortNumber, props.PortDeviceKey, regSuccess);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (cs.SupportsDigitalInput)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Attempting to add Digital Input device to Digital Input port '{0}'", props.PortNumber);
|
||||||
|
|
||||||
|
if (props.PortNumber > cs.NumberOfDigitalInputPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "WARNING: Cannot register DIO port {0} on {1}. Out of range",
|
||||||
|
props.PortNumber, props.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
|
||||||
|
|
||||||
|
if (!digitalInput.Registered)
|
||||||
|
{
|
||||||
|
if (digitalInput.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Successfully Created Digital Input Device on Digital Input");
|
||||||
|
return new GenericDigitalInputDevice(dc.Key, digitalInput);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, "WARNING: Attempt to register digital input {0} on device with key '{1}' failed.",
|
||||||
|
props.PortNumber, props.PortDeviceKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a generic digital input deviced tied to a versiport
|
/// Represents a generic digital input deviced tied to a versiport
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GenericVersiportDigitalInputDevice : Device, IDigitalInput
|
public class GenericVersiportDigitalInputDevice : EssentialsDevice, IDigitalInput
|
||||||
{
|
{
|
||||||
public Versiport InputPort { get; private set; }
|
public Versiport InputPort { get; private set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
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
|
||||||
{
|
{
|
||||||
|
|
@ -100,4 +101,74 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay]);
|
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GenericRelayDeviceFactory : EssentialsDeviceFactory<GenericRelayDevice>
|
||||||
|
{
|
||||||
|
public GenericRelayDeviceFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "relayoutput" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Relay Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||||
|
var key = dc.Key;
|
||||||
|
|
||||||
|
IRelayPorts portDevice;
|
||||||
|
|
||||||
|
if (props.PortDeviceKey == "processor")
|
||||||
|
portDevice = Global.ControlSystem as IRelayPorts;
|
||||||
|
else
|
||||||
|
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IRelayPorts;
|
||||||
|
|
||||||
|
if (portDevice == null)
|
||||||
|
Debug.Console(0, "Unable to add relay device with key '{0}'. Port Device does not support relays", key);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var cs = (portDevice as CrestronControlSystem);
|
||||||
|
|
||||||
|
if (cs != null)
|
||||||
|
{
|
||||||
|
// The relay is on a control system processor
|
||||||
|
if (!cs.SupportsRelay || props.PortNumber > cs.NumberOfRelayPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Port Device: {0} does not support relays or does not have enough relays");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// The relay is on another device type
|
||||||
|
|
||||||
|
if (props.PortNumber > portDevice.NumberOfRelayPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Port Device: {0} does not have enough relays");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Relay relay = portDevice.RelayPorts[props.PortNumber];
|
||||||
|
|
||||||
|
if (!relay.Registered)
|
||||||
|
{
|
||||||
|
if (relay.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
|
return new GenericRelayDevice(key, relay);
|
||||||
|
else
|
||||||
|
Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new GenericRelayDevice(key, relay);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future: Check if portDevice is 3-series card or other non control system that supports versiports
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +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
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for the Crestron StatusSign device")]
|
||||||
public class StatusSignController : CrestronGenericBridgeableBaseDevice
|
public class StatusSignController : CrestronGenericBridgeableBaseDevice
|
||||||
{
|
{
|
||||||
private readonly StatusSign _device;
|
private readonly StatusSign _device;
|
||||||
|
|
@ -158,4 +161,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class StatusSignControllerFactory : EssentialsDeviceFactory<StatusSignController>
|
||||||
|
{
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
@ -12,6 +13,7 @@ namespace PepperDash.Essentials.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines the basic needs for an EssentialsDevice to enable it to be build by an IDeviceFactory class
|
/// Defines the basic needs for an EssentialsDevice to enable it to be build by an IDeviceFactory class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("The base Essentials Device Class")]
|
||||||
public abstract class EssentialsDevice : Device
|
public abstract class EssentialsDevice : Device
|
||||||
{
|
{
|
||||||
protected EssentialsDevice(string key)
|
protected EssentialsDevice(string key)
|
||||||
|
|
@ -27,6 +29,40 @@ namespace PepperDash.Essentials.Core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
|
||||||
|
public class DescriptionAttribute : Attribute
|
||||||
|
{
|
||||||
|
private string _Description;
|
||||||
|
|
||||||
|
public DescriptionAttribute(string description)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Setting Description: {0}", description);
|
||||||
|
_Description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Description
|
||||||
|
{
|
||||||
|
get { return _Description; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
|
||||||
|
public class ConfigSnippetAttribute : Attribute
|
||||||
|
{
|
||||||
|
private string _ConfigSnippet;
|
||||||
|
|
||||||
|
public ConfigSnippetAttribute(string configSnippet)
|
||||||
|
{
|
||||||
|
Debug.Console(2, "Setting Description {0}", configSnippet);
|
||||||
|
_ConfigSnippet = configSnippet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ConfigSnippet
|
||||||
|
{
|
||||||
|
get { return _ConfigSnippet; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Devices the basic needs for a Device Factory
|
/// Devices the basic needs for a Device Factory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -46,7 +82,10 @@ namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
foreach (var typeName in TypeNames)
|
foreach (var typeName in TypeNames)
|
||||||
{
|
{
|
||||||
DeviceFactory.AddFactoryForType(typeName, BuildDevice);
|
Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
||||||
|
var attributes = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
|
||||||
|
string description = attributes[0].Description;
|
||||||
|
DeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
|
@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class InRoomPc : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
|
public class InRoomPc : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
|
||||||
{
|
{
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
||||||
public string IconName { get; set; }
|
public string IconName { get; set; }
|
||||||
|
|
@ -63,4 +64,19 @@ namespace PepperDash.Essentials.Core.Devices
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class InRoomPcFactory : EssentialsDeviceFactory<InRoomPc>
|
||||||
|
{
|
||||||
|
public InRoomPcFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "inroompc" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new InRoomPc Device");
|
||||||
|
return new InRoomPc(dc.Key, dc.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
|
@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Laptop : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
|
public class Laptop : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
|
||||||
{
|
{
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
||||||
public string IconName { get; set; }
|
public string IconName { get; set; }
|
||||||
|
|
@ -63,4 +64,18 @@ namespace PepperDash.Essentials.Core.Devices
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LaptopFactory : EssentialsDeviceFactory<Laptop>
|
||||||
|
{
|
||||||
|
public LaptopFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "laptop" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Laptop Device");
|
||||||
|
return new Core.Devices.Laptop(dc.Key, dc.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
|
|
@ -208,4 +209,27 @@ namespace PepperDash.Essentials.Core
|
||||||
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class BasicIrDisplayFactory : EssentialsDeviceFactory<BasicIrDisplay>
|
||||||
|
{
|
||||||
|
public BasicIrDisplayFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "basicirdisplay" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new BasicIrDisplay Device");
|
||||||
|
var ir = IRPortHelper.GetIrPort(dc.Properties);
|
||||||
|
if (ir != null)
|
||||||
|
{
|
||||||
|
var display = new BasicIrDisplay(dc.Key, dc.Name, ir.Port, ir.FileName);
|
||||||
|
display.IrPulseTime = 200; // Set default pulse time for IR commands.
|
||||||
|
return display;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -12,7 +12,7 @@ using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
|
@ -182,4 +182,19 @@ namespace PepperDash.Essentials.Core
|
||||||
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MockDisplayFactory : EssentialsDeviceFactory<MockDisplay>
|
||||||
|
{
|
||||||
|
public MockDisplayFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "mockdisplay" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Mock Display Device");
|
||||||
|
return new MockDisplay(dc.Key, dc.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -5,35 +5,84 @@ using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.GeneralIO;
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
using PepperDash.Essentials.Core.CrestronIO.Cards;
|
|
||||||
using PepperDash.Essentials.Core.Touchpanels;
|
using PepperDash.Essentials.Core.Touchpanels;
|
||||||
using Crestron.SimplSharpPro.ThreeSeriesCards;
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
public class DeviceFactoryWrapper
|
||||||
|
{
|
||||||
|
public CType CType { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public Func<DeviceConfig, IKeyed> FactoryMethod { get; set; }
|
||||||
|
|
||||||
|
public DeviceFactoryWrapper()
|
||||||
|
{
|
||||||
|
CType = null;
|
||||||
|
Description = "Not Available";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
{
|
{
|
||||||
|
public DeviceFactory()
|
||||||
|
{
|
||||||
|
var assy = Assembly.GetExecutingAssembly();
|
||||||
|
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
||||||
|
|
||||||
|
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
||||||
|
|
||||||
|
if (types != null)
|
||||||
|
{
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||||
|
factory.LoadTypeFactories();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A dictionary of factory methods, keyed by config types, added by plugins.
|
/// A dictionary of factory methods, keyed by config types, added by plugins.
|
||||||
/// These methods are looked up and called by GetDevice in this class.
|
/// These methods are looked up and called by GetDevice in this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static Dictionary<string, Func<DeviceConfig, IKeyed>> FactoryMethods =
|
static Dictionary<string, DeviceFactoryWrapper> FactoryMethods =
|
||||||
new Dictionary<string, Func<DeviceConfig, IKeyed>>(StringComparer.OrdinalIgnoreCase);
|
new Dictionary<string, DeviceFactoryWrapper>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a plugin factory method
|
/// Adds a plugin factory method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dc"></param>
|
/// <param name="dc"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static void AddFactoryForType(string type, Func<DeviceConfig, IKeyed> method)
|
public static void AddFactoryForType(string typeName, Func<DeviceConfig, IKeyed> method)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", type);
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||||
DeviceFactory.FactoryMethods.Add(type, method);
|
DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddFactoryForType(string typeName, string description, CType cType, Func<DeviceConfig, IKeyed> method)
|
||||||
|
{
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||||
|
|
||||||
|
if(FactoryMethods.ContainsKey(typeName))
|
||||||
|
{
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to add type: '{0}'. Already exists in DeviceFactory", typeName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var wrapper = new DeviceFactoryWrapper() { CType = cType, Description = description, FactoryMethod = method };
|
||||||
|
DeviceFactory.FactoryMethods.Add(typeName, wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -55,83 +104,46 @@ namespace PepperDash.Essentials.Core
|
||||||
if (FactoryMethods.ContainsKey(typeName))
|
if (FactoryMethods.ContainsKey(typeName))
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
|
||||||
return FactoryMethods[typeName](dc);
|
return FactoryMethods[typeName].FactoryMethod(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));
|
|
||||||
}
|
|
||||||
if (typeName == "c3com3")
|
|
||||||
{
|
|
||||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
var cardSlot = control.CardSlot;
|
|
||||||
|
|
||||||
return new C3Com3Controller(key, name, new C3com3(cardSlot, Global.ControlSystem));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints the type names fromt the FactoryMethods collection.
|
/// Prints the type names and associated metadata from the FactoryMethods collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command"></param>
|
/// <param name="command"></param>
|
||||||
public static void GetDeviceFactoryTypes(string filter)
|
public static void GetDeviceFactoryTypes(string filter)
|
||||||
{
|
{
|
||||||
List<string> typeNames = new List<string>();
|
Dictionary<string, DeviceFactoryWrapper> types = new Dictionary<string, DeviceFactoryWrapper>();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(filter))
|
if (!string.IsNullOrEmpty(filter))
|
||||||
{
|
{
|
||||||
typeNames = FactoryMethods.Keys.Where(k => k.Contains(filter)).ToList();
|
types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
typeNames = FactoryMethods.Keys.ToList();
|
types = FactoryMethods;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0, "Device Types:");
|
Debug.Console(0, "Device Types:");
|
||||||
|
|
||||||
foreach (var type in typeNames)
|
foreach (var type in types.OrderBy(t => t.Key))
|
||||||
{
|
{
|
||||||
Debug.Console(0, "type: '{0}'", type);
|
var description = type.Value.Description;
|
||||||
}
|
var cType = "Not Specified by Plugin";
|
||||||
}
|
|
||||||
|
if(type.Value.CType != null)
|
||||||
|
{
|
||||||
|
cType = type.Value.CType.FullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug.Console(0,
|
||||||
/// <summary>
|
@"Type: '{0}'
|
||||||
/// Responsible for loading all of the device types
|
CType: '{1}'
|
||||||
/// </summary>
|
Description: {2}", type.Key, cType, description);
|
||||||
public class CoreDeviceFactory
|
}
|
||||||
{
|
|
||||||
public CoreDeviceFactory()
|
|
||||||
{
|
|
||||||
var genComm = new GenericCommFactory() as IDeviceFactory;
|
|
||||||
genComm.LoadTypeFactories();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
@ -15,7 +16,7 @@ namespace PepperDash.Essentials.Core
|
||||||
public interface IDeviceFactory
|
public interface IDeviceFactory
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Will be called when the plugin is loaded by Essentials. Must add any new types to the DeviceFactory using DeviceFactory.AddFactoryForType() for each new type
|
/// Loads all the types to the DeviceFactory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void LoadTypeFactories();
|
void LoadTypeFactories();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -15,7 +16,7 @@ namespace PepperDash.Essentials.Core.Privacy
|
||||||
/// Used for applications where one or more microphones with momentary contact closure outputs are used to
|
/// Used for applications where one or more microphones with momentary contact closure outputs are used to
|
||||||
/// toggle the privacy state of the room. Privacy state feedback is represented
|
/// toggle the privacy state of the room. Privacy state feedback is represented
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MicrophonePrivacyController : Device
|
public class MicrophonePrivacyController : EssentialsDevice
|
||||||
{
|
{
|
||||||
MicrophonePrivacyControllerConfig Config;
|
MicrophonePrivacyControllerConfig Config;
|
||||||
|
|
||||||
|
|
@ -225,4 +226,21 @@ namespace PepperDash.Essentials.Core.Privacy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MicrophonePrivacyControllerFactory : EssentialsDeviceFactory<MicrophonePrivacyController>
|
||||||
|
{
|
||||||
|
public MicrophonePrivacyControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "microphoneprivacycontroller" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new MIcrophonePrivacyController Device");
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Core.Privacy.MicrophonePrivacyControllerConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
return new Core.Privacy.MicrophonePrivacyController(dc.Key, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -68,12 +68,21 @@ namespace PepperDash.Essentials
|
||||||
case ("PepperDashEssentials.dll"):
|
case ("PepperDashEssentials.dll"):
|
||||||
{
|
{
|
||||||
version = Global.AssemblyVersion;
|
version = Global.AssemblyVersion;
|
||||||
assembly = Assembly.GetExecutingAssembly();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ("PepperDashEssentialsBase.dll"):
|
case ("PepperDash_Essentials_Core.dll"):
|
||||||
{
|
{
|
||||||
|
version = Global.AssemblyVersion;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("PepperDash_Essentials_DM.dll"):
|
||||||
|
{
|
||||||
|
version = Global.AssemblyVersion;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("Essentials Devices Common.dll"):
|
||||||
|
{
|
||||||
|
version = Global.AssemblyVersion;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ("PepperDash_Core.dll"):
|
case ("PepperDash_Core.dll"):
|
||||||
|
|
@ -97,6 +106,17 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void SetEssentialsAssembly(string name, Assembly assembly)
|
||||||
|
{
|
||||||
|
var loadedAssembly = LoadedAssemblies.FirstOrDefault(la => la.Name.Equals(name));
|
||||||
|
|
||||||
|
if (loadedAssembly != null)
|
||||||
|
{
|
||||||
|
loadedAssembly.SetAssembly(assembly);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads an assembly via Reflection and adds it to the list of loaded assemblies
|
/// Loads an assembly via Reflection and adds it to the list of loaded assemblies
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -360,7 +380,8 @@ namespace PepperDash.Essentials
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Load Plugin not found. {0} is not a plugin assembly. Exception: {1}", loadedAssembly.Name, e);
|
Debug.Console(2, "Load Plugin not found. {0}.{2} is not a plugin factory. Exception: {1}",
|
||||||
|
loadedAssembly.Name, e, type.Name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -489,5 +510,10 @@ namespace PepperDash.Essentials
|
||||||
Version = version;
|
Version = version;
|
||||||
Assembly = assembly;
|
Assembly = assembly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetAssembly(Assembly assembly)
|
||||||
|
{
|
||||||
|
Assembly = assembly;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -522,4 +522,19 @@ namespace PepperDash.Essentials.Core
|
||||||
[JsonProperty("enableSaturday")]
|
[JsonProperty("enableSaturday")]
|
||||||
public bool EnableSaturday { get; set; }
|
public bool EnableSaturday { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class RoomOnToDefaultSourceWhenOccupiedFactory : EssentialsDeviceFactory<RoomOnToDefaultSourceWhenOccupied>
|
||||||
|
{
|
||||||
|
public RoomOnToDefaultSourceWhenOccupiedFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "roomonwhenoccupancydetectedfeature" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new RoomOnToDefaultSourceWhenOccupied Device");
|
||||||
|
return new RoomOnToDefaultSourceWhenOccupied(dc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base class for a shade device
|
/// Base class for a shade device
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class ShadeBase : Device, IShadesOpenClose
|
public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose
|
||||||
{
|
{
|
||||||
public ShadeBase(string key, string name)
|
public ShadeBase(string key, string name)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,14 @@ using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Shades
|
namespace PepperDash.Essentials.Core.Shades
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class that contains the shades to be controlled in a room
|
/// Class that contains the shades to be controlled in a room
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShadeController : Device, IShades
|
public class ShadeController : EssentialsDevice, IShades
|
||||||
{
|
{
|
||||||
ShadeControllerConfigProperties Config;
|
ShadeControllerConfigProperties Config;
|
||||||
|
|
||||||
|
|
@ -55,4 +56,21 @@ namespace PepperDash.Essentials.Core.Shades
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ShadeControllerFactory : EssentialsDeviceFactory<ShadeController>
|
||||||
|
{
|
||||||
|
public ShadeControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "shadecontroller" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new ShadeController Device");
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Core.Shades.ShadeControllerConfigProperties>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
return new Core.Shades.ShadeController(dc.Key, dc.Name, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -260,4 +260,29 @@ namespace PepperDash.Essentials.DM.AirMedia
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AirMediaControllerFactory : EssentialsDeviceFactory<AirMediaController>
|
||||||
|
{
|
||||||
|
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
|
||||||
{
|
{
|
||||||
|
|
@ -18,6 +19,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 128x128")]
|
||||||
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback
|
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback
|
||||||
{
|
{
|
||||||
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
@ -1275,4 +1277,41 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DmChassisControllerFactory : EssentialsDeviceFactory<DmChassisController>
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
|
|
@ -6,6 +7,7 @@ using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
using Crestron.SimplSharpPro.DM.AirMedia;
|
using Crestron.SimplSharpPro.DM.AirMedia;
|
||||||
using Crestron.SimplSharpPro.UI;
|
using Crestron.SimplSharpPro.UI;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
@ -17,86 +19,33 @@ using PepperDash.Essentials.DM.Endpoints.DGEs;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Responsible for loading the type factories for this library
|
||||||
|
/// </summary>
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
{
|
{
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
public DeviceFactory()
|
||||||
{
|
{
|
||||||
var key = dc.Key;
|
var assy = Assembly.GetExecutingAssembly();
|
||||||
var name = dc.Name;
|
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
||||||
var type = dc.Type;
|
|
||||||
var properties = dc.Properties;
|
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
||||||
|
|
||||||
if (typeName.StartsWith("am"))
|
if (types != null)
|
||||||
{
|
{
|
||||||
if (typeName == "am200" || typeName == "am300")
|
foreach (var type in types)
|
||||||
{
|
{
|
||||||
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
|
try
|
||||||
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
|
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
factory.LoadTypeFactories();
|
||||||
return PepperDash.Essentials.DM.DmChassisController.
|
|
||||||
GetDmChassisController(key, name, type, props);
|
|
||||||
}
|
}
|
||||||
else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x")) {
|
catch (Exception e)
|
||||||
var props = JsonConvert.DeserializeObject
|
{
|
||||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -12,12 +12,14 @@ 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
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represent both a transmitter and receiver pair of the HD-MD-400-C-E / HD-MD-300-C-E / HD-MD-200-C-E kits
|
/// Represent both a transmitter and receiver pair of the HD-MD-400-C-E / HD-MD-300-C-E / HD-MD-200-C-E kits
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for all HD-MD variants")]
|
||||||
public class HdMdxxxCEController : CrestronGenericBridgeableBaseDevice, IRouting//, IComPorts
|
public class HdMdxxxCEController : CrestronGenericBridgeableBaseDevice, IRouting//, IComPorts
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -268,4 +270,40 @@ namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
public ControlPropertiesConfig Control { get; set; }
|
public ControlPropertiesConfig Control { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class HdMdxxxCEControllerFactory : EssentialsDeviceFactory<HdMdxxxCEController>
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -63,4 +63,37 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DgeControllerFactory : EssentialsDeviceFactory<DgeController>
|
||||||
|
{
|
||||||
|
public DgeControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "dge100", "dmdge200c" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var typeName = dc.Type.ToLower();
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new DgeControllerm Device");
|
||||||
|
|
||||||
|
Dge100 dgeDevice = null;
|
||||||
|
if (typeName == "dge100")
|
||||||
|
dgeDevice = new Dge100(comm.IpIdInt, Global.ControlSystem);
|
||||||
|
else 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 DgeController(dc.Key + "-comPorts", dc.Name, dgeDevice, dc, props);
|
||||||
|
|
||||||
|
return dgeController;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,9 +13,11 @@ 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
|
||||||
{
|
{
|
||||||
|
[Description("Wrapper class for all DM-RMC variants")]
|
||||||
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
|
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
|
||||||
{
|
{
|
||||||
public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
|
||||||
|
|
@ -281,4 +283,25 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
||||||
|
{
|
||||||
|
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
|
||||||
{
|
{
|
||||||
|
|
@ -146,6 +148,7 @@ namespace PepperDash.Essentials.DM
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Description("Wrapper class for all DM-TX variants")]
|
||||||
public abstract class DmTxControllerBase : CrestronGenericBridgeableBaseDevice
|
public abstract class DmTxControllerBase : CrestronGenericBridgeableBaseDevice
|
||||||
{
|
{
|
||||||
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
|
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
|
||||||
|
|
@ -319,12 +322,25 @@ namespace PepperDash.Essentials.DM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//public enum ePdtHdcpSupport
|
|
||||||
//{
|
public class DmTxControllerFactory : EssentialsDeviceFactory<DmTxControllerBase>
|
||||||
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
|
|
@ -13,7 +15,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents and audio endpoint
|
/// Represents and audio endpoint
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GenericAudioOut : Device, IRoutingSinkNoSwitching
|
public class GenericAudioOut : EssentialsDevice, IRoutingSinkNoSwitching
|
||||||
{
|
{
|
||||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||||
|
|
||||||
|
|
@ -98,4 +100,20 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GenericAudioOutWithVolumeFactory : EssentialsDeviceFactory<GenericAudioOutWithVolume>
|
||||||
|
{
|
||||||
|
public GenericAudioOutWithVolumeFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "genericaudiooutwithvolume" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new GenericAudioOutWithVolumeFactory Device");
|
||||||
|
var zone = dc.Properties.Value<uint>("zone");
|
||||||
|
return new GenericAudioOutWithVolume(dc.Key, dc.Name,
|
||||||
|
dc.Properties.Value<string>("volumeDeviceKey"), zone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -10,7 +10,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.AudioCodec
|
namespace PepperDash.Essentials.Devices.Common.AudioCodec
|
||||||
{
|
{
|
||||||
public abstract class AudioCodecBase : Device, IHasDialer, IUsageTracking, IAudioCodecInfo
|
public abstract class AudioCodecBase : EssentialsDevice, IHasDialer, IUsageTracking, IAudioCodecInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
public event EventHandler<CodecCallStatusItemChangeEventArgs> CallStatusChange;
|
public event EventHandler<CodecCallStatusItemChangeEventArgs> CallStatusChange;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.AudioCodec
|
namespace PepperDash.Essentials.Devices.Common.AudioCodec
|
||||||
|
|
@ -111,4 +112,20 @@ namespace PepperDash.Essentials.Devices.Common.AudioCodec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MockACFactory : EssentialsDeviceFactory<MockAC>
|
||||||
|
{
|
||||||
|
public MockACFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "mockac" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new MockAc Device");
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<AudioCodec.MockAcPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
return new AudioCodec.MockAC(dc.Key, dc.Name, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
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;
|
||||||
using PepperDash.Essentials.Devices.Common.Codec;
|
using PepperDash.Essentials.Devices.Common.Codec;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
@ -244,4 +245,22 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CameraViscaFactory : EssentialsDeviceFactory<CameraVisca>
|
||||||
|
{
|
||||||
|
public CameraViscaFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "cameravisca" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new CameraVisca Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Cameras.CameraPropertiesConfig>(
|
||||||
|
dc.Properties.ToString());
|
||||||
|
return new Cameras.CameraVisca(dc.Key, dc.Name, comm, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,8 @@ using Crestron.SimplSharpPro.Gateways;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
|
|
@ -112,4 +114,20 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
Ethernet, EthernetShared, Cresnet
|
Ethernet, EthernetShared, Cresnet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CenRfgwControllerFactory : EssentialsDeviceFactory<CenRfgwController>
|
||||||
|
{
|
||||||
|
public CenRfgwControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "cenrfgwex", "cenerfgwpoe" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new CEN-GWEXER Device");
|
||||||
|
return CenRfgwController.GetNewExGatewayController(dc.Key, dc.Name,
|
||||||
|
dc.Properties.Value<string>("id"), dc.Properties.Value<string>("gatewayType"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -5,6 +5,7 @@ using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -373,4 +374,22 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
||||||
public TesiraForteControlPoint ControlPoint { get; set; }
|
public TesiraForteControlPoint ControlPoint { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class BiampTesiraForteDspFactory : EssentialsDeviceFactory<BiampTesiraForteDsp>
|
||||||
|
{
|
||||||
|
public BiampTesiraForteDspFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "biamptesira" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new BiampTesira Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>(
|
||||||
|
dc.Properties.ToString());
|
||||||
|
return new BiampTesiraForteDsp(dc.Key, dc.Name, comm, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,7 @@ using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.DSP
|
namespace PepperDash.Essentials.Devices.Common.DSP
|
||||||
{
|
{
|
||||||
public abstract class DspBase : Device
|
public abstract class DspBase : EssentialsDevice
|
||||||
{
|
{
|
||||||
public Dictionary<string, DspControlPoint> LevelControlPoints { get; private set; }
|
public Dictionary<string, DspControlPoint> LevelControlPoints { get; private set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,18 @@ using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class IRBlurayBase : Device, IDiscPlayerControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
|
public class IRBlurayBase : EssentialsDevice, IDiscPlayerControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
|
||||||
{
|
{
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
||||||
|
|
@ -311,4 +316,30 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class IRBlurayBaseFactory : EssentialsDeviceFactory<IRBlurayBase>
|
||||||
|
{
|
||||||
|
public IRBlurayBaseFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "discplayer", "bluray" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new IRBlurayPlayer Device");
|
||||||
|
|
||||||
|
if (dc.Properties["control"]["method"].Value<string>() == "ir")
|
||||||
|
{
|
||||||
|
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||||
|
return new IRBlurayBase(dc.Key, dc.Name, irCont);
|
||||||
|
}
|
||||||
|
else if (dc.Properties["control"]["method"].Value<string>() == "com")
|
||||||
|
{
|
||||||
|
Debug.Console(0, "[{0}] COM Device type not implemented YET!", dc.Key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,6 +9,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
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;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||||
|
|
||||||
|
|
@ -725,4 +726,24 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AvocorDisplayFactory : EssentialsDeviceFactory<AvocorDisplay>
|
||||||
|
{
|
||||||
|
public AvocorDisplayFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "avocorvtf" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
if (comm != null)
|
||||||
|
return new AvocorDisplay(dc.Key, dc.Name, comm, null);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
|
||||||
using Crestron.SimplSharpPro;
|
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using PepperDash.Core;
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using PepperDash.Essentials.Core.Config;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
|
||||||
{
|
|
||||||
public class DisplayDeviceFactory
|
|
||||||
{
|
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
|
||||||
{
|
|
||||||
var key = dc.Key;
|
|
||||||
var name = dc.Name;
|
|
||||||
var type = dc.Type;
|
|
||||||
var properties = dc.Properties;
|
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (typeName == "necmpsx")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
if (comm != null)
|
|
||||||
return new NecPSXMDisplay(dc.Key, dc.Name, comm);
|
|
||||||
}
|
|
||||||
if (typeName == "panasonicthef")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
if (comm != null)
|
|
||||||
return new PanasonicThefDisplay(dc.Key, dc.Name, comm);
|
|
||||||
}
|
|
||||||
else if(typeName == "samsungmdc")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
if (comm != null)
|
|
||||||
return new SamsungMDC(dc.Key, dc.Name, comm, dc.Properties["id"].Value<string>());
|
|
||||||
}
|
|
||||||
if (typeName == "avocorvtf")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
if (comm != null)
|
|
||||||
return new AvocorDisplay(dc.Key, dc.Name, comm, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Displays factory: Exception creating device type {0}, key {1}: \nCONFIG JSON: {2} \nERROR: {3}\n\n",
|
|
||||||
dc.Type, dc.Key, JsonConvert.SerializeObject(dc), e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -7,6 +7,7 @@ using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||||
|
|
@ -361,4 +362,23 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class NecPSXMDisplayFactory : EssentialsDeviceFactory<NecPSXMDisplay>
|
||||||
|
{
|
||||||
|
public NecPSXMDisplayFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "necmpsx" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
if (comm != null)
|
||||||
|
return new NecPSXMDisplay(dc.Key, dc.Name, comm);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||||
|
|
@ -16,7 +17,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PanasonicThefDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor
|
public class PanasonicThDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
public CommunicationGather PortGather { get; private set; }
|
public CommunicationGather PortGather { get; private set; }
|
||||||
|
|
@ -73,7 +74,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor for IBasicCommunication
|
/// Constructor for IBasicCommunication
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PanasonicThefDisplay(string key, string name, IBasicCommunication comm)
|
public PanasonicThDisplay(string key, string name, IBasicCommunication comm)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
Communication = comm;
|
Communication = comm;
|
||||||
|
|
@ -82,7 +83,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor for TCP
|
/// Constructor for TCP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PanasonicThefDisplay(string key, string name, string hostname, int port)
|
public PanasonicThDisplay(string key, string name, string hostname, int port)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
Communication = new GenericTcpIpClient(key + "-tcp", hostname, port, 5000);
|
Communication = new GenericTcpIpClient(key + "-tcp", hostname, port, 5000);
|
||||||
|
|
@ -93,7 +94,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor for COM
|
/// Constructor for COM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PanasonicThefDisplay(string key, string name, ComPort port, ComPort.ComPortSpec spec)
|
public PanasonicThDisplay(string key, string name, ComPort port, ComPort.ComPortSpec spec)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
Communication = new ComPortController(key + "-com", port, spec);
|
Communication = new ComPortController(key + "-com", port, spec);
|
||||||
|
|
@ -132,7 +133,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
//};
|
//};
|
||||||
}
|
}
|
||||||
|
|
||||||
~PanasonicThefDisplay()
|
~PanasonicThDisplay()
|
||||||
{
|
{
|
||||||
PortGather = null;
|
PortGather = null;
|
||||||
}
|
}
|
||||||
|
|
@ -343,4 +344,23 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class PanasonicThDisplayFactory : EssentialsDeviceFactory<PanasonicThDisplay>
|
||||||
|
{
|
||||||
|
public PanasonicThDisplayFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "panasonicthef" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
if (comm != null)
|
||||||
|
return new PanasonicThDisplay(dc.Key, dc.Name, comm);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,9 +9,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
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;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||||
|
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Displays
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -637,4 +640,23 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SamsungMDCFactory : EssentialsDeviceFactory<SamsungMDC>
|
||||||
|
{
|
||||||
|
public SamsungMDCFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "samsungmdc" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
if (comm != null)
|
||||||
|
return new SamsungMDC(dc.Key, dc.Name, comm, dc.Properties["id"].Value<string>());
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,11 +9,12 @@ using Crestron.SimplSharpPro.Lighting;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Environment.Lighting
|
namespace PepperDash.Essentials.Devices.Common.Environment.Lighting
|
||||||
{
|
{
|
||||||
public class Din8sw8Controller : Device, ISwitchedOutputCollection
|
public class Din8sw8Controller : EssentialsDevice, ISwitchedOutputCollection
|
||||||
{
|
{
|
||||||
// Need to figure out some sort of interface to make these switched outputs behave like processor relays so they can be used interchangably
|
// Need to figure out some sort of interface to make these switched outputs behave like processor relays so they can be used interchangably
|
||||||
|
|
||||||
|
|
@ -85,4 +86,21 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lighting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Din8sw8ControllerFactory : EssentialsDeviceFactory<Din8sw8Controller>
|
||||||
|
{
|
||||||
|
public Din8sw8ControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "din8sw8" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Din8sw8Controller Device");
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
|
||||||
|
return new Din8sw8Controller(dc.Key, comm.CresnetIdInt);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Lighting;
|
using PepperDash.Essentials.Core.Lighting;
|
||||||
using LightingBase = PepperDash.Essentials.Core.Lighting.LightingBase;
|
using LightingBase = PepperDash.Essentials.Core.Lighting.LightingBase;
|
||||||
|
|
@ -264,4 +265,23 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
|
||||||
// public string Username { get; set; }
|
// public string Username { get; set; }
|
||||||
// public string Password { get; set; }
|
// public string Password { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LutronQuantumAreaFactory : EssentialsDeviceFactory<LutronQuantumArea>
|
||||||
|
{
|
||||||
|
public LutronQuantumAreaFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "lutronqs" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new LutronQuantumArea Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Environment.Lutron.LutronQuantumPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
return new LutronQuantumArea(dc.Key, dc.Name, comm, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.CrestronIO;
|
using PepperDash.Essentials.Core.CrestronIO;
|
||||||
using PepperDash.Essentials.Core.Shades;
|
using PepperDash.Essentials.Core.Shades;
|
||||||
|
|
||||||
|
|
@ -110,4 +111,21 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
|
||||||
public IOPortConfig Close { get; set; }
|
public IOPortConfig Close { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class RelayControlledShadeFactory : EssentialsDeviceFactory<RelayControlledShade>
|
||||||
|
{
|
||||||
|
public RelayControlledShadeFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "relaycontrolledshade" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Environment.Somfy.RelayControlledShadeConfigProperties>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
return new Environment.Somfy.RelayControlledShade(dc.Key, dc.Name, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -132,7 +132,6 @@
|
||||||
<Compile Include="Display\AvocorVTFDisplay.cs" />
|
<Compile Include="Display\AvocorVTFDisplay.cs" />
|
||||||
<Compile Include="Display\InputInterfaces.cs" />
|
<Compile Include="Display\InputInterfaces.cs" />
|
||||||
<Compile Include="Display\SamsungMDCDisplay.cs" />
|
<Compile Include="Display\SamsungMDCDisplay.cs" />
|
||||||
<Compile Include="Display\DeviceFactory.cs" />
|
|
||||||
<Compile Include="Display\NecPaSeriesProjector.cs" />
|
<Compile Include="Display\NecPaSeriesProjector.cs" />
|
||||||
<Compile Include="Display\NECPSXMDisplay.cs" />
|
<Compile Include="Display\NECPSXMDisplay.cs" />
|
||||||
<Compile Include="DSP\BiampTesira\BiampTesiraForteDspLevel.cs" />
|
<Compile Include="DSP\BiampTesira\BiampTesiraForteDspLevel.cs" />
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.GeneralIO;
|
using Crestron.SimplSharpPro.GeneralIO;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
@ -18,375 +20,33 @@ using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||||
using PepperDash.Essentials.Devices.Common.Environment;
|
using PepperDash.Essentials.Devices.Common.Environment;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
{
|
{
|
||||||
public static IKeyed GetDevice(DeviceConfig dc)
|
|
||||||
|
public DeviceFactory()
|
||||||
{
|
{
|
||||||
var key = dc.Key;
|
var assy = Assembly.GetExecutingAssembly();
|
||||||
var name = dc.Name;
|
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
|
||||||
var type = dc.Type;
|
|
||||||
var properties = dc.Properties;
|
|
||||||
var propAnon = new {};
|
|
||||||
JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
|
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
|
||||||
var groupName = dc.Group.ToLower();
|
|
||||||
|
|
||||||
if (typeName == "appletv")
|
if (types != null)
|
||||||
{
|
{
|
||||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
foreach (var type in types)
|
||||||
return new AppleTV(key, name, irCont);
|
|
||||||
}
|
|
||||||
else if (typeName == "analogwaylivecore")
|
|
||||||
{
|
{
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
try
|
||||||
var props = JsonConvert.DeserializeObject<AnalogWayLiveCorePropertiesConfig>(
|
|
||||||
properties.ToString());
|
|
||||||
return new AnalogWayLiveCore(key, name, comm, props);
|
|
||||||
}
|
|
||||||
else if (typeName == "basicirdisplay")
|
|
||||||
{
|
{
|
||||||
var ir = IRPortHelper.GetIrPort(properties);
|
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
|
||||||
if (ir != null)
|
factory.LoadTypeFactories();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
var display = new BasicIrDisplay(key, name, ir.Port, ir.FileName);
|
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
|
||||||
display.IrPulseTime = 200; // Set default pulse time for IR commands.
|
|
||||||
return display;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "biamptesira")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
var props = JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>(
|
|
||||||
properties.ToString());
|
|
||||||
return new BiampTesiraForteDsp(key, name, comm, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
else if (typeName == "cameravisca")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
var props = JsonConvert.DeserializeObject<Cameras.CameraPropertiesConfig>(
|
|
||||||
properties.ToString());
|
|
||||||
return new Cameras.CameraVisca(key, name, comm, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "cenrfgwex")
|
|
||||||
{
|
|
||||||
return CenRfgwController.GetNewExGatewayController(key, name,
|
|
||||||
properties.Value<string>("id"), properties.Value<string>("gatewayType"));
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "cenerfgwpoe")
|
|
||||||
{
|
|
||||||
return CenRfgwController.GetNewErGatewayController(key, name,
|
|
||||||
properties.Value<string>("id"), properties.Value<string>("gatewayType"));
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (groupName == "discplayer") // (typeName == "irbluray")
|
|
||||||
{
|
|
||||||
if (properties["control"]["method"].Value<string>() == "ir")
|
|
||||||
{
|
|
||||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
|
||||||
return new IRBlurayBase(key, name, irCont);
|
|
||||||
}
|
|
||||||
else if (properties["control"]["method"].Value<string>() == "com")
|
|
||||||
{
|
|
||||||
Debug.Console(0, "[{0}] COM Device type not implemented YET!", key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (typeName == "digitallogger")
|
|
||||||
{
|
|
||||||
// var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
var props = JsonConvert.DeserializeObject<DigitalLoggerPropertiesConfig>(
|
|
||||||
properties.ToString());
|
|
||||||
return new DigitalLogger(key, name, props);
|
|
||||||
}
|
|
||||||
else if (typeName == "genericaudiooutwithvolume")
|
|
||||||
{
|
|
||||||
var zone = dc.Properties.Value<uint>("zone");
|
|
||||||
return new GenericAudioOutWithVolume(key, name,
|
|
||||||
dc.Properties.Value<string>("volumeDeviceKey"), zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (groupName == "genericsource")
|
|
||||||
{
|
|
||||||
return new GenericSource(key, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "inroompc")
|
|
||||||
{
|
|
||||||
return new Core.Devices.InRoomPc(key, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "laptop")
|
|
||||||
{
|
|
||||||
return new Core.Devices.Laptop(key, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "bluejeanspc")
|
|
||||||
{
|
|
||||||
return new SoftCodec.BlueJeansPc(key, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "mockvc")
|
|
||||||
{
|
|
||||||
return new VideoCodec.MockVC(dc);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "mockac")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<AudioCodec.MockAcPropertiesConfig>(properties.ToString());
|
|
||||||
return new AudioCodec.MockAC(key, name, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName.StartsWith("ciscospark"))
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "zoomroom")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
return new VideoCodec.ZoomRoom.ZoomRoom(dc, comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "digitalinput")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<IOPortConfig>(properties.ToString());
|
|
||||||
|
|
||||||
IDigitalInputPorts portDevice;
|
|
||||||
|
|
||||||
if (props.PortDeviceKey == "processor")
|
|
||||||
portDevice = Global.ControlSystem as IDigitalInputPorts;
|
|
||||||
else
|
|
||||||
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IDigitalInputPorts;
|
|
||||||
|
|
||||||
if (portDevice == null)
|
|
||||||
Debug.Console(0, "ERROR: Unable to add digital input device with key '{0}'. Port Device does not support digital inputs", key);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var cs = (portDevice as CrestronControlSystem);
|
|
||||||
if (cs == null)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "ERROR: Port device for [{0}] is not control system", props.PortDeviceKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cs.SupportsVersiport)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Attempting to add Digital Input device to Versiport port '{0}'", props.PortNumber);
|
|
||||||
|
|
||||||
if (props.PortNumber > cs.NumberOfVersiPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "WARNING: Cannot add Vesiport {0} on {1}. Out of range",
|
|
||||||
props.PortNumber, props.PortDeviceKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Versiport vp = cs.VersiPorts[props.PortNumber];
|
|
||||||
|
|
||||||
if (!vp.Registered)
|
|
||||||
{
|
|
||||||
var regSuccess = vp.Register();
|
|
||||||
if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Successfully Created Digital Input Device on Versiport");
|
|
||||||
return new GenericVersiportDigitalInputDevice(key, vp, props);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed: {2}",
|
|
||||||
props.PortNumber, props.PortDeviceKey, regSuccess);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (cs.SupportsDigitalInput)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Attempting to add Digital Input device to Digital Input port '{0}'", props.PortNumber);
|
|
||||||
|
|
||||||
if (props.PortNumber > cs.NumberOfDigitalInputPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "WARNING: Cannot register DIO port {0} on {1}. Out of range",
|
|
||||||
props.PortNumber, props.PortDeviceKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
|
|
||||||
|
|
||||||
if (!digitalInput.Registered)
|
|
||||||
{
|
|
||||||
if (digitalInput.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Successfully Created Digital Input Device on Digital Input");
|
|
||||||
return new GenericDigitalInputDevice(key, digitalInput);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Debug.Console(0, "WARNING: Attempt to register digital input {0} on device with key '{1}' failed.",
|
|
||||||
props.PortNumber, props.PortDeviceKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (typeName == "relayoutput")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<IOPortConfig>(properties.ToString());
|
|
||||||
|
|
||||||
IRelayPorts portDevice;
|
|
||||||
|
|
||||||
if (props.PortDeviceKey == "processor")
|
|
||||||
portDevice = Global.ControlSystem as IRelayPorts;
|
|
||||||
else
|
|
||||||
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IRelayPorts;
|
|
||||||
|
|
||||||
if (portDevice == null)
|
|
||||||
Debug.Console(0, "Unable to add relay device with key '{0}'. Port Device does not support relays", key);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var cs = (portDevice as CrestronControlSystem);
|
|
||||||
|
|
||||||
if (cs != null)
|
|
||||||
{
|
|
||||||
// The relay is on a control system processor
|
|
||||||
if (!cs.SupportsRelay || props.PortNumber > cs.NumberOfRelayPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Port Device: {0} does not support relays or does not have enough relays");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// The relay is on another device type
|
|
||||||
|
|
||||||
if (props.PortNumber > portDevice.NumberOfRelayPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "Port Device: {0} does not have enough relays");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Relay relay = portDevice.RelayPorts[props.PortNumber];
|
|
||||||
|
|
||||||
if (!relay.Registered)
|
|
||||||
{
|
|
||||||
if (relay.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
|
||||||
return new GenericRelayDevice(key, relay);
|
|
||||||
else
|
|
||||||
Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return new GenericRelayDevice(key, relay);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Future: Check if portDevice is 3-series card or other non control system that supports versiports
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "microphoneprivacycontroller")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<Core.Privacy.MicrophonePrivacyControllerConfig>(properties.ToString());
|
|
||||||
|
|
||||||
return new Core.Privacy.MicrophonePrivacyController(key, props);
|
|
||||||
}
|
|
||||||
else if (typeName == "roku")
|
|
||||||
{
|
|
||||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
|
||||||
return new Roku2(key, name, irCont);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (groupName == "settopbox") //(typeName == "irstbbase")
|
|
||||||
{
|
|
||||||
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
|
||||||
var config = dc.Properties.ToObject<SetTopBoxPropertiesConfig>();
|
|
||||||
var stb = new IRSetTopBoxBase(key, name, irCont, config);
|
|
||||||
|
|
||||||
//stb.HasDvr = properties.Value<bool>("hasDvr");
|
|
||||||
var listName = properties.Value<string>("presetsList");
|
|
||||||
if (listName != null)
|
|
||||||
stb.LoadPresets(listName);
|
|
||||||
return stb;
|
|
||||||
}
|
|
||||||
else if (typeName == "tvonecorio")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
var props = JsonConvert.DeserializeObject<TVOneCorioPropertiesConfig>(
|
|
||||||
properties.ToString());
|
|
||||||
return new TVOneCorio(key, name, comm, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
else if (typeName == "glsoirccn")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
|
|
||||||
GlsOccupancySensorBase occSensor = null;
|
|
||||||
|
|
||||||
occSensor = new GlsOirCCn(comm.CresnetIdInt, Global.ControlSystem);
|
|
||||||
|
|
||||||
if (occSensor != null)
|
|
||||||
return new GlsOccupancySensorBaseController(key, name, occSensor);
|
|
||||||
else
|
|
||||||
Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (typeName == "glsodtccn")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
|
|
||||||
var occSensor = new GlsOdtCCn(comm.CresnetIdInt, Global.ControlSystem);
|
|
||||||
|
|
||||||
if (occSensor != null)
|
|
||||||
return new GlsOdtOccupancySensorController(key, name, occSensor);
|
|
||||||
else
|
|
||||||
Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (groupName == "lighting")
|
|
||||||
{
|
|
||||||
if (typeName == "lutronqs")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.CreateCommForDevice(dc);
|
|
||||||
|
|
||||||
var props = JsonConvert.DeserializeObject<Environment.Lutron.LutronQuantumPropertiesConfig>(properties.ToString());
|
|
||||||
|
|
||||||
return new Environment.Lutron.LutronQuantumArea(key, name, comm, props);
|
|
||||||
}
|
|
||||||
else if (typeName == "din8sw8")
|
|
||||||
{
|
|
||||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
|
|
||||||
return new Environment.Lighting.Din8sw8Controller(key, comm.CresnetIdInt);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (groupName == "environment")
|
|
||||||
{
|
|
||||||
if (typeName == "shadecontroller")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<Core.Shades.ShadeControllerConfigProperties>(properties.ToString());
|
|
||||||
|
|
||||||
return new Core.Shades.ShadeController(key, name, props);
|
|
||||||
}
|
|
||||||
else if (typeName == "relaycontrolledshade")
|
|
||||||
{
|
|
||||||
var props = JsonConvert.DeserializeObject<Environment.Somfy.RelayControlledShadeConfigProperties>(properties.ToString());
|
|
||||||
|
|
||||||
return new Environment.Somfy.RelayControlledShade(key, name, props);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,11 +8,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class GenericSource : Device, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
|
public class GenericSource : EssentialsDevice, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
|
||||||
{
|
{
|
||||||
|
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeNoControls; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeNoControls; } }
|
||||||
|
|
@ -39,4 +40,19 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GenericSourceFactory : EssentialsDeviceFactory<GenericSource>
|
||||||
|
{
|
||||||
|
public GenericSourceFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "genericsource" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Source Device");
|
||||||
|
return new GenericSource(dc.Key, dc.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -5,13 +5,14 @@ using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
public class AnalogWayLiveCore : Device
|
public class AnalogWayLiveCore : EssentialsDevice
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
public CommunicationGather PortGather { get; private set; }
|
public CommunicationGather PortGather { get; private set; }
|
||||||
|
|
@ -238,4 +239,22 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
// public QscDspControlPoint ControlPoint { get; set; }
|
// public QscDspControlPoint ControlPoint { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AnalogWayLiveCoreFactory : EssentialsDeviceFactory<AnalogWayLiveCore>
|
||||||
|
{
|
||||||
|
public AnalogWayLiveCoreFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "analogwaylivecore" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new AnalogWayLiveCore Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<AnalogWayLiveCorePropertiesConfig>(
|
||||||
|
dc.Properties.ToString());
|
||||||
|
return new AnalogWayLiveCore(dc.Key, dc.Name, comm, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -5,13 +5,14 @@ using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
public class TVOneCorio : Device
|
public class TVOneCorio : EssentialsDevice
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
public CommunicationGather PortGather { get; private set; }
|
public CommunicationGather PortGather { get; private set; }
|
||||||
|
|
@ -238,4 +239,22 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
// public QscDspControlPoint ControlPoint { get; set; }
|
// public QscDspControlPoint ControlPoint { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TVOneCorioFactory : EssentialsDeviceFactory<TVOneCorio>
|
||||||
|
{
|
||||||
|
public TVOneCorioFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "tvonecorio" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new TVOneCorio Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<TVOneCorioPropertiesConfig>(
|
||||||
|
dc.Properties.ToString());
|
||||||
|
return new TVOneCorio(dc.Key, dc.Name, comm, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.GeneralIO;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||||
|
|
@ -365,4 +366,38 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||||
LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
|
LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GlsOccupancySensorBaseControllerFactory : EssentialsDeviceFactory<GlsOccupancySensorBaseController>
|
||||||
|
{
|
||||||
|
public GlsOccupancySensorBaseControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "glsoirccn" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
|
||||||
|
|
||||||
|
var typeName = dc.Type.ToLower();
|
||||||
|
var key = dc.Key;
|
||||||
|
var name = dc.Name;
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
|
||||||
|
GlsOccupancySensorBase occSensor = null;
|
||||||
|
|
||||||
|
occSensor = new GlsOirCCn(comm.CresnetIdInt, Global.ControlSystem);
|
||||||
|
|
||||||
|
if (occSensor != null)
|
||||||
|
{
|
||||||
|
return new GlsOccupancySensorBaseController(key, name, occSensor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.GeneralIO;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||||
|
|
@ -159,4 +160,37 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||||
LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
|
LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GlsOdtOccupancySensorControllerFactory : EssentialsDeviceFactory<GlsOdtOccupancySensorController>
|
||||||
|
{
|
||||||
|
public GlsOdtOccupancySensorControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "glsodtccn" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new GlsOccupancySensorBaseController Device");
|
||||||
|
|
||||||
|
var typeName = dc.Type.ToLower();
|
||||||
|
var key = dc.Key;
|
||||||
|
var name = dc.Name;
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
|
||||||
|
var occSensor = new GlsOdtCCn(comm.CresnetIdInt, Global.ControlSystem);
|
||||||
|
|
||||||
|
if (occSensor != null)
|
||||||
|
{
|
||||||
|
return new GlsOdtOccupancySensorController(key, name, occSensor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, "ERROR: Unable to create Occupancy Sensor Device. Key: '{0}'", key);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -11,6 +11,7 @@ using Crestron.SimplSharp.Net.Http;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
|
|
@ -337,4 +338,20 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DigitalLoggerFactory : EssentialsDeviceFactory<DigitalLogger>
|
||||||
|
{
|
||||||
|
public DigitalLoggerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "digitallogger" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new DigitalLogger Device");
|
||||||
|
var props = JsonConvert.DeserializeObject<DigitalLoggerPropertiesConfig>(
|
||||||
|
dc.Properties.ToString());
|
||||||
|
return new DigitalLogger(dc.Key, dc.Name, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9,6 +9,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;
|
||||||
using PepperDash.Essentials.Core.Presets;
|
using PepperDash.Essentials.Core.Presets;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
|
|
@ -461,4 +462,27 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
trilist.SetBoolSigAction(joinMap.Record, stbTransport.Record);
|
trilist.SetBoolSigAction(joinMap.Record, stbTransport.Record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class IRSetTopBoxBaseFactory : EssentialsDeviceFactory<IRSetTopBoxBase>
|
||||||
|
{
|
||||||
|
public IRSetTopBoxBaseFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "settopbox" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new SetTopBox Device");
|
||||||
|
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||||
|
var config = dc.Properties.ToObject<SetTopBoxPropertiesConfig>();
|
||||||
|
var stb = new IRSetTopBoxBase(dc.Key, dc.Name, irCont, config);
|
||||||
|
|
||||||
|
var listName = dc.Properties.Value<string>("presetsList");
|
||||||
|
if (listName != null)
|
||||||
|
stb.LoadPresets(listName);
|
||||||
|
return stb;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -161,4 +161,19 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class BlueJeansPcFactory : EssentialsDeviceFactory<BlueJeansPc>
|
||||||
|
{
|
||||||
|
public BlueJeansPcFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "bluejeanspc" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new BlueJeansPc Device");
|
||||||
|
return new SoftCodec.BlueJeansPc(dc.Key, dc.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
|
|
@ -166,4 +167,20 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
trilist.SetBoolSigAction(joinMap.PlayPause, Play);
|
trilist.SetBoolSigAction(joinMap.PlayPause, Play);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AppleTVFactory : EssentialsDeviceFactory<AppleTV>
|
||||||
|
{
|
||||||
|
public AppleTVFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "appletv" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new AppleTV Device");
|
||||||
|
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||||
|
return new AppleTV(dc.Key, dc.Name, irCont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -8,11 +8,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class Roku2 : Device, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
public class Roku2 : EssentialsDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
||||||
{
|
{
|
||||||
[Api]
|
[Api]
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
@ -145,4 +146,21 @@ namespace PepperDash.Essentials.Devices.Common
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Roku2Factory : EssentialsDeviceFactory<Roku2>
|
||||||
|
{
|
||||||
|
public Roku2Factory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "roku" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Roku Device");
|
||||||
|
var irCont = IRPortHelper.GetIrOutputPortController(dc);
|
||||||
|
return new Roku2(dc.Key, dc.Name, irCont);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1843,4 +1843,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CiscoSparkCodecFactory : EssentialsDeviceFactory<CiscoSparkCodec>
|
||||||
|
{
|
||||||
|
public CiscoSparkCodecFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "ciscospark", "ciscowebex", "ciscowebexpro", "ciscoroomkit" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Cisco Codec Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -770,4 +770,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||||
_AutoAnswerEnabled = value;
|
_AutoAnswerEnabled = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MockVCFactory : EssentialsDeviceFactory<MockVC>
|
||||||
|
{
|
||||||
|
public MockVCFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "mockvc" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new MockVC Device");
|
||||||
|
return new VideoCodec.MockVC(dc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1676,4 +1676,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||||
InitialSyncComplete = false;
|
InitialSyncComplete = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ZoomRoomFactory : EssentialsDeviceFactory<ZoomRoom>
|
||||||
|
{
|
||||||
|
public ZoomRoomFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "zoomroom" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new ZoomRoom Device");
|
||||||
|
var comm = CommFactory.CreateCommForDevice(dc);
|
||||||
|
return new VideoCodec.ZoomRoom.ZoomRoom(dc, comm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue