From 33f0a1fe320a69cee476b67cbad389bf910ad787 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 1 May 2018 16:45:18 -0600 Subject: [PATCH] More progress on relay based shade control --- .../PepperDash_Essentials_Core.csproj | 2 ++ .../Shades/Shade Interfaces.cs | 15 +++++++-- .../Shades/ShadeBase.cs | 12 ------- .../Shades/ShadeController.cs | 33 +++++++++++++++++++ .../Environment/Crestron Lighting/Din8sw8.cs | 27 +++++++++++++++ .../Environment/Lutron/LutronQuantum.cs | 2 +- .../Environment/Somfy/RelayControlledShade.cs | 33 +++++++++++++++++++ .../Essentials Devices Common.csproj | 6 ++++ .../PepperDashEssentials/ControlSystem.cs | 10 ++++-- 9 files changed, 123 insertions(+), 17 deletions(-) delete mode 100644 Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs create mode 100644 Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs create mode 100644 Essentials Devices Common/Essentials Devices Common/Environment/Crestron Lighting/Din8sw8.cs create mode 100644 Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index ad873245..7a7e5c9f 100644 --- a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -182,6 +182,8 @@ + + diff --git a/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs b/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs index 7248a38b..35c0b97f 100644 --- a/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs +++ b/Essentials Core/PepperDashEssentialsBase/Shades/Shade Interfaces.cs @@ -6,7 +6,18 @@ using Crestron.SimplSharp; namespace PepperDash.Essentials.Core.Shades { - public class Shade Interfaces - { + public interface IShades + { + List Shades { get; } + } + + /// + /// Requirements for a device that implements basic shade control + /// + public interface iShadesRaiseLower + { + void Raise(); + void Lower(); + void Stop(); } } \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs b/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs deleted file mode 100644 index 2f6076a6..00000000 --- a/Essentials Core/PepperDashEssentialsBase/Shades/ShadeBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -namespace PepperDash.Essentials.Core.Shades -{ - public class ShadeBase - { - } -} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs b/Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs new file mode 100644 index 00000000..db538fec --- /dev/null +++ b/Essentials Core/PepperDashEssentialsBase/Shades/ShadeController.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; + +namespace PepperDash.Essentials.Core.Shades +{ + public class ShadeController : Device, IShades + { + public List IShades.Shades { get; private set; } + + } + + public abstract class ShadeBase : Device, iShadesRaiseLower + { + public ShadeBase(string key, string name) + : base(key, name) + { + + } + + #region iShadesRaiseLower Members + + public void iShadesRaiseLower.Raise(); + public void iShadesRaiseLower.Lower(); + public void iShadesRaiseLower.Stop(); + + #endregion + } +} \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Environment/Crestron Lighting/Din8sw8.cs b/Essentials Devices Common/Essentials Devices Common/Environment/Crestron Lighting/Din8sw8.cs new file mode 100644 index 00000000..11339513 --- /dev/null +++ b/Essentials Devices Common/Essentials Devices Common/Environment/Crestron Lighting/Din8sw8.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro; +using Crestron.SimplSharpPro.Lighting; + +using PepperDash.Core; +using PepperDash.Essentials.Core.CrestronIO; + +namespace PepperDash.Essentials.Devices.Common.Environment.Lighting +{ + public class Din8sw8Controller : Device + { + // Need to figure out some sort of interface to make these switched outputs behave like processor relays so they can be used interchangably + + public Din8Sw8 SwitchModule { get; private set; } + + public Din8sw8Controller(string key, string cresnetId) + : base(key) + { + + } + + } +} \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs b/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs index 82ce4e1d..83562cc2 100644 --- a/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs +++ b/Essentials Devices Common/Essentials Devices Common/Environment/Lutron/LutronQuantum.cs @@ -236,7 +236,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron public class LutronQuantumPropertiesConfig { public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } - public ControlPropertiesConfig Control { get; set; } + public ControlPropertiesConfig Control { get; set; } public int IntegrationId { get; set; } public List Scenes{ get; set; } diff --git a/Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs b/Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs new file mode 100644 index 00000000..98814172 --- /dev/null +++ b/Essentials Devices Common/Essentials Devices Common/Environment/Somfy/RelayControlledShade.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; +using PepperDash.Essentials.Core.Shades; + +namespace PepperDash.Essentials.Devices.Common.Environment.Somfy +{ + public class RelayControlledShade : ShadeBase + { + + public RelayControlledShade(string key, string name, RelayControlledShadeConfigProperties props) + : base(key, name) + { + + } + + + public void Raise() + { + + } + + } + + public class RelayControlledShadeConfigProperties + { + + } +} \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index e44f2459..78ed5a13 100644 --- a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -58,6 +58,10 @@ False ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll + + False + ..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll + False @@ -118,7 +122,9 @@ + + diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 3beb8ac4..79034231 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -76,16 +76,22 @@ namespace PepperDash.Essentials var versionString = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build); + string directoryPrefix; + + //directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory(); +#warning ^ For use with beta Include4.dat for XiO Edge + directoryPrefix = ""; + if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) { - filePathPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory() + dirSeparator + "NVRAM" + filePathPrefix = directoryPrefix + dirSeparator + "NVRAM" + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator; Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", versionString); } else { - filePathPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory() + dirSeparator + "User" + dirSeparator; + filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator; Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on XiO Edge Server", versionString); }