using System; using System.Collections.Generic; using System.Linq; using System.Text; using Crestron.SimplSharp; using Crestron.SimplSharpPro; namespace PepperDash.Essentials.Core { /// /// Encapsulates a string-named, joined and typed command to a device /// [Obsolete()] public class DevAction { public Cue Cue { get; private set; } public Action Action { get; private set; } public DevAction(Cue cue, Action action) { Cue = cue; Action = action; } } public enum eCueType { Bool, Int, String, Void, Other } /// /// The Cue class is a container to represent a name / join number / type for simplifying /// commands coming into devices. /// public class Cue { public string Name { get; private set; } public uint Number { get; private set; } public eCueType Type { get; private set; } public Cue(string name, uint join, eCueType type) { Name = name; Number = join; Type = type; } /// /// Override that prints out the cue's data /// public override string ToString() { return string.Format("{0} Cue '{1}'-{2}", Type, Name, Number); } ///// ///// Returns a new Cue with JoinNumber offset ///// //public Cue GetOffsetCopy(uint offset) //{ // return new Cue(Name, Number + offset, Type); //} /// /// Helper method to create a Cue of Bool type /// /// Cue public static Cue BoolCue(string name, uint join) { return new Cue(name, join, eCueType.Bool); } /// /// Helper method to create a Cue of ushort type /// /// Cue public static Cue UShortCue(string name, uint join) { return new Cue(name, join, eCueType.Int); } /// /// Helper method to create a Cue of string type /// /// Cue public static Cue StringCue(string name, uint join) { return new Cue(name, join, eCueType.String); } public static readonly Cue DefaultBoolCue = new Cue("-none-", 0, eCueType.Bool); public static readonly Cue DefaultIntCue = new Cue("-none-", 0, eCueType.Int); public static readonly Cue DefaultStringCue = new Cue("-none-", 0, eCueType.String); } }