diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/Hrxxx0WirelessRemoteControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/Hrxxx0WirelessRemoteControllerJoinMap.cs new file mode 100644 index 00000000..f9037aa0 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/Hrxxx0WirelessRemoteControllerJoinMap.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Core.Bridges +{ + public class Hrxxx0WirelessRemoteControllerJoinMap : JoinMapBaseAdvanced + { + [JoinName("Power")] + public JoinDataComplete Power = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, + new JoinMetadata() { Label = "Power", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Menu")] + public JoinDataComplete Menu = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 }, + new JoinMetadata() { Label = "Menu", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Guide")] + public JoinDataComplete Guide = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 }, + new JoinMetadata() { Label = "Guide", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Info")] + public JoinDataComplete Info = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 }, + new JoinMetadata() { Label = "Info", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("VolumeUp")] + public JoinDataComplete VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 }, + new JoinMetadata() { Label = "VolumeUp", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("VolumeDown")] + public JoinDataComplete VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 }, + new JoinMetadata() { Label = "VolumeDown", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("DialPadUp")] + public JoinDataComplete DialPadUp = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 }, + new JoinMetadata() { Label = "DialPadUp", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("DialPadDown")] + public JoinDataComplete DialPadDown = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 }, + new JoinMetadata() { Label = "DialPadDown", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("DialPadLeft")] + public JoinDataComplete DialPadLeft = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 }, + new JoinMetadata() { Label = "DialPadLeft", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("DialPadRight")] + public JoinDataComplete DialPadRight = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 }, + new JoinMetadata() { Label = "DialPadRight", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("DialPadSelect")] + public JoinDataComplete DialPadSelect = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 }, + new JoinMetadata() { Label = "DialPadSelect", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("ChannelUp")] + public JoinDataComplete ChannelUp = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 }, + new JoinMetadata() { Label = "ChannelUp", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("ChannelDown")] + public JoinDataComplete ChannelDown = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 }, + new JoinMetadata() { Label = "ChannelDown", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Mute")] + public JoinDataComplete Mute = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 }, + new JoinMetadata() { Label = "Mute", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Exit")] + public JoinDataComplete Exit = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 }, + new JoinMetadata() { Label = "Exit", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Last")] + public JoinDataComplete Last = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 }, + new JoinMetadata() { Label = "Last", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Play")] + public JoinDataComplete Play = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 }, + new JoinMetadata() { Label = "Play", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Pause")] + public JoinDataComplete Pause = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 }, + new JoinMetadata() { Label = "Pause", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Rewind")] + public JoinDataComplete Rewind = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 }, + new JoinMetadata() { Label = "Rewind", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("FastForward")] + public JoinDataComplete FastForward = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 }, + new JoinMetadata() { Label = "FastForward", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("PreviousTrack")] + public JoinDataComplete PreviousTrack = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 }, + new JoinMetadata() { Label = "PreviousTrack", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("NextTrack")] + public JoinDataComplete NextTrack = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 }, + new JoinMetadata() { Label = "NextTrack", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Stop")] + public JoinDataComplete Stop = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 }, + new JoinMetadata() { Label = "Stop", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Record")] + public JoinDataComplete Record = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 }, + new JoinMetadata() { Label = "Record", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Dvr")] + public JoinDataComplete Dvr = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 }, + new JoinMetadata() { Label = "Dvr", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad1")] + public JoinDataComplete Keypad1 = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad2Abc")] + public JoinDataComplete Keypad2 = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad2Abc", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad3Def")] + public JoinDataComplete Keypad3Def = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad3Def", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad4Ghi")] + public JoinDataComplete Keypad4Ghi = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad4Ghi", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad5Jkl")] + public JoinDataComplete Keypad5Jkl = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad5Jkl", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad6Mno")] + public JoinDataComplete Keypad6Mno = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad6Mno", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad7Pqrs")] + public JoinDataComplete Keypad7Pqrs = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad7Pqrs", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad8Tuv")] + public JoinDataComplete Keypad8Tuv = new JoinDataComplete(new JoinData() { JoinNumber = 33, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad8Tuv", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad9Wxyz")] + public JoinDataComplete Keypad9Wxyz = new JoinDataComplete(new JoinData() { JoinNumber = 34, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad9Wxyz", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Keypad0")] + public JoinDataComplete Keypad0 = new JoinDataComplete(new JoinData() { JoinNumber = 35, JoinSpan = 1 }, + new JoinMetadata() { Label = "Keypad0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Clear")] + public JoinDataComplete Clear = new JoinDataComplete(new JoinData() { JoinNumber = 36, JoinSpan = 1 }, + new JoinMetadata() { Label = "Clear", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Enter")] + public JoinDataComplete Enter = new JoinDataComplete(new JoinData() { JoinNumber = 37, JoinSpan = 1 }, + new JoinMetadata() { Label = "Enter", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Red")] + public JoinDataComplete Red = new JoinDataComplete(new JoinData() { JoinNumber = 38, JoinSpan = 1 }, + new JoinMetadata() { Label = "Red", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Green")] + public JoinDataComplete Green = new JoinDataComplete(new JoinData() { JoinNumber = 39, JoinSpan = 1 }, + new JoinMetadata() { Label = "Green", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Yellow")] + public JoinDataComplete Yellow = new JoinDataComplete(new JoinData() { JoinNumber = 40, JoinSpan = 1 }, + new JoinMetadata() { Label = "Yellow", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Blue")] + public JoinDataComplete Blue = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 1 }, + new JoinMetadata() { Label = "Blue", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom1")] + public JoinDataComplete Custom1 = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom2")] + public JoinDataComplete Custom2 = new JoinDataComplete(new JoinData() { JoinNumber = 43, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom3")] + public JoinDataComplete Custom3 = new JoinDataComplete(new JoinData() { JoinNumber = 44, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom4")] + public JoinDataComplete Custom4 = new JoinDataComplete(new JoinData() { JoinNumber = 45, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom5")] + public JoinDataComplete Custom5 = new JoinDataComplete(new JoinData() { JoinNumber = 46, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom6")] + public JoinDataComplete Custom6 = new JoinDataComplete(new JoinData() { JoinNumber = 47, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom7")] + public JoinDataComplete Custom7 = new JoinDataComplete(new JoinData() { JoinNumber = 48, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom8")] + public JoinDataComplete Custom8 = new JoinDataComplete(new JoinData() { JoinNumber = 49, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Custom9")] + public JoinDataComplete Custom9 = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 }, + new JoinMetadata() { Label = "Custom9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Fav")] + public JoinDataComplete Fav = new JoinDataComplete(new JoinData() { JoinNumber = 51, JoinSpan = 1 }, + new JoinMetadata() { Label = "Fav", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("Home")] + public JoinDataComplete Home = new JoinDataComplete(new JoinData() { JoinNumber = 52, JoinSpan = 1 }, + new JoinMetadata() { Label = "Home", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("BatteryLow")] + public JoinDataComplete BatteryLow = new JoinDataComplete(new JoinData() { JoinNumber = 53, JoinSpan = 1 }, + new JoinMetadata() { Label = "BatteryLow", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("BatteryCritical")] + public JoinDataComplete BatteryCritical = new JoinDataComplete(new JoinData() { JoinNumber = 54, JoinSpan = 1 }, + new JoinMetadata() { Label = "BatteryCritical", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital }); + + [JoinName("BatteryVoltage")] + public JoinDataComplete BatteryVoltage = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 }, + new JoinMetadata() { Label = "BatteryVoltage", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog }); + + public Hrxxx0WirelessRemoteControllerJoinMap(uint joinStart) + : base(joinStart, typeof(Hrxxx0WirelessRemoteControllerJoinMap)) + { + } + + + } +} \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs index 94110fd7..eaf109ef 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Comm and IR/CommFactory.cs @@ -184,6 +184,26 @@ namespace PepperDash.Essentials.Core throw new FormatException(string.Format("ERROR:Unable to convert Cresnet ID: {0} to hex. Error:\n{1}", CresnetId)); } } + } + + public string InfinetId { get; set; } + + /// + /// Attepmts to provide uiont conversion of string InifinetId + /// + public uint InfinetIdInt + { + get + { + try + { + return Convert.ToUInt32(InfinetId, 16); + } + catch (Exception) + { + throw new FormatException(string.Format("ERROR:Unable to conver Infinet ID: {0} to hex. Error:\n{1}", InfinetId)); + } + } } } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IDPad.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IDPad.cs index 2e0f3ae7..d222b47c 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IDPad.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IDPad.cs @@ -33,7 +33,7 @@ namespace PepperDash.Essentials.Core triList.SetBoolSigAction(141, dev.Right); triList.SetBoolSigAction(142, dev.Select); triList.SetBoolSigAction(130, dev.Menu); - triList.SetBoolSigAction(134, dev.Exit); + triList.SetBoolSigAction(134, dev.Exit); } public static void UnlinkButtons(this IDPad dev, BasicTriList triList) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/CenRfgwController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/CenRfgwController.cs new file mode 100644 index 00000000..1fd7da6d --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/CenRfgwController.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; +using Crestron.SimplSharpPro.Gateways; +using Newtonsoft.Json; + + +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.Config; + + +namespace PepperDash.Essentials.Core +{ + [Description("Wrapper class for Crestron Infinet-EX Gateways")] + public class CenRfgwController : CrestronGenericBaseDevice + { + private GatewayBase _Gateway; + public GatewayBase GateWay { get { return _Gateway; } } + + /// + /// Constructor for the on-board gateway + /// + /// + /// + public CenRfgwController(string key, string name, GatewayBase gateway) : + base(key, name, gateway) + { + _Gateway = gateway; + } + + public static CenRfgwController GetNewExGatewayController(string key, string name, ushort ipId, ushort cresnetId, string gatewayType) + { + eExGatewayType type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true); + try + { + var cs = Global.ControlSystem; + + GatewayBase gw = null; + switch (type) + { + case eExGatewayType.Ethernet: + gw = new CenRfgwEx(ipId, cs); + break; + case eExGatewayType.EthernetShared: + gw = new CenRfgwExEthernetSharable(ipId, cs); + break; + case eExGatewayType.Cresnet: + gw = new CenRfgwExCresnet(cresnetId, cs); + break; + } + return new CenRfgwController(key, name, gw); + } + catch (Exception) + { + Debug.Console(0, "ERROR: Cannot create EX Gateway, id {0}, type {1}", type == eExGatewayType.Cresnet ? cresnetId : ipId, gatewayType); + return null; + } + } + public static CenRfgwController GetNewErGatewayController(string key, string name, ushort ipId, ushort cresnetId, string gatewayType) + { + eExGatewayType type = (eExGatewayType)Enum.Parse(typeof(eExGatewayType), gatewayType, true); + try + { + var cs = Global.ControlSystem; + + GatewayBase gw = null; + switch (type) + { + case eExGatewayType.Ethernet: + gw = new CenErfgwPoe(ipId, cs); + break; + case eExGatewayType.EthernetShared: + gw = new CenErfgwPoeEthernetSharable(ipId, cs); + break; + case eExGatewayType.Cresnet: + gw = new CenErfgwPoeCresnet(cresnetId, cs); + break; + } + return new CenRfgwController(key, name, gw); + } + catch (Exception) + { + Debug.Console(0, "ERROR: Cannot create ER Gateway, id {0}, type {1}", type== eExGatewayType.Cresnet ? cresnetId : ipId, gatewayType); + return null; + } + } + + } + + + + public enum eExGatewayType + { + Ethernet, EthernetShared, Cresnet + } + + + #region Factory + public class CenRfgwControllerFactory : EssentialsDeviceFactory + { + public CenRfgwControllerFactory() + { + TypeNames = new List() { "cenrfgwex", "cenerfgwpoe" }; + } + + public override EssentialsDevice BuildDevice(DeviceConfig dc) + { + + Debug.Console(1, "Factory Attempting to create new CEN-GWEXER Device"); + + var props = JsonConvert.DeserializeObject(dc.Properties.ToString()); + + var type = dc.Type.ToLower(); + var control = props.Control; + var ipid = control.IpIdInt; + var cresnetId = control.CresnetIdInt; + var gatewayType = props.GatewayType; + + switch (type) + { + case ("cenrfgwex"): + return CenRfgwController.GetNewExGatewayController(dc.Key, dc.Name, + (ushort)ipid, (ushort)cresnetId, gatewayType); + case ("cenerfgwpoe"): + return CenRfgwController.GetNewErGatewayController(dc.Key, dc.Name, + (ushort)ipid, (ushort)cresnetId, gatewayType); + default: + return null; + } + } + } + #endregion + + +} \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/EssentialsRfGatewayConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/EssentialsRfGatewayConfig.cs new file mode 100644 index 00000000..e1ae8c11 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Gateways/EssentialsRfGatewayConfig.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using PepperDash.Core; +using PepperDash.Essentials.Core.Config; + + +namespace PepperDash.Essentials.Core +{ + public class EssentialsRfGatewayConfig + { + [JsonProperty("control")] + public EssentialsControlPropertiesConfig Control { get; set; } + + [JsonProperty("gatewayType")] + public string GatewayType { get; set; } + + } +} \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs index 2f3e1823..b540b3d6 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Global.cs @@ -17,8 +17,8 @@ namespace PepperDash.Essentials.Core { public static class Global { - public static CrestronControlSystem ControlSystem { get; set; } - + public static CrestronControlSystem ControlSystem { get; set; } + public static LicenseManager LicenseManager { get; set; } /// diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index 63b7f580..18b8fc65 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -62,6 +62,10 @@ False ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll + + False + ..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll + False ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll @@ -131,6 +135,7 @@ + @@ -177,6 +182,8 @@ + + @@ -222,6 +229,9 @@ + + + diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Remotes/ButtonExtensions.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Remotes/ButtonExtensions.cs new file mode 100644 index 00000000..43941260 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Remotes/ButtonExtensions.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; +using Crestron.SimplSharpPro.DeviceSupport; + +using PepperDash.Core; + +namespace PepperDash.Essentials.Core +{ + public static class ButtonExtensions + { + public static Button SetButtonAction(this Button button, Action a) + { + button.UserObject = a; + return button; + } + + public static Button SetButtonAction(this CrestronCollection