tbf/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs

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; } }
/// Parameterless constructor
public 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);
}
}
}