Output.Printers.Munich document has two pages for a large number of tests, ver. 2.17.739
This commit is contained in:
parent
cafa247279
commit
cd926f559d
@ -11,10 +11,10 @@ namespace Results.Output.Printers.Munich
|
||||
{
|
||||
public class MunichPrintDocument : PrintDocument
|
||||
{
|
||||
const string FontFamilyName = "Arial"; //"Times New Roman";
|
||||
const string FontFamilyName = "Arial"; ///"Times New Roman";
|
||||
|
||||
const int SpacingOne = 18;
|
||||
const int SpacingOneAndHalf = (3 * SpacingOne) / 2;
|
||||
const int SpacingOneAndHalf = 24; /// was 27 before
|
||||
const int TitleX = 240;
|
||||
const int TitleY = 180; /// Depends on the size of the header
|
||||
const int FirstLineNr = 14; /// Depends on the size of the header
|
||||
@ -38,10 +38,11 @@ namespace Results.Output.Printers.Munich
|
||||
readonly int resultsCount;
|
||||
readonly bool compound; /// true when MetersKind is MetersKind.Combined
|
||||
|
||||
readonly int secondTableOffset; /// Calculated in the constructor
|
||||
|
||||
/// Top coordinate of the table
|
||||
int top;
|
||||
int nrPages;
|
||||
int pageNr;
|
||||
int firstTblTop;
|
||||
int secondTblTop;
|
||||
|
||||
/// <summary>
|
||||
/// Property variable for the Font the user wishes to use
|
||||
@ -85,7 +86,8 @@ namespace Results.Output.Printers.Munich
|
||||
int resultsCount = wm.MeterTestRslts.Count;
|
||||
if (compound) resultsCount /= 3;
|
||||
|
||||
secondTableOffset = (resultsCount + 2) * SpacingOneAndHalf;
|
||||
pageNr = 1;
|
||||
nrPages = (compound ? (resultsCount > 7) : (resultsCount > 9)) ? 2 : 1;
|
||||
|
||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
||||
}
|
||||
@ -138,219 +140,253 @@ namespace Results.Output.Printers.Munich
|
||||
/// Use the StringFormat class for the text layout of our document
|
||||
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
|
||||
|
||||
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
|
||||
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
|
||||
|
||||
int lineNr = FirstLineNr;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
|
||||
lineNr++;
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
|
||||
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
|
||||
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
|
||||
lineNr += 2;
|
||||
|
||||
if (compound)
|
||||
if (pageNr == 1)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
|
||||
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
|
||||
|
||||
///
|
||||
/// Common
|
||||
///
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
|
||||
lineNr++;
|
||||
}
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qn :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Qn :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
|
||||
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
|
||||
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
|
||||
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
|
||||
lineNr += 2;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
|
||||
|
||||
if (compound)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
lineNr++;
|
||||
}
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
||||
}
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||
}
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
|
||||
|
||||
lineNr += 2;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
|
||||
}
|
||||
|
||||
lineNr += 2;
|
||||
firstTblTop = SpacingOne * lineNr;
|
||||
|
||||
///
|
||||
/// Table 1
|
||||
///
|
||||
PrintTableOne(e, firstTblTop);
|
||||
DrawTableFrame(e, resultsCount + 1, firstTblTop);
|
||||
}
|
||||
|
||||
lineNr += 2;
|
||||
top = SpacingOne * lineNr;
|
||||
|
||||
PrintTable(e);
|
||||
DrawTable(e);
|
||||
if (pageNr == nrPages)
|
||||
{
|
||||
if (pageNr == 1)
|
||||
{
|
||||
secondTblTop = firstTblTop + (resultsCount + 2) * SpacingOneAndHalf;
|
||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf * 2) / SpacingOne;
|
||||
}
|
||||
else
|
||||
{
|
||||
secondTblTop = TitleY + SpacingOne;
|
||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne - 3;
|
||||
}
|
||||
|
||||
lineNr += (secondTableOffset * 2) / SpacingOne;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
|
||||
///
|
||||
/// Table 2
|
||||
///
|
||||
PrintTableTwo(e, secondTblTop);
|
||||
DrawTableFrame(e, resultsCount + 1, secondTblTop);
|
||||
|
||||
lineNr++;
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||
lineNr ++;
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Datum");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift");
|
||||
///
|
||||
/// Footer
|
||||
///
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
|
||||
|
||||
lineNr++;
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||
lineNr++;
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Datum");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift");
|
||||
}
|
||||
|
||||
e.HasMorePages = (pageNr != nrPages);
|
||||
pageNr++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print table texts.
|
||||
/// </summary>
|
||||
void PrintTable(System.Drawing.Printing.PrintPageEventArgs e)
|
||||
void PrintTableOne(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
|
||||
{
|
||||
PrintAt(e, FromTest(-1, -1), "Prüflauf");
|
||||
PrintAt(e, FromTest(-1, 0), "Q [l/h]");
|
||||
PrintAt(e, FromTest(-1, 1), "Prüf-Vol.[l]");
|
||||
PrintAt(e, FromTest(-1, 2), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]");
|
||||
PrintAt(e, FromTest(-1, 3), compound ? "NZ-Vol.[l]" : "-");
|
||||
PrintAt(e, FromTest(-1, 4), "Fehler [%]");
|
||||
PrintAt(e, FromTest(-1, 5), "Ergebnis");
|
||||
PrintAt(e, GetTabItemPos(0, 0, tblTop), "Prüflauf");
|
||||
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
|
||||
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Prüf-Vol.[l]");
|
||||
PrintAt(e, GetTabItemPos(0, 3, tblTop), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]");
|
||||
PrintAt(e, GetTabItemPos(0, 4, tblTop), compound ? "NZ-Vol.[l]" : "-");
|
||||
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Fehler [%]");
|
||||
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Ergebnis");
|
||||
|
||||
PrintAt(e, FromTest(-1, 6), "Q [l/h]");
|
||||
PrintAt(e, FromTest(-1, 7), "Temperatur");
|
||||
PrintAt(e, FromTest(-1, 8), "Dichte");
|
||||
PrintAt(e, FromTest(-1, 9), "Prüfzeit");
|
||||
PrintAt(e, FromTest(-1, 10), "Druck Eing.");
|
||||
PrintAt(e, FromTest(-1, 11), "Druck Ausg.");
|
||||
|
||||
int rowCnt = 0;
|
||||
int rowCnt = 1;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
{
|
||||
Point p = FromTest(rowCnt, -1);
|
||||
PrintAt(e, p.X, p.Y, mtr.Name());
|
||||
PrintAt(e, p.X, p.Y + (resultsCount + 2) * SpacingOneAndHalf, mtr.Name());
|
||||
|
||||
PrintAt(e, FromTest(rowCnt, 0), mtr.TestRslt.FlowMass.ToString("F1"));
|
||||
PrintAt(e, FromTest(rowCnt, 1), mtr.TestRslt.VolumeCTV.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 0, tblTop), mtr.Name());
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.VolumeCTV.ToString("F2"));
|
||||
if (compound)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
|
||||
PrintAt(e, FromTest(rowCnt, 2), mainMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, FromTest(rowCnt, 3), auxMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, FromTest(rowCnt, 4), mtr.Error.ToString("F2"));
|
||||
PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO");
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mainMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), auxMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintAt(e, FromTest(rowCnt, 2), mtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, FromTest(rowCnt, 3), "-");
|
||||
PrintAt(e, FromTest(rowCnt, 4), mtr.Error.ToString("F2"));
|
||||
PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO");
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), "-");
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
|
||||
}
|
||||
PrintAt(e, FromTest(rowCnt, 6), mtr.TestRslt.FlowMass.ToString("F1"));
|
||||
PrintAt(e, FromTest(rowCnt, 7), mtr.TestRslt.TempDownMean.ToString("F2"));
|
||||
PrintAt(e, FromTest(rowCnt, 8), mtr.TestRslt.DensityDiv.ToString("F2"));
|
||||
PrintAt(e, FromTest(rowCnt, 9), mtr.TestTime.ToString("F1"));
|
||||
PrintAt(e, FromTest(rowCnt, 10), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
|
||||
PrintAt(e, FromTest(rowCnt, 11), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
|
||||
|
||||
rowCnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PrintTableTwo(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
|
||||
{
|
||||
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
|
||||
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Temperatur");
|
||||
PrintAt(e, GetTabItemPos(0, 3, tblTop), "Dichte");
|
||||
PrintAt(e, GetTabItemPos(0, 4, tblTop), "Prüfzeit");
|
||||
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Druck Eing.");
|
||||
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Druck Ausg.");
|
||||
|
||||
int rowCnt = 1;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
{
|
||||
Point p = GetTabItemPos(rowCnt, 0, tblTop);
|
||||
PrintAt(e, p.X, p.Y, mtr.Name());
|
||||
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.TempDownMean.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.TestRslt.DensityDiv.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), mtr.TestTime.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
|
||||
|
||||
rowCnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw table lines.
|
||||
/// </summary>
|
||||
void DrawTable(System.Drawing.Printing.PrintPageEventArgs e)
|
||||
void DrawTableFrame(System.Drawing.Printing.PrintPageEventArgs e, int rowsCount, int tblTop)
|
||||
{
|
||||
int mid = top + SpacingOneAndHalf;
|
||||
int bot = top + (resultsCount + 1) * SpacingOneAndHalf;
|
||||
|
||||
int top2 = top + secondTableOffset;
|
||||
int mid2 = mid + secondTableOffset;
|
||||
int bot2 = bot + secondTableOffset;
|
||||
int t = tblTop;
|
||||
int m = tblTop + SpacingOneAndHalf;
|
||||
int b = tblTop + rowsCount * SpacingOneAndHalf;
|
||||
|
||||
// Horizontal lines
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top), new Point(747, top));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid), new Point(747, mid));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot), new Point(747, bot));
|
||||
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top2), new Point(747, top2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid2), new Point(747, mid2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot2), new Point(747, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, t), new Point(747, t));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, m), new Point(747, m));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, b), new Point(747, b));
|
||||
|
||||
// Vertical lines
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top), new Point( 80, bot));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top), new Point(267, bot));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top), new Point(347, bot));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top), new Point(427, bot));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top), new Point(507, bot));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top), new Point(587, bot));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top), new Point(667, bot));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top), new Point(747, bot));
|
||||
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top2), new Point( 80, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top2), new Point(267, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top2), new Point(347, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top2), new Point(427, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top2), new Point(507, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top2), new Point(587, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top2), new Point(667, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top2), new Point(747, bot2));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, t), new Point( 80, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, t), new Point(267, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, t), new Point(347, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, t), new Point(427, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, t), new Point(507, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, t), new Point(587, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, t), new Point(667, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, t), new Point(747, b));
|
||||
}
|
||||
|
||||
|
||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
||||
{
|
||||
PrintAt(e, p.X, p.Y, text);
|
||||
@ -373,16 +409,16 @@ namespace Results.Output.Printers.Munich
|
||||
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
|
||||
}
|
||||
|
||||
Point FromTest(int testNr, int parNr)
|
||||
/// <summary>
|
||||
/// Get text position form a number of the test and a number of the parameter.
|
||||
/// </summary>
|
||||
/// <param name="row"></param>
|
||||
/// <param name="column">Table column (0-based)</param>
|
||||
/// <returns></returns>
|
||||
Point GetTabItemPos(int row, int column, int tblTop)
|
||||
{
|
||||
const int NrParamsInOneTableRow = 6;
|
||||
|
||||
int x = 267 + (parNr % NrParamsInOneTableRow) * 80 + MarginLeft;
|
||||
int y = top + SpacingOneAndHalf + MarginTop + testNr * SpacingOneAndHalf
|
||||
+ ((parNr >= NrParamsInOneTableRow) ? secondTableOffset : 0);
|
||||
|
||||
if (parNr < 0) x = 80 + MarginLeft; /// When parNr == -1 return the left column x coordinate
|
||||
|
||||
int x = MarginLeft + ((column == 0) ? 80 : 187) + column * 80; /// leftmost column is wider
|
||||
int y = MarginTop + tblTop + (row * SpacingOneAndHalf);
|
||||
return new Point(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.736.0")]
|
||||
[assembly: AssemblyFileVersion("2.17.736.0")]
|
||||
[assembly: AssemblyVersion("2.17.739.0")]
|
||||
[assembly: AssemblyFileVersion("2.17.739.0")]
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.17.738.1")]
|
||||
[assembly: AssemblyFileVersion("2.17.738.1")]
|
||||
[assembly: AssemblyVersion("2.17.739.1")]
|
||||
[assembly: AssemblyFileVersion("2.17.739.1")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user