diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml index fb8b178..084c2e8 100644 --- a/AppImageBuilder.yml +++ b/AppImageBuilder.yml @@ -12,7 +12,7 @@ script: # Copy the python application code into the AppDir - cp bin/evaluate.py $TARGET_APPDIR/usr/bin/ - cp -r src/* $TARGET_APPDIR/usr/src/ - - cp src/pkm.vogel.nmreval.desktop $TARGET_APPDIR/usr/share/applications + - cp src/resources/pkm.vogel.nmreval.desktop $TARGET_APPDIR/usr/share/applications # set current date as version info - sed -i "s/CURRENT_DATE/$(date +'%Y-%m-%d')/" $TARGET_APPDIR/usr/src/nmreval/version.py diff --git a/src/gui_qt/_py/tnmh_dialog.py b/src/gui_qt/_py/tnmh_dialog.py index a9924e4..6037040 100644 --- a/src/gui_qt/_py/tnmh_dialog.py +++ b/src/gui_qt/_py/tnmh_dialog.py @@ -11,59 +11,44 @@ from PyQt5 import QtCore, QtGui, QtWidgets -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(1094, 829) - self.gridLayout = QtWidgets.QGridLayout(Dialog) +class Ui_Wizard(object): + def setupUi(self, Wizard): + Wizard.setObjectName("Wizard") + Wizard.resize(854, 619) + self.wizardPage1 = QtWidgets.QWizardPage() + self.wizardPage1.setObjectName("wizardPage1") + self.gridLayout = QtWidgets.QGridLayout(self.wizardPage1) self.gridLayout.setObjectName("gridLayout") - self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) - self.buttonBox.setObjectName("buttonBox") - self.gridLayout.addWidget(self.buttonBox, 5, 1, 1, 1) - self.verticalLayout = QtWidgets.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") - self.listWidget = QtWidgets.QListWidget(Dialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth()) - self.listWidget.setSizePolicy(sizePolicy) - self.listWidget.setObjectName("listWidget") - self.verticalLayout.addWidget(self.listWidget) - self.label = QtWidgets.QLabel(Dialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) - self.label.setSizePolicy(sizePolicy) - self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label.setObjectName("label") - self.verticalLayout.addWidget(self.label) - self.tg_value_label = QtWidgets.QLabel(Dialog) - self.tg_value_label.setText("") - self.tg_value_label.setObjectName("tg_value_label") - self.verticalLayout.addWidget(self.tg_value_label) - self.label_4 = QtWidgets.QLabel(Dialog) - self.label_4.setObjectName("label_4") - self.verticalLayout.addWidget(self.label_4) - self.label_5 = QtWidgets.QLabel(Dialog) - self.label_5.setText("") - self.label_5.setObjectName("label_5") - self.verticalLayout.addWidget(self.label_5) - self.gridLayout.addLayout(self.verticalLayout, 0, 0, 5, 1) - self.dsc_plot = PlotWidget(Dialog) + self.treeWidget = QtWidgets.QTreeWidget(self.wizardPage1) + self.treeWidget.setObjectName("treeWidget") + self.treeWidget.headerItem().setText(0, "1") + self.treeWidget.header().setVisible(False) + self.gridLayout.addWidget(self.treeWidget, 2, 0, 1, 1) + self.gridLayout_9 = QtWidgets.QGridLayout() + self.gridLayout_9.setObjectName("gridLayout_9") + self.tg_export_check = QtWidgets.QCheckBox(self.wizardPage1) + self.tg_export_check.setChecked(True) + self.tg_export_check.setObjectName("tg_export_check") + self.gridLayout_9.addWidget(self.tg_export_check, 0, 0, 1, 1) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.gridLayout_9.addItem(spacerItem, 3, 0, 1, 1) + self.tglines_export_check = QtWidgets.QCheckBox(self.wizardPage1) + self.tglines_export_check.setChecked(True) + self.tglines_export_check.setObjectName("tglines_export_check") + self.gridLayout_9.addWidget(self.tglines_export_check, 0, 1, 1, 1) + self.pushButton = QtWidgets.QPushButton(self.wizardPage1) + self.pushButton.setObjectName("pushButton") + self.gridLayout_9.addWidget(self.pushButton, 2, 0, 1, 2) + self.gridLayout.addLayout(self.gridLayout_9, 2, 1, 1, 1) + self.dsc_plot = PlotWidget(self.wizardPage1) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.dsc_plot.sizePolicy().hasHeightForWidth()) self.dsc_plot.setSizePolicy(sizePolicy) self.dsc_plot.setObjectName("dsc_plot") - self.gridLayout.addWidget(self.dsc_plot, 0, 1, 1, 1) - self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.calctg_button = QtWidgets.QToolButton(Dialog) + self.gridLayout.addWidget(self.dsc_plot, 1, 0, 1, 2) + self.calctg_button = QtWidgets.QToolButton(self.wizardPage1) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -72,171 +57,156 @@ class Ui_Dialog(object): self.calctg_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.calctg_button.setArrowType(QtCore.Qt.RightArrow) self.calctg_button.setObjectName("calctg_button") - self.verticalLayout_2.addWidget(self.calctg_button) - self.toolButton_2 = QtWidgets.QToolButton(Dialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred) + self.gridLayout.addWidget(self.calctg_button, 0, 0, 1, 2) + Wizard.addPage(self.wizardPage1) + self.wizardPage2 = QtWidgets.QWizardPage() + self.wizardPage2.setObjectName("wizardPage2") + self.gridLayout_2 = QtWidgets.QGridLayout(self.wizardPage2) + self.gridLayout_2.setObjectName("gridLayout_2") + self.toolButton = QtWidgets.QToolButton(self.wizardPage2) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.toolButton_2.sizePolicy().hasHeightForWidth()) - self.toolButton_2.setSizePolicy(sizePolicy) - self.toolButton_2.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) - self.toolButton_2.setAutoRaise(False) - self.toolButton_2.setArrowType(QtCore.Qt.RightArrow) - self.toolButton_2.setObjectName("toolButton_2") - self.verticalLayout_2.addWidget(self.toolButton_2) - self.gridLayout.addLayout(self.verticalLayout_2, 0, 2, 1, 1) - self.tabWidget = QtWidgets.QTabWidget(Dialog) - self.tabWidget.setTabPosition(QtWidgets.QTabWidget.East) - self.tabWidget.setObjectName("tabWidget") - self.tabWidgetPage1 = QtWidgets.QWidget() - self.tabWidgetPage1.setObjectName("tabWidgetPage1") - self.gridLayout_3 = QtWidgets.QGridLayout(self.tabWidgetPage1) - self.gridLayout_3.setObjectName("gridLayout_3") - self.tglines_export_check = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.tglines_export_check.setChecked(True) - self.tglines_export_check.setObjectName("tglines_export_check") - self.gridLayout_3.addWidget(self.tglines_export_check, 2, 3, 1, 1) - self.checkBox_6 = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.checkBox_6.setChecked(True) - self.checkBox_6.setObjectName("checkBox_6") - self.gridLayout_3.addWidget(self.checkBox_6, 6, 3, 1, 1) - self.new_graph_tau_combo = QtWidgets.QComboBox(self.tabWidgetPage1) - self.new_graph_tau_combo.setObjectName("new_graph_tau_combo") - self.gridLayout_3.addWidget(self.new_graph_tau_combo, 8, 3, 1, 1) - self.line = QtWidgets.QFrame(self.tabWidgetPage1) - self.line.setFrameShape(QtWidgets.QFrame.HLine) - self.line.setFrameShadow(QtWidgets.QFrame.Sunken) - self.line.setObjectName("line") - self.gridLayout_3.addWidget(self.line, 3, 2, 1, 2) - self.checkBox = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.checkBox.setChecked(True) - self.checkBox.setObjectName("checkBox") - self.gridLayout_3.addWidget(self.checkBox, 5, 2, 1, 1) - self.tg_export_check = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.tg_export_check.setChecked(True) - self.tg_export_check.setObjectName("tg_export_check") - self.gridLayout_3.addWidget(self.tg_export_check, 2, 2, 1, 1) - self.new_graph_tau_check = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.new_graph_tau_check.setChecked(True) - self.new_graph_tau_check.setObjectName("new_graph_tau_check") - self.gridLayout_3.addWidget(self.new_graph_tau_check, 8, 2, 1, 1) - self.checkBox_5 = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.checkBox_5.setChecked(True) - self.checkBox_5.setObjectName("checkBox_5") - self.gridLayout_3.addWidget(self.checkBox_5, 6, 2, 1, 1) - spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.gridLayout_3.addItem(spacerItem, 10, 3, 1, 1) - self.label_6 = QtWidgets.QLabel(self.tabWidgetPage1) - self.label_6.setObjectName("label_6") - self.gridLayout_3.addWidget(self.label_6, 4, 2, 1, 2) - self.checkBox_4 = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.checkBox_4.setChecked(True) - self.checkBox_4.setObjectName("checkBox_4") - self.gridLayout_3.addWidget(self.checkBox_4, 5, 3, 1, 1) - self.checkBox_7 = QtWidgets.QCheckBox(self.tabWidgetPage1) - self.checkBox_7.setChecked(True) - self.checkBox_7.setObjectName("checkBox_7") - self.gridLayout_3.addWidget(self.checkBox_7, 7, 2, 1, 1) - self.pushButton_4 = QtWidgets.QPushButton(self.tabWidgetPage1) - self.pushButton_4.setObjectName("pushButton_4") - self.gridLayout_3.addWidget(self.pushButton_4, 9, 2, 1, 2) - self.tghodge_graph = PlotWidget(self.tabWidgetPage1) + sizePolicy.setHeightForWidth(self.toolButton.sizePolicy().hasHeightForWidth()) + self.toolButton.setSizePolicy(sizePolicy) + self.toolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) + self.toolButton.setArrowType(QtCore.Qt.RightArrow) + self.toolButton.setObjectName("toolButton") + self.gridLayout_2.addWidget(self.toolButton, 0, 0, 1, 2) + self.tghodge_graph = PlotWidget(self.wizardPage2) self.tghodge_graph.setObjectName("tghodge_graph") - self.gridLayout_3.addWidget(self.tghodge_graph, 2, 1, 9, 1) - self.tau_plot = PlotWidget(self.tabWidgetPage1) + self.gridLayout_2.addWidget(self.tghodge_graph, 2, 0, 1, 1) + self.tau_plot = PlotWidget(self.wizardPage2) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tau_plot.sizePolicy().hasHeightForWidth()) self.tau_plot.setSizePolicy(sizePolicy) self.tau_plot.setObjectName("tau_plot") - self.gridLayout_3.addWidget(self.tau_plot, 2, 0, 9, 1) - self.tabWidget.addTab(self.tabWidgetPage1, "") - self.tabWidgetPage2 = QtWidgets.QWidget() - self.tabWidgetPage2.setObjectName("tabWidgetPage2") - self.gridLayout_2 = QtWidgets.QGridLayout(self.tabWidgetPage2) - self.gridLayout_2.setObjectName("gridLayout_2") - self.fit_tnhm_fitbutton = QtWidgets.QPushButton(self.tabWidgetPage2) - self.fit_tnhm_fitbutton.setObjectName("fit_tnhm_fitbutton") - self.gridLayout_2.addWidget(self.fit_tnhm_fitbutton, 1, 1, 1, 2) - self.graphicsView_2 = PlotWidget(self.tabWidgetPage2) - self.graphicsView_2.setObjectName("graphicsView_2") - self.gridLayout_2.addWidget(self.graphicsView_2, 0, 0, 9, 1) - self.new_graph_tnmh_check = QtWidgets.QCheckBox(self.tabWidgetPage2) - self.new_graph_tnmh_check.setChecked(True) - self.new_graph_tnmh_check.setObjectName("new_graph_tnmh_check") - self.gridLayout_2.addWidget(self.new_graph_tnmh_check, 5, 1, 1, 1) - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.label_2 = QtWidgets.QLabel(self.tabWidgetPage2) - self.label_2.setObjectName("label_2") - self.horizontalLayout.addWidget(self.label_2) - self.tnmh_tg_combo = QtWidgets.QComboBox(self.tabWidgetPage2) - self.tnmh_tg_combo.setObjectName("tnmh_tg_combo") - self.tnmh_tg_combo.addItem("") - self.tnmh_tg_combo.addItem("") - self.tnmh_tg_combo.addItem("") - self.tnmh_tg_combo.addItem("") - self.tnmh_tg_combo.addItem("") - self.horizontalLayout.addWidget(self.tnmh_tg_combo) - self.gridLayout_2.addLayout(self.horizontalLayout, 0, 1, 1, 2) - self.new_graph_tnmh_combo = QtWidgets.QComboBox(self.tabWidgetPage2) - self.new_graph_tnmh_combo.setObjectName("new_graph_tnmh_combo") - self.gridLayout_2.addWidget(self.new_graph_tnmh_combo, 5, 2, 1, 1) - self.line_2 = QtWidgets.QFrame(self.tabWidgetPage2) - self.line_2.setMinimumSize(QtCore.QSize(0, 0)) - self.line_2.setFrameShape(QtWidgets.QFrame.HLine) - self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken) - self.line_2.setObjectName("line_2") - self.gridLayout_2.addWidget(self.line_2, 2, 1, 1, 2) - self.checkBox_2 = QtWidgets.QCheckBox(self.tabWidgetPage2) - self.checkBox_2.setObjectName("checkBox_2") - self.gridLayout_2.addWidget(self.checkBox_2, 3, 1, 1, 2) - self.checkBox_3 = QtWidgets.QCheckBox(self.tabWidgetPage2) - self.checkBox_3.setObjectName("checkBox_3") - self.gridLayout_2.addWidget(self.checkBox_3, 4, 1, 1, 2) + self.gridLayout_2.addWidget(self.tau_plot, 2, 1, 1, 1) + self.gridLayout_4 = QtWidgets.QGridLayout() + self.gridLayout_4.setObjectName("gridLayout_4") + self.checkBox_6 = QtWidgets.QCheckBox(self.wizardPage2) + self.checkBox_6.setChecked(True) + self.checkBox_6.setObjectName("checkBox_6") + self.gridLayout_4.addWidget(self.checkBox_6, 2, 0, 1, 1) + self.pushButton_4 = QtWidgets.QPushButton(self.wizardPage2) + self.pushButton_4.setObjectName("pushButton_4") + self.gridLayout_4.addWidget(self.pushButton_4, 2, 2, 1, 1) + self.new_graph_tau_check = QtWidgets.QCheckBox(self.wizardPage2) + self.new_graph_tau_check.setChecked(True) + self.new_graph_tau_check.setObjectName("new_graph_tau_check") + self.gridLayout_4.addWidget(self.new_graph_tau_check, 0, 1, 1, 1) + self.checkBox_7 = QtWidgets.QCheckBox(self.wizardPage2) + self.checkBox_7.setChecked(True) + self.checkBox_7.setObjectName("checkBox_7") + self.gridLayout_4.addWidget(self.checkBox_7, 4, 0, 1, 1) + self.checkBox_5 = QtWidgets.QCheckBox(self.wizardPage2) + self.checkBox_5.setChecked(True) + self.checkBox_5.setObjectName("checkBox_5") + self.gridLayout_4.addWidget(self.checkBox_5, 3, 0, 1, 1) + self.new_graph_tau_combo = QtWidgets.QComboBox(self.wizardPage2) + self.new_graph_tau_combo.setObjectName("new_graph_tau_combo") + self.gridLayout_4.addWidget(self.new_graph_tau_combo, 0, 2, 1, 1) + self.checkBox_4 = QtWidgets.QCheckBox(self.wizardPage2) + self.checkBox_4.setChecked(True) + self.checkBox_4.setObjectName("checkBox_4") + self.gridLayout_4.addWidget(self.checkBox_4, 1, 0, 1, 1) + self.checkBox = QtWidgets.QCheckBox(self.wizardPage2) + self.checkBox.setChecked(True) + self.checkBox.setObjectName("checkBox") + self.gridLayout_4.addWidget(self.checkBox, 0, 0, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout_4, 3, 0, 1, 2) + Wizard.addPage(self.wizardPage2) + self.wizardPage = QtWidgets.QWizardPage() + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.wizardPage.sizePolicy().hasHeightForWidth()) + self.wizardPage.setSizePolicy(sizePolicy) + self.wizardPage.setSubTitle("") + self.wizardPage.setObjectName("wizardPage") + self.gridLayout_6 = QtWidgets.QGridLayout(self.wizardPage) + self.gridLayout_6.setObjectName("gridLayout_6") + self.fit_tnhm_fitbutton_2 = QtWidgets.QPushButton(self.wizardPage) + self.fit_tnhm_fitbutton_2.setObjectName("fit_tnhm_fitbutton_2") + self.gridLayout_6.addWidget(self.fit_tnhm_fitbutton_2, 0, 0, 1, 2) + self.graphicsView_3 = PlotWidget(self.wizardPage) + self.graphicsView_3.setObjectName("graphicsView_3") + self.gridLayout_6.addWidget(self.graphicsView_3, 1, 0, 1, 1) + self.gridLayout_3 = QtWidgets.QGridLayout() + self.gridLayout_3.setObjectName("gridLayout_3") + self.tnmh_tg_combo_2 = QtWidgets.QComboBox(self.wizardPage) + self.tnmh_tg_combo_2.setObjectName("tnmh_tg_combo_2") + self.tnmh_tg_combo_2.addItem("") + self.tnmh_tg_combo_2.addItem("") + self.tnmh_tg_combo_2.addItem("") + self.tnmh_tg_combo_2.addItem("") + self.tnmh_tg_combo_2.addItem("") + self.gridLayout_3.addWidget(self.tnmh_tg_combo_2, 0, 1, 1, 1) + self.label_3 = QtWidgets.QLabel(self.wizardPage) + self.label_3.setObjectName("label_3") + self.gridLayout_3.addWidget(self.label_3, 0, 0, 1, 1) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem1, 8, 1, 1, 1) - self.pushButton = QtWidgets.QPushButton(self.tabWidgetPage2) - self.pushButton.setObjectName("pushButton") - self.gridLayout_2.addWidget(self.pushButton, 7, 1, 1, 2) - self.tabWidget.addTab(self.tabWidgetPage2, "") - self.gridLayout.addWidget(self.tabWidget, 4, 1, 1, 2) + self.gridLayout_3.addItem(spacerItem1, 1, 0, 1, 1) + self.gridLayout_6.addLayout(self.gridLayout_3, 1, 1, 1, 1) + self.treeWidget_2 = QtWidgets.QTreeWidget(self.wizardPage) + self.treeWidget_2.setObjectName("treeWidget_2") + self.treeWidget_2.headerItem().setText(0, "1") + self.gridLayout_6.addWidget(self.treeWidget_2, 2, 0, 1, 1) + self.gridLayout_5 = QtWidgets.QGridLayout() + self.gridLayout_5.setObjectName("gridLayout_5") + self.new_graph_tnmh_check_2 = QtWidgets.QCheckBox(self.wizardPage) + self.new_graph_tnmh_check_2.setChecked(True) + self.new_graph_tnmh_check_2.setObjectName("new_graph_tnmh_check_2") + self.gridLayout_5.addWidget(self.new_graph_tnmh_check_2, 1, 0, 1, 1) + self.checkBox_14 = QtWidgets.QCheckBox(self.wizardPage) + self.checkBox_14.setObjectName("checkBox_14") + self.gridLayout_5.addWidget(self.checkBox_14, 0, 0, 1, 1) + self.pushButton_2 = QtWidgets.QPushButton(self.wizardPage) + self.pushButton_2.setObjectName("pushButton_2") + self.gridLayout_5.addWidget(self.pushButton_2, 2, 0, 1, 2) + self.checkBox_13 = QtWidgets.QCheckBox(self.wizardPage) + self.checkBox_13.setObjectName("checkBox_13") + self.gridLayout_5.addWidget(self.checkBox_13, 0, 1, 1, 1) + self.new_graph_tnmh_combo_2 = QtWidgets.QComboBox(self.wizardPage) + self.new_graph_tnmh_combo_2.setObjectName("new_graph_tnmh_combo_2") + self.gridLayout_5.addWidget(self.new_graph_tnmh_combo_2, 1, 1, 1, 1) + spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.gridLayout_5.addItem(spacerItem2, 3, 0, 1, 1) + self.gridLayout_6.addLayout(self.gridLayout_5, 2, 1, 1, 1) + Wizard.addPage(self.wizardPage) - self.retranslateUi(Dialog) - self.tabWidget.setCurrentIndex(0) - self.buttonBox.accepted.connect(Dialog.accept) # type: ignore - self.buttonBox.rejected.connect(Dialog.reject) # type: ignore - QtCore.QMetaObject.connectSlotsByName(Dialog) + self.retranslateUi(Wizard) + QtCore.QMetaObject.connectSlotsByName(Wizard) - def retranslateUi(self, Dialog): + def retranslateUi(self, Wizard): _translate = QtCore.QCoreApplication.translate - Dialog.setWindowTitle(_translate("Dialog", "SImba, everything the light touches is our kingdom")) - self.label.setText(_translate("Dialog", "
Tg values:
")) - self.label_4.setText(_translate("Dialog", "TNMH parameter:
")) - self.calctg_button.setText(_translate("Dialog", "Calculate Tg")) - self.toolButton_2.setText(_translate("Dialog", "Calculate fictive Cp")) - self.tglines_export_check.setText(_translate("Dialog", "Export lines")) - self.checkBox_6.setText(_translate("Dialog", "End")) - self.checkBox.setText(_translate("Dialog", "Onset")) - self.tg_export_check.setText(_translate("Dialog", "Export Tg")) - self.new_graph_tau_check.setText(_translate("Dialog", "New graph")) - self.checkBox_5.setText(_translate("Dialog", "Inflection")) - self.label_6.setText(_translate("Dialog", "Export Hodge:")) - self.checkBox_4.setText(_translate("Dialog", "Midpoint")) - self.checkBox_7.setText(_translate("Dialog", "Fictive")) - self.pushButton_4.setText(_translate("Dialog", "Export")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage1), _translate("Dialog", "Tg / Hodge")) - self.fit_tnhm_fitbutton.setText(_translate("Dialog", "Fit TNMH model")) - self.new_graph_tnmh_check.setText(_translate("Dialog", "New graph")) - self.label_2.setText(_translate("Dialog", "Tg for TNMH")) - self.tnmh_tg_combo.setItemText(0, _translate("Dialog", "Fictive")) - self.tnmh_tg_combo.setItemText(1, _translate("Dialog", "Onset")) - self.tnmh_tg_combo.setItemText(2, _translate("Dialog", "Midpoint")) - self.tnmh_tg_combo.setItemText(3, _translate("Dialog", "End")) - self.tnmh_tg_combo.setItemText(4, _translate("Dialog", "Inflection")) - self.checkBox_2.setText(_translate("Dialog", "Export dTf / dT")) - self.checkBox_3.setText(_translate("Dialog", "Export fit")) - self.pushButton.setText(_translate("Dialog", "Export")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage2), _translate("Dialog", "TNMH")) + Wizard.setWindowTitle(_translate("Wizard", "Wizard")) + self.wizardPage1.setTitle(_translate("Wizard", "Glass transition")) + self.tg_export_check.setText(_translate("Wizard", "Export Tg")) + self.tglines_export_check.setText(_translate("Wizard", "Export lines")) + self.pushButton.setText(_translate("Wizard", "Export")) + self.calctg_button.setText(_translate("Wizard", "Calculate Tg")) + self.wizardPage2.setTitle(_translate("Wizard", "Hodge")) + self.toolButton.setText(_translate("Wizard", "Calculate Hodge")) + self.checkBox_6.setText(_translate("Wizard", "End")) + self.pushButton_4.setText(_translate("Wizard", "Export")) + self.new_graph_tau_check.setText(_translate("Wizard", "New graph")) + self.checkBox_7.setText(_translate("Wizard", "Fictive")) + self.checkBox_5.setText(_translate("Wizard", "Inflection")) + self.checkBox_4.setText(_translate("Wizard", "Midpoint")) + self.checkBox.setText(_translate("Wizard", "Onset")) + self.wizardPage.setTitle(_translate("Wizard", "TNMH")) + self.fit_tnhm_fitbutton_2.setText(_translate("Wizard", "Fit TNMH model")) + self.tnmh_tg_combo_2.setItemText(0, _translate("Wizard", "Fictive")) + self.tnmh_tg_combo_2.setItemText(1, _translate("Wizard", "Onset")) + self.tnmh_tg_combo_2.setItemText(2, _translate("Wizard", "Midpoint")) + self.tnmh_tg_combo_2.setItemText(3, _translate("Wizard", "End")) + self.tnmh_tg_combo_2.setItemText(4, _translate("Wizard", "Inflection")) + self.label_3.setText(_translate("Wizard", "Tg for TNMH")) + self.new_graph_tnmh_check_2.setText(_translate("Wizard", "New graph")) + self.checkBox_14.setText(_translate("Wizard", "Export fit")) + self.pushButton_2.setText(_translate("Wizard", "Export")) + self.checkBox_13.setText(_translate("Wizard", "Export dTf / dT")) from pyqtgraph import PlotWidget diff --git a/src/gui_qt/dsc/glass_dialog.py b/src/gui_qt/dsc/glass_dialog.py index ede88f7..11e388d 100644 --- a/src/gui_qt/dsc/glass_dialog.py +++ b/src/gui_qt/dsc/glass_dialog.py @@ -6,20 +6,26 @@ from pyqtgraph import mkPen, mkBrush, LegendItem from nmreval.dsc.hodge import tau_hodge from nmreval.lib.colors import Tab10 -from ..Qt import QtWidgets, QtCore -from .._py.tnmh_dialog import Ui_Dialog +from ..Qt import QtWidgets, QtCore, QtGui +from .._py.tnmh_dialog import Ui_Wizard +from ..lib.listwidget import QListWidgetSelect from ..lib.pg_objects import PlotItem, RegionItem from nmreval.data import DSC, Points -class TgCalculator(QtWidgets.QDialog, Ui_Dialog): - newTg = QtCore.pyqtSignal(dict, list, str) +class TgCalculator(QtWidgets.QWizard, Ui_Wizard): + newTg = QtCore.pyqtSignal(dict) def __init__(self, management, parent=None): super().__init__(parent=parent) self.setupUi(self) + self.listWidget = QListWidgetSelect(parent=self) + self.listWidget.setObjectName('listWidget') + self.setSideWidget(self.listWidget) + self.listWidget.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)) + self._management = management self._colors = cycle(Tab10) @@ -56,8 +62,13 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): PlotItem(x=[], y=[], pen=None, symbol='d', symbolBrush=Tab10.TabRed.rgb())), None, ), - # 'fictive': PlotItem(x=[], y=[], pen=None, symbol='t1', symbolBrush=Tab10.TabPurple.rgb(), name='Fictive'), - # 'TNMH': PlotItem(x=[], y=[], pen=None, symbol='star', symbolBrush=Tab10.TabPurple.rgb(), name='TNMH'), + 'fictive': ( + PlotItem(x=[], y=[], pen=None, symbol='t1', symbolBrush=Tab10.TabPurple.rgb(), name='Fictive'), + None, + (PlotItem(x=[], y=[], pen=mkPen({'color': Tab10.TabPurple.rgb()})), + PlotItem(x=[], y=[], pen=None, symbol='t1', symbolBrush=Tab10.TabPurple.rgb())), + None, + ), } self._lines = {} self.tau_plot.getPlotItem().addLegend() @@ -75,8 +86,6 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): self.add_sets() - self.listWidget.itemClicked.connect(self.show_tg_values) - self.new_graph_tau_combo.setEnabled(False) self.new_graph_tau_check.stateChanged.connect(lambda state: self.new_graph_tau_combo.setEnabled(not bool(state))) @@ -92,7 +101,6 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): for plots in self._plots.values(): for val in plots: self.dsc_plot.removeItem(val) - self.graphicsView_2.removeItem(val) for key, plt in self._hodge.items(): plt[0].setData(x=[], y=[]) @@ -148,16 +156,16 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): self.dsc_plot.addItem(tg_plot) fictive_cp = PlotItem(pen=mkPen(c.rgb())) - self.graphicsView_2.addItem(fictive_cp) +# self.graphicsView_2.addItem(fictive_cp) tnmh_fit = PlotItem() tnmh_fit.set_line(style=2, color=c) - self.graphicsView_2.addItem(tnmh_fit) + # self.graphicsView_2.addItem(tnmh_fit) self._plots[key] = (data_plot, tg_plot, glass, liquid, tangent, fictive_cp, tnmh_fit) self._tg_value[key] = { 'onset': (nan, nan), - 'mid': (nan, nan), + 'midpoint': (nan, nan), 'end': (nan, nan), 'inflection': (nan, nan), # 'fictive': (nan, nan), @@ -194,28 +202,46 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): self._update_tg_plots() - def show_tg_values(self, item): - values = self._tg_value.get(item.data(QtCore.Qt.UserRole)) - - if values is not None: - label = '\n'.join((f'{name.capitalize()}: {pos[0]:.2f} K' for name, pos in values.items())) - self.tg_value_label.setText(label) - - fit = self._fit.get(item.data(QtCore.Qt.UserRole)) - if fit is not None: - self.label_5.setText(fit._parameter_string()) - def _update_tg_plots(self): + self.treeWidget.clear() for idx in range(self.listWidget.count()): item = self.listWidget.item(idx) + tree_item = QtWidgets.QTreeWidgetItem([item.text()]) + values = self._tg_value.get(item.data(QtCore.Qt.UserRole)) + + if values is not None: + for name, pos in values.items(): + child_item = QtWidgets.QTreeWidgetItem([f'{name.capitalize()}: {pos[0]:.2f} K']) + tree_item.addChild(child_item) + + self.treeWidget.addTopLevelItem(tree_item) + key = item.data(QtCore.Qt.UserRole) plot = self._plots[key] data, _ = self._dsc[key] plot[1].setData(array(list(self._tg_value[key].values()))) - self.hodge() + @QtCore.pyqtSlot(name='on_pushButton_clicked') + def export_tg(self): + ret_dic = {} + for key, tg in self._tg_value.items(): + tgx = [x for x, y in tg.values()] + tgy = [y for x, y in tg.values()] + if self.tg_export_check.isChecked(): + tg_pts = Points(x=tgx, y=tgy, name=self._management[key].name + ' (Tg)', value=self._management[key].value) + else: + tg_pts = None + + if self.tglines_export_check.isChecked(): + line = self._lines[key] + else: + line = [] + + ret_dic[key] = (tg_pts, line) + + self.newTg.emit(ret_dic) @QtCore.pyqtSlot(QtWidgets.QListWidgetItem, name='on_listWidget_itemChanged') def change_visibility(self, item: QtWidgets.QListWidgetItem): @@ -270,6 +296,7 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): self._fit[key] = res plot[-1].setData(res.x, res.y) + @QtCore.pyqtSlot(name='on_toolButton_clicked') def hodge(self): for tg_type, (plot, data, fitplots, fit) in self._hodge.items(): @@ -292,8 +319,8 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): data, fit = tau_hodge(*array(m).T) data.name = f'{data.name} ({tg_type.capitalize()})' plot.setData(data.x, data.y) - fitplots[0].setData(1000/fit.x, fit.y) - fitplots[1].setData(1000/fit.x_data, fit.y_data) + fitplots[0].setData(fit.x, fit.y) + fitplots[1].setData(fit.x_data, fit.y_data) self._hodge[tg_type] = (plot, data, fitplots, fit) diff --git a/src/gui_qt/main/management.py b/src/gui_qt/main/management.py index d62aca8..e181d60 100644 --- a/src/gui_qt/main/management.py +++ b/src/gui_qt/main/management.py @@ -773,8 +773,8 @@ class UpperManagement(QtCore.QObject): self.newData.emit(new_data, self.current_graph) - @QtCore.pyqtSlot(dict, list, str) - def addTg(self, dic1: dict, dic2: list, graph_id: str): + @QtCore.pyqtSlot(dict) + def addTg(self, dic1: dict): for k, (tg, lines) in dic1.items(): p: ExperimentContainer = self[k] col = p.plot_real.linecolor @@ -792,11 +792,6 @@ class UpperManagement(QtCore.QObject): self.newData.emit(tg_data_id, self.current_graph) - set_id_list = [] - for v in dic2: - set_id_list.append(self.add(v)) - self.newData.emit(set_id_list, graph_id) - @QtCore.pyqtSlot(int, dict) def smooth_data(self, npoints, param_kwargs): _active = self.graphs[self.current_graph].active diff --git a/src/nmreval/dsc/hodge.py b/src/nmreval/dsc/hodge.py index 2d5b716..288f68a 100644 --- a/src/nmreval/dsc/hodge.py +++ b/src/nmreval/dsc/hodge.py @@ -10,18 +10,18 @@ from nmreval.utils import kB def tau_hodge(tg: ArrayLike, rate: ArrayLike) -> (Points, FitResult): - rate = np.asanyarray(rate) / 60 + rate = np.asanyarray(rate) tg = np.asanyarray(tg) fitter = FitRoutine() fitter.set_model(Arrhenius) - d = fitter.add_data(tg, rate) + d = fitter.add_data(1000/tg, rate, we='y') - init = linregress(1/tg, np.log(rate)) + init = linregress(1000/tg, np.log(rate)) - d.set_parameter([np.exp(init.intercept), init.slope*kB], fun_kwargs={'invt': None}) + d.set_parameter([np.exp(init.intercept), 1000*init.slope*kB], fun_kwargs={'invt': 'invt1000'}) res = fitter.run()[0] de = res.parameter['E_{A}'] - tau = kB*tg**2/np.abs(de.value)/rate + tau = kB*tg**2/np.abs(de.value)/rate*60 return Points(x=1000/tg, y=tau, y_err=tau*de.error/np.abs(de.value), name='Hodge'), res diff --git a/src/resources/_ui/tnmh_dialog.ui b/src/resources/_ui/tnmh_dialog.ui index 00a3a78..03e8830 100644 --- a/src/resources/_ui/tnmh_dialog.ui +++ b/src/resources/_ui/tnmh_dialog.ui @@ -1,400 +1,362 @@