Files
tbf/TBF/BenchControl/Modbus/TempMeter/Groch/TempMeterCfg.cs
T

95 lines
2.9 KiB
C#

///
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using SchematicDrawing;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.TempMeter.Groch
{
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg, TBF.BenchControl.GenericDevices.ICalibInfoCfg, IDrawingItemWithMeasuredVal
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TempMeterCfgCtrl(); }
///
/// Serialized parameters
///
public int Idx0; /// 0 .. 15
public double A1;
public double A2;
public double A3;
public double A4;
public double A5;
public double DefaultTemperature;
/// 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 SchematicDrawing.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; }
public int MsrdX { get; set; }
public int MsrdY { get; set; }
public Orient MsrdOrient { get; set; }
public Config.Unit MsrdUnits { get; set; }
public string MsrdFormat { get; set; }
public double MsrdValLimLo { get; set; }
public double MsrdValLimHi { get; set; }
[XmlIgnore]
public IList<GNode> GNodes { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
TempMeterCfg()
{
GNodes = new List<GNode>();
}
public TempMeterCfg(IComponentFactory factory)
: this()
{
Shape = Shape.TempM;
Sz = Sz.M;
MsrdUnits = Config.Unit.C;
MsrdFormat = "{0:F1} °C";
Factory = factory;
Name = "T";
ParentName = "CB";
Idx0 = 0;
A1 = 0;
A2 = 0;
A3 = 0;
A4 = 0;
A5 = 0;
DefaultTemperature = 20.0;
}
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Idx0={2}, A1={3}, A2={4}, A3={5}, A4={6}, A5={7}, Default={8}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
Idx0,
A1, A2, A3, A4, A5, DefaultTemperature);
}
}
}