- 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
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using System.IO;
|
|
using System.IO.Ports;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Cameras.CameraRoi
|
|
{
|
|
public class CameraRoiCfg : ComponentCfgBase, IChildComponentCfg
|
|
{
|
|
public int RoiNr; /// ROI number 1..4
|
|
|
|
/// <summary> Procedure parameters </summary>
|
|
[XmlIgnore]
|
|
public RoiProcedureParams ProcParams;
|
|
public override IParamsProvider GetProcedureParams() { return ProcParams; }
|
|
public override IParamsProvider CreateProcedureParams(Entities.Procedure procedure)
|
|
{
|
|
RoiProcedureParams procParams = new RoiProcedureParams();
|
|
procParams.UpdateProcedureParams(Name, procedure);
|
|
return procParams;
|
|
}
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
CameraRoiCfg()
|
|
{
|
|
Name = "ROI";
|
|
ParentName = "Idc";
|
|
RoiNr = 1;
|
|
ProcParams = new RoiProcedureParams();
|
|
}
|
|
|
|
public CameraRoiCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Parent={1}, Roi={2}",
|
|
Name,
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
|
RoiNr);
|
|
}
|
|
}
|
|
}
|