2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2016-08-05 12:32:36 +00:00
|
|
|
|
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2019-07-10 13:41:02 +00:00
|
|
|
|
using System;
|
2015-04-15 18:32:56 +00:00
|
|
|
|
using System.IO;
|
2015-01-02 18:14:19 +00:00
|
|
|
|
using System.Collections.Generic;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
using TBF.BenchControl.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TBF.BenchControl.Elde.Diverter
|
|
|
|
|
|
{
|
2019-07-10 13:41:02 +00:00
|
|
|
|
public class DiverterCfg : ComponentCfgBase, IChildComponentCfg, GenericDevices.ICalibInfoCfg
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
2017-06-21 21:39:34 +00:00
|
|
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(DiverterCfg) })[0];
|
2018-06-18 10:44:37 +00:00
|
|
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
2017-06-21 21:39:34 +00:00
|
|
|
|
|
2015-01-02 18:14:19 +00:00
|
|
|
|
public IComponentCfgCtrl GetControl() { return new DiverterCfgCtrl(); }
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Serialized parameters
|
|
|
|
|
|
///
|
2019-09-04 10:28:30 +00:00
|
|
|
|
public int BitPosition; /// 0..63
|
|
|
|
|
|
public int AdcNr; /// 0..15(?), number of the analog input
|
|
|
|
|
|
public int AdcValueToSink; /// 0..1023
|
|
|
|
|
|
public int AdcValueToTank; /// 0..1023
|
|
|
|
|
|
public int StartingLevel; /// 0..100 in %, threshold for the ADC value to start the test
|
|
|
|
|
|
public int ThresholdLo; /// 0..100 in %, threshold for low level when diverter transition time is measured
|
|
|
|
|
|
public int ThresholdHi; /// 0..100 in %, threshold for high level when diverter transition time is measured
|
|
|
|
|
|
public int DfltSwithTimeStartMs; /// Default diverter transition time 'start' or 'to tank' in ms
|
|
|
|
|
|
public int DfltSwithTimeEndMs; /// Default diverter transition time 'end' or 'to sink' in ms
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2019-07-10 13:41:02 +00:00
|
|
|
|
/// Calibration info serialized parameters displayed in Metrology tab page
|
2021-08-18 06:52:34 +00:00
|
|
|
|
public string CalibCertificateNr { get; set; }
|
|
|
|
|
|
public DateTime CalibDate { get; set; }
|
|
|
|
|
|
public DateTime CalibValidDate { get; set; }
|
2019-07-10 13:41:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
2014-12-31 12:46:33 +00:00
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
2021-08-18 06:52:34 +00:00
|
|
|
|
DiverterCfg() { }
|
|
|
|
|
|
|
|
|
|
|
|
public DiverterCfg(IComponentFactory factory)
|
|
|
|
|
|
: this()
|
|
|
|
|
|
{
|
|
|
|
|
|
Factory = factory;
|
2014-12-29 15:00:27 +00:00
|
|
|
|
Name = "Div";
|
|
|
|
|
|
ParentName = "CB";
|
|
|
|
|
|
BitPosition = 0;
|
2021-08-18 06:52:34 +00:00
|
|
|
|
AdcNr = 5; /// Div1: AdcNr=5 , Div2: AdcNr=6
|
|
|
|
|
|
AdcValueToSink = 100;
|
|
|
|
|
|
AdcValueToTank = 500;
|
|
|
|
|
|
StartingLevel = 50;
|
2018-06-08 12:52:34 +00:00
|
|
|
|
ThresholdLo = 10;
|
|
|
|
|
|
ThresholdHi = 90;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2021-08-18 06:52:34 +00:00
|
|
|
|
CalibCertificateNr = string.Empty;
|
|
|
|
|
|
CalibDate = TBF.UI.Constants.MinDate;
|
|
|
|
|
|
CalibValidDate = TBF.UI.Constants.MaxDate;
|
2014-12-29 15:00:27 +00:00
|
|
|
|
}
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
public string ToString(int i)
|
|
|
|
|
|
{
|
2018-06-08 12:52:34 +00:00
|
|
|
|
return string.Format("Name={0}, Parent={1}, Bit={2}, ADC#={3}, ADC2Sink={4}, ADC2Tank={5}, Gate={6}%, Lo={7}%, Lo={8}%",
|
2014-12-31 12:46:33 +00:00
|
|
|
|
Name,
|
2014-12-29 15:00:27 +00:00
|
|
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
2015-03-24 01:45:36 +00:00
|
|
|
|
BitPosition,
|
2015-06-12 14:39:57 +00:00
|
|
|
|
AdcNr,
|
|
|
|
|
|
AdcValueToSink,
|
|
|
|
|
|
AdcValueToTank,
|
2015-04-18 05:31:52 +00:00
|
|
|
|
StartingLevel,
|
2018-06-08 12:52:34 +00:00
|
|
|
|
ThresholdLo,
|
|
|
|
|
|
ThresholdHi);
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|