BuiltIn components clean-up.
This commit is contained in:
@@ -33,10 +33,11 @@ namespace TBF.Rig.BuiltIn.Valve
|
||||
public int LagOpening { get { return valveCfg.LagOpening; } }
|
||||
public int LagClosing { get { return valveCfg.LagClosing; } }
|
||||
|
||||
public readonly UInt128 Mask; /// derived from bitPosition in the constructor
|
||||
|
||||
public readonly UInt128 Mask; /// derived from bitPosition in the constructor
|
||||
public int BitPosition { get { return valveCfg.BitNr; } }
|
||||
|
||||
public bool State { get { return (controlBoard.Route & Mask) != 0; } }
|
||||
|
||||
|
||||
public Valve() { }
|
||||
|
||||
@@ -48,26 +49,20 @@ namespace TBF.Rig.BuiltIn.Valve
|
||||
controlBoard = TbfComponents.FindComponent(cfg.ParentName, components) as TBF.Rig.ControlBoard.IControlBoard;
|
||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
if (valveCfg.BitNr < 0 || valveCfg.BitNr >= 128)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("position");
|
||||
}
|
||||
this.Mask = (((UInt128)1) << valveCfg.BitNr);
|
||||
if (valveCfg.CoupledToName != null)
|
||||
{
|
||||
coupledTo = (IValve)TbfComponents.FindComponent(valveCfg.CoupledToName, components);
|
||||
}
|
||||
|
||||
if (valveCfg.CoupledToName != null)
|
||||
{
|
||||
coupledTo = (IValve)TbfComponents.FindComponent(valveCfg.CoupledToName, components);
|
||||
}
|
||||
if (valveCfg.BitNr < 0 || valveCfg.BitNr >= 128)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("position");
|
||||
}
|
||||
Mask = (((UInt128)1) << valveCfg.BitNr);
|
||||
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public bool State
|
||||
{
|
||||
get { return (controlBoard.Route & Mask) != 0; }
|
||||
}
|
||||
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCfgChange(object sender, CfgChangeArgs args)
|
||||
|
||||
Reference in New Issue
Block a user