ProcedureName added to TestResults entity, Basic writer changes

This commit is contained in:
Milan Hanajik
2014-07-29 15:06:29 +02:00
parent 019e85066f
commit 8c83965315
5 changed files with 27 additions and 9 deletions
@@ -20,7 +20,8 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
const int Tab3 = 430; const int Tab3 = 430;
const int Tab4 = 590; const int Tab4 = 590;
const int BorderW = 1; /// Table border line width const int BorderW = 1; /// Table border line width
const int Margin = 7; /// Margins of the text from table lines const int MarginTop = 7; /// Margins of the text from table lines
const int MarginLeft = 4; /// Margins of the text from table lines
/// Initialized in the constructor /// Initialized in the constructor
readonly Printer prn; readonly Printer prn;
@@ -324,11 +325,11 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
{ {
const int NrParamsInOneTableRow = 6; const int NrParamsInOneTableRow = 6;
int x = 267 + (parNr % NrParamsInOneTableRow) * 80 + Margin; int x = 267 + (parNr % NrParamsInOneTableRow) * 80 + MarginLeft;
int y = top + SpacingOneAndHalf + Margin + testNr * SpacingOneAndHalf int y = top + SpacingOneAndHalf + MarginTop + testNr * SpacingOneAndHalf
+ ((parNr >= NrParamsInOneTableRow) ? secondTableOffset : 0); + ((parNr >= NrParamsInOneTableRow) ? secondTableOffset : 0);
if (parNr < 0) x = 80 + Margin; /// When parNr == -1 return the left column x coordinate if (parNr < 0) x = 80 + MarginLeft; /// When parNr == -1 return the left column x coordinate
return new Point(x, y); return new Point(x, y);
} }
@@ -34,6 +34,12 @@ namespace TBF.BenchControl.ResultsWriters.Basic
/// <returns>Reference to the operation</returns> /// <returns>Reference to the operation</returns>
public IOperation WriteResultsOp(IList<Entities.TestResult> results) public IOperation WriteResultsOp(IList<Entities.TestResult> results)
{ {
if ((results == null) || (results.Count == 0))
{
writer = null;
return this;
}
this.results = results; this.results = results;
now = DateTime.Now; now = DateTime.Now;
try try
@@ -69,10 +75,14 @@ namespace TBF.BenchControl.ResultsWriters.Basic
now.Year.ToString("D4"), now.Year.ToString("D4"),
now.Hour.ToString("D2"), now.Hour.ToString("D2"),
now.Minute.ToString("D2"))); now.Minute.ToString("D2")));
writer.WriteLine("Wasserzähler Type : 110338"); writer.WriteLine(string.Format("Wasserzähler Type : {0}", results[0].ProcedureName));
writer.WriteLine("Gerät Nr. : 1"); writer.WriteLine("Gerät Nr. : 1");
writer.WriteLine(string.Format("Benutzer : {0}", Entities.User.CurrentUser.Name)); writer.WriteLine(string.Format("Benutzer : {0}", Entities.User.CurrentUser.Name));
writer.WriteLine("Impulsrate : 1 67.422 1"); writer.Write("Impulsrate : ");
for (int i = 0; i < Program.WMsCount; i++)
{
//writer.Write(results[0].
}
writer.WriteLine("Bereich : 22,9 °C 947 mbar 43 %"); writer.WriteLine("Bereich : 22,9 °C 947 mbar 43 %");
writer.WriteLine(""); writer.WriteLine("");
writer.WriteLine("Test Metode MIDFehler Durchfluss Test Zeit T1 T2 Dichte Masse Druck Volume Bor"); writer.WriteLine("Test Metode MIDFehler Durchfluss Test Zeit T1 T2 Dichte Masse Druck Volume Bor");
@@ -333,7 +333,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
//State.Create("set_RV_position", //State.Create("set_RV_position",
.AddOperation(checkUiOp) .AddOperation(checkUiOp)
.AddOperations(measureOperations) .AddOperations(measureOperations)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, measuredFlow, 10)) /// timeout = 10 sec. .AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, measuredFlow, 600)) /// timeout = 10 sec.
//.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue)) //.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue))
.EnterState(); .EnterState();
do do
@@ -11,6 +11,8 @@ namespace TBF.Entities
public virtual IList<MeterTestResult> Meters { get; set; } public virtual IList<MeterTestResult> Meters { get; set; }
public virtual IList<MeterTestResult> CombinedMeters { get; set; } public virtual IList<MeterTestResult> CombinedMeters { get; set; }
/// Value copied from the procedure (Entities.Procedure)
public virtual string ProcedureName { get; set; }
/// Values copied from the test (Entities.Test) /// Values copied from the test (Entities.Test)
public virtual string TestName { get; set; } public virtual string TestName { get; set; }
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
@@ -120,6 +122,9 @@ namespace TBF.Entities
} }
RepetitionNr = repetitionNr; RepetitionNr = repetitionNr;
/// Copy test parameters from Entities.Procedure object
ProcedureName = test.Procedure.Name;
/// Copy test parameters from Entities.Test object /// Copy test parameters from Entities.Test object
TestName = test.Name; TestName = test.Name;
Qfrom = test.Qfrom; Qfrom = test.Qfrom;
@@ -14,6 +14,8 @@ namespace TBF.Mappings
HasMany(x => x.CombinedMeters) HasMany(x => x.CombinedMeters)
.Cascade.All(); .Cascade.All();
Map(x => x.ProcedureName);
Map(x => x.TestName); Map(x => x.TestName);
Map(x => x.Qfrom); Map(x => x.Qfrom);
Map(x => x.Qto); Map(x => x.Qto);