def _span_rbw_controls(self): span = QtGui.QComboBox(self) decimation_values = [1] + [2**x for x in range(2, 10)] for d in decimation_values: span.addItem("Span: %s" % frequency_text(DEVICE_FULL_SPAN / d)) self._decimation_values = decimation_values self._span_box = span def new_span(): self.set_decimation(decimation_values[span.currentIndex()]) self._update_rbw_box() span.currentIndexChanged.connect(new_span) rbw = QtGui.QComboBox(self) self._points_values = [2**x for x in range(8, 16)] self._rbw_box = rbw rbw.addItems([str(p) for p in self._points_values]) self._read_update_span_rbw_boxes() def new_rbw(): self.points = self._points_values[rbw.currentIndex()] self.decimation_points = self.decimation_factor * self.points with self.paused_stream() as dut: dut.spp(self.points) rbw.setCurrentIndex(self._points_values.index(1024)) rbw.currentIndexChanged.connect(new_rbw) return span, rbw
def _span_rbw_controls(self): span = QtGui.QComboBox(self) decimation_values = [1] + [2 ** x for x in range(2, 10)] for d in decimation_values: span.addItem("Span: %s" % frequency_text(DEVICE_FULL_SPAN / d)) self._decimation_values = decimation_values self._span_box = span def new_span(): self.set_decimation(decimation_values[span.currentIndex()]) self._update_rbw_box() span.currentIndexChanged.connect(new_span) rbw = QtGui.QComboBox(self) self._points_values = [2 ** x for x in range(8, 16)] self._rbw_box = rbw rbw.addItems([str(p) for p in self._points_values]) self._read_update_span_rbw_boxes() def new_rbw(): self.points = self._points_values[rbw.currentIndex()] self.decimation_points = self.decimation_factor * self.points with self.paused_stream() as dut: dut.spp(self.points) rbw.setCurrentIndex(self._points_values.index(1024)) rbw.currentIndexChanged.connect(new_rbw) return span, rbw
def _update_rbw_box(self): d = self.decimation_factor for i, p in enumerate(self._points_values): r = DEVICE_FULL_SPAN / d / p self._rbw_box.setItemText(i, "RBW: %s" % frequency_text(r)) if self.decimation_points and self.decimation_points == d * p: self._rbw_box.setCurrentIndex(i) self.points = self._points_values[self._rbw_box.currentIndex()]