feat(SigCommands): #759 Adds SigCommand concept for each data type

This commit is contained in:
Neil Dorin
2021-07-26 17:57:35 -06:00
parent 10f5516a5a
commit 83525b721b
7 changed files with 321 additions and 12 deletions

View File

@@ -62,6 +62,7 @@ namespace PepperDash.Essentials.Core
ValueFunc = valueFunc;
}
public override void FireUpdate()
{
bool newValue = InTestMode ? TestValue : ValueFunc.Invoke();

View File

@@ -42,8 +42,6 @@ namespace PepperDash.Essentials.Core
Key = key;
}
/// <summary>
/// Clears test mode and fires update.
/// </summary>
@@ -53,9 +51,9 @@ namespace PepperDash.Essentials.Core
FireUpdate();
}
/// <summary>
/// Fires an update synchronously
/// </summary>
/// <summary>
/// Computes the value by running the ValueFunc and if the value has changed, updates the linked sigs and fires the OnOutputChange event
/// </summary>
public abstract void FireUpdate();
/// <summary>
@@ -66,13 +64,7 @@ namespace PepperDash.Essentials.Core
CrestronInvoke.BeginInvoke(o => FireUpdate());
}
///// <summary>
///// Helper method that fires event. Use this intstead of calling OutputChange
///// </summary>
//protected void OnOutputChange()
//{
// if (OutputChange != null) OutputChange(this, EventArgs.Empty);
//}
// Helper Methods for firing event
protected void OnOutputChange(bool value)
{