/// /// Copyright (c) 2013-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Elde.RegulValveTandem { public class RegulValveTandemCfg : ComponentCfgBase, IChildComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegulValveTandemCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl() { return new RegulValveTandemCfgCtrl(); } /// /// Serialized parameters /// public ValveCategory Category; /// Feeding, Output or All public string RegulValveName; /// Name of the regulation valve used to control the flow public string FixedRVName; /// Name of the regulation valve with a fixed position public float FixedRVPosition; /// Fixed RV position 0 .. 100 in [%] public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions public int FlowStableSec; /// 0..60 sec /// Private parameterless constructor invoked by all other (public) constructors RegulValveTandemCfg() { } public RegulValveTandemCfg(string name, IComponentFactory factory) : this() { Name = name; Factory = factory; ParentName = string.Empty; Category = ValveCategory.Output; RegulValveName = "RV1"; FixedRVName = "RV2"; FixedRVPosition = 50.0f; StoredPositionReuse = false; FlowStableSec = 5; } public string ToString(int i) { return string.Format("Name={0}, RegulVName={1}, FixedRVName={2}, FixedRVPos={3}%, PosReuse={4}, FlowStable={5}s", Name, RegulValveName, FixedRVName, FixedRVPosition.ToString("F0"), StoredPositionReuse, FlowStableSec); } } }