Beispiel #1
0
    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
        rbw.setCurrentIndex(self._points_values.index(1024))
        #new_rbw()
        rbw.currentIndexChanged.connect(new_rbw)

        return span, rbw
Beispiel #2
0
    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))
        span.setCurrentIndex(decimation_values.index(self.dut.decimation()))
        def new_span():
            self.set_decimation(decimation_values[span.currentIndex()])
            build_rbw()
        span.currentIndexChanged.connect(new_span)

        rbw = QtGui.QComboBox(self)
        points_values = [2 ** x for x in range(8, 16)]
        rbw.addItems([str(p) for p in points_values])
        def build_rbw():
            d = self.decimation_factor
            for i, p in enumerate(points_values):
                r = DEVICE_FULL_SPAN / d / p
                rbw.setItemText(i, "RBW: %s" % frequency_text(r))
                if self.decimation_points and self.decimation_points == d * p:
                    rbw.setCurrentIndex(i)
            self.points = points_values[rbw.currentIndex()]
        build_rbw()
        def new_rbw():
            self.points = points_values[rbw.currentIndex()]
            self.decimation_points = self.decimation_factor * self.points
        rbw.setCurrentIndex(points_values.index(1024))
        new_rbw()
        rbw.currentIndexChanged.connect(new_rbw)

        return span, rbw
Beispiel #3
0
 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()]
Beispiel #4
0
 def build_rbw():
     d = self.decimation_factor
     for i, p in enumerate(points_values):
         r = DEVICE_FULL_SPAN / d / p
         rbw.setItemText(i, "RBW: %s" % frequency_text(r))
         if self.decimation_points and self.decimation_points == d * p:
             rbw.setCurrentIndex(i)
     self.points = points_values[rbw.currentIndex()]