diff --git a/Results/Entities/WaterMeter.cs b/Results/Entities/WaterMeter.cs index 10f85dc4e..a37f1ad92 100644 --- a/Results/Entities/WaterMeter.cs +++ b/Results/Entities/WaterMeter.cs @@ -145,14 +145,12 @@ namespace Results.Entities #endif } -#if LANG_PL public virtual string PassedOrErrorFlagsStr() { ErrorFlagsMode errorFlagsMode; string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode)); return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr()) : eFlags; } -#endif /// /// Convert failed tests and combined errorFlags of all tests to string diff --git a/Results/Output/Printers/OnePerMeter/OnePerMeterPrintDocument.cs b/Results/Output/Printers/OnePerMeter/OnePerMeterPrintDocument.cs index 4aff98d31..773e4f519 100644 --- a/Results/Output/Printers/OnePerMeter/OnePerMeterPrintDocument.cs +++ b/Results/Output/Printers/OnePerMeter/OnePerMeterPrintDocument.cs @@ -195,7 +195,7 @@ namespace Results.Output.Printers.OnePerMeter Table table1 = new Table(2) { Style = commonTableStyle }; foreach (var item in commonItems1) { - string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; + string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] }; table1.AddRow(row, horizAlgn, vertAlgn); } float bodyTop1 = table1.Draw(e, leftMarginCommon1, commonTop); @@ -204,7 +204,7 @@ namespace Results.Output.Printers.OnePerMeter table1 = new Table(2) { Style = commonTableStyle }; foreach (var item in commonItems2) { - string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; + string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] }; table1.AddRow(row, horizAlgn, vertAlgn); } float bodyTop2 = table1.Draw(e, leftMarginCommon2, commonTop); @@ -213,7 +213,7 @@ namespace Results.Output.Printers.OnePerMeter table1 = new Table(2) { Style = commonTableStyle }; foreach (var item in commonItems3) { - string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; + string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] }; table1.AddRow(row, horizAlgn, vertAlgn); } float bodyTop3 = table1.Draw(e, leftMarginCommon3, commonTop); @@ -244,7 +244,7 @@ namespace Results.Output.Printers.OnePerMeter LineWidth = 1, TopHeadersCount = 1, HorizLines = TableLines.All, - VertLines = TableLines.FirstSecondAndLast + VertLines = TableLines.All }; table = Table.Create_TestsAreRows(wm, (pageNr == 1) ? testItems : testItems2, style); break; @@ -303,7 +303,7 @@ namespace Results.Output.Printers.OnePerMeter Table table2 = new Table(2) { Style = commonTableStyle }; foreach (var item in belowItems1) { - string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; + string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] }; table2.AddRow(row, horizAlgn, vertAlgn); } table2.Draw(e, leftMarginBelow1, belowTop); @@ -312,7 +312,7 @@ namespace Results.Output.Printers.OnePerMeter table2 = new Table(2) { Style = commonTableStyle }; foreach (var item in belowItems2) { - string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; + string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] }; table2.AddRow(row, horizAlgn, vertAlgn); } table2.Draw(e, leftMarginBelow2, belowTop); @@ -321,7 +321,7 @@ namespace Results.Output.Printers.OnePerMeter table2 = new Table(2) { Style = commonTableStyle }; foreach (var item in belowItems3) { - string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; + string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] }; table2.AddRow(row, horizAlgn, vertAlgn); } table2.Draw(e, leftMarginBelow3, belowTop); diff --git a/Results/Output/Printers/Table.cs b/Results/Output/Printers/Table.cs index e3f6e9b58..0b8f5f5ce 100644 --- a/Results/Output/Printers/Table.cs +++ b/Results/Output/Printers/Table.cs @@ -205,7 +205,7 @@ namespace Results.Output.Printers { for (int colIx = 0; colIx <= tblColumnsCount; colIx++) { - if (Style.VertLines == TableLines.All || colIx == 0 || colIx == RowsCount || (Style.VertLines == TableLines.FirstSecondAndLast && colIx == 1)) + if (Style.VertLines == TableLines.All || colIx == 0 || colIx == ColumnsCount || (Style.VertLines == TableLines.FirstSecondAndLast && colIx == 1)) { e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableTopY), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableBottomY)); } diff --git a/Results/Properties/AssemblyInfo.cs b/Results/Properties/AssemblyInfo.cs index dfa62ffb0..4c4f9434f 100644 --- a/Results/Properties/AssemblyInfo.cs +++ b/Results/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.18.874.0")] -[assembly: AssemblyFileVersion("2.18.874.0")] +[assembly: AssemblyVersion("2.18.877.0")] +[assembly: AssemblyFileVersion("2.18.877.0")] diff --git a/TBF/BenchControl/Output/Printers/OnePerMeter/Printer.cs b/TBF/BenchControl/Output/Printers/OnePerMeter/Printer.cs index 616ba1760..096ff6a5a 100644 --- a/TBF/BenchControl/Output/Printers/OnePerMeter/Printer.cs +++ b/TBF/BenchControl/Output/Printers/OnePerMeter/Printer.cs @@ -150,7 +150,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter foreach (var wm in batch.WaterMeters) { - if (!printerCfg.GoodOnly || wm.Passed) + if (wm != null && (!printerCfg.GoodOnly || wm.Passed)) { string documentName; try @@ -185,56 +185,53 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter void PrintResults(Results.Entities.Batch batch, Results.Entities.WaterMeter wm, string documentName) { - if (batch.WaterMeters.Count > 0) - { - OnePerMeterPrinterCfg cfg = new OnePerMeterPrinterCfg { - PageOrientation = printerCfg.PageOrientation, - Template = printerCfg.Template, - TopMargin = printerCfg.TopMargin, - BottomMargin = printerCfg.BottomMargin, - LeftMargin = printerCfg.LeftMargin, - TitFntFml = printerCfg.TitFntFml, - TitFntSz = printerCfg.TitFntSz, - TitFntSty = printerCfg.TitFntSty, - HdrFntFml = printerCfg.HdrFntFml, - HdrFntSz = printerCfg.HdrFntSz, - HdrFntSty = printerCfg.HdrFntSty, - BodyFntFml = printerCfg.BodyFntFml, - BodyFntSz = printerCfg.BodyFntSz, - BodyFntSty = printerCfg.BodyFntSty, - FooterFntFml = printerCfg.FooterFntFml, - FooterFntSz = printerCfg.FooterFntSz, - FooterFntSty = printerCfg.FooterFntSty, - GoodOnly = printerCfg.GoodOnly, - SupressPrinting = printerCfg.SupressPrinting, - CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()), - Header = printerCfg.Header, - ColW0Pct = printerCfg.ColW0Pct, - ColW1Pct = printerCfg.ColW1Pct, - ColW2Pct = printerCfg.ColW2Pct, - CommonItems1 = printerCfg.CommonItems1, - CommonItems2 = printerCfg.CommonItems2, - CommonItems3 = printerCfg.CommonItems3, - Form = printerCfg.Form, - TestItems = printerCfg.SelectedItems, - TestItems2 = printerCfg.SelectedItems2, - BelowW0Pct = printerCfg.BelowW0Pct, - BelowW1Pct = printerCfg.BelowW1Pct, - BelowW2Pct = printerCfg.BelowW2Pct, - BelowItems1 = printerCfg.BelowItems1, - BelowItems2 = printerCfg.BelowItems2, - BelowItems3 = printerCfg.BelowItems3, - Footer = printerCfg.Footer, - TestsAreRows = printerCfg.TestsAreRows, - ImgFullPathName = (wm.ArchivePath != null) ? System.IO.Path.Combine(wm.ArchivePath, printerCfg.ImgName) : null, - ImgLeft = printerCfg.ImgLeft, - ImgTop = printerCfg.ImgTop, - ImgWid = printerCfg.ImgWid, - ImgHgh = printerCfg.ImgHgh, - }; + OnePerMeterPrinterCfg cfg = new OnePerMeterPrinterCfg { + PageOrientation = printerCfg.PageOrientation, + Template = printerCfg.Template, + TopMargin = printerCfg.TopMargin, + BottomMargin = printerCfg.BottomMargin, + LeftMargin = printerCfg.LeftMargin, + TitFntFml = printerCfg.TitFntFml, + TitFntSz = printerCfg.TitFntSz, + TitFntSty = printerCfg.TitFntSty, + HdrFntFml = printerCfg.HdrFntFml, + HdrFntSz = printerCfg.HdrFntSz, + HdrFntSty = printerCfg.HdrFntSty, + BodyFntFml = printerCfg.BodyFntFml, + BodyFntSz = printerCfg.BodyFntSz, + BodyFntSty = printerCfg.BodyFntSty, + FooterFntFml = printerCfg.FooterFntFml, + FooterFntSz = printerCfg.FooterFntSz, + FooterFntSty = printerCfg.FooterFntSty, + GoodOnly = printerCfg.GoodOnly, + SupressPrinting = printerCfg.SupressPrinting, + CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()), + Header = printerCfg.Header, + ColW0Pct = printerCfg.ColW0Pct, + ColW1Pct = printerCfg.ColW1Pct, + ColW2Pct = printerCfg.ColW2Pct, + CommonItems1 = printerCfg.CommonItems1, + CommonItems2 = printerCfg.CommonItems2, + CommonItems3 = printerCfg.CommonItems3, + Form = printerCfg.Form, + TestItems = printerCfg.SelectedItems, + TestItems2 = printerCfg.SelectedItems2, + BelowW0Pct = printerCfg.BelowW0Pct, + BelowW1Pct = printerCfg.BelowW1Pct, + BelowW2Pct = printerCfg.BelowW2Pct, + BelowItems1 = printerCfg.BelowItems1, + BelowItems2 = printerCfg.BelowItems2, + BelowItems3 = printerCfg.BelowItems3, + Footer = printerCfg.Footer, + TestsAreRows = printerCfg.TestsAreRows, + ImgFullPathName = (wm.ArchivePath != null) ? System.IO.Path.Combine(wm.ArchivePath, printerCfg.ImgName) : null, + ImgLeft = printerCfg.ImgLeft, + ImgTop = printerCfg.ImgTop, + ImgWid = printerCfg.ImgWid, + ImgHgh = printerCfg.ImgHgh, + }; - new Results.Output.Printers.OnePerMeter.OnePerMeterPrintDocument(batch, cfg, wm, documentName).Print(); - } + new Results.Output.Printers.OnePerMeter.OnePerMeterPrintDocument(batch, cfg, wm, documentName).Print(); } } } diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 0d185e5bd..f8785d2db 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.18.875.0")] -[assembly: AssemblyFileVersion("2.18.875.0")] +[assembly: AssemblyVersion("2.18.877.0")] +[assembly: AssemblyFileVersion("2.18.877.0")]