ResultsPrinter.Cevak implemented, bug fixes in ResultsPrinter.Basic. Bug fixes in EntryForms (Purchase order via UpdateTestResultss(..)), version 2.2.222.
This commit is contained in:
@@ -33,6 +33,7 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
/// Data to print
|
||||
///
|
||||
Results.Entities.Batch batch;
|
||||
TBF.BenchControl.BenchInfo.Polska.Component benchInfo;
|
||||
|
||||
///
|
||||
/// Items to print
|
||||
@@ -55,15 +56,17 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
/// <param name="textToPrint">Text to be printed</param>
|
||||
public PrintDocumentCevak(Results.Entities.Batch batch,
|
||||
PageOrientation pageOrientation,
|
||||
int topMrgn)
|
||||
int topMrgn,
|
||||
TBF.BenchControl.BenchInfo.Polska.Component benchInfo)
|
||||
{
|
||||
this.batch = batch;
|
||||
this.benchInfo = benchInfo;
|
||||
|
||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
||||
|
||||
TitleY = topMrgn; /// Depends on the size of the header
|
||||
HdrTop = TitleY + 60;
|
||||
BodyTop = HdrTop + 160;
|
||||
BodyTop = HdrTop + 230;
|
||||
|
||||
if (batch.WaterMeters[0].Compound())
|
||||
{
|
||||
@@ -97,7 +100,7 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
|
||||
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
|
||||
|
||||
nrPages = 1 + batch.WaterMeters.Count / nrWMsOnNextPage;
|
||||
nrPages = 1 + (batch.WaterMeters.Count - nrWMsOnFirstPage + nrWMsOnNextPage - 1) / nrWMsOnNextPage;
|
||||
|
||||
pageNr = 1;
|
||||
nextWMNr = 0;
|
||||
@@ -164,18 +167,24 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
|
||||
string[] leftColumn = new string[]
|
||||
{
|
||||
"Batch number: ",
|
||||
"Date and time: ",
|
||||
"Procedure:",
|
||||
Strings.User_,
|
||||
"Ambient temperature: ",
|
||||
"Ambient pressure: ",
|
||||
"Ambient humidity: ",
|
||||
"Protokol č.: ",
|
||||
"Zákazník: ",
|
||||
"Datum a čas: ",
|
||||
"Procedura: ",
|
||||
"Popis procedury: ",
|
||||
"Zkoušející: ",
|
||||
"Název zkušební stanice: ",
|
||||
"Zkušební SW, č. verze: ",
|
||||
"Metodika: ", /// BenchAdresa 1
|
||||
"Okolní teplota: ",
|
||||
"Okolní tlak: ",
|
||||
"Relativní vlhkost: ",
|
||||
};
|
||||
|
||||
string[] rightColumn = new string[]
|
||||
{
|
||||
batch.BatchNr.ToString(),
|
||||
batch.WaterMeters[0].PurchaseOrder,
|
||||
//batch.EndTime.ToShortDateString() + " " + batch.EndTime.ToShortTimeString(),
|
||||
string.Format("{0}.{1}.{2} {3}:{4}", batch.EndTime.Year.ToString("D4"),
|
||||
batch.EndTime.Month.ToString("D2"),
|
||||
@@ -183,7 +192,11 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
batch.EndTime.Hour.ToString("D2"),
|
||||
batch.EndTime.Minute.ToString("D2")),
|
||||
batch.ProcedureName,
|
||||
batch.ProcedureDescription,
|
||||
User.CurrentUser.Name,
|
||||
benchInfo.TestBenchName,
|
||||
string.Format("Test Bench Framework ver.{0}", batch.ProgramVersion),
|
||||
benchInfo.BenchInfoCfg.Address1,
|
||||
batch.AmbientTempAve().ToString("F1") + " °C",
|
||||
batch.AmbientPressAve().ToString("F0") + " mbar",
|
||||
batch.AmbientHumiAve().ToString("F0") + " %",
|
||||
@@ -222,7 +235,7 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
///----------
|
||||
/// Footer
|
||||
///----------
|
||||
PrintAt(e, leftMargin, topMargin + printHeight - SpacingOne, string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages));
|
||||
PrintAt(e, leftMargin, topMargin + printHeight - SpacingOne, string.Format("str. {1}/{2}", Strings.Page, pageNr++, nrPages));
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +287,7 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
int tableLeftX = (int)columnPos[0];
|
||||
int tableRightX = (int)columnPos[rsltItems.Count] - 20;
|
||||
|
||||
string wmText = string.Format("Water meter {0}", printedWMNr);
|
||||
string wmText = string.Format("Vodoměr {0}", printedWMNr);
|
||||
PrintAt(e, 100, top, wmText);
|
||||
if (!string.IsNullOrEmpty(wm.SerialNr))
|
||||
{
|
||||
@@ -298,6 +311,7 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
int testsCount = 0;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
testsCount++;
|
||||
for (int i = 0; i < rsltItems.Count; i++)
|
||||
{
|
||||
string itemText;
|
||||
@@ -327,7 +341,6 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
/// TODO: How to print colors?
|
||||
}
|
||||
|
||||
testsCount++;
|
||||
PrintAt(e, (int)columnPos[i], top + 30 + SpacingOne * testsCount, itemText);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ namespace TBF.BenchControl.ResultsPrinters.Cevak
|
||||
{
|
||||
if (batch.WaterMeters.Count > 0)
|
||||
{
|
||||
new PrintDocumentCevak(batch,
|
||||
printerCfg.PageOrientation,
|
||||
printerCfg.TopMargin).Print();
|
||||
TBF.BenchControl.BenchInfo.Polska.Component benchInfo =
|
||||
BenchControl.Sequences.ProcessData.BenchInfo as TBF.BenchControl.BenchInfo.Polska.Component;
|
||||
new PrintDocumentCevak(batch, printerCfg.PageOrientation, printerCfg.TopMargin, benchInfo).Print();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user