Initial commit almost identical to SVN-repo rev.340

This commit is contained in:
Milan Hanajik
2014-07-28 09:56:40 +02:00
commit 175a92f633
575 changed files with 186534 additions and 0 deletions
@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using TBF.BenchControl;
namespace TBF.BenchControl.ResultsPrinters.Munich
{
public class Printer : ComponentBase, Generic.IComponent, IOperation, GenericDevices.IResultsPrinter
{
readonly PrinterCfg printerCfg;
public static void ResetStaticProperties() { }
/// <summary>
/// Data to print
/// </summary>
public BenchControl.BenchId.Component BenchId;
public IList<GenericDevices.IWaterMeter> WaterMeters;
public IList<Entities.TestResult> Results;
public string Title;
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;
}
/// <summary>Events: ResultsPrinted</summary>
/// <param name="results">Results to print</param>
/// <returns>Reference to the operation</returns>
public IOperation PrintResultsOp(BenchControl.BenchId.Component benchId,
IList<GenericDevices.IWaterMeter> waterMeters,
IList<Entities.TestResult> results,
string title)
{
this.BenchId = benchId;
this.WaterMeters = waterMeters;
this.Results = results;
this.Title = title;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
if (Results != null && Results.Count >= 1)
{
new MunichPrintDocument(this).Print();
}
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
return Event.ResultsPrinted;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}