From ccb44fc038af848c31be5a1a76c2e0405a236d92 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 4 Nov 2022 15:53:40 +0100 Subject: [PATCH] BUGFIX: integration limits are not possible --- src/gui_qt/math/integrate_derive.py | 5 +++++ src/nmreval/data/points.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui_qt/math/integrate_derive.py b/src/gui_qt/math/integrate_derive.py index 0980b26..632ed5c 100644 --- a/src/gui_qt/math/integrate_derive.py +++ b/src/gui_qt/math/integrate_derive.py @@ -48,6 +48,11 @@ class QDeriveIntegrate(QtWidgets.QDialog, Ui_Dialog): def enable_graph(self, state: int): self.graph_combobox.setEnabled(state != QtCore.Qt.Checked) + @QtCore.pyqtSlot(int, name='on_range_checkbox_stateChanged') + def enable_limits(self, full_range: int): + self.start_lineedit.setEnabled(full_range != QtCore.Qt.Checked) + self.stop_lineedit.setEnabled(full_range != QtCore.Qt.Checked) + def get_options(self): opts = {'graph': '' if self.newgraph_checkbox.isChecked() else self.graph_combobox.currentData(), 'mode': self.mode, 'sets': []} diff --git a/src/nmreval/data/points.py b/src/nmreval/data/points.py index 926b9c4..89146e2 100644 --- a/src/nmreval/data/points.py +++ b/src/nmreval/data/points.py @@ -393,7 +393,7 @@ class Points: def integrate(self, log: bool = False, limits: tuple[float, float] = None) -> PointLike: new_data = self.copy() - if limits is not None: + if limits != (None, None): new_data.cut(*limits) if log: