/// /// Copyright (c) 2017 Sensus Metering Systems /// using System.Xml.Serialization; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Modbus.TankSelector { public class TankSelectorCfg : ComponentCfgBase, Generic.IChildComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TankSelectorCfg) })[0]; protected override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl() { return new TankSelectorCfgCtrl(); } /// /// Serialized parameters /// public string HotWaterHeating; /// Name of the component communicating with the temperature controller public string HotWaterCooling; /// Name of the component communicating with the temperature controller public string WarmWaterHeating; /// Name of the component communicating with the temperature controller public string WarmWaterCooling; /// Name of the component communicating with the temperature controller public string ColdWaterCooling; /// Name of the component communicating with the temperature controller /// Private parameterless constructor invoked by all other (public) constructors TankSelectorCfg() { Name = "TankSelector"; ParentName = "QuidoRS"; } public TankSelectorCfg(IComponentFactory factory) : this() { this.Factory = factory; } public string ToString(int i) { return string.Format("Name={0}, DigOut={1}, Hot heating={2}, Hot cooling={3}, Warm heating={4}, Warm cooling={5}, Cold cooling={6}", Name, (string.IsNullOrEmpty(ParentName) ? "-" : ParentName), (string.IsNullOrEmpty(HotWaterHeating) ? "-" : HotWaterHeating), (string.IsNullOrEmpty(HotWaterCooling) ? "-" : HotWaterCooling), (string.IsNullOrEmpty(WarmWaterHeating) ? "-" : WarmWaterHeating), (string.IsNullOrEmpty(WarmWaterCooling) ? "-" : WarmWaterCooling), (string.IsNullOrEmpty(ColdWaterCooling) ? "-" : ColdWaterCooling)); } } }