tbf/TestBenchFramework/BenchControl/BenchId/ComponentCfg.cs
2015-04-15 20:32:56 +02:00

46 lines
1.2 KiB
C#

///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchId
{
/// <summary>
/// Holds information identifying the test bench - serializable configuration.
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Component(this); }
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
///
/// Serialized parameters
///
public int TestBenchNr;
/// Private parameterless constructor invoked by all other (public) constructors
ComponentCfg()
{
Name = "Bench-ID";
ParentName = string.Empty;
TestBenchNr = 1;
}
public ComponentCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, TestBenchNr={1}",
Name,
TestBenchNr);
}
}
}