/// /// Copyright (c) 2013-2020 Sensus Slovensko a.s. /// using System; using System.Xml.Serialization; using Config.Entities; using SchematicDrawing; using TBF.BenchControl.Generic; using System.Collections.Generic; namespace TBF.BenchControl.WaterMeters.WaterMeter { public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg, IDrawingItem { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(WaterMeterCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl(IList cmpntEntities) { return new WaterMeterCfgCtrl(); } /// /// Serialized parameters /// /// Schematic drawing info 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; } /// Procedure parameters [XmlIgnore] public ProcParams ProcParams; public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; } public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); } /// Private parameterless constructor invoked by all other (public) constructors WaterMeterCfg() { ProcParams = CreateProcParamsProvider() as ProcParams; GNodes = new List(); } public WaterMeterCfg(IComponentFactory factory) : this() { Shape = Shape.WaterM; Sz = Sz.L; Factory = factory; Name = "WM"; ParentName = string.Empty; } public string ToString(int i) { return string.Format("{0} {1}[{2},{3}]", Name, Shape, X, Y); } } }