Output.Printers.Zapiska : 'Good only' option implemented, ver. 2.17.681

This commit is contained in:
Milan Hanajik 2017-09-29 15:21:40 +02:00
parent 3dc347c66a
commit fd81675168
4 changed files with 41 additions and 26 deletions

View File

@ -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,6 +352,8 @@ namespace Results.Output.Printers.Zapiska
float columnWidth = e.Graphics.MeasureString(selectedItems[i].Caption, headerFont).Width;
foreach (var wm in wms)
{
if (!cfg.GoodOnly || wm.Passed)
{
string itemText = selectedItems[i].Print(wm);
/// Strip color information
@ -354,6 +363,7 @@ namespace Results.Output.Printers.Zapiska
float width = e.Graphics.MeasureString(itemText, font).Width;
if (width > columnWidth) columnWidth = width;
}
}
columnPos[i + 1] = columnPos[i] + columnWidth + (float)GapBetweenTableColumns;
}
int tableLeftX = (int)columnPos[0];
@ -374,6 +384,8 @@ namespace Results.Output.Printers.Zapiska
int rowsCount = 0;
foreach (var wm in wms)
{
if (!cfg.GoodOnly || wm.Passed)
{
WMeterRsltItemSpec.TableRowNr = ++rowsCount;
@ -395,6 +407,7 @@ namespace Results.Output.Printers.Zapiska
PrintAt(e, (int)columnPos[i], top + 2 * SpacingOne4Header + SpacingOne * rowsCount, itemText);
}
}
}
/// Horizontal line
horY = top + 2 * SpacingOneAndHalf4Header + SpacingOne * rowsCount;

View File

@ -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")]

View File

@ -107,6 +107,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
printerCfg.BelowItems3 = newCfg.BelowItems3;
printerCfg.Footer = newCfg.Footer;
printerCfg.GoodOnly = newCfg.GoodOnly;
ApplyConfig();
}
}

View File

@ -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")]