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:
Milan Hanajik
2015-01-02 12:51:27 +01:00
parent 752719bd62
commit 94de991bf6
126 changed files with 1117 additions and 1629 deletions
@@ -1,22 +1,19 @@
using System;
using System.Collections.Generic;
using log4net;
using TBF.BenchControl;
namespace TBF.BenchControl.TestMethods.CombinedMeters
{
public class TestMethod : Generic.IComponent, GenericDevices.ITestMethod, ISequence
public class TestMethod : ComponentBase, GenericDevices.ITestMethod, ISequence
{
readonly TestMethodCfg testMethodCfg;
public Generic.IComponentCfg Cfg { get { return testMethodCfg; } }
public static void ResetStaticProperties() { }
public string Name { get { return testMethodCfg.Name; } }
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
public override string ToString() { return string.Format("TestMethods.CombinedMeters({0})", Cfg.ToString(1)); }
public TestMethod(TestMethodCfg cfg)
: base(cfg)
{
if (cfg == null) throw new ArgumentNullException("cfg");
this.testMethodCfg = cfg;
log.Debug(this.ToString());
}
public IList<Event> Execute(Entities.Test test)
@@ -7,8 +7,8 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
/// Parameterless constructor
public TestMethodCfg()
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
Name = "CombinedMeters";
ParentName = string.Empty;
@@ -7,11 +7,6 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
{
public string ClassName { get { return "CombinedMeters"; } }
public bool HasProcedureParams { get { return false; } }
public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; }
public bool HasTestParams { get { return false; } }
public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }