output.FileWriter.Enhanced copes with WaterMeters.Count==0, etc.
This commit is contained in:
@@ -294,7 +294,7 @@ namespace TBF.BenchControl.Output.FileWriters.Enhanced
|
|||||||
foreach (var v in commonItems)
|
foreach (var v in commonItems)
|
||||||
{
|
{
|
||||||
leftColumn[cnt] = v.Caption;
|
leftColumn[cnt] = v.Caption;
|
||||||
rightColumn[cnt] = v.Print(batch.WaterMeters[0]);
|
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
|
|||||||
HdrTop = TitleY + 60;
|
HdrTop = TitleY + 60;
|
||||||
BodyTop = HdrTop + 160;
|
BodyTop = HdrTop + 160;
|
||||||
|
|
||||||
if (batch.WaterMeters[0].Compound())
|
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound())
|
||||||
{
|
{
|
||||||
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
|
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
|
||||||
}
|
}
|
||||||
@@ -100,12 +100,15 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
|
|||||||
}
|
}
|
||||||
|
|
||||||
int testsCount = 0;
|
int testsCount = 0;
|
||||||
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
|
if (batch.WaterMeters.Count > 0)
|
||||||
{
|
{
|
||||||
if (mtr.Publish() == Config.Entities.Publish.Always) testsCount++;
|
foreach (var mtr in batch.WaterMeters[0].MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (mtr.Publish() == Config.Entities.Publish.Always) testsCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (batch.WaterMeters[0].Compound()) testsCount /= 3;
|
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound()) testsCount /= 3;
|
||||||
|
|
||||||
int wmSectionHeight = (testsCount + 4) * SpacingOne;
|
int wmSectionHeight = (testsCount + 4) * SpacingOne;
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace TBF.BenchControl.ResultsPrinters.LabelPrinter
|
|||||||
|
|
||||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
||||||
|
|
||||||
if (batch.WaterMeters[0].Compound())
|
if (batch.WaterMeters.Count > 0 && batch.WaterMeters[0].Compound())
|
||||||
{
|
{
|
||||||
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
|
rsltItems = Results.ItemSpec.FromStrArray(Program.LocalSettings.RsltItems_Printer_CombinedWM);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user