Compare commits

...

6 Commits

66 changed files with 1565 additions and 936 deletions

View File

@@ -21,7 +21,7 @@ using PepperDash.Essentials.AppServer.Messengers;
namespace PepperDash.Essentials
{
public class MobileControlSystemController : Device
public class MobileControlSystemController : EssentialsDevice
{
WebSocketClient WSClient;
@@ -865,4 +865,20 @@ namespace PepperDash.Essentials
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);
}
}
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials
/// <summary>
///
/// </summary>
public abstract class MobileControlBridgeBase: Device
public abstract class MobileControlBridgeBase: EssentialsDevice
{
public MobileControlSystemController Parent { get; private set; }

View File

@@ -825,4 +825,35 @@ namespace PepperDash.Essentials.Room.MobileControl
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;
}
}
}

View File

@@ -15,32 +15,18 @@ using Crestron.SimplSharpPro.EthernetCommunication;
namespace PepperDash.Essentials
{
/// <summary>
/// Responsible for loading all of the device types for this library
/// </summary>
public class BridgeFactory
{
public static IKeyed GetDevice(DeviceConfig dc)
public BridgeFactory()
{
// ? why is this static JTA 2018-06-13?
var key = dc.Key;
var name = dc.Name;
var type = dc.Type;
var properties = dc.Properties;
var propAnon = new { };
var typeName = dc.Type.ToLower();
var groupName = dc.Group.ToLower();
//Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
if (typeName == "eiscapi")
{
return new EiscApi(dc);
}
return null;
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
eiscApiFactory.LoadTypeFactories();
}
}
}
public class CommBridge : Device
{

View File

@@ -80,10 +80,29 @@ namespace PepperDash.Essentials
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
LoadDeviceTypesFromFactories();
if (!Debug.DoNotLoadOnNextBoot)
GoWithLoad();
}
/// <summary>
/// Instantiates each of the device factories to load thier device types
/// </summary>
void LoadDeviceTypesFromFactories()
{
// Instantiate the Device Factories
new CoreDeviceFactory();
new DmDeviceFactory();
new UiDeviceFactory();
new DeviceFactory();
new BridgeFactory();
new PepperDash.Essentials.Devices.Common.DeviceFactory();
new PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory();
}
/// <summary>
@@ -290,9 +309,6 @@ namespace PepperDash.Essentials
/// </summary>
public void LoadDevices()
{
// Instantiate the Device Factories
new CoreDeviceFactory();
// Build the processor wrapper class
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
@@ -356,33 +372,15 @@ namespace PepperDash.Essentials
}
// 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)
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"
//{
// // iterate plugin factories
// foreach (var f in FactoryObjects)
// {
// var cresFactory = f as IGetCrestronDevice;
// if (cresFactory != null)
// {
// newDev = cresFactory.GetDevice(devConf, this);
// }
// }
//}
//
//if (newDev == null)
// newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
//
if (newDev != null)
DeviceManager.AddDevice(newDev);

View File

@@ -6,11 +6,12 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials
{
public class Amplifier : Device, IRoutingSinkNoSwitching
public class Amplifier : EssentialsDevice, IRoutingSinkNoSwitching
{
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -54,4 +55,18 @@ namespace PepperDash.Essentials
#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);
}
}
}

View File

@@ -10,88 +10,34 @@ using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Room.MobileControl;
namespace PepperDash.Essentials
{
public class DeviceFactory
/// <summary>
/// Responsible for loading all of the device types for this library
/// </summary>
public class DeviceFactory
{
public static IKeyed GetDevice(DeviceConfig dc)
{
var key = dc.Key;
var name = dc.Name;
var type = dc.Type;
var properties = dc.Properties;
public DeviceFactory()
{
var ampFactory = new AmplifierFactory() as IDeviceFactory;
ampFactory.LoadTypeFactories();
var typeName = dc.Type.ToLower();
var mockDisplayFactory = new MockDisplayFactory() as IDeviceFactory;
mockDisplayFactory.LoadTypeFactories();
if (typeName == "amplifier")
{
return new Amplifier(dc.Key, dc.Name);
}
else if (dc.Group.ToLower() == "touchpanel") // typeName.StartsWith("tsw"))
{
return UiDeviceFactory.GetUiDevice(dc);
}
var consoleCommMockFactroy = new ConsoleCommMockDeviceFactory() as IDeviceFactory;
consoleCommMockFactroy.LoadTypeFactories();
else if (typeName == "mockdisplay")
{
return new MockDisplay(key, name);
}
var mcSystemControllerFactory = new MobileControlSystemControllerFactory() as IDeviceFactory;
mcSystemControllerFactory.LoadTypeFactories();
else if (typeName == "generic")
{
return new Device(key, name);
}
var mcSIMPLRoomBridgeFactory = new MobileControlSIMPLRoomBridgeFactory() as IDeviceFactory;
mcSIMPLRoomBridgeFactory.LoadTypeFactories();
//// 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;
}
var roomOnToDefSourceWhenOcc = new RoomOnToDefaultSourceWhenOccupiedFactory() as IDeviceFactory;
roomOnToDefSourceWhenOcc.LoadTypeFactories();
}
}
}

View File

@@ -18,173 +18,18 @@ using PepperDash.Essentials.DM.Endpoints.DGEs;
namespace PepperDash.Essentials
{
/// <summary>
/// Responsible for loading all of the UI device types for this library
/// </summary>
public class UiDeviceFactory
{
public static IKeyed GetUiDevice(DeviceConfig config)
public UiDeviceFactory()
{
var comm = CommFactory.GetControlPropertiesConfig(config);
var dgeControllerFactory = new DgeControllerFactory() as IDeviceFactory;
dgeControllerFactory.LoadTypeFactories();
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;
var essentialsTouchpanelControllerFactory = new EssentialsTouchpanelControllerFactory() as IDeviceFactory;
essentialsTouchpanelControllerFactory.LoadTypeFactories();
}
}

View File

@@ -9,11 +9,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.UI;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.PageManagers;
namespace PepperDash.Essentials
{
public class EssentialsTouchpanelController : Device, IHasBasicTriListWithSmartObject
public class EssentialsTouchpanelController : EssentialsDevice, IHasBasicTriListWithSmartObject
{
public BasicTriListWithSmartObject Panel { get; private set; }
@@ -197,4 +198,132 @@ namespace PepperDash.Essentials
(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;
}
}
}

View File

@@ -123,117 +123,6 @@ namespace PepperDash.Essentials.Core.Bridges
var bridge = device as IBridgeAdvanced;
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
}
//if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
//{
// (device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is IBridgeAdvanced)
//{
// Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
// (device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
//}
//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;
//}
}
Debug.Console(1, this, "Devices Linked.");
@@ -403,5 +292,19 @@ namespace PepperDash.Essentials.Core.Bridges
}
public class EiscApiFactory : EssentialsDeviceFactory<EiscApi>
{
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);
}
}
}

View File

@@ -5,10 +5,12 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
public class ConsoleCommMockDevice : Device, ICommunicationMonitor
public class ConsoleCommMockDevice : EssentialsDevice, ICommunicationMonitor
{
public IBasicCommunication Communication { 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);
}
}
}

View File

@@ -17,6 +17,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
/// </summary>
[Description("Generic communication wrapper class for any IBasicCommunication type")]
public class GenericComm : ReconfigurableBridgableDevice
{
EssentialsControlPropertiesConfig PropertiesConfig;

View File

@@ -1,13 +1,17 @@
using Crestron.SimplSharpPro;
using System.Collections.Generic;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class C2nRthsController:CrestronGenericBridgeableBaseDevice
[Description("Wrapper class for the C2N-RTHS sensor")]
public class C2nRthsController : CrestronGenericBridgeableBaseDevice
{
private readonly C2nRths _device;
@@ -65,4 +69,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
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));
}
}
}

View File

@@ -5,6 +5,8 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Essentials.Core.Config;
using PepperDash.Core;
@@ -13,7 +15,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Wrapper class for CEN-IO-DIGIN-104 digital input module
/// </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; }
@@ -37,4 +40,23 @@ namespace PepperDash.Essentials.Core
#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));
}
}
}

View File

@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash_Essentials_Core.Devices;
namespace PepperDash.Essentials.Core.CrestronIO
@@ -67,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;
}
}
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
/// <summary>
/// Represents a generic digital input deviced tied to a versiport
/// </summary>
public class GenericVersiportDigitalInputDevice : Device, IDigitalInput
public class GenericVersiportDigitalInputDevice : EssentialsDevice, IDigitalInput
{
public Versiport InputPort { get; private set; }

View File

@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash_Essentials_Core.Devices;
namespace PepperDash.Essentials.Core.CrestronIO
@@ -101,4 +102,74 @@ namespace PepperDash.Essentials.Core.CrestronIO
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;
}
}
}

View File

@@ -1,14 +1,17 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class StatusSignController:CrestronGenericBridgeableBaseDevice
[Description("Wrapper class for the Crestron StatusSign device")]
public class StatusSignController : CrestronGenericBridgeableBaseDevice
{
private readonly StatusSign _device;
@@ -158,4 +161,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
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));
}
}
}

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
@@ -12,6 +13,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Defines the basic needs for an EssentialsDevice to enable it to be build by an IDeviceFactory class
/// </summary>
[Description("The base Essentials Device Class")]
public abstract class EssentialsDevice : Device
{
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>
/// Devices the basic needs for a Device Factory
/// </summary>
@@ -46,7 +82,10 @@ namespace PepperDash.Essentials.Core
{
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);
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using Crestron.SimplSharpPro;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Core;
@@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
/// <summary>
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
/// </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 string IconName { get; set; }
@@ -63,4 +64,19 @@ namespace PepperDash.Essentials.Core.Devices
#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);
}
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using Crestron.SimplSharpPro;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Core;
@@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
/// <summary>
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
/// </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 string IconName { get; set; }
@@ -63,4 +64,18 @@ namespace PepperDash.Essentials.Core.Devices
#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);
}
}
}

View File

@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
@@ -208,4 +209,27 @@ namespace PepperDash.Essentials.Core
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;
}
}
}

View File

@@ -12,7 +12,7 @@ using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
@@ -182,4 +182,19 @@ namespace PepperDash.Essentials.Core
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);
}
}
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
@@ -13,26 +14,53 @@ using PepperDash.Essentials.Core.Touchpanels;
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
{
/// <summary>
/// A dictionary of factory methods, keyed by config types, added by plugins.
/// These methods are looked up and called by GetDevice in this class.
/// </summary>
static Dictionary<string, Func<DeviceConfig, IKeyed>> FactoryMethods =
new Dictionary<string, Func<DeviceConfig, IKeyed>>(StringComparer.OrdinalIgnoreCase);
static Dictionary<string, DeviceFactoryWrapper> FactoryMethods =
new Dictionary<string, DeviceFactoryWrapper>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Adds a plugin factory method
/// </summary>
/// <param name="dc"></param>
/// <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);
DeviceFactory.FactoryMethods.Add(type, method);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
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>
/// The factory method for Core "things". Also iterates the Factory methods that have
/// been loaded from plugins
@@ -52,76 +80,70 @@ namespace PepperDash.Essentials.Core
if (FactoryMethods.ContainsKey(typeName))
{
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));
}
return null;
}
/// <summary>
/// Prints the type names fromt the FactoryMethods collection.
/// Prints the type names and associated metadata from the FactoryMethods collection.
/// </summary>
/// <param name="command"></param>
public static void GetDeviceFactoryTypes(string filter)
{
List<string> typeNames = new List<string>();
Dictionary<string, DeviceFactoryWrapper> types = new Dictionary<string, DeviceFactoryWrapper>();
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
{
typeNames = FactoryMethods.Keys.ToList();
types = FactoryMethods;
}
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,
@"Type: '{0}'
CType: '{1}'
Description: {2}", type.Key, cType, description);
}
}
}
/// <summary>
/// Responsible for loading all of the device types
/// Responsible for loading all of the device types for this library
/// </summary>
public class CoreDeviceFactory
{
public CoreDeviceFactory()
{
var genComm = new GenericCommFactory() as IDeviceFactory;
genComm.LoadTypeFactories();
Debug.Console(1, "Essentials.Core Factory Adding Types...");
//cast to IDeviceFactory isn't explicitly required here...but will be when instantiating using reflection, which I'm assuming is the next step
var genCommFactory = new GenericCommFactory() as IDeviceFactory;
genCommFactory.LoadTypeFactories();
var c2nRthsFactory = new C2nRthsControllerFactory() as IDeviceFactory;
c2nRthsFactory.LoadTypeFactories();
var statusSignFactory = new StatusSignControllerFactory() as IDeviceFactory;
statusSignFactory.LoadTypeFactories();
var cenIoControllerFactory = new CenIoDigIn104ControllerFactory() as IDeviceFactory;
cenIoControllerFactory.LoadTypeFactories();
}
}
}

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.Core
public interface IDeviceFactory
{
/// <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>
void LoadTypeFactories();
}

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
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
/// toggle the privacy state of the room. Privacy state feedback is represented
/// </summary>
public class MicrophonePrivacyController : Device
public class MicrophonePrivacyController : EssentialsDevice
{
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);
}
}
}

View File

@@ -522,4 +522,19 @@ namespace PepperDash.Essentials.Core
[JsonProperty("enableSaturday")]
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);
}
}
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary>
/// Base class for a shade device
/// </summary>
public abstract class ShadeBase : Device, IShadesOpenClose
public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose
{
public ShadeBase(string key, string name)
: base(key, name)

View File

@@ -5,13 +5,14 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Shades
{
/// <summary>
/// Class that contains the shades to be controlled in a room
/// </summary>
public class ShadeController : Device, IShades
public class ShadeController : EssentialsDevice, IShades
{
ShadeControllerConfigProperties Config;
@@ -55,4 +56,21 @@ namespace PepperDash.Essentials.Core.Shades
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);
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -11,6 +11,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
using PepperDash.Essentials.Core.Config;
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
///
/// </summary>
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 128x128")]
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingInputsOutputs, IRouting, IHasFeedback
{
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;
}
}
}

View File

@@ -17,85 +17,27 @@ using PepperDash.Essentials.DM.Endpoints.DGEs;
namespace PepperDash.Essentials.DM
{
public class DeviceFactory
/// <summary>
/// Responsible for loading the type factories for this library
/// </summary>
public class DmDeviceFactory
{
public static IKeyed GetDevice(DeviceConfig dc)
{
var key = dc.Key;
var name = dc.Name;
var type = dc.Type;
var properties = dc.Properties;
public DmDeviceFactory()
{
Debug.Console(1, "Essentials.DM Factory Adding Types...");
var typeName = dc.Type.ToLower();
var dmChassisFactory = new DmChassisControllerFactory() as IDeviceFactory;
dmChassisFactory.LoadTypeFactories();
if (typeName.StartsWith("am"))
{
if (typeName == "am200" || typeName == "am300")
{
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
AmX00 amDevice = null;
if (typeName == "am200")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
else if (typeName == "am300")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
var dmTxFactory = new DmTxControllerFactory() as IDeviceFactory;
dmTxFactory.LoadTypeFactories();
return new AirMediaController(key, name, amDevice, dc, props);
}
}
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
{
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmChassisController.
GetDmChassisController(key, name, type, props);
}
else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmBladeChassisController.
GetDmChassisController(key, name, type, props);
}
// Hand off to DmTxHelper class
else if (typeName.StartsWith("dmtx")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
}
// Hand off to DmRmcHelper class
else if (typeName.StartsWith("dmrmc")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
}
else if (typeName.Equals("hdmd4x14ke")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.HdMdNxM4kEPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
}
else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
if (typeName.Equals("hdmd400ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd300ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd200ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd200c1ge"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
}
return null;
}
var dmRxFactory = new DmRmcControllerFactory() as IDeviceFactory;
dmRxFactory.LoadTypeFactories();
var hdMdFactory = new HdMdxxxCEControllerFactory() as IDeviceFactory;
hdMdFactory.LoadTypeFactories();
}
}

View File

@@ -12,12 +12,14 @@ using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM
{
/// <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
/// </summary>
[Description("Wrapper class for all HD-MD variants")]
public class HdMdxxxCEController : CrestronGenericBridgeableBaseDevice, IRouting//, IComPorts
{
/// <summary>
@@ -268,4 +270,40 @@ namespace PepperDash.Essentials.DM
{
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;
}
}
}

View File

@@ -63,4 +63,37 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
#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;
}
}
}

View File

@@ -13,9 +13,11 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM
{
[Description("Wrapper class for all DM-RMC variants")]
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
{
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);
}
}
}

View File

@@ -13,6 +13,8 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM
{
@@ -146,6 +148,7 @@ namespace PepperDash.Essentials.DM
/// <summary>
///
/// </summary>
[Description("Wrapper class for all DM-TX variants")]
public abstract class DmTxControllerBase : CrestronGenericBridgeableBaseDevice
{
public virtual void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
@@ -319,12 +322,25 @@ namespace PepperDash.Essentials.DM
}
}
}
//public enum ePdtHdcpSupport
//{
// HdcpOff = 0,
// Hdcp1 = 1,
// Hdcp2 = 2,
// Hdcp2_2= 3,
// Auto = 99
//}
}
public class DmTxControllerFactory : EssentialsDeviceFactory<DmTxControllerBase>
{
public DmTxControllerFactory()
{
TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c", "dmtx401c", "dmtx401s" };
}
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);
}
}
}

View File

@@ -6,6 +6,8 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Devices.Common
@@ -13,7 +15,7 @@ namespace PepperDash.Essentials.Devices.Common
/// <summary>
/// Represents and audio endpoint
/// </summary>
public class GenericAudioOut : Device, IRoutingSinkNoSwitching
public class GenericAudioOut : EssentialsDevice, IRoutingSinkNoSwitching
{
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);
}
}
}

View File

@@ -10,7 +10,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
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;

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Devices.Common.Codec;
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);
}
}
}

View File

@@ -7,6 +7,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Devices.Common.Codec;
using System.Text.RegularExpressions;
using Crestron.SimplSharp.Reflection;
@@ -244,4 +245,22 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
#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);
}
}
}

View File

@@ -8,6 +8,8 @@ using Crestron.SimplSharpPro.Gateways;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Devices.Common
{
@@ -112,4 +114,20 @@ namespace PepperDash.Essentials.Devices.Common
{
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"));
}
}
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using System.Text.RegularExpressions;
@@ -373,4 +374,22 @@ namespace PepperDash.Essentials.Devices.Common.DSP
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);
}
}
}

View File

@@ -9,7 +9,7 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.DSP
{
public abstract class DspBase : Device
public abstract class DspBase : EssentialsDevice
{
public Dictionary<string, DspControlPoint> LevelControlPoints { get; private set; }

View File

@@ -5,13 +5,18 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Core.Config;
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; }
@@ -311,4 +316,30 @@ namespace PepperDash.Essentials.Devices.Common
#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;
}
}
}

View File

@@ -9,6 +9,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using Feedback = PepperDash.Essentials.Core.Feedback;
@@ -725,4 +726,24 @@ namespace PepperDash.Essentials.Devices.Displays
#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;
}
}
}

View File

@@ -14,51 +14,20 @@ 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;
public DisplayDeviceFactory()
{
var necFactory = new NecPSXMDisplayFactory() as IDeviceFactory;
necFactory.LoadTypeFactories();
var typeName = dc.Type.ToLower();
var panasonicThFactory = new PanasonicThDisplayFactory() as IDeviceFactory;
panasonicThFactory.LoadTypeFactories();
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;
}
var samsungMdcFactory = new SamsungMDCFactory() as IDeviceFactory;
samsungMdcFactory.LoadTypeFactories();
var avocorFactory = new AvocorDisplayFactory() as IDeviceFactory;
avocorFactory.LoadTypeFactories();
}
return null;
}
}
}

View File

@@ -7,6 +7,7 @@ using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
using Feedback = PepperDash.Essentials.Core.Feedback;
@@ -361,4 +362,23 @@ namespace PepperDash.Essentials.Devices.Displays
#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;
}
}
}

View File

@@ -7,6 +7,7 @@ using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
using Feedback = PepperDash.Essentials.Core.Feedback;
@@ -16,7 +17,7 @@ namespace PepperDash.Essentials.Devices.Displays
/// <summary>
///
/// </summary>
public class PanasonicThefDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor
public class PanasonicThDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor
{
public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; }
@@ -73,7 +74,7 @@ namespace PepperDash.Essentials.Devices.Displays
/// <summary>
/// Constructor for IBasicCommunication
/// </summary>
public PanasonicThefDisplay(string key, string name, IBasicCommunication comm)
public PanasonicThDisplay(string key, string name, IBasicCommunication comm)
: base(key, name)
{
Communication = comm;
@@ -82,7 +83,7 @@ namespace PepperDash.Essentials.Devices.Displays
/// <summary>
/// Constructor for TCP
/// </summary>
public PanasonicThefDisplay(string key, string name, string hostname, int port)
public PanasonicThDisplay(string key, string name, string hostname, int port)
: base(key, name)
{
Communication = new GenericTcpIpClient(key + "-tcp", hostname, port, 5000);
@@ -93,7 +94,7 @@ namespace PepperDash.Essentials.Devices.Displays
/// <summary>
/// Constructor for COM
/// </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)
{
Communication = new ComPortController(key + "-com", port, spec);
@@ -132,7 +133,7 @@ namespace PepperDash.Essentials.Devices.Displays
//};
}
~PanasonicThefDisplay()
~PanasonicThDisplay()
{
PortGather = null;
}
@@ -343,4 +344,23 @@ namespace PepperDash.Essentials.Devices.Displays
#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;
}
}
}

View File

@@ -9,9 +9,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using Feedback = PepperDash.Essentials.Core.Feedback;
using Newtonsoft.Json.Linq;
namespace PepperDash.Essentials.Devices.Displays
{
/// <summary>
@@ -637,4 +640,23 @@ namespace PepperDash.Essentials.Devices.Displays
#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;
}
}
}

View File

@@ -9,11 +9,12 @@ using Crestron.SimplSharpPro.Lighting;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.CrestronIO;
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
@@ -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);
}
}
}

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Lighting;
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 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);
}
}
}

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.CrestronIO;
using PepperDash.Essentials.Core.Shades;
@@ -110,4 +111,21 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
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);
}
}
}

View File

@@ -18,375 +18,98 @@ using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Devices.Common.Occupancy;
using PepperDash.Essentials.Devices.Common.Environment;
namespace PepperDash.Essentials.Devices.Common
{
public class DeviceFactory
{
public static IKeyed GetDevice(DeviceConfig dc)
{
var key = dc.Key;
var name = dc.Name;
var type = dc.Type;
var properties = dc.Properties;
var propAnon = new {};
JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
public DeviceFactory()
{
var appleTVFactory = new AppleTVFactory() as IDeviceFactory;
appleTVFactory.LoadTypeFactories();
var typeName = dc.Type.ToLower();
var groupName = dc.Group.ToLower();
var analogWayLCFactory = new AnalogWayLiveCoreFactory() as IDeviceFactory;
analogWayLCFactory.LoadTypeFactories();
if (typeName == "appletv")
{
var irCont = IRPortHelper.GetIrOutputPortController(dc);
return new AppleTV(key, name, irCont);
}
else if (typeName == "analogwaylivecore")
{
var comm = CommFactory.CreateCommForDevice(dc);
var props = JsonConvert.DeserializeObject<AnalogWayLiveCorePropertiesConfig>(
properties.ToString());
return new AnalogWayLiveCore(key, name, comm, props);
}
else if (typeName == "basicirdisplay")
{
var ir = IRPortHelper.GetIrPort(properties);
if (ir != null)
{
var display = new BasicIrDisplay(key, name, ir.Port, ir.FileName);
display.IrPulseTime = 200; // Set default pulse time for IR commands.
return display;
}
}
var basicIrDisplayFactory = new BasicIrDisplayFactory() as IDeviceFactory;
basicIrDisplayFactory.LoadTypeFactories();
else if (typeName == "biamptesira")
{
var comm = CommFactory.CreateCommForDevice(dc);
var props = JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>(
properties.ToString());
return new BiampTesiraForteDsp(key, name, comm, props);
}
var biampTesiraFactory = new BiampTesiraForteDspFactory() as IDeviceFactory;
biampTesiraFactory.LoadTypeFactories();
var cameraViscaFactory = new Cameras.CameraViscaFactory() as IDeviceFactory;
cameraViscaFactory.LoadTypeFactories();
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);
}
var cenRfGwFactory = new CenRfgwControllerFactory() as IDeviceFactory;
cenRfGwFactory.LoadTypeFactories();
else if (typeName == "cenrfgwex")
{
return CenRfgwController.GetNewExGatewayController(key, name,
properties.Value<string>("id"), properties.Value<string>("gatewayType"));
}
var irBlurayFactory = new IRBlurayBaseFactory() as IDeviceFactory;
irBlurayFactory.LoadTypeFactories();
else if (typeName == "cenerfgwpoe")
{
return CenRfgwController.GetNewErGatewayController(key, name,
properties.Value<string>("id"), properties.Value<string>("gatewayType"));
}
var digitalLoggerFactory = new DigitalLoggerFactory() as IDeviceFactory;
digitalLoggerFactory.LoadTypeFactories();
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);
}
var genericAudioOutFactory = new GenericAudioOutWithVolumeFactory() as IDeviceFactory;
genericAudioOutFactory.LoadTypeFactories();
else if (groupName == "genericsource")
{
return new GenericSource(key, name);
}
var genericSourceFactory = new GenericSourceFactory() as IDeviceFactory;
genericSourceFactory.LoadTypeFactories();
else if (typeName == "inroompc")
{
return new Core.Devices.InRoomPc(key, name);
}
var inRoomPcFactory = new Core.Devices.InRoomPcFactory() as IDeviceFactory;
inRoomPcFactory.LoadTypeFactories();
else if (typeName == "laptop")
{
return new Core.Devices.Laptop(key, name);
}
var laptopFactory = new Core.Devices.LaptopFactory() as IDeviceFactory;
laptopFactory.LoadTypeFactories();
else if (typeName == "bluejeanspc")
{
return new SoftCodec.BlueJeansPc(key, name);
}
var blueJeansPcFactory = new SoftCodec.BlueJeansPcFactory() as IDeviceFactory;
blueJeansPcFactory.LoadTypeFactories();
else if (typeName == "mockvc")
{
return new VideoCodec.MockVC(dc);
}
var mockAcFactory = new AudioCodec.MockACFactory() as IDeviceFactory;
mockAcFactory.LoadTypeFactories();
else if (typeName == "mockac")
{
var props = JsonConvert.DeserializeObject<AudioCodec.MockAcPropertiesConfig>(properties.ToString());
return new AudioCodec.MockAC(key, name, props);
}
var mockVcFactory = new VideoCodec.MockVCFactory() as IDeviceFactory;
mockVcFactory.LoadTypeFactories();
else if (typeName.StartsWith("ciscospark"))
{
var comm = CommFactory.CreateCommForDevice(dc);
return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
}
var ciscoCodecFactory = new VideoCodec.Cisco.CiscoSparkCodecFactory() as IDeviceFactory;
ciscoCodecFactory.LoadTypeFactories();
else if (typeName == "zoomroom")
{
var comm = CommFactory.CreateCommForDevice(dc);
return new VideoCodec.ZoomRoom.ZoomRoom(dc, comm);
}
var zoomRoomFactory = new VideoCodec.ZoomRoom.ZoomRoomFactory() as IDeviceFactory;
zoomRoomFactory.LoadTypeFactories();
else if (typeName == "digitalinput")
{
var props = JsonConvert.DeserializeObject<IOPortConfig>(properties.ToString());
var digitalInputFactory = new GenericDigitalInputDeviceFactory() as IDeviceFactory;
digitalInputFactory.LoadTypeFactories();
IDigitalInputPorts portDevice;
var relayFactory = new GenericRelayDeviceFactory() as IDeviceFactory;
relayFactory.LoadTypeFactories();
if (props.PortDeviceKey == "processor")
portDevice = Global.ControlSystem as IDigitalInputPorts;
else
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IDigitalInputPorts;
var micPrivacyFactory = new Core.Privacy.MicrophonePrivacyControllerFactory() as IDeviceFactory;
micPrivacyFactory.LoadTypeFactories();
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;
}
var rokuFactory = new Roku2Factory() as IDeviceFactory;
rokuFactory.LoadTypeFactories();
if (cs.SupportsVersiport)
{
Debug.Console(1, "Attempting to add Digital Input device to Versiport port '{0}'", props.PortNumber);
var setTopBoxFactory = new IRSetTopBoxBaseFactory() as IDeviceFactory;
setTopBoxFactory.LoadTypeFactories();
if (props.PortNumber > cs.NumberOfVersiPorts)
{
Debug.Console(0, "WARNING: Cannot add Vesiport {0} on {1}. Out of range",
props.PortNumber, props.PortDeviceKey);
return null;
}
var tvOneCorioFactory = new TVOneCorioFactory() as IDeviceFactory;
tvOneCorioFactory.LoadTypeFactories();
Versiport vp = cs.VersiPorts[props.PortNumber];
var glsOccSensorBaseFactory = new GlsOccupancySensorBaseControllerFactory() as IDeviceFactory;
glsOccSensorBaseFactory.LoadTypeFactories();
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);
var glsOdtOccSensorFactory = new GlsOdtOccupancySensorControllerFactory() as IDeviceFactory;
glsOdtOccSensorFactory.LoadTypeFactories();
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;
}
var lutronQuantumFactory = new Environment.Lutron.LutronQuantumAreaFactory() as IDeviceFactory;
lutronQuantumFactory.LoadTypeFactories();
DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
var din8sw8ControllerFactory = new Environment.Lighting.Din8sw8ControllerFactory() as IDeviceFactory;
din8sw8ControllerFactory.LoadTypeFactories();
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);
}
}
}
}
var shadeControllerFactory = new Core.Shades.ShadeControllerFactory() as IDeviceFactory;
shadeControllerFactory.LoadTypeFactories();
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;
}
var relayControlledShadeFactory = new Environment.Somfy.RelayControlledShadeFactory() as IDeviceFactory;
relayControlledShadeFactory.LoadTypeFactories();
}
}
}

View File

@@ -8,11 +8,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
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; } }
@@ -39,4 +40,19 @@ namespace PepperDash.Essentials.Devices.Common
#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);
}
}
}

View File

@@ -5,13 +5,14 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using System.Text.RegularExpressions;
namespace PepperDash.Essentials.Devices.Common
{
public class AnalogWayLiveCore : Device
public class AnalogWayLiveCore : EssentialsDevice
{
public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; }
@@ -238,4 +239,22 @@ namespace PepperDash.Essentials.Devices.Common
// 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);
}
}
}

View File

@@ -5,13 +5,14 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using System.Text.RegularExpressions;
namespace PepperDash.Essentials.Devices.Common
{
public class TVOneCorio : Device
public class TVOneCorio : EssentialsDevice
{
public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; }
@@ -238,4 +239,22 @@ namespace PepperDash.Essentials.Devices.Common
// 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);
}
}
}

View File

@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Devices.Common.Occupancy
@@ -365,4 +366,38 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
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;
}
}
}
}

View File

@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Devices.Common.Occupancy
@@ -159,4 +160,37 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
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;
}
}
}
}

View File

@@ -11,6 +11,7 @@ using Crestron.SimplSharp.Net.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash_Essentials_Core.Devices;
@@ -338,4 +339,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);
}
}
}

View File

@@ -9,6 +9,7 @@ using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Presets;
using PepperDash.Essentials.Core.Routing;
using PepperDash_Essentials_Core.Devices;
@@ -462,4 +463,27 @@ namespace PepperDash.Essentials.Devices.Common
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;
}
}
}

View File

@@ -161,4 +161,19 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
#endregion
}
public class BlueJeansPcFactory : EssentialsDeviceFactory<BlueJeansPc>
{
public BlueJeansPcFactory()
{
TypeNames = new List<string>() { "mockvc" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new BlueJeansPc Device");
return new SoftCodec.BlueJeansPc(dc.Key, dc.Name);
}
}
}

View File

@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
using PepperDash_Essentials_Core.Devices;
@@ -167,4 +168,20 @@ namespace PepperDash.Essentials.Devices.Common
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);
}
}
}

View File

@@ -8,11 +8,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Devices.Common
{
public class Roku2 : Device, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
public class Roku2 : EssentialsDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
{
[Api]
public IrOutputPortController IrPort { get; private set; }
@@ -145,4 +146,21 @@ namespace PepperDash.Essentials.Devices.Common
#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);
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -770,4 +770,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
_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);
}
}
}

View File

@@ -1676,4 +1676,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
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);
}
}
}