Files
tbf/TBF/Rig/WaterMeters/WaterMeter/WaterMeterCfg.cs
T

67 lines
2.0 KiB
C#

///
/// Copyright (c) 2013-2020 Sensus Slovensko a.s.
///
using System;
using System.Xml.Serialization;
using Config.Entities;
using SchematicDrawing;
using TBF.Rig.Generic;
using System.Collections.Generic;
namespace TBF.Rig.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<Config.Entities.Component> 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<GNode> GNodes { get; set; }
/// <summary> Procedure parameters </summary>
[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<GNode>();
}
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);
}
}
}