def test_change_custom_bw(self): bw = 0.3 N = Filter.get_filter_length_from_bandwidth(bw) self.dialog.ui.doubleSpinBoxCustomBandwidth.setValue(bw) self.assertEqual(N, self.dialog.ui.spinBoxCustomKernelLength.value()) N = 401 bw = Filter.get_bandwidth_from_filter_length(N) self.dialog.ui.spinBoxCustomKernelLength.setValue(N) self.assertAlmostEqual(bw, self.dialog.ui.doubleSpinBoxCustomBandwidth.value(), places=self.dialog.ui.doubleSpinBoxCustomBandwidth.decimals())
def on_spin_box_custom_kernel_length_value_changed(self, filter_len: int): self.ui.doubleSpinBoxCustomBandwidth.blockSignals(True) self.ui.doubleSpinBoxCustomBandwidth.setValue(Filter.get_bandwidth_from_filter_length(filter_len)) self.ui.doubleSpinBoxCustomBandwidth.blockSignals(False)
def on_spin_box_custom_kernel_length_value_changed(self, filter_len: int): self.ui.doubleSpinBoxCustomBandwidth.blockSignals(True) self.ui.doubleSpinBoxCustomBandwidth.setValue(Filter.get_bandwidth_from_filter_length(filter_len)) self.ui.doubleSpinBoxCustomBandwidth.blockSignals(False)