/// /// Copyright (c) 2013-2016 Sensus Slovensko a.s. /// using System.Collections.Generic; using System.Xml.Serialization; using SchematicDrawing; using TBF.Rig.Generic; namespace TBF.Rig.BuiltIn.Pump { public class PumpCfg : ComponentCfgBase, IChildComponentCfg, IRouteBasedDrawingItem { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl(IList cmpntEntities) { return new PumpCfgCtrl(); } /// /// Serialized parameters /// public int BitNr { get; set; } public bool Inverted { get; set; } /// When true the pump function is inverted: 0 = on, 1 = off public int Delay; public Shape Shape { get; set; } public int X { get; set; } public int Y { get; set; } public Sz Sz { get; set; } public Orient Orient { get; set; } public bool Flip { get; set; } public int LblX { get; set; } public int LblY { get; set; } public Orient LblOrient { get; set; } [XmlIgnore] public IList GNodes { get; set; } [XmlIgnore] public IList EdgesToSet { get; set; } /// Private parameterless constructor invoked by all other (public) constructors PumpCfg() { GNodes = new List(); EdgesToSet = new List(); } public PumpCfg(IComponentFactory factory) : this() { Shape = Shape.Pump; Sz = Sz.M; Factory = factory; Name = "P"; ParentName = "CB"; BitNr = 0; Delay = 1; } public string ToString(int i) { return string.Format("Name={0}, Parent={1}, Bit={2}, Delay={3}", Name, (string.IsNullOrEmpty(ParentName) ? "-" : ParentName), BitNr, Delay); } } }