- reconfigured to use Munich component and 5 watermeters
- valve categories used in paths, Category property added to IValve
This commit is contained in:
@@ -7,6 +7,7 @@ namespace TBF.BenchControl.Elde.Valve
|
||||
public class ValveCfg : ComponentCfgBase, IChildComponentCfg
|
||||
{
|
||||
public int BitPosition; /// Bit-position
|
||||
public ValveCategory Category; /// None, Feeding, Bench or Output
|
||||
public string CoupledToName; /// Name of the coupled valve or null
|
||||
public bool Invert; /// The coupled valve has inverted position
|
||||
public int LagOpening; /// Delay (referred to the master valve) when opening this valve in [s]
|
||||
@@ -18,30 +19,37 @@ namespace TBF.BenchControl.Elde.Valve
|
||||
{
|
||||
}
|
||||
/// Constructor 1
|
||||
public ValveCfg(IComponentFactory factory, string name, string parentName, int bitPosition, string coupledToName, bool invert, int lagOpening, int lagClosing)
|
||||
public ValveCfg(IComponentFactory factory, string name, string parentName, int bitPosition,
|
||||
ValveCategory category, string coupledToName, bool invert, int lagOpening, int lagClosing)
|
||||
: base(factory, name, parentName)
|
||||
{
|
||||
this.BitPosition = bitPosition;
|
||||
this.Category = category;
|
||||
this.CoupledToName = coupledToName;
|
||||
this.Invert = invert;
|
||||
this.LagOpening = lagOpening;
|
||||
this.LagClosing = lagClosing;
|
||||
}
|
||||
/// Constructor 2 without CoupledTo valve
|
||||
public ValveCfg(IComponentFactory factory, string name, string parentName, int bitPosition)
|
||||
: this(factory, name, parentName, bitPosition, null, false, 0, 0)
|
||||
public ValveCfg(IComponentFactory factory, string name, string parentName, int bitPosition, ValveCategory category)
|
||||
: this(factory, name, parentName, bitPosition, category, null, false, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public IComponentCfg Clone()
|
||||
{
|
||||
return new ValveCfg(Factory, Name, ParentName, BitPosition, CoupledToName, Invert, LagOpening, LagClosing);
|
||||
return new ValveCfg(Factory, Name, ParentName, BitPosition, Category, CoupledToName, Invert, LagOpening, LagClosing);
|
||||
}
|
||||
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("bit={0}, coupledTo={1}, invert={2}, lagOpen={3}, lagClose={4}",
|
||||
BitPosition, CoupledToName, (Invert ? "yes" : "no"), LagOpening, LagClosing);
|
||||
return string.Format("bit={0}, cat={1}, coupledTo={2}, invert={3}, lagOpen={4}, lagClose={5}",
|
||||
BitPosition,
|
||||
Category,
|
||||
(string.IsNullOrEmpty(CoupledToName) ? "---" : CoupledToName),
|
||||
(Invert ? "yes" : "no"),
|
||||
LagOpening,
|
||||
LagClosing);
|
||||
}
|
||||
|
||||
public TBF.Entities.Component CreateDbEntity()
|
||||
|
||||
Reference in New Issue
Block a user