Bug fixed in Disabled watermeters will not appear in results...
When there were no results yet and Results screen was opened -> crash
This commit is contained in:
@@ -148,19 +148,20 @@ namespace TBF.Screens
|
||||
{
|
||||
for (int mtr0 = 0; mtr0 < Program.WMsCount; mtr0++)
|
||||
{
|
||||
if (!testResults[0].Meters[mtr0].Disabled) enabledWMsCount++;
|
||||
if ((testResults != null) && (testResults.Count > 0) && !testResults[0].Meters[mtr0].Disabled)
|
||||
enabledWMsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (MetersArrangement == Forms.ResultsConfig.Meters.Horizontally)
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
|
||||
lvWidth = (lvWidth + 5) / enabledWMsCount - 5;
|
||||
lvWidth = (lvWidth + 5) / Math.Max(enabledWMsCount, 1) - 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
flowLayoutPanel.FlowDirection = FlowDirection.TopDown;
|
||||
lvHeight = (lvHeight + 5) / enabledWMsCount - 5;
|
||||
lvHeight = (lvHeight + 5) / Math.Max(enabledWMsCount, 1) - 5;
|
||||
}
|
||||
flowLayoutPanel.Controls.Clear();
|
||||
flowLayoutPanel.WrapContents = false;
|
||||
@@ -170,7 +171,7 @@ namespace TBF.Screens
|
||||
int printedWMNr = 1;
|
||||
for (int mtr = 1; mtr <= (combined ? Program.WMsCount / 2 : Program.WMsCount); mtr++)
|
||||
{
|
||||
if (combined || !testResults[0].Meters[mtr - 1].Disabled)
|
||||
if (combined || (testResults != null && testResults.Count > 0 && !testResults[0].Meters[mtr - 1].Disabled))
|
||||
{
|
||||
if (TestsArrangement == Forms.ResultsConfig.TestsAre.Rows)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user