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:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.WaterMeter
|
||||
@@ -7,35 +8,24 @@ namespace TBF.BenchControl.WaterMeter
|
||||
/// <summary>
|
||||
/// This component = instance of this class is a placeholder for a combined main watermeter
|
||||
/// </summary>
|
||||
public class WaterMeter : ComponentBase, Generic.IComponent, GenericDevices.IWaterMeter
|
||||
public class WaterMeter : ComponentBase, GenericDevices.IWaterMeter
|
||||
{
|
||||
readonly WaterMeterCfg combinedMainCfg;
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(WaterMeter));
|
||||
public override string ToString() { return string.Format("WaterMeter({0})", Cfg.ToString(1)); }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
readonly WaterMeterCfg waterMeterCfg;
|
||||
|
||||
/// <summary>WaterMeter producer</summary>
|
||||
public string Producer
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Producer : ""; }
|
||||
}
|
||||
public string Producer { get { return waterMeterCfg. ProcParams.Producer; } }
|
||||
|
||||
/// <summary>Nominal water flow in [m3/h]</summary>
|
||||
public float Qn
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Qn : 0; }
|
||||
}
|
||||
public float Qn { get { return waterMeterCfg. ProcParams.Qn; } }
|
||||
|
||||
/// <summary>WaterMeter approval information or signature</summary>
|
||||
public string ApprovalInfo
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).ApprovalInfo : ""; }
|
||||
}
|
||||
public string ApprovalInfo { get { return waterMeterCfg. ProcParams.ApprovalInfo; } }
|
||||
|
||||
/// <summary>Metrological class</summary>
|
||||
public string MetrologicalClass
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).MetrologicalClass : ""; }
|
||||
}
|
||||
public string MetrologicalClass { get { return waterMeterCfg. ProcParams.MetrologicalClass; } }
|
||||
|
||||
/// Properties set by the Begin and the End form
|
||||
public string SerialNr
|
||||
@@ -62,8 +52,8 @@ namespace TBF.BenchControl.WaterMeter
|
||||
public WaterMeter(WaterMeterCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.combinedMainCfg = cfg;
|
||||
waterMeterCfg = cfg;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user