Initial commit almost identical to SVN-repo rev.340
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
|
||||
namespace TBF.BenchControl
|
||||
{
|
||||
public class BenchPath
|
||||
{
|
||||
public int ItemNr;
|
||||
public string Name;
|
||||
public float Qfrom;
|
||||
public float Qto;
|
||||
public ITempMeter TempIn;
|
||||
public ITempMeter TempOut;
|
||||
public IPressureMeter PressIn;
|
||||
public IPressureMeter PressOut;
|
||||
public IList<IValve> ValvesOpen;
|
||||
public IList<IValve> ValvesClose;
|
||||
|
||||
/// Constructor from name, the rest is empty
|
||||
public BenchPath(string name, int itemNr)
|
||||
{
|
||||
ItemNr = itemNr;
|
||||
Name = name;
|
||||
ValvesOpen = new List<IValve>();
|
||||
ValvesClose = new List<IValve>();
|
||||
}
|
||||
|
||||
/// Constructor from data entity
|
||||
public BenchPath(Entities.BenchPath entity, IList<BenchControl.Generic.IComponent> components)
|
||||
: this(entity.Name, entity.ItemNr)
|
||||
{
|
||||
Qfrom = entity.Qfrom;
|
||||
Qto = entity.Qto;
|
||||
TempIn = (ITempMeter)TbfComponents.FindComponent(entity.TempIn, components);
|
||||
TempOut = (ITempMeter)TbfComponents.FindComponent(entity.TempOut, components);
|
||||
PressIn = (IPressureMeter)TbfComponents.FindComponent(entity.PressIn, components);
|
||||
PressOut = (IPressureMeter)TbfComponents.FindComponent(entity.PressOut, components);
|
||||
|
||||
string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' });
|
||||
ValvesOpen = new List<IValve>();
|
||||
foreach (var vName in vOpen) ValvesOpen.Add((IValve)TbfComponents.FindComponent(vName, components));
|
||||
|
||||
string[] vClose = entity.ValvesClose.Split(new char[] { ';' });
|
||||
ValvesClose = new List<IValve>();
|
||||
foreach (var vName in vClose) ValvesClose.Add((IValve)TbfComponents.FindComponent(vName, components));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user