68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
///
|
|
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
|
///
|
|
using System.IO;
|
|
using System.Collections.Generic;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.BuiltIn.Pump
|
|
{
|
|
public class PumpCfg : ComponentCfgBase, IChildComponentCfg, SchematicDrawing.IDrawingItemCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl() { return new PumpCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public int BitPosition;
|
|
public int Delay;
|
|
|
|
public SchematicDrawing.Shape Shape { get; set; }
|
|
public int X { get; set; }
|
|
public int Y { get; set; }
|
|
public SchematicDrawing.Sz Sz { get; set; }
|
|
public SchematicDrawing.Orient Orient { get; set; }
|
|
public bool Flip { get; set; }
|
|
public int LblX { get; set; }
|
|
public int LblY { get; set; }
|
|
public SchematicDrawing.Orient LblOrient { get; set; }
|
|
public int ValX { get; set; }
|
|
public int ValY { get; set; }
|
|
public double ValFact { get; set; }
|
|
public string ValFmt { get; set; }
|
|
public SchematicDrawing.Orient ValOrient { get; set; }
|
|
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
PumpCfg()
|
|
{
|
|
Name = "P";
|
|
Shape = SchematicDrawing.Shape.Pump;
|
|
ParentName = "CB";
|
|
BitPosition = 0;
|
|
Delay = 1;
|
|
}
|
|
|
|
public PumpCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public bool IsHidden() { return (X == 0) && (Y == 0); }
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Parent={1}, Bit={2}, Delay={3}",
|
|
Name,
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
|
BitPosition,
|
|
Delay);
|
|
}
|
|
}
|
|
}
|