- 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
57 lines
2.2 KiB
C#
57 lines
2.2 KiB
C#
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Elde.Valve
|
|
{
|
|
public class ValveCfg : ComponentCfgBase, IChildComponentCfg
|
|
{
|
|
public int BitPosition; /// Bit-position
|
|
public ValveCategory Category; /// None, Feeding, Bench or Output
|
|
public int OpenCloseTime; /// Delay for SetValvesOp operations
|
|
public bool Inverted; /// The valve is inverted: 0=open, 1=closed
|
|
///
|
|
public string CoupledToName; /// Name of the coupled valve or null
|
|
public bool InvertCouple; /// The coupled valve has inverted position
|
|
public int LagOpening; /// Delay (referred to the master valve) when opening this valve in [s]
|
|
public int LagClosing; /// Delay (referred to the master valve) when closing this valve in [s]
|
|
/// Negative values of delays mean an earlier function of the coupled valve.
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
ValveCfg()
|
|
{
|
|
Name = "V";
|
|
ParentName = "CB";
|
|
BitPosition = 0;
|
|
Category = ValveCategory.None;
|
|
OpenCloseTime = 1;
|
|
Inverted = false;
|
|
CoupledToName = string.Empty;
|
|
InvertCouple = false;
|
|
LagOpening = 0;
|
|
LagClosing = 0;
|
|
}
|
|
|
|
public ValveCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Parent={1}, Bit={2}, Inv.={3}, Delay={4}s, Cat.={5}, CoupledTo={6}, Inv.Couple={7}, LagOpen={8}s, LagClose={9}s",
|
|
Name,
|
|
string.IsNullOrEmpty(ParentName) ? "-" : ParentName,
|
|
BitPosition,
|
|
Inverted ? "yes" : "no",
|
|
OpenCloseTime,
|
|
Category,
|
|
string.IsNullOrEmpty(CoupledToName) ? "-" : CoupledToName,
|
|
InvertCouple ? "yes" : "no",
|
|
LagOpening,
|
|
LagClosing);
|
|
}
|
|
}
|
|
}
|