using System; using System.Collections.Generic; namespace TBF.Entities { /// /// Test, consisting of one or more repetitions of the test 'SingleTest'. /// public class Test : IHasItemNr { 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 low limit in [m3/h] public virtual float Qto { get; set; } /// Water flow high limit in [m3/h] public virtual float Volume { get; set; } /// Test volume (target) in [l] public virtual float TstTime { get; set; } /// Test time (estimate) in [s] public virtual int Repeats { get; set; } public virtual bool Emptying { get; set; } public virtual bool Zeroing { get; set; } public virtual int Time2MassMsrmt { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s] public virtual string Method { get; set; } public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0) public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0) public virtual double TolerRed { get; set; } /// in [%] (always > 0) public virtual TestRedType RedType { get; set; } public virtual string FeedingPath { get; set; } public virtual string BenchPath { get; set; } public virtual string OutputPath { get; set; } public virtual string MetersPath { get; set; } public virtual string TransitionStart { get; set; } public virtual string TransitionEnd { get; set; } public virtual IList MoreParams { get; set; } public virtual Procedure Procedure { get; set; } /// ------------- Additional stuff not mapped into the database ------------- public Test() { MoreParams = new List(); } public Test(string name, int itemNr, Procedure procedure) : this() { Name = name; ItemNr = itemNr; Procedure = procedure; } // Makes a new copy of this object (not just a reference) public virtual Test Clone() { Test result = new Test(Name, ItemNr, Procedure); result.Qfrom = Qfrom; result.Qto = Qto; result.Volume = Volume; result.TstTime = TstTime; result.Repeats = Repeats; result.Emptying = Emptying; result.Zeroing = Zeroing; result.Time2MassMsrmt = Time2MassMsrmt; result.Method = Method; result.ErrLimLo = ErrLimLo; result.ErrLimHi = ErrLimHi; result.TolerRed = TolerRed; result.RedType = RedType; result.FeedingPath = FeedingPath; result.BenchPath = BenchPath; result.OutputPath = OutputPath; result.MetersPath = MetersPath; foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); } return result; } } }