FlowStableSec parameter added to RegulValve

This commit is contained in:
Milan Hanajik
2014-09-08 20:24:46 +02:00
parent cc2a24cee5
commit d14cb175a6
8 changed files with 86 additions and 76 deletions
@@ -16,6 +16,7 @@ namespace TBF.BenchControl.Elde.RegulValve
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.
@@ -26,6 +27,7 @@ namespace TBF.BenchControl.Elde.RegulValve
public RegulValveCfg()
{
StableTimeMs = 500;
FlowStableSec = 5;
}
/// <summary>
/// Regulation valve configuration parameters
@@ -35,7 +37,7 @@ namespace TBF.BenchControl.Elde.RegulValve
/// <param name="dacValueClosed">0..1023</param>
/// <param name="dacValueOpen">0..1023</param>
/// <param name="pidCoef">1..100</param>
public RegulValveCfg(IComponentFactory factory, string name, string parentName, int position, int dacValueClosed, int dacValueOpen, int pidCoef, int stableTimeMs, bool storedPositionReuse)
public RegulValveCfg(IComponentFactory factory, string name, string parentName, int position, int dacValueClosed, int dacValueOpen, int pidCoef, int stableTimeMs, bool storedPositionReuse, int flowStableSec)
: base(factory, name, parentName)
{
if (position < 0 || position > 7) throw new ArgumentOutOfRangeException("position");
@@ -49,17 +51,18 @@ namespace TBF.BenchControl.Elde.RegulValve
this.PidCoef = pidCoef;
this.StableTimeMs = stableTimeMs;
this.StoredPositionReuse = storedPositionReuse;
this.FlowStableSec = flowStableSec;
}
public IComponentCfg Clone()
{
return new RegulValveCfg(Factory, Name, ParentName, Position, DacValueClosed, DacValueOpen, PidCoef, StableTimeMs, StoredPositionReuse);
return new RegulValveCfg(Factory, Name, ParentName, Position, DacValueClosed, DacValueOpen, PidCoef, StableTimeMs, StoredPositionReuse, FlowStableSec);
}
public string ToString(int i)
{
return string.Format("position={0}, DAC-closed={1}, DAC-open={2}, PID={3}, posReuse={4}",
Position, DacValueClosed, DacValueOpen, PidCoef, StoredPositionReuse);
return string.Format("position={0}, DAC-closed={1}, DAC-open={2}, PID={3}, posReuse={4}, flowStableSec={5}",
Position, DacValueClosed, DacValueOpen, PidCoef, StoredPositionReuse, FlowStableSec);
}
public TBF.Entities.Component CreateDbEntity()