mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 13:07:18 +00:00
docs: update XML comments for Essentials Core
This commit is contained in:
parent
0764685c51
commit
f88bb13367
260 changed files with 7018 additions and 1318 deletions
|
|
@ -63,6 +63,10 @@ namespace PepperDash.Essentials.Core
|
|||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the ValueFunc
|
||||
/// </summary>
|
||||
/// <param name="newFunc">New function to set as the ValueFunc</param>
|
||||
public void SetValueFunc(Func<bool> newFunc)
|
||||
{
|
||||
ValueFunc = newFunc;
|
||||
|
|
@ -153,6 +157,10 @@ namespace PepperDash.Essentials.Core
|
|||
LinkedCrestronFeedbacks.Remove(feedback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ToString override
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return (InTestMode ? "TEST -- " : "") + BoolValue.ToString();
|
||||
|
|
|
|||
|
|
@ -48,12 +48,8 @@ namespace PepperDash.Essentials.Core
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the
|
||||
/// Start method
|
||||
/// </summary>
|
||||
/// <param name="timeout"></param>
|
||||
/// <summary>
|
||||
/// Start method
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
if (Timer == null)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,14 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public class BoolFeedbackPulseExtender
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the TimeoutMs
|
||||
/// </summary>
|
||||
public uint TimeoutMs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Feedback
|
||||
/// </summary>
|
||||
public BoolFeedback Feedback { get; private set; }
|
||||
CTimer Timer;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ using Crestron.SimplSharpPro;
|
|||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Abstract base class for BoolOutputLogicals
|
||||
/// </summary>
|
||||
public abstract class BoolFeedbackLogic
|
||||
{
|
||||
/// <summary>
|
||||
|
|
@ -21,13 +23,23 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
protected List<BoolFeedback> OutputsIn = new List<BoolFeedback>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ComputedValue
|
||||
/// </summary>
|
||||
protected bool ComputedValue;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
protected BoolFeedbackLogic()
|
||||
{
|
||||
Output = new BoolFeedback(() => ComputedValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AddOutputIn method
|
||||
/// </summary>
|
||||
/// <param name="output">feedback to add</param>
|
||||
public void AddOutputIn(BoolFeedback output)
|
||||
{
|
||||
// Don't double up outputs
|
||||
|
|
@ -38,9 +50,10 @@ namespace PepperDash.Essentials.Core
|
|||
Evaluate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AddOutputsIn method
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// AddOutputsIn method
|
||||
/// </summary>
|
||||
/// <param name="outputs">feedbacks to add</param>
|
||||
public void AddOutputsIn(List<BoolFeedback> outputs)
|
||||
{
|
||||
foreach (var o in outputs.Where(o => !OutputsIn.Contains(o)))
|
||||
|
|
@ -51,9 +64,10 @@ namespace PepperDash.Essentials.Core
|
|||
Evaluate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RemoveOutputIn method
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// RemoveOutputIn method
|
||||
/// </summary>
|
||||
/// <param name="output">feedback to remove</param>
|
||||
public void RemoveOutputIn(BoolFeedback output)
|
||||
{
|
||||
// Don't double up outputs
|
||||
|
|
@ -64,9 +78,10 @@ namespace PepperDash.Essentials.Core
|
|||
Evaluate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RemoveOutputsIn method
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// RemoveOutputsIn method
|
||||
/// </summary>
|
||||
/// <param name="outputs">feedbacks to remove</param>
|
||||
public void RemoveOutputsIn(List<BoolFeedback> outputs)
|
||||
{
|
||||
foreach (var o in outputs)
|
||||
|
|
@ -77,20 +92,28 @@ namespace PepperDash.Essentials.Core
|
|||
Evaluate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ClearOutputs method
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// ClearOutputs method
|
||||
/// </summary>
|
||||
public void ClearOutputs()
|
||||
{
|
||||
OutputsIn.Clear();
|
||||
Evaluate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AnyInput_OutputChange event handler
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void AnyInput_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
Evaluate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Evaluate method
|
||||
/// </summary>
|
||||
protected abstract void Evaluate();
|
||||
}
|
||||
|
||||
|
|
@ -99,6 +122,9 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public class BoolFeedbackAnd : BoolFeedbackLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// Evaluate method
|
||||
/// </summary>
|
||||
protected override void Evaluate()
|
||||
{
|
||||
var prevValue = ComputedValue;
|
||||
|
|
@ -112,11 +138,14 @@ namespace PepperDash.Essentials.Core
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a BoolFeedbackOr
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Represents a BoolFeedbackOr
|
||||
/// </summary>
|
||||
public class BoolFeedbackOr : BoolFeedbackLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// Evaluate method
|
||||
/// </summary>
|
||||
protected override void Evaluate()
|
||||
{
|
||||
var prevValue = ComputedValue;
|
||||
|
|
@ -130,19 +159,26 @@ namespace PepperDash.Essentials.Core
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a BoolFeedbackLinq
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Represents a BoolFeedbackLinq
|
||||
/// </summary>
|
||||
public class BoolFeedbackLinq : BoolFeedbackLogic
|
||||
{
|
||||
readonly Func<IEnumerable<BoolFeedback>, bool> _predicate;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
public BoolFeedbackLinq(Func<IEnumerable<BoolFeedback>, bool> predicate)
|
||||
: base()
|
||||
{
|
||||
_predicate = predicate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Evaluate method
|
||||
/// </summary>
|
||||
protected override void Evaluate()
|
||||
{
|
||||
var prevValue = ComputedValue;
|
||||
|
|
|
|||
|
|
@ -102,12 +102,19 @@ namespace PepperDash.Essentials.Core
|
|||
if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method that fires event. Use this intstead of calling OutputChange
|
||||
/// </summary>
|
||||
/// <param name="value">value to seed eventArgs</param>
|
||||
protected void OnOutputChange(int value)
|
||||
{
|
||||
if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helper method that fires event. Use this intstead of calling OutputChange
|
||||
/// </summary>
|
||||
/// <param name="value">value to seed eventArgs</param>
|
||||
protected void OnOutputChange(string value)
|
||||
{
|
||||
if (OutputChange != null) OutputChange(this, new FeedbackEventArgs(value));
|
||||
|
|
|
|||
|
|
@ -15,10 +15,15 @@ namespace PepperDash.Essentials.Core
|
|||
/// Gets or sets the BoolValue
|
||||
/// </summary>
|
||||
public bool BoolValue { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IntValue
|
||||
/// </summary>
|
||||
public int IntValue { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UShortValue
|
||||
/// </summary>
|
||||
public ushort UShortValue
|
||||
{
|
||||
get
|
||||
|
|
@ -26,27 +31,41 @@ namespace PepperDash.Essentials.Core
|
|||
return (ushort)IntValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the StringValue
|
||||
/// </summary>
|
||||
public string StringValue { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Type
|
||||
/// </summary>
|
||||
public eFeedbackEventType Type { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for BoolValue
|
||||
/// </summary>
|
||||
/// <param name="value">value to set</param>
|
||||
public FeedbackEventArgs(bool value)
|
||||
{
|
||||
BoolValue = value;
|
||||
Type = eFeedbackEventType.TypeBool;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for IntValue
|
||||
/// </summary>
|
||||
/// <param name="value">value to set</param>
|
||||
public FeedbackEventArgs(int value)
|
||||
{
|
||||
IntValue = value;
|
||||
Type = eFeedbackEventType.TypeInt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for StringValue
|
||||
/// </summary>
|
||||
/// <param name="value">value to set</param>
|
||||
public FeedbackEventArgs(string value)
|
||||
{
|
||||
StringValue = value;
|
||||
|
|
@ -59,8 +78,19 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public enum eFeedbackEventType
|
||||
{
|
||||
/// <summary>
|
||||
/// Boolean type feedback event
|
||||
/// </summary>
|
||||
TypeBool,
|
||||
|
||||
/// <summary>
|
||||
/// Integer type feedback event
|
||||
/// </summary>
|
||||
TypeInt,
|
||||
|
||||
/// <summary>
|
||||
/// String type feedback event
|
||||
/// </summary>
|
||||
TypeString
|
||||
}
|
||||
}
|
||||
|
|
@ -64,6 +64,10 @@ namespace PepperDash.Essentials.Core
|
|||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the ValueFunc
|
||||
/// </summary>
|
||||
/// <param name="newFunc">function to set</param>
|
||||
public void SetValueFunc(Func<int> newFunc)
|
||||
{
|
||||
ValueFunc = newFunc;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
public class SerialFeedback : Feedback
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the SerialValue
|
||||
/// </summary>
|
||||
public override string SerialValue { get { return _SerialValue; } }
|
||||
string _SerialValue;
|
||||
|
||||
|
|
@ -25,11 +28,18 @@ namespace PepperDash.Essentials.Core
|
|||
|
||||
List<StringInputSig> LinkedInputSigs = new List<StringInputSig>();
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
[Obsolete("use constructor with Key parameter. This constructor will be removed in a future version")]
|
||||
public SerialFeedback()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with Key parameter
|
||||
/// </summary>
|
||||
/// <param name="key">Key to find this Feedback</param>
|
||||
public SerialFeedback(string key)
|
||||
: base(key)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@ namespace PepperDash.Essentials.Core
|
|||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the ValueFunc
|
||||
/// </summary>
|
||||
/// <param name="newFunc">function to set</param>
|
||||
public void SetValueFunc(Func<string> newFunc)
|
||||
{
|
||||
ValueFunc = newFunc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue