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,22 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
{
|
||||
public class RoiDetection : Generic.IComponent, GenericDevices.ITestMethod, ISequence
|
||||
public class RoiDetection : ComponentBase, GenericDevices.ITestMethod, ISequence
|
||||
{
|
||||
readonly RoiDetectionCfg roiDetectionCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return roiDetectionCfg; } }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public string Name { get { return roiDetectionCfg.Name; } }
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RoiDetection));
|
||||
public override string ToString() { return string.Format("TestMethods.CameraRoiDetection({0})", Cfg.ToString(1)); }
|
||||
|
||||
public RoiDetection(RoiDetectionCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.roiDetectionCfg = cfg;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public IList<Event> Execute(Entities.Test test)
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
{
|
||||
public class RoiDetectionCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
/// Parameterless constructor
|
||||
public RoiDetectionCfg()
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
RoiDetectionCfg()
|
||||
{
|
||||
Name = "RoiDetection";
|
||||
ParentName = string.Empty;
|
||||
|
||||
@@ -6,10 +6,6 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
public class RoiDetectionFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "ROI Detection"; } }
|
||||
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