From 036d7988135fd16a2bb02f9c801ded8b29c69a0c Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 15 Dec 2023 18:27:32 +0000 Subject: [PATCH] issue-168 (#183) fix FC reading problems; fixes #168 Co-authored-by: Dominik Demuth Reviewed-on: https://gitea.pkm.physik.tu-darmstadt.de/IPKM/nmreval/pulls/183 --- src/gui_qt/io/fcbatchreader.py | 4 +++- src/gui_qt/main/mainwindow.py | 2 ++ src/nmreval/io/fcbatchreader.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui_qt/io/fcbatchreader.py b/src/gui_qt/io/fcbatchreader.py index c2a498e..124e2a6 100644 --- a/src/gui_qt/io/fcbatchreader.py +++ b/src/gui_qt/io/fcbatchreader.py @@ -22,6 +22,8 @@ class QFCReader(QtWidgets.QDialog, Ui_FCEval_dialog): self.start_lineedit.setValidator(QtGui.QDoubleValidator()) self.stop_lineedit.setValidator(QtGui.QDoubleValidator()) + self.graph_checkbox.stateChanged.connect(lambda x: self.graph_comboBox.setEnabled(not bool(x))) + self.listWidget.installEventFilter(self) def eventFilter(self, src: QtCore.QObject, evt: QtCore.QEvent) -> bool: @@ -107,7 +109,7 @@ class QFCReader(QtWidgets.QDialog, Ui_FCEval_dialog): ret_vals.extend(fc_eval.get_parameter(path=self.label.text(), kind='temp', parameter=save_variables)) grp = '' - if self.graph_checkbox.isChecked(): + if not self.graph_checkbox.isChecked(): grp = self.graph_comboBox.currentData(QtCore.Qt.UserRole) self.data_read.emit(ret_vals, grp) diff --git a/src/gui_qt/main/mainwindow.py b/src/gui_qt/main/mainwindow.py index 8e439a2..0ec24a3 100644 --- a/src/gui_qt/main/mainwindow.py +++ b/src/gui_qt/main/mainwindow.py @@ -276,6 +276,8 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow): reader.data_read.connect(self.management.add_new_data) reader.exec() + self.path = reader.path + del reader @QtCore.pyqtSlot(name='on_actionPrint_triggered') diff --git a/src/nmreval/io/fcbatchreader.py b/src/nmreval/io/fcbatchreader.py index ea319b4..c08e08c 100644 --- a/src/nmreval/io/fcbatchreader.py +++ b/src/nmreval/io/fcbatchreader.py @@ -48,7 +48,7 @@ class FCReader: found_temperature = filename.stem if filename.is_file(): - if region is None: + if (region is None) or (region == (None, None)): _temp = self._read_from_hdf(filename) else: _temp = self._read_signals(filename, region)