From 68a0157fbe1ec2172a14426be3d47f1477d59c92 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 30 Aug 2022 13:57:53 -0600 Subject: [PATCH 1/5] fix: add missing interface --- .../Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs b/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs index c7f68e8b..41616d96 100644 --- a/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs +++ b/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs @@ -7,7 +7,7 @@ using PepperDash.Essentials.Room.Config; namespace PepperDash.Essentials { - public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasDefaultDisplay + public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasDefaultDisplay, IHasCurrentVolumeControls { bool ExcludeFromGlobalFunctions { get; } From 074ee190ade91ff749ef205044dddec8bd873ca2 Mon Sep 17 00:00:00 2001 From: Jason DeVito Date: Tue, 30 Aug 2022 21:53:41 -0500 Subject: [PATCH 2/5] 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 @@ + From 122abc56e599469079467a9923266ce8252d4dd3 Mon Sep 17 00:00:00 2001 From: Jason DeVito Date: Tue, 30 Aug 2022 22:02:47 -0500 Subject: [PATCH 3/5] fix: added null checks in BuildDevice with debug statements if null --- .../Crestron IO/Ir/CenIoIr104Controller.cs | 51 +++++++++++++++---- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs index 413f3568..c516c03e 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs @@ -16,46 +16,77 @@ 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 class CenIoIr104Controller : EssentialsDevice, IIROutputPorts + { + private readonly CenIoIr104 _ir104; + /// + /// Constructor + /// + /// + /// + /// public CenIoIr104Controller(string key, string name, CenIoIr104 ir104) : base(key, name) { - Ir104 = ir104; + _ir104 = ir104; } #region IDigitalInputPorts Members + /// + /// IR port collection + /// public CrestronCollection IROutputPorts { - get { return Ir104.IROutputPorts; } + get { return _ir104.IROutputPorts; } } + /// + /// Number of relay ports property + /// public int NumberOfIROutputPorts { - get { return Ir104.NumberOfIROutputPorts; } + get { return _ir104.NumberOfIROutputPorts; } } #endregion } + /// + /// CEN-IO-IR-104 controller fatory + /// public class CenIoIr104ControllerFactory : EssentialsDeviceFactory { + /// + /// Constructor + /// public CenIoIr104ControllerFactory() { TypeNames = new List() { "cenioir104" }; } + /// + /// Build device CEN-IO-IR-104 + /// + /// + /// public override EssentialsDevice BuildDevice(DeviceConfig dc) { - Debug.Console(1, "Factory Attempting to create new CEN-IR-104 Device"); + Debug.Console(1, "Factory Attempting to create new CEN-IO-IR-104 Device"); + + var control = CommFactory.GetControlPropertiesConfig(dc); + if (control == null) + { + Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device"); + return null; + } - var control = CommFactory.GetControlPropertiesConfig(dc); var ipid = control.IpIdInt; - - return new CenIoIr104Controller(dc.Key, dc.Name, new Crestron.SimplSharpPro.GeneralIO.CenIoIr104(ipid, Global.ControlSystem)); + if(ipid != 0) return new CenIoIr104Controller(dc.Key, dc.Name, new CenIoIr104(ipid, Global.ControlSystem)); + + Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device using IP-ID-{0}", ipid); + return null; } } From 457494128832efb0f4aa22a9cd1977921b6c9362 Mon Sep 17 00:00:00 2001 From: Jason DeVito Date: Tue, 30 Aug 2022 22:11:33 -0500 Subject: [PATCH 4/5] fix: updated debug statement for DinCenCnController class referencing building a temp sensor device --- .../Crestron IO/DinCenCn/DinCenCnController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/DinCenCn/DinCenCnController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/DinCenCn/DinCenCnController.cs index 68fedc82..7e9179fe 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/DinCenCn/DinCenCnController.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/DinCenCn/DinCenCnController.cs @@ -34,7 +34,7 @@ namespace PepperDash.Essentials.Core public override EssentialsDevice BuildDevice(DeviceConfig dc) { - Debug.Console(1, "Factory Attempting to create new C2N-RTHS Device"); + Debug.Console(1, "Factory Attempting to create new DIN-CEN-CN2 Device"); var control = CommFactory.GetControlPropertiesConfig(dc); var ipid = control.IpIdInt; From fb689c4484e9f95f58adb83295a75e35ace8217e Mon Sep 17 00:00:00 2001 From: jdevito Date: Wed, 31 Aug 2022 14:43:58 -0500 Subject: [PATCH 5/5] fix: updated CEN-IO classes inheriting from EssentialsDevice to CrestronGenericBaseDevice to resolve activation issues --- .../Inputs/CenIoDigIn104Controller.cs | 17 ++- .../Crestron IO/Ir/CenIoIr104Controller.cs | 120 +++++++++--------- .../Crestron IO/Relay/CenIoRy104Controller.cs | 8 +- 3 files changed, 76 insertions(+), 69 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs index 5112f3aa..bdbcc2e9 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Inputs/CenIoDigIn104Controller.cs @@ -16,7 +16,7 @@ namespace PepperDash.Essentials.Core /// Wrapper class for CEN-IO-DIGIN-104 digital input module /// [Description("Wrapper class for the CEN-IO-DIGIN-104 diginal input module")] - public class CenIoDigIn104Controller : EssentialsDevice, IDigitalInputPorts + public class CenIoDigIn104Controller : CrestronGenericBaseDevice, IDigitalInputPorts { public CenIoDi104 Di104 { get; private set; } @@ -52,10 +52,17 @@ namespace PepperDash.Essentials.Core { 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)); + var control = CommFactory.GetControlPropertiesConfig(dc); + if (control == null) + { + Debug.Console(1, "Factory failed to create a new CEN-DIGIN-104 Device, control properties not found"); + return null; + } + var ipid = control.IpIdInt; + if (ipid != 0) return new CenIoDigIn104Controller(dc.Key, dc.Name, new CenIoDi104(ipid, Global.ControlSystem)); + + Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device using IP-ID-{0}", ipid); + return null; } } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs index c516c03e..3fa45dd7 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Ir/CenIoIr104Controller.cs @@ -1,93 +1,93 @@ -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 +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 : CrestronGenericBaseDevice, IIROutputPorts { - private readonly CenIoIr104 _ir104; - + private readonly CenIoIr104 _ir104; + /// /// Constructor /// /// /// - /// - public CenIoIr104Controller(string key, string name, CenIoIr104 ir104) - : base(key, name) - { - _ir104 = ir104; - } - + /// + public CenIoIr104Controller(string key, string name, CenIoIr104 ir104) + : base(key, name, ir104) + { + _ir104 = ir104; + } + #region IDigitalInputPorts Members /// /// IR port collection /// - public CrestronCollection IROutputPorts - { - get { return _ir104.IROutputPorts; } + public CrestronCollection IROutputPorts + { + get { return _ir104.IROutputPorts; } } /// /// Number of relay ports property /// - public int NumberOfIROutputPorts - { - get { return _ir104.NumberOfIROutputPorts; } - } - + public int NumberOfIROutputPorts + { + get { return _ir104.NumberOfIROutputPorts; } + } + #endregion - } - + } + /// /// CEN-IO-IR-104 controller fatory - /// - public class CenIoIr104ControllerFactory : EssentialsDeviceFactory - { + /// + public class CenIoIr104ControllerFactory : EssentialsDeviceFactory + { /// /// Constructor - /// - public CenIoIr104ControllerFactory() - { - TypeNames = new List() { "cenioir104" }; - } - + /// + public CenIoIr104ControllerFactory() + { + TypeNames = new List() { "cenioir104" }; + } + /// /// Build device CEN-IO-IR-104 /// /// - /// - public override EssentialsDevice BuildDevice(DeviceConfig dc) - { - Debug.Console(1, "Factory Attempting to create new CEN-IO-IR-104 Device"); - + /// + public override EssentialsDevice BuildDevice(DeviceConfig dc) + { + Debug.Console(1, "Factory Attempting to create new CEN-IO-IR-104 Device"); + var control = CommFactory.GetControlPropertiesConfig(dc); if (control == null) { - Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device"); + Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device, control properties not found"); return null; - } - - var ipid = control.IpIdInt; + } + + var ipid = control.IpIdInt; if(ipid != 0) return new CenIoIr104Controller(dc.Key, dc.Name, new CenIoIr104(ipid, Global.ControlSystem)); Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device using IP-ID-{0}", ipid); - return null; - } - } - + return null; + } + } + } \ No newline at end of file diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs index 19ca8438..e9963f4d 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs @@ -10,7 +10,7 @@ namespace PepperDash.Essentials.Core /// Wrapper class for CEN-IO-RY-104 relay module /// [Description("Wrapper class for the CEN-IO-RY-104 relay module")] - public class CenIoRy104Controller : EssentialsDevice, IRelayPorts + public class CenIoRy104Controller : CrestronGenericBaseDevice, IRelayPorts { private readonly CenIoRy104 _ry104; @@ -21,7 +21,7 @@ namespace PepperDash.Essentials.Core /// /// public CenIoRy104Controller(string key, string name, CenIoRy104 ry104) - : base(key, name) + : base(key, name, ry104) { _ry104 = ry104; } @@ -62,8 +62,8 @@ namespace PepperDash.Essentials.Core var controlPropertiesConfig = CommFactory.GetControlPropertiesConfig(dc); if (controlPropertiesConfig == null) - { - Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device"); + { + Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device, control properties not found"); return null; }