/// /// Copyright (c) 2017 Sensus Metering Systems /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Elde.RegulValveCoax { public class RegulValveCfg : ComponentCfgBase, IChildComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegulValveCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl() { return new RegulValveCfgCtrl(); } /// /// Serialized parameters /// public int Idx1; /// 1..8 public ValveCategory Category; /// Feeding, Output or All public int StableTimeMs; /// 200..1500 ms public int FlowStableSec; /// 0..60 sec public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions public bool ReTryCommands; /// /// Stabilization time when setting the flow: 0=200ms, step 50ms, max. 1.5 sec. /// public int StableTime { get { return (StableTimeMs - 200) / 50; } } /// Private parameterless constructor invoked by all other (public) constructors RegulValveCfg() { } public RegulValveCfg(string name, IComponentFactory factory) : this() { Name = name; Factory = factory; ParentName = "CB"; Category = ValveCategory.Output; Idx1 = 1; StableTimeMs = 500; FlowStableSec = 5; StoredPositionReuse = false; ReTryCommands = false; } public string ToString(int i) { return string.Format("Name={0} ({1}), Idx1={2}, Cat.={3}, StabTm={4}ms, FlowStable={5}s, PosReuse={6}, ReTryCmds={7}", Name, (string.IsNullOrEmpty(ParentName) ? "-" : ParentName), Idx1, Category, StableTimeMs, FlowStableSec, StoredPositionReuse, ReTryCommands); } } }