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
@@ -5,33 +5,20 @@ using TBF.Boxes;
namespace TBF.BenchControl.Elde.FlowMeter
{
public class FlowMeter : Generic.IComponent, GenericDevices.IFlowMeter
public class FlowMeter : ComponentBase, GenericDevices.IFlowMeter
{
/// <summary>
/// Info: StartMassMeasurement() and "Balance response = .., Mass = ..."
/// Warn: Start measurement when busy is true
/// </summary>
private static readonly ILog log = LogManager.GetLogger(typeof(FlowMeter));
public override string ToString()
{
return string.Format("FlowMeter: Name={0}, Idx1={1}", Name, Idx1);
}
public override string ToString() { return string.Format("FlowMeter({0})", Cfg.ToString(1)); }
public static void ResetStaticProperties() { }
readonly FlowMeterCfg flowMeterCfg;
FlowMeterCfg flowMeterCfg;
public Generic.IComponentCfg Cfg { get { return flowMeterCfg; } }
public string Name { get { return flowMeterCfg.Name; } }
public int Idx1 { get { return flowMeterCfg.Idx1; } }
public IList<Entities.MeasurementCorrection> Corrections { get { return flowMeterCfg.Corrections; } }
public readonly ControlBoardDev ControlBoard;
public float NominalFlow { get { return nominalFlow; } }
readonly float nominalFlow;
public float NominalFlow { get { return flowMeterCfg.NominalFlow; } }
public float LtrPerPulse { get { return nominalFlow / 7200.0f; } }
public float LtrPerPulse { get { return flowMeterCfg.NominalFlow / 7200.0f; } }
public float LtrPerPulseCorrected(float flow)
{
@@ -42,15 +29,14 @@ namespace TBF.BenchControl.Elde.FlowMeter
public FlowMeter(FlowMeterCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
if (cfg == null) throw new ArgumentNullException("cfg");
this.flowMeterCfg = cfg;
flowMeterCfg = cfg;
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
nominalFlow = cfg.NominalFlow;
ControlBoard.EtCalib[Idx1] = NominalFlow;
ControlBoard.EtCalib[Idx1] = flowMeterCfg.NominalFlow;
/// Prepare data for SendCalibData() control board component method