Everything works OK after serious changes:

- all components, componentCfg-s and parameter providers use base classes
 - less boilerplate code, simpler access to test/procedure parameters from code
 - CreateTestParams(test), CreateProcedureParams(procedure) methods added
 - TestBenchSim class is made static, it is not inheritted by any device anymore
This commit is contained in:
Milan Hanajik
2015-01-02 12:51:27 +01:00
parent 752719bd62
commit 94de991bf6
126 changed files with 1117 additions and 1629 deletions
@@ -6,49 +6,30 @@ using TBF.Boxes;
namespace TBF.BenchControl.Elde.TempMeter
{
public class TempMeter : IComponent, GenericDevices.ITempMeter
public class TempMeter : ComponentBase, GenericDevices.ITempMeter
{
/// <summary>
/// Info: StartMassMeasurement() and "Balance response = .., Mass = ..."
/// Warn: Start measurement when busy is true
/// </summary>
private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter));
public override string ToString()
{
return string.Format("TempMeter({0},{1})", Name, Idx0);
}
public override string ToString() { return string.Format("TempMeter({0})", Cfg.ToString(1)); }
public static void ResetStaticProperties() { }
TempMeterCfg tempMeterCfg;
public Generic.IComponentCfg Cfg { get { return tempMeterCfg; } }
public string Name { get { return tempMeterCfg.Name; } }
readonly TempMeterCfg tempMtrCfg;
public readonly ControlBoardDev ControlBoard;
public readonly int Idx0; /// 0..7
public readonly float A1;
public readonly float A2;
public readonly float A3;
public readonly float A4;
public readonly float A5;
public int Idx0 { get { return tempMtrCfg.Idx0; } } /// 0..7
public float A1 { get { return tempMtrCfg.A1; } }
public float A2 { get { return tempMtrCfg.A2; } }
public float A3 { get { return tempMtrCfg.A3; } }
public float A4 { get { return tempMtrCfg.A4; } }
public float A5 { get { return tempMtrCfg.A5; } }
public TempMeter(TempMeterCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
if (cfg == null) throw new ArgumentNullException("cfg");
this.tempMeterCfg = cfg;
tempMtrCfg = cfg;
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
Idx0 = cfg.Idx0;
A1 = cfg.A1;
A2 = cfg.A2;
A3 = cfg.A3;
A4 = cfg.A4;
A5 = cfg.A5;
/// Prepare data for SendCalibData() control board component method
ControlBoard.TempCalibData[Idx0, 0] = A1;
ControlBoard.TempCalibData[Idx0, 1] = A2;