minor cleanup
This commit is contained in:
parent
92c29bec2a
commit
988d2ccbda
@ -17,6 +17,49 @@ class Ui_Dialog(object):
|
|||||||
Dialog.resize(1042, 683)
|
Dialog.resize(1042, 683)
|
||||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||||
self.gridLayout.setObjectName("gridLayout")
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
|
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||||
|
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||||
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Save)
|
||||||
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
|
self.gridLayout.addWidget(self.buttonBox, 3, 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.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, 3, 1)
|
||||||
|
self.dsc_plot = PlotWidget(Dialog)
|
||||||
|
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.stackedWidget = QtWidgets.QStackedWidget(Dialog)
|
self.stackedWidget = QtWidgets.QStackedWidget(Dialog)
|
||||||
self.stackedWidget.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
self.stackedWidget.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
self.stackedWidget.setFrameShadow(QtWidgets.QFrame.Raised)
|
self.stackedWidget.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||||
@ -25,27 +68,43 @@ class Ui_Dialog(object):
|
|||||||
self.stackedWidgetPage1.setObjectName("stackedWidgetPage1")
|
self.stackedWidgetPage1.setObjectName("stackedWidgetPage1")
|
||||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.stackedWidgetPage1)
|
self.gridLayout_3 = QtWidgets.QGridLayout(self.stackedWidgetPage1)
|
||||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||||
self.checkBox = QtWidgets.QCheckBox(self.stackedWidgetPage1)
|
self.hodge_selection = CheckCombobox(self.stackedWidgetPage1)
|
||||||
self.checkBox.setObjectName("checkBox")
|
self.hodge_selection.setObjectName("hodge_selection")
|
||||||
self.gridLayout_3.addWidget(self.checkBox, 1, 1, 1, 1)
|
self.hodge_selection.addItem("")
|
||||||
self.checkBox_2 = QtWidgets.QCheckBox(self.stackedWidgetPage1)
|
self.hodge_selection.addItem("")
|
||||||
self.checkBox_2.setText("")
|
self.hodge_selection.addItem("")
|
||||||
self.checkBox_2.setObjectName("checkBox_2")
|
self.hodge_selection.addItem("")
|
||||||
self.gridLayout_3.addWidget(self.checkBox_2, 2, 1, 1, 1)
|
self.gridLayout_3.addWidget(self.hodge_selection, 4, 2, 1, 1)
|
||||||
self.pushButton = QtWidgets.QPushButton(self.stackedWidgetPage1)
|
self.tau_plot = PlotWidget(self.stackedWidgetPage1)
|
||||||
self.pushButton.setObjectName("pushButton")
|
|
||||||
self.gridLayout_3.addWidget(self.pushButton, 0, 1, 1, 1)
|
|
||||||
self.comboBox_2 = CheckCombobox(self.stackedWidgetPage1)
|
|
||||||
self.comboBox_2.setObjectName("comboBox_2")
|
|
||||||
self.gridLayout_3.addWidget(self.comboBox_2, 3, 1, 1, 1)
|
|
||||||
self.graphicsView_3 = PlotWidget(self.stackedWidgetPage1)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.graphicsView_3.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.tau_plot.sizePolicy().hasHeightForWidth())
|
||||||
self.graphicsView_3.setSizePolicy(sizePolicy)
|
self.tau_plot.setSizePolicy(sizePolicy)
|
||||||
self.graphicsView_3.setObjectName("graphicsView_3")
|
self.tau_plot.setObjectName("tau_plot")
|
||||||
self.gridLayout_3.addWidget(self.graphicsView_3, 0, 0, 4, 1)
|
self.gridLayout_3.addWidget(self.tau_plot, 0, 0, 7, 1)
|
||||||
|
self.tg_export_check = QtWidgets.QCheckBox(self.stackedWidgetPage1)
|
||||||
|
self.tg_export_check.setObjectName("tg_export_check")
|
||||||
|
self.gridLayout_3.addWidget(self.tg_export_check, 2, 1, 1, 1)
|
||||||
|
self.tglines_export_check = QtWidgets.QCheckBox(self.stackedWidgetPage1)
|
||||||
|
self.tglines_export_check.setObjectName("tglines_export_check")
|
||||||
|
self.gridLayout_3.addWidget(self.tglines_export_check, 2, 2, 1, 1)
|
||||||
|
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
self.gridLayout_3.addItem(spacerItem, 6, 2, 1, 1)
|
||||||
|
self.new_graph_tau_combo = QtWidgets.QComboBox(self.stackedWidgetPage1)
|
||||||
|
self.new_graph_tau_combo.setObjectName("new_graph_tau_combo")
|
||||||
|
self.gridLayout_3.addWidget(self.new_graph_tau_combo, 5, 2, 1, 1)
|
||||||
|
self.label_6 = QtWidgets.QLabel(self.stackedWidgetPage1)
|
||||||
|
self.label_6.setObjectName("label_6")
|
||||||
|
self.gridLayout_3.addWidget(self.label_6, 4, 1, 1, 1)
|
||||||
|
self.new_graph_tau_check = QtWidgets.QCheckBox(self.stackedWidgetPage1)
|
||||||
|
self.new_graph_tau_check.setObjectName("new_graph_tau_check")
|
||||||
|
self.gridLayout_3.addWidget(self.new_graph_tau_check, 5, 1, 1, 1)
|
||||||
|
self.line = QtWidgets.QFrame(self.stackedWidgetPage1)
|
||||||
|
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||||
|
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||||
|
self.line.setObjectName("line")
|
||||||
|
self.gridLayout_3.addWidget(self.line, 3, 1, 1, 2)
|
||||||
self.stackedWidget.addWidget(self.stackedWidgetPage1)
|
self.stackedWidget.addWidget(self.stackedWidgetPage1)
|
||||||
self.page = QtWidgets.QWidget()
|
self.page = QtWidgets.QWidget()
|
||||||
self.page.setObjectName("page")
|
self.page.setObjectName("page")
|
||||||
@ -75,50 +134,15 @@ class Ui_Dialog(object):
|
|||||||
self.graphicsView_2.setObjectName("graphicsView_2")
|
self.graphicsView_2.setObjectName("graphicsView_2")
|
||||||
self.gridLayout_2.addWidget(self.graphicsView_2, 0, 0, 3, 1)
|
self.gridLayout_2.addWidget(self.graphicsView_2, 0, 0, 3, 1)
|
||||||
self.stackedWidget.addWidget(self.page)
|
self.stackedWidget.addWidget(self.page)
|
||||||
self.gridLayout.addWidget(self.stackedWidget, 1, 1, 1, 1)
|
self.gridLayout.addWidget(self.stackedWidget, 2, 1, 1, 1)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
self.calctg_button = QtWidgets.QPushButton(Dialog)
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
|
||||||
self.gridLayout.addWidget(self.buttonBox, 2, 1, 1, 1)
|
|
||||||
self.graphicsView = PlotWidget(Dialog)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.calctg_button.sizePolicy().hasHeightForWidth())
|
||||||
self.graphicsView.setSizePolicy(sizePolicy)
|
self.calctg_button.setSizePolicy(sizePolicy)
|
||||||
self.graphicsView.setObjectName("graphicsView")
|
self.calctg_button.setObjectName("calctg_button")
|
||||||
self.gridLayout.addWidget(self.graphicsView, 0, 1, 1, 1)
|
self.gridLayout.addWidget(self.calctg_button, 1, 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.label_3 = QtWidgets.QLabel(Dialog)
|
|
||||||
self.label_3.setObjectName("label_3")
|
|
||||||
self.verticalLayout.addWidget(self.label_3)
|
|
||||||
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, 2, 1)
|
|
||||||
|
|
||||||
self.retranslateUi(Dialog)
|
self.retranslateUi(Dialog)
|
||||||
self.stackedWidget.setCurrentIndex(0)
|
self.stackedWidget.setCurrentIndex(0)
|
||||||
@ -129,8 +153,17 @@ class Ui_Dialog(object):
|
|||||||
def retranslateUi(self, Dialog):
|
def retranslateUi(self, Dialog):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
Dialog.setWindowTitle(_translate("Dialog", "SImba, everything the light touches is our kingdom"))
|
Dialog.setWindowTitle(_translate("Dialog", "SImba, everything the light touches is our kingdom"))
|
||||||
self.checkBox.setText(_translate("Dialog", "Export lines"))
|
self.label.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-weight:600;\">Tg values:</span></p></body></html>"))
|
||||||
self.pushButton.setText(_translate("Dialog", "Calculate Tg"))
|
self.tg_value_label.setText(_translate("Dialog", "TextLabel"))
|
||||||
|
self.label_4.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-weight:600;\">TNMH parameter:</span></p></body></html>"))
|
||||||
|
self.hodge_selection.setItemText(0, _translate("Dialog", "Onset"))
|
||||||
|
self.hodge_selection.setItemText(1, _translate("Dialog", "Midpoint"))
|
||||||
|
self.hodge_selection.setItemText(2, _translate("Dialog", "End"))
|
||||||
|
self.hodge_selection.setItemText(3, _translate("Dialog", "Inflection"))
|
||||||
|
self.tg_export_check.setText(_translate("Dialog", "Export Tg"))
|
||||||
|
self.tglines_export_check.setText(_translate("Dialog", "Export lines"))
|
||||||
|
self.label_6.setText(_translate("Dialog", "Hodge:"))
|
||||||
|
self.new_graph_tau_check.setText(_translate("Dialog", "New graph"))
|
||||||
self.pushButton_2.setText(_translate("Dialog", "Fictive Cp"))
|
self.pushButton_2.setText(_translate("Dialog", "Fictive Cp"))
|
||||||
self.label_2.setText(_translate("Dialog", "Tg for TNMH"))
|
self.label_2.setText(_translate("Dialog", "Tg for TNMH"))
|
||||||
self.comboBox.setItemText(0, _translate("Dialog", "Fictive"))
|
self.comboBox.setItemText(0, _translate("Dialog", "Fictive"))
|
||||||
@ -139,8 +172,6 @@ class Ui_Dialog(object):
|
|||||||
self.comboBox.setItemText(3, _translate("Dialog", "End"))
|
self.comboBox.setItemText(3, _translate("Dialog", "End"))
|
||||||
self.comboBox.setItemText(4, _translate("Dialog", "Inflection"))
|
self.comboBox.setItemText(4, _translate("Dialog", "Inflection"))
|
||||||
self.pushButton_3.setText(_translate("Dialog", "Fit TNMH model"))
|
self.pushButton_3.setText(_translate("Dialog", "Fit TNMH model"))
|
||||||
self.label.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-weight:600;\">Tg values:</span></p></body></html>"))
|
self.calctg_button.setText(_translate("Dialog", "Calculate Tg"))
|
||||||
self.label_3.setText(_translate("Dialog", "TextLabel"))
|
|
||||||
self.label_4.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-weight:600;\">TNMH parameter:</span></p></body></html>"))
|
|
||||||
from ..lib.forms import CheckCombobox
|
from ..lib.forms import CheckCombobox
|
||||||
from pyqtgraph import PlotWidget
|
from pyqtgraph import PlotWidget
|
||||||
|
@ -29,33 +29,42 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
'mid': PlotItem(x=[], y=[], pen=None, symbol='s', symbolBrush=Tab10.TabOrange.rgb(), name='Midpoint'),
|
'mid': PlotItem(x=[], y=[], pen=None, symbol='s', symbolBrush=Tab10.TabOrange.rgb(), name='Midpoint'),
|
||||||
'end': PlotItem(x=[], y=[], pen=None, symbol='t', symbolBrush=Tab10.TabGreen.rgb(), name='End'),
|
'end': PlotItem(x=[], y=[], pen=None, symbol='t', symbolBrush=Tab10.TabGreen.rgb(), name='End'),
|
||||||
'inflection': PlotItem(x=[], y=[], pen=None, symbol='d', symbolBrush=Tab10.TabRed.rgb(), name='Inflection'),
|
'inflection': PlotItem(x=[], y=[], pen=None, symbol='d', symbolBrush=Tab10.TabRed.rgb(), name='Inflection'),
|
||||||
'fictive': PlotItem(x=[], y=[], pen=None, symbol='t1', symbolBrush=Tab10.TabPurple.rgb(), name='Fictive'),
|
# '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'),
|
# 'TNMH': PlotItem(x=[], y=[], pen=None, symbol='star', symbolBrush=Tab10.TabPurple.rgb(), name='TNMH'),
|
||||||
}
|
}
|
||||||
|
self.tau_plot.getPlotItem().addLegend()
|
||||||
for plt in self._hodge_plots.values():
|
for plt in self._hodge_plots.values():
|
||||||
self.graphicsView_3.addItem(plt)
|
self.tau_plot.addItem(plt)
|
||||||
|
self.tau_plot.setLogMode(y=True)
|
||||||
|
|
||||||
self.limits = RegionItem(), RegionItem()
|
self.limits = RegionItem(), RegionItem()
|
||||||
for lim in self.limits:
|
for lim in self.limits:
|
||||||
self.graphicsView.addItem(lim)
|
self.dsc_plot.addItem(lim)
|
||||||
self._limitless = True
|
self._limitless = True
|
||||||
|
|
||||||
self.add_sets()
|
self.add_sets()
|
||||||
|
|
||||||
self.listWidget.itemClicked.connect(self.show_tg_values)
|
self.listWidget.itemClicked.connect(self.show_tg_values)
|
||||||
|
|
||||||
for x in 'abc':
|
# for x in self._hodge_plots:
|
||||||
self.comboBox_2.addItem(x)
|
# self.hodge_selection.addItem(x)
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
|
print('call')
|
||||||
self.clear()
|
self.clear()
|
||||||
|
self._colors = cycle(Tab10)
|
||||||
self.add_sets()
|
self.add_sets()
|
||||||
|
|
||||||
|
for g in self._management.graphs.list():
|
||||||
|
print(g)
|
||||||
|
|
||||||
|
return self
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
self.listWidget.clear()
|
self.listWidget.clear()
|
||||||
for plots in self._plots.values():
|
for plots in self._plots.values():
|
||||||
for val in plots:
|
for val in plots:
|
||||||
self.graphicsView.removeItem(val)
|
self.dsc_plot.removeItem(val)
|
||||||
self.graphicsView_2.removeItem(val)
|
self.graphicsView_2.removeItem(val)
|
||||||
|
|
||||||
for plt in self._hodge_plots.values():
|
for plt in self._hodge_plots.values():
|
||||||
@ -65,6 +74,7 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
self._plots = {}
|
self._plots = {}
|
||||||
self._tg_value = {}
|
self._tg_value = {}
|
||||||
self._fit = {}
|
self._fit = {}
|
||||||
|
self.gra
|
||||||
|
|
||||||
def add_sets(self):
|
def add_sets(self):
|
||||||
min_x = 10_000_000
|
min_x = 10_000_000
|
||||||
@ -86,22 +96,22 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
self._dsc[key] = (data, None)
|
self._dsc[key] = (data, None)
|
||||||
|
|
||||||
data_plot = PlotItem(x=data.x, y=data.y, pen=mkPen(c.rgb()))
|
data_plot = PlotItem(x=data.x, y=data.y, pen=mkPen(c.rgb()))
|
||||||
self.graphicsView.addItem(data_plot)
|
self.dsc_plot.addItem(data_plot)
|
||||||
|
|
||||||
glass = PlotItem()
|
glass = PlotItem()
|
||||||
glass.set_line(style=2, color=c)
|
glass.set_line(style=2, color=c)
|
||||||
self.graphicsView.addItem(glass)
|
self.dsc_plot.addItem(glass)
|
||||||
|
|
||||||
liquid = PlotItem()
|
liquid = PlotItem()
|
||||||
liquid.set_line(style=2, color=c)
|
liquid.set_line(style=2, color=c)
|
||||||
self.graphicsView.addItem(liquid)
|
self.dsc_plot.addItem(liquid)
|
||||||
|
|
||||||
tangent = PlotItem()
|
tangent = PlotItem()
|
||||||
tangent.set_line(style=2, color=c)
|
tangent.set_line(style=2, color=c)
|
||||||
self.graphicsView.addItem(tangent)
|
self.dsc_plot.addItem(tangent)
|
||||||
|
|
||||||
tg_plot = PlotItem(pen=None, symbolBrush=c.rgb(), symbol='o')
|
tg_plot = PlotItem(pen=None, symbolBrush=c.rgb(), symbol='o')
|
||||||
self.graphicsView.addItem(tg_plot)
|
self.dsc_plot.addItem(tg_plot)
|
||||||
|
|
||||||
fictive_cp = PlotItem(pen=mkPen(c.rgb()))
|
fictive_cp = PlotItem(pen=mkPen(c.rgb()))
|
||||||
self.graphicsView_2.addItem(fictive_cp)
|
self.graphicsView_2.addItem(fictive_cp)
|
||||||
@ -111,7 +121,7 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
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._plots[key] = (data_plot, tg_plot, glass, liquid, tangent, fictive_cp, tnmh_fit)
|
||||||
self._tg_value[key] = {'onset': (nan, nan), 'mid': (nan, nan), 'end': (nan, nan), 'inflection': (nan, nan), 'fictive': (nan, nan)}
|
self._tg_value[key] = {'onset': (nan, nan), 'mid': (nan, nan), 'end': (nan, nan), 'inflection': (nan, nan)} # , 'fictive': (nan, nan)}
|
||||||
|
|
||||||
if self._limitless:
|
if self._limitless:
|
||||||
dist = max_x - min_x
|
dist = max_x - min_x
|
||||||
@ -119,7 +129,7 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
self.limits[1].setRegion((max_x-min(5, 0.1*dist), max_x))
|
self.limits[1].setRegion((max_x-min(5, 0.1*dist), max_x))
|
||||||
self._limitless = False
|
self._limitless = False
|
||||||
|
|
||||||
@QtCore.pyqtSlot(name='on_pushButton_clicked')
|
@QtCore.pyqtSlot(name='on_calctg_button_clicked')
|
||||||
def calc_tg(self):
|
def calc_tg(self):
|
||||||
baselines = tuple(lim.getRegion() for lim in self.limits)
|
baselines = tuple(lim.getRegion() for lim in self.limits)
|
||||||
if baselines[0][0] > baselines[1][0]:
|
if baselines[0][0] > baselines[1][0]:
|
||||||
@ -148,7 +158,7 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
|
|
||||||
if values is not None:
|
if values is not None:
|
||||||
label = '\n'.join((f'{name.capitalize()}: {pos[0]:.2f} K' for name, pos in values.items()))
|
label = '\n'.join((f'{name.capitalize()}: {pos[0]:.2f} K' for name, pos in values.items()))
|
||||||
self.label_3.setText(label)
|
self.tg_value_label.setText(label)
|
||||||
|
|
||||||
fit = self._fit.get(item.data(QtCore.Qt.UserRole))
|
fit = self._fit.get(item.data(QtCore.Qt.UserRole))
|
||||||
if fit is not None:
|
if fit is not None:
|
||||||
@ -241,4 +251,3 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
def close(self) -> bool:
|
def close(self) -> bool:
|
||||||
self.clear()
|
self.clear()
|
||||||
return super().close()
|
return super().close()
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
|||||||
self.fitpreview = []
|
self.fitpreview = []
|
||||||
self._fit_plot_id = None
|
self._fit_plot_id = None
|
||||||
self.savefitdialog = None
|
self.savefitdialog = None
|
||||||
|
self._tg_dialog = None
|
||||||
self.eval = None
|
self.eval = None
|
||||||
self.editor = None
|
self.editor = None
|
||||||
|
|
||||||
@ -1083,5 +1084,8 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
|||||||
|
|
||||||
@QtCore.pyqtSlot(name='on_actionTNMH_model_triggered')
|
@QtCore.pyqtSlot(name='on_actionTNMH_model_triggered')
|
||||||
def show_tg_dialog(self):
|
def show_tg_dialog(self):
|
||||||
dialog = TgCalculator(self.management, parent=self)
|
if self._tg_dialog is None:
|
||||||
dialog.show()
|
self._tg_dialog = TgCalculator(self.management, parent=self)
|
||||||
|
else:
|
||||||
|
self._tg_dialog()
|
||||||
|
self._tg_dialog.show()
|
||||||
|
@ -14,7 +14,78 @@
|
|||||||
<string>SImba, everything the light touches is our kingdom</string>
|
<string>SImba, everything the light touches is our kingdom</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="1">
|
<item row="3" column="1">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Save</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" rowspan="3">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QListWidget" name="listWidget">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-weight:600;">Tg values:</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="tg_value_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-weight:600;">TNMH parameter:</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="PlotWidget" name="dsc_plot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
<widget class="QStackedWidget" name="stackedWidget">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
@ -25,34 +96,34 @@
|
|||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="stackedWidgetPage1" native="true">
|
<widget class="QWidget" name="stackedWidgetPage1">
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="1" column="1">
|
<item row="4" column="2">
|
||||||
<widget class="QCheckBox" name="checkBox">
|
<widget class="CheckCombobox" name="hodge_selection">
|
||||||
<property name="text">
|
<item>
|
||||||
<string>Export lines</string>
|
<property name="text">
|
||||||
</property>
|
<string>Onset</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Midpoint</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>End</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Inflection</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="0" column="0" rowspan="7">
|
||||||
<widget class="QCheckBox" name="checkBox_2">
|
<widget class="PlotWidget" name="tau_plot">
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Calculate Tg</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="CheckCombobox" name="comboBox_2"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" rowspan="4">
|
|
||||||
<widget class="PlotWidget" name="graphicsView_3">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -61,6 +132,57 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QCheckBox" name="tg_export_check">
|
||||||
|
<property name="text">
|
||||||
|
<string>Export Tg</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QCheckBox" name="tglines_export_check">
|
||||||
|
<property name="text">
|
||||||
|
<string>Export lines</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="2">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="2">
|
||||||
|
<widget class="QComboBox" name="new_graph_tau_combo"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hodge:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QCheckBox" name="new_graph_tau_check">
|
||||||
|
<property name="text">
|
||||||
|
<string>New graph</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" colspan="2">
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="page">
|
<widget class="QWidget" name="page">
|
||||||
@ -126,77 +248,19 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QPushButton" name="calctg_button">
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="PlotWidget" name="graphicsView">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Calculate Tg</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" rowspan="2">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QListWidget" name="listWidget">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string><html><head/><body><p><span style=" font-weight:600;">Tg values:</span></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>TextLabel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string><html><head/><body><p><span style=" font-weight:600;">TNMH parameter:</span></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
Loading…
Reference in New Issue
Block a user