Bug fixes: (1) OnePerMeter : 'WaterMeters[0]' used instead of 'wm', (2) Printers.Table : last vertical line, ver. 2.18.877

This commit is contained in:
Milan Hanajik
2018-04-15 12:19:06 +02:00
parent b17d710044
commit 5769b6ad48
6 changed files with 59 additions and 64 deletions
-2
View File
@@ -145,14 +145,12 @@ namespace Results.Entities
#endif #endif
} }
#if LANG_PL
public virtual string PassedOrErrorFlagsStr() public virtual string PassedOrErrorFlagsStr()
{ {
ErrorFlagsMode errorFlagsMode; ErrorFlagsMode errorFlagsMode;
string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode)); string eFlags = Utils.ErrorFlagsStr(ErrorFlagsFromTestsAndWM(out errorFlagsMode));
return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr()) : eFlags; return string.IsNullOrEmpty(eFlags) ? (WaterMeterData.Text4 + PassedColorStr()) : eFlags;
} }
#endif
/// <summary> /// <summary>
/// Convert failed tests and combined errorFlags of all tests to string /// Convert failed tests and combined errorFlags of all tests to string
@@ -195,7 +195,7 @@ namespace Results.Output.Printers.OnePerMeter
Table table1 = new Table(2) { Style = commonTableStyle }; Table table1 = new Table(2) { Style = commonTableStyle };
foreach (var item in commonItems1) foreach (var item in commonItems1)
{ {
string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
table1.AddRow(row, horizAlgn, vertAlgn); table1.AddRow(row, horizAlgn, vertAlgn);
} }
float bodyTop1 = table1.Draw(e, leftMarginCommon1, commonTop); float bodyTop1 = table1.Draw(e, leftMarginCommon1, commonTop);
@@ -204,7 +204,7 @@ namespace Results.Output.Printers.OnePerMeter
table1 = new Table(2) { Style = commonTableStyle }; table1 = new Table(2) { Style = commonTableStyle };
foreach (var item in commonItems2) foreach (var item in commonItems2)
{ {
string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
table1.AddRow(row, horizAlgn, vertAlgn); table1.AddRow(row, horizAlgn, vertAlgn);
} }
float bodyTop2 = table1.Draw(e, leftMarginCommon2, commonTop); float bodyTop2 = table1.Draw(e, leftMarginCommon2, commonTop);
@@ -213,7 +213,7 @@ namespace Results.Output.Printers.OnePerMeter
table1 = new Table(2) { Style = commonTableStyle }; table1 = new Table(2) { Style = commonTableStyle };
foreach (var item in commonItems3) foreach (var item in commonItems3)
{ {
string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
table1.AddRow(row, horizAlgn, vertAlgn); table1.AddRow(row, horizAlgn, vertAlgn);
} }
float bodyTop3 = table1.Draw(e, leftMarginCommon3, commonTop); float bodyTop3 = table1.Draw(e, leftMarginCommon3, commonTop);
@@ -244,7 +244,7 @@ namespace Results.Output.Printers.OnePerMeter
LineWidth = 1, LineWidth = 1,
TopHeadersCount = 1, TopHeadersCount = 1,
HorizLines = TableLines.All, HorizLines = TableLines.All,
VertLines = TableLines.FirstSecondAndLast VertLines = TableLines.All
}; };
table = Table.Create_TestsAreRows(wm, (pageNr == 1) ? testItems : testItems2, style); table = Table.Create_TestsAreRows(wm, (pageNr == 1) ? testItems : testItems2, style);
break; break;
@@ -303,7 +303,7 @@ namespace Results.Output.Printers.OnePerMeter
Table table2 = new Table(2) { Style = commonTableStyle }; Table table2 = new Table(2) { Style = commonTableStyle };
foreach (var item in belowItems1) foreach (var item in belowItems1)
{ {
string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
table2.AddRow(row, horizAlgn, vertAlgn); table2.AddRow(row, horizAlgn, vertAlgn);
} }
table2.Draw(e, leftMarginBelow1, belowTop); table2.Draw(e, leftMarginBelow1, belowTop);
@@ -312,7 +312,7 @@ namespace Results.Output.Printers.OnePerMeter
table2 = new Table(2) { Style = commonTableStyle }; table2 = new Table(2) { Style = commonTableStyle };
foreach (var item in belowItems2) foreach (var item in belowItems2)
{ {
string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
table2.AddRow(row, horizAlgn, vertAlgn); table2.AddRow(row, horizAlgn, vertAlgn);
} }
table2.Draw(e, leftMarginBelow2, belowTop); table2.Draw(e, leftMarginBelow2, belowTop);
@@ -321,7 +321,7 @@ namespace Results.Output.Printers.OnePerMeter
table2 = new Table(2) { Style = commonTableStyle }; table2 = new Table(2) { Style = commonTableStyle };
foreach (var item in belowItems3) foreach (var item in belowItems3)
{ {
string[] row = new string[] { item.Caption, (batch.WaterMeters.Count > 0) ? item.Print(batch.WaterMeters[0]).Split(new char[] { '|' })[0] : string.Empty }; string[] row = new string[] { item.Caption, item.Print(wm).Split(new char[] { '|' })[0] };
table2.AddRow(row, horizAlgn, vertAlgn); table2.AddRow(row, horizAlgn, vertAlgn);
} }
table2.Draw(e, leftMarginBelow3, belowTop); table2.Draw(e, leftMarginBelow3, belowTop);
+1 -1
View File
@@ -205,7 +205,7 @@ namespace Results.Output.Printers
{ {
for (int colIx = 0; colIx <= tblColumnsCount; colIx++) for (int colIx = 0; colIx <= tblColumnsCount; colIx++)
{ {
if (Style.VertLines == TableLines.All || colIx == 0 || colIx == RowsCount || (Style.VertLines == TableLines.FirstSecondAndLast && colIx == 1)) if (Style.VertLines == TableLines.All || colIx == 0 || colIx == ColumnsCount || (Style.VertLines == TableLines.FirstSecondAndLast && colIx == 1))
{ {
e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableTopY), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableBottomY)); e.Graphics.DrawLine(new Pen(Color.Black, Style.LineWidth), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableTopY), new PointF(vertLinePos[colIx] + Style.LineWidth / 2, tableBottomY));
} }
+2 -2
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 // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.18.874.0")] [assembly: AssemblyVersion("2.18.877.0")]
[assembly: AssemblyFileVersion("2.18.874.0")] [assembly: AssemblyFileVersion("2.18.877.0")]
@@ -150,7 +150,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
foreach (var wm in batch.WaterMeters) foreach (var wm in batch.WaterMeters)
{ {
if (!printerCfg.GoodOnly || wm.Passed) if (wm != null && (!printerCfg.GoodOnly || wm.Passed))
{ {
string documentName; string documentName;
try try
@@ -185,56 +185,53 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
void PrintResults(Results.Entities.Batch batch, Results.Entities.WaterMeter wm, string documentName) void PrintResults(Results.Entities.Batch batch, Results.Entities.WaterMeter wm, string documentName)
{ {
if (batch.WaterMeters.Count > 0) OnePerMeterPrinterCfg cfg = new OnePerMeterPrinterCfg {
{ PageOrientation = printerCfg.PageOrientation,
OnePerMeterPrinterCfg cfg = new OnePerMeterPrinterCfg { Template = printerCfg.Template,
PageOrientation = printerCfg.PageOrientation, TopMargin = printerCfg.TopMargin,
Template = printerCfg.Template, BottomMargin = printerCfg.BottomMargin,
TopMargin = printerCfg.TopMargin, LeftMargin = printerCfg.LeftMargin,
BottomMargin = printerCfg.BottomMargin, TitFntFml = printerCfg.TitFntFml,
LeftMargin = printerCfg.LeftMargin, TitFntSz = printerCfg.TitFntSz,
TitFntFml = printerCfg.TitFntFml, TitFntSty = printerCfg.TitFntSty,
TitFntSz = printerCfg.TitFntSz, HdrFntFml = printerCfg.HdrFntFml,
TitFntSty = printerCfg.TitFntSty, HdrFntSz = printerCfg.HdrFntSz,
HdrFntFml = printerCfg.HdrFntFml, HdrFntSty = printerCfg.HdrFntSty,
HdrFntSz = printerCfg.HdrFntSz, BodyFntFml = printerCfg.BodyFntFml,
HdrFntSty = printerCfg.HdrFntSty, BodyFntSz = printerCfg.BodyFntSz,
BodyFntFml = printerCfg.BodyFntFml, BodyFntSty = printerCfg.BodyFntSty,
BodyFntSz = printerCfg.BodyFntSz, FooterFntFml = printerCfg.FooterFntFml,
BodyFntSty = printerCfg.BodyFntSty, FooterFntSz = printerCfg.FooterFntSz,
FooterFntFml = printerCfg.FooterFntFml, FooterFntSty = printerCfg.FooterFntSty,
FooterFntSz = printerCfg.FooterFntSz, GoodOnly = printerCfg.GoodOnly,
FooterFntSty = printerCfg.FooterFntSty, SupressPrinting = printerCfg.SupressPrinting,
GoodOnly = printerCfg.GoodOnly, CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
SupressPrinting = printerCfg.SupressPrinting, Header = printerCfg.Header,
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()), ColW0Pct = printerCfg.ColW0Pct,
Header = printerCfg.Header, ColW1Pct = printerCfg.ColW1Pct,
ColW0Pct = printerCfg.ColW0Pct, ColW2Pct = printerCfg.ColW2Pct,
ColW1Pct = printerCfg.ColW1Pct, CommonItems1 = printerCfg.CommonItems1,
ColW2Pct = printerCfg.ColW2Pct, CommonItems2 = printerCfg.CommonItems2,
CommonItems1 = printerCfg.CommonItems1, CommonItems3 = printerCfg.CommonItems3,
CommonItems2 = printerCfg.CommonItems2, Form = printerCfg.Form,
CommonItems3 = printerCfg.CommonItems3, TestItems = printerCfg.SelectedItems,
Form = printerCfg.Form, TestItems2 = printerCfg.SelectedItems2,
TestItems = printerCfg.SelectedItems, BelowW0Pct = printerCfg.BelowW0Pct,
TestItems2 = printerCfg.SelectedItems2, BelowW1Pct = printerCfg.BelowW1Pct,
BelowW0Pct = printerCfg.BelowW0Pct, BelowW2Pct = printerCfg.BelowW2Pct,
BelowW1Pct = printerCfg.BelowW1Pct, BelowItems1 = printerCfg.BelowItems1,
BelowW2Pct = printerCfg.BelowW2Pct, BelowItems2 = printerCfg.BelowItems2,
BelowItems1 = printerCfg.BelowItems1, BelowItems3 = printerCfg.BelowItems3,
BelowItems2 = printerCfg.BelowItems2, Footer = printerCfg.Footer,
BelowItems3 = printerCfg.BelowItems3, TestsAreRows = printerCfg.TestsAreRows,
Footer = printerCfg.Footer, ImgFullPathName = (wm.ArchivePath != null) ? System.IO.Path.Combine(wm.ArchivePath, printerCfg.ImgName) : null,
TestsAreRows = printerCfg.TestsAreRows, ImgLeft = printerCfg.ImgLeft,
ImgFullPathName = (wm.ArchivePath != null) ? System.IO.Path.Combine(wm.ArchivePath, printerCfg.ImgName) : null, ImgTop = printerCfg.ImgTop,
ImgLeft = printerCfg.ImgLeft, ImgWid = printerCfg.ImgWid,
ImgTop = printerCfg.ImgTop, ImgHgh = printerCfg.ImgHgh,
ImgWid = printerCfg.ImgWid, };
ImgHgh = printerCfg.ImgHgh,
};
new Results.Output.Printers.OnePerMeter.OnePerMeterPrintDocument(batch, cfg, wm, documentName).Print(); new Results.Output.Printers.OnePerMeter.OnePerMeterPrintDocument(batch, cfg, wm, documentName).Print();
}
} }
} }
} }
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("2.18.875.0")] [assembly: AssemblyVersion("2.18.877.0")]
[assembly: AssemblyFileVersion("2.18.875.0")] [assembly: AssemblyFileVersion("2.18.877.0")]