Files
tbf/TBF/Rig/Dummy/RegValve/RegValveCfg.cs
T

61 lines
1.6 KiB
C#

///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using System.Xml.Serialization;
using SchematicDrawing;
using TBF.Rig.Generic;
namespace TBF.Rig.Dummy.RegValve
{
public class RegValveCfg : ComponentCfgBase, IComponentCfg, IDrawingItem
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegValveCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new RegulValveCfgCtrl(); }
///
/// Serialized parameters
///
public ValveCategory Category; /// Feeding, Output or All
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; }
/// Private parameterless constructor invoked by all other (public) constructors
RegValveCfg()
{
GNodes = new List<GNode>();
}
public RegValveCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
Category = ValveCategory.Output;
Shape = Shape.RegV;
Sz = Sz.M;
}
public string ToString(int i)
{
return string.Format("{0} {1}[{2},{3}]", Name, Shape, X, Y);
}
}
}