/// /// Copyright (c) 2013-2020 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using Config.Entities; using SchematicDrawing; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Elde.PressureMeter { public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg, IDrawingItem { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl(IList cmpntEntities) { return new PressureMeterCfgCtrl(); } /// /// Serialized parameters /// public int Idx0; /// 0..3 public MeretProtocol Protocol; /// Meret or Modbus public byte RS485Address; /// 0..255 /// Calibration info serialized parameters displayed in Metrology tab page public string CalibCertificateNr { get; set; } public DateTime CalibDate { get; set; } public DateTime CalibValidDate { get; set; } /// 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; } /// Private parameterless constructor invoked by all other (public) constructors PressureMeterCfg() { GNodes = new List(); } public PressureMeterCfg(IComponentFactory factory) : this() { Shape = Shape.PressM; Sz = Sz.M; Factory = factory; Name = "Pr"; ParentName = "CB"; Idx0 = 0; Protocol = MeretProtocol.Modbus; RS485Address = 99; } public string ToString(int i) { return string.Format("Name={0}, Parent={1}, Idx0={2}, Protocol={3}, Address={4}", Name, (string.IsNullOrEmpty(ParentName) ? "-" : ParentName), Idx0, Protocol.ToDescription(), RS485Address); } } }