From 074ee190ade91ff749ef205044dddec8bd873ca2 Mon Sep 17 00:00:00 2001 From: Jason DeVito Date: Tue, 30 Aug 2022 21:53:41 -0500 Subject: [PATCH] feat: added cen-io-ir-104 device and factory --- .../Crestron IO/Ir/CenIoIr104Controller.cs | 62 +++++++++++++++++++ .../PepperDash_Essentials_Core.csproj | 1 + 2 files changed, 63 insertions(+) create mode 100644 essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs new file mode 100644 index 00000000..413f3568 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; +using Crestron.SimplSharpPro.GeneralIO; +using PepperDash.Essentials.Core.Config; + + +using PepperDash.Core; + +namespace PepperDash.Essentials.Core +{ + /// + /// Wrapper class for CEN-IO-IR-104 module + /// + [Description("Wrapper class for the CEN-IO-IR-104 module")] + public class CenIoIr104Controller : EssentialsDevice, IIROutputPorts + { + public CenIoIr104 Ir104 { get; private set; } + + public CenIoIr104Controller(string key, string name, CenIoIr104 ir104) + : base(key, name) + { + Ir104 = ir104; + } + + #region IDigitalInputPorts Members + + public CrestronCollection IROutputPorts + { + get { return Ir104.IROutputPorts; } + } + + public int NumberOfIROutputPorts + { + get { return Ir104.NumberOfIROutputPorts; } + } + + #endregion + } + + public class CenIoIr104ControllerFactory : EssentialsDeviceFactory + { + public CenIoIr104ControllerFactory() + { + TypeNames = new List() { "cenioir104" }; + } + + public override EssentialsDevice BuildDevice(DeviceConfig dc) + { + Debug.Console(1, "Factory Attempting to create new CEN-IR-104 Device"); + + var control = CommFactory.GetControlPropertiesConfig(dc); + var ipid = control.IpIdInt; + + return new CenIoIr104Controller(dc.Key, dc.Name, new Crestron.SimplSharpPro.GeneralIO.CenIoIr104(ipid, Global.ControlSystem)); + } + } + +} \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index cdf6406c..df9b8115 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -183,6 +183,7 @@ +