mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 03:14:57 +00:00
Basic scaffold of VC driver.
This commit is contained in:
@@ -6,6 +6,8 @@ using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.SmartObjects
|
||||
{
|
||||
public class SmartObjectHelperBase
|
||||
@@ -33,13 +35,37 @@ namespace PepperDash.Essentials.Core.SmartObjects
|
||||
SmartObject.SigChange -= this.SmartObject_SigChange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper to get a sig name with debugging when fail
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public BoolOutputSig GetBoolOutputNamed(string name)
|
||||
{
|
||||
if (SmartObject.BooleanOutput.Contains(name))
|
||||
return SmartObject.BooleanOutput[name];
|
||||
else
|
||||
Debug.Console(0, "WARNING: Cannot get signal. Smart object {0} on trilist {1:x2} does not contain signal '{2}'",
|
||||
SmartObject.ID, SmartObject.Device.ID, name);
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets action on signal after checking for existence.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="a"></param>
|
||||
public void SetBoolAction(string name, Action<bool> a)
|
||||
{
|
||||
if (SmartObject.BooleanOutput.Contains(name))
|
||||
SmartObject.BooleanOutput[name].UserObject = a;
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "WARNING: Cannot set action. Smart object {0} on trilist {1:x2} does not contain signal '{2}'",
|
||||
SmartObject.ID, SmartObject.Device.ID, name);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Standard Action listener
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user