All printers modified for new Results, other fixes and changes.

This commit is contained in:
Milan Hanajik
2016-01-06 21:39:52 +01:00
parent 511d86a186
commit 1ee5724082
17 changed files with 458 additions and 738 deletions
@@ -73,14 +73,12 @@ namespace TBF.BenchControl.ResultsPrinters.Zapiska
/// to be printed into a 2-dimensional array of strings 'dataToprint'.
/// </summary>
/// <param name="procedure">Procedure belonging to the results</param>
/// <param name="allResults">Results to be printed (multiple batches)</param>
public MyPrintDocument(Procedure procedure,
IList<TestResult> allResults,
string tester)
/// <param name="batch">Results to be printed (multiple batches)</param>
public MyPrintDocument(Results.Entities.Batch batch)
{
this.procedure = procedure;
this.allResults = allResults;
this.tester = tester;
//this.procedure = procedure;
//this.allResults = allResults;
//this.tester = tester;
dateTime = DateTime.Now;
@@ -1,13 +1,7 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using log4net;
using Config.Entities;
using TBF.BenchControl;
namespace TBF.BenchControl.ResultsPrinters.Zapiska
{
@@ -20,16 +14,13 @@ namespace TBF.BenchControl.ResultsPrinters.Zapiska
public bool SupressPrinting { get { return printerCfg.SupressPrinting; } }
/// <summary>
/// Data to print
/// </summary>
GenericDevices.IBenchInfo benchId;
Procedure procedure;
IList<TestResult> unsortedResults;
public Printer()
{
}
/// <summary> Data to print </summary>
Results.Entities.Batch batch;
public Printer() { }
public Printer(PrinterCfg cfg)
: base(cfg)
@@ -41,34 +32,22 @@ namespace TBF.BenchControl.ResultsPrinters.Zapiska
/// <summary>
/// Prints the test cycle results, Events: Event.ResultsPrinted
/// </summary>
/// <param name="benchId">Bench ID</param>
/// <param name="waterMeters">This parameter is unused</param>
/// <param name="procedure">Procedure to print the results of</param>
/// <param name="unsortedResults">Results to print</param>
/// <param name="batch">Batch results to print</param>
/// <param name="title">This parameter is unused</param>
/// <returns>Reference to the operation</returns>
public IOperation PrintResultsOp(GenericDevices.IBenchInfo benchId,
IList<GenericDevices.IWaterMeter> waterMeters,
Procedure procedure,
IList<TestResult> unsortedResults,
string title)
public IOperation PrintResultsOp(Results.Entities.Batch batch, string title)
{
if ((procedure == null) || (unsortedResults == null) || (unsortedResults.Count < 1))
{
return null;
}
this.benchId = benchId;
this.procedure = procedure;
this.unsortedResults = unsortedResults;
this.batch = batch;
return this;
}
/// <summary>Start this operation</summary>
public void Start()
{
new MyPrintDocument(procedure, unsortedResults, User.CurrentUser.Name).Print();
if (batch.WaterMeters.Count > 0)
{
new MyPrintDocument(batch).Print();
}
}
/// <summary>Run this operation</summary>