Better sample rate selection.

This commit is contained in:
Nick Foster 2013-07-18 18:31:10 -07:00
parent 4174658f0d
commit 498cea34b2

View File

@ -226,8 +226,11 @@ class mainwindow(QtGui.QMainWindow):
self.ui.combo_ant.addItems(self.antennas) self.ui.combo_ant.addItems(self.antennas)
#set up recommended sample rate #set up recommended sample rate
lowest_rate_valid = min(x for x in self.rates if x >= 4e6) recommended_rate = min(x for x in self.rates if x >= 4e6 and
self.ui.combo_rate.setCurrentIndex(self.rates.index(lowest_rate_valid)) max(self.rates) % x == 0)
if recommended_rate >= 8.e6:
self.ui.check_pmf.setChecked(True)
self.ui.combo_rate.setCurrentIndex(self.rates.index(recommended_rate))
################ action handlers #################### ################ action handlers ####################
def on_combo_source_currentIndexChanged(self, index): def on_combo_source_currentIndexChanged(self, index):