Output.Printers.Zapiska : 'Good only' option implemented, ver. 2.17.681
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user