2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
|
|
|
|
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
|
|
|
|
///
|
|
|
|
|
|
using System.IO;
|
2015-01-02 18:14:19 +00:00
|
|
|
|
using System.Collections.Generic;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
using TBF.BenchControl.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TBF.BenchControl.Elde.Diverter
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DiverterCfg : ComponentCfgBase, IChildComponentCfg
|
|
|
|
|
|
{
|
2015-01-02 18:14:19 +00:00
|
|
|
|
public IComponent GetComponent(IList<IComponent> components) { return new Diverter(this, components); }
|
|
|
|
|
|
public IComponentCfgCtrl GetControl() { return new DiverterCfgCtrl(); }
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Serialized parameters
|
|
|
|
|
|
///
|
2015-03-24 01:45:36 +00:00
|
|
|
|
public int BitPosition; /// 0..63
|
2015-04-18 05:31:52 +00:00
|
|
|
|
public int StartingLevel; /// 0..100 in %, threshold for the ADC value to start the test
|
|
|
|
|
|
public int StoppingLevel; /// 0..100 in %, threshold for the ADC value to start the test
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2014-12-31 12:46:33 +00:00
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
|
|
|
|
DiverterCfg()
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
2014-12-29 15:00:27 +00:00
|
|
|
|
Name = "Div";
|
|
|
|
|
|
ParentName = "CB";
|
|
|
|
|
|
BitPosition = 0;
|
2015-04-18 05:31:52 +00:00
|
|
|
|
StartingLevel = 50;
|
|
|
|
|
|
StoppingLevel = 50;
|
2015-03-24 01:45:36 +00:00
|
|
|
|
}
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2014-12-29 15:00:27 +00:00
|
|
|
|
public DiverterCfg(IComponentFactory factory)
|
|
|
|
|
|
: this()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Factory = factory;
|
|
|
|
|
|
}
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
public string ToString(int i)
|
|
|
|
|
|
{
|
2015-03-24 01:45:36 +00:00
|
|
|
|
return string.Format("Name={0}, Parent={1}, Bit={2}, StartEdge={3}%, StopEdge={4}%",
|
2014-12-31 12:46:33 +00:00
|
|
|
|
Name,
|
2014-12-29 15:00:27 +00:00
|
|
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
2015-03-24 01:45:36 +00:00
|
|
|
|
BitPosition,
|
2015-04-18 05:31:52 +00:00
|
|
|
|
StartingLevel,
|
|
|
|
|
|
StoppingLevel);
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|