tbf/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs
Milan Hanajik 94de991bf6 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
2015-01-02 12:51:27 +01:00

58 lines
2.0 KiB
C#

using System;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.RegulValve
{
public class RegulValveCfg : ComponentCfgBase, IChildComponentCfg
{
public int Idx1; /// 1..7
public int DacValueClosed; /// 0..1023
public int DacValueOpen; /// 0..1023
public int PidCoef; /// 1..100
public int StableTimeMs; /// 200..1500 ms
public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions
public int FlowStableSec; /// 0..60 sec
/// <summary>
/// Stabilization time when setting the flow: 0=200ms, step 50ms, max. 1.5 sec.
/// </summary>
public int StableTime { get { return (StableTimeMs - 200) / 50; } }
/// Private parameterless constructor invoked by all other (public) constructors
RegulValveCfg()
{
Name = "RegulationValve";
ParentName = "CB";
Idx1 = 1;
DacValueClosed = 100;
DacValueOpen = 500;
PidCoef = 20;
StableTimeMs = 500;
StoredPositionReuse = false;
FlowStableSec = 5;
}
public RegulValveCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Idx1={2}, ADC-Closed={3}, ADC-Open={4}, PID={5}, StabTm={6}ms, PosReuse={7}, FlowStable={8}s",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
Idx1,
DacValueClosed,
DacValueOpen,
PidCoef,
StableTimeMs,
StoredPositionReuse,
FlowStableSec);
}
}
}