tbf/TestBenchFramework/BenchControl/Elde/PumpWithFM/PumpCfg.cs
Milan Hanajik 94de991bf6 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
2015-01-02 12:51:27 +01:00

52 lines
1.4 KiB
C#

using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.PumpWithFM
{
public class PumpCfg : ComponentCfgBase, IChildComponentCfg
{
public int BitPosition;
public int FMIndex;
public int Delay;
/// <summary> Test parameters </summary>
[XmlIgnore]
public FMPumpTestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; }
public override IParamsProvider CreateTestParams(Entities.Test test)
{
FMPumpTestParams testParams = new FMPumpTestParams();
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors
PumpCfg()
{
Name = "Pump";
ParentName = "CB";
BitPosition = 0;
FMIndex = 0;
Delay = 1;
TestParams = new FMPumpTestParams();
}
public PumpCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Bit={2}, FMIndex={3}, Delay={4}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
BitPosition,
FMIndex,
Delay);
}
}
}