80 lines
2.5 KiB
C#
80 lines
2.5 KiB
C#
///
|
|
/// 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.Rig.Generic;
|
|
|
|
namespace TBF.Rig.Elde.PressureMeter
|
|
{
|
|
public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.Rig.GenericDevices.ICalibInfoCfg, IDrawingItem
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> 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<GNode> GNodes { get; set; }
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
PressureMeterCfg()
|
|
{
|
|
GNodes = new List<GNode>();
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|