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:
@@ -2,15 +2,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Printing;
|
||||
using log4net;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
{
|
||||
public class Printer : ComponentBase, Generic.IComponent, IOperation, GenericDevices.IResultsPrinter
|
||||
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
|
||||
{
|
||||
readonly PrinterCfg printerCfg;
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
|
||||
public override string ToString() { return string.Format("ResultsPrinters.Munich({0})", Cfg.ToString(1)); }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
readonly PrinterCfg printerCfg;
|
||||
|
||||
/// <summary>
|
||||
/// Data to print
|
||||
@@ -19,32 +21,17 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
public IList<GenericDevices.IWaterMeter> WaterMeters;
|
||||
public IList<Entities.TestResult> Results;
|
||||
public string Title;
|
||||
public string Version { get { return printerCfg. ProcParams.Version; } }
|
||||
public string Zaehlertyp { get { return printerCfg. ProcParams.Zaehlertyp; } }
|
||||
public string Pruefvorlage { get { return printerCfg. ProcParams.Pruefvorlage; } }
|
||||
public string Eichjahr { get { return printerCfg. ProcParams.Eichjahr; } }
|
||||
|
||||
public string Version
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Version : ""; }
|
||||
}
|
||||
|
||||
public string Zaehlertyp
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Zaehlertyp : ""; }
|
||||
}
|
||||
|
||||
public string Pruefvorlage
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Pruefvorlage : ""; }
|
||||
}
|
||||
|
||||
public string Eichjahr
|
||||
{
|
||||
get { return (ProcedureParams is ProcParams) ? (ProcedureParams as ProcParams).Eichjahr : ""; }
|
||||
}
|
||||
|
||||
public Printer(PrinterCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.printerCfg = cfg;
|
||||
printerCfg = cfg;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Events: ResultsPrinted</summary>
|
||||
|
||||
Reference in New Issue
Block a user