BuiltIn components clean-up.

This commit is contained in:
Milan Hanajik
2021-04-02 20:27:02 +02:00
parent ce0b8af4a0
commit bb3a6ff4f3
5 changed files with 32 additions and 42 deletions
+5 -13
View File
@@ -15,10 +15,8 @@ namespace TBF.Rig.BuiltIn.ValveEx
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
readonly ValveCfg valveCfg;
public readonly UInt128 Mask; /// derived from bitPosition in the constructor
///
public readonly IValve[] InputValves;
public readonly IValve[] InputValves;
public readonly UInt128 Mask; /// derived from bitPosition in the constructor
public Valve() { }
@@ -27,15 +25,6 @@ namespace TBF.Rig.BuiltIn.ValveEx
: base(cfg)
{
valveCfg = cfg as ValveCfg;
//controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
//if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
if (valveCfg.BitPosition < 0 || valveCfg.BitPosition >= 128)
{
throw new ArgumentOutOfRangeException("position");
}
this.Mask = (((UInt128)1) << valveCfg.BitPosition);
InputValves = new IValve[valveCfg.InputValvesCount];
InputValves[0] = TbfComponents.FindComponent(valveCfg.Input1, components) as IValve;
@@ -53,9 +42,12 @@ namespace TBF.Rig.BuiltIn.ValveEx
InputValves[4] = TbfComponents.FindComponent(valveCfg.Input5, components) as IValve;
}
Mask = (((UInt128)1) << valveCfg.BitPosition);
log.Warn(this.ToString());
}
public void UpdateRoute(ref UInt128 route)
{
bool output;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace TBF.Rig.BuiltIn.ValveEx
///
/// Serialized parameters
///
public int BitPosition; /// Bit-position
public int BitPosition; /// Bit-position 0 .. 127
///
public ValveExOperation LogicalOp; /// Logical operation between input valves
public bool InvertOutput; /// Invert the output of logical operation