From 2021230836e5629eebe9fbcb08dcb4bdd2e3e4b7 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 27 Jun 2018 00:21:53 -0700 Subject: [PATCH] Quick fix to account for possibly odd speeds --- MainWindow.xaml.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 0708be35..df60515e 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -483,7 +483,12 @@ namespace DICUI return; } - cmb_DriveSpeed.SelectedValue = speed; + // If the value is in the list, we can set it immediately + if (_driveSpeeds.Contains(speed)) + cmb_DriveSpeed.SelectedValue = speed; + // Otherwise, we need to set the next lowest value + else + cmb_DriveSpeed.SelectedValue = _driveSpeeds.Where(s => s < speed).Last(); } ///