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
@@ -2,33 +2,28 @@
using System.Collections.Generic;
using System.Xml.Serialization;
using log4net;
using TBF.Entities;
using TBF.BenchControl;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchId
{
/// <summary>
/// Holds information identifying the test bench.
/// </summary>
public class Component : ComponentBase, Generic.IComponent
public class Component : ComponentBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
{
return string.Format("BenchId: Name={0}, TestBenchNr={1}", benchIdCfg.Name, TestBenchNr);
}
public override string ToString() { return string.Format("BenchId({0})", Cfg.ToString(1)); }
readonly ComponentCfg benchIdCfg;
public static void ResetStaticProperties() { }
public int TestBenchNr { get { return benchIdCfg.TestBenchNr; } }
public Component(ComponentCfg cfg)
: base(cfg)
{
if (cfg == null) throw new ArgumentNullException("cfg");
this.benchIdCfg = cfg;
benchIdCfg = cfg;
log.Debug(this.ToString());
}
}
@@ -11,8 +11,8 @@ namespace TBF.BenchControl.BenchId
{
public int TestBenchNr;
/// Parameterless constructor, sets default values
public ComponentCfg()
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg()
{
Name = "Bench-ID";
ParentName = string.Empty;
@@ -6,10 +6,6 @@ namespace TBF.BenchControl.BenchId
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return "Bench-ID"; } }
public bool HasProcedureParams { get { return false; } }
public bool HasTestParams { get { return false; } }
public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; }
public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return int.MaxValue; } }