tbf/TestBenchFramework/BenchControl/ComponentBase.cs
Milan Hanajik 0160dc965d - RegulValve ADC Open/Close values calibration implemented
- 'More' button added to ComponentCfgCtrl-s
- Dataflow from ComponentParametersDlg to components: CfgChangeHandler
- Dataflow from components to ComponentParametersDlg: CmdResponseHandler
- Detection of parameter changes and appropriate MesssageBox display:
  1.warning message when component configuration change requires program restart
  2.confirmation message box when any configuration changes would be lost
2015-01-03 14:45:58 +01:00

39 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using TBF.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl
{
public class ComponentBase : IComponent
{
readonly Generic.IComponentCfg cfg;
public Generic.IComponentCfg Cfg { get { return cfg; } }
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; } }
public Entities.DebugMode DebugLevel { get { return cfg.DebugLevel; } }
public Entities.LogLevel LogLevel { get { return cfg.LogLevel; } }
public IList<MeasurementCorrection> Corrections { get { return cfg.Corrections; } }
/// Constructor
public ComponentBase(IComponentCfg cfg)
{
if (cfg == null) throw new ArgumentNullException("cfg");
this.cfg = cfg;
}
/// <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() { }
}
}