2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2022-04-15 11:30:58 +00:00
|
|
|
|
/// Copyright (c) 2013-2022 Sensus Slovensko a.s.
|
2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
|
|
|
|
|
using System.Collections.Generic;
|
2021-10-26 09:23:57 +00:00
|
|
|
|
using TBF.Rig.GenericDevices;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2021-10-26 09:23:57 +00:00
|
|
|
|
namespace TBF.Rig
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class BenchPath
|
|
|
|
|
|
{
|
|
|
|
|
|
public int ItemNr;
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
public float Qfrom;
|
|
|
|
|
|
public float Qto;
|
2021-04-13 09:04:00 +00:00
|
|
|
|
public string Selector;
|
2016-10-18 16:48:20 +00:00
|
|
|
|
public ITempMeter TempMtrUp;
|
|
|
|
|
|
public ITempMeter TempMtrDown;
|
|
|
|
|
|
public IPressureMeter PressMtrUp;
|
|
|
|
|
|
public IPressureMeter PressMtrDown;
|
|
|
|
|
|
public IPressureMeter PressMtrDelta;
|
2016-03-18 02:36:33 +00:00
|
|
|
|
public IValve StopBFValve;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
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
|
2021-10-26 09:23:57 +00:00
|
|
|
|
public BenchPath(Config.Entities.BenchPath entity, IList<Rig.Generic.IComponent> components)
|
2014-07-28 07:54:35 +00:00
|
|
|
|
: this(entity.Name, entity.ItemNr)
|
|
|
|
|
|
{
|
|
|
|
|
|
Qfrom = entity.Qfrom;
|
|
|
|
|
|
Qto = entity.Qto;
|
2021-04-13 09:04:00 +00:00
|
|
|
|
Selector = entity.Selector;
|
2016-10-18 16:48:20 +00:00
|
|
|
|
TempMtrUp = TbfComponents.FindComponent(entity.TempMtrUp, components) as ITempMeter;
|
|
|
|
|
|
TempMtrDown = TbfComponents.FindComponent(entity.TempMtrDown, components) as ITempMeter;
|
|
|
|
|
|
PressMtrUp = TbfComponents.FindComponent(entity.PressMtrUp, components) as IPressureMeter;
|
|
|
|
|
|
PressMtrDown = TbfComponents.FindComponent(entity.PressMtrDown, components) as IPressureMeter;
|
|
|
|
|
|
PressMtrDelta = TbfComponents.FindComponent(entity.PressMtrDelta, components) as IPressureMeter;
|
2016-03-18 02:36:33 +00:00
|
|
|
|
StopBFValve = TbfComponents.FindComponent(entity.StopBFValve, components) as IValve;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' });
|
2022-04-15 11:30:58 +00:00
|
|
|
|
foreach (var vName in vOpen)
|
|
|
|
|
|
{
|
|
|
|
|
|
var cmpnt = TbfComponents.FindComponent(vName, components);
|
|
|
|
|
|
if (cmpnt is IValve) ValvesOpen.Add(cmpnt as IValve);
|
|
|
|
|
|
}
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2022-04-15 11:30:58 +00:00
|
|
|
|
string[] vClose = entity.ValvesClose.Split(new char[] { ';' });
|
|
|
|
|
|
ValvesClose = new List<IValve>();
|
|
|
|
|
|
foreach (var vName in vClose)
|
|
|
|
|
|
{
|
|
|
|
|
|
var cmpnt = TbfComponents.FindComponent(vName, components);
|
|
|
|
|
|
if (cmpnt is IValve) ValvesClose.Add(cmpnt as IValve);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-04-14 10:29:14 +00:00
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
2022-04-15 11:30:58 +00:00
|
|
|
|
return string.Format("{0} StopBF={1}", Name, (StopBFValve != null) ? StopBFValve.Name : "---");
|
2016-04-14 10:29:14 +00:00
|
|
|
|
}
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|