/// /// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Modbus.QuidoRS { public class QuidoRSCfg : ComponentCfgBase, Generic.IChildComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(QuidoRSCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl() { return new QuidoRSCfgCtrl(); } /// /// Serialized parameters /// public byte ModbusAddress; /// 1..255 public bool WatchdogEnabled; public int WatchdogBitNr; /// 0..15 /// Private parameterless constructor invoked by all other (public) constructors QuidoRSCfg() { Name = "QuidoRS"; ParentName = "Modbus"; ModbusAddress = 49; WatchdogEnabled = true; WatchdogBitNr = 4; } public QuidoRSCfg(IComponentFactory factory) : this() { this.Factory = factory; } public string ToString(int i) { return string.Format("Name={0}, ModbusAddr={1}, Parent={2}", Name, ModbusAddress, (string.IsNullOrEmpty(ParentName) ? "-" : ParentName)); } } }