2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2019-09-17 08:27:23 +00:00
|
|
|
|
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
|
|
|
|
|
using System;
|
2014-12-31 12:46:33 +00:00
|
|
|
|
using System.Collections.Generic;
|
2015-12-04 16:17:20 +00:00
|
|
|
|
using Config.Entities;
|
2014-12-31 12:46:33 +00:00
|
|
|
|
using TBF.BenchControl.Generic;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
namespace TBF.BenchControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ComponentBase : IComponent
|
|
|
|
|
|
{
|
2014-12-31 12:46:33 +00:00
|
|
|
|
readonly Generic.IComponentCfg cfg;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
public Generic.IComponentCfg Cfg { get { return cfg; } }
|
|
|
|
|
|
|
2014-12-31 12:46:33 +00:00
|
|
|
|
public string Name { get { return cfg.Name; } }
|
|
|
|
|
|
public string ClassName { get { return cfg.Factory.ClassName; } }
|
|
|
|
|
|
public string ParentName { get { return cfg.ParentName; } }
|
|
|
|
|
|
public Generic.IComponentFactory Factory { get { return cfg.Factory; } }
|
|
|
|
|
|
public int ItemNr { get { return cfg.ItemNr; } }
|
2015-12-04 16:17:20 +00:00
|
|
|
|
public DebugMode DebugLevel { get { return cfg.DebugLevel; } set { cfg.DebugLevel = value; } }
|
|
|
|
|
|
public LogLevel LogLevel { get { return cfg.LogLevel; } }
|
2019-09-17 08:27:23 +00:00
|
|
|
|
|
2019-08-09 07:55:11 +00:00
|
|
|
|
public IList<MeasurementCorrection> Corrections
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return cfg.Corrections; }
|
|
|
|
|
|
set { cfg.Corrections = value; }
|
|
|
|
|
|
}
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2019-09-17 08:27:23 +00:00
|
|
|
|
public IList<Uncertainty> Uncertainties
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return cfg.Uncertainties; }
|
|
|
|
|
|
set { cfg.Uncertainties = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-06-29 09:14:33 +00:00
|
|
|
|
|
|
|
|
|
|
/// Constructor, components created in this way is used by
|
|
|
|
|
|
/// IComponentFactory.DummyComponent() function. Such dummy component should be used
|
|
|
|
|
|
/// only for runtime class type identification (e.g. object is iValve)
|
|
|
|
|
|
public ComponentBase()
|
|
|
|
|
|
{
|
|
|
|
|
|
cfg = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Constructor with configuration as an argument
|
2014-12-31 12:46:33 +00:00
|
|
|
|
public ComponentBase(IComponentCfg cfg)
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
2014-12-31 12:46:33 +00:00
|
|
|
|
if (cfg == null) throw new ArgumentNullException("cfg");
|
|
|
|
|
|
this.cfg = cfg;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-01-02 22:42:01 +00:00
|
|
|
|
/// <summary> Empty implementation, might be overriden in derived classes </summary>
|
|
|
|
|
|
public static void ResetStaticProperties() { }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> Empty implementation, might be overriden in derived classes </summary>
|
|
|
|
|
|
public virtual void StartChangeHandler() { }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> Empty implementation, might be overriden in derived classes </summary>
|
|
|
|
|
|
public virtual void StopChangeHandler() { }
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|