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:
@@ -1,18 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.ResultsWriters.Basic
|
||||
{
|
||||
public class Writer : Generic.IComponent, IOperation, GenericDevices.IResultsWriter
|
||||
public class Writer : ComponentBase, IOperation, GenericDevices.IResultsWriter
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Writer));
|
||||
public override string ToString() { return string.Format("ResultsWriters.Basic({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly WriterCfg writerCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return writerCfg; } }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public string Name { get { return writerCfg.Name; } }
|
||||
|
||||
/// <summary>
|
||||
/// Results to print
|
||||
@@ -22,9 +21,10 @@ namespace TBF.BenchControl.ResultsWriters.Basic
|
||||
StreamWriter writer;
|
||||
|
||||
public Writer(WriterCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.writerCfg = cfg;
|
||||
writerCfg = cfg;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace TBF.BenchControl.ResultsWriters.Basic
|
||||
{
|
||||
public class WriterCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
/// Parameterless constructor
|
||||
public WriterCfg()
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
WriterCfg()
|
||||
{
|
||||
Name = "BasicResultsWriter";
|
||||
ParentName = string.Empty;
|
||||
|
||||
@@ -6,10 +6,6 @@ namespace TBF.BenchControl.ResultsWriters.Basic
|
||||
public class WriterFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "BasicResultsWriter"; } }
|
||||
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 1; } }
|
||||
|
||||
Reference in New Issue
Block a user