- Part field (int) added to Test and TestResult, shown and processed in UI in ProcedureDlg
62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Elde.RegulValve
|
|
{
|
|
public class RegulValveCfg : ComponentCfgBase, IChildComponentCfg
|
|
{
|
|
public IComponent GetComponent(IList<IComponent> components) { return new RegulValve(this, components); }
|
|
public IComponentCfgCtrl GetControl() { return new RegulValveCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public int Idx1; /// 1..7
|
|
public int DacValueClosed; /// 0..1023
|
|
public int DacValueOpen; /// 0..1023
|
|
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;
|
|
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}, StabTm={5}ms, PosReuse={6}, FlowStable={7}s",
|
|
Name,
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
|
Idx1,
|
|
DacValueClosed,
|
|
DacValueOpen,
|
|
StableTimeMs,
|
|
StoredPositionReuse,
|
|
FlowStableSec);
|
|
}
|
|
}
|
|
}
|