95 lines
2.9 KiB
C#
95 lines
2.9 KiB
C#
///
|
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace TBF.Entities
|
|
{
|
|
public class OutputPath : IHasItemNr, IHasValves
|
|
{
|
|
public virtual int Id { get; protected set; }
|
|
public virtual int ItemNr { get; set; }
|
|
public virtual string Name { get; set; }
|
|
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
|
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
|
public virtual string RegulValve { get; set; }
|
|
public virtual string FlowMeter { get; set; }
|
|
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
|
public virtual string StartValve { get; set; }
|
|
public virtual string Diverter { get; set; }
|
|
public virtual string TempDiv { get; set; }
|
|
public virtual string Balance { get; set; }
|
|
public virtual string EmptyTankValve { get; set; }
|
|
|
|
/// Valves
|
|
public virtual string ValvesOpen { get; set; }
|
|
public virtual string ValvesClose { get; set; }
|
|
|
|
/// ------------- Additional stuff not mapped into the database -------------
|
|
|
|
public OutputPath()
|
|
{
|
|
}
|
|
|
|
public OutputPath(string name, int itemNr)
|
|
: this()
|
|
{
|
|
Name = name;
|
|
ItemNr = itemNr;
|
|
}
|
|
|
|
public OutputPath(BenchControl.OutputPath path)
|
|
: this(path.Name, path.ItemNr)
|
|
{
|
|
Qfrom = path.Qfrom;
|
|
Qto = path.Qto;
|
|
RegulValve = (path.RegulValve != null) ? path.RegulValve.Cfg.Name : null;
|
|
FlowMeter = (path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : null;
|
|
PidCoef = path.PidCoef;
|
|
StartValve = (path.StartValve != null) ? path.StartValve.Cfg.Name : null;
|
|
Diverter = (path.Diverter != null) ? path.Diverter.Cfg.Name : null;
|
|
TempDiv = (path.TempDiv != null) ? path.TempDiv.Cfg.Name : null;
|
|
Balance = (path.Balance != null) ? path.Balance.Cfg.Name : null;
|
|
EmptyTankValve = (path.EmptyTankValve != null) ? path.EmptyTankValve.Cfg.Name : null;
|
|
|
|
string vOpen = string.Empty;
|
|
foreach (var valve in path.ValvesOpen)
|
|
{
|
|
if (vOpen != string.Empty) vOpen += ";";
|
|
vOpen += valve.Cfg.Name;
|
|
}
|
|
ValvesOpen = vOpen;
|
|
|
|
string vClose = string.Empty;
|
|
foreach (var valve in path.ValvesClose)
|
|
{
|
|
if (vClose != string.Empty) vClose += ";";
|
|
vClose += valve.Cfg.Name;
|
|
}
|
|
ValvesClose = vClose;
|
|
}
|
|
|
|
public virtual OutputPath Clone(string name, int itemNr)
|
|
{
|
|
OutputPath result = new OutputPath(name, itemNr);
|
|
|
|
result.Name = Name;
|
|
result.Qfrom = Qfrom;
|
|
result.Qto = Qto;
|
|
result.RegulValve = RegulValve;
|
|
result.FlowMeter = FlowMeter;
|
|
result.PidCoef = PidCoef;
|
|
result.StartValve = StartValve;
|
|
result.Diverter = Diverter;
|
|
result.TempDiv = TempDiv;
|
|
result.Balance = Balance;
|
|
result.EmptyTankValve = EmptyTankValve;
|
|
result.ValvesOpen = ValvesOpen;
|
|
result.ValvesClose = ValvesClose;
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|