Everything works OK after serious changes:
- all components, componentCfg-s and parameter providers use base classes - less boilerplate code, simpler access to test/procedure parameters from code - CreateTestParams(test), CreateProcedureParams(procedure) methods added - TestBenchSim class is made static, it is not inheritted by any device anymore
This commit is contained in:
@@ -6,24 +6,14 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
{
|
||||
public class Pump : ComponentBase, GenericDevices.IPumpFM, GenericDevices.IValve, IOperation
|
||||
{
|
||||
/// <summary>
|
||||
/// Info: StartMassMeasurement() and "Balance response = .., Mass = ..."
|
||||
/// Warn: Start measurement when busy is true
|
||||
/// </summary>
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Pump));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Pump(name={0}, bit={1}, idx={2})", Name, bitPosition, FMIndex);
|
||||
}
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Pump));
|
||||
public override string ToString() { return string.Format("PumpWithFM({0})", Cfg.ToString(1)); }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public int Delay { get { return (Cfg as PumpCfg).Delay; } }
|
||||
readonly PumpCfg pumpCfg;
|
||||
|
||||
public int Delay { get { return pumpCfg.Delay; } }
|
||||
public ValveCategory Category { get { return ValveCategory.Feeding; } } /// Pump category is Feeding
|
||||
|
||||
public float Power { get { return (TestParams is FMPumpTestParams) ? (TestParams as FMPumpTestParams).Power : 0; } }
|
||||
|
||||
public float Power { get { return pumpCfg.TestParams.Power; } }
|
||||
public GenericDevices.IValve CoupledTo { get { return null; } }
|
||||
public bool InvertCouple { get { return false; } }
|
||||
public int LagOpening { get { return 0; } }
|
||||
@@ -45,14 +35,14 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
public Pump(PumpCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
pumpCfg = cfg;
|
||||
|
||||
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
this.bitPosition = cfg.BitPosition;
|
||||
this.Mask = (((ulong)1) << bitPosition);
|
||||
this.FMIndex = cfg.FMIndex;
|
||||
bitPosition = pumpCfg.BitPosition;
|
||||
Mask = (((ulong)1) << pumpCfg.BitPosition);
|
||||
FMIndex = pumpCfg.FMIndex;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user