61 lines
1.7 KiB
C#
61 lines
1.7 KiB
C#
///
|
|
/// Copyright (c) 2017 Sensus Metering Systems
|
|
///
|
|
using System.Collections.Generic;
|
|
using System.Xml.Serialization;
|
|
using SchematicDrawing;
|
|
using TBF.Rig.Generic;
|
|
|
|
namespace TBF.Rig.Dummy.FlowMeter
|
|
{
|
|
public class FlowMeterCfg : ComponentCfgBase, IComponentCfg, IDrawingItem
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(FlowMeterCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new FlowMeterCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz
|
|
|
|
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
|
|
FlowMeterCfg()
|
|
{
|
|
GNodes = new List<GNode>();
|
|
}
|
|
|
|
public FlowMeterCfg(string name, IComponentFactory factory)
|
|
: this()
|
|
{
|
|
Shape = Shape.FlowM;
|
|
Sz = Sz.M;
|
|
|
|
Name = name;
|
|
Factory = factory;
|
|
NominalFlow = 1.0f;
|
|
}
|
|
|
|
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("{0} {1}[{2},{3}] NominalFlow={4}", Name, Shape, X, Y, NominalFlow);
|
|
}
|
|
}
|
|
}
|