Skip to content

Commit c067f2e

Browse files
committed
Disable other tabs when MLC is running
1 parent 3355779 commit c067f2e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

IMLCGui/MainWindow.xaml.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ private void BtnQuickRun_Click(object sender, RoutedEventArgs e)
189189
this.TxtBoxQuickBandwidth.Text = "";
190190
this.TxtBoxQuickLatency.Text = "";
191191
this.BtnQuickRun.Content = "Cancel";
192+
this.ToggleOtherTabs(false);
192193
},
193194
"Running Intel MLC quick test",
194195
() =>
@@ -222,6 +223,7 @@ private void ResetQuickRunButton()
222223
this.BtnQuickRun.Invoke(() =>
223224
{
224225
this.BtnQuickRun.Content = "Run";
226+
this.ToggleOtherTabs(true);
225227
});
226228
}
227229

@@ -305,6 +307,7 @@ private void BtnBandwidthRun_Click(object sender, RoutedEventArgs e)
305307
this.TxtBoxBandwidth11.Text = "";
306308
this.TxtBoxBandwidthStreamTriad.Text = "";
307309
this.BtnBandwidthRun.Content = "Cancel";
310+
this.ToggleOtherTabs(false);
308311
},
309312
"Running Intel MLC bandwidth test",
310313
() =>
@@ -329,6 +332,7 @@ private void ResetBandwidthRunButton()
329332
this.BtnBandwidthRun.Invoke(() =>
330333
{
331334
this.BtnBandwidthRun.Content = "Run";
335+
this.ToggleOtherTabs(true);
332336
});
333337
}
334338

@@ -456,6 +460,7 @@ private void BtnLatencyRun_Click(object sender, RoutedEventArgs e)
456460
rowLatency.Bandwidth = "";
457461
}
458462
this.BtnLatencyRun.Content = "Cancel";
463+
this.ToggleOtherTabs(false);
459464
},
460465
"Running Intel MLC latency test",
461466
() =>
@@ -480,6 +485,7 @@ private void ResetLatencyRunButton()
480485
this.BtnLatencyRun.Invoke(() =>
481486
{
482487
this.BtnLatencyRun.Content = "Run";
488+
this.ToggleOtherTabs(true);
483489
});
484490
}
485491

@@ -602,6 +608,7 @@ private void BtnCacheRun_Click(object sender, RoutedEventArgs e)
602608
this.TxtBoxL2Hit.Text = "";
603609
this.TxtBoxL2HitM.Text = "";
604610
this.BtnCacheRun.Content = "Cancel";
611+
this.ToggleOtherTabs(false);
605612
},
606613
"Running Intel MLC cache test",
607614
() =>
@@ -626,6 +633,7 @@ private void ResetCacheRunButton()
626633
this.BtnCacheRun.Invoke(() =>
627634
{
628635
this.BtnCacheRun.Content = "Run";
636+
this.ToggleOtherTabs(true);
629637
});
630638
}
631639

@@ -828,6 +836,7 @@ private void BtnConfigureDownload_Click(object sender, RoutedEventArgs e)
828836
if (!Directory.Exists(mlcWindowsPath))
829837
{
830838
this._logger.Warn($"Failed to locate extracted directory at \"{mlcWindowsPath}\"");
839+
FileUtils.Delete(extractedZipDirectory);
831840
Dispatcher.Invoke(() =>
832841
{
833842
this.WriteToConfigureLog($"Failed to locate MLC at: {mlcWindowsPath}");
@@ -1055,6 +1064,18 @@ private void TxtConfigurePath_KeyUp(object sender, KeyEventArgs e)
10551064
}
10561065
}
10571066

1067+
private void ToggleOtherTabs(bool enabled)
1068+
{
1069+
for (int tabIndex = 0; tabIndex < this.TabCtrlBenchmark.Items.Count; tabIndex++)
1070+
{
1071+
if (tabIndex != this.TabCtrlBenchmark.SelectedIndex)
1072+
{
1073+
MetroTabItem tab = (MetroTabItem)this.TabCtrlBenchmark.Items[tabIndex];
1074+
tab.IsEnabled = enabled;
1075+
}
1076+
}
1077+
}
1078+
10581079
private static string TrimNumericString(string inputString)
10591080
{
10601081
inputString = inputString.Trim();

0 commit comments

Comments
 (0)