From bf347bbf04716fadeb4b0002829e34389d6185d0 Mon Sep 17 00:00:00 2001 From: Nick Genovese Date: Thu, 2 Nov 2023 09:42:43 -0400 Subject: [PATCH] feature: removed din8sw8 --- .../Environment/Crestron Lighting/Din8sw8.cs | 106 ------------------ 1 file changed, 106 deletions(-) delete mode 100644 src/PepperDash.Essentials.Devices.Common/Environment/Crestron Lighting/Din8sw8.cs diff --git a/src/PepperDash.Essentials.Devices.Common/Environment/Crestron Lighting/Din8sw8.cs b/src/PepperDash.Essentials.Devices.Common/Environment/Crestron Lighting/Din8sw8.cs deleted file mode 100644 index b262ef84..00000000 --- a/src/PepperDash.Essentials.Devices.Common/Environment/Crestron Lighting/Din8sw8.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro; -using Crestron.SimplSharpPro.DeviceSupport; -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 : 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 - - public Din8Sw8 SwitchModule { get; private set; } - - /// - /// Collection of generic switched outputs - /// - public Dictionary SwitchedOutputs { get; private set; } - - public Din8sw8Controller(string key, uint cresnetId) - : base(key) - { - SwitchedOutputs = new Dictionary(); - - SwitchModule = new Din8Sw8(cresnetId, Global.ControlSystem); - - if (SwitchModule.Register() != eDeviceRegistrationUnRegistrationResponse.Success) - { - Debug.Console(2, this, "Error registering Din8sw8. Reason: {0}", SwitchModule.RegistrationFailureReason); - } - - PopulateDictionary(); - } - - public override bool CustomActivate() - { - - - return base.CustomActivate(); - } - - /// - /// Populates the generic collection with the loads from the Crestron collection - /// - void PopulateDictionary() - { - foreach (var item in SwitchModule.SwitchedLoads) - { - SwitchedOutputs.Add(item.Number, new Din8sw8Output(item)); - } - } - } - - /// - /// Wrapper class to - /// - public class Din8sw8Output : ISwitchedOutput - { - SwitchedLoadWithOverrideParameter SwitchedOutput; - - public BoolFeedback OutputIsOnFeedback { get; protected set; } - - public Din8sw8Output(SwitchedLoadWithOverrideParameter switchedOutput) - { - SwitchedOutput = switchedOutput; - - OutputIsOnFeedback = new BoolFeedback(new Func(() => SwitchedOutput.IsOn)); - } - - public void On() - { - SwitchedOutput.FullOn(); - } - - public void Off() - { - SwitchedOutput.FullOff(); - } - } - - public class Din8sw8ControllerFactory : EssentialsDeviceFactory - { - public Din8sw8ControllerFactory() - { - TypeNames = new List() { "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); - - } - } - -} \ No newline at end of file