diff --git a/Results/Output/Printers/Zapiska/ZapiskaPrintDocument.cs b/Results/Output/Printers/Zapiska/ZapiskaPrintDocument.cs index 01af11ea6..16e6fa61b 100644 --- a/Results/Output/Printers/Zapiska/ZapiskaPrintDocument.cs +++ b/Results/Output/Printers/Zapiska/ZapiskaPrintDocument.cs @@ -134,7 +134,14 @@ namespace Results.Output.Printers.Zapiska SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2; /// Calculate the table rows count - int tableRowsCount = batch.WaterMeters.Count; + int tableRowsCount = 0; + if (cfg.GoodOnly) + { + foreach (var wm in batch.WaterMeters) + { + if (!cfg.GoodOnly || wm.Passed) tableRowsCount++; + } + } /// Prepare document outline titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height; @@ -345,14 +352,17 @@ namespace Results.Output.Printers.Zapiska float columnWidth = e.Graphics.MeasureString(selectedItems[i].Caption, headerFont).Width; foreach (var wm in wms) { - string itemText = selectedItems[i].Print(wm); + if (!cfg.GoodOnly || wm.Passed) + { + string itemText = selectedItems[i].Print(wm); - /// Strip color information - string[] texts = itemText.Split(new char[] { '|' }); - if (texts.Length == 2) { itemText = texts[0]; } + /// Strip color information + string[] texts = itemText.Split(new char[] { '|' }); + if (texts.Length == 2) { itemText = texts[0]; } - float width = e.Graphics.MeasureString(itemText, font).Width; - if (width > columnWidth) columnWidth = width; + float width = e.Graphics.MeasureString(itemText, font).Width; + if (width > columnWidth) columnWidth = width; + } } columnPos[i + 1] = columnPos[i] + columnWidth + (float)GapBetweenTableColumns; } @@ -375,25 +385,28 @@ namespace Results.Output.Printers.Zapiska int rowsCount = 0; foreach (var wm in wms) { - WMeterRsltItemSpec.TableRowNr = ++rowsCount; + if (!cfg.GoodOnly || wm.Passed) + { + WMeterRsltItemSpec.TableRowNr = ++rowsCount; - for (int i = 0; i < selectedItems.Count; i++) - { - WMeterRsltItemSpec.TableColumnNr = i + 1; + for (int i = 0; i < selectedItems.Count; i++) + { + WMeterRsltItemSpec.TableColumnNr = i + 1; - string itemText = selectedItems[i].Print(wm); + string itemText = selectedItems[i].Print(wm); - /// Strip color information - string[] texts = itemText.Split(new char[] { '|' }); - if (texts.Length == 2) - { - itemText = texts[0]; - Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White); - /// TODO: How to print colors? - } + /// Strip color information + string[] texts = itemText.Split(new char[] { '|' }); + if (texts.Length == 2) + { + itemText = texts[0]; + Color color = texts[1].Equals("Green") ? Color.Green : (texts[1].Equals("Red") ? Color.Red : Color.White); + /// TODO: How to print colors? + } - PrintAt(e, (int)columnPos[i], top + 2 * SpacingOne4Header + SpacingOne * rowsCount, itemText); - } + PrintAt(e, (int)columnPos[i], top + 2 * SpacingOne4Header + SpacingOne * rowsCount, itemText); + } + } } /// Horizontal line diff --git a/Results/Properties/AssemblyInfo.cs b/Results/Properties/AssemblyInfo.cs index 364ea33f3..9431a9e71 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.17.677.0")] -[assembly: AssemblyFileVersion("2.17.677.0")] +[assembly: AssemblyVersion("2.17.681.0")] +[assembly: AssemblyFileVersion("2.17.681.0")] diff --git a/TestBenchFramework/BenchControl/Output/Printers/Zapiska/Printer.cs b/TestBenchFramework/BenchControl/Output/Printers/Zapiska/Printer.cs index 9ebefa714..1c61fab40 100644 --- a/TestBenchFramework/BenchControl/Output/Printers/Zapiska/Printer.cs +++ b/TestBenchFramework/BenchControl/Output/Printers/Zapiska/Printer.cs @@ -107,6 +107,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska printerCfg.BelowItems3 = newCfg.BelowItems3; printerCfg.Footer = newCfg.Footer; + printerCfg.GoodOnly = newCfg.GoodOnly; + ApplyConfig(); } } diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index b2c9da46f..354c6c928 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.17.680.1")] -[assembly: AssemblyFileVersion("2.17.680.1")] +[assembly: AssemblyVersion("2.17.681.1")] +[assembly: AssemblyFileVersion("2.17.681.1")]