tbf/TestBenchFramework/BenchControl/Elde/Diverter/DiverterCfg.cs

58 lines
1.7 KiB
C#

///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.Diverter
{
public class DiverterCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponentCfgCtrl GetControl() { return new DiverterCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition; /// 0..63
public int AdcNr; /// 0..15(?), number of the analog input
public int AdcValueToSink; /// 0..1023
public int AdcValueToTank; /// 0..1023
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
/// Private parameterless constructor invoked by all other (public) constructors
DiverterCfg()
{
Name = "Div";
ParentName = "CB";
BitPosition = 0;
AdcNr = 5; /// Div1: AdcNr=5 , Div2: AdcNr=6
AdcValueToSink = 100;
AdcValueToTank = 500;
StartingLevel = 50;
StoppingLevel = 50;
}
public DiverterCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Bit={2}, ADC#={3}, ADC2Sink={4}, ADC2Tank={5}, StartingLevel={6}%, StoppingLevel={7}%",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
BitPosition,
AdcNr,
AdcValueToSink,
AdcValueToTank,
StartingLevel,
StoppingLevel);
}
}
}