BUGFIX: VFT;
change to src layout
This commit is contained in:
12
src/gui_qt/Qt.py
Normal file
12
src/gui_qt/Qt.py
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets, QtPrintSupport
|
||||
|
||||
# from PySide2 import QtCore, QtGui, QtWidgets, QtPrintSupport
|
||||
# QtCore.pyqtSignal = QtCore.Signal
|
||||
# QtCore.pyqtProperty = QtCore.Property
|
||||
# QtCore.pyqtSlot = QtCore.Slot
|
||||
|
||||
# import pyqtgraph as pg
|
||||
#
|
||||
# pg.setConfigOption('background', 'w')
|
||||
# pg.setConfigOption('foreground', 'k')
|
18
src/gui_qt/__init__.py
Normal file
18
src/gui_qt/__init__.py
Normal file
@ -0,0 +1,18 @@
|
||||
from nmreval.configs import read_configuration
|
||||
|
||||
from .Qt import QtWidgets
|
||||
from .lib.styles import MyProxyStyle
|
||||
|
||||
|
||||
class App(QtWidgets.QApplication):
|
||||
color = 'light'
|
||||
theme = 'normal'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
configs = read_configuration()
|
||||
App.theme = configs.get('GUI', 'Theme')
|
||||
App.color = configs.get('GUI', 'Color')
|
||||
|
||||
self.setStyle(MyProxyStyle(App.color))
|
0
src/gui_qt/_py/__init__.py
Normal file
0
src/gui_qt/_py/__init__.py
Normal file
323
src/gui_qt/_py/agroptiondialog.py
Normal file
323
src/gui_qt/_py/agroptiondialog.py
Normal file
@ -0,0 +1,323 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '_ui/agroptiondialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(513, 466)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(Dialog)
|
||||
self.tabWidget.setTabShape(QtWidgets.QTabWidget.Rounded)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tabWidgetPage1 = QtWidgets.QWidget()
|
||||
self.tabWidgetPage1.setObjectName("tabWidgetPage1")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.tabWidgetPage1)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.frame_2 = QtWidgets.QFrame(self.tabWidgetPage1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth())
|
||||
self.frame_2.setSizePolicy(sizePolicy)
|
||||
self.frame_2.setFrameShape(QtWidgets.QFrame.Panel)
|
||||
self.frame_2.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame_2.setLineWidth(3)
|
||||
self.frame_2.setMidLineWidth(5)
|
||||
self.frame_2.setObjectName("frame_2")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.frame_2)
|
||||
self.gridLayout_4.setSpacing(3)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.bottomMarginDoubleSpinBox = QtWidgets.QDoubleSpinBox(self.frame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.bottomMarginDoubleSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.bottomMarginDoubleSpinBox.setSizePolicy(sizePolicy)
|
||||
self.bottomMarginDoubleSpinBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.bottomMarginDoubleSpinBox.setObjectName("bottomMarginDoubleSpinBox")
|
||||
self.gridLayout_4.addWidget(self.bottomMarginDoubleSpinBox, 5, 2, 1, 1)
|
||||
self.bottomMarginLabel = QtWidgets.QLabel(self.frame_2)
|
||||
self.bottomMarginLabel.setObjectName("bottomMarginLabel")
|
||||
self.gridLayout_4.addWidget(self.bottomMarginLabel, 5, 1, 1, 1)
|
||||
self.rightMarginLabel = QtWidgets.QLabel(self.frame_2)
|
||||
self.rightMarginLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.rightMarginLabel.setObjectName("rightMarginLabel")
|
||||
self.gridLayout_4.addWidget(self.rightMarginLabel, 2, 3, 1, 1)
|
||||
self.rightMarginDoubleSpinBox = QtWidgets.QDoubleSpinBox(self.frame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.rightMarginDoubleSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.rightMarginDoubleSpinBox.setSizePolicy(sizePolicy)
|
||||
self.rightMarginDoubleSpinBox.setObjectName("rightMarginDoubleSpinBox")
|
||||
self.gridLayout_4.addWidget(self.rightMarginDoubleSpinBox, 3, 3, 1, 1)
|
||||
self.leftMarginDoubleSpinBox = QtWidgets.QDoubleSpinBox(self.frame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.leftMarginDoubleSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.leftMarginDoubleSpinBox.setSizePolicy(sizePolicy)
|
||||
self.leftMarginDoubleSpinBox.setObjectName("leftMarginDoubleSpinBox")
|
||||
self.gridLayout_4.addWidget(self.leftMarginDoubleSpinBox, 3, 0, 1, 1)
|
||||
self.leftMarginLabel = QtWidgets.QLabel(self.frame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.leftMarginLabel.sizePolicy().hasHeightForWidth())
|
||||
self.leftMarginLabel.setSizePolicy(sizePolicy)
|
||||
self.leftMarginLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.leftMarginLabel.setObjectName("leftMarginLabel")
|
||||
self.gridLayout_4.addWidget(self.leftMarginLabel, 2, 0, 1, 1)
|
||||
self.topMarginLabel = QtWidgets.QLabel(self.frame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.topMarginLabel.sizePolicy().hasHeightForWidth())
|
||||
self.topMarginLabel.setSizePolicy(sizePolicy)
|
||||
self.topMarginLabel.setObjectName("topMarginLabel")
|
||||
self.gridLayout_4.addWidget(self.topMarginLabel, 0, 1, 1, 1)
|
||||
self.topMarginDoubleSpinBox = QtWidgets.QDoubleSpinBox(self.frame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.topMarginDoubleSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.topMarginDoubleSpinBox.setSizePolicy(sizePolicy)
|
||||
self.topMarginDoubleSpinBox.setObjectName("topMarginDoubleSpinBox")
|
||||
self.gridLayout_4.addWidget(self.topMarginDoubleSpinBox, 0, 2, 1, 1)
|
||||
self.frame = QtWidgets.QFrame(self.frame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
self.frame.setSizePolicy(sizePolicy)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.WinPanel)
|
||||
self.frame.setMidLineWidth(0)
|
||||
self.frame.setObjectName("frame")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.gridLayout_4.addWidget(self.frame, 1, 1, 4, 2)
|
||||
self.gridLayout_2.addWidget(self.frame_2, 1, 0, 2, 2)
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_3.addItem(spacerItem)
|
||||
self.heightLabel = QtWidgets.QLabel(self.tabWidgetPage1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.heightLabel.sizePolicy().hasHeightForWidth())
|
||||
self.heightLabel.setSizePolicy(sizePolicy)
|
||||
self.heightLabel.setObjectName("heightLabel")
|
||||
self.verticalLayout_3.addWidget(self.heightLabel)
|
||||
self.heightDoubleSpinBox = QtWidgets.QDoubleSpinBox(self.tabWidgetPage1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.heightDoubleSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.heightDoubleSpinBox.setSizePolicy(sizePolicy)
|
||||
self.heightDoubleSpinBox.setObjectName("heightDoubleSpinBox")
|
||||
self.verticalLayout_3.addWidget(self.heightDoubleSpinBox)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_3.addItem(spacerItem1)
|
||||
self.gridLayout_2.addLayout(self.verticalLayout_3, 1, 2, 2, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem2)
|
||||
self.widthLabel = QtWidgets.QLabel(self.tabWidgetPage1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.widthLabel.sizePolicy().hasHeightForWidth())
|
||||
self.widthLabel.setSizePolicy(sizePolicy)
|
||||
self.widthLabel.setObjectName("widthLabel")
|
||||
self.horizontalLayout.addWidget(self.widthLabel)
|
||||
self.widthDoubleSpinBox = QtWidgets.QDoubleSpinBox(self.tabWidgetPage1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.widthDoubleSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.widthDoubleSpinBox.setSizePolicy(sizePolicy)
|
||||
self.widthDoubleSpinBox.setObjectName("widthDoubleSpinBox")
|
||||
self.horizontalLayout.addWidget(self.widthDoubleSpinBox)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem3)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout, 0, 0, 1, 2)
|
||||
self.tabWidget.addTab(self.tabWidgetPage1, "")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
self.tab.setObjectName("tab")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.label_11 = QtWidgets.QLabel(self.tab)
|
||||
self.label_11.setObjectName("label_11")
|
||||
self.verticalLayout_4.addWidget(self.label_11)
|
||||
self.spinBox_2 = QtWidgets.QSpinBox(self.tab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.spinBox_2.sizePolicy().hasHeightForWidth())
|
||||
self.spinBox_2.setSizePolicy(sizePolicy)
|
||||
self.spinBox_2.setMaximum(1000)
|
||||
self.spinBox_2.setProperty("value", 100)
|
||||
self.spinBox_2.setObjectName("spinBox_2")
|
||||
self.verticalLayout_4.addWidget(self.spinBox_2)
|
||||
self.legendLabel = QtWidgets.QLabel(self.tab)
|
||||
self.legendLabel.setObjectName("legendLabel")
|
||||
self.verticalLayout_4.addWidget(self.legendLabel)
|
||||
self.spinBox = QtWidgets.QSpinBox(self.tab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.spinBox.sizePolicy().hasHeightForWidth())
|
||||
self.spinBox.setSizePolicy(sizePolicy)
|
||||
self.spinBox.setMaximum(1000)
|
||||
self.spinBox.setProperty("value", 100)
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.verticalLayout_4.addWidget(self.spinBox)
|
||||
self.groupBox_4 = QtWidgets.QGroupBox(self.tab)
|
||||
self.groupBox_4.setObjectName("groupBox_4")
|
||||
self.formLayout_2 = QtWidgets.QFormLayout(self.groupBox_4)
|
||||
self.formLayout_2.setObjectName("formLayout_2")
|
||||
self.verticalAxisTickLabel = QtWidgets.QLabel(self.groupBox_4)
|
||||
self.verticalAxisTickLabel.setObjectName("verticalAxisTickLabel")
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.verticalAxisTickLabel)
|
||||
self.spinBox_5 = QtWidgets.QSpinBox(self.groupBox_4)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.spinBox_5.sizePolicy().hasHeightForWidth())
|
||||
self.spinBox_5.setSizePolicy(sizePolicy)
|
||||
self.spinBox_5.setMaximum(1000)
|
||||
self.spinBox_5.setProperty("value", 100)
|
||||
self.spinBox_5.setObjectName("spinBox_5")
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.spinBox_5)
|
||||
self.verticalAxisLabelSpinBox = QtWidgets.QSpinBox(self.groupBox_4)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.verticalAxisLabelSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.verticalAxisLabelSpinBox.setSizePolicy(sizePolicy)
|
||||
self.verticalAxisLabelSpinBox.setMaximum(1000)
|
||||
self.verticalAxisLabelSpinBox.setProperty("value", 100)
|
||||
self.verticalAxisLabelSpinBox.setObjectName("verticalAxisLabelSpinBox")
|
||||
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.verticalAxisLabelSpinBox)
|
||||
self.verticalAxisLabelLabel = QtWidgets.QLabel(self.groupBox_4)
|
||||
self.verticalAxisLabelLabel.setObjectName("verticalAxisLabelLabel")
|
||||
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.verticalAxisLabelLabel)
|
||||
self.verticalLayout_4.addWidget(self.groupBox_4)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(self.tab)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.formLayout = QtWidgets.QFormLayout(self.groupBox_3)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.spinBox_4 = QtWidgets.QSpinBox(self.groupBox_3)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.spinBox_4.sizePolicy().hasHeightForWidth())
|
||||
self.spinBox_4.setSizePolicy(sizePolicy)
|
||||
self.spinBox_4.setMaximum(1000)
|
||||
self.spinBox_4.setProperty("value", 100)
|
||||
self.spinBox_4.setObjectName("spinBox_4")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.spinBox_4)
|
||||
self.spinBox_3 = QtWidgets.QSpinBox(self.groupBox_3)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.spinBox_3.sizePolicy().hasHeightForWidth())
|
||||
self.spinBox_3.setSizePolicy(sizePolicy)
|
||||
self.spinBox_3.setMaximum(1000)
|
||||
self.spinBox_3.setProperty("value", 100)
|
||||
self.spinBox_3.setObjectName("spinBox_3")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.spinBox_3)
|
||||
self.label_10 = QtWidgets.QLabel(self.groupBox_3)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_10.sizePolicy().hasHeightForWidth())
|
||||
self.label_10.setSizePolicy(sizePolicy)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_10)
|
||||
self.label_12 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_12)
|
||||
self.verticalLayout_4.addWidget(self.groupBox_3)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_4.addItem(spacerItem4)
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.tab_2)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.spinBox_6 = QtWidgets.QSpinBox(self.tab_2)
|
||||
self.spinBox_6.setMaximum(1000)
|
||||
self.spinBox_6.setProperty("value", 100)
|
||||
self.spinBox_6.setObjectName("spinBox_6")
|
||||
self.gridLayout_3.addWidget(self.spinBox_6, 0, 1, 1, 1)
|
||||
self.label_3 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout_3.addWidget(self.label_3, 0, 0, 1, 1)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_3.addItem(spacerItem5, 2, 1, 1, 1)
|
||||
self.doubleSpinBox_7 = QtWidgets.QDoubleSpinBox(self.tab_2)
|
||||
self.doubleSpinBox_7.setDecimals(1)
|
||||
self.doubleSpinBox_7.setMaximum(20.0)
|
||||
self.doubleSpinBox_7.setSingleStep(0.5)
|
||||
self.doubleSpinBox_7.setProperty("value", 1.0)
|
||||
self.doubleSpinBox_7.setObjectName("doubleSpinBox_7")
|
||||
self.gridLayout_3.addWidget(self.doubleSpinBox_7, 1, 1, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout_3.addWidget(self.label_4, 1, 0, 1, 1)
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Grace settings"))
|
||||
self.bottomMarginDoubleSpinBox.setSuffix(_translate("Dialog", " cm"))
|
||||
self.bottomMarginLabel.setText(_translate("Dialog", "Bottom margin"))
|
||||
self.rightMarginLabel.setText(_translate("Dialog", "Right margin"))
|
||||
self.rightMarginDoubleSpinBox.setSuffix(_translate("Dialog", " cm"))
|
||||
self.leftMarginDoubleSpinBox.setSuffix(_translate("Dialog", " cm"))
|
||||
self.leftMarginLabel.setText(_translate("Dialog", "Left margin"))
|
||||
self.topMarginLabel.setText(_translate("Dialog", "Top margin"))
|
||||
self.topMarginDoubleSpinBox.setSuffix(_translate("Dialog", " cm"))
|
||||
self.heightLabel.setText(_translate("Dialog", "Paper height"))
|
||||
self.heightDoubleSpinBox.setSuffix(_translate("Dialog", " cm"))
|
||||
self.widthLabel.setText(_translate("Dialog", "Paper width"))
|
||||
self.widthDoubleSpinBox.setSuffix(_translate("Dialog", " cm"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage1), _translate("Dialog", "Dimensions"))
|
||||
self.label_11.setText(_translate("Dialog", "Title"))
|
||||
self.legendLabel.setText(_translate("Dialog", "Legend"))
|
||||
self.groupBox_4.setTitle(_translate("Dialog", "Vertical axis"))
|
||||
self.verticalAxisTickLabel.setText(_translate("Dialog", "tick"))
|
||||
self.verticalAxisLabelLabel.setText(_translate("Dialog", "label"))
|
||||
self.groupBox_3.setTitle(_translate("Dialog", "Horizontal axis"))
|
||||
self.label_10.setText(_translate("Dialog", "tick"))
|
||||
self.label_12.setText(_translate("Dialog", "label"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Dialog", "Fonts"))
|
||||
self.label_3.setText(_translate("Dialog", "Default symbol size"))
|
||||
self.label_4.setText(_translate("Dialog", "Default line size"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("Dialog", "Symbol/Line"))
|
74
src/gui_qt/_py/apod_dialog.py
Normal file
74
src/gui_qt/_py/apod_dialog.py
Normal file
@ -0,0 +1,74 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '_ui/apod_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_ApodEdit(object):
|
||||
def setupUi(self, ApodEdit):
|
||||
ApodEdit.setObjectName("ApodEdit")
|
||||
ApodEdit.resize(784, 484)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(ApodEdit.sizePolicy().hasHeightForWidth())
|
||||
ApodEdit.setSizePolicy(sizePolicy)
|
||||
self.gridLayout = QtWidgets.QGridLayout(ApodEdit)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.graphicsView = PlotWidget(ApodEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
|
||||
self.graphicsView.setSizePolicy(sizePolicy)
|
||||
self.graphicsView.setObjectName("graphicsView")
|
||||
self.gridLayout.addWidget(self.graphicsView, 2, 0, 1, 1)
|
||||
self.graphicsView_2 = PlotWidget(ApodEdit)
|
||||
self.graphicsView_2.setObjectName("graphicsView_2")
|
||||
self.gridLayout.addWidget(self.graphicsView_2, 2, 1, 1, 1)
|
||||
self.apodcombobox = QtWidgets.QComboBox(ApodEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.apodcombobox.sizePolicy().hasHeightForWidth())
|
||||
self.apodcombobox.setSizePolicy(sizePolicy)
|
||||
self.apodcombobox.setObjectName("apodcombobox")
|
||||
self.gridLayout.addWidget(self.apodcombobox, 0, 0, 1, 1)
|
||||
self.widget_layout = QtWidgets.QHBoxLayout()
|
||||
self.widget_layout.setContentsMargins(-1, 6, -1, -1)
|
||||
self.widget_layout.setSpacing(20)
|
||||
self.widget_layout.setObjectName("widget_layout")
|
||||
self.gridLayout.addLayout(self.widget_layout, 1, 0, 1, 2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(ApodEdit)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 2)
|
||||
self.eqn_label = QtWidgets.QLabel(ApodEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.eqn_label.sizePolicy().hasHeightForWidth())
|
||||
self.eqn_label.setSizePolicy(sizePolicy)
|
||||
self.eqn_label.setIndent(3)
|
||||
self.eqn_label.setObjectName("eqn_label")
|
||||
self.gridLayout.addWidget(self.eqn_label, 0, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(ApodEdit)
|
||||
self.buttonBox.accepted.connect(ApodEdit.accept)
|
||||
self.buttonBox.rejected.connect(ApodEdit.close)
|
||||
QtCore.QMetaObject.connectSlotsByName(ApodEdit)
|
||||
|
||||
def retranslateUi(self, ApodEdit):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
ApodEdit.setWindowTitle(_translate("ApodEdit", "Apodization"))
|
||||
self.eqn_label.setText(_translate("ApodEdit", "TextLabel"))
|
||||
from pyqtgraph import PlotWidget
|
203
src/gui_qt/_py/asciidialog.py
Normal file
203
src/gui_qt/_py/asciidialog.py
Normal file
@ -0,0 +1,203 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '_ui/asciidialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_ascii_reader(object):
|
||||
def setupUi(self, ascii_reader):
|
||||
ascii_reader.setObjectName("ascii_reader")
|
||||
ascii_reader.resize(667, 509)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(ascii_reader)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(ascii_reader)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tabWidgetPage1 = QtWidgets.QWidget()
|
||||
self.tabWidgetPage1.setObjectName("tabWidgetPage1")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tabWidgetPage1)
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.plainTextEdit_2 = QtWidgets.QPlainTextEdit(self.tabWidgetPage1)
|
||||
self.plainTextEdit_2.setEnabled(False)
|
||||
self.plainTextEdit_2.setMaximumSize(QtCore.QSize(16777215, 180))
|
||||
self.plainTextEdit_2.setObjectName("plainTextEdit_2")
|
||||
self.verticalLayout_3.addWidget(self.plainTextEdit_2)
|
||||
self.ascii_table = QtWidgets.QTableWidget(self.tabWidgetPage1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.ascii_table.sizePolicy().hasHeightForWidth())
|
||||
self.ascii_table.setSizePolicy(sizePolicy)
|
||||
self.ascii_table.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
|
||||
self.ascii_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.ascii_table.setAlternatingRowColors(True)
|
||||
self.ascii_table.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.ascii_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectColumns)
|
||||
self.ascii_table.setObjectName("ascii_table")
|
||||
self.ascii_table.setColumnCount(0)
|
||||
self.ascii_table.setRowCount(0)
|
||||
self.ascii_table.horizontalHeader().setMinimumSectionSize(1)
|
||||
self.verticalLayout_3.addWidget(self.ascii_table)
|
||||
self.tabWidget.addTab(self.tabWidgetPage1, "")
|
||||
self.tabWidgetPage2 = QtWidgets.QWidget()
|
||||
self.tabWidgetPage2.setObjectName("tabWidgetPage2")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.tabWidgetPage2)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.plainTextEdit = QtWidgets.QPlainTextEdit(self.tabWidgetPage2)
|
||||
self.plainTextEdit.setObjectName("plainTextEdit")
|
||||
self.horizontalLayout_3.addWidget(self.plainTextEdit)
|
||||
self.formLayout = QtWidgets.QFormLayout()
|
||||
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow)
|
||||
self.formLayout.setContentsMargins(0, -1, -1, -1)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label_2 = QtWidgets.QLabel(self.tabWidgetPage2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
|
||||
self.delay_lineedit = QtWidgets.QLineEdit(self.tabWidgetPage2)
|
||||
self.delay_lineedit.setObjectName("delay_lineedit")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.delay_lineedit)
|
||||
self.label_3 = QtWidgets.QLabel(self.tabWidgetPage2)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3)
|
||||
self.start_lineedit = QtWidgets.QLineEdit(self.tabWidgetPage2)
|
||||
self.start_lineedit.setObjectName("start_lineedit")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.start_lineedit)
|
||||
self.label_4 = QtWidgets.QLabel(self.tabWidgetPage2)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_4)
|
||||
self.end_lineedit = QtWidgets.QLineEdit(self.tabWidgetPage2)
|
||||
self.end_lineedit.setObjectName("end_lineedit")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.end_lineedit)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.tabWidgetPage2)
|
||||
self.checkBox.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.SpanningRole, self.checkBox)
|
||||
self.checkBox_2 = QtWidgets.QCheckBox(self.tabWidgetPage2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.checkBox_2.sizePolicy().hasHeightForWidth())
|
||||
self.checkBox_2.setSizePolicy(sizePolicy)
|
||||
self.checkBox_2.setObjectName("checkBox_2")
|
||||
self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.checkBox_2)
|
||||
self.stag_lineEdit = QtWidgets.QLineEdit(self.tabWidgetPage2)
|
||||
self.stag_lineEdit.setEnabled(True)
|
||||
self.stag_lineEdit.setObjectName("stag_lineEdit")
|
||||
self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.stag_lineEdit)
|
||||
self.pushButton = QtWidgets.QPushButton(self.tabWidgetPage2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton.setSizePolicy(sizePolicy)
|
||||
icon = QtGui.QIcon.fromTheme("accessories-calculator")
|
||||
self.pushButton.setIcon(icon)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.pushButton)
|
||||
self.horizontalLayout_3.addLayout(self.formLayout)
|
||||
self.tabWidget.addTab(self.tabWidgetPage2, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.x_label = QtWidgets.QLabel(ascii_reader)
|
||||
self.x_label.setObjectName("x_label")
|
||||
self.horizontalLayout.addWidget(self.x_label)
|
||||
self.x_lineedit = QtWidgets.QLineEdit(ascii_reader)
|
||||
self.x_lineedit.setInputMethodHints(QtCore.Qt.ImhFormattedNumbersOnly|QtCore.Qt.ImhPreferNumbers)
|
||||
self.x_lineedit.setObjectName("x_lineedit")
|
||||
self.horizontalLayout.addWidget(self.x_lineedit)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem1)
|
||||
self.y_label = QtWidgets.QLabel(ascii_reader)
|
||||
self.y_label.setObjectName("y_label")
|
||||
self.horizontalLayout.addWidget(self.y_label)
|
||||
self.y_lineedit = QtWidgets.QLineEdit(ascii_reader)
|
||||
self.y_lineedit.setInputMethodHints(QtCore.Qt.ImhFormattedNumbersOnly|QtCore.Qt.ImhPreferNumbers)
|
||||
self.y_lineedit.setObjectName("y_lineedit")
|
||||
self.horizontalLayout.addWidget(self.y_lineedit)
|
||||
self.widget = QtWidgets.QWidget(ascii_reader)
|
||||
self.widget.setObjectName("widget")
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.widget)
|
||||
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_4.setSpacing(0)
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_4.addItem(spacerItem2)
|
||||
self.label_5 = QtWidgets.QLabel(self.widget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_4.addWidget(self.label_5)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.widget)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout_4.addWidget(self.lineEdit)
|
||||
self.horizontalLayout.addWidget(self.widget)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.skippy_checkbox = QtWidgets.QCheckBox(ascii_reader)
|
||||
self.skippy_checkbox.setObjectName("skippy_checkbox")
|
||||
self.horizontalLayout_2.addWidget(self.skippy_checkbox)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem3)
|
||||
self.radioButton = QtWidgets.QRadioButton(ascii_reader)
|
||||
self.radioButton.setChecked(True)
|
||||
self.radioButton.setAutoExclusive(True)
|
||||
self.radioButton.setObjectName("radioButton")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(ascii_reader)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.radioButton)
|
||||
self.horizontalLayout_2.addWidget(self.radioButton)
|
||||
self.radioButton_2 = QtWidgets.QRadioButton(ascii_reader)
|
||||
self.radioButton_2.setAutoExclusive(True)
|
||||
self.radioButton_2.setObjectName("radioButton_2")
|
||||
self.buttonGroup.addButton(self.radioButton_2)
|
||||
self.horizontalLayout_2.addWidget(self.radioButton_2)
|
||||
self.radioButton_3 = QtWidgets.QRadioButton(ascii_reader)
|
||||
self.radioButton_3.setObjectName("radioButton_3")
|
||||
self.buttonGroup.addButton(self.radioButton_3)
|
||||
self.horizontalLayout_2.addWidget(self.radioButton_3)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.buttonbox = QtWidgets.QDialogButtonBox(ascii_reader)
|
||||
self.buttonbox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonbox.setObjectName("buttonbox")
|
||||
self.verticalLayout.addWidget(self.buttonbox)
|
||||
|
||||
self.retranslateUi(ascii_reader)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
self.buttonbox.rejected.connect(ascii_reader.close)
|
||||
QtCore.QMetaObject.connectSlotsByName(ascii_reader)
|
||||
|
||||
def retranslateUi(self, ascii_reader):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
ascii_reader.setWindowTitle(_translate("ascii_reader", "Read text file"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage1), _translate("ascii_reader", "Data"))
|
||||
self.label_2.setText(_translate("ascii_reader", "Number of delays"))
|
||||
self.label_3.setText(_translate("ascii_reader", "Start value"))
|
||||
self.label_4.setText(_translate("ascii_reader", "End value"))
|
||||
self.checkBox.setText(_translate("ascii_reader", "Logarithmic scale"))
|
||||
self.checkBox_2.setText(_translate("ascii_reader", "Staggered range"))
|
||||
self.pushButton.setText(_translate("ascii_reader", "Calculate delays"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage2), _translate("ascii_reader", "Delays"))
|
||||
self.x_label.setText(_translate("ascii_reader", "x"))
|
||||
self.x_lineedit.setToolTip(_translate("ascii_reader", "<html><head/><body><p>Specify which column is used as x-value.</p></body></html>"))
|
||||
self.y_label.setText(_translate("ascii_reader", "y"))
|
||||
self.y_lineedit.setToolTip(_translate("ascii_reader", "<html><head/><body><p>Specify which columns are read for y-values. (\'Points\': Every number creates a new data set;\'FID\'/\'Spectrum\': Numbers at even positions are used for real parts, at odd positions for imaginary parts.)</p></body></html>"))
|
||||
self.label_5.setText(_translate("ascii_reader", "<html><head/><body><p>Δy</p></body></html>"))
|
||||
self.skippy_checkbox.setToolTip(_translate("ascii_reader", "Use selection for next files. Deletes possible delay values."))
|
||||
self.skippy_checkbox.setText(_translate("ascii_reader", "Skip next dialogues?"))
|
||||
self.radioButton.setText(_translate("ascii_reader", "Points"))
|
||||
self.radioButton_2.setText(_translate("ascii_reader", "FID"))
|
||||
self.radioButton_3.setText(_translate("ascii_reader", "Spectrum"))
|
89
src/gui_qt/_py/axisConfigTemplate.py
Normal file
89
src/gui_qt/_py/axisConfigTemplate.py
Normal file
@ -0,0 +1,89 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '_ui/axisConfigTemplate.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(186, 154)
|
||||
Form.setMaximumSize(QtCore.QSize(200, 16777215))
|
||||
self.gridLayout = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 7, 0, 1, 2)
|
||||
self.linkCombo = QtWidgets.QComboBox(Form)
|
||||
self.linkCombo.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
|
||||
self.linkCombo.setObjectName("linkCombo")
|
||||
self.gridLayout.addWidget(self.linkCombo, 7, 2, 1, 2)
|
||||
self.autoPercentSpin = QtWidgets.QSpinBox(Form)
|
||||
self.autoPercentSpin.setEnabled(True)
|
||||
self.autoPercentSpin.setMinimum(1)
|
||||
self.autoPercentSpin.setMaximum(100)
|
||||
self.autoPercentSpin.setSingleStep(1)
|
||||
self.autoPercentSpin.setProperty("value", 100)
|
||||
self.autoPercentSpin.setObjectName("autoPercentSpin")
|
||||
self.gridLayout.addWidget(self.autoPercentSpin, 2, 2, 1, 2)
|
||||
self.autoRadio = QtWidgets.QRadioButton(Form)
|
||||
self.autoRadio.setChecked(True)
|
||||
self.autoRadio.setObjectName("autoRadio")
|
||||
self.gridLayout.addWidget(self.autoRadio, 2, 0, 1, 2)
|
||||
self.manualRadio = QtWidgets.QRadioButton(Form)
|
||||
self.manualRadio.setObjectName("manualRadio")
|
||||
self.gridLayout.addWidget(self.manualRadio, 1, 0, 1, 2)
|
||||
self.minText = QtWidgets.QLineEdit(Form)
|
||||
self.minText.setObjectName("minText")
|
||||
self.gridLayout.addWidget(self.minText, 1, 2, 1, 1)
|
||||
self.maxText = QtWidgets.QLineEdit(Form)
|
||||
self.maxText.setObjectName("maxText")
|
||||
self.gridLayout.addWidget(self.maxText, 1, 3, 1, 1)
|
||||
self.invertCheck = QtWidgets.QCheckBox(Form)
|
||||
self.invertCheck.setObjectName("invertCheck")
|
||||
self.gridLayout.addWidget(self.invertCheck, 5, 0, 1, 4)
|
||||
self.mouseCheck = QtWidgets.QCheckBox(Form)
|
||||
self.mouseCheck.setChecked(True)
|
||||
self.mouseCheck.setObjectName("mouseCheck")
|
||||
self.gridLayout.addWidget(self.mouseCheck, 6, 0, 1, 4)
|
||||
self.visibleOnlyCheck = QtWidgets.QCheckBox(Form)
|
||||
self.visibleOnlyCheck.setObjectName("visibleOnlyCheck")
|
||||
self.gridLayout.addWidget(self.visibleOnlyCheck, 3, 2, 1, 2)
|
||||
self.autoPanCheck = QtWidgets.QCheckBox(Form)
|
||||
self.autoPanCheck.setObjectName("autoPanCheck")
|
||||
self.gridLayout.addWidget(self.autoPanCheck, 4, 2, 1, 2)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "PyQtGraph"))
|
||||
self.label.setText(_translate("Form", "Link Axis:"))
|
||||
self.linkCombo.setToolTip(_translate("Form", "<html><head/><body><p>Links this axis with another view. When linked, both views will display the same data range.</p></body></html>"))
|
||||
self.autoPercentSpin.setToolTip(_translate("Form", "<html><head/><body><p>Percent of data to be visible when auto-scaling. It may be useful to decrease this value for data with spiky noise.</p></body></html>"))
|
||||
self.autoPercentSpin.setSuffix(_translate("Form", "%"))
|
||||
self.autoRadio.setToolTip(_translate("Form", "<html><head/><body><p>Automatically resize this axis whenever the displayed data is changed.</p></body></html>"))
|
||||
self.autoRadio.setText(_translate("Form", "Auto"))
|
||||
self.manualRadio.setToolTip(_translate("Form", "<html><head/><body><p>Set the range for this axis manually. This disables automatic scaling. </p></body></html>"))
|
||||
self.manualRadio.setText(_translate("Form", "Manual"))
|
||||
self.minText.setToolTip(_translate("Form", "<html><head/><body><p>Minimum value to display for this axis.</p></body></html>"))
|
||||
self.minText.setText(_translate("Form", "0"))
|
||||
self.maxText.setToolTip(_translate("Form", "<html><head/><body><p>Maximum value to display for this axis.</p></body></html>"))
|
||||
self.maxText.setText(_translate("Form", "0"))
|
||||
self.invertCheck.setToolTip(_translate("Form", "<html><head/><body><p>Inverts the display of this axis. (+y points downward instead of upward)</p></body></html>"))
|
||||
self.invertCheck.setText(_translate("Form", "Invert Axis"))
|
||||
self.mouseCheck.setToolTip(_translate("Form", "<html><head/><body><p>Enables mouse interaction (panning, scaling) for this axis.</p></body></html>"))
|
||||
self.mouseCheck.setText(_translate("Form", "Mouse Enabled"))
|
||||
self.visibleOnlyCheck.setToolTip(_translate("Form", "<html><head/><body><p>When checked, the axis will only auto-scale to data that is visible along the orthogonal axis.</p></body></html>"))
|
||||
self.visibleOnlyCheck.setText(_translate("Form", "Visible Data Only"))
|
||||
self.autoPanCheck.setToolTip(_translate("Form", "<html><head/><body><p>When checked, the axis will automatically pan to center on the current data, but the scale along this axis will not change.</p></body></html>"))
|
||||
self.autoPanCheck.setText(_translate("Form", "Auto Pan Only"))
|
64
src/gui_qt/_py/baseline_dialog.py
Normal file
64
src/gui_qt/_py/baseline_dialog.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '_ui/baseline_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_SignalEdit(object):
|
||||
def setupUi(self, SignalEdit):
|
||||
SignalEdit.setObjectName("SignalEdit")
|
||||
SignalEdit.resize(919, 595)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(SignalEdit.sizePolicy().hasHeightForWidth())
|
||||
SignalEdit.setSizePolicy(sizePolicy)
|
||||
self.gridLayout = QtWidgets.QGridLayout(SignalEdit)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.groupBox = QtWidgets.QWidget(SignalEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
|
||||
self.groupBox.setSizePolicy(sizePolicy)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.listWidget = QtWidgets.QListWidget(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, 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.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(SignalEdit)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 3)
|
||||
self.graphicsView = PlotWidget(SignalEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
|
||||
self.graphicsView.setSizePolicy(sizePolicy)
|
||||
self.graphicsView.setObjectName("graphicsView")
|
||||
self.gridLayout.addWidget(self.graphicsView, 0, 2, 1, 1)
|
||||
|
||||
self.retranslateUi(SignalEdit)
|
||||
self.buttonBox.accepted.connect(SignalEdit.accept)
|
||||
self.buttonBox.rejected.connect(SignalEdit.close)
|
||||
QtCore.QMetaObject.connectSlotsByName(SignalEdit)
|
||||
|
||||
def retranslateUi(self, SignalEdit):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
SignalEdit.setWindowTitle(_translate("SignalEdit", "Dialog"))
|
||||
from pyqtgraph import PlotWidget
|
613
src/gui_qt/_py/basewindow.py
Normal file
613
src/gui_qt/_py/basewindow.py
Normal file
@ -0,0 +1,613 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/basewindow.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_BaseWindow(object):
|
||||
def setupUi(self, BaseWindow):
|
||||
BaseWindow.setObjectName("BaseWindow")
|
||||
BaseWindow.resize(1388, 735)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(":/logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
BaseWindow.setWindowIcon(icon)
|
||||
BaseWindow.setDockOptions(QtWidgets.QMainWindow.AllowTabbedDocks|QtWidgets.QMainWindow.AnimatedDocks|QtWidgets.QMainWindow.ForceTabbedDocks|QtWidgets.QMainWindow.VerticalTabs)
|
||||
self.centralwidget = QtWidgets.QWidget(BaseWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
|
||||
self.horizontalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.splitter = QtWidgets.QSplitter(self.centralwidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.splitter)
|
||||
self.tabWidget.setTabPosition(QtWidgets.QTabWidget.West)
|
||||
self.tabWidget.setTabShape(QtWidgets.QTabWidget.Rounded)
|
||||
self.tabWidget.setElideMode(QtCore.Qt.ElideRight)
|
||||
self.tabWidget.setTabsClosable(True)
|
||||
self.tabWidget.setMovable(False)
|
||||
self.tabWidget.setTabBarAutoHide(True)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.datawidget = DataWidget()
|
||||
self.datawidget.setObjectName("datawidget")
|
||||
self.tabWidget.addTab(self.datawidget, "")
|
||||
self.valuewidget = ValueEditWidget()
|
||||
self.valuewidget.setObjectName("valuewidget")
|
||||
icon1 = QtGui.QIcon()
|
||||
icon1.addPixmap(QtGui.QPixmap(":/value_dock"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.tabWidget.addTab(self.valuewidget, icon1, "")
|
||||
self.fit_dialog = QFitDialog()
|
||||
self.fit_dialog.setObjectName("fit_dialog")
|
||||
icon2 = QtGui.QIcon()
|
||||
icon2.addPixmap(QtGui.QPixmap(":/fit_dock"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.tabWidget.addTab(self.fit_dialog, icon2, "")
|
||||
self.editsignalwidget = EditSignalWidget()
|
||||
self.editsignalwidget.setObjectName("editsignalwidget")
|
||||
icon3 = QtGui.QIcon()
|
||||
icon3.addPixmap(QtGui.QPixmap(":/signal_dock"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.tabWidget.addTab(self.editsignalwidget, icon3, "")
|
||||
self.ptsselectwidget = PointSelectWidget()
|
||||
self.ptsselectwidget.setObjectName("ptsselectwidget")
|
||||
icon4 = QtGui.QIcon()
|
||||
icon4.addPixmap(QtGui.QPixmap(":/peakpick_dock"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.tabWidget.addTab(self.ptsselectwidget, icon4, "")
|
||||
self.t1tauwidget = QT1Widget()
|
||||
self.t1tauwidget.setObjectName("t1tauwidget")
|
||||
icon5 = QtGui.QIcon()
|
||||
icon5.addPixmap(QtGui.QPixmap(":/eval_t1_dock"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.tabWidget.addTab(self.t1tauwidget, icon5, "")
|
||||
self.area = QtWidgets.QMdiArea(self.splitter)
|
||||
self.area.setObjectName("area")
|
||||
self.horizontalLayout.addWidget(self.splitter)
|
||||
BaseWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(BaseWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1388, 30))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuFile = QtWidgets.QMenu(self.menubar)
|
||||
self.menuFile.setObjectName("menuFile")
|
||||
self.menuSave = QtWidgets.QMenu(self.menuFile)
|
||||
icon6 = QtGui.QIcon()
|
||||
icon6.addPixmap(QtGui.QPixmap(":/Daleks.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.menuSave.setIcon(icon6)
|
||||
self.menuSave.setSeparatorsCollapsible(True)
|
||||
self.menuSave.setObjectName("menuSave")
|
||||
self.menuData = QtWidgets.QMenu(self.menubar)
|
||||
self.menuData.setObjectName("menuData")
|
||||
self.menuHelp = QtWidgets.QMenu(self.menubar)
|
||||
self.menuHelp.setObjectName("menuHelp")
|
||||
self.menuExtra = QtWidgets.QMenu(self.menubar)
|
||||
self.menuExtra.setObjectName("menuExtra")
|
||||
self.menuNormalize = QtWidgets.QMenu(self.menuExtra)
|
||||
icon7 = QtGui.QIcon()
|
||||
icon7.addPixmap(QtGui.QPixmap(":/normal.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.menuNormalize.setIcon(icon7)
|
||||
self.menuNormalize.setObjectName("menuNormalize")
|
||||
self.menuFit = QtWidgets.QMenu(self.menubar)
|
||||
self.menuFit.setObjectName("menuFit")
|
||||
self.menuMethod = QtWidgets.QMenu(self.menuFit)
|
||||
self.menuMethod.setObjectName("menuMethod")
|
||||
self.menuLimits = QtWidgets.QMenu(self.menuFit)
|
||||
self.menuLimits.setObjectName("menuLimits")
|
||||
self.menuOptions = QtWidgets.QMenu(self.menubar)
|
||||
self.menuOptions.setObjectName("menuOptions")
|
||||
self.menuWindow = QtWidgets.QMenu(self.menubar)
|
||||
self.menuWindow.setObjectName("menuWindow")
|
||||
self.menuView = QtWidgets.QMenu(self.menuWindow)
|
||||
self.menuView.setObjectName("menuView")
|
||||
self.menuNMR = QtWidgets.QMenu(self.menubar)
|
||||
self.menuNMR.setObjectName("menuNMR")
|
||||
self.menuBDS = QtWidgets.QMenu(self.menubar)
|
||||
self.menuBDS.setObjectName("menuBDS")
|
||||
self.menuSpectrum = QtWidgets.QMenu(self.menubar)
|
||||
self.menuSpectrum.setObjectName("menuSpectrum")
|
||||
self.menuStuff = QtWidgets.QMenu(self.menubar)
|
||||
self.menuStuff.setTitle("")
|
||||
self.menuStuff.setObjectName("menuStuff")
|
||||
BaseWindow.setMenuBar(self.menubar)
|
||||
self.toolBar = QtWidgets.QToolBar(BaseWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.toolBar.sizePolicy().hasHeightForWidth())
|
||||
self.toolBar.setSizePolicy(sizePolicy)
|
||||
self.toolBar.setAllowedAreas(QtCore.Qt.AllToolBarAreas)
|
||||
self.toolBar.setIconSize(QtCore.QSize(24, 24))
|
||||
self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
|
||||
self.toolBar.setObjectName("toolBar")
|
||||
BaseWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
||||
self.toolbar_edit = QtWidgets.QToolBar(BaseWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.toolbar_edit.sizePolicy().hasHeightForWidth())
|
||||
self.toolbar_edit.setSizePolicy(sizePolicy)
|
||||
self.toolbar_edit.setIconSize(QtCore.QSize(24, 24))
|
||||
self.toolbar_edit.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
|
||||
self.toolbar_edit.setObjectName("toolbar_edit")
|
||||
BaseWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolbar_edit)
|
||||
self.statusBar = QtWidgets.QStatusBar(BaseWindow)
|
||||
self.statusBar.setObjectName("statusBar")
|
||||
BaseWindow.setStatusBar(self.statusBar)
|
||||
self.toolBar_nmr = QtWidgets.QToolBar(BaseWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.toolBar_nmr.sizePolicy().hasHeightForWidth())
|
||||
self.toolBar_nmr.setSizePolicy(sizePolicy)
|
||||
self.toolBar_nmr.setIconSize(QtCore.QSize(24, 24))
|
||||
self.toolBar_nmr.setObjectName("toolBar_nmr")
|
||||
BaseWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar_nmr)
|
||||
self.toolBar_fit = QtWidgets.QToolBar(BaseWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.toolBar_fit.sizePolicy().hasHeightForWidth())
|
||||
self.toolBar_fit.setSizePolicy(sizePolicy)
|
||||
self.toolBar_fit.setIconSize(QtCore.QSize(24, 24))
|
||||
self.toolBar_fit.setObjectName("toolBar_fit")
|
||||
BaseWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar_fit)
|
||||
self.toolBar_spectrum = QtWidgets.QToolBar(BaseWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.toolBar_spectrum.sizePolicy().hasHeightForWidth())
|
||||
self.toolBar_spectrum.setSizePolicy(sizePolicy)
|
||||
self.toolBar_spectrum.setIconSize(QtCore.QSize(24, 24))
|
||||
self.toolBar_spectrum.setObjectName("toolBar_spectrum")
|
||||
BaseWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar_spectrum)
|
||||
self.toolBar_data = QtWidgets.QToolBar(BaseWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.toolBar_data.sizePolicy().hasHeightForWidth())
|
||||
self.toolBar_data.setSizePolicy(sizePolicy)
|
||||
self.toolBar_data.setIconSize(QtCore.QSize(24, 24))
|
||||
self.toolBar_data.setObjectName("toolBar_data")
|
||||
BaseWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar_data)
|
||||
self.action_close = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("window-close")
|
||||
self.action_close.setIcon(icon)
|
||||
self.action_close.setObjectName("action_close")
|
||||
self.actionExportGraphic = QtWidgets.QAction(BaseWindow)
|
||||
self.actionExportGraphic.setObjectName("actionExportGraphic")
|
||||
self.action_open = QtWidgets.QAction(BaseWindow)
|
||||
self.action_open.setObjectName("action_open")
|
||||
self.actionExportData = QtWidgets.QAction(BaseWindow)
|
||||
self.actionExportData.setObjectName("actionExportData")
|
||||
self.action_calc = QtWidgets.QAction(BaseWindow)
|
||||
self.action_calc.setObjectName("action_calc")
|
||||
self.action_delete_sets = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("edit-delete")
|
||||
self.action_delete_sets.setIcon(icon)
|
||||
self.action_delete_sets.setObjectName("action_delete_sets")
|
||||
self.action_save_fit_parameter = QtWidgets.QAction(BaseWindow)
|
||||
self.action_save_fit_parameter.setObjectName("action_save_fit_parameter")
|
||||
self.action_sort_pts = QtWidgets.QAction(BaseWindow)
|
||||
self.action_sort_pts.setObjectName("action_sort_pts")
|
||||
self.action_reset = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("edit-clear")
|
||||
self.action_reset.setIcon(icon)
|
||||
self.action_reset.setObjectName("action_reset")
|
||||
self.actionDocumentation = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("help-about")
|
||||
self.actionDocumentation.setIcon(icon)
|
||||
self.actionDocumentation.setObjectName("actionDocumentation")
|
||||
self.action_FitWidget = QtWidgets.QAction(BaseWindow)
|
||||
self.action_FitWidget.setObjectName("action_FitWidget")
|
||||
self.action_norm_max = QtWidgets.QAction(BaseWindow)
|
||||
self.action_norm_max.setObjectName("action_norm_max")
|
||||
self.action_norm_first = QtWidgets.QAction(BaseWindow)
|
||||
self.action_norm_first.setObjectName("action_norm_first")
|
||||
self.action_norm_area = QtWidgets.QAction(BaseWindow)
|
||||
self.action_norm_area.setObjectName("action_norm_area")
|
||||
self.action_norm_max_abs = QtWidgets.QAction(BaseWindow)
|
||||
self.action_norm_max_abs.setObjectName("action_norm_max_abs")
|
||||
self.action_norm_last = QtWidgets.QAction(BaseWindow)
|
||||
self.action_norm_last.setObjectName("action_norm_last")
|
||||
self.actionSave = QtWidgets.QAction(BaseWindow)
|
||||
self.actionSave.setObjectName("actionSave")
|
||||
self.actiontoolbar_display = QtWidgets.QAction(BaseWindow)
|
||||
self.actiontoolbar_display.setCheckable(True)
|
||||
self.actiontoolbar_display.setObjectName("actiontoolbar_display")
|
||||
self.actionEdit_toolbars = QtWidgets.QAction(BaseWindow)
|
||||
self.actionEdit_toolbars.setCheckable(True)
|
||||
self.actionEdit_toolbars.setObjectName("actionEdit_toolbars")
|
||||
self.actionAddlines = QtWidgets.QAction(BaseWindow)
|
||||
self.actionAddlines.setObjectName("actionAddlines")
|
||||
self.actionColors = QtWidgets.QAction(BaseWindow)
|
||||
self.actionColors.setObjectName("actionColors")
|
||||
self.actionConcatenate_sets = QtWidgets.QAction(BaseWindow)
|
||||
self.actionConcatenate_sets.setObjectName("actionConcatenate_sets")
|
||||
self.actionShift = QtWidgets.QAction(BaseWindow)
|
||||
self.actionShift.setObjectName("actionShift")
|
||||
self.actionShow_log = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("dialog-information")
|
||||
self.actionShow_log.setIcon(icon)
|
||||
self.actionShow_log.setObjectName("actionShow_log")
|
||||
self.action_create_fit_function = QtWidgets.QAction(BaseWindow)
|
||||
self.action_create_fit_function.setObjectName("action_create_fit_function")
|
||||
self.action_colorcycle = QtWidgets.QAction(BaseWindow)
|
||||
self.action_colorcycle.setObjectName("action_colorcycle")
|
||||
self.actionSave_session = QtWidgets.QAction(BaseWindow)
|
||||
self.actionSave_session.setObjectName("actionSave_session")
|
||||
self.actionMouse_behaviour = QtWidgets.QAction(BaseWindow)
|
||||
self.actionMouse_behaviour.setCheckable(True)
|
||||
self.actionMouse_behaviour.setObjectName("actionMouse_behaviour")
|
||||
self.actionConfiguration = QtWidgets.QAction(BaseWindow)
|
||||
self.actionConfiguration.setObjectName("actionConfiguration")
|
||||
self.actionRefresh = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("view-refresh")
|
||||
self.actionRefresh.setIcon(icon)
|
||||
self.actionRefresh.setObjectName("actionRefresh")
|
||||
self.actionInterpolation = QtWidgets.QAction(BaseWindow)
|
||||
self.actionInterpolation.setObjectName("actionInterpolation")
|
||||
self.actionRunning_values = QtWidgets.QAction(BaseWindow)
|
||||
self.actionRunning_values.setObjectName("actionRunning_values")
|
||||
self.actionFit_parameter_saving = QtWidgets.QAction(BaseWindow)
|
||||
self.actionFit_parameter_saving.setObjectName("actionFit_parameter_saving")
|
||||
self.actionShow_fit_parameter = QtWidgets.QAction(BaseWindow)
|
||||
self.actionShow_fit_parameter.setObjectName("actionShow_fit_parameter")
|
||||
self.actionSkip_points = QtWidgets.QAction(BaseWindow)
|
||||
self.actionSkip_points.setObjectName("actionSkip_points")
|
||||
self.actionGuide_lines = QtWidgets.QAction(BaseWindow)
|
||||
self.actionGuide_lines.setObjectName("actionGuide_lines")
|
||||
self.actionMaximize = QtWidgets.QAction(BaseWindow)
|
||||
self.actionMaximize.setCheckable(True)
|
||||
self.actionMaximize.setVisible(False)
|
||||
self.actionMaximize.setObjectName("actionMaximize")
|
||||
self.actionTile = QtWidgets.QAction(BaseWindow)
|
||||
self.actionTile.setObjectName("actionTile")
|
||||
self.actionMinimize = QtWidgets.QAction(BaseWindow)
|
||||
self.actionMinimize.setCheckable(True)
|
||||
self.actionMinimize.setVisible(False)
|
||||
self.actionMinimize.setObjectName("actionMinimize")
|
||||
self.actionNew_window = QtWidgets.QAction(BaseWindow)
|
||||
self.actionNew_window.setObjectName("actionNew_window")
|
||||
self.actionDelete_window = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("edit-delete")
|
||||
self.actionDelete_window.setIcon(icon)
|
||||
self.actionDelete_window.setObjectName("actionDelete_window")
|
||||
self.actionCascade_windows = QtWidgets.QAction(BaseWindow)
|
||||
self.actionCascade_windows.setObjectName("actionCascade_windows")
|
||||
self.actionNext_window = QtWidgets.QAction(BaseWindow)
|
||||
self.actionNext_window.setObjectName("actionNext_window")
|
||||
self.actionPrevious = QtWidgets.QAction(BaseWindow)
|
||||
self.actionPrevious.setObjectName("actionPrevious")
|
||||
self.t1action = QtWidgets.QAction(BaseWindow)
|
||||
self.t1action.setObjectName("t1action")
|
||||
self.t1tau = QtWidgets.QAction(BaseWindow)
|
||||
self.t1tau.setObjectName("t1tau")
|
||||
self.action_coup_calc = QtWidgets.QAction(BaseWindow)
|
||||
self.action_coup_calc.setObjectName("action_coup_calc")
|
||||
self.action_calc_eps_derivative = QtWidgets.QAction(BaseWindow)
|
||||
self.action_calc_eps_derivative.setObjectName("action_calc_eps_derivative")
|
||||
self.actionOpen_FC = QtWidgets.QAction(BaseWindow)
|
||||
self.actionOpen_FC.setObjectName("actionOpen_FC")
|
||||
self.action_mean_t1 = QtWidgets.QAction(BaseWindow)
|
||||
self.action_mean_t1.setObjectName("action_mean_t1")
|
||||
self.actionFilon = QtWidgets.QAction(BaseWindow)
|
||||
self.actionFilon.setObjectName("actionFilon")
|
||||
self.action_new_set = QtWidgets.QAction(BaseWindow)
|
||||
self.action_new_set.setObjectName("action_new_set")
|
||||
self.action_magnitude = QtWidgets.QAction(BaseWindow)
|
||||
self.action_magnitude.setObjectName("action_magnitude")
|
||||
self.actionCenterMax = QtWidgets.QAction(BaseWindow)
|
||||
self.actionCenterMax.setObjectName("actionCenterMax")
|
||||
self.action_depake = QtWidgets.QAction(BaseWindow)
|
||||
self.action_depake.setObjectName("action_depake")
|
||||
self.action_edit = QtWidgets.QAction(BaseWindow)
|
||||
self.action_edit.setObjectName("action_edit")
|
||||
self.actionPick_position = QtWidgets.QAction(BaseWindow)
|
||||
self.actionPick_position.setObjectName("actionPick_position")
|
||||
self.actionIntegrate = QtWidgets.QAction(BaseWindow)
|
||||
self.actionIntegrate.setObjectName("actionIntegrate")
|
||||
self.actionDerivation = QtWidgets.QAction(BaseWindow)
|
||||
self.actionDerivation.setObjectName("actionDerivation")
|
||||
self.actionIntegration = QtWidgets.QAction(BaseWindow)
|
||||
self.actionIntegration.setObjectName("actionIntegration")
|
||||
self.action_cut = QtWidgets.QAction(BaseWindow)
|
||||
self.action_cut.setObjectName("action_cut")
|
||||
self.actionMove_between_plots = QtWidgets.QAction(BaseWindow)
|
||||
self.actionMove_between_plots.setObjectName("actionMove_between_plots")
|
||||
self.actionBaseline = QtWidgets.QAction(BaseWindow)
|
||||
self.actionBaseline.setObjectName("actionBaseline")
|
||||
self.actionCalculateT1 = QtWidgets.QAction(BaseWindow)
|
||||
self.actionCalculateT1.setObjectName("actionCalculateT1")
|
||||
self.actionChange_datatypes = QtWidgets.QAction(BaseWindow)
|
||||
self.actionChange_datatypes.setObjectName("actionChange_datatypes")
|
||||
self.actionPrint = QtWidgets.QAction(BaseWindow)
|
||||
icon = QtGui.QIcon.fromTheme("document-print")
|
||||
self.actionPrint.setIcon(icon)
|
||||
self.actionPrint.setObjectName("actionPrint")
|
||||
self.action_lm_fit = QtWidgets.QAction(BaseWindow)
|
||||
self.action_lm_fit.setCheckable(True)
|
||||
self.action_lm_fit.setChecked(True)
|
||||
self.action_lm_fit.setObjectName("action_lm_fit")
|
||||
self.action_nm_fit = QtWidgets.QAction(BaseWindow)
|
||||
self.action_nm_fit.setCheckable(True)
|
||||
self.action_nm_fit.setObjectName("action_nm_fit")
|
||||
self.action_odr_fit = QtWidgets.QAction(BaseWindow)
|
||||
self.action_odr_fit.setCheckable(True)
|
||||
self.action_odr_fit.setObjectName("action_odr_fit")
|
||||
self.action_no_range = QtWidgets.QAction(BaseWindow)
|
||||
self.action_no_range.setCheckable(True)
|
||||
self.action_no_range.setChecked(False)
|
||||
self.action_no_range.setObjectName("action_no_range")
|
||||
self.action_x_range = QtWidgets.QAction(BaseWindow)
|
||||
self.action_x_range.setCheckable(True)
|
||||
self.action_x_range.setChecked(True)
|
||||
self.action_x_range.setObjectName("action_x_range")
|
||||
self.action_custom_range = QtWidgets.QAction(BaseWindow)
|
||||
self.action_custom_range.setCheckable(True)
|
||||
self.action_custom_range.setObjectName("action_custom_range")
|
||||
self.actionSnake = QtWidgets.QAction(BaseWindow)
|
||||
self.actionSnake.setObjectName("actionSnake")
|
||||
self.actionFunction_editor = QtWidgets.QAction(BaseWindow)
|
||||
self.actionFunction_editor.setObjectName("actionFunction_editor")
|
||||
self.actionLife = QtWidgets.QAction(BaseWindow)
|
||||
self.actionLife.setObjectName("actionLife")
|
||||
self.actionTetris = QtWidgets.QAction(BaseWindow)
|
||||
self.actionTetris.setObjectName("actionTetris")
|
||||
self.actionUpdate = QtWidgets.QAction(BaseWindow)
|
||||
self.actionUpdate.setObjectName("actionUpdate")
|
||||
self.actionMine = QtWidgets.QAction(BaseWindow)
|
||||
self.actionMine.setObjectName("actionMine")
|
||||
self.menuSave.addAction(self.actionSave)
|
||||
self.menuSave.addAction(self.actionExportGraphic)
|
||||
self.menuSave.addAction(self.action_save_fit_parameter)
|
||||
self.menuFile.addAction(self.action_open)
|
||||
self.menuFile.addAction(self.actionOpen_FC)
|
||||
self.menuFile.addAction(self.menuSave.menuAction())
|
||||
self.menuFile.addSeparator()
|
||||
self.menuFile.addAction(self.actionPrint)
|
||||
self.menuFile.addAction(self.action_reset)
|
||||
self.menuFile.addSeparator()
|
||||
self.menuFile.addAction(self.action_close)
|
||||
self.menuFile.addSeparator()
|
||||
self.menuData.addAction(self.action_new_set)
|
||||
self.menuData.addAction(self.action_delete_sets)
|
||||
self.menuData.addAction(self.actionMove_between_plots)
|
||||
self.menuData.addAction(self.actionConcatenate_sets)
|
||||
self.menuData.addAction(self.actionAddlines)
|
||||
self.menuData.addSeparator()
|
||||
self.menuData.addAction(self.action_sort_pts)
|
||||
self.menuData.addAction(self.actionSkip_points)
|
||||
self.menuData.addSeparator()
|
||||
self.menuData.addAction(self.action_cut)
|
||||
self.menuData.addSeparator()
|
||||
self.menuData.addAction(self.actionChange_datatypes)
|
||||
self.menuHelp.addAction(self.actionDocumentation)
|
||||
self.menuHelp.addAction(self.actionUpdate)
|
||||
self.menuNormalize.addAction(self.action_norm_max)
|
||||
self.menuNormalize.addAction(self.action_norm_max_abs)
|
||||
self.menuNormalize.addSeparator()
|
||||
self.menuNormalize.addAction(self.action_norm_first)
|
||||
self.menuNormalize.addAction(self.action_norm_last)
|
||||
self.menuNormalize.addSeparator()
|
||||
self.menuNormalize.addAction(self.action_norm_area)
|
||||
self.menuExtra.addAction(self.action_mean_t1)
|
||||
self.menuExtra.addSeparator()
|
||||
self.menuExtra.addAction(self.actionFilon)
|
||||
self.menuExtra.addAction(self.actionDerivation)
|
||||
self.menuExtra.addAction(self.actionIntegration)
|
||||
self.menuExtra.addSeparator()
|
||||
self.menuExtra.addAction(self.menuNormalize.menuAction())
|
||||
self.menuExtra.addAction(self.actionInterpolation)
|
||||
self.menuExtra.addAction(self.actionRunning_values)
|
||||
self.menuExtra.addAction(self.actionShift)
|
||||
self.menuExtra.addSeparator()
|
||||
self.menuExtra.addAction(self.action_calc)
|
||||
self.menuMethod.addAction(self.action_lm_fit)
|
||||
self.menuMethod.addAction(self.action_nm_fit)
|
||||
self.menuMethod.addAction(self.action_odr_fit)
|
||||
self.menuLimits.addAction(self.action_no_range)
|
||||
self.menuLimits.addAction(self.action_x_range)
|
||||
self.menuLimits.addAction(self.action_custom_range)
|
||||
self.menuFit.addAction(self.action_FitWidget)
|
||||
self.menuFit.addSeparator()
|
||||
self.menuFit.addAction(self.action_create_fit_function)
|
||||
self.menuFit.addAction(self.actionFunction_editor)
|
||||
self.menuFit.addSeparator()
|
||||
self.menuFit.addAction(self.actionShow_fit_parameter)
|
||||
self.menuFit.addAction(self.menuMethod.menuAction())
|
||||
self.menuFit.addAction(self.menuLimits.menuAction())
|
||||
self.menuOptions.addAction(self.actionMouse_behaviour)
|
||||
self.menuOptions.addSeparator()
|
||||
self.menuOptions.addAction(self.action_colorcycle)
|
||||
self.menuOptions.addAction(self.actionConfiguration)
|
||||
self.menuView.addAction(self.actionTile)
|
||||
self.menuView.addAction(self.actionCascade_windows)
|
||||
self.menuWindow.addAction(self.actionNew_window)
|
||||
self.menuWindow.addAction(self.actionDelete_window)
|
||||
self.menuWindow.addSeparator()
|
||||
self.menuWindow.addAction(self.actionNext_window)
|
||||
self.menuWindow.addAction(self.actionPrevious)
|
||||
self.menuWindow.addAction(self.actionMaximize)
|
||||
self.menuWindow.addAction(self.actionMinimize)
|
||||
self.menuWindow.addAction(self.menuView.menuAction())
|
||||
self.menuWindow.addSeparator()
|
||||
self.menuWindow.addAction(self.actionRefresh)
|
||||
self.menuNMR.addAction(self.t1action)
|
||||
self.menuNMR.addAction(self.actionCalculateT1)
|
||||
self.menuNMR.addAction(self.action_coup_calc)
|
||||
self.menuBDS.addAction(self.action_calc_eps_derivative)
|
||||
self.menuSpectrum.addAction(self.action_magnitude)
|
||||
self.menuSpectrum.addAction(self.actionCenterMax)
|
||||
self.menuSpectrum.addAction(self.action_depake)
|
||||
self.menuSpectrum.addSeparator()
|
||||
self.menuSpectrum.addAction(self.action_edit)
|
||||
self.menuSpectrum.addAction(self.actionBaseline)
|
||||
self.menuSpectrum.addAction(self.actionPick_position)
|
||||
self.menuStuff.addAction(self.actionSnake)
|
||||
self.menuStuff.addAction(self.actionLife)
|
||||
self.menuStuff.addAction(self.actionTetris)
|
||||
self.menuStuff.addAction(self.actionMine)
|
||||
self.menubar.addAction(self.menuFile.menuAction())
|
||||
self.menubar.addAction(self.menuWindow.menuAction())
|
||||
self.menubar.addAction(self.menuData.menuAction())
|
||||
self.menubar.addAction(self.menuExtra.menuAction())
|
||||
self.menubar.addAction(self.menuSpectrum.menuAction())
|
||||
self.menubar.addAction(self.menuFit.menuAction())
|
||||
self.menubar.addAction(self.menuNMR.menuAction())
|
||||
self.menubar.addAction(self.menuBDS.menuAction())
|
||||
self.menubar.addAction(self.menuOptions.menuAction())
|
||||
self.menubar.addAction(self.menuHelp.menuAction())
|
||||
self.menubar.addAction(self.menuStuff.menuAction())
|
||||
self.toolBar.addAction(self.action_open)
|
||||
self.toolBar.addAction(self.actionSave)
|
||||
self.toolBar.addSeparator()
|
||||
self.toolBar.addAction(self.actionMouse_behaviour)
|
||||
self.toolBar.addSeparator()
|
||||
self.toolBar.addAction(self.actionPrevious)
|
||||
self.toolBar.addAction(self.actionNext_window)
|
||||
self.toolbar_edit.addAction(self.action_calc)
|
||||
self.toolbar_edit.addAction(self.action_mean_t1)
|
||||
self.toolbar_edit.addAction(self.actionShift)
|
||||
self.toolBar_nmr.addAction(self.t1action)
|
||||
self.toolBar_nmr.addAction(self.actionCalculateT1)
|
||||
self.toolBar_fit.addAction(self.action_FitWidget)
|
||||
self.toolBar_spectrum.addAction(self.action_edit)
|
||||
self.toolBar_spectrum.addAction(self.actionPick_position)
|
||||
self.toolBar_data.addAction(self.actionConcatenate_sets)
|
||||
self.toolBar_data.addAction(self.action_sort_pts)
|
||||
|
||||
self.retranslateUi(BaseWindow)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
self.action_close.triggered.connect(BaseWindow.close)
|
||||
QtCore.QMetaObject.connectSlotsByName(BaseWindow)
|
||||
|
||||
def retranslateUi(self, BaseWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
BaseWindow.setWindowTitle(_translate("BaseWindow", "Mr. Godot told me to tell you he won\'t come this evening but surely tomorrow."))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.datawidget), _translate("BaseWindow", "Data"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.valuewidget), _translate("BaseWindow", "Values"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.fit_dialog), _translate("BaseWindow", "Fit"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.editsignalwidget), _translate("BaseWindow", "Signals"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.ptsselectwidget), _translate("BaseWindow", "Pick points"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.t1tauwidget), _translate("BaseWindow", "SLR"))
|
||||
self.menuFile.setTitle(_translate("BaseWindow", "&File"))
|
||||
self.menuSave.setTitle(_translate("BaseWindow", "&Save..."))
|
||||
self.menuData.setTitle(_translate("BaseWindow", "&Data"))
|
||||
self.menuHelp.setTitle(_translate("BaseWindow", "&Help"))
|
||||
self.menuExtra.setTitle(_translate("BaseWindow", "Math"))
|
||||
self.menuNormalize.setTitle(_translate("BaseWindow", "&Normalize"))
|
||||
self.menuFit.setTitle(_translate("BaseWindow", "F&it"))
|
||||
self.menuMethod.setTitle(_translate("BaseWindow", "Method"))
|
||||
self.menuLimits.setTitle(_translate("BaseWindow", "Limits"))
|
||||
self.menuOptions.setTitle(_translate("BaseWindow", "Options"))
|
||||
self.menuWindow.setTitle(_translate("BaseWindow", "Plots"))
|
||||
self.menuView.setTitle(_translate("BaseWindow", "View"))
|
||||
self.menuNMR.setTitle(_translate("BaseWindow", "NMR"))
|
||||
self.menuBDS.setTitle(_translate("BaseWindow", "BDS"))
|
||||
self.menuSpectrum.setTitle(_translate("BaseWindow", "Spectrum"))
|
||||
self.toolBar.setWindowTitle(_translate("BaseWindow", "Main"))
|
||||
self.toolbar_edit.setWindowTitle(_translate("BaseWindow", "Math"))
|
||||
self.toolBar_nmr.setWindowTitle(_translate("BaseWindow", "NMR"))
|
||||
self.toolBar_fit.setWindowTitle(_translate("BaseWindow", "Fit"))
|
||||
self.toolBar_spectrum.setWindowTitle(_translate("BaseWindow", "Spectrum"))
|
||||
self.toolBar_data.setWindowTitle(_translate("BaseWindow", "Data"))
|
||||
self.action_close.setText(_translate("BaseWindow", "&Quit"))
|
||||
self.action_close.setShortcut(_translate("BaseWindow", "Ctrl+Q"))
|
||||
self.actionExportGraphic.setText(_translate("BaseWindow", "Export graphic..."))
|
||||
self.actionExportGraphic.setShortcut(_translate("BaseWindow", "Ctrl+Shift+S"))
|
||||
self.action_open.setText(_translate("BaseWindow", "&Open..."))
|
||||
self.action_open.setShortcut(_translate("BaseWindow", "Ctrl+O"))
|
||||
self.actionExportData.setText(_translate("BaseWindow", "Export data..."))
|
||||
self.actionExportData.setShortcut(_translate("BaseWindow", "Ctrl+Shift+S"))
|
||||
self.action_calc.setText(_translate("BaseWindow", "&Evaluate expression..."))
|
||||
self.action_delete_sets.setText(_translate("BaseWindow", "&Delete Set"))
|
||||
self.action_delete_sets.setShortcut(_translate("BaseWindow", "Ctrl+Del"))
|
||||
self.action_save_fit_parameter.setText(_translate("BaseWindow", "Save fit ¶meter..."))
|
||||
self.action_sort_pts.setText(_translate("BaseWindow", "Sort &points"))
|
||||
self.action_reset.setText(_translate("BaseWindow", "&Reset"))
|
||||
self.action_reset.setShortcut(_translate("BaseWindow", "Ctrl+R"))
|
||||
self.actionDocumentation.setText(_translate("BaseWindow", "&Documentation"))
|
||||
self.actionDocumentation.setShortcut(_translate("BaseWindow", "F1"))
|
||||
self.action_FitWidget.setText(_translate("BaseWindow", "Open &Fit"))
|
||||
self.action_FitWidget.setShortcut(_translate("BaseWindow", "Ctrl+F"))
|
||||
self.action_norm_max.setText(_translate("BaseWindow", "&Max"))
|
||||
self.action_norm_first.setText(_translate("BaseWindow", "&First point"))
|
||||
self.action_norm_area.setText(_translate("BaseWindow", "&Area"))
|
||||
self.action_norm_max_abs.setText(_translate("BaseWindow", "Ma&x(Abs)"))
|
||||
self.action_norm_last.setText(_translate("BaseWindow", "&Last point"))
|
||||
self.actionSave.setText(_translate("BaseWindow", "S&ave..."))
|
||||
self.actionSave.setShortcut(_translate("BaseWindow", "Ctrl+S"))
|
||||
self.actiontoolbar_display.setText(_translate("BaseWindow", "&Views"))
|
||||
self.actionEdit_toolbars.setText(_translate("BaseWindow", "&Edit"))
|
||||
self.actionAddlines.setText(_translate("BaseWindow", "Set by function..."))
|
||||
self.actionColors.setText(_translate("BaseWindow", "&Reset color"))
|
||||
self.actionConcatenate_sets.setText(_translate("BaseWindow", "Join sets"))
|
||||
self.actionShift.setText(_translate("BaseWindow", "&Shift/scale..."))
|
||||
self.actionShow_log.setText(_translate("BaseWindow", "&Show log..."))
|
||||
self.action_create_fit_function.setText(_translate("BaseWindow", "&Create fit function..."))
|
||||
self.action_colorcycle.setText(_translate("BaseWindow", "Color cycles..."))
|
||||
self.actionSave_session.setText(_translate("BaseWindow", "Update session"))
|
||||
self.actionMouse_behaviour.setText(_translate("BaseWindow", "Mouse behaviour"))
|
||||
self.actionMouse_behaviour.setToolTip(_translate("BaseWindow", "Switch between zoom and pan in graph."))
|
||||
self.actionConfiguration.setText(_translate("BaseWindow", "Configuration..."))
|
||||
self.actionRefresh.setText(_translate("BaseWindow", "Refresh"))
|
||||
self.actionRefresh.setShortcut(_translate("BaseWindow", "F5"))
|
||||
self.actionInterpolation.setText(_translate("BaseWindow", "Interpolation..."))
|
||||
self.actionRunning_values.setText(_translate("BaseWindow", "Smoothing..."))
|
||||
self.actionFit_parameter_saving.setText(_translate("BaseWindow", "Fit parameter saving..."))
|
||||
self.actionShow_fit_parameter.setText(_translate("BaseWindow", "Parameter..."))
|
||||
self.actionSkip_points.setText(_translate("BaseWindow", "Skip points..."))
|
||||
self.actionGuide_lines.setText(_translate("BaseWindow", "Draw lines..."))
|
||||
self.actionMaximize.setText(_translate("BaseWindow", "Maximize"))
|
||||
self.actionTile.setText(_translate("BaseWindow", "Tile windows"))
|
||||
self.actionMinimize.setText(_translate("BaseWindow", "Minimize"))
|
||||
self.actionNew_window.setText(_translate("BaseWindow", "New plot"))
|
||||
self.actionDelete_window.setText(_translate("BaseWindow", "Delete plot"))
|
||||
self.actionCascade_windows.setText(_translate("BaseWindow", "Cascade windows"))
|
||||
self.actionNext_window.setText(_translate("BaseWindow", "Next"))
|
||||
self.actionNext_window.setShortcut(_translate("BaseWindow", "Alt+Right"))
|
||||
self.actionPrevious.setText(_translate("BaseWindow", "Previous"))
|
||||
self.actionPrevious.setShortcut(_translate("BaseWindow", "Alt+Left"))
|
||||
self.t1action.setText(_translate("BaseWindow", "Evaluate T1 minimum..."))
|
||||
self.t1tau.setText(_translate("BaseWindow", "Calculate T1..."))
|
||||
self.action_coup_calc.setText(_translate("BaseWindow", "Coupling values..."))
|
||||
self.action_calc_eps_derivative.setText(_translate("BaseWindow", "Calculate derivative loss"))
|
||||
self.actionOpen_FC.setText(_translate("BaseWindow", "Read FC data..."))
|
||||
self.action_mean_t1.setText(_translate("BaseWindow", "Convert mean values..."))
|
||||
self.actionFilon.setText(_translate("BaseWindow", "Log FT..."))
|
||||
self.action_new_set.setText(_translate("BaseWindow", "New set"))
|
||||
self.action_magnitude.setText(_translate("BaseWindow", "Calculate magnitude"))
|
||||
self.actionCenterMax.setText(_translate("BaseWindow", "Center on max"))
|
||||
self.action_depake.setText(_translate("BaseWindow", "De-paked spectrum"))
|
||||
self.action_edit.setText(_translate("BaseWindow", "Edit signals..."))
|
||||
self.actionPick_position.setText(_translate("BaseWindow", "Pick points..."))
|
||||
self.actionIntegrate.setText(_translate("BaseWindow", "Integrate"))
|
||||
self.actionDerivation.setText(_translate("BaseWindow", "Differentiation..."))
|
||||
self.actionIntegration.setText(_translate("BaseWindow", "Integration..."))
|
||||
self.action_cut.setText(_translate("BaseWindow", "Cut to visible range"))
|
||||
self.actionMove_between_plots.setText(_translate("BaseWindow", "Move sets..."))
|
||||
self.actionBaseline.setText(_translate("BaseWindow", "Baseline..."))
|
||||
self.actionCalculateT1.setText(_translate("BaseWindow", "Calculate relaxation..."))
|
||||
self.actionChange_datatypes.setText(_translate("BaseWindow", "Change datatypes..."))
|
||||
self.actionPrint.setText(_translate("BaseWindow", "Print..."))
|
||||
self.actionPrint.setShortcut(_translate("BaseWindow", "Ctrl+P"))
|
||||
self.action_lm_fit.setText(_translate("BaseWindow", "Default stuff"))
|
||||
self.action_nm_fit.setText(_translate("BaseWindow", "Nelder-Mead"))
|
||||
self.action_odr_fit.setText(_translate("BaseWindow", "ODR"))
|
||||
self.action_no_range.setText(_translate("BaseWindow", "None"))
|
||||
self.action_x_range.setText(_translate("BaseWindow", "Visible x range"))
|
||||
self.action_custom_range.setText(_translate("BaseWindow", "Custom"))
|
||||
self.actionSnake.setText(_translate("BaseWindow", "Worm"))
|
||||
self.actionFunction_editor.setText(_translate("BaseWindow", "Function editor..."))
|
||||
self.actionLife.setText(_translate("BaseWindow", "Life..."))
|
||||
self.actionTetris.setText(_translate("BaseWindow", "Not Tetris"))
|
||||
self.actionUpdate.setText(_translate("BaseWindow", "Look for updates"))
|
||||
self.actionMine.setText(_translate("BaseWindow", "Mine"))
|
||||
from ..data.datawidget.datawidget import DataWidget
|
||||
from ..data.point_select import PointSelectWidget
|
||||
from ..data.signaledit.editsignalwidget import EditSignalWidget
|
||||
from ..data.valueeditwidget import ValueEditWidget
|
||||
from ..fit.fitwindow import QFitDialog
|
||||
from ..nmr.t1widget import QT1Widget
|
120
src/gui_qt/_py/bdsdialog.py
Normal file
120
src/gui_qt/_py/bdsdialog.py
Normal file
@ -0,0 +1,120 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/bdsdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9.2
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(544, 443)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.listWidget = QtWidgets.QListWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
|
||||
self.listWidget.setSizePolicy(sizePolicy)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.gridLayout.addWidget(self.listWidget, 1, 0, 2, 1)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox_2)
|
||||
self.verticalLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_3.setSpacing(3)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.freq_button = QtWidgets.QRadioButton(self.groupBox_2)
|
||||
self.freq_button.setChecked(True)
|
||||
self.freq_button.setObjectName("freq_button")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(Dialog)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.freq_button)
|
||||
self.verticalLayout_3.addWidget(self.freq_button)
|
||||
self.temp_button = QtWidgets.QRadioButton(self.groupBox_2)
|
||||
self.temp_button.setObjectName("temp_button")
|
||||
self.buttonGroup.addButton(self.temp_button)
|
||||
self.verticalLayout_3.addWidget(self.temp_button)
|
||||
self.gridLayout.addWidget(self.groupBox_2, 1, 1, 1, 1)
|
||||
self.groupBox = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_2.setSpacing(3)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.eps_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.eps_checkBox.setChecked(True)
|
||||
self.eps_checkBox.setObjectName("eps_checkBox")
|
||||
self.verticalLayout_2.addWidget(self.eps_checkBox)
|
||||
self.modul_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.modul_checkBox.setObjectName("modul_checkBox")
|
||||
self.verticalLayout_2.addWidget(self.modul_checkBox)
|
||||
self.cond_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.cond_checkBox.setObjectName("cond_checkBox")
|
||||
self.verticalLayout_2.addWidget(self.cond_checkBox)
|
||||
self.loss_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.loss_checkBox.setObjectName("loss_checkBox")
|
||||
self.verticalLayout_2.addWidget(self.loss_checkBox)
|
||||
self.line = QtWidgets.QFrame(self.groupBox)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.verticalLayout_2.addWidget(self.line)
|
||||
self.cap_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.cap_checkBox.setObjectName("cap_checkBox")
|
||||
self.verticalLayout_2.addWidget(self.cap_checkBox)
|
||||
self.temp_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.temp_checkBox.setObjectName("temp_checkBox")
|
||||
self.verticalLayout_2.addWidget(self.temp_checkBox)
|
||||
self.time_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.time_checkBox.setObjectName("time_checkBox")
|
||||
self.verticalLayout_2.addWidget(self.time_checkBox)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.gridLayout.addWidget(self.groupBox, 2, 1, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 2)
|
||||
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.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 2)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
Dialog.setTabOrder(self.freq_button, self.temp_button)
|
||||
Dialog.setTabOrder(self.temp_button, self.eps_checkBox)
|
||||
Dialog.setTabOrder(self.eps_checkBox, self.modul_checkBox)
|
||||
Dialog.setTabOrder(self.modul_checkBox, self.cond_checkBox)
|
||||
Dialog.setTabOrder(self.cond_checkBox, self.listWidget)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Read BDS data"))
|
||||
self.groupBox_2.setTitle(_translate("Dialog", "X Axis"))
|
||||
self.freq_button.setText(_translate("Dialog", "Frequency"))
|
||||
self.temp_button.setText(_translate("Dialog", "Temperature"))
|
||||
self.groupBox.setTitle(_translate("Dialog", "Y Axis"))
|
||||
self.eps_checkBox.setText(_translate("Dialog", "Permittivity ε"))
|
||||
self.modul_checkBox.setText(_translate("Dialog", "Modulus 1/ε"))
|
||||
self.cond_checkBox.setText(_translate("Dialog", "Conductivity iεω"))
|
||||
self.loss_checkBox.setText(_translate("Dialog", "Loss factor tan(δ)"))
|
||||
self.cap_checkBox.setText(_translate("Dialog", "Capacity"))
|
||||
self.temp_checkBox.setText(_translate("Dialog", "Meas. temperature"))
|
||||
self.time_checkBox.setText(_translate("Dialog", "Meas. time"))
|
||||
self.label.setText(_translate("Dialog", "Found entries"))
|
||||
|
104
src/gui_qt/_py/color_palette.py
Normal file
104
src/gui_qt/_py/color_palette.py
Normal file
@ -0,0 +1,104 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/color_palette.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(390, 409)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.palette_combobox = QtWidgets.QComboBox(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.palette_combobox.sizePolicy().hasHeightForWidth())
|
||||
self.palette_combobox.setSizePolicy(sizePolicy)
|
||||
self.palette_combobox.setObjectName("palette_combobox")
|
||||
self.gridLayout.addWidget(self.palette_combobox, 0, 1, 1, 2)
|
||||
self.add_color_button = QtWidgets.QPushButton(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.add_color_button.sizePolicy().hasHeightForWidth())
|
||||
self.add_color_button.setSizePolicy(sizePolicy)
|
||||
self.add_color_button.setObjectName("add_color_button")
|
||||
self.gridLayout.addWidget(self.add_color_button, 3, 2, 1, 1)
|
||||
self.colorlist = QtWidgets.QListWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.colorlist.sizePolicy().hasHeightForWidth())
|
||||
self.colorlist.setSizePolicy(sizePolicy)
|
||||
self.colorlist.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove)
|
||||
self.colorlist.setObjectName("colorlist")
|
||||
self.gridLayout.addWidget(self.colorlist, 4, 1, 1, 2)
|
||||
self.add_palette_button = QtWidgets.QPushButton(Dialog)
|
||||
self.add_palette_button.setObjectName("add_palette_button")
|
||||
self.gridLayout.addWidget(self.add_palette_button, 1, 1, 1, 1)
|
||||
self.new_name_edit = QtWidgets.QLineEdit(Dialog)
|
||||
self.new_name_edit.setObjectName("new_name_edit")
|
||||
self.gridLayout.addWidget(self.new_name_edit, 6, 1, 1, 2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 7, 0, 1, 3)
|
||||
self.color_combobox = ColorListEditor(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.color_combobox.sizePolicy().hasHeightForWidth())
|
||||
self.color_combobox.setSizePolicy(sizePolicy)
|
||||
self.color_combobox.setObjectName("color_combobox")
|
||||
self.gridLayout.addWidget(self.color_combobox, 3, 1, 1, 1)
|
||||
self.line = QtWidgets.QFrame(Dialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 2, 0, 1, 3)
|
||||
self.save_button = QtWidgets.QPushButton(Dialog)
|
||||
self.save_button.setObjectName("save_button")
|
||||
self.gridLayout.addWidget(self.save_button, 6, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.append_palette_button = QtWidgets.QPushButton(Dialog)
|
||||
self.append_palette_button.setObjectName("append_palette_button")
|
||||
self.gridLayout.addWidget(self.append_palette_button, 1, 2, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 3, 0, 1, 1)
|
||||
self.line_2 = QtWidgets.QFrame(Dialog)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout.addWidget(self.line_2, 5, 0, 1, 3)
|
||||
self.label.setBuddy(self.palette_combobox)
|
||||
self.label_2.setBuddy(self.color_combobox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Color cycles"))
|
||||
self.add_color_button.setText(_translate("Dialog", "Add color"))
|
||||
self.add_palette_button.setText(_translate("Dialog", "Load"))
|
||||
self.save_button.setText(_translate("Dialog", "Save as new list"))
|
||||
self.label.setText(_translate("Dialog", "Color cycles"))
|
||||
self.append_palette_button.setText(_translate("Dialog", "Append"))
|
||||
self.label_2.setText(_translate("Dialog", "Available color"))
|
||||
from ..lib.delegates import ColorListEditor
|
57
src/gui_qt/_py/coupling_calculator.py
Normal file
57
src/gui_qt/_py/coupling_calculator.py
Normal file
@ -0,0 +1,57 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/coupling_calculator.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_coupling_calc_dialog(object):
|
||||
def setupUi(self, coupling_calc_dialog):
|
||||
coupling_calc_dialog.setObjectName("coupling_calc_dialog")
|
||||
coupling_calc_dialog.resize(400, 280)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(coupling_calc_dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.comboBox = QtWidgets.QComboBox(coupling_calc_dialog)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.verticalLayout.addWidget(self.comboBox)
|
||||
self.label_2 = QtWidgets.QLabel(coupling_calc_dialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
self.verticalFrame = QtWidgets.QFrame(coupling_calc_dialog)
|
||||
self.verticalFrame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.verticalFrame.setObjectName("verticalFrame")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalFrame)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.verticalLayout.addWidget(self.verticalFrame)
|
||||
self.label = QtWidgets.QLabel(coupling_calc_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.setStyleSheet("font-weight: bold")
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(coupling_calc_dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(coupling_calc_dialog)
|
||||
self.buttonBox.accepted.connect(coupling_calc_dialog.accept)
|
||||
self.buttonBox.rejected.connect(coupling_calc_dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(coupling_calc_dialog)
|
||||
|
||||
def retranslateUi(self, coupling_calc_dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
coupling_calc_dialog.setWindowTitle(_translate("coupling_calc_dialog", "Calculate BPP coupling constants"))
|
||||
self.label_2.setText(_translate("coupling_calc_dialog", "TextLabel"))
|
||||
self.label.setText(_translate("coupling_calc_dialog", "TextLabel"))
|
46
src/gui_qt/_py/coupling_t1_from_tau.py
Normal file
46
src/gui_qt/_py/coupling_t1_from_tau.py
Normal file
@ -0,0 +1,46 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/coupling_t1_from_tau.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_couplingForm(object):
|
||||
def setupUi(self, couplingForm):
|
||||
couplingForm.setObjectName("couplingForm")
|
||||
couplingForm.resize(400, 300)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(couplingForm)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(couplingForm)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.lineEdit = LineEdit(couplingForm)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.radioButton_2 = QtWidgets.QRadioButton(couplingForm)
|
||||
self.radioButton_2.setChecked(True)
|
||||
self.radioButton_2.setObjectName("radioButton_2")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(couplingForm)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.radioButton_2)
|
||||
self.horizontalLayout.addWidget(self.radioButton_2)
|
||||
self.radioButton = QtWidgets.QRadioButton(couplingForm)
|
||||
self.radioButton.setObjectName("radioButton")
|
||||
self.buttonGroup.addButton(self.radioButton)
|
||||
self.horizontalLayout.addWidget(self.radioButton)
|
||||
|
||||
self.retranslateUi(couplingForm)
|
||||
QtCore.QMetaObject.connectSlotsByName(couplingForm)
|
||||
|
||||
def retranslateUi(self, couplingForm):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
couplingForm.setWindowTitle(_translate("couplingForm", "Form"))
|
||||
self.label.setText(_translate("couplingForm", "parameter_name"))
|
||||
self.radioButton_2.setText(_translate("couplingForm", "Value"))
|
||||
self.radioButton.setText(_translate("couplingForm", "Index"))
|
||||
from nmrevalgui.lib.forms import LineEdit
|
64
src/gui_qt/_py/datawidget.py
Normal file
64
src/gui_qt/_py/datawidget.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/datawidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_DataWidget(object):
|
||||
def setupUi(self, DataWidget):
|
||||
DataWidget.setObjectName("DataWidget")
|
||||
DataWidget.resize(307, 847)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(DataWidget)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_2.setSpacing(3)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout)
|
||||
self.propwidget = ExpandableWidget(DataWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.propwidget.sizePolicy().hasHeightForWidth())
|
||||
self.propwidget.setSizePolicy(sizePolicy)
|
||||
self.propwidget.setObjectName("propwidget")
|
||||
self.verticalLayout_2.addWidget(self.propwidget)
|
||||
self.frame = QtWidgets.QFrame(DataWidget)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.graph_toolButton = QtWidgets.QToolButton(self.frame)
|
||||
self.graph_toolButton.setObjectName("graph_toolButton")
|
||||
self.horizontalLayout.addWidget(self.graph_toolButton)
|
||||
self.empty_toolButton = QtWidgets.QToolButton(self.frame)
|
||||
self.empty_toolButton.setObjectName("empty_toolButton")
|
||||
self.horizontalLayout.addWidget(self.empty_toolButton)
|
||||
self.func_toolButton = QtWidgets.QToolButton(self.frame)
|
||||
self.func_toolButton.setText("")
|
||||
self.func_toolButton.setObjectName("func_toolButton")
|
||||
self.horizontalLayout.addWidget(self.func_toolButton)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.verticalLayout_2.addWidget(self.frame)
|
||||
|
||||
self.retranslateUi(DataWidget)
|
||||
QtCore.QMetaObject.connectSlotsByName(DataWidget)
|
||||
|
||||
def retranslateUi(self, DataWidget):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
DataWidget.setWindowTitle(_translate("DataWidget", "Data"))
|
||||
self.graph_toolButton.setToolTip(_translate("DataWidget", "New graph"))
|
||||
self.graph_toolButton.setText(_translate("DataWidget", "New graph"))
|
||||
self.empty_toolButton.setToolTip(_translate("DataWidget", "New set"))
|
||||
self.empty_toolButton.setText(_translate("DataWidget", "Empty set"))
|
||||
from ..lib.expandablewidget import ExpandableWidget
|
213
src/gui_qt/_py/dscfile_dialog.py
Normal file
213
src/gui_qt/_py/dscfile_dialog.py
Normal file
@ -0,0 +1,213 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/dscfile_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9.2
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(962, 662)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Save)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout_2.addWidget(self.buttonBox, 1, 1, 1, 1)
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout()
|
||||
self.gridLayout_4.setContentsMargins(-1, 0, 0, -1)
|
||||
self.gridLayout_4.setSpacing(3)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.cp_checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.cp_checkBox.sizePolicy().hasHeightForWidth())
|
||||
self.cp_checkBox.setSizePolicy(sizePolicy)
|
||||
self.cp_checkBox.setChecked(True)
|
||||
self.cp_checkBox.setObjectName("cp_checkBox")
|
||||
self.gridLayout_4.addWidget(self.cp_checkBox, 11, 0, 1, 4)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.loadempty_button = QtWidgets.QPushButton(Dialog)
|
||||
self.loadempty_button.setObjectName("loadempty_button")
|
||||
self.horizontalLayout_2.addWidget(self.loadempty_button)
|
||||
self.delempty_button = QtWidgets.QPushButton(Dialog)
|
||||
self.delempty_button.setObjectName("delempty_button")
|
||||
self.horizontalLayout_2.addWidget(self.delempty_button)
|
||||
self.gridLayout_4.addLayout(self.horizontalLayout_2, 5, 0, 1, 4)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_4.addItem(spacerItem, 12, 0, 1, 1)
|
||||
self.isotherm_radioButton = QtWidgets.QRadioButton(Dialog)
|
||||
self.isotherm_radioButton.setChecked(True)
|
||||
self.isotherm_radioButton.setObjectName("isotherm_radioButton")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(Dialog)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.isotherm_radioButton)
|
||||
self.gridLayout_4.addWidget(self.isotherm_radioButton, 6, 1, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
|
||||
self.label_4.setSizePolicy(sizePolicy)
|
||||
self.label_4.setStyleSheet("font-weight: bold")
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout_4.addWidget(self.label_4, 0, 0, 1, 4)
|
||||
self.reference_tableWidget = QtWidgets.QTableWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.reference_tableWidget.sizePolicy().hasHeightForWidth())
|
||||
self.reference_tableWidget.setSizePolicy(sizePolicy)
|
||||
self.reference_tableWidget.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.reference_tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
|
||||
self.reference_tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.reference_tableWidget.setColumnCount(2)
|
||||
self.reference_tableWidget.setObjectName("reference_tableWidget")
|
||||
self.reference_tableWidget.setRowCount(0)
|
||||
self.reference_tableWidget.horizontalHeader().setVisible(False)
|
||||
self.reference_tableWidget.horizontalHeader().setStretchLastSection(True)
|
||||
self.reference_tableWidget.verticalHeader().setVisible(False)
|
||||
self.gridLayout_4.addWidget(self.reference_tableWidget, 9, 0, 1, 4)
|
||||
self.step_listWidget = QtWidgets.QListWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.step_listWidget.sizePolicy().hasHeightForWidth())
|
||||
self.step_listWidget.setSizePolicy(sizePolicy)
|
||||
self.step_listWidget.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.step_listWidget.setObjectName("step_listWidget")
|
||||
self.gridLayout_4.addWidget(self.step_listWidget, 1, 0, 1, 4)
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_4.addWidget(self.label, 6, 0, 1, 1)
|
||||
self.slope_radioButton = QtWidgets.QRadioButton(Dialog)
|
||||
self.slope_radioButton.setObjectName("slope_radioButton")
|
||||
self.buttonGroup.addButton(self.slope_radioButton)
|
||||
self.gridLayout_4.addWidget(self.slope_radioButton, 6, 2, 1, 1)
|
||||
self.empty_label = QtWidgets.QLabel(Dialog)
|
||||
self.empty_label.setObjectName("empty_label")
|
||||
self.gridLayout_4.addWidget(self.empty_label, 4, 0, 1, 4)
|
||||
self.label_3 = QtWidgets.QLabel(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
|
||||
self.label_3.setSizePolicy(sizePolicy)
|
||||
self.label_3.setStyleSheet("font-weight: bold")
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout_4.addWidget(self.label_3, 8, 0, 1, 4)
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setStyleSheet("font-weight: bold")
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout_4.addWidget(self.label_2, 3, 0, 1, 4)
|
||||
self.line = QtWidgets.QFrame(Dialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout_4.addWidget(self.line, 7, 0, 1, 4)
|
||||
self.none_radioButton = QtWidgets.QRadioButton(Dialog)
|
||||
self.none_radioButton.setObjectName("none_radioButton")
|
||||
self.buttonGroup.addButton(self.none_radioButton)
|
||||
self.gridLayout_4.addWidget(self.none_radioButton, 6, 3, 1, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.ref_add_pushButton = QtWidgets.QPushButton(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.ref_add_pushButton.sizePolicy().hasHeightForWidth())
|
||||
self.ref_add_pushButton.setSizePolicy(sizePolicy)
|
||||
self.ref_add_pushButton.setObjectName("ref_add_pushButton")
|
||||
self.horizontalLayout.addWidget(self.ref_add_pushButton)
|
||||
self.ref_remove_pushButton = QtWidgets.QPushButton(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.ref_remove_pushButton.sizePolicy().hasHeightForWidth())
|
||||
self.ref_remove_pushButton.setSizePolicy(sizePolicy)
|
||||
self.ref_remove_pushButton.setObjectName("ref_remove_pushButton")
|
||||
self.horizontalLayout.addWidget(self.ref_remove_pushButton)
|
||||
self.gridLayout_4.addLayout(self.horizontalLayout, 10, 0, 1, 4)
|
||||
self.line_2 = QtWidgets.QFrame(Dialog)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout_4.addWidget(self.line_2, 2, 0, 1, 4)
|
||||
self.gridLayout_2.addLayout(self.gridLayout_4, 0, 0, 1, 1)
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.raw_graph = PlotWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.raw_graph.sizePolicy().hasHeightForWidth())
|
||||
self.raw_graph.setSizePolicy(sizePolicy)
|
||||
self.raw_graph.setMinimumSize(QtCore.QSize(300, 200))
|
||||
self.raw_graph.setObjectName("raw_graph")
|
||||
self.gridLayout.addWidget(self.raw_graph, 0, 0, 1, 1)
|
||||
self.calib_graph = PlotWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.calib_graph.sizePolicy().hasHeightForWidth())
|
||||
self.calib_graph.setSizePolicy(sizePolicy)
|
||||
self.calib_graph.setMinimumSize(QtCore.QSize(300, 200))
|
||||
self.calib_graph.setObjectName("calib_graph")
|
||||
self.gridLayout.addWidget(self.calib_graph, 1, 0, 1, 1)
|
||||
self.baseline_graph = PlotWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.baseline_graph.sizePolicy().hasHeightForWidth())
|
||||
self.baseline_graph.setSizePolicy(sizePolicy)
|
||||
self.baseline_graph.setMinimumSize(QtCore.QSize(300, 200))
|
||||
self.baseline_graph.setObjectName("baseline_graph")
|
||||
self.gridLayout.addWidget(self.baseline_graph, 0, 1, 1, 1)
|
||||
self.end_graph = PlotWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.end_graph.sizePolicy().hasHeightForWidth())
|
||||
self.end_graph.setSizePolicy(sizePolicy)
|
||||
self.end_graph.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.end_graph.setObjectName("end_graph")
|
||||
self.gridLayout.addWidget(self.end_graph, 1, 1, 1, 1)
|
||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Read DSC file"))
|
||||
self.cp_checkBox.setText(_translate("Dialog", "Convert to heat capacity"))
|
||||
self.loadempty_button.setText(_translate("Dialog", "Load empty"))
|
||||
self.delempty_button.setText(_translate("Dialog", "Remove empty"))
|
||||
self.isotherm_radioButton.setText(_translate("Dialog", "Isotherms"))
|
||||
self.label_4.setText(_translate("Dialog", "Detected steps"))
|
||||
self.label.setText(_translate("Dialog", "Slope"))
|
||||
self.slope_radioButton.setText(_translate("Dialog", "Initial slope"))
|
||||
self.empty_label.setText(_translate("Dialog", "Empty measurement"))
|
||||
self.label_3.setText(_translate("Dialog", "Calibration"))
|
||||
self.label_2.setText(_translate("Dialog", "Baseline"))
|
||||
self.none_radioButton.setText(_translate("Dialog", "None"))
|
||||
self.ref_add_pushButton.setText(_translate("Dialog", "Add reference"))
|
||||
self.ref_remove_pushButton.setText(_translate("Dialog", "Remove reference"))
|
||||
|
||||
from pyqtgraph import PlotWidget
|
185
src/gui_qt/_py/editsignalwidget.py
Normal file
185
src/gui_qt/_py/editsignalwidget.py
Normal file
@ -0,0 +1,185 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/editsignalwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(328, 732)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.groupBox_4 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_4.setObjectName("groupBox_4")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.groupBox_4)
|
||||
self.horizontalLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.baselinebutton = QtWidgets.QPushButton(self.groupBox_4)
|
||||
self.baselinebutton.setObjectName("baselinebutton")
|
||||
self.horizontalLayout_3.addWidget(self.baselinebutton)
|
||||
self.verticalLayout.addWidget(self.groupBox_4)
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox)
|
||||
self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.leftshiftbutton = QtWidgets.QPushButton(self.groupBox)
|
||||
self.leftshiftbutton.setObjectName("leftshiftbutton")
|
||||
self.gridLayout_3.addWidget(self.leftshiftbutton, 1, 0, 1, 2)
|
||||
self.comboBox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.gridLayout_3.addWidget(self.comboBox, 0, 0, 1, 1)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.lsspinBox = QtWidgets.QSpinBox(self.groupBox)
|
||||
self.lsspinBox.setMaximum(9999)
|
||||
self.lsspinBox.setObjectName("lsspinBox")
|
||||
self.verticalLayout_2.addWidget(self.lsspinBox)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.verticalLayout_2.addWidget(self.lineEdit)
|
||||
self.gridLayout_3.addLayout(self.verticalLayout_2, 0, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox)
|
||||
self.groupBox_6 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_6.setFlat(False)
|
||||
self.groupBox_6.setObjectName("groupBox_6")
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.groupBox_6)
|
||||
self.horizontalLayout_4.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.zfbutton = QtWidgets.QPushButton(self.groupBox_6)
|
||||
self.zfbutton.setObjectName("zfbutton")
|
||||
self.horizontalLayout_4.addWidget(self.zfbutton)
|
||||
self.verticalLayout.addWidget(self.groupBox_6)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_2.setFlat(False)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_2)
|
||||
self.gridLayout_4.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_4.setVerticalSpacing(0)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.ph1slider = QtWidgets.QDoubleSpinBox(self.groupBox_2)
|
||||
self.ph1slider.setMinimum(-360.0)
|
||||
self.ph1slider.setMaximum(360.0)
|
||||
self.ph1slider.setWrapping(True)
|
||||
self.ph1slider.setObjectName("ph1slider")
|
||||
self.gridLayout_4.addWidget(self.ph1slider, 5, 1, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout_4.addWidget(self.label_6, 4, 0, 3, 1)
|
||||
self.pushButton_2 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.gridLayout_4.addWidget(self.pushButton_2, 8, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_4.addWidget(self.label, 1, 0, 3, 1)
|
||||
self.pivot_lineedit = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pivot_lineedit.sizePolicy().hasHeightForWidth())
|
||||
self.pivot_lineedit.setSizePolicy(sizePolicy)
|
||||
self.pivot_lineedit.setInputMethodHints(QtCore.Qt.ImhDigitsOnly)
|
||||
self.pivot_lineedit.setObjectName("pivot_lineedit")
|
||||
self.gridLayout_4.addWidget(self.pivot_lineedit, 7, 1, 1, 1)
|
||||
self.ph0slider = QtWidgets.QDoubleSpinBox(self.groupBox_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.ph0slider.sizePolicy().hasHeightForWidth())
|
||||
self.ph0slider.setSizePolicy(sizePolicy)
|
||||
self.ph0slider.setMinimum(-180.0)
|
||||
self.ph0slider.setMaximum(180.0)
|
||||
self.ph0slider.setWrapping(True)
|
||||
self.ph0slider.setObjectName("ph0slider")
|
||||
self.gridLayout_4.addWidget(self.ph0slider, 2, 1, 1, 1)
|
||||
self.label_8 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.gridLayout_4.addWidget(self.label_8, 7, 0, 1, 1)
|
||||
self.phasebutton = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.phasebutton.setObjectName("phasebutton")
|
||||
self.gridLayout_4.addWidget(self.phasebutton, 8, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox_2)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.groupBox_3.sizePolicy().hasHeightForWidth())
|
||||
self.groupBox_3.setSizePolicy(sizePolicy)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.groupBox_3)
|
||||
self.verticalLayout_7.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_7.setObjectName("verticalLayout_7")
|
||||
self.apodcombobox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.apodcombobox.setObjectName("apodcombobox")
|
||||
self.verticalLayout_7.addWidget(self.apodcombobox)
|
||||
self.label_2 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_2.setIndent(3)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout_7.addWidget(self.label_2)
|
||||
self.verticalLayout_8 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_8.setSpacing(0)
|
||||
self.verticalLayout_8.setObjectName("verticalLayout_8")
|
||||
self.verticalLayout_7.addLayout(self.verticalLayout_8)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.pushButton = QtWidgets.QPushButton(self.groupBox_3)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.horizontalLayout.addWidget(self.pushButton)
|
||||
self.apodbutton = QtWidgets.QPushButton(self.groupBox_3)
|
||||
self.apodbutton.setObjectName("apodbutton")
|
||||
self.horizontalLayout.addWidget(self.apodbutton)
|
||||
self.verticalLayout_7.addLayout(self.horizontalLayout)
|
||||
self.verticalLayout.addWidget(self.groupBox_3)
|
||||
self.groupBox_5 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_5.setObjectName("groupBox_5")
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.groupBox_5)
|
||||
self.horizontalLayout_5.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.fourierutton = QtWidgets.QPushButton(self.groupBox_5)
|
||||
self.fourierutton.setObjectName("fourierutton")
|
||||
self.horizontalLayout_5.addWidget(self.fourierutton)
|
||||
self.verticalLayout.addWidget(self.groupBox_5)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.groupBox_4.setTitle(_translate("Form", "Baseline correction"))
|
||||
self.baselinebutton.setText(_translate("Form", "Apply"))
|
||||
self.groupBox.setTitle(_translate("Form", "Left shift"))
|
||||
self.leftshiftbutton.setText(_translate("Form", "Apply"))
|
||||
self.comboBox.setItemText(0, _translate("Form", "Points"))
|
||||
self.comboBox.setItemText(1, _translate("Form", "Seconds"))
|
||||
self.groupBox_6.setTitle(_translate("Form", "Zerofilling"))
|
||||
self.zfbutton.setText(_translate("Form", "Apply"))
|
||||
self.groupBox_2.setTitle(_translate("Form", "Phase correction"))
|
||||
self.label_6.setText(_translate("Form", "Phase 1"))
|
||||
self.pushButton_2.setText(_translate("Form", "Preview"))
|
||||
self.label.setText(_translate("Form", "Phase 0"))
|
||||
self.pivot_lineedit.setText(_translate("Form", "0"))
|
||||
self.label_8.setText(_translate("Form", "Pivot"))
|
||||
self.phasebutton.setText(_translate("Form", "Apply"))
|
||||
self.groupBox_3.setTitle(_translate("Form", "Apodization"))
|
||||
self.label_2.setText(_translate("Form", "TextLabel"))
|
||||
self.pushButton.setText(_translate("Form", "Preview"))
|
||||
self.apodbutton.setText(_translate("Form", "Apply"))
|
||||
self.groupBox_5.setTitle(_translate("Form", "FFT"))
|
||||
self.fourierutton.setText(_translate("Form", "Apply"))
|
240
src/gui_qt/_py/eval_expr_dialog.py
Normal file
240
src/gui_qt/_py/eval_expr_dialog.py
Normal file
@ -0,0 +1,240 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/eval_expr_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_CalcDialog(object):
|
||||
def setupUi(self, CalcDialog):
|
||||
CalcDialog.setObjectName("CalcDialog")
|
||||
CalcDialog.setWindowModality(QtCore.Qt.WindowModal)
|
||||
CalcDialog.resize(804, 627)
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(CalcDialog)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.splitter_2 = QtWidgets.QSplitter(CalcDialog)
|
||||
self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter_2.setObjectName("splitter_2")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.splitter_2)
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(self.verticalLayoutWidget)
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setObjectName("page")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.page)
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.page)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout_2.addWidget(self.label_2)
|
||||
self.listWidget = QtWidgets.QListWidget(self.page)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
|
||||
self.listWidget.setSizePolicy(sizePolicy)
|
||||
self.listWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.listWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.verticalLayout_2.addWidget(self.listWidget)
|
||||
self.overwrite_checkbox = QtWidgets.QCheckBox(self.page)
|
||||
self.overwrite_checkbox.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.overwrite_checkbox.setObjectName("overwrite_checkbox")
|
||||
self.verticalLayout_2.addWidget(self.overwrite_checkbox)
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.page_2)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(self.page_2)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.formLayout_3 = QtWidgets.QFormLayout(self.groupBox_2)
|
||||
self.formLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.formLayout_3.setHorizontalSpacing(3)
|
||||
self.formLayout_3.setObjectName("formLayout_3")
|
||||
self.label_3 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_3)
|
||||
self.label_lineEdit = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.label_lineEdit.setObjectName("label_lineEdit")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.label_lineEdit)
|
||||
self.label_9 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_9)
|
||||
self.value_lineEdit = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.value_lineEdit.setObjectName("value_lineEdit")
|
||||
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.value_lineEdit)
|
||||
self.label_6 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_6)
|
||||
self.dtype_comboBox = QtWidgets.QComboBox(self.groupBox_2)
|
||||
self.dtype_comboBox.setObjectName("dtype_comboBox")
|
||||
self.dtype_comboBox.addItem("")
|
||||
self.dtype_comboBox.addItem("")
|
||||
self.dtype_comboBox.addItem("")
|
||||
self.dtype_comboBox.addItem("")
|
||||
self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.dtype_comboBox)
|
||||
self.verticalLayout_4.addWidget(self.groupBox_2)
|
||||
self.groupBox = QtWidgets.QGroupBox(self.page_2)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.formLayout_2 = QtWidgets.QFormLayout(self.groupBox)
|
||||
self.formLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.formLayout_2.setSpacing(3)
|
||||
self.formLayout_2.setObjectName("formLayout_2")
|
||||
self.label_4 = QtWidgets.QLabel(self.groupBox)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_4)
|
||||
self.symcolor_comboBox = ColorListEditor(self.groupBox)
|
||||
self.symcolor_comboBox.setObjectName("symcolor_comboBox")
|
||||
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.symcolor_comboBox)
|
||||
self.label_5 = QtWidgets.QLabel(self.groupBox)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_5)
|
||||
self.symbol_spinBox = QtWidgets.QSpinBox(self.groupBox)
|
||||
self.symbol_spinBox.setProperty("value", 10)
|
||||
self.symbol_spinBox.setObjectName("symbol_spinBox")
|
||||
self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.symbol_spinBox)
|
||||
self.symbol_comboBox = SymbolStyleEditor(self.groupBox)
|
||||
self.symbol_comboBox.setObjectName("symbol_comboBox")
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.symbol_comboBox)
|
||||
self.label_10 = QtWidgets.QLabel(self.groupBox)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_10)
|
||||
self.verticalLayout_4.addWidget(self.groupBox)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(self.page_2)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.formLayout = QtWidgets.QFormLayout(self.groupBox_3)
|
||||
self.formLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.formLayout.setSpacing(3)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label_7 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_7)
|
||||
self.linecolor_comboBox = ColorListEditor(self.groupBox_3)
|
||||
self.linecolor_comboBox.setObjectName("linecolor_comboBox")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.linecolor_comboBox)
|
||||
self.label_8 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_8)
|
||||
self.line_doubleSpinBox = QtWidgets.QDoubleSpinBox(self.groupBox_3)
|
||||
self.line_doubleSpinBox.setProperty("value", 1.0)
|
||||
self.line_doubleSpinBox.setObjectName("line_doubleSpinBox")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.line_doubleSpinBox)
|
||||
self.linestyle_comboBox = LineStyleEditor(self.groupBox_3)
|
||||
self.linestyle_comboBox.setObjectName("linestyle_comboBox")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.linestyle_comboBox)
|
||||
self.label_11 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_11.setObjectName("label_11")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_11)
|
||||
self.verticalLayout_4.addWidget(self.groupBox_3)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_4.addItem(spacerItem)
|
||||
self.graph_comboBox = QtWidgets.QComboBox(self.page_2)
|
||||
self.graph_comboBox.setObjectName("graph_comboBox")
|
||||
self.verticalLayout_4.addWidget(self.graph_comboBox)
|
||||
self.groupBox.raise_()
|
||||
self.groupBox_2.raise_()
|
||||
self.groupBox_3.raise_()
|
||||
self.graph_comboBox.raise_()
|
||||
self.stackedWidget.addWidget(self.page_2)
|
||||
self.page_3 = QtWidgets.QWidget()
|
||||
self.page_3.setObjectName("page_3")
|
||||
self.stackedWidget.addWidget(self.page_3)
|
||||
self.verticalLayout.addWidget(self.stackedWidget)
|
||||
self.splitter = QtWidgets.QSplitter(self.splitter_2)
|
||||
self.splitter.setOrientation(QtCore.Qt.Vertical)
|
||||
self.splitter.setChildrenCollapsible(False)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.verticalLayoutWidget_2 = QtWidgets.QWidget(self.splitter)
|
||||
self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2")
|
||||
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2)
|
||||
self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||
self.namespace_widget = QNamespaceWidget(self.verticalLayoutWidget_2)
|
||||
self.namespace_widget.setObjectName("namespace_widget")
|
||||
self.verticalLayout_6.addWidget(self.namespace_widget)
|
||||
self.verticalLayoutWidget_3 = QtWidgets.QWidget(self.splitter)
|
||||
self.verticalLayoutWidget_3.setObjectName("verticalLayoutWidget_3")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_3)
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.line_2 = QtWidgets.QFrame(self.verticalLayoutWidget_3)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.verticalLayout_3.addWidget(self.line_2)
|
||||
self.label = QtWidgets.QLabel(self.verticalLayoutWidget_3)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout_3.addWidget(self.label)
|
||||
self.calc_edit = QtWidgets.QPlainTextEdit(self.verticalLayoutWidget_3)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.calc_edit.sizePolicy().hasHeightForWidth())
|
||||
self.calc_edit.setSizePolicy(sizePolicy)
|
||||
self.calc_edit.setObjectName("calc_edit")
|
||||
self.verticalLayout_3.addWidget(self.calc_edit)
|
||||
self.verticalLayout_5.addWidget(self.splitter_2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(CalcDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout_5.addWidget(self.buttonBox)
|
||||
self.label_3.setBuddy(self.label_lineEdit)
|
||||
self.label_9.setBuddy(self.value_lineEdit)
|
||||
self.label_6.setBuddy(self.dtype_comboBox)
|
||||
self.label_4.setBuddy(self.symcolor_comboBox)
|
||||
self.label_5.setBuddy(self.symbol_spinBox)
|
||||
self.label_7.setBuddy(self.linecolor_comboBox)
|
||||
self.label_8.setBuddy(self.line_doubleSpinBox)
|
||||
|
||||
self.retranslateUi(CalcDialog)
|
||||
self.stackedWidget.setCurrentIndex(2)
|
||||
QtCore.QMetaObject.connectSlotsByName(CalcDialog)
|
||||
CalcDialog.setTabOrder(self.calc_edit, self.listWidget)
|
||||
CalcDialog.setTabOrder(self.listWidget, self.overwrite_checkbox)
|
||||
CalcDialog.setTabOrder(self.overwrite_checkbox, self.label_lineEdit)
|
||||
CalcDialog.setTabOrder(self.label_lineEdit, self.value_lineEdit)
|
||||
CalcDialog.setTabOrder(self.value_lineEdit, self.dtype_comboBox)
|
||||
CalcDialog.setTabOrder(self.dtype_comboBox, self.symcolor_comboBox)
|
||||
CalcDialog.setTabOrder(self.symcolor_comboBox, self.symbol_spinBox)
|
||||
CalcDialog.setTabOrder(self.symbol_spinBox, self.linecolor_comboBox)
|
||||
CalcDialog.setTabOrder(self.linecolor_comboBox, self.line_doubleSpinBox)
|
||||
|
||||
def retranslateUi(self, CalcDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
CalcDialog.setWindowTitle(_translate("CalcDialog", "Evaluate stuff"))
|
||||
self.label_2.setText(_translate("CalcDialog", "Select sets for evaluation"))
|
||||
self.overwrite_checkbox.setText(_translate("CalcDialog", "Overwrite values"))
|
||||
self.groupBox_2.setTitle(_translate("CalcDialog", "GroupBox"))
|
||||
self.label_3.setText(_translate("CalcDialog", "Label"))
|
||||
self.label_9.setText(_translate("CalcDialog", "Value"))
|
||||
self.label_6.setText(_translate("CalcDialog", "Datatype"))
|
||||
self.dtype_comboBox.setItemText(0, _translate("CalcDialog", "Points"))
|
||||
self.dtype_comboBox.setItemText(1, _translate("CalcDialog", "Timesignal"))
|
||||
self.dtype_comboBox.setItemText(2, _translate("CalcDialog", "Spectrum"))
|
||||
self.dtype_comboBox.setItemText(3, _translate("CalcDialog", "BDS"))
|
||||
self.groupBox.setTitle(_translate("CalcDialog", "Symbol"))
|
||||
self.label_4.setText(_translate("CalcDialog", "Color"))
|
||||
self.label_5.setText(_translate("CalcDialog", "Size"))
|
||||
self.label_10.setText(_translate("CalcDialog", "Style"))
|
||||
self.groupBox_3.setTitle(_translate("CalcDialog", "Line"))
|
||||
self.label_7.setText(_translate("CalcDialog", "Color"))
|
||||
self.label_8.setText(_translate("CalcDialog", "Width"))
|
||||
self.label_11.setText(_translate("CalcDialog", "Style"))
|
||||
self.label.setText(_translate("CalcDialog", "Expressions are evaluated line by line and change previous values"))
|
||||
from ..lib.delegates import ColorListEditor, LineStyleEditor, SymbolStyleEditor
|
||||
from ..lib.namespace import QNamespaceWidget
|
217
src/gui_qt/_py/evalexpression.py
Normal file
217
src/gui_qt/_py/evalexpression.py
Normal file
@ -0,0 +1,217 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/evalexpression.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_CalcDialog(object):
|
||||
def setupUi(self, CalcDialog):
|
||||
CalcDialog.setObjectName("CalcDialog")
|
||||
CalcDialog.resize(895, 547)
|
||||
self.gridLayout = QtWidgets.QGridLayout(CalcDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.tabWidget = QtWidgets.QTabWidget(CalcDialog)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
self.tab.setObjectName("tab")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.tab)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setSpacing(0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_2.setSpacing(0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.textEdit = QtWidgets.QTextEdit(self.tab)
|
||||
self.textEdit.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.textEdit.sizePolicy().hasHeightForWidth())
|
||||
self.textEdit.setSizePolicy(sizePolicy)
|
||||
self.textEdit.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.textEdit.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.textEdit.setAutoFormatting(QtWidgets.QTextEdit.AutoNone)
|
||||
self.textEdit.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
|
||||
self.textEdit.setObjectName("textEdit")
|
||||
self.horizontalLayout_2.addWidget(self.textEdit)
|
||||
self.textEdit_3 = QtWidgets.QTextEdit(self.tab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.textEdit_3.sizePolicy().hasHeightForWidth())
|
||||
self.textEdit_3.setSizePolicy(sizePolicy)
|
||||
self.textEdit_3.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.textEdit_3.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.textEdit_3.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
|
||||
self.textEdit_3.setObjectName("textEdit_3")
|
||||
self.horizontalLayout_2.addWidget(self.textEdit_3)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab_2)
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_3.setSpacing(0)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.textEdit_2 = QtWidgets.QTextEdit(self.tab_2)
|
||||
self.textEdit_2.setEnabled(True)
|
||||
self.textEdit_2.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.textEdit_2.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.textEdit_2.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
|
||||
self.textEdit_2.setObjectName("textEdit_2")
|
||||
self.horizontalLayout_3.addWidget(self.textEdit_2)
|
||||
self.textEdit_4 = QtWidgets.QTextEdit(self.tab_2)
|
||||
self.textEdit_4.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.textEdit_4.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.textEdit_4.setReadOnly(True)
|
||||
self.textEdit_4.setObjectName("textEdit_4")
|
||||
self.horizontalLayout_3.addWidget(self.textEdit_4)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_3)
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.tab_3 = QtWidgets.QWidget()
|
||||
self.tab_3.setObjectName("tab_3")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_3)
|
||||
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_4.setSpacing(0)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.treeWidget = QtWidgets.QTreeWidget(self.tab_3)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.treeWidget.sizePolicy().hasHeightForWidth())
|
||||
self.treeWidget.setSizePolicy(sizePolicy)
|
||||
self.treeWidget.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.treeWidget.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.treeWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.treeWidget.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
|
||||
self.treeWidget.setObjectName("treeWidget")
|
||||
self.treeWidget.header().setVisible(False)
|
||||
self.verticalLayout_4.addWidget(self.treeWidget)
|
||||
self.tabWidget.addTab(self.tab_3, "")
|
||||
self.verticalLayout_2.addWidget(self.tabWidget)
|
||||
self.label = QtWidgets.QLabel(CalcDialog)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout_2.addWidget(self.label)
|
||||
self.calc_edit = QtWidgets.QPlainTextEdit(CalcDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.calc_edit.sizePolicy().hasHeightForWidth())
|
||||
self.calc_edit.setSizePolicy(sizePolicy)
|
||||
self.calc_edit.setObjectName("calc_edit")
|
||||
self.verticalLayout_2.addWidget(self.calc_edit)
|
||||
self.gridLayout.addLayout(self.verticalLayout_2, 0, 3, 1, 1)
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_5.setSpacing(0)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.label_2 = QtWidgets.QLabel(CalcDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout_5.addWidget(self.label_2)
|
||||
self.listWidget = QtWidgets.QListWidget(CalcDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
|
||||
self.listWidget.setSizePolicy(sizePolicy)
|
||||
self.listWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.listWidget.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.verticalLayout_5.addWidget(self.listWidget)
|
||||
self.overwrite_checkbox = QtWidgets.QCheckBox(CalcDialog)
|
||||
self.overwrite_checkbox.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.overwrite_checkbox.setObjectName("overwrite_checkbox")
|
||||
self.verticalLayout_5.addWidget(self.overwrite_checkbox)
|
||||
self.gridLayout.addLayout(self.verticalLayout_5, 0, 1, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(CalcDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 1, 3, 1, 1)
|
||||
self.line = QtWidgets.QFrame(CalcDialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 0, 2, 1, 1)
|
||||
|
||||
self.retranslateUi(CalcDialog)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
self.buttonBox.accepted.connect(CalcDialog.accept)
|
||||
self.buttonBox.rejected.connect(CalcDialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(CalcDialog)
|
||||
|
||||
def retranslateUi(self, CalcDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
CalcDialog.setWindowTitle(_translate("CalcDialog", "Evaluate stuff"))
|
||||
self.textEdit.setHtml(_translate("CalcDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'Noto Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">- X, y, and Δy values </p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">- Values of dataset on position <span style=\" font-style:italic;\">i</span> in list</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> (<span style=\" font-style:italic;\">s[i].x</span> and <span style=\" font-style:italic;\">x</span> return the same values)</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">- Numpy functions</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">- If available, fit parameters</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> (see namespace for available parameters)</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">- Fit functions:</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> (meaning of p and extra arguments </p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> depend on function)</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">- Constants:</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"> (nuclei are accessed by <span style=\" font-style:italic;\">const[\'gamma\'][\'1H\']</span>)</p></body></html>"))
|
||||
self.textEdit_3.setHtml(_translate("CalcDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'Noto Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">x y y_err</span></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">s[i].x s[i+2].y</span> <span style=\" font-style:italic;\">s[i-1].y_err</span></p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-style:italic;\"><br /></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">np.function</span></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">fit[\'NAME\']</span></p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-style:italic;\"><br /></p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">Name.func(p, x, *args) </span></p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-style:italic;\"><br /></p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">const[\'NAME\']</span></p></body></html>"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("CalcDialog", "Parameter"))
|
||||
self.textEdit_2.setHtml(_translate("CalcDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'Noto Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Substract neighbouring datasets: </p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Normalize on fit value M<span style=\" vertical-align:sub;\">∞</span>:</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Logscale x:</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Division by exponential decay:</p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
self.textEdit_4.setHtml(_translate("CalcDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'Noto Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">y = y-s[i+1].y</span></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">y = y/fit[\'M_infty\']</span></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">x = np.log10(x)</span></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">y = y/np.exp(-x/10)</span></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-style:italic;\">y = y/Exponential_Decay.func([0, 1, 10, 1], x)</span></p></body></html>"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("CalcDialog", "Example"))
|
||||
self.treeWidget.headerItem().setText(0, _translate("CalcDialog", "Namespace"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("CalcDialog", "Namespace"))
|
||||
self.label.setText(_translate("CalcDialog", "Expressions are evaluated line by line and change previous values"))
|
||||
self.label_2.setText(_translate("CalcDialog", "<html><head/><body><p>Select sets for evaluation<br>(no selection = all visible):</p></body></html>"))
|
||||
self.overwrite_checkbox.setText(_translate("CalcDialog", "Overwrite values?"))
|
52
src/gui_qt/_py/expandablewidget.py
Normal file
52
src/gui_qt/_py/expandablewidget.py
Normal file
@ -0,0 +1,52 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/expandablewidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_ExpandableForm(object):
|
||||
def setupUi(self, ExpandableForm):
|
||||
ExpandableForm.setObjectName("ExpandableForm")
|
||||
ExpandableForm.resize(400, 300)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(ExpandableForm)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setSpacing(0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setSpacing(0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.toolButton = QtWidgets.QToolButton(ExpandableForm)
|
||||
self.toolButton.setStyleSheet("border: 0")
|
||||
self.toolButton.setText("")
|
||||
self.toolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.toolButton.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.horizontalLayout.addWidget(self.toolButton)
|
||||
self.label = QtWidgets.QLabel(ExpandableForm)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
self.label.setText("")
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.line = QtWidgets.QFrame(ExpandableForm)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.horizontalLayout.addWidget(self.line)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.retranslateUi(ExpandableForm)
|
||||
QtCore.QMetaObject.connectSlotsByName(ExpandableForm)
|
||||
|
||||
def retranslateUi(self, ExpandableForm):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
ExpandableForm.setWindowTitle(_translate("ExpandableForm", "Form"))
|
65
src/gui_qt/_py/exportConfigTemplate.py
Normal file
65
src/gui_qt/_py/exportConfigTemplate.py
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/exportConfigTemplate.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(241, 367)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
|
||||
self.itemTree = QtWidgets.QTreeWidget(Form)
|
||||
self.itemTree.setObjectName("itemTree")
|
||||
self.itemTree.headerItem().setText(0, "1")
|
||||
self.itemTree.header().setVisible(False)
|
||||
self.gridLayout.addWidget(self.itemTree, 1, 0, 1, 3)
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 3)
|
||||
self.formatList = QtWidgets.QListWidget(Form)
|
||||
self.formatList.setObjectName("formatList")
|
||||
self.gridLayout.addWidget(self.formatList, 3, 0, 1, 3)
|
||||
self.exportBtn = QtWidgets.QPushButton(Form)
|
||||
self.exportBtn.setObjectName("exportBtn")
|
||||
self.gridLayout.addWidget(self.exportBtn, 6, 1, 1, 1)
|
||||
self.closeBtn = QtWidgets.QPushButton(Form)
|
||||
self.closeBtn.setObjectName("closeBtn")
|
||||
self.gridLayout.addWidget(self.closeBtn, 6, 2, 1, 1)
|
||||
self.paramTree = ParameterTree(Form)
|
||||
self.paramTree.setColumnCount(2)
|
||||
self.paramTree.setObjectName("paramTree")
|
||||
self.paramTree.headerItem().setText(0, "1")
|
||||
self.paramTree.header().setVisible(False)
|
||||
self.gridLayout.addWidget(self.paramTree, 5, 0, 1, 3)
|
||||
self.label_3 = QtWidgets.QLabel(Form)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 4, 0, 1, 3)
|
||||
self.copyBtn = QtWidgets.QPushButton(Form)
|
||||
self.copyBtn.setObjectName("copyBtn")
|
||||
self.gridLayout.addWidget(self.copyBtn, 6, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Export"))
|
||||
self.label.setText(_translate("Form", "Item to export:"))
|
||||
self.label_2.setText(_translate("Form", "Export format"))
|
||||
self.exportBtn.setText(_translate("Form", "Export"))
|
||||
self.closeBtn.setText(_translate("Form", "Close"))
|
||||
self.label_3.setText(_translate("Form", "Export options"))
|
||||
self.copyBtn.setText(_translate("Form", "Copy"))
|
||||
from ..parametertree import ParameterTree
|
196
src/gui_qt/_py/fcreader.py
Normal file
196
src/gui_qt/_py/fcreader.py
Normal file
@ -0,0 +1,196 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fcreader.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FCEval_dialog(object):
|
||||
def setupUi(self, FCEval_dialog):
|
||||
FCEval_dialog.setObjectName("FCEval_dialog")
|
||||
FCEval_dialog.resize(457, 697)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(FCEval_dialog)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.input_box = QtWidgets.QGroupBox(FCEval_dialog)
|
||||
self.input_box.setObjectName("input_box")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.input_box)
|
||||
self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_2.setSpacing(3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.file_pushbutton = QtWidgets.QPushButton(self.input_box)
|
||||
self.file_pushbutton.setChecked(False)
|
||||
self.file_pushbutton.setObjectName("file_pushbutton")
|
||||
self.gridLayout_2.addWidget(self.file_pushbutton, 0, 0, 1, 1)
|
||||
self.dir_pushbutton = QtWidgets.QPushButton(self.input_box)
|
||||
self.dir_pushbutton.setObjectName("dir_pushbutton")
|
||||
self.gridLayout_2.addWidget(self.dir_pushbutton, 0, 1, 1, 1)
|
||||
self.listWidget = QtWidgets.QListWidget(self.input_box)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
|
||||
self.listWidget.setSizePolicy(sizePolicy)
|
||||
self.listWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.listWidget.setTextElideMode(QtCore.Qt.ElideLeft)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.gridLayout_2.addWidget(self.listWidget, 1, 0, 1, 3)
|
||||
self.overwrite_cb = QtWidgets.QCheckBox(self.input_box)
|
||||
self.overwrite_cb.setObjectName("overwrite_cb")
|
||||
self.gridLayout_2.addWidget(self.overwrite_cb, 0, 2, 1, 1)
|
||||
self.verticalLayout.addWidget(self.input_box)
|
||||
self.region_box = QtWidgets.QGroupBox(FCEval_dialog)
|
||||
self.region_box.setCheckable(True)
|
||||
self.region_box.setObjectName("region_box")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.region_box)
|
||||
self.horizontalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.start_lineedit = QtWidgets.QLineEdit(self.region_box)
|
||||
self.start_lineedit.setObjectName("start_lineedit")
|
||||
self.horizontalLayout.addWidget(self.start_lineedit)
|
||||
self.stop_lineedit = QtWidgets.QLineEdit(self.region_box)
|
||||
self.stop_lineedit.setObjectName("stop_lineedit")
|
||||
self.horizontalLayout.addWidget(self.stop_lineedit)
|
||||
self.verticalLayout.addWidget(self.region_box)
|
||||
self.fit_box = QtWidgets.QGroupBox(FCEval_dialog)
|
||||
self.fit_box.setObjectName("fit_box")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.fit_box)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.label_12 = QtWidgets.QLabel(self.fit_box)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.gridLayout_3.addWidget(self.label_12, 0, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout_3.addItem(spacerItem, 0, 1, 1, 1)
|
||||
self.kww_checkbox = QtWidgets.QCheckBox(self.fit_box)
|
||||
self.kww_checkbox.setChecked(True)
|
||||
self.kww_checkbox.setObjectName("kww_checkbox")
|
||||
self.gridLayout_3.addWidget(self.kww_checkbox, 0, 2, 1, 1)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setSpacing(2)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_3 = QtWidgets.QLabel(self.fit_box)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.horizontalLayout_3.addWidget(self.label_3)
|
||||
self.t1_cb = QtWidgets.QCheckBox(self.fit_box)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.t1_cb.sizePolicy().hasHeightForWidth())
|
||||
self.t1_cb.setSizePolicy(sizePolicy)
|
||||
self.t1_cb.setText("")
|
||||
self.t1_cb.setChecked(True)
|
||||
self.t1_cb.setObjectName("t1_cb")
|
||||
self.horizontalLayout_3.addWidget(self.t1_cb)
|
||||
self.label_4 = QtWidgets.QLabel(self.fit_box)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout_3.addWidget(self.label_4)
|
||||
self.beta_cb = QtWidgets.QCheckBox(self.fit_box)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.beta_cb.sizePolicy().hasHeightForWidth())
|
||||
self.beta_cb.setSizePolicy(sizePolicy)
|
||||
self.beta_cb.setChecked(True)
|
||||
self.beta_cb.setObjectName("beta_cb")
|
||||
self.horizontalLayout_3.addWidget(self.beta_cb)
|
||||
self.label_5 = QtWidgets.QLabel(self.fit_box)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_3.addWidget(self.label_5)
|
||||
self.m0_cb = QtWidgets.QCheckBox(self.fit_box)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.m0_cb.sizePolicy().hasHeightForWidth())
|
||||
self.m0_cb.setSizePolicy(sizePolicy)
|
||||
self.m0_cb.setText("")
|
||||
self.m0_cb.setObjectName("m0_cb")
|
||||
self.horizontalLayout_3.addWidget(self.m0_cb)
|
||||
self.label_6 = QtWidgets.QLabel(self.fit_box)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.horizontalLayout_3.addWidget(self.label_6)
|
||||
self.off_cb = QtWidgets.QCheckBox(self.fit_box)
|
||||
self.off_cb.setObjectName("off_cb")
|
||||
self.horizontalLayout_3.addWidget(self.off_cb)
|
||||
self.gridLayout_3.addLayout(self.horizontalLayout_3, 1, 0, 1, 3)
|
||||
self.verticalLayout.addWidget(self.fit_box)
|
||||
self.out_box = QtWidgets.QGroupBox(FCEval_dialog)
|
||||
self.out_box.setObjectName("out_box")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.out_box)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.savebutton = QtWidgets.QPushButton(self.out_box)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.savebutton.sizePolicy().hasHeightForWidth())
|
||||
self.savebutton.setSizePolicy(sizePolicy)
|
||||
self.savebutton.setObjectName("savebutton")
|
||||
self.gridLayout.addWidget(self.savebutton, 0, 1, 1, 1)
|
||||
self.line = QtWidgets.QFrame(self.out_box)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 2, 0, 1, 2)
|
||||
self.graph_comboBox = QtWidgets.QComboBox(self.out_box)
|
||||
self.graph_comboBox.setObjectName("graph_comboBox")
|
||||
self.gridLayout.addWidget(self.graph_comboBox, 3, 1, 1, 1)
|
||||
self.graph_checkbox = QtWidgets.QCheckBox(self.out_box)
|
||||
self.graph_checkbox.setChecked(True)
|
||||
self.graph_checkbox.setObjectName("graph_checkbox")
|
||||
self.gridLayout.addWidget(self.graph_checkbox, 3, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.out_box)
|
||||
self.label.setMaximumSize(QtCore.QSize(16777215, 16777215))
|
||||
self.label.setText("")
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 1, 0, 1, 2)
|
||||
self.label_2 = QtWidgets.QLabel(self.out_box)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
|
||||
self.verticalLayout.addWidget(self.out_box)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(FCEval_dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
self.label_12.setBuddy(self.kww_checkbox)
|
||||
self.label_4.setBuddy(self.t1_cb)
|
||||
self.label_5.setBuddy(self.beta_cb)
|
||||
self.label_6.setBuddy(self.m0_cb)
|
||||
|
||||
self.retranslateUi(FCEval_dialog)
|
||||
self.buttonBox.accepted.connect(FCEval_dialog.accept)
|
||||
self.buttonBox.rejected.connect(FCEval_dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(FCEval_dialog)
|
||||
|
||||
def retranslateUi(self, FCEval_dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FCEval_dialog.setWindowTitle(_translate("FCEval_dialog", "FC evaluation"))
|
||||
self.input_box.setTitle(_translate("FCEval_dialog", "Input"))
|
||||
self.file_pushbutton.setText(_translate("FCEval_dialog", "Add HDF files..."))
|
||||
self.dir_pushbutton.setText(_translate("FCEval_dialog", "Add directory..."))
|
||||
self.overwrite_cb.setText(_translate("FCEval_dialog", "Overwrite prev. data"))
|
||||
self.region_box.setTitle(_translate("FCEval_dialog", "Evaluate region (empty values default to start/end)"))
|
||||
self.start_lineedit.setPlaceholderText(_translate("FCEval_dialog", "start pos in µs"))
|
||||
self.stop_lineedit.setPlaceholderText(_translate("FCEval_dialog", "end pos in µs"))
|
||||
self.fit_box.setTitle(_translate("FCEval_dialog", "Fit equation"))
|
||||
self.label_12.setText(_translate("FCEval_dialog", "y = M<sub>0</sub> exp[-(x/T<sub>1</sub>)<sup>β</sup>] + Off"))
|
||||
self.kww_checkbox.setToolTip(_translate("FCEval_dialog", "Check to fit a stretched exponential instead of exponential function."))
|
||||
self.kww_checkbox.setText(_translate("FCEval_dialog", "Stretched exponential"))
|
||||
self.label_3.setText(_translate("FCEval_dialog", "Plot:"))
|
||||
self.label_4.setText(_translate("FCEval_dialog", "T<sub>1</sub>"))
|
||||
self.label_5.setText(_translate("FCEval_dialog", "β"))
|
||||
self.label_6.setText(_translate("FCEval_dialog", "M<sub>0</sub>"))
|
||||
self.off_cb.setText(_translate("FCEval_dialog", "Offset"))
|
||||
self.out_box.setTitle(_translate("FCEval_dialog", "Output"))
|
||||
self.savebutton.setText(_translate("FCEval_dialog", "Change directory..."))
|
||||
self.graph_checkbox.setText(_translate("FCEval_dialog", "New graph"))
|
||||
self.label_2.setText(_translate("FCEval_dialog", "Save location"))
|
181
src/gui_qt/_py/filedialog.py
Normal file
181
src/gui_qt/_py/filedialog.py
Normal file
@ -0,0 +1,181 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/filedialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_QFileDialog(object):
|
||||
def setupUi(self, QFileDialog):
|
||||
QFileDialog.setObjectName("QFileDialog")
|
||||
QFileDialog.resize(521, 316)
|
||||
QFileDialog.setSizeGripEnabled(True)
|
||||
self.gridlayout = QtWidgets.QGridLayout(QFileDialog)
|
||||
self.gridlayout.setObjectName("gridlayout")
|
||||
self.lookInLabel = QtWidgets.QLabel(QFileDialog)
|
||||
self.lookInLabel.setObjectName("lookInLabel")
|
||||
self.gridlayout.addWidget(self.lookInLabel, 0, 0, 1, 1)
|
||||
self.hboxlayout = QtWidgets.QHBoxLayout()
|
||||
self.hboxlayout.setObjectName("hboxlayout")
|
||||
self.lookInCombo = QFileDialogComboBox(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(1)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.lookInCombo.sizePolicy().hasHeightForWidth())
|
||||
self.lookInCombo.setSizePolicy(sizePolicy)
|
||||
self.lookInCombo.setMinimumSize(QtCore.QSize(50, 0))
|
||||
self.lookInCombo.setObjectName("lookInCombo")
|
||||
self.hboxlayout.addWidget(self.lookInCombo)
|
||||
self.backButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.backButton.setObjectName("backButton")
|
||||
self.hboxlayout.addWidget(self.backButton)
|
||||
self.forwardButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.forwardButton.setObjectName("forwardButton")
|
||||
self.hboxlayout.addWidget(self.forwardButton)
|
||||
self.toParentButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.toParentButton.setObjectName("toParentButton")
|
||||
self.hboxlayout.addWidget(self.toParentButton)
|
||||
self.newFolderButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.newFolderButton.setObjectName("newFolderButton")
|
||||
self.hboxlayout.addWidget(self.newFolderButton)
|
||||
self.listModeButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.listModeButton.setObjectName("listModeButton")
|
||||
self.hboxlayout.addWidget(self.listModeButton)
|
||||
self.detailModeButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.detailModeButton.setObjectName("detailModeButton")
|
||||
self.hboxlayout.addWidget(self.detailModeButton)
|
||||
self.gridlayout.addLayout(self.hboxlayout, 0, 1, 1, 2)
|
||||
self.splitter = QtWidgets.QSplitter(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.splitter.sizePolicy().hasHeightForWidth())
|
||||
self.splitter.setSizePolicy(sizePolicy)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter.setChildrenCollapsible(False)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.sidebar = QSidebar(self.splitter)
|
||||
self.sidebar.setObjectName("sidebar")
|
||||
self.frame = QtWidgets.QFrame(self.splitter)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(self.frame)
|
||||
self.vboxlayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.vboxlayout.setSpacing(0)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(self.frame)
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setObjectName("page")
|
||||
self.vboxlayout1 = QtWidgets.QVBoxLayout(self.page)
|
||||
self.vboxlayout1.setContentsMargins(0, 0, 0, 0)
|
||||
self.vboxlayout1.setSpacing(0)
|
||||
self.vboxlayout1.setObjectName("vboxlayout1")
|
||||
self.listView = QFileDialogListView(self.page)
|
||||
self.listView.setObjectName("listView")
|
||||
self.vboxlayout1.addWidget(self.listView)
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.vboxlayout2 = QtWidgets.QVBoxLayout(self.page_2)
|
||||
self.vboxlayout2.setContentsMargins(0, 0, 0, 0)
|
||||
self.vboxlayout2.setSpacing(0)
|
||||
self.vboxlayout2.setObjectName("vboxlayout2")
|
||||
self.treeView = QFileDialogTreeView(self.page_2)
|
||||
self.treeView.setObjectName("treeView")
|
||||
self.vboxlayout2.addWidget(self.treeView)
|
||||
self.stackedWidget.addWidget(self.page_2)
|
||||
self.vboxlayout.addWidget(self.stackedWidget)
|
||||
self.gridlayout.addWidget(self.splitter, 1, 0, 1, 3)
|
||||
self.fileNameLabel = QtWidgets.QLabel(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileNameLabel.sizePolicy().hasHeightForWidth())
|
||||
self.fileNameLabel.setSizePolicy(sizePolicy)
|
||||
self.fileNameLabel.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.fileNameLabel.setObjectName("fileNameLabel")
|
||||
self.gridlayout.addWidget(self.fileNameLabel, 2, 0, 1, 1)
|
||||
self.fileNameEdit = QFileDialogLineEdit(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(1)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileNameEdit.sizePolicy().hasHeightForWidth())
|
||||
self.fileNameEdit.setSizePolicy(sizePolicy)
|
||||
self.fileNameEdit.setObjectName("fileNameEdit")
|
||||
self.gridlayout.addWidget(self.fileNameEdit, 2, 1, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(QFileDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridlayout.addWidget(self.buttonBox, 2, 2, 2, 1)
|
||||
self.fileTypeLabel = QtWidgets.QLabel(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileTypeLabel.sizePolicy().hasHeightForWidth())
|
||||
self.fileTypeLabel.setSizePolicy(sizePolicy)
|
||||
self.fileTypeLabel.setObjectName("fileTypeLabel")
|
||||
self.gridlayout.addWidget(self.fileTypeLabel, 3, 0, 1, 1)
|
||||
self.fileTypeCombo = QtWidgets.QComboBox(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileTypeCombo.sizePolicy().hasHeightForWidth())
|
||||
self.fileTypeCombo.setSizePolicy(sizePolicy)
|
||||
self.fileTypeCombo.setObjectName("fileTypeCombo")
|
||||
self.gridlayout.addWidget(self.fileTypeCombo, 3, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(QFileDialog)
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(QFileDialog)
|
||||
QFileDialog.setTabOrder(self.lookInCombo, self.backButton)
|
||||
QFileDialog.setTabOrder(self.backButton, self.forwardButton)
|
||||
QFileDialog.setTabOrder(self.forwardButton, self.toParentButton)
|
||||
QFileDialog.setTabOrder(self.toParentButton, self.newFolderButton)
|
||||
QFileDialog.setTabOrder(self.newFolderButton, self.listModeButton)
|
||||
QFileDialog.setTabOrder(self.listModeButton, self.detailModeButton)
|
||||
QFileDialog.setTabOrder(self.detailModeButton, self.sidebar)
|
||||
QFileDialog.setTabOrder(self.sidebar, self.treeView)
|
||||
QFileDialog.setTabOrder(self.treeView, self.listView)
|
||||
QFileDialog.setTabOrder(self.listView, self.fileNameEdit)
|
||||
QFileDialog.setTabOrder(self.fileNameEdit, self.buttonBox)
|
||||
QFileDialog.setTabOrder(self.buttonBox, self.fileTypeCombo)
|
||||
|
||||
def retranslateUi(self, QFileDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
self.lookInLabel.setText(_translate("QFileDialog", "Look in:"))
|
||||
self.backButton.setToolTip(_translate("QFileDialog", "Back"))
|
||||
self.backButton.setAccessibleName(_translate("QFileDialog", "Back"))
|
||||
self.backButton.setAccessibleDescription(_translate("QFileDialog", "Go back"))
|
||||
self.backButton.setShortcut(_translate("QFileDialog", "Alt+Left"))
|
||||
self.forwardButton.setToolTip(_translate("QFileDialog", "Forward"))
|
||||
self.forwardButton.setAccessibleName(_translate("QFileDialog", "Forward"))
|
||||
self.forwardButton.setAccessibleDescription(_translate("QFileDialog", "Go forward"))
|
||||
self.forwardButton.setShortcut(_translate("QFileDialog", "Alt+Right"))
|
||||
self.toParentButton.setToolTip(_translate("QFileDialog", "Parent Directory"))
|
||||
self.toParentButton.setAccessibleName(_translate("QFileDialog", "Parent Directory"))
|
||||
self.toParentButton.setAccessibleDescription(_translate("QFileDialog", "Go to the parent directory"))
|
||||
self.toParentButton.setShortcut(_translate("QFileDialog", "Alt+Up"))
|
||||
self.newFolderButton.setToolTip(_translate("QFileDialog", "Create New Folder"))
|
||||
self.newFolderButton.setAccessibleName(_translate("QFileDialog", "Create New Folder"))
|
||||
self.newFolderButton.setAccessibleDescription(_translate("QFileDialog", "Create a New Folder"))
|
||||
self.listModeButton.setToolTip(_translate("QFileDialog", "List View"))
|
||||
self.listModeButton.setAccessibleName(_translate("QFileDialog", "List View"))
|
||||
self.listModeButton.setAccessibleDescription(_translate("QFileDialog", "Change to list view mode"))
|
||||
self.detailModeButton.setToolTip(_translate("QFileDialog", "Detail View"))
|
||||
self.detailModeButton.setAccessibleName(_translate("QFileDialog", "Detail View"))
|
||||
self.detailModeButton.setAccessibleDescription(_translate("QFileDialog", "Change to detail view mode"))
|
||||
self.sidebar.setAccessibleName(_translate("QFileDialog", "Sidebar"))
|
||||
self.sidebar.setAccessibleDescription(_translate("QFileDialog", "List of places and bookmarks"))
|
||||
self.listView.setAccessibleName(_translate("QFileDialog", "Files"))
|
||||
self.treeView.setAccessibleName(_translate("QFileDialog", "Files"))
|
||||
self.fileTypeLabel.setText(_translate("QFileDialog", "Files of type:"))
|
||||
from private.qfiledialog_p import QFileDialogComboBox, QFileDialogLineEdit, QFileDialogListView, QFileDialogTreeView
|
||||
from private.qsidebar_p import QSidebar
|
77
src/gui_qt/_py/fitcreationdialog.py
Normal file
77
src/gui_qt/_py/fitcreationdialog.py
Normal file
@ -0,0 +1,77 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitcreationdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(773, 633)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
|
||||
Dialog.setSizePolicy(sizePolicy)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.splitter = QtWidgets.QSplitter(Dialog)
|
||||
self.splitter.setOrientation(QtCore.Qt.Vertical)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.splitter)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.description_box = QtWidgets.QWidget()
|
||||
self.description_box.setObjectName("description_box")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.description_box)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.tabWidget.addTab(self.description_box, "")
|
||||
self.args_box = QtWidgets.QWidget()
|
||||
self.args_box.setObjectName("args_box")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.args_box)
|
||||
self.verticalLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.tabWidget.addTab(self.args_box, "")
|
||||
self.kwargs_box = QtWidgets.QWidget()
|
||||
self.kwargs_box.setObjectName("kwargs_box")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.kwargs_box)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.tabWidget.addTab(self.kwargs_box, "")
|
||||
self.namespace_box = QtWidgets.QWidget()
|
||||
self.namespace_box.setObjectName("namespace_box")
|
||||
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.namespace_box)
|
||||
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||
self.tabWidget.addTab(self.namespace_box, "")
|
||||
self.plainTextEdit = CodeEditor(self.splitter)
|
||||
self.plainTextEdit.setEnabled(True)
|
||||
self.plainTextEdit.setObjectName("plainTextEdit")
|
||||
self.verticalLayout.addWidget(self.splitter)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Create fit function"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.description_box), _translate("Dialog", "Description"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.args_box), _translate("Dialog", "Variables"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.kwargs_box), _translate("Dialog", "Multiple choice"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.namespace_box), _translate("Dialog", "Available Functions"))
|
||||
from ..lib.codeeditor import CodeEditor
|
159
src/gui_qt/_py/fitdialog.py
Normal file
159
src/gui_qt/_py/fitdialog.py
Normal file
@ -0,0 +1,159 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FitDialog(object):
|
||||
def setupUi(self, FitDialog):
|
||||
FitDialog.setObjectName("FitDialog")
|
||||
FitDialog.resize(347, 710)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(FitDialog)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.scrollArea = QtWidgets.QScrollArea(FitDialog)
|
||||
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollAreaWidgetContents_2 = QtWidgets.QWidget()
|
||||
self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 341, 665))
|
||||
self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_2)
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, -1)
|
||||
self.gridLayout_2.setSpacing(3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.weight_combobox = QtWidgets.QComboBox(self.scrollAreaWidgetContents_2)
|
||||
self.weight_combobox.setObjectName("weight_combobox")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.gridLayout_2.addWidget(self.weight_combobox, 6, 1, 1, 1)
|
||||
self.newmodel_button = QtWidgets.QPushButton(self.scrollAreaWidgetContents_2)
|
||||
self.newmodel_button.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.newmodel_button.sizePolicy().hasHeightForWidth())
|
||||
self.newmodel_button.setSizePolicy(sizePolicy)
|
||||
self.newmodel_button.setObjectName("newmodel_button")
|
||||
self.gridLayout_2.addWidget(self.newmodel_button, 2, 0, 1, 1)
|
||||
self.deletemodel_button = QtWidgets.QPushButton(self.scrollAreaWidgetContents_2)
|
||||
self.deletemodel_button.setEnabled(False)
|
||||
self.deletemodel_button.setObjectName("deletemodel_button")
|
||||
self.gridLayout_2.addWidget(self.deletemodel_button, 2, 1, 1, 1)
|
||||
self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents_2)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout_2.addWidget(self.label_3, 6, 0, 1, 1)
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(self.scrollAreaWidgetContents_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.stackedWidget.sizePolicy().hasHeightForWidth())
|
||||
self.stackedWidget.setSizePolicy(sizePolicy)
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setObjectName("page")
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
self.gridLayout_2.addWidget(self.stackedWidget, 1, 0, 1, 2)
|
||||
self.functionwidget = QFunctionWidget(self.scrollAreaWidgetContents_2)
|
||||
self.functionwidget.setObjectName("functionwidget")
|
||||
self.gridLayout_2.addWidget(self.functionwidget, 0, 0, 1, 2)
|
||||
self.model_frame = QtWidgets.QFrame(self.scrollAreaWidgetContents_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.model_frame.sizePolicy().hasHeightForWidth())
|
||||
self.model_frame.setSizePolicy(sizePolicy)
|
||||
self.model_frame.setObjectName("model_frame")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.model_frame)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setHorizontalSpacing(0)
|
||||
self.gridLayout.setVerticalSpacing(1)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.show_combobox = QtWidgets.QComboBox(self.model_frame)
|
||||
self.show_combobox.setObjectName("show_combobox")
|
||||
self.show_combobox.addItem("")
|
||||
self.gridLayout.addWidget(self.show_combobox, 1, 1, 1, 1)
|
||||
self.default_combobox = QtWidgets.QComboBox(self.model_frame)
|
||||
self.default_combobox.setObjectName("default_combobox")
|
||||
self.default_combobox.addItem("")
|
||||
self.gridLayout.addWidget(self.default_combobox, 0, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.model_frame)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.model_frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.model_frame, 3, 0, 1, 2)
|
||||
self.data_widget = ExpandableWidget(self.scrollAreaWidgetContents_2)
|
||||
self.data_widget.setMinimumSize(QtCore.QSize(0, 24))
|
||||
self.data_widget.setObjectName("data_widget")
|
||||
self.gridLayout_2.addWidget(self.data_widget, 5, 0, 1, 2)
|
||||
self.scrollArea.setWidget(self.scrollAreaWidgetContents_2)
|
||||
self.verticalLayout.addWidget(self.scrollArea)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.fit_button = QtWidgets.QPushButton(FitDialog)
|
||||
self.fit_button.setStyleSheet("font-weight: bold")
|
||||
self.fit_button.setObjectName("fit_button")
|
||||
self.horizontalLayout.addWidget(self.fit_button)
|
||||
self.abort_button = QtWidgets.QPushButton(FitDialog)
|
||||
self.abort_button.setStyleSheet("font-weight: bold")
|
||||
self.abort_button.setObjectName("abort_button")
|
||||
self.horizontalLayout.addWidget(self.abort_button)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.preview_checkbox = QtWidgets.QCheckBox(FitDialog)
|
||||
self.preview_checkbox.setObjectName("preview_checkbox")
|
||||
self.horizontalLayout.addWidget(self.preview_checkbox)
|
||||
self.preview_button = QtWidgets.QPushButton(FitDialog)
|
||||
self.preview_button.setCheckable(False)
|
||||
self.preview_button.setChecked(False)
|
||||
self.preview_button.setFlat(False)
|
||||
self.preview_button.setObjectName("preview_button")
|
||||
self.horizontalLayout.addWidget(self.preview_button)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.retranslateUi(FitDialog)
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(FitDialog)
|
||||
|
||||
def retranslateUi(self, FitDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FitDialog.setWindowTitle(_translate("FitDialog", "Form"))
|
||||
self.weight_combobox.setItemText(0, _translate("FitDialog", "None"))
|
||||
self.weight_combobox.setItemText(1, _translate("FitDialog", "y"))
|
||||
self.weight_combobox.setItemText(2, _translate("FitDialog", "y²"))
|
||||
self.weight_combobox.setItemText(3, _translate("FitDialog", "Δy"))
|
||||
self.weight_combobox.setItemText(4, _translate("FitDialog", "log(y)"))
|
||||
self.newmodel_button.setText(_translate("FitDialog", "New model"))
|
||||
self.deletemodel_button.setText(_translate("FitDialog", "Delete model"))
|
||||
self.label_3.setText(_translate("FitDialog", "Weight"))
|
||||
self.show_combobox.setItemText(0, _translate("FitDialog", "Model a"))
|
||||
self.default_combobox.setItemText(0, _translate("FitDialog", "Model a"))
|
||||
self.label_2.setText(_translate("FitDialog", "Show model"))
|
||||
self.label.setText(_translate("FitDialog", "Default"))
|
||||
self.fit_button.setText(_translate("FitDialog", "Run fit!!!"))
|
||||
self.abort_button.setText(_translate("FitDialog", "Abort"))
|
||||
self.preview_checkbox.setText(_translate("FitDialog", "Preview"))
|
||||
self.preview_button.setText(_translate("FitDialog", "Update"))
|
||||
from ..fit.fitfunction import QFunctionWidget
|
||||
from ..lib.expandablewidget import ExpandableWidget
|
285
src/gui_qt/_py/fitdialog_window.py
Normal file
285
src/gui_qt/_py/fitdialog_window.py
Normal file
@ -0,0 +1,285 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitdialog_window.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FitDialog(object):
|
||||
def setupUi(self, FitDialog):
|
||||
FitDialog.setObjectName("FitDialog")
|
||||
FitDialog.setWindowModality(QtCore.Qt.ApplicationModal)
|
||||
FitDialog.resize(828, 827)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(":/logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
FitDialog.setWindowIcon(icon)
|
||||
self.centralwidget = QtWidgets.QWidget(FitDialog)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.splitter = QtWidgets.QSplitter(self.centralwidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.widget_2 = QtWidgets.QWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.widget_2.sizePolicy().hasHeightForWidth())
|
||||
self.widget_2.setSizePolicy(sizePolicy)
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.widget_2)
|
||||
self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_3.setSpacing(3)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.label_3 = QtWidgets.QLabel(self.widget_2)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout_3.addWidget(self.label_3, 3, 0, 1, 1)
|
||||
self.weight_combobox = QtWidgets.QComboBox(self.widget_2)
|
||||
self.weight_combobox.setObjectName("weight_combobox")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.weight_combobox.addItem("")
|
||||
self.gridLayout_3.addWidget(self.weight_combobox, 3, 1, 1, 1)
|
||||
self.line = QtWidgets.QFrame(self.widget_2)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout_3.addWidget(self.line, 2, 0, 1, 2)
|
||||
self.tableWidget = QtWidgets.QTableWidget(self.widget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tableWidget.sizePolicy().hasHeightForWidth())
|
||||
self.tableWidget.setSizePolicy(sizePolicy)
|
||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.tableWidget.setShowGrid(False)
|
||||
self.tableWidget.setGridStyle(QtCore.Qt.NoPen)
|
||||
self.tableWidget.setColumnCount(2)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setRowCount(0)
|
||||
self.tableWidget.horizontalHeader().setVisible(False)
|
||||
self.tableWidget.horizontalHeader().setStretchLastSection(True)
|
||||
self.tableWidget.verticalHeader().setVisible(False)
|
||||
self.gridLayout_3.addWidget(self.tableWidget, 0, 0, 1, 2)
|
||||
self.horizontalFrame = QtWidgets.QFrame(self.widget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.horizontalFrame.sizePolicy().hasHeightForWidth())
|
||||
self.horizontalFrame.setSizePolicy(sizePolicy)
|
||||
self.horizontalFrame.setObjectName("horizontalFrame")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.horizontalFrame)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setHorizontalSpacing(0)
|
||||
self.gridLayout.setVerticalSpacing(1)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.show_combobox = QtWidgets.QComboBox(self.horizontalFrame)
|
||||
self.show_combobox.setObjectName("show_combobox")
|
||||
self.show_combobox.addItem("")
|
||||
self.gridLayout.addWidget(self.show_combobox, 1, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.horizontalFrame)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.default_combobox = QtWidgets.QComboBox(self.horizontalFrame)
|
||||
self.default_combobox.setObjectName("default_combobox")
|
||||
self.default_combobox.addItem("")
|
||||
self.gridLayout.addWidget(self.default_combobox, 0, 1, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.horizontalFrame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.gridLayout_3.addWidget(self.horizontalFrame, 1, 0, 1, 2)
|
||||
self.middle_widget = QtWidgets.QWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.middle_widget.sizePolicy().hasHeightForWidth())
|
||||
self.middle_widget.setSizePolicy(sizePolicy)
|
||||
self.middle_widget.setObjectName("middle_widget")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.middle_widget)
|
||||
self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_2.setSpacing(3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.newmodel_button = QtWidgets.QPushButton(self.middle_widget)
|
||||
self.newmodel_button.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.newmodel_button.sizePolicy().hasHeightForWidth())
|
||||
self.newmodel_button.setSizePolicy(sizePolicy)
|
||||
self.newmodel_button.setObjectName("newmodel_button")
|
||||
self.gridLayout_2.addWidget(self.newmodel_button, 2, 0, 1, 1)
|
||||
self.functionwidget = FunctionSelectionWidget(self.middle_widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.functionwidget.sizePolicy().hasHeightForWidth())
|
||||
self.functionwidget.setSizePolicy(sizePolicy)
|
||||
self.functionwidget.setObjectName("functionwidget")
|
||||
self.gridLayout_2.addWidget(self.functionwidget, 0, 0, 1, 2)
|
||||
self.deletemodel_button = QtWidgets.QPushButton(self.middle_widget)
|
||||
self.deletemodel_button.setEnabled(False)
|
||||
self.deletemodel_button.setObjectName("deletemodel_button")
|
||||
self.gridLayout_2.addWidget(self.deletemodel_button, 2, 1, 1, 1)
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(self.middle_widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.stackedWidget.sizePolicy().hasHeightForWidth())
|
||||
self.stackedWidget.setSizePolicy(sizePolicy)
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setObjectName("page")
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.stackedWidget.addWidget(self.page_2)
|
||||
self.gridLayout_2.addWidget(self.stackedWidget, 1, 0, 1, 2)
|
||||
self.verticalLayout_2.addWidget(self.splitter)
|
||||
self.frame_4 = QtWidgets.QFrame(self.centralwidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame_4.sizePolicy().hasHeightForWidth())
|
||||
self.frame_4.setSizePolicy(sizePolicy)
|
||||
self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame_4.setLineWidth(2)
|
||||
self.frame_4.setMidLineWidth(0)
|
||||
self.frame_4.setObjectName("frame_4")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_4)
|
||||
self.horizontalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem)
|
||||
self.fit_button = QtWidgets.QPushButton(self.frame_4)
|
||||
self.fit_button.setObjectName("fit_button")
|
||||
self.horizontalLayout_2.addWidget(self.fit_button)
|
||||
self.abort_button = QtWidgets.QPushButton(self.frame_4)
|
||||
self.abort_button.setObjectName("abort_button")
|
||||
self.horizontalLayout_2.addWidget(self.abort_button)
|
||||
self.preview_button = QtWidgets.QPushButton(self.frame_4)
|
||||
icon1 = QtGui.QIcon()
|
||||
icon1.addPixmap(QtGui.QPixmap(":/fit_preview.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.preview_button.setIcon(icon1)
|
||||
self.preview_button.setCheckable(True)
|
||||
self.preview_button.setObjectName("preview_button")
|
||||
self.horizontalLayout_2.addWidget(self.preview_button)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.verticalLayout_2.addWidget(self.frame_4)
|
||||
FitDialog.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(FitDialog)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 828, 30))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuOptions = QtWidgets.QMenu(self.menubar)
|
||||
self.menuOptions.setObjectName("menuOptions")
|
||||
self.menuMethod = QtWidgets.QMenu(self.menuOptions)
|
||||
self.menuMethod.setObjectName("menuMethod")
|
||||
self.menuLimits = QtWidgets.QMenu(self.menuOptions)
|
||||
self.menuLimits.setObjectName("menuLimits")
|
||||
self.menuHelp = QtWidgets.QMenu(self.menubar)
|
||||
self.menuHelp.setObjectName("menuHelp")
|
||||
self.menuUser = QtWidgets.QMenu(self.menubar)
|
||||
self.menuUser.setObjectName("menuUser")
|
||||
FitDialog.setMenuBar(self.menubar)
|
||||
self.statusBar = QtWidgets.QStatusBar(FitDialog)
|
||||
self.statusBar.setObjectName("statusBar")
|
||||
FitDialog.setStatusBar(self.statusBar)
|
||||
self.action_nm = QtWidgets.QAction(FitDialog)
|
||||
self.action_nm.setCheckable(True)
|
||||
self.action_nm.setObjectName("action_nm")
|
||||
self.action_odr = QtWidgets.QAction(FitDialog)
|
||||
self.action_odr.setCheckable(True)
|
||||
self.action_odr.setObjectName("action_odr")
|
||||
self.action_lm = QtWidgets.QAction(FitDialog)
|
||||
self.action_lm.setCheckable(True)
|
||||
self.action_lm.setChecked(True)
|
||||
self.action_lm.setObjectName("action_lm")
|
||||
self.actionHelp = QtWidgets.QAction(FitDialog)
|
||||
self.actionHelp.setObjectName("actionHelp")
|
||||
self.actionOpen_editor = QtWidgets.QAction(FitDialog)
|
||||
self.actionOpen_editor.setObjectName("actionOpen_editor")
|
||||
self.actionPreview_points = QtWidgets.QAction(FitDialog)
|
||||
self.actionPreview_points.setObjectName("actionPreview_points")
|
||||
self.actionSave_current_model = QtWidgets.QAction(FitDialog)
|
||||
self.actionSave_current_model.setObjectName("actionSave_current_model")
|
||||
self.action_no_range = QtWidgets.QAction(FitDialog)
|
||||
self.action_no_range.setCheckable(True)
|
||||
self.action_no_range.setObjectName("action_no_range")
|
||||
self.action_x_range = QtWidgets.QAction(FitDialog)
|
||||
self.action_x_range.setCheckable(True)
|
||||
self.action_x_range.setChecked(True)
|
||||
self.action_x_range.setObjectName("action_x_range")
|
||||
self.action_custom_range = QtWidgets.QAction(FitDialog)
|
||||
self.action_custom_range.setCheckable(True)
|
||||
self.action_custom_range.setObjectName("action_custom_range")
|
||||
self.menuMethod.addAction(self.action_lm)
|
||||
self.menuMethod.addAction(self.action_nm)
|
||||
self.menuMethod.addAction(self.action_odr)
|
||||
self.menuLimits.addAction(self.action_no_range)
|
||||
self.menuLimits.addAction(self.action_x_range)
|
||||
self.menuLimits.addAction(self.action_custom_range)
|
||||
self.menuOptions.addAction(self.menuMethod.menuAction())
|
||||
self.menuOptions.addAction(self.menuLimits.menuAction())
|
||||
self.menuOptions.addSeparator()
|
||||
self.menuOptions.addAction(self.actionPreview_points)
|
||||
self.menuHelp.addAction(self.actionHelp)
|
||||
self.menuUser.addAction(self.actionOpen_editor)
|
||||
self.menuUser.addAction(self.actionSave_current_model)
|
||||
self.menubar.addAction(self.menuOptions.menuAction())
|
||||
self.menubar.addAction(self.menuUser.menuAction())
|
||||
self.menubar.addAction(self.menuHelp.menuAction())
|
||||
|
||||
self.retranslateUi(FitDialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(FitDialog)
|
||||
|
||||
def retranslateUi(self, FitDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FitDialog.setWindowTitle(_translate("FitDialog", "One must imagine Sisyphus happy."))
|
||||
self.label_3.setText(_translate("FitDialog", "Weight"))
|
||||
self.weight_combobox.setItemText(0, _translate("FitDialog", "None"))
|
||||
self.weight_combobox.setItemText(1, _translate("FitDialog", "y"))
|
||||
self.weight_combobox.setItemText(2, _translate("FitDialog", "y²"))
|
||||
self.weight_combobox.setItemText(3, _translate("FitDialog", "Δy"))
|
||||
self.weight_combobox.setItemText(4, _translate("FitDialog", "log(y)"))
|
||||
self.show_combobox.setItemText(0, _translate("FitDialog", "Model a"))
|
||||
self.label_2.setText(_translate("FitDialog", "Show model"))
|
||||
self.default_combobox.setItemText(0, _translate("FitDialog", "Model a"))
|
||||
self.label.setText(_translate("FitDialog", "Default"))
|
||||
self.newmodel_button.setText(_translate("FitDialog", "New model"))
|
||||
self.deletemodel_button.setText(_translate("FitDialog", "Delete model"))
|
||||
self.fit_button.setText(_translate("FitDialog", "Run fit!!!"))
|
||||
self.abort_button.setText(_translate("FitDialog", "Abort"))
|
||||
self.preview_button.setText(_translate("FitDialog", "Preview"))
|
||||
self.menuOptions.setTitle(_translate("FitDialog", "Options"))
|
||||
self.menuMethod.setTitle(_translate("FitDialog", "Method"))
|
||||
self.menuLimits.setTitle(_translate("FitDialog", "Limits"))
|
||||
self.menuHelp.setTitle(_translate("FitDialog", "Help"))
|
||||
self.menuUser.setTitle(_translate("FitDialog", "User"))
|
||||
self.action_nm.setText(_translate("FitDialog", "Nelder-Mead"))
|
||||
self.action_odr.setText(_translate("FitDialog", "ODR"))
|
||||
self.action_lm.setText(_translate("FitDialog", "Default stuff"))
|
||||
self.actionHelp.setText(_translate("FitDialog", "Help!"))
|
||||
self.actionOpen_editor.setText(_translate("FitDialog", "Open editor..."))
|
||||
self.actionPreview_points.setText(_translate("FitDialog", "Preview points..."))
|
||||
self.actionSave_current_model.setText(_translate("FitDialog", "Save current model..."))
|
||||
self.action_no_range.setText(_translate("FitDialog", "None"))
|
||||
self.action_x_range.setText(_translate("FitDialog", "Visible x range"))
|
||||
self.action_custom_range.setText(_translate("FitDialog", "Custom..."))
|
||||
from ..fit.function_selection import FunctionSelectionWidget
|
||||
import images_rc
|
116
src/gui_qt/_py/fitfunctionwidget.py
Normal file
116
src/gui_qt/_py/fitfunctionwidget.py
Normal file
@ -0,0 +1,116 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitfunctionwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(382, 375)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
|
||||
Form.setSizePolicy(sizePolicy)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.typecomboBox = QtWidgets.QComboBox(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.typecomboBox.sizePolicy().hasHeightForWidth())
|
||||
self.typecomboBox.setSizePolicy(sizePolicy)
|
||||
self.typecomboBox.setObjectName("typecomboBox")
|
||||
self.gridLayout.addWidget(self.typecomboBox, 0, 0, 1, 2)
|
||||
self.complex_widget = QtWidgets.QWidget(Form)
|
||||
self.complex_widget.setObjectName("complex_widget")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.complex_widget)
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.complex_widget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.complex_comboBox = QtWidgets.QComboBox(self.complex_widget)
|
||||
self.complex_comboBox.setObjectName("complex_comboBox")
|
||||
self.complex_comboBox.addItem("")
|
||||
self.complex_comboBox.addItem("")
|
||||
self.complex_comboBox.addItem("")
|
||||
self.gridLayout_2.addWidget(self.complex_comboBox, 1, 1, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.complex_widget)
|
||||
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.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 2)
|
||||
self.gridLayout.addWidget(self.complex_widget, 6, 0, 1, 2)
|
||||
self.fitcomboBox = QtWidgets.QComboBox(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fitcomboBox.sizePolicy().hasHeightForWidth())
|
||||
self.fitcomboBox.setSizePolicy(sizePolicy)
|
||||
self.fitcomboBox.setObjectName("fitcomboBox")
|
||||
self.gridLayout.addWidget(self.fitcomboBox, 1, 0, 1, 2)
|
||||
self.use_function_button = QtWidgets.QToolButton(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.use_function_button.sizePolicy().hasHeightForWidth())
|
||||
self.use_function_button.setSizePolicy(sizePolicy)
|
||||
self.use_function_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.use_function_button.setAutoRaise(False)
|
||||
self.use_function_button.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.use_function_button.setObjectName("use_function_button")
|
||||
self.gridLayout.addWidget(self.use_function_button, 3, 1, 1, 1)
|
||||
self.operator_combobox = QtWidgets.QComboBox(Form)
|
||||
self.operator_combobox.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
|
||||
self.operator_combobox.setFrame(True)
|
||||
self.operator_combobox.setObjectName("operator_combobox")
|
||||
self.operator_combobox.addItem("")
|
||||
self.operator_combobox.addItem("")
|
||||
self.operator_combobox.addItem("")
|
||||
self.operator_combobox.addItem("")
|
||||
self.gridLayout.addWidget(self.operator_combobox, 3, 0, 1, 1)
|
||||
self.functree = FitModelTree(Form)
|
||||
self.functree.setObjectName("functree")
|
||||
self.functree.headerItem().setText(0, "1")
|
||||
self.gridLayout.addWidget(self.functree, 5, 0, 1, 2)
|
||||
self.fitequation = QtWidgets.QLabel(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fitequation.sizePolicy().hasHeightForWidth())
|
||||
self.fitequation.setSizePolicy(sizePolicy)
|
||||
self.fitequation.setWordWrap(True)
|
||||
self.fitequation.setObjectName("fitequation")
|
||||
self.gridLayout.addWidget(self.fitequation, 2, 0, 1, 2)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.label_2.setText(_translate("Form", "Select part to fit"))
|
||||
self.complex_comboBox.setItemText(0, _translate("Form", "Complex"))
|
||||
self.complex_comboBox.setItemText(1, _translate("Form", "Real"))
|
||||
self.complex_comboBox.setItemText(2, _translate("Form", "Imaginary"))
|
||||
self.label.setText(_translate("Form", "Complex function found"))
|
||||
self.use_function_button.setText(_translate("Form", "Use"))
|
||||
self.operator_combobox.setItemText(0, _translate("Form", "Add"))
|
||||
self.operator_combobox.setItemText(1, _translate("Form", "Multiply"))
|
||||
self.operator_combobox.setItemText(2, _translate("Form", "Subtract"))
|
||||
self.operator_combobox.setItemText(3, _translate("Form", "Divide by"))
|
||||
self.fitequation.setText(_translate("Form", "Equation"))
|
||||
from ..fit.fit_forms import FitModelTree
|
70
src/gui_qt/_py/fitfuncwidget.py
Normal file
70
src/gui_qt/_py/fitfuncwidget.py
Normal file
@ -0,0 +1,70 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitfuncwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FormFit(object):
|
||||
def setupUi(self, FormFit):
|
||||
FormFit.setObjectName("FormFit")
|
||||
FormFit.resize(292, 477)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(FormFit)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(FormFit)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.general_tab = QtWidgets.QWidget()
|
||||
self.general_tab.setObjectName("general_tab")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.general_tab)
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.scrollArea = QtWidgets.QScrollArea(self.general_tab)
|
||||
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.scrollArea.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollwidget = QtWidgets.QWidget()
|
||||
self.scrollwidget.setGeometry(QtCore.QRect(0, 0, 284, 442))
|
||||
self.scrollwidget.setObjectName("scrollwidget")
|
||||
self.scrollArea.setWidget(self.scrollwidget)
|
||||
self.verticalLayout_2.addWidget(self.scrollArea)
|
||||
self.tabWidget.addTab(self.general_tab, "")
|
||||
self.data_tab = QtWidgets.QWidget()
|
||||
self.data_tab.setObjectName("data_tab")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.data_tab)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.comboBox = QtWidgets.QComboBox(self.data_tab)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.verticalLayout_3.addWidget(self.comboBox)
|
||||
self.scrollArea2 = QtWidgets.QScrollArea(self.data_tab)
|
||||
self.scrollArea2.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea2.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.scrollArea2.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
|
||||
self.scrollArea2.setWidgetResizable(True)
|
||||
self.scrollArea2.setObjectName("scrollArea2")
|
||||
self.scrollwidget2 = QtWidgets.QWidget()
|
||||
self.scrollwidget2.setGeometry(QtCore.QRect(0, 0, 272, 357))
|
||||
self.scrollwidget2.setObjectName("scrollwidget2")
|
||||
self.scrollArea2.setWidget(self.scrollwidget2)
|
||||
self.verticalLayout_3.addWidget(self.scrollArea2)
|
||||
self.tabWidget.addTab(self.data_tab, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
|
||||
self.retranslateUi(FormFit)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(FormFit)
|
||||
|
||||
def retranslateUi(self, FormFit):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FormFit.setWindowTitle(_translate("FormFit", "Form"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.general_tab), _translate("FormFit", "General settings"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.data_tab), _translate("FormFit", "Data parameter"))
|
86
src/gui_qt/_py/fitfuncwidget_old.py
Normal file
86
src/gui_qt/_py/fitfuncwidget_old.py
Normal file
@ -0,0 +1,86 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitfuncwidget_old.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FormFit(object):
|
||||
def setupUi(self, FormFit):
|
||||
FormFit.setObjectName("FormFit")
|
||||
FormFit.resize(402, 523)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(FormFit)
|
||||
self.verticalLayout.setContentsMargins(0, 6, 0, 0)
|
||||
self.verticalLayout.setSpacing(6)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(FormFit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
|
||||
self.tabWidget.setSizePolicy(sizePolicy)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.general_tab = QtWidgets.QWidget()
|
||||
self.general_tab.setObjectName("general_tab")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.general_tab)
|
||||
self.verticalLayout_3.setContentsMargins(2, 2, 2, 2)
|
||||
self.verticalLayout_3.setSpacing(2)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.scrollArea = QtWidgets.QScrollArea(self.general_tab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.scrollArea.sizePolicy().hasHeightForWidth())
|
||||
self.scrollArea.setSizePolicy(sizePolicy)
|
||||
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
|
||||
self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.scrollArea.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
|
||||
self.scrollArea.setWidgetResizable(False)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollwidget = QtWidgets.QWidget()
|
||||
self.scrollwidget.setGeometry(QtCore.QRect(0, 0, 390, 478))
|
||||
self.scrollwidget.setObjectName("scrollwidget")
|
||||
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.scrollwidget)
|
||||
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||
self.scrollArea.setWidget(self.scrollwidget)
|
||||
self.verticalLayout_3.addWidget(self.scrollArea)
|
||||
self.tabWidget.addTab(self.general_tab, "")
|
||||
self.data_tab = QtWidgets.QWidget()
|
||||
self.data_tab.setObjectName("data_tab")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.data_tab)
|
||||
self.verticalLayout_2.setContentsMargins(2, 2, 2, 2)
|
||||
self.verticalLayout_2.setSpacing(2)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.comboBox = QtWidgets.QComboBox(self.data_tab)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.verticalLayout_2.addWidget(self.comboBox)
|
||||
self.scrollArea2 = QtWidgets.QScrollArea(self.data_tab)
|
||||
self.scrollArea2.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea2.setWidgetResizable(True)
|
||||
self.scrollArea2.setObjectName("scrollArea2")
|
||||
self.scrollwidget2 = QtWidgets.QWidget()
|
||||
self.scrollwidget2.setGeometry(QtCore.QRect(0, 0, 390, 444))
|
||||
self.scrollwidget2.setObjectName("scrollwidget2")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.scrollwidget2)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.scrollArea2.setWidget(self.scrollwidget2)
|
||||
self.verticalLayout_2.addWidget(self.scrollArea2)
|
||||
self.tabWidget.addTab(self.data_tab, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
|
||||
self.retranslateUi(FormFit)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(FormFit)
|
||||
|
||||
def retranslateUi(self, FormFit):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FormFit.setWindowTitle(_translate("FormFit", "Form"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.general_tab), _translate("FormFit", "General settings"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.data_tab), _translate("FormFit", "Data parameter"))
|
67
src/gui_qt/_py/fitmodelfixwidget.py
Normal file
67
src/gui_qt/_py/fitmodelfixwidget.py
Normal file
@ -0,0 +1,67 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitmodelfixwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FitFixParameter(object):
|
||||
def setupUi(self, FitFixParameter):
|
||||
FitFixParameter.setObjectName("FitFixParameter")
|
||||
FitFixParameter.setWindowModality(QtCore.Qt.WindowModal)
|
||||
FitFixParameter.resize(480, 267)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(FitFixParameter.sizePolicy().hasHeightForWidth())
|
||||
FitFixParameter.setSizePolicy(sizePolicy)
|
||||
FitFixParameter.setAutoFillBackground(True)
|
||||
self.gridLayout = QtWidgets.QGridLayout(FitFixParameter)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.frame = QtWidgets.QFrame(FitFixParameter)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 3, 0)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.parametername = QtWidgets.QLabel(self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(1)
|
||||
sizePolicy.setVerticalStretch(10)
|
||||
sizePolicy.setHeightForWidth(self.parametername.sizePolicy().hasHeightForWidth())
|
||||
self.parametername.setSizePolicy(sizePolicy)
|
||||
self.parametername.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.parametername.setIndent(6)
|
||||
self.parametername.setObjectName("parametername")
|
||||
self.horizontalLayout.addWidget(self.parametername)
|
||||
self.label = QtWidgets.QLabel(self.frame)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.gridLayout.addWidget(self.frame, 1, 0, 1, 1)
|
||||
self.parameter_line = QtWidgets.QLineEdit(FitFixParameter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.parameter_line.sizePolicy().hasHeightForWidth())
|
||||
self.parameter_line.setSizePolicy(sizePolicy)
|
||||
self.parameter_line.setObjectName("parameter_line")
|
||||
self.gridLayout.addWidget(self.parameter_line, 1, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(FitFixParameter)
|
||||
QtCore.QMetaObject.connectSlotsByName(FitFixParameter)
|
||||
|
||||
def retranslateUi(self, FitFixParameter):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FitFixParameter.setWindowTitle(_translate("FitFixParameter", "Form"))
|
||||
self.parametername.setText(_translate("FitFixParameter", "Parameter"))
|
||||
self.label.setText(_translate("FitFixParameter", "Unit"))
|
||||
self.parameter_line.setText(_translate("FitFixParameter", "1"))
|
135
src/gui_qt/_py/fitmodelwidget.py
Normal file
135
src/gui_qt/_py/fitmodelwidget.py
Normal file
@ -0,0 +1,135 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitmodelwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FitParameter(object):
|
||||
def setupUi(self, FitParameter):
|
||||
FitParameter.setObjectName("FitParameter")
|
||||
FitParameter.resize(365, 78)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(FitParameter.sizePolicy().hasHeightForWidth())
|
||||
FitParameter.setSizePolicy(sizePolicy)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(FitParameter)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setSpacing(1)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.parametername = QtWidgets.QLabel(FitParameter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.parametername.sizePolicy().hasHeightForWidth())
|
||||
self.parametername.setSizePolicy(sizePolicy)
|
||||
self.parametername.setMinimumSize(QtCore.QSize(28, 0))
|
||||
self.parametername.setObjectName("parametername")
|
||||
self.horizontalLayout_2.addWidget(self.parametername)
|
||||
self.parameter_line = LineEdit(FitParameter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.parameter_line.sizePolicy().hasHeightForWidth())
|
||||
self.parameter_line.setSizePolicy(sizePolicy)
|
||||
self.parameter_line.setText("")
|
||||
self.parameter_line.setObjectName("parameter_line")
|
||||
self.horizontalLayout_2.addWidget(self.parameter_line)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem)
|
||||
self.fixed_check = QtWidgets.QCheckBox(FitParameter)
|
||||
self.fixed_check.setObjectName("fixed_check")
|
||||
self.horizontalLayout_2.addWidget(self.fixed_check)
|
||||
self.global_checkbox = QtWidgets.QCheckBox(FitParameter)
|
||||
self.global_checkbox.setObjectName("global_checkbox")
|
||||
self.horizontalLayout_2.addWidget(self.global_checkbox)
|
||||
self.toolButton = QtWidgets.QToolButton(FitParameter)
|
||||
self.toolButton.setText("")
|
||||
self.toolButton.setPopupMode(QtWidgets.QToolButton.InstantPopup)
|
||||
self.toolButton.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.horizontalLayout_2.addWidget(self.toolButton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.frame = QtWidgets.QFrame(FitParameter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
self.frame.setSizePolicy(sizePolicy)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.checkBox = QtWidgets.QCheckBox(self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.checkBox.sizePolicy().hasHeightForWidth())
|
||||
self.checkBox.setSizePolicy(sizePolicy)
|
||||
self.checkBox.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.checkBox.setText("")
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.horizontalLayout.addWidget(self.checkBox)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.lineEdit.sizePolicy().hasHeightForWidth())
|
||||
self.lineEdit.setSizePolicy(sizePolicy)
|
||||
self.lineEdit.setText("")
|
||||
self.lineEdit.setFrame(True)
|
||||
self.lineEdit.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.label_3 = QtWidgets.QLabel(self.frame)
|
||||
self.label_3.setEnabled(True)
|
||||
self.label_3.setTextFormat(QtCore.Qt.RichText)
|
||||
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.horizontalLayout.addWidget(self.label_3)
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit_2.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.lineEdit_2.sizePolicy().hasHeightForWidth())
|
||||
self.lineEdit_2.setSizePolicy(sizePolicy)
|
||||
self.lineEdit_2.setText("")
|
||||
self.lineEdit_2.setFrame(True)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.horizontalLayout.addWidget(self.lineEdit_2)
|
||||
self.verticalLayout.addWidget(self.frame)
|
||||
self.line = QtWidgets.QFrame(FitParameter)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.verticalLayout.addWidget(self.line)
|
||||
|
||||
self.retranslateUi(FitParameter)
|
||||
QtCore.QMetaObject.connectSlotsByName(FitParameter)
|
||||
|
||||
def retranslateUi(self, FitParameter):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FitParameter.setWindowTitle(_translate("FitParameter", "Form"))
|
||||
self.parametername.setText(_translate("FitParameter", "A"))
|
||||
self.parameter_line.setToolTip(_translate("FitParameter", "Initial values"))
|
||||
self.parameter_line.setPlaceholderText(_translate("FitParameter", "0"))
|
||||
self.fixed_check.setText(_translate("FitParameter", "Fix"))
|
||||
self.global_checkbox.setText(_translate("FitParameter", "Global"))
|
||||
self.lineEdit.setToolTip(_translate("FitParameter", "<html><head/><body><p>Lower bound. Same bound is used for all data. Leave empty for no boundary condition.</p></body></html>"))
|
||||
self.label_3.setText(_translate("FitParameter", "Textlabel"))
|
||||
self.lineEdit_2.setToolTip(_translate("FitParameter", "<html><head/><body><p>Upper bound. Same bound is used for all data. Leave empty for no boundary condition.</p></body></html>"))
|
||||
from ..lib.forms import LineEdit
|
50
src/gui_qt/_py/fitparametertable.py
Normal file
50
src/gui_qt/_py/fitparametertable.py
Normal file
@ -0,0 +1,50 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitparametertable.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FitParameterDialog(object):
|
||||
def setupUi(self, FitParameterDialog):
|
||||
FitParameterDialog.setObjectName("FitParameterDialog")
|
||||
FitParameterDialog.resize(898, 583)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(FitParameterDialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.verticalLayout.addLayout(self.verticalLayout_2)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.pushButton = QtWidgets.QPushButton(FitParameterDialog)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.horizontalLayout.addWidget(self.pushButton)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(FitParameterDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth())
|
||||
self.buttonBox.setSizePolicy(sizePolicy)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close)
|
||||
self.buttonBox.setCenterButtons(False)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.horizontalLayout.addWidget(self.buttonBox)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.retranslateUi(FitParameterDialog)
|
||||
self.buttonBox.accepted.connect(FitParameterDialog.accept)
|
||||
self.buttonBox.rejected.connect(FitParameterDialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(FitParameterDialog)
|
||||
|
||||
def retranslateUi(self, FitParameterDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FitParameterDialog.setWindowTitle(_translate("FitParameterDialog", "Fitparameter"))
|
||||
self.pushButton.setText(_translate("FitParameterDialog", "Copy"))
|
70
src/gui_qt/_py/fitparameterwidget.py
Normal file
70
src/gui_qt/_py/fitparameterwidget.py
Normal file
@ -0,0 +1,70 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/fitparameterwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_FormFit(object):
|
||||
def setupUi(self, FormFit):
|
||||
FormFit.setObjectName("FormFit")
|
||||
FormFit.resize(292, 477)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(FormFit)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(FormFit)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.general_tab = QtWidgets.QWidget()
|
||||
self.general_tab.setObjectName("general_tab")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.general_tab)
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.scrollArea = QtWidgets.QScrollArea(self.general_tab)
|
||||
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.scrollArea.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollwidget = QtWidgets.QWidget()
|
||||
self.scrollwidget.setGeometry(QtCore.QRect(0, 0, 284, 442))
|
||||
self.scrollwidget.setObjectName("scrollwidget")
|
||||
self.scrollArea.setWidget(self.scrollwidget)
|
||||
self.verticalLayout_2.addWidget(self.scrollArea)
|
||||
self.tabWidget.addTab(self.general_tab, "")
|
||||
self.data_tab = QtWidgets.QWidget()
|
||||
self.data_tab.setObjectName("data_tab")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.data_tab)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.comboBox = QtWidgets.QComboBox(self.data_tab)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.verticalLayout_3.addWidget(self.comboBox)
|
||||
self.scrollArea2 = QtWidgets.QScrollArea(self.data_tab)
|
||||
self.scrollArea2.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea2.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.scrollArea2.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
|
||||
self.scrollArea2.setWidgetResizable(True)
|
||||
self.scrollArea2.setObjectName("scrollArea2")
|
||||
self.scrollwidget2 = QtWidgets.QWidget()
|
||||
self.scrollwidget2.setGeometry(QtCore.QRect(0, 0, 272, 392))
|
||||
self.scrollwidget2.setObjectName("scrollwidget2")
|
||||
self.scrollArea2.setWidget(self.scrollwidget2)
|
||||
self.verticalLayout_3.addWidget(self.scrollArea2)
|
||||
self.tabWidget.addTab(self.data_tab, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
|
||||
self.retranslateUi(FormFit)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(FormFit)
|
||||
|
||||
def retranslateUi(self, FormFit):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
FormFit.setWindowTitle(_translate("FormFit", "Form"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.general_tab), _translate("FormFit", "General settings"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.data_tab), _translate("FormFit", "Data parameter"))
|
194
src/gui_qt/_py/fitresult.py
Normal file
194
src/gui_qt/_py/fitresult.py
Normal file
@ -0,0 +1,194 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file './resources/_ui/fitresult.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(817, 584)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.sets_comboBox = ElideComboBox(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.sets_comboBox.sizePolicy().hasHeightForWidth())
|
||||
self.sets_comboBox.setSizePolicy(sizePolicy)
|
||||
self.sets_comboBox.setMaximumSize(QtCore.QSize(400, 16777215))
|
||||
self.sets_comboBox.setBaseSize(QtCore.QSize(200, 0))
|
||||
self.sets_comboBox.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToMinimumContentsLength)
|
||||
self.sets_comboBox.setObjectName("sets_comboBox")
|
||||
self.gridLayout.addWidget(self.sets_comboBox, 0, 0, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Retry)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 6, 0, 1, 2)
|
||||
self.param_tableWidget = QtWidgets.QTableWidget(Dialog)
|
||||
self.param_tableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
|
||||
self.param_tableWidget.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored)
|
||||
self.param_tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.param_tableWidget.setAlternatingRowColors(True)
|
||||
self.param_tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
|
||||
self.param_tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectColumns)
|
||||
self.param_tableWidget.setShowGrid(False)
|
||||
self.param_tableWidget.setColumnCount(0)
|
||||
self.param_tableWidget.setObjectName("param_tableWidget")
|
||||
self.param_tableWidget.setRowCount(0)
|
||||
self.param_tableWidget.horizontalHeader().setStretchLastSection(False)
|
||||
self.gridLayout.addWidget(self.param_tableWidget, 1, 0, 1, 1)
|
||||
self.groupBox = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox)
|
||||
self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_2.setSpacing(3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.graph_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.graph_checkBox.sizePolicy().hasHeightForWidth())
|
||||
self.graph_checkBox.setSizePolicy(sizePolicy)
|
||||
self.graph_checkBox.setChecked(True)
|
||||
self.graph_checkBox.setObjectName("graph_checkBox")
|
||||
self.gridLayout_2.addWidget(self.graph_checkBox, 1, 1, 1, 1)
|
||||
self.graph_comboBox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.graph_comboBox.setEnabled(False)
|
||||
self.graph_comboBox.setObjectName("graph_comboBox")
|
||||
self.gridLayout_2.addWidget(self.graph_comboBox, 1, 2, 1, 1)
|
||||
self.curve_checkbox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.curve_checkbox.setChecked(True)
|
||||
self.curve_checkbox.setObjectName("curve_checkbox")
|
||||
self.gridLayout_2.addWidget(self.curve_checkbox, 0, 0, 1, 1)
|
||||
self.partial_checkBox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.partial_checkBox.setObjectName("partial_checkBox")
|
||||
self.gridLayout_2.addWidget(self.partial_checkBox, 1, 0, 1, 1)
|
||||
self.parameter_checkbox = QtWidgets.QCheckBox(self.groupBox)
|
||||
self.parameter_checkbox.setChecked(True)
|
||||
self.parameter_checkbox.setObjectName("parameter_checkbox")
|
||||
self.gridLayout_2.addWidget(self.parameter_checkbox, 0, 1, 1, 1)
|
||||
self.gridLayout.addWidget(self.groupBox, 5, 0, 1, 2)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.reject_fit_checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
self.reject_fit_checkBox.setObjectName("reject_fit_checkBox")
|
||||
self.horizontalLayout_2.addWidget(self.reject_fit_checkBox)
|
||||
self.del_prev_checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
self.del_prev_checkBox.setObjectName("del_prev_checkBox")
|
||||
self.horizontalLayout_2.addWidget(self.del_prev_checkBox)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 1)
|
||||
self.line = QtWidgets.QFrame(Dialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 3, 0, 1, 2)
|
||||
self.stack = QtWidgets.QToolBox(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.stack.sizePolicy().hasHeightForWidth())
|
||||
self.stack.setSizePolicy(sizePolicy)
|
||||
self.stack.setObjectName("stack")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setGeometry(QtCore.QRect(0, 0, 399, 346))
|
||||
self.page.setObjectName("page")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.page)
|
||||
self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_3.setSpacing(3)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.logy_box = QtWidgets.QCheckBox(self.page)
|
||||
self.logy_box.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.logy_box.setObjectName("logy_box")
|
||||
self.gridLayout_3.addWidget(self.logy_box, 2, 1, 1, 1)
|
||||
self.logx_box = QtWidgets.QCheckBox(self.page)
|
||||
self.logx_box.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.logx_box.setObjectName("logx_box")
|
||||
self.gridLayout_3.addWidget(self.logx_box, 2, 0, 1, 1)
|
||||
self.graphicsView = GraphicsLayoutWidget(self.page)
|
||||
self.graphicsView.setObjectName("graphicsView")
|
||||
self.gridLayout_3.addWidget(self.graphicsView, 0, 0, 1, 2)
|
||||
self.stack.addItem(self.page, "")
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setGeometry(QtCore.QRect(0, 0, 399, 346))
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.page_2)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_2.setSpacing(3)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.stats_tableWidget = QtWidgets.QTableWidget(self.page_2)
|
||||
self.stats_tableWidget.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.stats_tableWidget.setGridStyle(QtCore.Qt.NoPen)
|
||||
self.stats_tableWidget.setColumnCount(1)
|
||||
self.stats_tableWidget.setObjectName("stats_tableWidget")
|
||||
self.stats_tableWidget.setRowCount(0)
|
||||
self.stats_tableWidget.horizontalHeader().setVisible(False)
|
||||
self.stats_tableWidget.horizontalHeader().setSortIndicatorShown(True)
|
||||
self.verticalLayout_2.addWidget(self.stats_tableWidget)
|
||||
self.stack.addItem(self.page_2, "")
|
||||
self.page_3 = QtWidgets.QWidget()
|
||||
self.page_3.setGeometry(QtCore.QRect(0, 0, 399, 346))
|
||||
self.page_3.setObjectName("page_3")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.page_3)
|
||||
self.verticalLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_3.setSpacing(3)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.corr_tableWidget = QtWidgets.QTableWidget(self.page_3)
|
||||
self.corr_tableWidget.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.corr_tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.corr_tableWidget.setGridStyle(QtCore.Qt.NoPen)
|
||||
self.corr_tableWidget.setObjectName("corr_tableWidget")
|
||||
self.corr_tableWidget.setColumnCount(4)
|
||||
self.corr_tableWidget.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.corr_tableWidget.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.corr_tableWidget.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.corr_tableWidget.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.corr_tableWidget.setHorizontalHeaderItem(3, item)
|
||||
self.corr_tableWidget.horizontalHeader().setStretchLastSection(True)
|
||||
self.corr_tableWidget.verticalHeader().setVisible(False)
|
||||
self.verticalLayout_3.addWidget(self.corr_tableWidget)
|
||||
self.stack.addItem(self.page_3, "")
|
||||
self.gridLayout.addWidget(self.stack, 0, 1, 3, 1)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.stack.setCurrentIndex(0)
|
||||
self.stack.layout().setSpacing(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Fit results"))
|
||||
self.groupBox.setTitle(_translate("Dialog", "Output"))
|
||||
self.graph_checkBox.setText(_translate("Dialog", "New graph"))
|
||||
self.curve_checkbox.setText(_translate("Dialog", "Plot fit curve"))
|
||||
self.partial_checkBox.setText(_translate("Dialog", "Plot partial functions"))
|
||||
self.parameter_checkbox.setText(_translate("Dialog", "Plot parameter"))
|
||||
self.reject_fit_checkBox.setText(_translate("Dialog", "Reject this fit"))
|
||||
self.del_prev_checkBox.setText(_translate("Dialog", "Delete previous fits"))
|
||||
self.logy_box.setText(_translate("Dialog", "logarithmic y axis"))
|
||||
self.logx_box.setText(_translate("Dialog", "logarithmic x axis"))
|
||||
self.stack.setItemText(self.stack.indexOf(self.page), _translate("Dialog", "Plot"))
|
||||
self.stack.setItemText(self.stack.indexOf(self.page_2), _translate("Dialog", "Statistics"))
|
||||
item = self.corr_tableWidget.horizontalHeaderItem(0)
|
||||
item.setText(_translate("Dialog", "Parameter 1"))
|
||||
item = self.corr_tableWidget.horizontalHeaderItem(1)
|
||||
item.setText(_translate("Dialog", "Parameter 2"))
|
||||
item = self.corr_tableWidget.horizontalHeaderItem(2)
|
||||
item.setText(_translate("Dialog", "Corr."))
|
||||
item = self.corr_tableWidget.horizontalHeaderItem(3)
|
||||
item.setText(_translate("Dialog", "Partial Corr."))
|
||||
self.stack.setItemText(self.stack.indexOf(self.page_3), _translate("Dialog", "Correlations"))
|
||||
from ..lib.forms import ElideComboBox
|
||||
from pyqtgraph import GraphicsLayoutWidget
|
58
src/gui_qt/_py/ftdialog.py
Normal file
58
src/gui_qt/_py/ftdialog.py
Normal file
@ -0,0 +1,58 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/ftdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(400, 300)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.listWidget = QtWidgets.QListWidget(Dialog)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.verticalLayout.addWidget(self.listWidget)
|
||||
self.mode_comboBox = QtWidgets.QComboBox(Dialog)
|
||||
self.mode_comboBox.setObjectName("mode_comboBox")
|
||||
self.mode_comboBox.addItem("")
|
||||
self.mode_comboBox.addItem("")
|
||||
self.mode_comboBox.addItem("")
|
||||
self.verticalLayout.addWidget(self.mode_comboBox)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.graph_checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
self.graph_checkBox.setObjectName("graph_checkBox")
|
||||
self.horizontalLayout.addWidget(self.graph_checkBox)
|
||||
self.graph_comboBox = QtWidgets.QComboBox(Dialog)
|
||||
self.graph_comboBox.setObjectName("graph_comboBox")
|
||||
self.horizontalLayout.addWidget(self.graph_comboBox)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Logarithmic Fourier"))
|
||||
self.mode_comboBox.setItemText(0, _translate("Dialog", "Real"))
|
||||
self.mode_comboBox.setItemText(1, _translate("Dialog", "Imag"))
|
||||
self.mode_comboBox.setItemText(2, _translate("Dialog", "Complex"))
|
||||
self.graph_checkBox.setText(_translate("Dialog", "New graph"))
|
123
src/gui_qt/_py/function_tree_widget.py
Normal file
123
src/gui_qt/_py/function_tree_widget.py
Normal file
@ -0,0 +1,123 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/function_tree_widget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(314, 232)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
|
||||
Form.setSizePolicy(sizePolicy)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.widget_2 = ExpandableWidget(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.widget_2.sizePolicy().hasHeightForWidth())
|
||||
self.widget_2.setSizePolicy(sizePolicy)
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.gridLayout.addWidget(self.widget_2, 4, 0, 1, 2)
|
||||
self.widget = QtWidgets.QWidget(Form)
|
||||
self.widget.setObjectName("widget")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.widget)
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.widget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.complex_comboBox = QtWidgets.QComboBox(self.widget)
|
||||
self.complex_comboBox.setObjectName("complex_comboBox")
|
||||
self.complex_comboBox.addItem("")
|
||||
self.complex_comboBox.addItem("")
|
||||
self.complex_comboBox.addItem("")
|
||||
self.gridLayout_2.addWidget(self.complex_comboBox, 1, 1, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.widget)
|
||||
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.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 2)
|
||||
self.gridLayout.addWidget(self.widget, 5, 0, 1, 2)
|
||||
self.use_function_button = QtWidgets.QToolButton(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.use_function_button.sizePolicy().hasHeightForWidth())
|
||||
self.use_function_button.setSizePolicy(sizePolicy)
|
||||
self.use_function_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.use_function_button.setAutoRaise(False)
|
||||
self.use_function_button.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.use_function_button.setObjectName("use_function_button")
|
||||
self.gridLayout.addWidget(self.use_function_button, 3, 1, 1, 1)
|
||||
self.fitcomboBox = QtWidgets.QComboBox(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fitcomboBox.sizePolicy().hasHeightForWidth())
|
||||
self.fitcomboBox.setSizePolicy(sizePolicy)
|
||||
self.fitcomboBox.setObjectName("fitcomboBox")
|
||||
self.gridLayout.addWidget(self.fitcomboBox, 1, 0, 1, 2)
|
||||
self.typecomboBox = QtWidgets.QComboBox(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.typecomboBox.sizePolicy().hasHeightForWidth())
|
||||
self.typecomboBox.setSizePolicy(sizePolicy)
|
||||
self.typecomboBox.setObjectName("typecomboBox")
|
||||
self.gridLayout.addWidget(self.typecomboBox, 0, 0, 1, 2)
|
||||
self.fitequation = QtWidgets.QLabel(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fitequation.sizePolicy().hasHeightForWidth())
|
||||
self.fitequation.setSizePolicy(sizePolicy)
|
||||
self.fitequation.setWordWrap(True)
|
||||
self.fitequation.setObjectName("fitequation")
|
||||
self.gridLayout.addWidget(self.fitequation, 2, 0, 1, 2)
|
||||
self.operator_combobox = QtWidgets.QComboBox(Form)
|
||||
self.operator_combobox.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
|
||||
self.operator_combobox.setFrame(True)
|
||||
self.operator_combobox.setObjectName("operator_combobox")
|
||||
self.operator_combobox.addItem("")
|
||||
self.operator_combobox.addItem("")
|
||||
self.operator_combobox.addItem("")
|
||||
self.operator_combobox.addItem("")
|
||||
self.gridLayout.addWidget(self.operator_combobox, 3, 0, 1, 1)
|
||||
self.comboBox_2 = QtWidgets.QComboBox(Form)
|
||||
self.comboBox_2.setObjectName("comboBox_2")
|
||||
self.gridLayout.addWidget(self.comboBox_2, 6, 0, 1, 2)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.label_2.setText(_translate("Form", "Select part to fit"))
|
||||
self.complex_comboBox.setItemText(0, _translate("Form", "Complex"))
|
||||
self.complex_comboBox.setItemText(1, _translate("Form", "Real"))
|
||||
self.complex_comboBox.setItemText(2, _translate("Form", "Imaginary"))
|
||||
self.label.setText(_translate("Form", "Complex function found"))
|
||||
self.use_function_button.setText(_translate("Form", "Use"))
|
||||
self.fitequation.setText(_translate("Form", "Equation"))
|
||||
self.operator_combobox.setItemText(0, _translate("Form", "Add"))
|
||||
self.operator_combobox.setItemText(1, _translate("Form", "Multiply"))
|
||||
self.operator_combobox.setItemText(2, _translate("Form", "Subtract"))
|
||||
self.operator_combobox.setItemText(3, _translate("Form", "Divide by"))
|
||||
from ..lib.expandablewidget import ExpandableWidget
|
276
src/gui_qt/_py/gol.py
Normal file
276
src/gui_qt/_py/gol.py
Normal file
@ -0,0 +1,276 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/gol.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(883, 732)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.widget = QtWidgets.QWidget(Form)
|
||||
self.widget.setObjectName("widget")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.widget)
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.vanish_shadow = QtWidgets.QRadioButton(self.widget)
|
||||
self.vanish_shadow.setChecked(True)
|
||||
self.vanish_shadow.setObjectName("vanish_shadow")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(Form)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.vanish_shadow)
|
||||
self.verticalLayout_3.addWidget(self.vanish_shadow)
|
||||
self.full_shadow = QtWidgets.QRadioButton(self.widget)
|
||||
self.full_shadow.setObjectName("full_shadow")
|
||||
self.buttonGroup.addButton(self.full_shadow)
|
||||
self.verticalLayout_3.addWidget(self.full_shadow)
|
||||
self.radioButton = QtWidgets.QRadioButton(self.widget)
|
||||
self.radioButton.setObjectName("radioButton")
|
||||
self.buttonGroup.addButton(self.radioButton)
|
||||
self.verticalLayout_3.addWidget(self.radioButton)
|
||||
self.line = QtWidgets.QFrame(self.widget)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.verticalLayout_3.addWidget(self.line)
|
||||
self.faster_button = QtWidgets.QToolButton(self.widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.faster_button.sizePolicy().hasHeightForWidth())
|
||||
self.faster_button.setSizePolicy(sizePolicy)
|
||||
self.faster_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.faster_button.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.faster_button.setObjectName("faster_button")
|
||||
self.verticalLayout_3.addWidget(self.faster_button)
|
||||
self.velocity_label = QtWidgets.QLabel(self.widget)
|
||||
self.velocity_label.setObjectName("velocity_label")
|
||||
self.verticalLayout_3.addWidget(self.velocity_label)
|
||||
self.slower_button = QtWidgets.QToolButton(self.widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.slower_button.sizePolicy().hasHeightForWidth())
|
||||
self.slower_button.setSizePolicy(sizePolicy)
|
||||
self.slower_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.slower_button.setArrowType(QtCore.Qt.LeftArrow)
|
||||
self.slower_button.setObjectName("slower_button")
|
||||
self.verticalLayout_3.addWidget(self.slower_button)
|
||||
self.current_step = QtWidgets.QLabel(self.widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.current_step.sizePolicy().hasHeightForWidth())
|
||||
self.current_step.setSizePolicy(sizePolicy)
|
||||
self.current_step.setObjectName("current_step")
|
||||
self.verticalLayout_3.addWidget(self.current_step)
|
||||
self.pause_button = QtWidgets.QPushButton(self.widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pause_button.sizePolicy().hasHeightForWidth())
|
||||
self.pause_button.setSizePolicy(sizePolicy)
|
||||
self.pause_button.setCheckable(True)
|
||||
self.pause_button.setObjectName("pause_button")
|
||||
self.verticalLayout_3.addWidget(self.pause_button)
|
||||
self.line_3 = QtWidgets.QFrame(self.widget)
|
||||
self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_3.setObjectName("line_3")
|
||||
self.verticalLayout_3.addWidget(self.line_3)
|
||||
self.label_6 = QtWidgets.QLabel(self.widget)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.verticalLayout_3.addWidget(self.label_6)
|
||||
self.cover_label = QtWidgets.QLabel(self.widget)
|
||||
self.cover_label.setText("")
|
||||
self.cover_label.setObjectName("cover_label")
|
||||
self.verticalLayout_3.addWidget(self.cover_label)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_3.addItem(spacerItem)
|
||||
self.gridLayout_2.addWidget(self.widget, 0, 0, 1, 1)
|
||||
self.view = QtWidgets.QGraphicsView(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.view.sizePolicy().hasHeightForWidth())
|
||||
self.view.setSizePolicy(sizePolicy)
|
||||
self.view.setStyleSheet("background-color: transparent")
|
||||
self.view.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.view.setObjectName("view")
|
||||
self.gridLayout_2.addWidget(self.view, 0, 1, 1, 1)
|
||||
self.option_frame = QtWidgets.QFrame(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.option_frame.sizePolicy().hasHeightForWidth())
|
||||
self.option_frame.setSizePolicy(sizePolicy)
|
||||
self.option_frame.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.option_frame.setObjectName("option_frame")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.option_frame)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setHorizontalSpacing(6)
|
||||
self.gridLayout.setVerticalSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.rule_label = QtWidgets.QLabel(self.option_frame)
|
||||
self.rule_label.setObjectName("rule_label")
|
||||
self.horizontalLayout_2.addWidget(self.rule_label)
|
||||
self.rule_cb = QtWidgets.QComboBox(self.option_frame)
|
||||
self.rule_cb.setObjectName("rule_cb")
|
||||
self.horizontalLayout_2.addWidget(self.rule_cb)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_2, 3, 0, 1, 1)
|
||||
self.line_2 = QtWidgets.QFrame(self.option_frame)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout.addWidget(self.line_2, 2, 0, 1, 1)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setContentsMargins(-1, 0, -1, 0)
|
||||
self.verticalLayout_2.setSpacing(3)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.object_widget = QtWidgets.QWidget(self.option_frame)
|
||||
self.object_widget.setObjectName("object_widget")
|
||||
self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.object_widget)
|
||||
self.horizontalLayout_6.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_6.setSpacing(3)
|
||||
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||
self.label_5 = QtWidgets.QLabel(self.object_widget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_6.addWidget(self.label_5)
|
||||
self.object_size = QtWidgets.QSpinBox(self.object_widget)
|
||||
self.object_size.setMinimum(1)
|
||||
self.object_size.setMaximum(600)
|
||||
self.object_size.setObjectName("object_size")
|
||||
self.horizontalLayout_6.addWidget(self.object_size)
|
||||
self.verticalLayout_2.addWidget(self.object_widget)
|
||||
self.rand_button_wdgt = QtWidgets.QWidget(self.option_frame)
|
||||
self.rand_button_wdgt.setObjectName("rand_button_wdgt")
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.rand_button_wdgt)
|
||||
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_7.setSpacing(3)
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.add_random_button = QtWidgets.QPushButton(self.rand_button_wdgt)
|
||||
self.add_random_button.setObjectName("add_random_button")
|
||||
self.horizontalLayout_7.addWidget(self.add_random_button)
|
||||
self.remove_random_button = QtWidgets.QPushButton(self.rand_button_wdgt)
|
||||
self.remove_random_button.setObjectName("remove_random_button")
|
||||
self.horizontalLayout_7.addWidget(self.remove_random_button)
|
||||
self.verticalLayout_2.addWidget(self.rand_button_wdgt)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout)
|
||||
self.gridLayout.addLayout(self.verticalLayout_2, 2, 1, 4, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label_3 = QtWidgets.QLabel(self.option_frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
|
||||
self.label_3.setSizePolicy(sizePolicy)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.horizontalLayout.addWidget(self.label_3)
|
||||
self.survival_line = QtWidgets.QLineEdit(self.option_frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.survival_line.sizePolicy().hasHeightForWidth())
|
||||
self.survival_line.setSizePolicy(sizePolicy)
|
||||
self.survival_line.setObjectName("survival_line")
|
||||
self.horizontalLayout.addWidget(self.survival_line)
|
||||
self.label_4 = QtWidgets.QLabel(self.option_frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
|
||||
self.label_4.setSizePolicy(sizePolicy)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout.addWidget(self.label_4)
|
||||
self.birth_line = QtWidgets.QLineEdit(self.option_frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.birth_line.sizePolicy().hasHeightForWidth())
|
||||
self.birth_line.setSizePolicy(sizePolicy)
|
||||
self.birth_line.setObjectName("birth_line")
|
||||
self.horizontalLayout.addWidget(self.birth_line)
|
||||
self.gridLayout.addLayout(self.horizontalLayout, 4, 0, 1, 1)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label = QtWidgets.QLabel(self.option_frame)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout_3.addWidget(self.label)
|
||||
self.width_box = QtWidgets.QSpinBox(self.option_frame)
|
||||
self.width_box.setMaximum(600)
|
||||
self.width_box.setProperty("value", 100)
|
||||
self.width_box.setObjectName("width_box")
|
||||
self.horizontalLayout_3.addWidget(self.width_box)
|
||||
self.label_2 = QtWidgets.QLabel(self.option_frame)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_3.addWidget(self.label_2)
|
||||
self.height_box = QtWidgets.QSpinBox(self.option_frame)
|
||||
self.height_box.setMaximum(600)
|
||||
self.height_box.setProperty("value", 100)
|
||||
self.height_box.setObjectName("height_box")
|
||||
self.horizontalLayout_3.addWidget(self.height_box)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_3, 1, 0, 1, 1)
|
||||
self.object_combobox = QtWidgets.QComboBox(self.option_frame)
|
||||
self.object_combobox.setObjectName("object_combobox")
|
||||
self.object_combobox.addItem("")
|
||||
self.object_combobox.addItem("")
|
||||
self.object_combobox.addItem("")
|
||||
self.object_combobox.addItem("")
|
||||
self.object_combobox.addItem("")
|
||||
self.gridLayout.addWidget(self.object_combobox, 1, 1, 1, 1)
|
||||
self.start_button = QtWidgets.QPushButton(self.option_frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.start_button.sizePolicy().hasHeightForWidth())
|
||||
self.start_button.setSizePolicy(sizePolicy)
|
||||
self.start_button.setObjectName("start_button")
|
||||
self.gridLayout.addWidget(self.start_button, 0, 0, 1, 2)
|
||||
self.gridLayout_2.addWidget(self.option_frame, 1, 1, 1, 1)
|
||||
self.hide_button = QtWidgets.QCheckBox(Form)
|
||||
self.hide_button.setObjectName("hide_button")
|
||||
self.gridLayout_2.addWidget(self.hide_button, 1, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Game Of Life"))
|
||||
self.vanish_shadow.setText(_translate("Form", "Motion blur"))
|
||||
self.full_shadow.setText(_translate("Form", "Scorched earth"))
|
||||
self.radioButton.setText(_translate("Form", "Nothing"))
|
||||
self.faster_button.setText(_translate("Form", "Faster"))
|
||||
self.velocity_label.setText(_translate("Form", "10 steps / s"))
|
||||
self.slower_button.setText(_translate("Form", "Slower"))
|
||||
self.current_step.setText(_translate("Form", "0 step"))
|
||||
self.pause_button.setText(_translate("Form", "Pause"))
|
||||
self.label_6.setText(_translate("Form", "Coverage:"))
|
||||
self.rule_label.setText(_translate("Form", "Rule"))
|
||||
self.label_5.setText(_translate("Form", "Size"))
|
||||
self.add_random_button.setText(_translate("Form", "Add Random"))
|
||||
self.remove_random_button.setText(_translate("Form", "Remove Random"))
|
||||
self.label_3.setText(_translate("Form", "Survival"))
|
||||
self.label_4.setText(_translate("Form", " Birth"))
|
||||
self.label.setText(_translate("Form", "Width"))
|
||||
self.label_2.setText(_translate("Form", "Height"))
|
||||
self.object_combobox.setItemText(0, _translate("Form", "Random"))
|
||||
self.object_combobox.setItemText(1, _translate("Form", "Circle"))
|
||||
self.object_combobox.setItemText(2, _translate("Form", "Square"))
|
||||
self.object_combobox.setItemText(3, _translate("Form", "Diamond"))
|
||||
self.object_combobox.setItemText(4, _translate("Form", "Plus"))
|
||||
self.start_button.setText(_translate("Form", "Start"))
|
||||
self.hide_button.setText(_translate("Form", "Hide options"))
|
56
src/gui_qt/_py/gracemsgdialog.py
Normal file
56
src/gui_qt/_py/gracemsgdialog.py
Normal file
@ -0,0 +1,56 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/gracemsgdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_GraceMsgDialog(object):
|
||||
def setupUi(self, GraceMsgDialog):
|
||||
GraceMsgDialog.setObjectName("GraceMsgDialog")
|
||||
GraceMsgDialog.resize(400, 300)
|
||||
self.gridLayout = QtWidgets.QGridLayout(GraceMsgDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.graph_combo = QtWidgets.QComboBox(GraceMsgDialog)
|
||||
self.graph_combo.setObjectName("graph_combo")
|
||||
self.gridLayout.addWidget(self.graph_combo, 1, 1, 1, 1)
|
||||
self.graph_button = QtWidgets.QRadioButton(GraceMsgDialog)
|
||||
self.graph_button.setObjectName("graph_button")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(GraceMsgDialog)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.graph_button)
|
||||
self.gridLayout.addWidget(self.graph_button, 1, 0, 1, 1)
|
||||
self.overwrite_button = QtWidgets.QRadioButton(GraceMsgDialog)
|
||||
self.overwrite_button.setChecked(True)
|
||||
self.overwrite_button.setObjectName("overwrite_button")
|
||||
self.buttonGroup.addButton(self.overwrite_button)
|
||||
self.gridLayout.addWidget(self.overwrite_button, 0, 0, 1, 1)
|
||||
self.radioButton = QtWidgets.QRadioButton(GraceMsgDialog)
|
||||
self.radioButton.setObjectName("radioButton")
|
||||
self.buttonGroup.addButton(self.radioButton)
|
||||
self.gridLayout.addWidget(self.radioButton, 2, 0, 1, 1)
|
||||
self.tableWidget = QtWidgets.QTableWidget(GraceMsgDialog)
|
||||
self.tableWidget.setColumnCount(2)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setRowCount(0)
|
||||
self.tableWidget.horizontalHeader().setVisible(False)
|
||||
self.gridLayout.addWidget(self.tableWidget, 3, 0, 2, 2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(GraceMsgDialog)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2)
|
||||
|
||||
self.retranslateUi(GraceMsgDialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(GraceMsgDialog)
|
||||
|
||||
def retranslateUi(self, GraceMsgDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
GraceMsgDialog.setWindowTitle(_translate("GraceMsgDialog", "Goodness gracious, file already exists."))
|
||||
self.graph_button.setText(_translate("GraceMsgDialog", "Add to graph"))
|
||||
self.overwrite_button.setText(_translate("GraceMsgDialog", "Overwrite file"))
|
||||
self.radioButton.setText(_translate("GraceMsgDialog", "Replace sets"))
|
92
src/gui_qt/_py/gracereader.py
Normal file
92
src/gui_qt/_py/gracereader.py
Normal file
@ -0,0 +1,92 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/gracereader.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(400, 613)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.treeWidget = QtWidgets.QTreeWidget(Dialog)
|
||||
self.treeWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.treeWidget.setObjectName("treeWidget")
|
||||
self.treeWidget.headerItem().setText(0, "1")
|
||||
self.treeWidget.header().setVisible(False)
|
||||
self.verticalLayout.addWidget(self.treeWidget)
|
||||
self.tableWidget = QtWidgets.QTableWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tableWidget.sizePolicy().hasHeightForWidth())
|
||||
self.tableWidget.setSizePolicy(sizePolicy)
|
||||
self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.tableWidget.setGridStyle(QtCore.Qt.NoPen)
|
||||
self.tableWidget.setRowCount(4)
|
||||
self.tableWidget.setColumnCount(2)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(0, 0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(0, 1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(1, 0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(1, 1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(2, 0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(2, 1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(3, 0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(3, 1, item)
|
||||
self.tableWidget.horizontalHeader().setVisible(False)
|
||||
self.tableWidget.horizontalHeader().setStretchLastSection(True)
|
||||
self.tableWidget.verticalHeader().setVisible(False)
|
||||
self.verticalLayout.addWidget(self.tableWidget)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Load data from agr"))
|
||||
self.label.setText(_translate("Dialog", "Only data will be loaded, no line and symbol properties!"))
|
||||
__sortingEnabled = self.tableWidget.isSortingEnabled()
|
||||
self.tableWidget.setSortingEnabled(False)
|
||||
item = self.tableWidget.item(0, 0)
|
||||
item.setText(_translate("Dialog", "Symbol"))
|
||||
item = self.tableWidget.item(1, 0)
|
||||
item.setText(_translate("Dialog", "Symbol color"))
|
||||
item = self.tableWidget.item(2, 0)
|
||||
item.setText(_translate("Dialog", "Linestyle"))
|
||||
item = self.tableWidget.item(3, 0)
|
||||
item.setText(_translate("Dialog", "Line color"))
|
||||
self.tableWidget.setSortingEnabled(__sortingEnabled)
|
275
src/gui_qt/_py/graph.py
Normal file
275
src/gui_qt/_py/graph.py
Normal file
@ -0,0 +1,275 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/graph.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_GraphWindow(object):
|
||||
def setupUi(self, GraphWindow):
|
||||
GraphWindow.setObjectName("GraphWindow")
|
||||
GraphWindow.resize(680, 520)
|
||||
GraphWindow.setBaseSize(QtCore.QSize(300, 10))
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(GraphWindow)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.widget = QtWidgets.QWidget(GraphWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth())
|
||||
self.widget.setSizePolicy(sizePolicy)
|
||||
self.widget.setObjectName("widget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(1)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.logx_button = QtWidgets.QToolButton(self.widget)
|
||||
self.logx_button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.logx_button.setCheckable(True)
|
||||
self.logx_button.setAutoRaise(True)
|
||||
self.logx_button.setObjectName("logx_button")
|
||||
self.horizontalLayout.addWidget(self.logx_button)
|
||||
self.logy_button = QtWidgets.QToolButton(self.widget)
|
||||
self.logy_button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.logy_button.setCheckable(True)
|
||||
self.logy_button.setAutoRaise(True)
|
||||
self.logy_button.setObjectName("logy_button")
|
||||
self.horizontalLayout.addWidget(self.logy_button)
|
||||
self.line = QtWidgets.QFrame(self.widget)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.horizontalLayout.addWidget(self.line)
|
||||
self.gridbutton = QtWidgets.QToolButton(self.widget)
|
||||
self.gridbutton.setCheckable(True)
|
||||
self.gridbutton.setAutoRaise(True)
|
||||
self.gridbutton.setObjectName("gridbutton")
|
||||
self.horizontalLayout.addWidget(self.gridbutton)
|
||||
self.bwbutton = QtWidgets.QToolButton(self.widget)
|
||||
self.bwbutton.setCheckable(True)
|
||||
self.bwbutton.setAutoRaise(True)
|
||||
self.bwbutton.setObjectName("bwbutton")
|
||||
self.horizontalLayout.addWidget(self.bwbutton)
|
||||
self.line_2 = QtWidgets.QFrame(self.widget)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.horizontalLayout.addWidget(self.line_2)
|
||||
self.legend_button = QtWidgets.QToolButton(self.widget)
|
||||
self.legend_button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.legend_button.setCheckable(True)
|
||||
self.legend_button.setAutoRaise(True)
|
||||
self.legend_button.setObjectName("legend_button")
|
||||
self.horizontalLayout.addWidget(self.legend_button)
|
||||
self.imag_button = QtWidgets.QToolButton(self.widget)
|
||||
self.imag_button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.imag_button.setCheckable(True)
|
||||
self.imag_button.setChecked(True)
|
||||
self.imag_button.setAutoRaise(True)
|
||||
self.imag_button.setObjectName("imag_button")
|
||||
self.horizontalLayout.addWidget(self.imag_button)
|
||||
self.real_button = QtWidgets.QToolButton(self.widget)
|
||||
self.real_button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.real_button.setCheckable(True)
|
||||
self.real_button.setChecked(True)
|
||||
self.real_button.setAutoRaise(True)
|
||||
self.real_button.setObjectName("real_button")
|
||||
self.horizontalLayout.addWidget(self.real_button)
|
||||
self.error_button = QtWidgets.QToolButton(self.widget)
|
||||
self.error_button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.error_button.setCheckable(True)
|
||||
self.error_button.setAutoRaise(True)
|
||||
self.error_button.setObjectName("error_button")
|
||||
self.horizontalLayout.addWidget(self.error_button)
|
||||
self.line_3 = QtWidgets.QFrame(self.widget)
|
||||
self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_3.setObjectName("line_3")
|
||||
self.horizontalLayout.addWidget(self.line_3)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.limit_button = QtWidgets.QToolButton(self.widget)
|
||||
self.limit_button.setCheckable(True)
|
||||
self.limit_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.limit_button.setAutoRaise(True)
|
||||
self.limit_button.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.limit_button.setObjectName("limit_button")
|
||||
self.horizontalLayout.addWidget(self.limit_button)
|
||||
self.label_button = QtWidgets.QToolButton(self.widget)
|
||||
self.label_button.setCheckable(True)
|
||||
self.label_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.label_button.setAutoRaise(True)
|
||||
self.label_button.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.label_button.setObjectName("label_button")
|
||||
self.horizontalLayout.addWidget(self.label_button)
|
||||
self.verticalLayout.addWidget(self.widget)
|
||||
self.line_4 = QtWidgets.QFrame(GraphWindow)
|
||||
self.line_4.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_4.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_4.setObjectName("line_4")
|
||||
self.verticalLayout.addWidget(self.line_4)
|
||||
self.limit_widget = QtWidgets.QWidget(GraphWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.limit_widget.sizePolicy().hasHeightForWidth())
|
||||
self.limit_widget.setSizePolicy(sizePolicy)
|
||||
self.limit_widget.setObjectName("limit_widget")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.limit_widget)
|
||||
self.horizontalLayout_2.setContentsMargins(1, 1, 1, 1)
|
||||
self.horizontalLayout_2.setSpacing(2)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label = QtWidgets.QLabel(self.limit_widget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout_2.addWidget(self.label)
|
||||
self.xmin_lineedit = QtWidgets.QLineEdit(self.limit_widget)
|
||||
self.xmin_lineedit.setObjectName("xmin_lineedit")
|
||||
self.horizontalLayout_2.addWidget(self.xmin_lineedit)
|
||||
self.label_2 = QtWidgets.QLabel(self.limit_widget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
self.xmax_lineedit = QtWidgets.QLineEdit(self.limit_widget)
|
||||
self.xmax_lineedit.setObjectName("xmax_lineedit")
|
||||
self.horizontalLayout_2.addWidget(self.xmax_lineedit)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.label_3 = QtWidgets.QLabel(self.limit_widget)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.horizontalLayout_2.addWidget(self.label_3)
|
||||
self.ymin_lineedit = QtWidgets.QLineEdit(self.limit_widget)
|
||||
self.ymin_lineedit.setObjectName("ymin_lineedit")
|
||||
self.horizontalLayout_2.addWidget(self.ymin_lineedit)
|
||||
self.label_4 = QtWidgets.QLabel(self.limit_widget)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout_2.addWidget(self.label_4)
|
||||
self.ymax_lineedit = QtWidgets.QLineEdit(self.limit_widget)
|
||||
self.ymax_lineedit.setObjectName("ymax_lineedit")
|
||||
self.horizontalLayout_2.addWidget(self.ymax_lineedit)
|
||||
self.apply_button = QtWidgets.QPushButton(self.limit_widget)
|
||||
icon = QtGui.QIcon.fromTheme("dialog-ok")
|
||||
self.apply_button.setIcon(icon)
|
||||
self.apply_button.setObjectName("apply_button")
|
||||
self.horizontalLayout_2.addWidget(self.apply_button)
|
||||
self.verticalLayout.addWidget(self.limit_widget)
|
||||
self.label_widget = QtWidgets.QWidget(GraphWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_widget.sizePolicy().hasHeightForWidth())
|
||||
self.label_widget.setSizePolicy(sizePolicy)
|
||||
self.label_widget.setObjectName("label_widget")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.label_widget)
|
||||
self.horizontalLayout_3.setContentsMargins(1, 1, 1, 1)
|
||||
self.horizontalLayout_3.setSpacing(2)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_5 = QtWidgets.QLabel(self.label_widget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_3.addWidget(self.label_5)
|
||||
self.title_lineedit = QtWidgets.QLineEdit(self.label_widget)
|
||||
self.title_lineedit.setObjectName("title_lineedit")
|
||||
self.horizontalLayout_3.addWidget(self.title_lineedit)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem2)
|
||||
self.label_6 = QtWidgets.QLabel(self.label_widget)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.horizontalLayout_3.addWidget(self.label_6)
|
||||
self.xaxis_linedit = QtWidgets.QLineEdit(self.label_widget)
|
||||
self.xaxis_linedit.setObjectName("xaxis_linedit")
|
||||
self.horizontalLayout_3.addWidget(self.xaxis_linedit)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem3)
|
||||
self.label_7 = QtWidgets.QLabel(self.label_widget)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.horizontalLayout_3.addWidget(self.label_7)
|
||||
self.yaxis_linedit = QtWidgets.QLineEdit(self.label_widget)
|
||||
self.yaxis_linedit.setObjectName("yaxis_linedit")
|
||||
self.horizontalLayout_3.addWidget(self.yaxis_linedit)
|
||||
self.verticalLayout.addWidget(self.label_widget)
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setHorizontalSpacing(3)
|
||||
self.gridLayout.setVerticalSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.listWidget = QtWidgets.QListWidget(GraphWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
|
||||
self.listWidget.setSizePolicy(sizePolicy)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.gridLayout.addWidget(self.listWidget, 1, 1, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(GraphWindow)
|
||||
self.checkBox.setChecked(True)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout.addWidget(self.checkBox, 0, 1, 1, 1)
|
||||
self.graphic = PlotWidget(GraphWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.graphic.sizePolicy().hasHeightForWidth())
|
||||
self.graphic.setSizePolicy(sizePolicy)
|
||||
self.graphic.setObjectName("graphic")
|
||||
self.gridLayout.addWidget(self.graphic, 0, 0, 2, 1)
|
||||
self.verticalLayout.addLayout(self.gridLayout)
|
||||
self.label.setBuddy(self.xmin_lineedit)
|
||||
self.label_2.setBuddy(self.xmax_lineedit)
|
||||
self.label_3.setBuddy(self.ymin_lineedit)
|
||||
self.label_4.setBuddy(self.ymax_lineedit)
|
||||
self.label_5.setBuddy(self.title_lineedit)
|
||||
self.label_6.setBuddy(self.xaxis_linedit)
|
||||
self.label_7.setBuddy(self.yaxis_linedit)
|
||||
|
||||
self.retranslateUi(GraphWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(GraphWindow)
|
||||
GraphWindow.setTabOrder(self.logx_button, self.logy_button)
|
||||
GraphWindow.setTabOrder(self.logy_button, self.gridbutton)
|
||||
GraphWindow.setTabOrder(self.gridbutton, self.legend_button)
|
||||
GraphWindow.setTabOrder(self.legend_button, self.imag_button)
|
||||
GraphWindow.setTabOrder(self.imag_button, self.error_button)
|
||||
GraphWindow.setTabOrder(self.error_button, self.limit_button)
|
||||
GraphWindow.setTabOrder(self.limit_button, self.label_button)
|
||||
GraphWindow.setTabOrder(self.label_button, self.xmin_lineedit)
|
||||
GraphWindow.setTabOrder(self.xmin_lineedit, self.xmax_lineedit)
|
||||
GraphWindow.setTabOrder(self.xmax_lineedit, self.ymin_lineedit)
|
||||
GraphWindow.setTabOrder(self.ymin_lineedit, self.ymax_lineedit)
|
||||
GraphWindow.setTabOrder(self.ymax_lineedit, self.title_lineedit)
|
||||
GraphWindow.setTabOrder(self.title_lineedit, self.xaxis_linedit)
|
||||
GraphWindow.setTabOrder(self.xaxis_linedit, self.yaxis_linedit)
|
||||
|
||||
def retranslateUi(self, GraphWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
GraphWindow.setWindowTitle(_translate("GraphWindow", "Form"))
|
||||
self.logx_button.setToolTip(_translate("GraphWindow", "Change x axis linear <-> logarithmic"))
|
||||
self.logx_button.setText(_translate("GraphWindow", "Log X"))
|
||||
self.logy_button.setToolTip(_translate("GraphWindow", "Change y axis linear <-> logarithmic"))
|
||||
self.logy_button.setText(_translate("GraphWindow", "Log Y"))
|
||||
self.gridbutton.setToolTip(_translate("GraphWindow", "Show/hide grid"))
|
||||
self.gridbutton.setText(_translate("GraphWindow", "Grid"))
|
||||
self.bwbutton.setToolTip(_translate("GraphWindow", "Change background"))
|
||||
self.bwbutton.setText(_translate("GraphWindow", "Black/white"))
|
||||
self.legend_button.setToolTip(_translate("GraphWindow", "Change legend"))
|
||||
self.legend_button.setText(_translate("GraphWindow", "Legend"))
|
||||
self.imag_button.setToolTip(_translate("GraphWindow", "Show/hide imaginary part"))
|
||||
self.imag_button.setText(_translate("GraphWindow", "Imaginary"))
|
||||
self.real_button.setToolTip(_translate("GraphWindow", "Show/hide real part"))
|
||||
self.real_button.setText(_translate("GraphWindow", "Real"))
|
||||
self.error_button.setToolTip(_translate("GraphWindow", "Show/hide errorbars"))
|
||||
self.error_button.setText(_translate("GraphWindow", "Errorbars"))
|
||||
self.limit_button.setText(_translate("GraphWindow", "Limits"))
|
||||
self.label_button.setText(_translate("GraphWindow", "Labels"))
|
||||
self.label.setText(_translate("GraphWindow", "X: "))
|
||||
self.label_2.setText(_translate("GraphWindow", "---"))
|
||||
self.label_3.setText(_translate("GraphWindow", "Y: "))
|
||||
self.label_4.setText(_translate("GraphWindow", "---"))
|
||||
self.apply_button.setText(_translate("GraphWindow", "Apply"))
|
||||
self.label_5.setText(_translate("GraphWindow", "Title"))
|
||||
self.label_6.setText(_translate("GraphWindow", "X Axis"))
|
||||
self.label_7.setText(_translate("GraphWindow", "Y Axis"))
|
||||
self.checkBox.setText(_translate("GraphWindow", "Show legend"))
|
||||
from pyqtgraph import PlotWidget
|
121
src/gui_qt/_py/guidelinewidget.py
Normal file
121
src/gui_qt/_py/guidelinewidget.py
Normal file
@ -0,0 +1,121 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/guidelinewidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(431, 799)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_2.setSpacing(3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.mode_comboBox = QtWidgets.QComboBox(Form)
|
||||
self.mode_comboBox.setObjectName("mode_comboBox")
|
||||
self.mode_comboBox.addItem("")
|
||||
self.mode_comboBox.addItem("")
|
||||
self.gridLayout_2.addWidget(self.mode_comboBox, 2, 0, 1, 2)
|
||||
self.graph_comboBox = QtWidgets.QComboBox(Form)
|
||||
self.graph_comboBox.setObjectName("graph_comboBox")
|
||||
self.gridLayout_2.addWidget(self.graph_comboBox, 0, 0, 1, 2)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.diagonal_widget = QtWidgets.QWidget(Form)
|
||||
self.diagonal_widget.setObjectName("diagonal_widget")
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.diagonal_widget)
|
||||
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.horizontalLayout_2.addWidget(self.diagonal_widget)
|
||||
self.vh_widget = QtWidgets.QWidget(Form)
|
||||
self.vh_widget.setObjectName("vh_widget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.vh_widget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.vh_widget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.vh_pos_lineEdit = QtWidgets.QLineEdit(self.vh_widget)
|
||||
self.vh_pos_lineEdit.setObjectName("vh_pos_lineEdit")
|
||||
self.horizontalLayout.addWidget(self.vh_pos_lineEdit)
|
||||
self.horizontalLayout_2.addWidget(self.vh_widget)
|
||||
self.drag_checkBox = QtWidgets.QCheckBox(Form)
|
||||
self.drag_checkBox.setChecked(True)
|
||||
self.drag_checkBox.setObjectName("drag_checkBox")
|
||||
self.horizontalLayout_2.addWidget(self.drag_checkBox)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout_2, 3, 0, 1, 2)
|
||||
self.color_comboBox = ColorListEditor(Form)
|
||||
self.color_comboBox.setObjectName("color_comboBox")
|
||||
self.gridLayout_2.addWidget(self.color_comboBox, 6, 1, 1, 1)
|
||||
self.pushButton = QtWidgets.QPushButton(Form)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.gridLayout_2.addWidget(self.pushButton, 7, 0, 1, 2)
|
||||
self.label_6 = QtWidgets.QLabel(Form)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout_2.addWidget(self.label_6, 5, 0, 1, 1)
|
||||
self.comment_lineEdit = QtWidgets.QLineEdit(Form)
|
||||
self.comment_lineEdit.setObjectName("comment_lineEdit")
|
||||
self.gridLayout_2.addWidget(self.comment_lineEdit, 5, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout_2.addWidget(self.label_2, 6, 0, 1, 1)
|
||||
self.tableWidget = QtWidgets.QTableWidget(Form)
|
||||
self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
|
||||
self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.tableWidget.setColumnCount(2)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(1, item)
|
||||
self.tableWidget.horizontalHeader().setVisible(True)
|
||||
self.tableWidget.horizontalHeader().setStretchLastSection(True)
|
||||
self.gridLayout_2.addWidget(self.tableWidget, 8, 0, 1, 2)
|
||||
self.line = QtWidgets.QFrame(Form)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout_2.addWidget(self.line, 1, 0, 1, 2)
|
||||
self.line_2 = QtWidgets.QFrame(Form)
|
||||
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, 4, 0, 1, 2)
|
||||
self.label.setBuddy(self.vh_pos_lineEdit)
|
||||
self.label_6.setBuddy(self.comment_lineEdit)
|
||||
self.label_2.setBuddy(self.color_comboBox)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
Form.setTabOrder(self.graph_comboBox, self.mode_comboBox)
|
||||
Form.setTabOrder(self.mode_comboBox, self.vh_pos_lineEdit)
|
||||
Form.setTabOrder(self.vh_pos_lineEdit, self.drag_checkBox)
|
||||
Form.setTabOrder(self.drag_checkBox, self.comment_lineEdit)
|
||||
Form.setTabOrder(self.comment_lineEdit, self.color_comboBox)
|
||||
Form.setTabOrder(self.color_comboBox, self.pushButton)
|
||||
Form.setTabOrder(self.pushButton, self.tableWidget)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.mode_comboBox.setItemText(0, _translate("Form", "Vertical"))
|
||||
self.mode_comboBox.setItemText(1, _translate("Form", "Horizontal"))
|
||||
self.label.setText(_translate("Form", "Position"))
|
||||
self.vh_pos_lineEdit.setText(_translate("Form", "0"))
|
||||
self.drag_checkBox.setText(_translate("Form", "Drag enabled"))
|
||||
self.pushButton.setText(_translate("Form", "Create line"))
|
||||
self.label_6.setText(_translate("Form", "Comment"))
|
||||
self.label_2.setText(_translate("Form", "Color"))
|
||||
item = self.tableWidget.horizontalHeaderItem(0)
|
||||
item.setText(_translate("Form", "Pos."))
|
||||
item = self.tableWidget.horizontalHeaderItem(1)
|
||||
item.setText(_translate("Form", "Comment"))
|
||||
from ..lib.delegates import ColorListEditor
|
80
src/gui_qt/_py/hdftree.py
Normal file
80
src/gui_qt/_py/hdftree.py
Normal file
@ -0,0 +1,80 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/hdftree.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Hdf_Dialog(object):
|
||||
def setupUi(self, Hdf_Dialog):
|
||||
Hdf_Dialog.setObjectName("Hdf_Dialog")
|
||||
Hdf_Dialog.resize(460, 772)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Hdf_Dialog)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.label_3 = QtWidgets.QLabel(Hdf_Dialog)
|
||||
self.label_3.setTextFormat(QtCore.Qt.RichText)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.verticalLayout_2.addWidget(self.label_3)
|
||||
self.splitter = QtWidgets.QSplitter(Hdf_Dialog)
|
||||
self.splitter.setOrientation(QtCore.Qt.Vertical)
|
||||
self.splitter.setChildrenCollapsible(False)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.horizontalLayoutWidget = QtWidgets.QWidget(self.splitter)
|
||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.horizontalLayoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setSpacing(0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.verticalLayout.addLayout(self.verticalLayout_3)
|
||||
self.widget = QtWidgets.QWidget(self.horizontalLayoutWidget)
|
||||
self.widget.setObjectName("widget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.widget)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(2)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label = QtWidgets.QLabel(self.widget)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.comboBox_2 = QtWidgets.QComboBox(self.widget)
|
||||
self.comboBox_2.setObjectName("comboBox_2")
|
||||
self.gridLayout.addWidget(self.comboBox_2, 1, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.widget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.comboBox = QtWidgets.QComboBox(self.widget)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.gridLayout.addWidget(self.comboBox, 0, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.widget)
|
||||
self.widget_2 = ExpandableWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.widget_2.sizePolicy().hasHeightForWidth())
|
||||
self.widget_2.setSizePolicy(sizePolicy)
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.verticalLayout_2.addWidget(self.splitter)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Hdf_Dialog)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout_2.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Hdf_Dialog)
|
||||
self.buttonBox.rejected.connect(Hdf_Dialog.close)
|
||||
self.buttonBox.accepted.connect(Hdf_Dialog.accept)
|
||||
QtCore.QMetaObject.connectSlotsByName(Hdf_Dialog)
|
||||
|
||||
def retranslateUi(self, Hdf_Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Hdf_Dialog.setWindowTitle(_translate("Hdf_Dialog", "View HDF file"))
|
||||
self.label_3.setText(_translate("Hdf_Dialog", "<html><head/><body><p><span style=\" color:#000000;\">Colors: </span><span style=\" color:#1f77b4;\">Time signals and spectra</span><span style=\" color:#000000;\">, </span><span style=\" color:#ff7f0e;\">accumulations</span></p></body></html>"))
|
||||
self.label.setText(_translate("Hdf_Dialog", "Label"))
|
||||
self.label_2.setText(_translate("Hdf_Dialog", "Group"))
|
||||
from ..lib.expandablewidget import ExpandableWidget
|
53
src/gui_qt/_py/integral_widget.py
Normal file
53
src/gui_qt/_py/integral_widget.py
Normal file
@ -0,0 +1,53 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/integral_widget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(397, 681)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
self.set_combobox = QtWidgets.QComboBox(Form)
|
||||
self.set_combobox.setObjectName("set_combobox")
|
||||
self.verticalLayout.addWidget(self.set_combobox)
|
||||
self.treeWidget = QtWidgets.QTreeWidget(Form)
|
||||
self.treeWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.treeWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.treeWidget.setHeaderHidden(True)
|
||||
self.treeWidget.setObjectName("treeWidget")
|
||||
self.treeWidget.headerItem().setText(0, "1")
|
||||
self.verticalLayout.addWidget(self.treeWidget)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.pushButton = QtWidgets.QPushButton(Form)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.horizontalLayout.addWidget(self.pushButton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.label_2.setText(_translate("Form", "TextLabel"))
|
||||
self.label.setText(_translate("Form", "Save integrals as dataset"))
|
||||
self.pushButton.setText(_translate("Form", "Apply"))
|
83
src/gui_qt/_py/integratederive_dialog.py
Normal file
83
src/gui_qt/_py/integratederive_dialog.py
Normal file
@ -0,0 +1,83 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/integratederive_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(400, 308)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.listWidget = QtWidgets.QListWidget(Dialog)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.verticalLayout.addWidget(self.listWidget)
|
||||
self.widget = QtWidgets.QWidget(Dialog)
|
||||
self.widget.setObjectName("widget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.widget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.start_lineedit = QtWidgets.QLineEdit(self.widget)
|
||||
self.start_lineedit.setEnabled(False)
|
||||
self.start_lineedit.setObjectName("start_lineedit")
|
||||
self.horizontalLayout.addWidget(self.start_lineedit)
|
||||
self.stop_lineedit = QtWidgets.QLineEdit(self.widget)
|
||||
self.stop_lineedit.setEnabled(False)
|
||||
self.stop_lineedit.setObjectName("stop_lineedit")
|
||||
self.horizontalLayout.addWidget(self.stop_lineedit)
|
||||
self.range_checkbox = QtWidgets.QCheckBox(self.widget)
|
||||
self.range_checkbox.setChecked(True)
|
||||
self.range_checkbox.setObjectName("range_checkbox")
|
||||
self.horizontalLayout.addWidget(self.range_checkbox)
|
||||
self.verticalLayout.addWidget(self.widget)
|
||||
self.ft_comboBox = QtWidgets.QComboBox(Dialog)
|
||||
self.ft_comboBox.setObjectName("ft_comboBox")
|
||||
self.ft_comboBox.addItem("")
|
||||
self.ft_comboBox.addItem("")
|
||||
self.ft_comboBox.addItem("")
|
||||
self.verticalLayout.addWidget(self.ft_comboBox)
|
||||
self.log_checkbox = QtWidgets.QCheckBox(Dialog)
|
||||
self.log_checkbox.setObjectName("log_checkbox")
|
||||
self.verticalLayout.addWidget(self.log_checkbox)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.newgraph_checkbox = QtWidgets.QCheckBox(Dialog)
|
||||
self.newgraph_checkbox.setObjectName("newgraph_checkbox")
|
||||
self.horizontalLayout_2.addWidget(self.newgraph_checkbox)
|
||||
self.graph_combobox = QtWidgets.QComboBox(Dialog)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.horizontalLayout_2.addWidget(self.graph_combobox)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Limits"))
|
||||
self.range_checkbox.setText(_translate("Dialog", "Full"))
|
||||
self.ft_comboBox.setItemText(0, _translate("Dialog", "Real"))
|
||||
self.ft_comboBox.setItemText(1, _translate("Dialog", "Imag"))
|
||||
self.ft_comboBox.setItemText(2, _translate("Dialog", "Complex"))
|
||||
self.log_checkbox.setText(_translate("Dialog", "use logarithmic x axis"))
|
||||
self.newgraph_checkbox.setText(_translate("Dialog", "New graph"))
|
166
src/gui_qt/_py/interpol_dialog.py
Normal file
166
src/gui_qt/_py/interpol_dialog.py
Normal file
@ -0,0 +1,166 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/interpol_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(416, 494)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.src_widget = QtWidgets.QWidget(Dialog)
|
||||
self.src_widget.setObjectName("src_widget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.src_widget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.graph_combobox = QtWidgets.QComboBox(self.src_widget)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.horizontalLayout.addWidget(self.graph_combobox)
|
||||
self.set_combobox = QtWidgets.QComboBox(self.src_widget)
|
||||
self.set_combobox.setObjectName("set_combobox")
|
||||
self.horizontalLayout.addWidget(self.set_combobox)
|
||||
self.gridLayout.addWidget(self.src_widget, 8, 0, 1, 2)
|
||||
self.label_3 = QtWidgets.QLabel(Dialog)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setToolTip("")
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
|
||||
self.line_2 = QtWidgets.QFrame(Dialog)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout.addWidget(self.line_2, 5, 0, 1, 2)
|
||||
self.ylog_checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
self.ylog_checkBox.setObjectName("ylog_checkBox")
|
||||
self.gridLayout.addWidget(self.ylog_checkBox, 2, 1, 1, 1)
|
||||
self.interp_comboBox = QtWidgets.QComboBox(Dialog)
|
||||
self.interp_comboBox.setToolTip("")
|
||||
self.interp_comboBox.setObjectName("interp_comboBox")
|
||||
self.interp_comboBox.addItem("")
|
||||
self.interp_comboBox.addItem("")
|
||||
self.gridLayout.addWidget(self.interp_comboBox, 4, 1, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 12, 0, 1, 2)
|
||||
self.line = QtWidgets.QFrame(Dialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 3, 0, 1, 2)
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 6, 0, 1, 1)
|
||||
self.listWidget = QtWidgets.QListWidget(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
|
||||
self.listWidget.setSizePolicy(sizePolicy)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.gridLayout.addWidget(self.listWidget, 1, 0, 1, 2)
|
||||
self.sampling_widget = QtWidgets.QWidget(Dialog)
|
||||
self.sampling_widget.setObjectName("sampling_widget")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.sampling_widget)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_4 = QtWidgets.QLabel(self.sampling_widget)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout_2.addWidget(self.label_4)
|
||||
self.start_lineEdit = QtWidgets.QLineEdit(self.sampling_widget)
|
||||
self.start_lineEdit.setObjectName("start_lineEdit")
|
||||
self.horizontalLayout_2.addWidget(self.start_lineEdit)
|
||||
self.label_5 = QtWidgets.QLabel(self.sampling_widget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_2.addWidget(self.label_5)
|
||||
self.stop_lineEdit = QtWidgets.QLineEdit(self.sampling_widget)
|
||||
self.stop_lineEdit.setObjectName("stop_lineEdit")
|
||||
self.horizontalLayout_2.addWidget(self.stop_lineEdit)
|
||||
self.label_6 = QtWidgets.QLabel(self.sampling_widget)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.horizontalLayout_2.addWidget(self.label_6)
|
||||
self.step_lineEdit = QtWidgets.QLineEdit(self.sampling_widget)
|
||||
self.step_lineEdit.setObjectName("step_lineEdit")
|
||||
self.horizontalLayout_2.addWidget(self.step_lineEdit)
|
||||
self.logspace_checkBox = QtWidgets.QCheckBox(self.sampling_widget)
|
||||
self.logspace_checkBox.setObjectName("logspace_checkBox")
|
||||
self.horizontalLayout_2.addWidget(self.logspace_checkBox)
|
||||
self.gridLayout.addWidget(self.sampling_widget, 7, 0, 1, 2)
|
||||
self.xaxis_comboBox = QtWidgets.QComboBox(Dialog)
|
||||
self.xaxis_comboBox.setObjectName("xaxis_comboBox")
|
||||
self.xaxis_comboBox.addItem("")
|
||||
self.xaxis_comboBox.addItem("")
|
||||
self.gridLayout.addWidget(self.xaxis_comboBox, 6, 1, 1, 1)
|
||||
self.line_3 = QtWidgets.QFrame(Dialog)
|
||||
self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_3.setObjectName("line_3")
|
||||
self.gridLayout.addWidget(self.line_3, 9, 0, 1, 2)
|
||||
self.dest_combobox = QtWidgets.QComboBox(Dialog)
|
||||
self.dest_combobox.setObjectName("dest_combobox")
|
||||
self.gridLayout.addWidget(self.dest_combobox, 10, 1, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 11, 0, 1, 1)
|
||||
self.label_8 = QtWidgets.QLabel(Dialog)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.gridLayout.addWidget(self.label_8, 10, 0, 1, 1)
|
||||
self.xlog_checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
self.xlog_checkBox.setObjectName("xlog_checkBox")
|
||||
self.gridLayout.addWidget(self.xlog_checkBox, 2, 0, 1, 1)
|
||||
self.label.setBuddy(self.interp_comboBox)
|
||||
self.label_2.setBuddy(self.xaxis_comboBox)
|
||||
self.label_4.setBuddy(self.start_lineEdit)
|
||||
self.label_5.setBuddy(self.stop_lineEdit)
|
||||
self.label_6.setBuddy(self.step_lineEdit)
|
||||
self.label_8.setBuddy(self.dest_combobox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
Dialog.setTabOrder(self.listWidget, self.ylog_checkBox)
|
||||
Dialog.setTabOrder(self.ylog_checkBox, self.interp_comboBox)
|
||||
Dialog.setTabOrder(self.interp_comboBox, self.xaxis_comboBox)
|
||||
Dialog.setTabOrder(self.xaxis_comboBox, self.start_lineEdit)
|
||||
Dialog.setTabOrder(self.start_lineEdit, self.stop_lineEdit)
|
||||
Dialog.setTabOrder(self.stop_lineEdit, self.step_lineEdit)
|
||||
Dialog.setTabOrder(self.step_lineEdit, self.logspace_checkBox)
|
||||
Dialog.setTabOrder(self.logspace_checkBox, self.graph_combobox)
|
||||
Dialog.setTabOrder(self.graph_combobox, self.set_combobox)
|
||||
Dialog.setTabOrder(self.set_combobox, self.dest_combobox)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Data interpolation"))
|
||||
self.label_3.setText(_translate("Dialog", "Source data"))
|
||||
self.label.setText(_translate("Dialog", "Spline"))
|
||||
self.ylog_checkBox.setToolTip(_translate("Dialog", "If your data is on a logarithmic scale in y, check this box"))
|
||||
self.ylog_checkBox.setText(_translate("Dialog", "use log(y)"))
|
||||
self.interp_comboBox.setItemText(0, _translate("Dialog", "Cubic"))
|
||||
self.interp_comboBox.setItemText(1, _translate("Dialog", "Linear"))
|
||||
self.buttonBox.setToolTip(_translate("Dialog", "Accept to create new data sets."))
|
||||
self.label_2.setText(_translate("Dialog", "New x axis"))
|
||||
self.listWidget.setToolTip(_translate("Dialog", "Select sets that shall be interpolated. No selection will create interpolations of all visible sets."))
|
||||
self.label_4.setText(_translate("Dialog", "Start"))
|
||||
self.label_5.setText(_translate("Dialog", "Stop"))
|
||||
self.label_6.setText(_translate("Dialog", "Steps"))
|
||||
self.logspace_checkBox.setText(_translate("Dialog", "log-spaced?"))
|
||||
self.xaxis_comboBox.setItemText(0, _translate("Dialog", "new values"))
|
||||
self.xaxis_comboBox.setItemText(1, _translate("Dialog", "from data"))
|
||||
self.label_8.setText(_translate("Dialog", "Add interpolated data to"))
|
||||
self.xlog_checkBox.setText(_translate("Dialog", "use log(x)"))
|
39
src/gui_qt/_py/lineedit_dialog.py
Normal file
39
src/gui_qt/_py/lineedit_dialog.py
Normal file
@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/lineedit_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_LineEdit_Dialog(object):
|
||||
def setupUi(self, LineEdit_Dialog):
|
||||
LineEdit_Dialog.setObjectName("LineEdit_Dialog")
|
||||
LineEdit_Dialog.resize(400, 84)
|
||||
self.formLayout = QtWidgets.QFormLayout(LineEdit_Dialog)
|
||||
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label = QtWidgets.QLabel(LineEdit_Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label)
|
||||
self.new_string = QtWidgets.QLineEdit(LineEdit_Dialog)
|
||||
self.new_string.setObjectName("new_string")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.new_string)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(LineEdit_Dialog)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.SpanningRole, self.buttonBox)
|
||||
|
||||
self.retranslateUi(LineEdit_Dialog)
|
||||
self.buttonBox.accepted.connect(LineEdit_Dialog.accept)
|
||||
self.buttonBox.rejected.connect(LineEdit_Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(LineEdit_Dialog)
|
||||
|
||||
def retranslateUi(self, LineEdit_Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
LineEdit_Dialog.setWindowTitle(_translate("LineEdit_Dialog", "Dialog"))
|
||||
self.label.setText(_translate("LineEdit_Dialog", "Label"))
|
62
src/gui_qt/_py/mean_form.py
Normal file
62
src/gui_qt/_py/mean_form.py
Normal file
@ -0,0 +1,62 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/mean_form.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_mean_form(object):
|
||||
def setupUi(self, mean_form):
|
||||
mean_form.setObjectName("mean_form")
|
||||
mean_form.resize(712, 34)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(mean_form)
|
||||
self.horizontalLayout.setContentsMargins(1, 1, 1, 1)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(mean_form)
|
||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.digit_checkbox = QtWidgets.QCheckBox(mean_form)
|
||||
self.digit_checkbox.setChecked(True)
|
||||
self.digit_checkbox.setObjectName("digit_checkbox")
|
||||
self.horizontalLayout.addWidget(self.digit_checkbox)
|
||||
self.lineEdit = QtWidgets.QLineEdit(mean_form)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.data_checkbox = QtWidgets.QCheckBox(mean_form)
|
||||
self.data_checkbox.setObjectName("data_checkbox")
|
||||
self.horizontalLayout.addWidget(self.data_checkbox)
|
||||
self.frame = QtWidgets.QFrame(mean_form)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setSpacing(2)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.graph_combobox = QtWidgets.QComboBox(self.frame)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.horizontalLayout_2.addWidget(self.graph_combobox)
|
||||
self.set_combobox = QtWidgets.QComboBox(self.frame)
|
||||
self.set_combobox.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
|
||||
self.set_combobox.setObjectName("set_combobox")
|
||||
self.horizontalLayout_2.addWidget(self.set_combobox)
|
||||
self.horizontalLayout.addWidget(self.frame)
|
||||
|
||||
self.retranslateUi(mean_form)
|
||||
QtCore.QMetaObject.connectSlotsByName(mean_form)
|
||||
|
||||
def retranslateUi(self, mean_form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
mean_form.setWindowTitle(_translate("mean_form", "Form"))
|
||||
self.label.setText(_translate("mean_form", "TextLabel"))
|
||||
self.digit_checkbox.setText(_translate("mean_form", "Digit"))
|
||||
self.lineEdit.setText(_translate("mean_form", "1"))
|
||||
self.data_checkbox.setText(_translate("mean_form", "Data"))
|
96
src/gui_qt/_py/meandialog.py
Normal file
96
src/gui_qt/_py/meandialog.py
Normal file
@ -0,0 +1,96 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/meandialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_calc_means_dialog(object):
|
||||
def setupUi(self, calc_means_dialog):
|
||||
calc_means_dialog.setObjectName("calc_means_dialog")
|
||||
calc_means_dialog.resize(481, 322)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(calc_means_dialog)
|
||||
self.verticalLayout_2.setSpacing(3)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.dist_combobox = QtWidgets.QComboBox(calc_means_dialog)
|
||||
self.dist_combobox.setObjectName("dist_combobox")
|
||||
self.verticalLayout_2.addWidget(self.dist_combobox)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.from_combobox = QtWidgets.QComboBox(calc_means_dialog)
|
||||
self.from_combobox.setObjectName("from_combobox")
|
||||
self.from_combobox.addItem("")
|
||||
self.from_combobox.addItem("")
|
||||
self.from_combobox.addItem("")
|
||||
self.from_combobox.addItem("")
|
||||
self.horizontalLayout.addWidget(self.from_combobox)
|
||||
self.label_4 = QtWidgets.QLabel(calc_means_dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
|
||||
self.label_4.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(20)
|
||||
self.label_4.setFont(font)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout.addWidget(self.label_4)
|
||||
self.to_combobox = QtWidgets.QComboBox(calc_means_dialog)
|
||||
self.to_combobox.setObjectName("to_combobox")
|
||||
self.to_combobox.addItem("")
|
||||
self.to_combobox.addItem("")
|
||||
self.to_combobox.addItem("")
|
||||
self.to_combobox.addItem("")
|
||||
self.horizontalLayout.addWidget(self.to_combobox)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout)
|
||||
self.line = QtWidgets.QFrame(calc_means_dialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.verticalLayout_2.addWidget(self.line)
|
||||
self.label = QtWidgets.QLabel(calc_means_dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout_2.addWidget(self.label)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.checkBox = QtWidgets.QCheckBox(calc_means_dialog)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.horizontalLayout_2.addWidget(self.checkBox)
|
||||
self.graph_combobox = QtWidgets.QComboBox(calc_means_dialog)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.horizontalLayout_2.addWidget(self.graph_combobox)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(calc_means_dialog)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout_2.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(calc_means_dialog)
|
||||
self.to_combobox.setCurrentIndex(1)
|
||||
QtCore.QMetaObject.connectSlotsByName(calc_means_dialog)
|
||||
|
||||
def retranslateUi(self, calc_means_dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
calc_means_dialog.setWindowTitle(_translate("calc_means_dialog", "Mean times"))
|
||||
self.from_combobox.setItemText(0, _translate("calc_means_dialog", "Function value: τ"))
|
||||
self.from_combobox.setItemText(1, _translate("calc_means_dialog", "Peak time: τₚ"))
|
||||
self.from_combobox.setItemText(2, _translate("calc_means_dialog", "Arithmetic mean: ⟨τ⟩"))
|
||||
self.from_combobox.setItemText(3, _translate("calc_means_dialog", "Geometric mean: exp( ⟨ln(τ)⟩ )"))
|
||||
self.label_4.setText(_translate("calc_means_dialog", " ➝ "))
|
||||
self.to_combobox.setItemText(0, _translate("calc_means_dialog", "Function value: τ"))
|
||||
self.to_combobox.setItemText(1, _translate("calc_means_dialog", "Peak time: τₚ"))
|
||||
self.to_combobox.setItemText(2, _translate("calc_means_dialog", "Arithmetic mean: ⟨τ⟩"))
|
||||
self.to_combobox.setItemText(3, _translate("calc_means_dialog", "Geometric mean: exp( ⟨ln(τ)⟩ )"))
|
||||
self.label.setText(_translate("calc_means_dialog", "TextLabel"))
|
||||
self.checkBox.setText(_translate("calc_means_dialog", "New graph"))
|
32
src/gui_qt/_py/modelwidget.py
Normal file
32
src/gui_qt/_py/modelwidget.py
Normal file
@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/modelwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(188, 44)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.lineEdit = QtWidgets.QLineEdit(Form)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.label.setText(_translate("Form", "TextLabel"))
|
87
src/gui_qt/_py/move_dialog.py
Normal file
87
src/gui_qt/_py/move_dialog.py
Normal file
@ -0,0 +1,87 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/move_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MoveDialog(object):
|
||||
def setupUi(self, MoveDialog):
|
||||
MoveDialog.setObjectName("MoveDialog")
|
||||
MoveDialog.resize(395, 345)
|
||||
self.gridLayout = QtWidgets.QGridLayout(MoveDialog)
|
||||
self.gridLayout.setVerticalSpacing(1)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.tocomboBox = QtWidgets.QComboBox(MoveDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tocomboBox.sizePolicy().hasHeightForWidth())
|
||||
self.tocomboBox.setSizePolicy(sizePolicy)
|
||||
self.tocomboBox.setObjectName("tocomboBox")
|
||||
self.gridLayout.addWidget(self.tocomboBox, 3, 1, 1, 1)
|
||||
self.fromcomboBox = QtWidgets.QComboBox(MoveDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fromcomboBox.sizePolicy().hasHeightForWidth())
|
||||
self.fromcomboBox.setSizePolicy(sizePolicy)
|
||||
self.fromcomboBox.setObjectName("fromcomboBox")
|
||||
self.gridLayout.addWidget(self.fromcomboBox, 0, 1, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(MoveDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 6, 0, 1, 2)
|
||||
self.label_2 = QtWidgets.QLabel(MoveDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 3, 0, 1, 1)
|
||||
self.line = QtWidgets.QFrame(MoveDialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 4, 0, 1, 2)
|
||||
self.label = QtWidgets.QLabel(MoveDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.copy_button = QtWidgets.QRadioButton(MoveDialog)
|
||||
self.copy_button.setObjectName("copy_button")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(MoveDialog)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.copy_button)
|
||||
self.horizontalLayout.addWidget(self.copy_button)
|
||||
self.move_button = QtWidgets.QRadioButton(MoveDialog)
|
||||
self.move_button.setChecked(True)
|
||||
self.move_button.setObjectName("move_button")
|
||||
self.buttonGroup.addButton(self.move_button)
|
||||
self.horizontalLayout.addWidget(self.move_button)
|
||||
self.gridLayout.addLayout(self.horizontalLayout, 5, 0, 1, 2)
|
||||
self.listWidget = QtWidgets.QListWidget(MoveDialog)
|
||||
self.listWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.listWidget.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.gridLayout.addWidget(self.listWidget, 1, 1, 1, 1)
|
||||
self.label_2.setBuddy(self.tocomboBox)
|
||||
self.label.setBuddy(self.fromcomboBox)
|
||||
|
||||
self.retranslateUi(MoveDialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(MoveDialog)
|
||||
MoveDialog.setTabOrder(self.fromcomboBox, self.listWidget)
|
||||
MoveDialog.setTabOrder(self.listWidget, self.tocomboBox)
|
||||
MoveDialog.setTabOrder(self.tocomboBox, self.buttonBox)
|
||||
|
||||
def retranslateUi(self, MoveDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MoveDialog.setWindowTitle(_translate("MoveDialog", "Insert Reel 2 Real song."))
|
||||
self.label_2.setText(_translate("MoveDialog", "To"))
|
||||
self.label.setText(_translate("MoveDialog", "From"))
|
||||
self.copy_button.setText(_translate("MoveDialog", "Copy"))
|
||||
self.move_button.setText(_translate("MoveDialog", "Move"))
|
71
src/gui_qt/_py/namespace_widget.py
Normal file
71
src/gui_qt/_py/namespace_widget.py
Normal file
@ -0,0 +1,71 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/namespace_widget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(400, 300)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout_2.setContentsMargins(1, 1, 1, 1)
|
||||
self.gridLayout_2.setSpacing(3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.groups_comboBox = QtWidgets.QComboBox(Form)
|
||||
self.groups_comboBox.setObjectName("groups_comboBox")
|
||||
self.gridLayout_2.addWidget(self.groups_comboBox, 0, 0, 1, 1)
|
||||
self.subgroups_comboBox = QtWidgets.QComboBox(Form)
|
||||
self.subgroups_comboBox.setObjectName("subgroups_comboBox")
|
||||
self.gridLayout_2.addWidget(self.subgroups_comboBox, 0, 1, 1, 1)
|
||||
self.namespace_table = QtWidgets.QTableWidget(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.namespace_table.sizePolicy().hasHeightForWidth())
|
||||
self.namespace_table.setSizePolicy(sizePolicy)
|
||||
self.namespace_table.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.namespace_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.namespace_table.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
|
||||
self.namespace_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.namespace_table.setTextElideMode(QtCore.Qt.ElideNone)
|
||||
self.namespace_table.setColumnCount(2)
|
||||
self.namespace_table.setObjectName("namespace_table")
|
||||
self.namespace_table.setRowCount(5)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.namespace_table.setVerticalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.namespace_table.setVerticalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.namespace_table.setVerticalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.namespace_table.setVerticalHeaderItem(3, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.namespace_table.setVerticalHeaderItem(4, item)
|
||||
self.namespace_table.horizontalHeader().setVisible(False)
|
||||
self.namespace_table.horizontalHeader().setStretchLastSection(True)
|
||||
self.namespace_table.verticalHeader().setVisible(False)
|
||||
self.gridLayout_2.addWidget(self.namespace_table, 1, 0, 1, 2)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
item = self.namespace_table.verticalHeaderItem(0)
|
||||
item.setText(_translate("Form", "Neue Zeile"))
|
||||
item = self.namespace_table.verticalHeaderItem(1)
|
||||
item.setText(_translate("Form", "Neue Zeile"))
|
||||
item = self.namespace_table.verticalHeaderItem(2)
|
||||
item.setText(_translate("Form", "Neue Zeile"))
|
||||
item = self.namespace_table.verticalHeaderItem(3)
|
||||
item.setText(_translate("Form", "Neue Zeile"))
|
||||
item = self.namespace_table.verticalHeaderItem(4)
|
||||
item.setText(_translate("Form", "Neue Zeile"))
|
71
src/gui_qt/_py/option_selection.py
Normal file
71
src/gui_qt/_py/option_selection.py
Normal file
@ -0,0 +1,71 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/option_selection.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(400, 182)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Form)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.tableWidget = QtWidgets.QTableWidget(Form)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setColumnCount(2)
|
||||
self.tableWidget.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(1, item)
|
||||
self.gridLayout.addWidget(self.tableWidget, 1, 1, 1, 1)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label_2 = QtWidgets.QLabel(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
self.lineEdit = QtWidgets.QLineEdit(Form)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.verticalLayout.addWidget(self.lineEdit)
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
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.setObjectName("label")
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.comboBox = QtWidgets.QComboBox(Form)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.verticalLayout.addWidget(self.comboBox)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)
|
||||
self.pushButton = QtWidgets.QPushButton(Form)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.gridLayout.addWidget(self.pushButton, 2, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
item = self.tableWidget.horizontalHeaderItem(0)
|
||||
item.setText(_translate("Form", "Name"))
|
||||
item = self.tableWidget.horizontalHeaderItem(1)
|
||||
item.setText(_translate("Form", "Value"))
|
||||
self.label_2.setText(_translate("Form", "Nice name"))
|
||||
self.label.setText(_translate("Form", "TextLabel"))
|
||||
self.pushButton.setText(_translate("Form", "Add option"))
|
64
src/gui_qt/_py/parameterform.py
Normal file
64
src/gui_qt/_py/parameterform.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/parameterform.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_parameterform(object):
|
||||
def setupUi(self, parameterform):
|
||||
parameterform.setObjectName("parameterform")
|
||||
parameterform.setWindowModality(QtCore.Qt.WindowModal)
|
||||
parameterform.resize(290, 37)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(parameterform.sizePolicy().hasHeightForWidth())
|
||||
parameterform.setSizePolicy(sizePolicy)
|
||||
parameterform.setAutoFillBackground(True)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(parameterform)
|
||||
self.horizontalLayout.setContentsMargins(1, 1, 1, 1)
|
||||
self.horizontalLayout.setSpacing(2)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.line_2 = QtWidgets.QFrame(parameterform)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.horizontalLayout.addWidget(self.line_2)
|
||||
self.label = QtWidgets.QLabel(parameterform)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(1)
|
||||
sizePolicy.setVerticalStretch(10)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
self.label.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
spacerItem = QtWidgets.QSpacerItem(65, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.vals = QtWidgets.QLineEdit(parameterform)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.vals.sizePolicy().hasHeightForWidth())
|
||||
self.vals.setSizePolicy(sizePolicy)
|
||||
self.vals.setObjectName("vals")
|
||||
self.horizontalLayout.addWidget(self.vals)
|
||||
self.checkBox = QtWidgets.QCheckBox(parameterform)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.horizontalLayout.addWidget(self.checkBox)
|
||||
|
||||
self.retranslateUi(parameterform)
|
||||
QtCore.QMetaObject.connectSlotsByName(parameterform)
|
||||
|
||||
def retranslateUi(self, parameterform):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
parameterform.setWindowTitle(_translate("parameterform", "Form"))
|
||||
self.label.setText(_translate("parameterform", "Name"))
|
||||
self.vals.setText(_translate("parameterform", "1"))
|
||||
self.checkBox.setText(_translate("parameterform", "Fix?"))
|
97
src/gui_qt/_py/phase_corr_dialog.py
Normal file
97
src/gui_qt/_py/phase_corr_dialog.py
Normal file
@ -0,0 +1,97 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/phase_corr_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_SignalEdit(object):
|
||||
def setupUi(self, SignalEdit):
|
||||
SignalEdit.setObjectName("SignalEdit")
|
||||
SignalEdit.resize(919, 595)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(SignalEdit.sizePolicy().hasHeightForWidth())
|
||||
SignalEdit.setSizePolicy(sizePolicy)
|
||||
self.gridLayout = QtWidgets.QGridLayout(SignalEdit)
|
||||
self.gridLayout.setContentsMargins(6, 6, 6, 6)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.graphicsView = PlotWidget(SignalEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
|
||||
self.graphicsView.setSizePolicy(sizePolicy)
|
||||
self.graphicsView.setObjectName("graphicsView")
|
||||
self.gridLayout.addWidget(self.graphicsView, 0, 0, 1, 8)
|
||||
self.pivot_lineedit = QtWidgets.QLineEdit(SignalEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pivot_lineedit.sizePolicy().hasHeightForWidth())
|
||||
self.pivot_lineedit.setSizePolicy(sizePolicy)
|
||||
self.pivot_lineedit.setInputMethodHints(QtCore.Qt.ImhDigitsOnly)
|
||||
self.pivot_lineedit.setObjectName("pivot_lineedit")
|
||||
self.gridLayout.addWidget(self.pivot_lineedit, 1, 7, 1, 1)
|
||||
self.ph0slider = QtWidgets.QDoubleSpinBox(SignalEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.ph0slider.sizePolicy().hasHeightForWidth())
|
||||
self.ph0slider.setSizePolicy(sizePolicy)
|
||||
self.ph0slider.setWrapping(True)
|
||||
self.ph0slider.setMinimum(-180.0)
|
||||
self.ph0slider.setMaximum(180.0)
|
||||
self.ph0slider.setObjectName("ph0slider")
|
||||
self.gridLayout.addWidget(self.ph0slider, 1, 1, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(SignalEdit)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 2, 1, 1, 7)
|
||||
self.ph1slider = QtWidgets.QDoubleSpinBox(SignalEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.ph1slider.sizePolicy().hasHeightForWidth())
|
||||
self.ph1slider.setSizePolicy(sizePolicy)
|
||||
self.ph1slider.setWrapping(True)
|
||||
self.ph1slider.setMinimum(-360.0)
|
||||
self.ph1slider.setMaximum(360.0)
|
||||
self.ph1slider.setObjectName("ph1slider")
|
||||
self.gridLayout.addWidget(self.ph1slider, 1, 4, 1, 1)
|
||||
self.label_8 = QtWidgets.QLabel(SignalEdit)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.gridLayout.addWidget(self.label_8, 1, 6, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(SignalEdit)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout.addWidget(self.label_6, 1, 3, 1, 1)
|
||||
self.label = QtWidgets.QLabel(SignalEdit)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem, 1, 2, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem1, 1, 5, 1, 1)
|
||||
|
||||
self.retranslateUi(SignalEdit)
|
||||
self.buttonBox.accepted.connect(SignalEdit.accept)
|
||||
self.buttonBox.rejected.connect(SignalEdit.close)
|
||||
QtCore.QMetaObject.connectSlotsByName(SignalEdit)
|
||||
|
||||
def retranslateUi(self, SignalEdit):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
SignalEdit.setWindowTitle(_translate("SignalEdit", "Phase correction"))
|
||||
self.pivot_lineedit.setText(_translate("SignalEdit", "0"))
|
||||
self.label_8.setText(_translate("SignalEdit", "Pivot"))
|
||||
self.label_6.setText(_translate("SignalEdit", "Phase 1"))
|
||||
self.label.setText(_translate("SignalEdit", "Phase 0"))
|
||||
from pyqtgraph import PlotWidget
|
179
src/gui_qt/_py/plotConfigTemplate.py
Normal file
179
src/gui_qt/_py/plotConfigTemplate.py
Normal file
@ -0,0 +1,179 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/plotConfigTemplate.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(481, 840)
|
||||
self.averageGroup = QtWidgets.QGroupBox(Form)
|
||||
self.averageGroup.setGeometry(QtCore.QRect(0, 640, 242, 182))
|
||||
self.averageGroup.setCheckable(True)
|
||||
self.averageGroup.setChecked(False)
|
||||
self.averageGroup.setObjectName("averageGroup")
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.averageGroup)
|
||||
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_5.setSpacing(0)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.avgParamList = QtWidgets.QListWidget(self.averageGroup)
|
||||
self.avgParamList.setObjectName("avgParamList")
|
||||
self.gridLayout_5.addWidget(self.avgParamList, 0, 0, 1, 1)
|
||||
self.decimateGroup = QtWidgets.QFrame(Form)
|
||||
self.decimateGroup.setGeometry(QtCore.QRect(10, 140, 191, 171))
|
||||
self.decimateGroup.setObjectName("decimateGroup")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.decimateGroup)
|
||||
self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_4.setSpacing(0)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.clipToViewCheck = QtWidgets.QCheckBox(self.decimateGroup)
|
||||
self.clipToViewCheck.setObjectName("clipToViewCheck")
|
||||
self.gridLayout_4.addWidget(self.clipToViewCheck, 7, 0, 1, 3)
|
||||
self.maxTracesCheck = QtWidgets.QCheckBox(self.decimateGroup)
|
||||
self.maxTracesCheck.setObjectName("maxTracesCheck")
|
||||
self.gridLayout_4.addWidget(self.maxTracesCheck, 8, 0, 1, 2)
|
||||
self.downsampleCheck = QtWidgets.QCheckBox(self.decimateGroup)
|
||||
self.downsampleCheck.setObjectName("downsampleCheck")
|
||||
self.gridLayout_4.addWidget(self.downsampleCheck, 0, 0, 1, 3)
|
||||
self.peakRadio = QtWidgets.QRadioButton(self.decimateGroup)
|
||||
self.peakRadio.setChecked(True)
|
||||
self.peakRadio.setObjectName("peakRadio")
|
||||
self.gridLayout_4.addWidget(self.peakRadio, 6, 1, 1, 2)
|
||||
self.maxTracesSpin = QtWidgets.QSpinBox(self.decimateGroup)
|
||||
self.maxTracesSpin.setObjectName("maxTracesSpin")
|
||||
self.gridLayout_4.addWidget(self.maxTracesSpin, 8, 2, 1, 1)
|
||||
self.forgetTracesCheck = QtWidgets.QCheckBox(self.decimateGroup)
|
||||
self.forgetTracesCheck.setObjectName("forgetTracesCheck")
|
||||
self.gridLayout_4.addWidget(self.forgetTracesCheck, 9, 0, 1, 3)
|
||||
self.meanRadio = QtWidgets.QRadioButton(self.decimateGroup)
|
||||
self.meanRadio.setObjectName("meanRadio")
|
||||
self.gridLayout_4.addWidget(self.meanRadio, 3, 1, 1, 2)
|
||||
self.subsampleRadio = QtWidgets.QRadioButton(self.decimateGroup)
|
||||
self.subsampleRadio.setObjectName("subsampleRadio")
|
||||
self.gridLayout_4.addWidget(self.subsampleRadio, 2, 1, 1, 2)
|
||||
self.autoDownsampleCheck = QtWidgets.QCheckBox(self.decimateGroup)
|
||||
self.autoDownsampleCheck.setChecked(True)
|
||||
self.autoDownsampleCheck.setObjectName("autoDownsampleCheck")
|
||||
self.gridLayout_4.addWidget(self.autoDownsampleCheck, 1, 2, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(30, 20, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout_4.addItem(spacerItem, 2, 0, 1, 1)
|
||||
self.downsampleSpin = QtWidgets.QSpinBox(self.decimateGroup)
|
||||
self.downsampleSpin.setMinimum(1)
|
||||
self.downsampleSpin.setMaximum(100000)
|
||||
self.downsampleSpin.setProperty("value", 1)
|
||||
self.downsampleSpin.setObjectName("downsampleSpin")
|
||||
self.gridLayout_4.addWidget(self.downsampleSpin, 1, 1, 1, 1)
|
||||
self.transformGroup = QtWidgets.QFrame(Form)
|
||||
self.transformGroup.setGeometry(QtCore.QRect(10, 10, 171, 101))
|
||||
self.transformGroup.setObjectName("transformGroup")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.transformGroup)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.logYCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.logYCheck.setObjectName("logYCheck")
|
||||
self.gridLayout.addWidget(self.logYCheck, 2, 0, 1, 1)
|
||||
self.logXCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.logXCheck.setObjectName("logXCheck")
|
||||
self.gridLayout.addWidget(self.logXCheck, 1, 0, 1, 1)
|
||||
self.fftCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.fftCheck.setObjectName("fftCheck")
|
||||
self.gridLayout.addWidget(self.fftCheck, 0, 0, 1, 1)
|
||||
self.derivativeCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.derivativeCheck.setObjectName("derivativeCheck")
|
||||
self.gridLayout.addWidget(self.derivativeCheck, 3, 0, 1, 1)
|
||||
self.phasemapCheck = QtWidgets.QCheckBox(self.transformGroup)
|
||||
self.phasemapCheck.setObjectName("phasemapCheck")
|
||||
self.gridLayout.addWidget(self.phasemapCheck, 4, 0, 1, 1)
|
||||
self.pointsGroup = QtWidgets.QGroupBox(Form)
|
||||
self.pointsGroup.setGeometry(QtCore.QRect(10, 550, 234, 58))
|
||||
self.pointsGroup.setCheckable(True)
|
||||
self.pointsGroup.setObjectName("pointsGroup")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.pointsGroup)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.autoPointsCheck = QtWidgets.QCheckBox(self.pointsGroup)
|
||||
self.autoPointsCheck.setChecked(True)
|
||||
self.autoPointsCheck.setObjectName("autoPointsCheck")
|
||||
self.verticalLayout_5.addWidget(self.autoPointsCheck)
|
||||
self.gridGroup = QtWidgets.QFrame(Form)
|
||||
self.gridGroup.setGeometry(QtCore.QRect(10, 460, 221, 81))
|
||||
self.gridGroup.setObjectName("gridGroup")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridGroup)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.xGridCheck = QtWidgets.QCheckBox(self.gridGroup)
|
||||
self.xGridCheck.setObjectName("xGridCheck")
|
||||
self.gridLayout_2.addWidget(self.xGridCheck, 0, 0, 1, 2)
|
||||
self.yGridCheck = QtWidgets.QCheckBox(self.gridGroup)
|
||||
self.yGridCheck.setObjectName("yGridCheck")
|
||||
self.gridLayout_2.addWidget(self.yGridCheck, 1, 0, 1, 2)
|
||||
self.gridAlphaSlider = QtWidgets.QSlider(self.gridGroup)
|
||||
self.gridAlphaSlider.setMaximum(255)
|
||||
self.gridAlphaSlider.setProperty("value", 128)
|
||||
self.gridAlphaSlider.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.gridAlphaSlider.setObjectName("gridAlphaSlider")
|
||||
self.gridLayout_2.addWidget(self.gridAlphaSlider, 2, 1, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.gridGroup)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1)
|
||||
self.alphaGroup = QtWidgets.QGroupBox(Form)
|
||||
self.alphaGroup.setGeometry(QtCore.QRect(10, 390, 234, 60))
|
||||
self.alphaGroup.setCheckable(True)
|
||||
self.alphaGroup.setObjectName("alphaGroup")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.alphaGroup)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.autoAlphaCheck = QtWidgets.QCheckBox(self.alphaGroup)
|
||||
self.autoAlphaCheck.setChecked(False)
|
||||
self.autoAlphaCheck.setObjectName("autoAlphaCheck")
|
||||
self.horizontalLayout.addWidget(self.autoAlphaCheck)
|
||||
self.alphaSlider = QtWidgets.QSlider(self.alphaGroup)
|
||||
self.alphaSlider.setMaximum(1000)
|
||||
self.alphaSlider.setProperty("value", 1000)
|
||||
self.alphaSlider.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.alphaSlider.setObjectName("alphaSlider")
|
||||
self.horizontalLayout.addWidget(self.alphaSlider)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "PyQtGraph"))
|
||||
self.averageGroup.setToolTip(_translate("Form", "Display averages of the curves displayed in this plot. The parameter list allows you to choose parameters to average over (if any are available)."))
|
||||
self.averageGroup.setTitle(_translate("Form", "Average"))
|
||||
self.clipToViewCheck.setToolTip(_translate("Form", "Plot only the portion of each curve that is visible. This assumes X values are uniformly spaced."))
|
||||
self.clipToViewCheck.setText(_translate("Form", "Clip to View"))
|
||||
self.maxTracesCheck.setToolTip(_translate("Form", "If multiple curves are displayed in this plot, check this box to limit the number of traces that are displayed."))
|
||||
self.maxTracesCheck.setText(_translate("Form", "Max Traces:"))
|
||||
self.downsampleCheck.setText(_translate("Form", "Downsample"))
|
||||
self.peakRadio.setToolTip(_translate("Form", "Downsample by drawing a saw wave that follows the min and max of the original data. This method produces the best visual representation of the data but is slower."))
|
||||
self.peakRadio.setText(_translate("Form", "Peak"))
|
||||
self.maxTracesSpin.setToolTip(_translate("Form", "If multiple curves are displayed in this plot, check \"Max Traces\" and set this value to limit the number of traces that are displayed."))
|
||||
self.forgetTracesCheck.setToolTip(_translate("Form", "If MaxTraces is checked, remove curves from memory after they are hidden (saves memory, but traces can not be un-hidden)."))
|
||||
self.forgetTracesCheck.setText(_translate("Form", "Forget hidden traces"))
|
||||
self.meanRadio.setToolTip(_translate("Form", "Downsample by taking the mean of N samples."))
|
||||
self.meanRadio.setText(_translate("Form", "Mean"))
|
||||
self.subsampleRadio.setToolTip(_translate("Form", "Downsample by taking the first of N samples. This method is fastest and least accurate."))
|
||||
self.subsampleRadio.setText(_translate("Form", "Subsample"))
|
||||
self.autoDownsampleCheck.setToolTip(_translate("Form", "Automatically downsample data based on the visible range. This assumes X values are uniformly spaced."))
|
||||
self.autoDownsampleCheck.setText(_translate("Form", "Auto"))
|
||||
self.downsampleSpin.setToolTip(_translate("Form", "Downsample data before plotting. (plot every Nth sample)"))
|
||||
self.downsampleSpin.setSuffix(_translate("Form", "x"))
|
||||
self.logYCheck.setText(_translate("Form", "Log Y"))
|
||||
self.logXCheck.setText(_translate("Form", "Log X"))
|
||||
self.fftCheck.setText(_translate("Form", "Power Spectrum (FFT)"))
|
||||
self.derivativeCheck.setText(_translate("Form", "dy/dx"))
|
||||
self.phasemapCheck.setText(_translate("Form", "Y vs. Y\'"))
|
||||
self.pointsGroup.setTitle(_translate("Form", "Points"))
|
||||
self.autoPointsCheck.setText(_translate("Form", "Auto"))
|
||||
self.xGridCheck.setText(_translate("Form", "Show X Grid"))
|
||||
self.yGridCheck.setText(_translate("Form", "Show Y Grid"))
|
||||
self.label.setText(_translate("Form", "Opacity"))
|
||||
self.alphaGroup.setTitle(_translate("Form", "Alpha"))
|
||||
self.autoAlphaCheck.setText(_translate("Form", "Auto"))
|
118
src/gui_qt/_py/pokemon.py
Normal file
118
src/gui_qt/_py/pokemon.py
Normal file
@ -0,0 +1,118 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/pokemon.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(400, 359)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
|
||||
Dialog.setSizePolicy(sizePolicy)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(Dialog)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
self.formLayout = QtWidgets.QFormLayout()
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label)
|
||||
self.pokedex_nr = QtWidgets.QLabel(Dialog)
|
||||
self.pokedex_nr.setObjectName("pokedex_nr")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.pokedex_nr)
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_2)
|
||||
self.name = QtWidgets.QComboBox(Dialog)
|
||||
self.name.setObjectName("name")
|
||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.name)
|
||||
self.label_3 = QtWidgets.QLabel(Dialog)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_3)
|
||||
self.category = QtWidgets.QLabel(Dialog)
|
||||
self.category.setObjectName("category")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.category)
|
||||
self.label_4 = QtWidgets.QLabel(Dialog)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_4)
|
||||
self.poketype = QtWidgets.QLabel(Dialog)
|
||||
self.poketype.setObjectName("poketype")
|
||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.poketype)
|
||||
self.label_5 = QtWidgets.QLabel(Dialog)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_5)
|
||||
self.height = QtWidgets.QLabel(Dialog)
|
||||
self.height.setObjectName("height")
|
||||
self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.height)
|
||||
self.label_6 = QtWidgets.QLabel(Dialog)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_6)
|
||||
self.weight = QtWidgets.QLabel(Dialog)
|
||||
self.weight.setObjectName("weight")
|
||||
self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.weight)
|
||||
self.label_7 = QtWidgets.QLabel(Dialog)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.formLayout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.label_7)
|
||||
self.color = QtWidgets.QLabel(Dialog)
|
||||
self.color.setObjectName("color")
|
||||
self.formLayout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.color)
|
||||
self.label_8 = QtWidgets.QLabel(Dialog)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.label_8)
|
||||
self.info = QtWidgets.QLabel(Dialog)
|
||||
self.info.setObjectName("info")
|
||||
self.formLayout.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.info)
|
||||
self.verticalLayout.addLayout(self.formLayout)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.prev_button = QtWidgets.QToolButton(Dialog)
|
||||
self.prev_button.setObjectName("prev_button")
|
||||
self.horizontalLayout_2.addWidget(self.prev_button)
|
||||
self.next_button = QtWidgets.QToolButton(Dialog)
|
||||
self.next_button.setObjectName("next_button")
|
||||
self.horizontalLayout_2.addWidget(self.next_button)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Retry)
|
||||
self.buttonBox.setCenterButtons(False)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.horizontalLayout_2.addWidget(self.buttonBox)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.label_2.setBuddy(self.name)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.tabWidget.setCurrentIndex(-1)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Random Pokémon"))
|
||||
self.label.setText(_translate("Dialog", "National-Dex"))
|
||||
self.pokedex_nr.setText(_translate("Dialog", "TextLabel"))
|
||||
self.label_2.setText(_translate("Dialog", "Name"))
|
||||
self.label_3.setText(_translate("Dialog", "Kategorie"))
|
||||
self.category.setText(_translate("Dialog", "TextLabel"))
|
||||
self.label_4.setText(_translate("Dialog", "Typ"))
|
||||
self.poketype.setText(_translate("Dialog", "TextLabel"))
|
||||
self.label_5.setText(_translate("Dialog", "Größe"))
|
||||
self.height.setText(_translate("Dialog", "TextLabel"))
|
||||
self.label_6.setText(_translate("Dialog", "Gewicht"))
|
||||
self.weight.setText(_translate("Dialog", "TextLabel"))
|
||||
self.label_7.setText(_translate("Dialog", "Farbe"))
|
||||
self.color.setText(_translate("Dialog", "TextLabel"))
|
||||
self.label_8.setText(_translate("Dialog", "Mehr..."))
|
||||
self.info.setText(_translate("Dialog", "TextLabel"))
|
||||
self.prev_button.setText(_translate("Dialog", "Prev."))
|
||||
self.next_button.setText(_translate("Dialog", "Next"))
|
57
src/gui_qt/_py/propwidget.py
Normal file
57
src/gui_qt/_py/propwidget.py
Normal file
@ -0,0 +1,57 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/propwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(400, 300)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
|
||||
self.verticalLayout.setContentsMargins(2, 2, 2, 2)
|
||||
self.verticalLayout.setSpacing(2)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(Form)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tabWidgetPage2 = QtWidgets.QWidget()
|
||||
self.tabWidgetPage2.setObjectName("tabWidgetPage2")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tabWidgetPage2)
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.tableWidget_2 = QtWidgets.QTableWidget(self.tabWidgetPage2)
|
||||
self.tableWidget_2.setObjectName("tableWidget_2")
|
||||
self.tableWidget_2.setColumnCount(0)
|
||||
self.tableWidget_2.setRowCount(0)
|
||||
self.verticalLayout_3.addWidget(self.tableWidget_2)
|
||||
self.tabWidget.addTab(self.tabWidgetPage2, "")
|
||||
self.tabWidgetPage1 = QtWidgets.QWidget()
|
||||
self.tabWidgetPage1.setObjectName("tabWidgetPage1")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tabWidgetPage1)
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.tableWidget = QtWidgets.QTableWidget(self.tabWidgetPage1)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setColumnCount(0)
|
||||
self.tableWidget.setRowCount(0)
|
||||
self.verticalLayout_2.addWidget(self.tableWidget)
|
||||
self.tabWidget.addTab(self.tabWidgetPage1, "")
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage2), _translate("Form", "General"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage1), _translate("Form", "Symbol"))
|
133
src/gui_qt/_py/ptstab.py
Normal file
133
src/gui_qt/_py/ptstab.py
Normal file
@ -0,0 +1,133 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/ptstab.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(316, 747)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.peaktable = QtWidgets.QListWidget(Form)
|
||||
self.peaktable.setEditTriggers(QtWidgets.QAbstractItemView.DoubleClicked|QtWidgets.QAbstractItemView.EditKeyPressed)
|
||||
self.peaktable.setObjectName("peaktable")
|
||||
self.verticalLayout.addWidget(self.peaktable)
|
||||
self.groupBox = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.groupBox)
|
||||
self.horizontalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout.setSpacing(3)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.left_pt = QtWidgets.QSpinBox(self.groupBox)
|
||||
self.left_pt.setMaximum(999)
|
||||
self.left_pt.setObjectName("left_pt")
|
||||
self.horizontalLayout.addWidget(self.left_pt)
|
||||
self.right_pt = QtWidgets.QSpinBox(self.groupBox)
|
||||
self.right_pt.setMaximum(999)
|
||||
self.right_pt.setObjectName("right_pt")
|
||||
self.horizontalLayout.addWidget(self.right_pt)
|
||||
self.average_combobox = QtWidgets.QComboBox(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.average_combobox.sizePolicy().hasHeightForWidth())
|
||||
self.average_combobox.setSizePolicy(sizePolicy)
|
||||
self.average_combobox.setObjectName("average_combobox")
|
||||
self.average_combobox.addItem("")
|
||||
self.average_combobox.addItem("")
|
||||
self.average_combobox.addItem("")
|
||||
self.horizontalLayout.addWidget(self.average_combobox)
|
||||
self.verticalLayout.addWidget(self.groupBox)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_2.setCheckable(True)
|
||||
self.groupBox_2.setChecked(False)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.groupBox_2)
|
||||
self.horizontalLayout_5.setContentsMargins(3, 3, 3, 3)
|
||||
self.horizontalLayout_5.setSpacing(2)
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.special_comboBox = QtWidgets.QComboBox(self.groupBox_2)
|
||||
self.special_comboBox.setObjectName("special_comboBox")
|
||||
self.special_comboBox.addItem("")
|
||||
self.special_comboBox.addItem("")
|
||||
self.special_comboBox.addItem("")
|
||||
self.special_comboBox.addItem("")
|
||||
self.horizontalLayout_5.addWidget(self.special_comboBox)
|
||||
self.verticalLayout.addWidget(self.groupBox_2)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.groupBox_3)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.xbutton = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.xbutton.setObjectName("xbutton")
|
||||
self.gridLayout.addWidget(self.xbutton, 0, 0, 1, 1)
|
||||
self.ybutton = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.ybutton.setChecked(True)
|
||||
self.ybutton.setObjectName("ybutton")
|
||||
self.gridLayout.addWidget(self.ybutton, 0, 1, 1, 1)
|
||||
self.graph_checkbox = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.graph_checkbox.setChecked(True)
|
||||
self.graph_checkbox.setObjectName("graph_checkbox")
|
||||
self.gridLayout.addWidget(self.graph_checkbox, 1, 0, 1, 1)
|
||||
self.graph_combobox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.graph_combobox.setEnabled(False)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.gridLayout.addWidget(self.graph_combobox, 1, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox_3)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_2.setSpacing(2)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.okButton = QtWidgets.QPushButton(Form)
|
||||
icon = QtGui.QIcon.fromTheme("dialog-ok")
|
||||
self.okButton.setIcon(icon)
|
||||
self.okButton.setObjectName("okButton")
|
||||
self.horizontalLayout_2.addWidget(self.okButton)
|
||||
self.deleteButton = QtWidgets.QPushButton(Form)
|
||||
icon = QtGui.QIcon.fromTheme("dialog-cancel")
|
||||
self.deleteButton.setIcon(icon)
|
||||
self.deleteButton.setObjectName("deleteButton")
|
||||
self.horizontalLayout_2.addWidget(self.deleteButton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.peaktable.setToolTip(_translate("Form", "Edit by entering new value: \n"
|
||||
"Single number for points (e.g. 1e-6); \n"
|
||||
"two numbers separated by space for regions (e.g. 1e-6 5e-6). \n"
|
||||
"Changing between regions and points is NOT possible"))
|
||||
self.groupBox.setTitle(_translate("Form", "Average"))
|
||||
self.left_pt.setSuffix(_translate("Form", " pts"))
|
||||
self.left_pt.setPrefix(_translate("Form", "- "))
|
||||
self.right_pt.setSuffix(_translate("Form", " pts"))
|
||||
self.right_pt.setPrefix(_translate("Form", "+ "))
|
||||
self.average_combobox.setItemText(0, _translate("Form", "Mean"))
|
||||
self.average_combobox.setItemText(1, _translate("Form", "Sum"))
|
||||
self.average_combobox.setItemText(2, _translate("Form", "Integral"))
|
||||
self.groupBox_2.setTitle(_translate("Form", "Special value"))
|
||||
self.special_comboBox.setToolTip(_translate("Form", "Automatic selection of respective points"))
|
||||
self.special_comboBox.setItemText(0, _translate("Form", "max(y)"))
|
||||
self.special_comboBox.setItemText(1, _translate("Form", "max(abs(y))"))
|
||||
self.special_comboBox.setItemText(2, _translate("Form", "min(y)"))
|
||||
self.special_comboBox.setItemText(3, _translate("Form", "min(abs(y))"))
|
||||
self.groupBox_3.setTitle(_translate("Form", "Result"))
|
||||
self.xbutton.setText(_translate("Form", "x"))
|
||||
self.ybutton.setText(_translate("Form", "y"))
|
||||
self.graph_checkbox.setText(_translate("Form", "New graph?"))
|
||||
self.okButton.setText(_translate("Form", "Apply"))
|
||||
self.deleteButton.setText(_translate("Form", "Delete selected"))
|
179
src/gui_qt/_py/qfiledialog.py
Normal file
179
src/gui_qt/_py/qfiledialog.py
Normal file
@ -0,0 +1,179 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/qfiledialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_QFileDialog(object):
|
||||
def setupUi(self, QFileDialog):
|
||||
QFileDialog.setObjectName("QFileDialog")
|
||||
QFileDialog.resize(521, 316)
|
||||
QFileDialog.setSizeGripEnabled(True)
|
||||
self.gridlayout = QtWidgets.QGridLayout(QFileDialog)
|
||||
self.gridlayout.setObjectName("gridlayout")
|
||||
self.lookInLabel = QtWidgets.QLabel(QFileDialog)
|
||||
self.lookInLabel.setObjectName("lookInLabel")
|
||||
self.gridlayout.addWidget(self.lookInLabel, 0, 0, 1, 1)
|
||||
self.hboxlayout = QtWidgets.QHBoxLayout()
|
||||
self.hboxlayout.setObjectName("hboxlayout")
|
||||
self.lookInCombo = QtWidgets.QComboBox(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(1)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.lookInCombo.sizePolicy().hasHeightForWidth())
|
||||
self.lookInCombo.setSizePolicy(sizePolicy)
|
||||
self.lookInCombo.setMinimumSize(QtCore.QSize(50, 0))
|
||||
self.lookInCombo.setObjectName("lookInCombo")
|
||||
self.hboxlayout.addWidget(self.lookInCombo)
|
||||
self.backButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.backButton.setObjectName("backButton")
|
||||
self.hboxlayout.addWidget(self.backButton)
|
||||
self.forwardButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.forwardButton.setObjectName("forwardButton")
|
||||
self.hboxlayout.addWidget(self.forwardButton)
|
||||
self.toParentButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.toParentButton.setObjectName("toParentButton")
|
||||
self.hboxlayout.addWidget(self.toParentButton)
|
||||
self.newFolderButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.newFolderButton.setObjectName("newFolderButton")
|
||||
self.hboxlayout.addWidget(self.newFolderButton)
|
||||
self.listModeButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.listModeButton.setObjectName("listModeButton")
|
||||
self.hboxlayout.addWidget(self.listModeButton)
|
||||
self.detailModeButton = QtWidgets.QToolButton(QFileDialog)
|
||||
self.detailModeButton.setObjectName("detailModeButton")
|
||||
self.hboxlayout.addWidget(self.detailModeButton)
|
||||
self.gridlayout.addLayout(self.hboxlayout, 0, 1, 1, 2)
|
||||
self.splitter = QtWidgets.QSplitter(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.splitter.sizePolicy().hasHeightForWidth())
|
||||
self.splitter.setSizePolicy(sizePolicy)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter.setChildrenCollapsible(False)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.sidebar = QtWidgets.QListWidget(self.splitter)
|
||||
self.sidebar.setObjectName("sidebar")
|
||||
self.frame = QtWidgets.QFrame(self.splitter)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(self.frame)
|
||||
self.vboxlayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.vboxlayout.setSpacing(0)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(self.frame)
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setObjectName("page")
|
||||
self.vboxlayout1 = QtWidgets.QVBoxLayout(self.page)
|
||||
self.vboxlayout1.setContentsMargins(0, 0, 0, 0)
|
||||
self.vboxlayout1.setSpacing(0)
|
||||
self.vboxlayout1.setObjectName("vboxlayout1")
|
||||
self.listView = QtWidgets.QListView(self.page)
|
||||
self.listView.setObjectName("listView")
|
||||
self.vboxlayout1.addWidget(self.listView)
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.vboxlayout2 = QtWidgets.QVBoxLayout(self.page_2)
|
||||
self.vboxlayout2.setContentsMargins(0, 0, 0, 0)
|
||||
self.vboxlayout2.setSpacing(0)
|
||||
self.vboxlayout2.setObjectName("vboxlayout2")
|
||||
self.treeView = QtWidgets.QTreeView(self.page_2)
|
||||
self.treeView.setObjectName("treeView")
|
||||
self.vboxlayout2.addWidget(self.treeView)
|
||||
self.stackedWidget.addWidget(self.page_2)
|
||||
self.vboxlayout.addWidget(self.stackedWidget)
|
||||
self.gridlayout.addWidget(self.splitter, 1, 0, 1, 3)
|
||||
self.fileNameLabel = QtWidgets.QLabel(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileNameLabel.sizePolicy().hasHeightForWidth())
|
||||
self.fileNameLabel.setSizePolicy(sizePolicy)
|
||||
self.fileNameLabel.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.fileNameLabel.setObjectName("fileNameLabel")
|
||||
self.gridlayout.addWidget(self.fileNameLabel, 2, 0, 1, 1)
|
||||
self.fileNameEdit = QtWidgets.QLineEdit(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(1)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileNameEdit.sizePolicy().hasHeightForWidth())
|
||||
self.fileNameEdit.setSizePolicy(sizePolicy)
|
||||
self.fileNameEdit.setObjectName("fileNameEdit")
|
||||
self.gridlayout.addWidget(self.fileNameEdit, 2, 1, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(QFileDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridlayout.addWidget(self.buttonBox, 2, 2, 2, 1)
|
||||
self.fileTypeLabel = QtWidgets.QLabel(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileTypeLabel.sizePolicy().hasHeightForWidth())
|
||||
self.fileTypeLabel.setSizePolicy(sizePolicy)
|
||||
self.fileTypeLabel.setObjectName("fileTypeLabel")
|
||||
self.gridlayout.addWidget(self.fileTypeLabel, 3, 0, 1, 1)
|
||||
self.fileTypeCombo = QtWidgets.QComboBox(QFileDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.fileTypeCombo.sizePolicy().hasHeightForWidth())
|
||||
self.fileTypeCombo.setSizePolicy(sizePolicy)
|
||||
self.fileTypeCombo.setObjectName("fileTypeCombo")
|
||||
self.gridlayout.addWidget(self.fileTypeCombo, 3, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(QFileDialog)
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(QFileDialog)
|
||||
QFileDialog.setTabOrder(self.lookInCombo, self.backButton)
|
||||
QFileDialog.setTabOrder(self.backButton, self.forwardButton)
|
||||
QFileDialog.setTabOrder(self.forwardButton, self.toParentButton)
|
||||
QFileDialog.setTabOrder(self.toParentButton, self.newFolderButton)
|
||||
QFileDialog.setTabOrder(self.newFolderButton, self.listModeButton)
|
||||
QFileDialog.setTabOrder(self.listModeButton, self.detailModeButton)
|
||||
QFileDialog.setTabOrder(self.detailModeButton, self.sidebar)
|
||||
QFileDialog.setTabOrder(self.sidebar, self.treeView)
|
||||
QFileDialog.setTabOrder(self.treeView, self.listView)
|
||||
QFileDialog.setTabOrder(self.listView, self.fileNameEdit)
|
||||
QFileDialog.setTabOrder(self.fileNameEdit, self.buttonBox)
|
||||
QFileDialog.setTabOrder(self.buttonBox, self.fileTypeCombo)
|
||||
|
||||
def retranslateUi(self, QFileDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
self.lookInLabel.setText(_translate("QFileDialog", "Look in:"))
|
||||
self.backButton.setToolTip(_translate("QFileDialog", "Back"))
|
||||
self.backButton.setAccessibleName(_translate("QFileDialog", "Back"))
|
||||
self.backButton.setAccessibleDescription(_translate("QFileDialog", "Go back"))
|
||||
self.backButton.setShortcut(_translate("QFileDialog", "Alt+Left"))
|
||||
self.forwardButton.setToolTip(_translate("QFileDialog", "Forward"))
|
||||
self.forwardButton.setAccessibleName(_translate("QFileDialog", "Forward"))
|
||||
self.forwardButton.setAccessibleDescription(_translate("QFileDialog", "Go forward"))
|
||||
self.forwardButton.setShortcut(_translate("QFileDialog", "Alt+Right"))
|
||||
self.toParentButton.setToolTip(_translate("QFileDialog", "Parent Directory"))
|
||||
self.toParentButton.setAccessibleName(_translate("QFileDialog", "Parent Directory"))
|
||||
self.toParentButton.setAccessibleDescription(_translate("QFileDialog", "Go to the parent directory"))
|
||||
self.toParentButton.setShortcut(_translate("QFileDialog", "Alt+Up"))
|
||||
self.newFolderButton.setToolTip(_translate("QFileDialog", "Create New Folder"))
|
||||
self.newFolderButton.setAccessibleName(_translate("QFileDialog", "Create New Folder"))
|
||||
self.newFolderButton.setAccessibleDescription(_translate("QFileDialog", "Create a New Folder"))
|
||||
self.listModeButton.setToolTip(_translate("QFileDialog", "List View"))
|
||||
self.listModeButton.setAccessibleName(_translate("QFileDialog", "List View"))
|
||||
self.listModeButton.setAccessibleDescription(_translate("QFileDialog", "Change to list view mode"))
|
||||
self.detailModeButton.setToolTip(_translate("QFileDialog", "Detail View"))
|
||||
self.detailModeButton.setAccessibleName(_translate("QFileDialog", "Detail View"))
|
||||
self.detailModeButton.setAccessibleDescription(_translate("QFileDialog", "Change to detail view mode"))
|
||||
self.sidebar.setAccessibleName(_translate("QFileDialog", "Sidebar"))
|
||||
self.sidebar.setAccessibleDescription(_translate("QFileDialog", "List of places and bookmarks"))
|
||||
self.listView.setAccessibleName(_translate("QFileDialog", "Files"))
|
||||
self.treeView.setAccessibleName(_translate("QFileDialog", "Files"))
|
||||
self.fileTypeLabel.setText(_translate("QFileDialog", "Files of type:"))
|
131
src/gui_qt/_py/save_fit_parameter.py
Normal file
131
src/gui_qt/_py/save_fit_parameter.py
Normal file
@ -0,0 +1,131 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/save_fit_parameter.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_fitparameter_save_dialog(object):
|
||||
def setupUi(self, fitparameter_save_dialog):
|
||||
fitparameter_save_dialog.setObjectName("fitparameter_save_dialog")
|
||||
fitparameter_save_dialog.resize(578, 537)
|
||||
self.gridLayout = QtWidgets.QGridLayout(fitparameter_save_dialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.save_path_line = QtWidgets.QLineEdit(fitparameter_save_dialog)
|
||||
self.save_path_line.setObjectName("save_path_line")
|
||||
self.gridLayout.addWidget(self.save_path_line, 0, 1, 1, 6)
|
||||
self.save_path_button = QtWidgets.QToolButton(fitparameter_save_dialog)
|
||||
self.save_path_button.setObjectName("save_path_button")
|
||||
self.gridLayout.addWidget(self.save_path_button, 0, 0, 1, 1)
|
||||
self.comment_line = QtWidgets.QLineEdit(fitparameter_save_dialog)
|
||||
self.comment_line.setObjectName("comment_line")
|
||||
self.gridLayout.addWidget(self.comment_line, 6, 6, 1, 1)
|
||||
self.prec_spinbox = QtWidgets.QSpinBox(fitparameter_save_dialog)
|
||||
self.prec_spinbox.setProperty("value", 8)
|
||||
self.prec_spinbox.setObjectName("prec_spinbox")
|
||||
self.gridLayout.addWidget(self.prec_spinbox, 6, 3, 1, 1)
|
||||
self.line_2 = QtWidgets.QFrame(fitparameter_save_dialog)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout.addWidget(self.line_2, 4, 0, 1, 7)
|
||||
self.label_5 = QtWidgets.QLabel(fitparameter_save_dialog)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout.addWidget(self.label_5, 3, 0, 1, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.col_line = QtWidgets.QLineEdit(fitparameter_save_dialog)
|
||||
self.col_line.setObjectName("col_line")
|
||||
self.horizontalLayout.addWidget(self.col_line)
|
||||
self.usage_button = QtWidgets.QToolButton(fitparameter_save_dialog)
|
||||
self.usage_button.setObjectName("usage_button")
|
||||
self.horizontalLayout.addWidget(self.usage_button)
|
||||
self.gridLayout.addLayout(self.horizontalLayout, 3, 1, 1, 6)
|
||||
self.header_edit = QtWidgets.QTextEdit(fitparameter_save_dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.header_edit.sizePolicy().hasHeightForWidth())
|
||||
self.header_edit.setSizePolicy(sizePolicy)
|
||||
self.header_edit.setObjectName("header_edit")
|
||||
self.gridLayout.addWidget(self.header_edit, 5, 1, 1, 6)
|
||||
self.label_4 = QtWidgets.QLabel(fitparameter_save_dialog)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 6, 2, 1, 1)
|
||||
self.line = QtWidgets.QFrame(fitparameter_save_dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.line.sizePolicy().hasHeightForWidth())
|
||||
self.line.setSizePolicy(sizePolicy)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 1, 0, 1, 7)
|
||||
self.missing_value_line = QtWidgets.QLineEdit(fitparameter_save_dialog)
|
||||
self.missing_value_line.setObjectName("missing_value_line")
|
||||
self.gridLayout.addWidget(self.missing_value_line, 6, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(fitparameter_save_dialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 6, 4, 1, 1)
|
||||
self.tableWidget = QtWidgets.QTableWidget(fitparameter_save_dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tableWidget.sizePolicy().hasHeightForWidth())
|
||||
self.tableWidget.setSizePolicy(sizePolicy)
|
||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.tableWidget.setDragDropMode(QtWidgets.QAbstractItemView.DragOnly)
|
||||
self.tableWidget.setAlternatingRowColors(True)
|
||||
self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.tableWidget.setColumnCount(2)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setRowCount(0)
|
||||
self.tableWidget.horizontalHeader().setVisible(False)
|
||||
self.tableWidget.horizontalHeader().setStretchLastSection(True)
|
||||
self.gridLayout.addWidget(self.tableWidget, 2, 0, 1, 7)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(fitparameter_save_dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 7, 0, 1, 7)
|
||||
self.label = QtWidgets.QLabel(fitparameter_save_dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 6, 0, 1, 1)
|
||||
self.header_checkBox = QtWidgets.QCheckBox(fitparameter_save_dialog)
|
||||
self.header_checkBox.setObjectName("header_checkBox")
|
||||
self.gridLayout.addWidget(self.header_checkBox, 5, 0, 1, 1)
|
||||
self.label_5.setBuddy(self.col_line)
|
||||
self.label_2.setBuddy(self.comment_line)
|
||||
self.label.setBuddy(self.missing_value_line)
|
||||
|
||||
self.retranslateUi(fitparameter_save_dialog)
|
||||
self.buttonBox.accepted.connect(fitparameter_save_dialog.accept)
|
||||
self.buttonBox.rejected.connect(fitparameter_save_dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(fitparameter_save_dialog)
|
||||
fitparameter_save_dialog.setTabOrder(self.save_path_button, self.save_path_line)
|
||||
fitparameter_save_dialog.setTabOrder(self.save_path_line, self.tableWidget)
|
||||
fitparameter_save_dialog.setTabOrder(self.tableWidget, self.header_edit)
|
||||
fitparameter_save_dialog.setTabOrder(self.header_edit, self.missing_value_line)
|
||||
fitparameter_save_dialog.setTabOrder(self.missing_value_line, self.comment_line)
|
||||
|
||||
def retranslateUi(self, fitparameter_save_dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
fitparameter_save_dialog.setWindowTitle(_translate("fitparameter_save_dialog", "Save parameter"))
|
||||
self.save_path_button.setText(_translate("fitparameter_save_dialog", "Save path..."))
|
||||
self.comment_line.setText(_translate("fitparameter_save_dialog", "#"))
|
||||
self.label_5.setText(_translate("fitparameter_save_dialog", "Columns"))
|
||||
self.col_line.setPlaceholderText(_translate("fitparameter_save_dialog", "e.g. x; 1000/x; mean(T_1,beta); {beta/beta_1}; M_0*x"))
|
||||
self.usage_button.setText(_translate("fitparameter_save_dialog", "Usage?"))
|
||||
self.header_edit.setPlaceholderText(_translate("fitparameter_save_dialog", "Header ends always with column description. Additional header lines are commented automatically"))
|
||||
self.label_4.setText(_translate("fitparameter_save_dialog", "Precision"))
|
||||
self.missing_value_line.setText(_translate("fitparameter_save_dialog", "1e308"))
|
||||
self.label_2.setText(_translate("fitparameter_save_dialog", "Comment"))
|
||||
self.buttonBox.setToolTip(_translate("fitparameter_save_dialog", "Number of significant digits."))
|
||||
self.label.setText(_translate("fitparameter_save_dialog", "Missing values"))
|
||||
self.header_checkBox.setText(_translate("fitparameter_save_dialog", "Header"))
|
64
src/gui_qt/_py/save_fitmodel_dialog.py
Normal file
64
src/gui_qt/_py/save_fitmodel_dialog.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/save_fitmodel_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_SaveDialog(object):
|
||||
def setupUi(self, SaveDialog):
|
||||
SaveDialog.setObjectName("SaveDialog")
|
||||
SaveDialog.resize(400, 166)
|
||||
self.gridLayout = QtWidgets.QGridLayout(SaveDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_2 = QtWidgets.QLabel(SaveDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(SaveDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 3, 1, 1, 1)
|
||||
self.comboBox = QtWidgets.QComboBox(SaveDialog)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.gridLayout.addWidget(self.comboBox, 1, 1, 1, 1)
|
||||
self.label = QtWidgets.QLabel(SaveDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.lineEdit = QtWidgets.QLineEdit(SaveDialog)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 4, 1, 1, 1)
|
||||
self.frame = QtWidgets.QFrame(SaveDialog)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.horizontalLayout.addWidget(self.lineEdit_2)
|
||||
self.toolButton = QtWidgets.QToolButton(self.frame)
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.horizontalLayout.addWidget(self.toolButton)
|
||||
self.gridLayout.addWidget(self.frame, 2, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(SaveDialog)
|
||||
self.buttonBox.accepted.connect(SaveDialog.accept)
|
||||
self.buttonBox.rejected.connect(SaveDialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(SaveDialog)
|
||||
|
||||
def retranslateUi(self, SaveDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
SaveDialog.setWindowTitle(_translate("SaveDialog", "Dialog"))
|
||||
self.label_2.setText(_translate("SaveDialog", "Group"))
|
||||
self.label.setText(_translate("SaveDialog", "Name"))
|
||||
self.toolButton.setText(_translate("SaveDialog", "OK"))
|
33
src/gui_qt/_py/save_options.py
Normal file
33
src/gui_qt/_py/save_options.py
Normal file
@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/save_options.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(400, 58)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label = QtWidgets.QLabel(Form)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.checkBox = QtWidgets.QCheckBox(Form)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.verticalLayout.addWidget(self.checkBox)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.label.setText(_translate("Form", "<html><head/><body><p>Use <span style=\" font-weight:600;\"><label></span> as placeholder in filename for data label.</p></body></html>"))
|
||||
self.checkBox.setText(_translate("Form", "Replace spaces with underscore"))
|
41
src/gui_qt/_py/saveoptions.py
Normal file
41
src/gui_qt/_py/saveoptions.py
Normal file
@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/saveoptions.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Frame(object):
|
||||
def setupUi(self, Frame):
|
||||
Frame.setObjectName("Frame")
|
||||
Frame.resize(464, 62)
|
||||
Frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
Frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Frame)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label = QtWidgets.QLabel(Frame)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.line = QtWidgets.QFrame(Frame)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.verticalLayout.addWidget(self.line)
|
||||
self.checkBox = QtWidgets.QCheckBox(Frame)
|
||||
self.checkBox.setChecked(True)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.verticalLayout.addWidget(self.checkBox)
|
||||
|
||||
self.retranslateUi(Frame)
|
||||
QtCore.QMetaObject.connectSlotsByName(Frame)
|
||||
|
||||
def retranslateUi(self, Frame):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Frame.setWindowTitle(_translate("Frame", "Frame"))
|
||||
self.label.setText(_translate("Frame", "<html><head/><body><p>Use <span style=\" font-weight:600;\"><label></span> as placeholder in filename. (e.g. <span style=\" font-style:italic;\">t1_<label>.dat</span>)</p></body></html>"))
|
||||
self.checkBox.setText(_translate("Frame", "Replace spaces with underscore"))
|
70
src/gui_qt/_py/sdmodelwidget.py
Normal file
70
src/gui_qt/_py/sdmodelwidget.py
Normal file
@ -0,0 +1,70 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/sdmodelwidget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_SDParameter(object):
|
||||
def setupUi(self, SDParameter):
|
||||
SDParameter.setObjectName("SDParameter")
|
||||
SDParameter.setWindowModality(QtCore.Qt.WindowModal)
|
||||
SDParameter.resize(290, 37)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(SDParameter.sizePolicy().hasHeightForWidth())
|
||||
SDParameter.setSizePolicy(sizePolicy)
|
||||
SDParameter.setAutoFillBackground(True)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(SDParameter)
|
||||
self.verticalLayout.setContentsMargins(1, 0, 0, 0)
|
||||
self.verticalLayout.setSpacing(0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setContentsMargins(6, -1, 0, -1)
|
||||
self.gridLayout.setSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.parameter_line = LineEdit(SDParameter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.parameter_line.sizePolicy().hasHeightForWidth())
|
||||
self.parameter_line.setSizePolicy(sizePolicy)
|
||||
self.parameter_line.setObjectName("parameter_line")
|
||||
self.gridLayout.addWidget(self.parameter_line, 0, 2, 1, 1)
|
||||
self.parametername = QtWidgets.QLabel(SDParameter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(1)
|
||||
sizePolicy.setVerticalStretch(10)
|
||||
sizePolicy.setHeightForWidth(self.parametername.sizePolicy().hasHeightForWidth())
|
||||
self.parametername.setSizePolicy(sizePolicy)
|
||||
self.parametername.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.parametername.setObjectName("parametername")
|
||||
self.gridLayout.addWidget(self.parametername, 0, 0, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(SDParameter)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout.addWidget(self.checkBox, 0, 3, 1, 1)
|
||||
self.line_2 = QtWidgets.QFrame(SDParameter)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout.addWidget(self.line_2, 1, 0, 1, 4)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
|
||||
self.verticalLayout.addLayout(self.gridLayout)
|
||||
|
||||
self.retranslateUi(SDParameter)
|
||||
QtCore.QMetaObject.connectSlotsByName(SDParameter)
|
||||
|
||||
def retranslateUi(self, SDParameter):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
SDParameter.setWindowTitle(_translate("SDParameter", "Form"))
|
||||
self.parameter_line.setText(_translate("SDParameter", "1"))
|
||||
self.parametername.setText(_translate("SDParameter", "Fitparameter"))
|
||||
self.checkBox.setText(_translate("SDParameter", "Fix?"))
|
||||
from nmrevalgui.lib.forms import LineEdit
|
41
src/gui_qt/_py/selection_widget.py
Normal file
41
src/gui_qt/_py/selection_widget.py
Normal file
@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/selection_widget.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_SelectionWidget(object):
|
||||
def setupUi(self, SelectionWidget):
|
||||
SelectionWidget.setObjectName("SelectionWidget")
|
||||
SelectionWidget.resize(367, 43)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(SelectionWidget.sizePolicy().hasHeightForWidth())
|
||||
SelectionWidget.setSizePolicy(sizePolicy)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(SelectionWidget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(SelectionWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.comboBox = QtWidgets.QComboBox(SelectionWidget)
|
||||
self.comboBox.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToMinimumContentsLength)
|
||||
self.comboBox.setFrame(True)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.horizontalLayout.addWidget(self.comboBox)
|
||||
|
||||
self.retranslateUi(SelectionWidget)
|
||||
QtCore.QMetaObject.connectSlotsByName(SelectionWidget)
|
||||
|
||||
def retranslateUi(self, SelectionWidget):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
SelectionWidget.setWindowTitle(_translate("SelectionWidget", "Form"))
|
||||
self.label.setText(_translate("SelectionWidget", "TextLabel"))
|
225
src/gui_qt/_py/setbyfunction_dialog.py
Normal file
225
src/gui_qt/_py/setbyfunction_dialog.py
Normal file
@ -0,0 +1,225 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/setbyfunction_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_NewCurveDialog(object):
|
||||
def setupUi(self, NewCurveDialog):
|
||||
NewCurveDialog.setObjectName("NewCurveDialog")
|
||||
NewCurveDialog.resize(648, 578)
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(NewCurveDialog)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(NewCurveDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
|
||||
self.groupBox_2.setSizePolicy(sizePolicy)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_2)
|
||||
self.gridLayout_2.setContentsMargins(2, 2, 2, 2)
|
||||
self.gridLayout_2.setSpacing(2)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.lineEdit_3 = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.lineEdit_3.setPlaceholderText("")
|
||||
self.lineEdit_3.setObjectName("lineEdit_3")
|
||||
self.gridLayout_2.addWidget(self.lineEdit_3, 0, 1, 1, 1)
|
||||
self.lineEdit_5 = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.lineEdit_5.setObjectName("lineEdit_5")
|
||||
self.gridLayout_2.addWidget(self.lineEdit_5, 0, 6, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout_2.addWidget(self.label_5, 0, 3, 1, 1)
|
||||
self.lineEdit_4 = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.lineEdit_4.setObjectName("lineEdit_4")
|
||||
self.gridLayout_2.addWidget(self.lineEdit_4, 0, 4, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout_2.addWidget(self.label_4, 0, 0, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout_2.addWidget(self.label_6, 0, 5, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.groupBox_2)
|
||||
self.checkBox.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout_2.addWidget(self.checkBox, 0, 7, 1, 1)
|
||||
self.gridLayout_4.addWidget(self.groupBox_2, 0, 0, 1, 1)
|
||||
self.groupBox = QtWidgets.QGroupBox(NewCurveDialog)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox)
|
||||
self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_3.setSpacing(2)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.gridLayout_3.addWidget(self.lineEdit_2, 1, 2, 1, 1)
|
||||
self.comboBox_6 = QtWidgets.QComboBox(self.groupBox)
|
||||
self.comboBox_6.setObjectName("comboBox_6")
|
||||
self.gridLayout_3.addWidget(self.comboBox_6, 2, 0, 1, 1)
|
||||
self.pushButton = QtWidgets.QPushButton(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton.setSizePolicy(sizePolicy)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.gridLayout_3.addWidget(self.pushButton, 4, 0, 1, 1)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.gridLayout_3.addLayout(self.verticalLayout, 3, 0, 1, 1)
|
||||
self.comboBox_7 = QtWidgets.QComboBox(self.groupBox)
|
||||
self.comboBox_7.setObjectName("comboBox_7")
|
||||
self.gridLayout_3.addWidget(self.comboBox_7, 2, 2, 1, 1)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.gridLayout_3.addWidget(self.lineEdit, 1, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.groupBox)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.gridLayout_3.addLayout(self.verticalLayout_2, 3, 2, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout_3.addWidget(self.label_2, 0, 2, 1, 1)
|
||||
self.line_2 = QtWidgets.QFrame(self.groupBox)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout_3.addWidget(self.line_2, 0, 1, 4, 1)
|
||||
self.gridLayout_4.addWidget(self.groupBox, 1, 0, 1, 1)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(NewCurveDialog)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.groupBox_3)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setSpacing(2)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.doubleSpinBox = QtWidgets.QDoubleSpinBox(self.groupBox_3)
|
||||
self.doubleSpinBox.setDecimals(1)
|
||||
self.doubleSpinBox.setMaximum(20.0)
|
||||
self.doubleSpinBox.setSingleStep(0.5)
|
||||
self.doubleSpinBox.setProperty("value", 1.0)
|
||||
self.doubleSpinBox.setObjectName("doubleSpinBox")
|
||||
self.gridLayout.addWidget(self.doubleSpinBox, 3, 4, 1, 1)
|
||||
self.line = QtWidgets.QFrame(self.groupBox_3)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 0, 2, 4, 1)
|
||||
self.spinBox = QtWidgets.QSpinBox(self.groupBox_3)
|
||||
self.spinBox.setMaximum(100)
|
||||
self.spinBox.setProperty("value", 10)
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.gridLayout.addWidget(self.spinBox, 3, 1, 1, 1)
|
||||
self.label_8 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.gridLayout.addWidget(self.label_8, 0, 4, 1, 1)
|
||||
self.comboBox = SymbolStyleEditor(self.groupBox_3)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.gridLayout.addWidget(self.comboBox, 1, 1, 1, 1)
|
||||
self.comboBox_2 = LineStyleEditor(self.groupBox_3)
|
||||
self.comboBox_2.setObjectName("comboBox_2")
|
||||
self.gridLayout.addWidget(self.comboBox_2, 1, 4, 1, 1)
|
||||
self.label_7 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout.addWidget(self.label_7, 0, 1, 1, 1)
|
||||
self.comboBox_4 = ColorListEditor(self.groupBox_3)
|
||||
self.comboBox_4.setObjectName("comboBox_4")
|
||||
self.gridLayout.addWidget(self.comboBox_4, 2, 4, 1, 1)
|
||||
self.comboBox_5 = ColorListEditor(self.groupBox_3)
|
||||
self.comboBox_5.setObjectName("comboBox_5")
|
||||
self.gridLayout.addWidget(self.comboBox_5, 2, 1, 1, 1)
|
||||
self.gridLayout_4.addWidget(self.groupBox_3, 2, 0, 1, 1)
|
||||
self.groupBox_21 = QtWidgets.QGroupBox(NewCurveDialog)
|
||||
self.groupBox_21.setObjectName("groupBox_21")
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_21)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.label_3 = QtWidgets.QLabel(self.groupBox_21)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout_5.addWidget(self.label_3, 0, 0, 1, 1)
|
||||
self.lineEdit_6 = QtWidgets.QLineEdit(self.groupBox_21)
|
||||
self.lineEdit_6.setObjectName("lineEdit_6")
|
||||
self.gridLayout_5.addWidget(self.lineEdit_6, 0, 1, 1, 1)
|
||||
self.label_10 = QtWidgets.QLabel(self.groupBox_21)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.gridLayout_5.addWidget(self.label_10, 0, 2, 1, 1)
|
||||
self.comboBox_3 = QtWidgets.QComboBox(self.groupBox_21)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.comboBox_3.sizePolicy().hasHeightForWidth())
|
||||
self.comboBox_3.setSizePolicy(sizePolicy)
|
||||
self.comboBox_3.setObjectName("comboBox_3")
|
||||
self.gridLayout_5.addWidget(self.comboBox_3, 0, 3, 1, 1)
|
||||
self.gridLayout_4.addWidget(self.groupBox_21, 3, 0, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(NewCurveDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout_4.addWidget(self.buttonBox, 5, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_4.addItem(spacerItem, 4, 0, 1, 1)
|
||||
self.label_5.setBuddy(self.lineEdit_4)
|
||||
self.label_4.setBuddy(self.lineEdit_3)
|
||||
self.label_6.setBuddy(self.lineEdit_5)
|
||||
self.label.setBuddy(self.lineEdit)
|
||||
self.label_2.setBuddy(self.lineEdit_2)
|
||||
self.label_8.setBuddy(self.comboBox_2)
|
||||
self.label_7.setBuddy(self.comboBox)
|
||||
self.label_3.setBuddy(self.lineEdit_6)
|
||||
self.label_10.setBuddy(self.comboBox_3)
|
||||
|
||||
self.retranslateUi(NewCurveDialog)
|
||||
self.comboBox.setCurrentIndex(-1)
|
||||
self.comboBox_2.setCurrentIndex(-1)
|
||||
self.buttonBox.accepted.connect(NewCurveDialog.accept)
|
||||
self.buttonBox.rejected.connect(NewCurveDialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(NewCurveDialog)
|
||||
NewCurveDialog.setTabOrder(self.lineEdit_3, self.lineEdit_4)
|
||||
NewCurveDialog.setTabOrder(self.lineEdit_4, self.lineEdit_5)
|
||||
NewCurveDialog.setTabOrder(self.lineEdit_5, self.checkBox)
|
||||
NewCurveDialog.setTabOrder(self.checkBox, self.lineEdit)
|
||||
NewCurveDialog.setTabOrder(self.lineEdit, self.comboBox)
|
||||
NewCurveDialog.setTabOrder(self.comboBox, self.spinBox)
|
||||
NewCurveDialog.setTabOrder(self.spinBox, self.comboBox_2)
|
||||
NewCurveDialog.setTabOrder(self.comboBox_2, self.doubleSpinBox)
|
||||
NewCurveDialog.setTabOrder(self.doubleSpinBox, self.lineEdit_6)
|
||||
NewCurveDialog.setTabOrder(self.lineEdit_6, self.comboBox_3)
|
||||
NewCurveDialog.setTabOrder(self.comboBox_3, self.buttonBox)
|
||||
|
||||
def retranslateUi(self, NewCurveDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
NewCurveDialog.setWindowTitle(_translate("NewCurveDialog", "Create new data by function"))
|
||||
self.groupBox_2.setTitle(_translate("NewCurveDialog", "Control variable i"))
|
||||
self.lineEdit_3.setText(_translate("NewCurveDialog", "0"))
|
||||
self.lineEdit_5.setText(_translate("NewCurveDialog", "10"))
|
||||
self.label_5.setText(_translate("NewCurveDialog", "Stop at"))
|
||||
self.lineEdit_4.setText(_translate("NewCurveDialog", "1"))
|
||||
self.label_4.setText(_translate("NewCurveDialog", "Start at"))
|
||||
self.label_6.setText(_translate("NewCurveDialog", "# points"))
|
||||
self.checkBox.setText(_translate("NewCurveDialog", "Logarithmic?"))
|
||||
self.groupBox.setTitle(_translate("NewCurveDialog", "Expressions"))
|
||||
self.lineEdit_2.setText(_translate("NewCurveDialog", "x**2"))
|
||||
self.pushButton.setText(_translate("NewCurveDialog", "Check"))
|
||||
self.lineEdit.setText(_translate("NewCurveDialog", "i"))
|
||||
self.label.setText(_translate("NewCurveDialog", " x = "))
|
||||
self.label_2.setText(_translate("NewCurveDialog", " y = "))
|
||||
self.groupBox_3.setTitle(_translate("NewCurveDialog", "Look"))
|
||||
self.label_8.setText(_translate("NewCurveDialog", "Line"))
|
||||
self.label_7.setText(_translate("NewCurveDialog", "Symbol"))
|
||||
self.groupBox_21.setTitle(_translate("NewCurveDialog", "Designation"))
|
||||
self.label_3.setText(_translate("NewCurveDialog", "Name"))
|
||||
self.label_10.setText(_translate("NewCurveDialog", "Graph"))
|
||||
from ..lib.delegates import ColorListEditor, LineStyleEditor, SymbolStyleEditor
|
314
src/gui_qt/_py/shift_scale_dialog.py
Normal file
314
src/gui_qt/_py/shift_scale_dialog.py
Normal file
@ -0,0 +1,314 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/shift_scale_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_shift_dialog(object):
|
||||
def setupUi(self, shift_dialog):
|
||||
shift_dialog.setObjectName("shift_dialog")
|
||||
shift_dialog.resize(959, 639)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(shift_dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.splitter = QtWidgets.QSplitter(shift_dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.splitter.sizePolicy().hasHeightForWidth())
|
||||
self.splitter.setSizePolicy(sizePolicy)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
|
||||
self.tabWidget.setSizePolicy(sizePolicy)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.shift_page = QtWidgets.QWidget()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.shift_page.sizePolicy().hasHeightForWidth())
|
||||
self.shift_page.setSizePolicy(sizePolicy)
|
||||
self.shift_page.setObjectName("shift_page")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.shift_page)
|
||||
self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.label_7 = QtWidgets.QLabel(self.shift_page)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout_2.addWidget(self.label_7, 2, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.shift_page)
|
||||
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.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 2, 1, 1, 1)
|
||||
self.x_shift_spinbox = SciSpinBox(self.shift_page)
|
||||
self.x_shift_spinbox.setMinimumSize(QtCore.QSize(150, 0))
|
||||
self.x_shift_spinbox.setDecimals(3)
|
||||
self.x_shift_spinbox.setProperty("value", 0.0)
|
||||
self.x_shift_spinbox.setObjectName("x_shift_spinbox")
|
||||
self.gridLayout_2.addWidget(self.x_shift_spinbox, 2, 2, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(self.shift_page)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth())
|
||||
self.label_5.setSizePolicy(sizePolicy)
|
||||
self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout_2.addWidget(self.label_5, 3, 1, 1, 1)
|
||||
self.y_shift_spinbox = SciSpinBox(self.shift_page)
|
||||
self.y_shift_spinbox.setMinimumSize(QtCore.QSize(150, 0))
|
||||
self.y_shift_spinbox.setDecimals(3)
|
||||
self.y_shift_spinbox.setProperty("value", 0.0)
|
||||
self.y_shift_spinbox.setObjectName("y_shift_spinbox")
|
||||
self.gridLayout_2.addWidget(self.y_shift_spinbox, 3, 2, 1, 1)
|
||||
self.shift_table = QtWidgets.QTableWidget(self.shift_page)
|
||||
self.shift_table.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
|
||||
self.shift_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.shift_table.setColumnCount(3)
|
||||
self.shift_table.setObjectName("shift_table")
|
||||
self.shift_table.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.shift_table.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.shift_table.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.shift_table.setHorizontalHeaderItem(2, item)
|
||||
self.shift_table.verticalHeader().setVisible(False)
|
||||
self.gridLayout_2.addWidget(self.shift_table, 0, 0, 1, 3)
|
||||
self.tabWidget.addTab(self.shift_page, "")
|
||||
self.scale_page = QtWidgets.QWidget()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.scale_page.sizePolicy().hasHeightForWidth())
|
||||
self.scale_page.setSizePolicy(sizePolicy)
|
||||
self.scale_page.setObjectName("scale_page")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.scale_page)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_3 = QtWidgets.QLabel(self.scale_page)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
|
||||
self.label_3.setSizePolicy(sizePolicy)
|
||||
self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 1, 1, 1, 1)
|
||||
self.x_scale_spinbox = SciSpinBox(self.scale_page)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.x_scale_spinbox.sizePolicy().hasHeightForWidth())
|
||||
self.x_scale_spinbox.setSizePolicy(sizePolicy)
|
||||
self.x_scale_spinbox.setMinimumSize(QtCore.QSize(150, 0))
|
||||
self.x_scale_spinbox.setDecimals(3)
|
||||
self.x_scale_spinbox.setProperty("value", 1.0)
|
||||
self.x_scale_spinbox.setObjectName("x_scale_spinbox")
|
||||
self.gridLayout.addWidget(self.x_scale_spinbox, 1, 2, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.scale_page)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout.addWidget(self.label_6, 1, 0, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.scale_page)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 2, 1, 1, 1)
|
||||
self.y_scale_spinbox = SciSpinBox(self.scale_page)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.y_scale_spinbox.sizePolicy().hasHeightForWidth())
|
||||
self.y_scale_spinbox.setSizePolicy(sizePolicy)
|
||||
self.y_scale_spinbox.setMinimumSize(QtCore.QSize(150, 0))
|
||||
self.y_scale_spinbox.setDecimals(3)
|
||||
self.y_scale_spinbox.setProperty("value", 1.0)
|
||||
self.y_scale_spinbox.setObjectName("y_scale_spinbox")
|
||||
self.gridLayout.addWidget(self.y_scale_spinbox, 2, 2, 1, 1)
|
||||
self.scale_table = QtWidgets.QTableWidget(self.scale_page)
|
||||
self.scale_table.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
|
||||
self.scale_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.scale_table.setObjectName("scale_table")
|
||||
self.scale_table.setColumnCount(3)
|
||||
self.scale_table.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.scale_table.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.scale_table.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.scale_table.setHorizontalHeaderItem(2, item)
|
||||
self.scale_table.verticalHeader().setVisible(False)
|
||||
self.gridLayout.addWidget(self.scale_table, 0, 0, 1, 3)
|
||||
self.tabWidget.addTab(self.scale_page, "")
|
||||
self.verticalFrame_2 = QtWidgets.QFrame(self.splitter)
|
||||
self.verticalFrame_2.setObjectName("verticalFrame_2")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalFrame_2)
|
||||
self.verticalLayout_2.setSpacing(3)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.graphicsView = PlotWidget(self.verticalFrame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
|
||||
self.graphicsView.setSizePolicy(sizePolicy)
|
||||
self.graphicsView.setObjectName("graphicsView")
|
||||
self.verticalLayout_2.addWidget(self.graphicsView)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.label_4 = QtWidgets.QLabel(self.verticalFrame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
|
||||
self.label_4.setSizePolicy(sizePolicy)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout.addWidget(self.label_4)
|
||||
self.xlog_checkbox = QtWidgets.QCheckBox(self.verticalFrame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.xlog_checkbox.sizePolicy().hasHeightForWidth())
|
||||
self.xlog_checkbox.setSizePolicy(sizePolicy)
|
||||
self.xlog_checkbox.setObjectName("xlog_checkbox")
|
||||
self.horizontalLayout.addWidget(self.xlog_checkbox)
|
||||
self.ylog_checkbox = QtWidgets.QCheckBox(self.verticalFrame_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.ylog_checkbox.sizePolicy().hasHeightForWidth())
|
||||
self.ylog_checkbox.setSizePolicy(sizePolicy)
|
||||
self.ylog_checkbox.setObjectName("ylog_checkbox")
|
||||
self.horizontalLayout.addWidget(self.ylog_checkbox)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout)
|
||||
self.verticalLayout.addWidget(self.splitter)
|
||||
self.line = QtWidgets.QFrame(shift_dialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.verticalLayout.addWidget(self.line)
|
||||
self.frame = QtWidgets.QFrame(shift_dialog)
|
||||
self.frame.setObjectName("frame")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.frame)
|
||||
self.gridLayout_4.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_4.setSpacing(3)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.value_checkbox = QtWidgets.QCheckBox(self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.value_checkbox.sizePolicy().hasHeightForWidth())
|
||||
self.value_checkbox.setSizePolicy(sizePolicy)
|
||||
self.value_checkbox.setChecked(True)
|
||||
self.value_checkbox.setObjectName("value_checkbox")
|
||||
self.gridLayout_4.addWidget(self.value_checkbox, 0, 1, 1, 1)
|
||||
self.overwrite_checkbox = QtWidgets.QCheckBox(self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.overwrite_checkbox.sizePolicy().hasHeightForWidth())
|
||||
self.overwrite_checkbox.setSizePolicy(sizePolicy)
|
||||
self.overwrite_checkbox.setObjectName("overwrite_checkbox")
|
||||
self.gridLayout_4.addWidget(self.overwrite_checkbox, 0, 0, 1, 1)
|
||||
self.data_newgraph = QtWidgets.QCheckBox(self.frame)
|
||||
self.data_newgraph.setChecked(True)
|
||||
self.data_newgraph.setObjectName("data_newgraph")
|
||||
self.gridLayout_4.addWidget(self.data_newgraph, 1, 0, 1, 1)
|
||||
self.data_combobox = QtWidgets.QComboBox(self.frame)
|
||||
self.data_combobox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.data_combobox.sizePolicy().hasHeightForWidth())
|
||||
self.data_combobox.setSizePolicy(sizePolicy)
|
||||
self.data_combobox.setObjectName("data_combobox")
|
||||
self.gridLayout_4.addWidget(self.data_combobox, 2, 0, 1, 1)
|
||||
self.values_newgraph = QtWidgets.QCheckBox(self.frame)
|
||||
self.values_newgraph.setChecked(True)
|
||||
self.values_newgraph.setObjectName("values_newgraph")
|
||||
self.gridLayout_4.addWidget(self.values_newgraph, 1, 1, 1, 1)
|
||||
self.values_combobox = QtWidgets.QComboBox(self.frame)
|
||||
self.values_combobox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.values_combobox.sizePolicy().hasHeightForWidth())
|
||||
self.values_combobox.setSizePolicy(sizePolicy)
|
||||
self.values_combobox.setObjectName("values_combobox")
|
||||
self.gridLayout_4.addWidget(self.values_combobox, 2, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.frame)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(shift_dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
self.label.setBuddy(self.x_shift_spinbox)
|
||||
self.label_5.setBuddy(self.y_shift_spinbox)
|
||||
self.label_3.setBuddy(self.x_scale_spinbox)
|
||||
self.label_2.setBuddy(self.y_scale_spinbox)
|
||||
|
||||
self.retranslateUi(shift_dialog)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
self.buttonBox.accepted.connect(shift_dialog.accept)
|
||||
self.buttonBox.rejected.connect(shift_dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(shift_dialog)
|
||||
shift_dialog.setTabOrder(self.tabWidget, self.shift_table)
|
||||
shift_dialog.setTabOrder(self.shift_table, self.x_shift_spinbox)
|
||||
shift_dialog.setTabOrder(self.x_shift_spinbox, self.y_shift_spinbox)
|
||||
shift_dialog.setTabOrder(self.y_shift_spinbox, self.scale_table)
|
||||
shift_dialog.setTabOrder(self.scale_table, self.x_scale_spinbox)
|
||||
shift_dialog.setTabOrder(self.x_scale_spinbox, self.y_scale_spinbox)
|
||||
shift_dialog.setTabOrder(self.y_scale_spinbox, self.xlog_checkbox)
|
||||
shift_dialog.setTabOrder(self.xlog_checkbox, self.ylog_checkbox)
|
||||
shift_dialog.setTabOrder(self.ylog_checkbox, self.graphicsView)
|
||||
|
||||
def retranslateUi(self, shift_dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
shift_dialog.setWindowTitle(_translate("shift_dialog", "Shift + Scale"))
|
||||
self.label_7.setText(_translate("shift_dialog", "Global"))
|
||||
self.label.setText(_translate("shift_dialog", "<html><head/><body><p><span style=\" font-weight:600;\">x</span></p></body></html>"))
|
||||
self.label_5.setText(_translate("shift_dialog", "<html><head/><body><p><span style=\" font-weight:600;\">y</span></p></body></html>"))
|
||||
item = self.shift_table.horizontalHeaderItem(0)
|
||||
item.setText(_translate("shift_dialog", "Data"))
|
||||
item = self.shift_table.horizontalHeaderItem(1)
|
||||
item.setText(_translate("shift_dialog", "x"))
|
||||
item = self.shift_table.horizontalHeaderItem(2)
|
||||
item.setText(_translate("shift_dialog", "y"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.shift_page), _translate("shift_dialog", "Shift"))
|
||||
self.label_3.setText(_translate("shift_dialog", "<html><head/><body><p><span style=\" font-weight:600;\">x</span></p></body></html>"))
|
||||
self.label_6.setText(_translate("shift_dialog", "Global:"))
|
||||
self.label_2.setText(_translate("shift_dialog", "<html><head/><body><p><span style=\" font-weight:600;\">y</span></p></body></html>"))
|
||||
item = self.scale_table.horizontalHeaderItem(0)
|
||||
item.setText(_translate("shift_dialog", "Data"))
|
||||
item = self.scale_table.horizontalHeaderItem(1)
|
||||
item.setText(_translate("shift_dialog", "x"))
|
||||
item = self.scale_table.horizontalHeaderItem(2)
|
||||
item.setText(_translate("shift_dialog", "y"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.scale_page), _translate("shift_dialog", "Scale"))
|
||||
self.label_4.setText(_translate("shift_dialog", "Axes:"))
|
||||
self.xlog_checkbox.setText(_translate("shift_dialog", "log x"))
|
||||
self.ylog_checkbox.setText(_translate("shift_dialog", "log y"))
|
||||
self.value_checkbox.setText(_translate("shift_dialog", "Export shift/scale values"))
|
||||
self.overwrite_checkbox.setText(_translate("shift_dialog", "Overwrite data"))
|
||||
self.data_newgraph.setText(_translate("shift_dialog", "New graph"))
|
||||
self.values_newgraph.setText(_translate("shift_dialog", "New graph"))
|
||||
from ..lib.spinboxes import SciSpinBox
|
||||
from pyqtgraph import PlotWidget
|
95
src/gui_qt/_py/skipdialog.py
Normal file
95
src/gui_qt/_py/skipdialog.py
Normal file
@ -0,0 +1,95 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/skipdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_SkipDialog(object):
|
||||
def setupUi(self, SkipDialog):
|
||||
SkipDialog.setObjectName("SkipDialog")
|
||||
SkipDialog.resize(448, 208)
|
||||
SkipDialog.setWindowTitle("")
|
||||
self.gridLayout = QtWidgets.QGridLayout(SkipDialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_2 = QtWidgets.QLabel(SkipDialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 3, 0, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(SkipDialog)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 0, 0, 1, 4)
|
||||
self.offset_spinbox = QtWidgets.QSpinBox(SkipDialog)
|
||||
self.offset_spinbox.setMinimum(0)
|
||||
self.offset_spinbox.setMaximum(1)
|
||||
self.offset_spinbox.setProperty("value", 0)
|
||||
self.offset_spinbox.setObjectName("offset_spinbox")
|
||||
self.gridLayout.addWidget(self.offset_spinbox, 1, 3, 1, 1)
|
||||
self.label = QtWidgets.QLabel(SkipDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 1, 2, 1, 1)
|
||||
self.step_spinbox = QtWidgets.QSpinBox(SkipDialog)
|
||||
self.step_spinbox.setMinimum(2)
|
||||
self.step_spinbox.setObjectName("step_spinbox")
|
||||
self.gridLayout.addWidget(self.step_spinbox, 1, 1, 1, 1)
|
||||
self.invert_check = QtWidgets.QCheckBox(SkipDialog)
|
||||
self.invert_check.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.invert_check.setObjectName("invert_check")
|
||||
self.gridLayout.addWidget(self.invert_check, 1, 4, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(SkipDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 5)
|
||||
self.hide_button = QtWidgets.QRadioButton(SkipDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.hide_button.sizePolicy().hasHeightForWidth())
|
||||
self.hide_button.setSizePolicy(sizePolicy)
|
||||
self.hide_button.setChecked(True)
|
||||
self.hide_button.setObjectName("hide_button")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(SkipDialog)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.hide_button)
|
||||
self.gridLayout.addWidget(self.hide_button, 2, 0, 1, 2)
|
||||
self.delete_button = QtWidgets.QRadioButton(SkipDialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.delete_button.sizePolicy().hasHeightForWidth())
|
||||
self.delete_button.setSizePolicy(sizePolicy)
|
||||
self.delete_button.setObjectName("delete_button")
|
||||
self.buttonGroup.addButton(self.delete_button)
|
||||
self.gridLayout.addWidget(self.delete_button, 2, 2, 1, 3)
|
||||
self.label_2.setBuddy(self.step_spinbox)
|
||||
self.label.setBuddy(self.offset_spinbox)
|
||||
|
||||
self.retranslateUi(SkipDialog)
|
||||
self.buttonBox.accepted.connect(SkipDialog.accept)
|
||||
self.buttonBox.rejected.connect(SkipDialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(SkipDialog)
|
||||
SkipDialog.setTabOrder(self.step_spinbox, self.offset_spinbox)
|
||||
SkipDialog.setTabOrder(self.offset_spinbox, self.invert_check)
|
||||
SkipDialog.setTabOrder(self.invert_check, self.hide_button)
|
||||
SkipDialog.setTabOrder(self.hide_button, self.delete_button)
|
||||
|
||||
def retranslateUi(self, SkipDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
self.label_2.setText(_translate("SkipDialog", "Step"))
|
||||
self.label_4.setText(_translate("SkipDialog", "<html><head/><body><p>Show every <span style=\" font-style:italic;\">step</span> point, beginning with <span style=\" font-style:italic;\">offset (<step).<br/></span>Use <span style=\" font-style:italic;\">Invert </span>to hide every <span style=\" font-style:italic;\">step </span>point.</p></body></html>"))
|
||||
self.label.setText(_translate("SkipDialog", "Offset"))
|
||||
self.invert_check.setText(_translate("SkipDialog", "Invert"))
|
||||
self.hide_button.setText(_translate("SkipDialog", "Hide skipped pts."))
|
||||
self.delete_button.setText(_translate("SkipDialog", "Copy without any hidden pts."))
|
121
src/gui_qt/_py/smoothdialog.py
Normal file
121
src/gui_qt/_py/smoothdialog.py
Normal file
@ -0,0 +1,121 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/smoothdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_SmoothDialog(object):
|
||||
def setupUi(self, SmoothDialog):
|
||||
SmoothDialog.setObjectName("SmoothDialog")
|
||||
SmoothDialog.resize(451, 220)
|
||||
self.gridLayout = QtWidgets.QGridLayout(SmoothDialog)
|
||||
self.gridLayout.setSpacing(3)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.frac_label = QtWidgets.QLabel(SmoothDialog)
|
||||
self.frac_label.setObjectName("frac_label")
|
||||
self.gridLayout.addWidget(self.frac_label, 1, 0, 1, 1)
|
||||
self.widget_2 = QtWidgets.QWidget(SmoothDialog)
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.widget_2)
|
||||
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_3.setSpacing(3)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_3 = QtWidgets.QLabel(self.widget_2)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.horizontalLayout_3.addWidget(self.label_3)
|
||||
self.iter_spinBox = QtWidgets.QSpinBox(self.widget_2)
|
||||
self.iter_spinBox.setMaximum(3)
|
||||
self.iter_spinBox.setSingleStep(1)
|
||||
self.iter_spinBox.setProperty("value", 1)
|
||||
self.iter_spinBox.setObjectName("iter_spinBox")
|
||||
self.horizontalLayout_3.addWidget(self.iter_spinBox)
|
||||
self.gridLayout.addWidget(self.widget_2, 3, 0, 1, 2)
|
||||
self.line = QtWidgets.QFrame(SmoothDialog)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout.addWidget(self.line, 4, 0, 1, 2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(SmoothDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 7, 0, 1, 2)
|
||||
self.widget = QtWidgets.QWidget(SmoothDialog)
|
||||
self.widget.setObjectName("widget")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label = QtWidgets.QLabel(self.widget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout_2.addWidget(self.label)
|
||||
self.polynom_spinBox = QtWidgets.QSpinBox(self.widget)
|
||||
self.polynom_spinBox.setMinimum(1)
|
||||
self.polynom_spinBox.setMaximum(3)
|
||||
self.polynom_spinBox.setObjectName("polynom_spinBox")
|
||||
self.horizontalLayout_2.addWidget(self.polynom_spinBox)
|
||||
self.gridLayout.addWidget(self.widget, 2, 0, 1, 2)
|
||||
self.frac_spinBox = QtWidgets.QSpinBox(SmoothDialog)
|
||||
self.frac_spinBox.setMinimum(1)
|
||||
self.frac_spinBox.setMaximum(999)
|
||||
self.frac_spinBox.setObjectName("frac_spinBox")
|
||||
self.gridLayout.addWidget(self.frac_spinBox, 1, 1, 1, 1)
|
||||
self.comboBox = QtWidgets.QComboBox(SmoothDialog)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.gridLayout.addWidget(self.comboBox, 0, 0, 1, 2)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 6, 0, 1, 1)
|
||||
self.y_checkBox = QtWidgets.QCheckBox(SmoothDialog)
|
||||
self.y_checkBox.setObjectName("y_checkBox")
|
||||
self.gridLayout.addWidget(self.y_checkBox, 5, 1, 1, 1)
|
||||
self.x_checkBox = QtWidgets.QCheckBox(SmoothDialog)
|
||||
self.x_checkBox.setObjectName("x_checkBox")
|
||||
self.gridLayout.addWidget(self.x_checkBox, 5, 0, 1, 1)
|
||||
self.frac_label.setBuddy(self.frac_spinBox)
|
||||
self.label_3.setBuddy(self.iter_spinBox)
|
||||
self.label.setBuddy(self.polynom_spinBox)
|
||||
|
||||
self.retranslateUi(SmoothDialog)
|
||||
self.buttonBox.accepted.connect(SmoothDialog.accept)
|
||||
self.buttonBox.rejected.connect(SmoothDialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(SmoothDialog)
|
||||
SmoothDialog.setTabOrder(self.comboBox, self.frac_spinBox)
|
||||
SmoothDialog.setTabOrder(self.frac_spinBox, self.polynom_spinBox)
|
||||
SmoothDialog.setTabOrder(self.polynom_spinBox, self.iter_spinBox)
|
||||
SmoothDialog.setTabOrder(self.iter_spinBox, self.x_checkBox)
|
||||
SmoothDialog.setTabOrder(self.x_checkBox, self.y_checkBox)
|
||||
|
||||
def retranslateUi(self, SmoothDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
SmoothDialog.setWindowTitle(_translate("SmoothDialog", "1D smoothing filter"))
|
||||
self.frac_label.setText(_translate("SmoothDialog", "Window length"))
|
||||
self.label_3.setText(_translate("SmoothDialog", "Iterations"))
|
||||
self.label.setText(_translate("SmoothDialog", "Polynomial degree"))
|
||||
self.polynom_spinBox.setToolTip(_translate("SmoothDialog", "Deg"))
|
||||
self.frac_spinBox.setToolTip(_translate("SmoothDialog", "<html><head/><body><p>Number of data points used as smoothing window.</p></body></html>"))
|
||||
self.comboBox.setItemText(0, _translate("SmoothDialog", "Moving mean"))
|
||||
self.comboBox.setItemText(1, _translate("SmoothDialog", "Savitzky-Golay"))
|
||||
self.comboBox.setItemText(2, _translate("SmoothDialog", "Loess (slow, use for < 10000 pts)"))
|
||||
self.comboBox.setItemText(3, _translate("SmoothDialog", "Moving median"))
|
||||
self.comboBox.setItemText(4, _translate("SmoothDialog", "Moving standard deviation"))
|
||||
self.comboBox.setItemText(5, _translate("SmoothDialog", "Moving variance"))
|
||||
self.comboBox.setItemText(6, _translate("SmoothDialog", "Moving maximum"))
|
||||
self.comboBox.setItemText(7, _translate("SmoothDialog", "Moving minimum"))
|
||||
self.comboBox.setItemText(8, _translate("SmoothDialog", "Moving sum"))
|
||||
self.y_checkBox.setText(_translate("SmoothDialog", "y log-spaced?"))
|
||||
self.x_checkBox.setText(_translate("SmoothDialog", "x log-spaced?"))
|
318
src/gui_qt/_py/t1_calc_dialog.py
Normal file
318
src/gui_qt/_py/t1_calc_dialog.py
Normal file
@ -0,0 +1,318 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/t1_calc_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(582, 698)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox_2)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.specdens_combobox = QtWidgets.QComboBox(self.groupBox_2)
|
||||
self.specdens_combobox.setObjectName("specdens_combobox")
|
||||
self.verticalLayout_2.addWidget(self.specdens_combobox)
|
||||
self.specdens_frame = QtWidgets.QFrame(self.groupBox_2)
|
||||
self.specdens_frame.setObjectName("specdens_frame")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.specdens_frame)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.verticalLayout_2.addWidget(self.specdens_frame)
|
||||
self.coupling_combobox = QtWidgets.QComboBox(self.groupBox_2)
|
||||
self.coupling_combobox.setObjectName("coupling_combobox")
|
||||
self.verticalLayout_2.addWidget(self.coupling_combobox)
|
||||
self.coupling_frame = QtWidgets.QFrame(self.groupBox_2)
|
||||
self.coupling_frame.setObjectName("coupling_frame")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.coupling_frame)
|
||||
self.verticalLayout_4.setContentsMargins(-1, -1, 1, 1)
|
||||
self.verticalLayout_4.setSpacing(0)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.verticalLayout_2.addWidget(self.coupling_frame)
|
||||
self.gridLayout_2.addWidget(self.groupBox_2, 1, 0, 1, 1)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_3)
|
||||
self.gridLayout_4.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_4.setSpacing(3)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.graph_combobox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.graph_combobox.setEnabled(False)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.gridLayout_4.addWidget(self.graph_combobox, 1, 1, 1, 1)
|
||||
self.graph_checkbox = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.graph_checkbox.setChecked(True)
|
||||
self.graph_checkbox.setObjectName("graph_checkbox")
|
||||
self.gridLayout_4.addWidget(self.graph_checkbox, 1, 0, 1, 1)
|
||||
self.relax_combox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.relax_combox.setObjectName("relax_combox")
|
||||
self.relax_combox.addItem("")
|
||||
self.relax_combox.addItem("")
|
||||
self.gridLayout_4.addWidget(self.relax_combox, 0, 0, 1, 2)
|
||||
self.gridLayout_2.addWidget(self.groupBox_3, 2, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem, 3, 0, 1, 1)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout_2.addWidget(self.buttonBox, 4, 0, 1, 1)
|
||||
self.groupBox = QtWidgets.QGroupBox(Dialog)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox)
|
||||
self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_3.setSpacing(2)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.second_x_lineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.second_x_lineEdit.setObjectName("second_x_lineEdit")
|
||||
self.gridLayout_3.addWidget(self.second_x_lineEdit, 10, 1, 1, 1)
|
||||
self.x_input_combobox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.x_input_combobox.setObjectName("x_input_combobox")
|
||||
self.x_input_combobox.addItem("")
|
||||
self.x_input_combobox.addItem("")
|
||||
self.gridLayout_3.addWidget(self.x_input_combobox, 1, 1, 1, 1)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setSpacing(2)
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.radioButton = QtWidgets.QRadioButton(self.groupBox)
|
||||
self.radioButton.setChecked(True)
|
||||
self.radioButton.setObjectName("radioButton")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(Dialog)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.radioButton)
|
||||
self.horizontalLayout_4.addWidget(self.radioButton)
|
||||
self.radioButton_2 = QtWidgets.QRadioButton(self.groupBox)
|
||||
self.radioButton_2.setObjectName("radioButton_2")
|
||||
self.buttonGroup.addButton(self.radioButton_2)
|
||||
self.horizontalLayout_4.addWidget(self.radioButton_2)
|
||||
self.radioButton_4 = QtWidgets.QRadioButton(self.groupBox)
|
||||
self.radioButton_4.setObjectName("radioButton_4")
|
||||
self.buttonGroup.addButton(self.radioButton_4)
|
||||
self.horizontalLayout_4.addWidget(self.radioButton_4)
|
||||
self.radioButton_3 = QtWidgets.QRadioButton(self.groupBox)
|
||||
self.radioButton_3.setObjectName("radioButton_3")
|
||||
self.buttonGroup.addButton(self.radioButton_3)
|
||||
self.horizontalLayout_4.addWidget(self.radioButton_3)
|
||||
self.gridLayout_3.addLayout(self.horizontalLayout_4, 0, 0, 1, 2)
|
||||
self.label_7 = QtWidgets.QLabel(self.groupBox)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout_3.addWidget(self.label_7, 10, 0, 1, 1)
|
||||
self.line = QtWidgets.QFrame(self.groupBox)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout_3.addWidget(self.line, 9, 0, 1, 2)
|
||||
self.line_2 = QtWidgets.QFrame(self.groupBox)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.gridLayout_3.addWidget(self.line_2, 7, 0, 1, 2)
|
||||
self.range_widget = QtWidgets.QWidget(self.groupBox)
|
||||
self.range_widget.setObjectName("range_widget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.range_widget)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem1, 0, 0, 1, 1)
|
||||
self.stop_lineEdit = QtWidgets.QLineEdit(self.range_widget)
|
||||
self.stop_lineEdit.setObjectName("stop_lineEdit")
|
||||
self.gridLayout.addWidget(self.stop_lineEdit, 0, 3, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.range_widget)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 0, 2, 1, 1)
|
||||
self.spinBox = QtWidgets.QSpinBox(self.range_widget)
|
||||
self.spinBox.setProperty("value", 50)
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.gridLayout.addWidget(self.spinBox, 0, 5, 1, 1)
|
||||
self.start_lineEdit = QtWidgets.QLineEdit(self.range_widget)
|
||||
self.start_lineEdit.setObjectName("start_lineEdit")
|
||||
self.gridLayout.addWidget(self.start_lineEdit, 0, 1, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.range_widget)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout.addWidget(self.checkBox, 0, 6, 1, 1)
|
||||
self.gridLayout_3.addWidget(self.range_widget, 2, 0, 1, 2)
|
||||
self.data_widget = QtWidgets.QWidget(self.groupBox)
|
||||
self.data_widget.setObjectName("data_widget")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.data_widget)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setSpacing(2)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.tau_graph_combobox = QtWidgets.QComboBox(self.data_widget)
|
||||
self.tau_graph_combobox.setObjectName("tau_graph_combobox")
|
||||
self.horizontalLayout_2.addWidget(self.tau_graph_combobox)
|
||||
self.tau_set_combobox = QtWidgets.QComboBox(self.data_widget)
|
||||
self.tau_set_combobox.setObjectName("tau_set_combobox")
|
||||
self.horizontalLayout_2.addWidget(self.tau_set_combobox)
|
||||
self.label_10 = QtWidgets.QLabel(self.data_widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_10.sizePolicy().hasHeightForWidth())
|
||||
self.label_10.setSizePolicy(sizePolicy)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.horizontalLayout_2.addWidget(self.label_10)
|
||||
self.x_radioButton = QtWidgets.QRadioButton(self.data_widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.x_radioButton.sizePolicy().hasHeightForWidth())
|
||||
self.x_radioButton.setSizePolicy(sizePolicy)
|
||||
self.x_radioButton.setObjectName("x_radioButton")
|
||||
self.buttonGroup_2 = QtWidgets.QButtonGroup(Dialog)
|
||||
self.buttonGroup_2.setObjectName("buttonGroup_2")
|
||||
self.buttonGroup_2.addButton(self.x_radioButton)
|
||||
self.horizontalLayout_2.addWidget(self.x_radioButton)
|
||||
self.y_radioButton = QtWidgets.QRadioButton(self.data_widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.y_radioButton.sizePolicy().hasHeightForWidth())
|
||||
self.y_radioButton.setSizePolicy(sizePolicy)
|
||||
self.y_radioButton.setChecked(True)
|
||||
self.y_radioButton.setObjectName("y_radioButton")
|
||||
self.buttonGroup_2.addButton(self.y_radioButton)
|
||||
self.horizontalLayout_2.addWidget(self.y_radioButton)
|
||||
self.gridLayout_3.addWidget(self.data_widget, 3, 0, 1, 2)
|
||||
self.temp_widget = QtWidgets.QWidget(self.groupBox)
|
||||
self.temp_widget.setObjectName("temp_widget")
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.temp_widget)
|
||||
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_5.setHorizontalSpacing(6)
|
||||
self.gridLayout_5.setVerticalSpacing(0)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.arr_widget = QtWidgets.QWidget(self.temp_widget)
|
||||
self.arr_widget.setObjectName("arr_widget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.arr_widget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(2)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem2)
|
||||
self.label = QtWidgets.QLabel(self.arr_widget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.tau0_lineEdit = QtWidgets.QLineEdit(self.arr_widget)
|
||||
self.tau0_lineEdit.setObjectName("tau0_lineEdit")
|
||||
self.horizontalLayout.addWidget(self.tau0_lineEdit)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem3)
|
||||
self.label_2 = QtWidgets.QLabel(self.arr_widget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout.addWidget(self.label_2)
|
||||
self.ea_lineEdit = QtWidgets.QLineEdit(self.arr_widget)
|
||||
self.ea_lineEdit.setObjectName("ea_lineEdit")
|
||||
self.horizontalLayout.addWidget(self.ea_lineEdit)
|
||||
self.gridLayout_5.addWidget(self.arr_widget, 0, 1, 1, 1)
|
||||
self.vft_widget = QtWidgets.QWidget(self.temp_widget)
|
||||
self.vft_widget.setObjectName("vft_widget")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.vft_widget)
|
||||
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_3.setSpacing(2)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_3 = QtWidgets.QLabel(self.vft_widget)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.horizontalLayout_3.addWidget(self.label_3)
|
||||
self.tau0_vft_lineEdit = QtWidgets.QLineEdit(self.vft_widget)
|
||||
self.tau0_vft_lineEdit.setObjectName("tau0_vft_lineEdit")
|
||||
self.horizontalLayout_3.addWidget(self.tau0_vft_lineEdit)
|
||||
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem4)
|
||||
self.label_5 = QtWidgets.QLabel(self.vft_widget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_3.addWidget(self.label_5)
|
||||
self.b_vft_lineEdit = QtWidgets.QLineEdit(self.vft_widget)
|
||||
self.b_vft_lineEdit.setObjectName("b_vft_lineEdit")
|
||||
self.horizontalLayout_3.addWidget(self.b_vft_lineEdit)
|
||||
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem5)
|
||||
self.label_6 = QtWidgets.QLabel(self.vft_widget)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.horizontalLayout_3.addWidget(self.label_6)
|
||||
self.t0_vft_lineEdit = QtWidgets.QLineEdit(self.vft_widget)
|
||||
self.t0_vft_lineEdit.setObjectName("t0_vft_lineEdit")
|
||||
self.horizontalLayout_3.addWidget(self.t0_vft_lineEdit)
|
||||
self.gridLayout_5.addWidget(self.vft_widget, 1, 1, 1, 1)
|
||||
self.temp_combobox = QtWidgets.QComboBox(self.temp_widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.temp_combobox.sizePolicy().hasHeightForWidth())
|
||||
self.temp_combobox.setSizePolicy(sizePolicy)
|
||||
self.temp_combobox.setObjectName("temp_combobox")
|
||||
self.temp_combobox.addItem("")
|
||||
self.temp_combobox.addItem("")
|
||||
self.gridLayout_5.addWidget(self.temp_combobox, 0, 0, 2, 1)
|
||||
self.gridLayout_3.addWidget(self.temp_widget, 4, 0, 1, 2)
|
||||
self.xtype_combobox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.xtype_combobox.setObjectName("xtype_combobox")
|
||||
self.xtype_combobox.addItem("")
|
||||
self.xtype_combobox.addItem("")
|
||||
self.xtype_combobox.addItem("")
|
||||
self.xtype_combobox.addItem("")
|
||||
self.gridLayout_3.addWidget(self.xtype_combobox, 8, 1, 1, 1)
|
||||
self.label_8 = QtWidgets.QLabel(self.groupBox)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.gridLayout_3.addWidget(self.label_8, 8, 0, 1, 1)
|
||||
self.label_9 = QtWidgets.QLabel(self.groupBox)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.gridLayout_3.addWidget(self.label_9, 1, 0, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.groupBox, 0, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Calculate relaxation"))
|
||||
self.groupBox_2.setTitle(_translate("Dialog", "Model"))
|
||||
self.groupBox_3.setTitle(_translate("Dialog", "Result"))
|
||||
self.graph_checkbox.setText(_translate("Dialog", "New graph?"))
|
||||
self.relax_combox.setStatusTip(_translate("Dialog", "NOTE: Mean values are not available for all spectral densities. For more information ask someone."))
|
||||
self.relax_combox.setItemText(0, _translate("Dialog", "Spin-Lattice Relaxation T1"))
|
||||
self.relax_combox.setItemText(1, _translate("Dialog", "Spin-Spin Relaxation T2"))
|
||||
self.groupBox.setTitle(_translate("Dialog", "Axis"))
|
||||
self.x_input_combobox.setItemText(0, _translate("Dialog", "Range"))
|
||||
self.x_input_combobox.setItemText(1, _translate("Dialog", "Data"))
|
||||
self.radioButton.setText(_translate("Dialog", "τ / s"))
|
||||
self.radioButton_2.setText(_translate("Dialog", "ω / Hz"))
|
||||
self.radioButton_4.setText(_translate("Dialog", "1000 K / T"))
|
||||
self.radioButton_3.setText(_translate("Dialog", "T / K"))
|
||||
self.label_7.setText(_translate("Dialog", "2nd axis"))
|
||||
self.label_4.setText(_translate("Dialog", "–"))
|
||||
self.spinBox.setSuffix(_translate("Dialog", " pts."))
|
||||
self.checkBox.setText(_translate("Dialog", "Log?"))
|
||||
self.label_10.setText(_translate("Dialog", " Use"))
|
||||
self.x_radioButton.setText(_translate("Dialog", "x"))
|
||||
self.y_radioButton.setText(_translate("Dialog", "y"))
|
||||
self.label.setText(_translate("Dialog", "τ0 / s "))
|
||||
self.tau0_lineEdit.setText(_translate("Dialog", "1"))
|
||||
self.label_2.setText(_translate("Dialog", "E_A / eV "))
|
||||
self.ea_lineEdit.setText(_translate("Dialog", "1"))
|
||||
self.label_3.setText(_translate("Dialog", "τ0 / s "))
|
||||
self.tau0_vft_lineEdit.setText(_translate("Dialog", "1"))
|
||||
self.label_5.setText(_translate("Dialog", "B / K "))
|
||||
self.b_vft_lineEdit.setText(_translate("Dialog", "1"))
|
||||
self.label_6.setText(_translate("Dialog", "T_0 / K "))
|
||||
self.t0_vft_lineEdit.setText(_translate("Dialog", "1"))
|
||||
self.temp_combobox.setItemText(0, _translate("Dialog", "Arrhenius"))
|
||||
self.temp_combobox.setItemText(1, _translate("Dialog", "VFT"))
|
||||
self.xtype_combobox.setItemText(0, _translate("Dialog", "Function parameter: τ"))
|
||||
self.xtype_combobox.setItemText(1, _translate("Dialog", "Peak time: τₚ"))
|
||||
self.xtype_combobox.setItemText(2, _translate("Dialog", "Arithmetic mean: ⟨τ⟩"))
|
||||
self.xtype_combobox.setItemText(3, _translate("Dialog", "Geometric mean: exp(⟨ln τ⟩)"))
|
||||
self.label_8.setText(_translate("Dialog", "Interpretation as:"))
|
||||
self.label_9.setText(_translate("Dialog", "Input from: "))
|
258
src/gui_qt/_py/t1_dock.py
Normal file
258
src/gui_qt/_py/t1_dock.py
Normal file
@ -0,0 +1,258 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/t1_dock.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_t1dialog(object):
|
||||
def setupUi(self, t1dialog):
|
||||
t1dialog.setObjectName("t1dialog")
|
||||
t1dialog.resize(295, 771)
|
||||
self.dockWidgetContents = QtWidgets.QWidget()
|
||||
self.dockWidgetContents.setObjectName("dockWidgetContents")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.dockWidgetContents)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.scrollArea = QtWidgets.QScrollArea(self.dockWidgetContents)
|
||||
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollAreaWidgetContents = QtWidgets.QWidget()
|
||||
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 279, 727))
|
||||
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
|
||||
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
|
||||
self.verticalLayout_7.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_7.setSpacing(0)
|
||||
self.verticalLayout_7.setObjectName("verticalLayout_7")
|
||||
self.groupBox_1 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox_1.setObjectName("groupBox_1")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_1)
|
||||
self.gridLayout_3.setVerticalSpacing(0)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.comboBox_3 = QtWidgets.QComboBox(self.groupBox_1)
|
||||
self.comboBox_3.setObjectName("comboBox_3")
|
||||
self.comboBox_3.addItem("")
|
||||
self.comboBox_3.addItem("")
|
||||
self.comboBox_3.addItem("")
|
||||
self.comboBox_3.addItem("")
|
||||
self.gridLayout_3.addWidget(self.comboBox_3, 0, 1, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.groupBox_1)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout_3.addWidget(self.label_6, 0, 0, 1, 1)
|
||||
self.comboBox_2 = QtWidgets.QComboBox(self.groupBox_1)
|
||||
self.comboBox_2.setObjectName("comboBox_2")
|
||||
self.comboBox_2.addItem("")
|
||||
self.comboBox_2.addItem("")
|
||||
self.comboBox_2.addItem("")
|
||||
self.gridLayout_3.addWidget(self.comboBox_2, 1, 1, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(self.groupBox_1)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout_3.addWidget(self.label_5, 1, 0, 1, 1)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_1)
|
||||
self.groupBox_5 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox_5.setObjectName("groupBox_5")
|
||||
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.groupBox_5)
|
||||
self.verticalLayout_6.setSpacing(0)
|
||||
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||
self.comboBox_6 = QtWidgets.QComboBox(self.groupBox_5)
|
||||
self.comboBox_6.setObjectName("comboBox_6")
|
||||
self.comboBox_6.addItem("")
|
||||
self.comboBox_6.addItem("")
|
||||
self.comboBox_6.addItem("")
|
||||
self.comboBox_6.addItem("")
|
||||
self.verticalLayout_6.addWidget(self.comboBox_6)
|
||||
self.frame = QtWidgets.QFrame(self.groupBox_5)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame)
|
||||
self.horizontalLayout.setContentsMargins(0, 6, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label_9 = QtWidgets.QLabel(self.frame)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.horizontalLayout.addWidget(self.label_9)
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.horizontalLayout.addWidget(self.lineEdit_2)
|
||||
self.label_10 = QtWidgets.QLabel(self.frame)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.horizontalLayout.addWidget(self.label_10)
|
||||
self.lineEdit_3 = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit_3.setObjectName("lineEdit_3")
|
||||
self.horizontalLayout.addWidget(self.lineEdit_3)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.frame)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.horizontalLayout.addWidget(self.checkBox)
|
||||
self.verticalLayout_6.addWidget(self.frame)
|
||||
self.frame_2 = QtWidgets.QFrame(self.groupBox_5)
|
||||
self.frame_2.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame_2.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame_2.setObjectName("frame_2")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_2)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 6, 0, 0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_11 = QtWidgets.QLabel(self.frame_2)
|
||||
self.label_11.setObjectName("label_11")
|
||||
self.horizontalLayout_2.addWidget(self.label_11)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem)
|
||||
self.label_13 = QtWidgets.QLabel(self.frame_2)
|
||||
self.label_13.setObjectName("label_13")
|
||||
self.horizontalLayout_2.addWidget(self.label_13)
|
||||
self.label_12 = QtWidgets.QLabel(self.frame_2)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.horizontalLayout_2.addWidget(self.label_12)
|
||||
self.pushButton_2 = QtWidgets.QPushButton(self.frame_2)
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_2)
|
||||
self.verticalLayout_6.addWidget(self.frame_2)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_5)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.groupBox_2)
|
||||
self.gridLayout.setVerticalSpacing(0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_3 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 0, 3, 1, 1)
|
||||
self.t1_min_edit = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.t1_min_edit.setObjectName("t1_min_edit")
|
||||
self.gridLayout.addWidget(self.t1_min_edit, 0, 4, 1, 1)
|
||||
self.label_7 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout.addWidget(self.label_7, 0, 5, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem1, 0, 1, 1, 1)
|
||||
self.t1_pos_edit = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.t1_pos_edit.setObjectName("t1_pos_edit")
|
||||
self.gridLayout.addWidget(self.t1_pos_edit, 0, 2, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
|
||||
self.label_8 = QtWidgets.QLabel(self.groupBox_2)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.gridLayout.addWidget(self.label_8, 1, 5, 1, 1)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.groupBox_2)
|
||||
self.lineEdit.setInputMethodHints(QtCore.Qt.ImhDigitsOnly|QtCore.Qt.ImhFormattedNumbersOnly|QtCore.Qt.ImhPreferNumbers)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.gridLayout.addWidget(self.lineEdit, 1, 4, 1, 1)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_2)
|
||||
self.groupBox = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.comboBox_4 = QtWidgets.QComboBox(self.groupBox)
|
||||
self.comboBox_4.setObjectName("comboBox_4")
|
||||
self.verticalLayout_2.addWidget(self.comboBox_4)
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout_3)
|
||||
self.label_14 = QtWidgets.QLabel(self.groupBox)
|
||||
self.label_14.setObjectName("label_14")
|
||||
self.verticalLayout_2.addWidget(self.label_14)
|
||||
self.verticalLayout_7.addWidget(self.groupBox)
|
||||
self.groupBox_4 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox_4.setObjectName("groupBox_4")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox_4)
|
||||
self.verticalLayout_5.setSpacing(0)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.comboBox_5 = QtWidgets.QComboBox(self.groupBox_4)
|
||||
self.comboBox_5.setObjectName("comboBox_5")
|
||||
self.verticalLayout_5.addWidget(self.comboBox_5)
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_4.setContentsMargins(-1, -1, 0, 0)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.verticalLayout_5.addLayout(self.verticalLayout_4)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_4)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_3)
|
||||
self.gridLayout_2.setContentsMargins(-1, 1, -1, -1)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.comboBox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.gridLayout_2.addWidget(self.comboBox, 0, 1, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout_2.addWidget(self.label_4, 0, 0, 1, 1)
|
||||
self.checkBox_interpol = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.checkBox_interpol.setObjectName("checkBox_interpol")
|
||||
self.gridLayout_2.addWidget(self.checkBox_interpol, 1, 1, 1, 1)
|
||||
self.verticalLayout_7.addWidget(self.groupBox_3)
|
||||
self.pushButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.pushButton.setFont(font)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.verticalLayout_7.addWidget(self.pushButton)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(17, 423, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_7.addItem(spacerItem2)
|
||||
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
|
||||
self.verticalLayout.addWidget(self.scrollArea)
|
||||
t1dialog.setWidget(self.dockWidgetContents)
|
||||
|
||||
self.retranslateUi(t1dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(t1dialog)
|
||||
|
||||
def retranslateUi(self, t1dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
t1dialog.setWindowTitle(_translate("t1dialog", "Evaluate T1 (temperature)"))
|
||||
self.groupBox_1.setTitle(_translate("t1dialog", "Axes"))
|
||||
self.comboBox_3.setItemText(0, _translate("t1dialog", "T1"))
|
||||
self.comboBox_3.setItemText(1, _translate("t1dialog", "1/T1"))
|
||||
self.comboBox_3.setItemText(2, _translate("t1dialog", "log10(T1)"))
|
||||
self.comboBox_3.setItemText(3, _translate("t1dialog", "log10(1/T1)"))
|
||||
self.label_6.setText(_translate("t1dialog", "Relaxation in"))
|
||||
self.comboBox_2.setItemText(0, _translate("t1dialog", "T"))
|
||||
self.comboBox_2.setItemText(1, _translate("t1dialog", "1000/T"))
|
||||
self.comboBox_2.setItemText(2, _translate("t1dialog", "1/T"))
|
||||
self.label_5.setText(_translate("t1dialog", "Temperature in"))
|
||||
self.groupBox_5.setTitle(_translate("t1dialog", "T1 minimon"))
|
||||
self.comboBox_6.setItemText(0, _translate("t1dialog", "Data minimum"))
|
||||
self.comboBox_6.setItemText(1, _translate("t1dialog", "Parabola"))
|
||||
self.comboBox_6.setItemText(2, _translate("t1dialog", "Cubic spline"))
|
||||
self.comboBox_6.setItemText(3, _translate("t1dialog", "Pchip"))
|
||||
self.label_9.setText(_translate("t1dialog", "start (K)"))
|
||||
self.lineEdit_2.setPlaceholderText(_translate("t1dialog", "1"))
|
||||
self.label_10.setText(_translate("t1dialog", " end (K)"))
|
||||
self.lineEdit_3.setPlaceholderText(_translate("t1dialog", "2"))
|
||||
self.checkBox.setText(_translate("t1dialog", "Show?"))
|
||||
self.label_11.setText(_translate("t1dialog", "Minimon"))
|
||||
self.label_13.setText(_translate("t1dialog", "x value"))
|
||||
self.label_12.setText(_translate("t1dialog", "y value"))
|
||||
self.pushButton_2.setText(_translate("t1dialog", "Use"))
|
||||
self.groupBox_2.setTitle(_translate("t1dialog", "Parameter"))
|
||||
self.label_3.setText(_translate("t1dialog", "<html><head/><body><p>T<span style=\" vertical-align:sub;\">1</span> minimum</p></body></html>"))
|
||||
self.label_2.setText(_translate("t1dialog", "K"))
|
||||
self.t1_min_edit.setPlaceholderText(_translate("t1dialog", "1e-3"))
|
||||
self.label_7.setText(_translate("t1dialog", "s"))
|
||||
self.t1_pos_edit.setPlaceholderText(_translate("t1dialog", "100"))
|
||||
self.label.setText(_translate("t1dialog", "frequency"))
|
||||
self.label_8.setText(_translate("t1dialog", "Hz"))
|
||||
self.lineEdit.setPlaceholderText(_translate("t1dialog", "100e6"))
|
||||
self.groupBox.setTitle(_translate("t1dialog", "Spectral density"))
|
||||
self.label_14.setText(_translate("t1dialog", "Calculated minimum:"))
|
||||
self.groupBox_4.setTitle(_translate("t1dialog", "Coupling"))
|
||||
self.groupBox_3.setTitle(_translate("t1dialog", "Result"))
|
||||
self.comboBox.setStatusTip(_translate("t1dialog", "NOTE: Mean values are not available for all spectral densities. For more information ask someone."))
|
||||
self.comboBox.setItemText(0, _translate("t1dialog", "Fit parameter: τ"))
|
||||
self.comboBox.setItemText(1, _translate("t1dialog", "Peak time: τₚ"))
|
||||
self.comboBox.setItemText(2, _translate("t1dialog", "Arithmetic mean: ⟨τ⟩"))
|
||||
self.comboBox.setItemText(3, _translate("t1dialog", "Geometric mean: exp(⟨ln τ⟩)"))
|
||||
self.label_4.setText(_translate("t1dialog", "Result as"))
|
||||
self.checkBox_interpol.setText(_translate("t1dialog", "Use interpolation"))
|
||||
self.pushButton.setText(_translate("t1dialog", "Calculate"))
|
215
src/gui_qt/_py/t1_tau_calculation.py
Normal file
215
src/gui_qt/_py/t1_tau_calculation.py
Normal file
@ -0,0 +1,215 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/t1_tau_calculation.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(400, 799)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(Form)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_2)
|
||||
self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_2.setHorizontalSpacing(3)
|
||||
self.gridLayout_2.setVerticalSpacing(1)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.freq_spinbox = QtWidgets.QDoubleSpinBox(self.groupBox_2)
|
||||
self.freq_spinbox.setMaximum(999.99)
|
||||
self.freq_spinbox.setProperty("value", 100.0)
|
||||
self.freq_spinbox.setObjectName("freq_spinbox")
|
||||
self.gridLayout_2.addWidget(self.freq_spinbox, 0, 0, 1, 1)
|
||||
self.freq_combox = QtWidgets.QComboBox(self.groupBox_2)
|
||||
self.freq_combox.setObjectName("freq_combox")
|
||||
self.freq_combox.addItem("")
|
||||
self.freq_combox.addItem("")
|
||||
self.freq_combox.addItem("")
|
||||
self.gridLayout_2.addWidget(self.freq_combox, 0, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox_2)
|
||||
self.scrollArea = QtWidgets.QScrollArea(Form)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.scrollArea.sizePolicy().hasHeightForWidth())
|
||||
self.scrollArea.setSizePolicy(sizePolicy)
|
||||
self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollAreaWidgetContents = QtWidgets.QWidget()
|
||||
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 388, 713))
|
||||
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
|
||||
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_5.setSpacing(3)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.groupBox_6 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox_6.setObjectName("groupBox_6")
|
||||
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.groupBox_6)
|
||||
self.verticalLayout_7.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_7.setSpacing(1)
|
||||
self.verticalLayout_7.setObjectName("verticalLayout_7")
|
||||
self.comboBox_7 = QtWidgets.QComboBox(self.groupBox_6)
|
||||
self.comboBox_7.setObjectName("comboBox_7")
|
||||
self.comboBox_7.addItem("")
|
||||
self.comboBox_7.addItem("")
|
||||
self.comboBox_7.addItem("")
|
||||
self.verticalLayout_7.addWidget(self.comboBox_7)
|
||||
self.arr_frame = QtWidgets.QFrame(self.groupBox_6)
|
||||
self.arr_frame.setObjectName("arr_frame")
|
||||
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.arr_frame)
|
||||
self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_6.setSpacing(1)
|
||||
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||
self.verticalLayout_7.addWidget(self.arr_frame)
|
||||
self.temp_frame = QtWidgets.QFrame(self.groupBox_6)
|
||||
self.temp_frame.setObjectName("temp_frame")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.temp_frame)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.lineEdit_3 = QtWidgets.QLineEdit(self.temp_frame)
|
||||
self.lineEdit_3.setObjectName("lineEdit_3")
|
||||
self.gridLayout.addWidget(self.lineEdit_3, 0, 1, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.temp_frame)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout.addWidget(self.checkBox, 0, 7, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.temp_frame)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 0, 2, 1, 1)
|
||||
self.lineEdit_4 = QtWidgets.QLineEdit(self.temp_frame)
|
||||
self.lineEdit_4.setObjectName("lineEdit_4")
|
||||
self.gridLayout.addWidget(self.lineEdit_4, 0, 3, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem, 0, 4, 1, 1)
|
||||
self.spinBox = QtWidgets.QSpinBox(self.temp_frame)
|
||||
self.spinBox.setProperty("value", 50)
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.gridLayout.addWidget(self.spinBox, 0, 5, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem1, 0, 6, 1, 1)
|
||||
self.verticalLayout_7.addWidget(self.temp_frame)
|
||||
self.data_frame = QtWidgets.QFrame(self.groupBox_6)
|
||||
self.data_frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.data_frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.data_frame.setObjectName("data_frame")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.data_frame)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setSpacing(1)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.tau_graph_combobox = QtWidgets.QComboBox(self.data_frame)
|
||||
self.tau_graph_combobox.setObjectName("tau_graph_combobox")
|
||||
self.horizontalLayout.addWidget(self.tau_graph_combobox)
|
||||
self.tau_set_combobox = QtWidgets.QComboBox(self.data_frame)
|
||||
self.tau_set_combobox.setObjectName("tau_set_combobox")
|
||||
self.horizontalLayout.addWidget(self.tau_set_combobox)
|
||||
self.verticalLayout_7.addWidget(self.data_frame)
|
||||
self.comboBox = QtWidgets.QComboBox(self.groupBox_6)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.verticalLayout_7.addWidget(self.comboBox)
|
||||
self.verticalLayout_5.addWidget(self.groupBox_6)
|
||||
self.groupBox = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.specdens_combobox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.specdens_combobox.setObjectName("specdens_combobox")
|
||||
self.verticalLayout_2.addWidget(self.specdens_combobox)
|
||||
self.specdens_frame = QtWidgets.QFrame(self.groupBox)
|
||||
self.specdens_frame.setObjectName("specdens_frame")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.specdens_frame)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.verticalLayout_2.addWidget(self.specdens_frame)
|
||||
self.coupling_combobox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.coupling_combobox.setObjectName("coupling_combobox")
|
||||
self.verticalLayout_2.addWidget(self.coupling_combobox)
|
||||
self.coupling_frame = QtWidgets.QFrame(self.groupBox)
|
||||
self.coupling_frame.setObjectName("coupling_frame")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.coupling_frame)
|
||||
self.verticalLayout_4.setContentsMargins(-1, -1, 1, 1)
|
||||
self.verticalLayout_4.setSpacing(0)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.verticalLayout_2.addWidget(self.coupling_frame)
|
||||
self.verticalLayout_5.addWidget(self.groupBox)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(self.scrollAreaWidgetContents)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_3)
|
||||
self.gridLayout_4.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_4.setSpacing(3)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.tau_combox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.tau_combox.setObjectName("tau_combox")
|
||||
self.tau_combox.addItem("")
|
||||
self.tau_combox.addItem("")
|
||||
self.tau_combox.addItem("")
|
||||
self.tau_combox.addItem("")
|
||||
self.gridLayout_4.addWidget(self.tau_combox, 0, 0, 1, 2)
|
||||
self.graph_checkbox = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.graph_checkbox.setChecked(True)
|
||||
self.graph_checkbox.setObjectName("graph_checkbox")
|
||||
self.gridLayout_4.addWidget(self.graph_checkbox, 1, 0, 1, 1)
|
||||
self.graph_combobox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.graph_combobox.setEnabled(True)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.gridLayout_4.addWidget(self.graph_combobox, 1, 1, 1, 1)
|
||||
self.verticalLayout_5.addWidget(self.groupBox_3)
|
||||
self.pushButton = QtWidgets.QPushButton(self.scrollAreaWidgetContents)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.pushButton.setFont(font)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.verticalLayout_5.addWidget(self.pushButton)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_5.addItem(spacerItem2)
|
||||
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
|
||||
self.verticalLayout.addWidget(self.scrollArea)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.groupBox_2.setTitle(_translate("Form", "Frequency"))
|
||||
self.freq_combox.setItemText(0, _translate("Form", "MHz"))
|
||||
self.freq_combox.setItemText(1, _translate("Form", "kHz"))
|
||||
self.freq_combox.setItemText(2, _translate("Form", "Hz"))
|
||||
self.groupBox_6.setTitle(_translate("Form", "Correlation times"))
|
||||
self.comboBox_7.setItemText(0, _translate("Form", "Arrhenius"))
|
||||
self.comboBox_7.setItemText(1, _translate("Form", "VFT"))
|
||||
self.comboBox_7.setItemText(2, _translate("Form", "Data"))
|
||||
self.lineEdit_3.setPlaceholderText(_translate("Form", "1 K"))
|
||||
self.checkBox.setText(_translate("Form", "1000/T"))
|
||||
self.label_4.setText(_translate("Form", "–"))
|
||||
self.lineEdit_4.setPlaceholderText(_translate("Form", "100 K"))
|
||||
self.spinBox.setSuffix(_translate("Form", " pts."))
|
||||
self.comboBox.setItemText(0, _translate("Form", "Fit parameter: τ"))
|
||||
self.comboBox.setItemText(1, _translate("Form", "Peak time: τₚ"))
|
||||
self.comboBox.setItemText(2, _translate("Form", "Arithmetic mean: ⟨τ⟩"))
|
||||
self.comboBox.setItemText(3, _translate("Form", "Geometric mean: exp(⟨ln τ⟩)"))
|
||||
self.groupBox.setTitle(_translate("Form", "Model"))
|
||||
self.groupBox_3.setTitle(_translate("Form", "Result"))
|
||||
self.tau_combox.setStatusTip(_translate("Form", "NOTE: Mean values are not available for all spectral densities. For more information ask someone."))
|
||||
self.tau_combox.setItemText(0, _translate("Form", "Fit parameter: τ"))
|
||||
self.tau_combox.setItemText(1, _translate("Form", "Peak time: τₚ"))
|
||||
self.tau_combox.setItemText(2, _translate("Form", "Arithmetic mean: ⟨τ⟩"))
|
||||
self.tau_combox.setItemText(3, _translate("Form", "Geometric mean: exp(⟨ln τ⟩)"))
|
||||
self.graph_checkbox.setText(_translate("Form", "New graph?"))
|
||||
self.pushButton.setText(_translate("Form", "Calculate"))
|
228
src/gui_qt/_py/t1dialog.py
Normal file
228
src/gui_qt/_py/t1dialog.py
Normal file
@ -0,0 +1,228 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/t1dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_t1dialog(object):
|
||||
def setupUi(self, t1dialog):
|
||||
t1dialog.setObjectName("t1dialog")
|
||||
t1dialog.resize(316, 741)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(t1dialog)
|
||||
self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.groupBox_1 = QtWidgets.QGroupBox(t1dialog)
|
||||
self.groupBox_1.setObjectName("groupBox_1")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_1)
|
||||
self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_3.setHorizontalSpacing(3)
|
||||
self.gridLayout_3.setVerticalSpacing(0)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.t1_combobox = QtWidgets.QComboBox(self.groupBox_1)
|
||||
self.t1_combobox.setObjectName("t1_combobox")
|
||||
self.t1_combobox.addItem("")
|
||||
self.t1_combobox.addItem("")
|
||||
self.gridLayout_3.addWidget(self.t1_combobox, 1, 1, 1, 1)
|
||||
self.temp_combobox = QtWidgets.QComboBox(self.groupBox_1)
|
||||
self.temp_combobox.setObjectName("temp_combobox")
|
||||
self.temp_combobox.addItem("")
|
||||
self.temp_combobox.addItem("")
|
||||
self.temp_combobox.addItem("")
|
||||
self.gridLayout_3.addWidget(self.temp_combobox, 1, 0, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.groupBox_1, 0, 0, 1, 1)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(t1dialog)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.groupBox_2)
|
||||
self.gridLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout.setHorizontalSpacing(3)
|
||||
self.gridLayout.setVerticalSpacing(1)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.freq_combox = QtWidgets.QComboBox(self.groupBox_2)
|
||||
self.freq_combox.setObjectName("freq_combox")
|
||||
self.freq_combox.addItem("")
|
||||
self.freq_combox.addItem("")
|
||||
self.freq_combox.addItem("")
|
||||
self.gridLayout.addWidget(self.freq_combox, 0, 1, 1, 1)
|
||||
self.freq_spinbox = QtWidgets.QDoubleSpinBox(self.groupBox_2)
|
||||
self.freq_spinbox.setMaximum(999.99)
|
||||
self.freq_spinbox.setProperty("value", 100.0)
|
||||
self.freq_spinbox.setObjectName("freq_spinbox")
|
||||
self.gridLayout.addWidget(self.freq_spinbox, 0, 0, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.groupBox_2, 1, 0, 1, 1)
|
||||
self.groupBox = QtWidgets.QGroupBox(t1dialog)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, -1)
|
||||
self.verticalLayout_2.setSpacing(2)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.specdens_combobox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.specdens_combobox.setObjectName("specdens_combobox")
|
||||
self.verticalLayout_2.addWidget(self.specdens_combobox)
|
||||
self.sd_frame = QtWidgets.QFrame(self.groupBox)
|
||||
self.sd_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.sd_frame.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.sd_frame.setObjectName("sd_frame")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.sd_frame)
|
||||
self.verticalLayout_3.setContentsMargins(1, 1, 1, 1)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.verticalLayout_2.addWidget(self.sd_frame)
|
||||
self.coupling_combobox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.coupling_combobox.setObjectName("coupling_combobox")
|
||||
self.verticalLayout_2.addWidget(self.coupling_combobox)
|
||||
self.cp_frame = QtWidgets.QFrame(self.groupBox)
|
||||
self.cp_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.cp_frame.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.cp_frame.setObjectName("cp_frame")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.cp_frame)
|
||||
self.verticalLayout_4.setContentsMargins(1, 1, 1, 1)
|
||||
self.verticalLayout_4.setSpacing(0)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.verticalLayout_2.addWidget(self.cp_frame)
|
||||
self.gridLayout_2.addWidget(self.groupBox, 3, 0, 1, 1)
|
||||
self.groupBox_5 = QtWidgets.QGroupBox(t1dialog)
|
||||
self.groupBox_5.setObjectName("groupBox_5")
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_5)
|
||||
self.gridLayout_5.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_5.setHorizontalSpacing(2)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.interpol_combobox = QtWidgets.QComboBox(self.groupBox_5)
|
||||
self.interpol_combobox.setObjectName("interpol_combobox")
|
||||
self.interpol_combobox.addItem("")
|
||||
self.interpol_combobox.addItem("")
|
||||
self.interpol_combobox.addItem("")
|
||||
self.interpol_combobox.addItem("")
|
||||
self.gridLayout_5.addWidget(self.interpol_combobox, 0, 0, 1, 1)
|
||||
self.frame = QtWidgets.QFrame(self.groupBox_5)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label_9 = QtWidgets.QLabel(self.frame)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.horizontalLayout.addWidget(self.label_9)
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.horizontalLayout.addWidget(self.lineEdit_2)
|
||||
self.label_10 = QtWidgets.QLabel(self.frame)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.horizontalLayout.addWidget(self.label_10)
|
||||
self.lineEdit_3 = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit_3.setObjectName("lineEdit_3")
|
||||
self.horizontalLayout.addWidget(self.lineEdit_3)
|
||||
self.gridLayout_5.addWidget(self.frame, 1, 0, 1, 2)
|
||||
self.frame_2 = QtWidgets.QFrame(self.groupBox_5)
|
||||
self.frame_2.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.frame_2.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.frame_2.setObjectName("frame_2")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_2)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_11 = QtWidgets.QLabel(self.frame_2)
|
||||
self.label_11.setObjectName("label_11")
|
||||
self.horizontalLayout_2.addWidget(self.label_11)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem)
|
||||
self.label_13 = QtWidgets.QLabel(self.frame_2)
|
||||
self.label_13.setObjectName("label_13")
|
||||
self.horizontalLayout_2.addWidget(self.label_13)
|
||||
self.label_12 = QtWidgets.QLabel(self.frame_2)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.horizontalLayout_2.addWidget(self.label_12)
|
||||
self.gridLayout_5.addWidget(self.frame_2, 2, 0, 1, 2)
|
||||
self.t1min_toolButton = QtWidgets.QToolButton(self.groupBox_5)
|
||||
self.t1min_toolButton.setObjectName("t1min_toolButton")
|
||||
self.gridLayout_5.addWidget(self.t1min_toolButton, 0, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.groupBox_5, 2, 0, 1, 1)
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(t1dialog)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_3)
|
||||
self.gridLayout_4.setContentsMargins(3, 3, 3, 3)
|
||||
self.gridLayout_4.setSpacing(3)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.graph_combobox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.graph_combobox.setEnabled(False)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.gridLayout_4.addWidget(self.graph_combobox, 3, 1, 1, 1)
|
||||
self.tau_combox = QtWidgets.QComboBox(self.groupBox_3)
|
||||
self.tau_combox.setObjectName("tau_combox")
|
||||
self.tau_combox.addItem("")
|
||||
self.tau_combox.addItem("")
|
||||
self.tau_combox.addItem("")
|
||||
self.tau_combox.addItem("")
|
||||
self.gridLayout_4.addWidget(self.tau_combox, 1, 0, 1, 2)
|
||||
self.checkBox_interpol = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.checkBox_interpol.setObjectName("checkBox_interpol")
|
||||
self.gridLayout_4.addWidget(self.checkBox_interpol, 2, 0, 1, 2)
|
||||
self.graph_checkbox = QtWidgets.QCheckBox(self.groupBox_3)
|
||||
self.graph_checkbox.setChecked(True)
|
||||
self.graph_checkbox.setObjectName("graph_checkbox")
|
||||
self.gridLayout_4.addWidget(self.graph_checkbox, 3, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_4.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.label_t1min = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_t1min.setText("")
|
||||
self.label_t1min.setObjectName("label_t1min")
|
||||
self.gridLayout_4.addWidget(self.label_t1min, 0, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.groupBox_3, 4, 0, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(17, 19, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem1, 6, 0, 1, 1)
|
||||
self.calc_pushButton = QtWidgets.QPushButton(t1dialog)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.calc_pushButton.setFont(font)
|
||||
self.calc_pushButton.setObjectName("calc_pushButton")
|
||||
self.gridLayout_2.addWidget(self.calc_pushButton, 5, 0, 1, 1)
|
||||
self.label_9.setBuddy(self.lineEdit_2)
|
||||
self.label_10.setBuddy(self.lineEdit_3)
|
||||
|
||||
self.retranslateUi(t1dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(t1dialog)
|
||||
|
||||
def retranslateUi(self, t1dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
t1dialog.setWindowTitle(_translate("t1dialog", "Form"))
|
||||
self.groupBox_1.setTitle(_translate("t1dialog", "Axes"))
|
||||
self.t1_combobox.setItemText(0, _translate("t1dialog", "T1"))
|
||||
self.t1_combobox.setItemText(1, _translate("t1dialog", "1/T1"))
|
||||
self.temp_combobox.setItemText(0, _translate("t1dialog", "1000/T"))
|
||||
self.temp_combobox.setItemText(1, _translate("t1dialog", "T"))
|
||||
self.temp_combobox.setItemText(2, _translate("t1dialog", "1/T"))
|
||||
self.groupBox_2.setTitle(_translate("t1dialog", "Frequency"))
|
||||
self.freq_combox.setItemText(0, _translate("t1dialog", "MHz"))
|
||||
self.freq_combox.setItemText(1, _translate("t1dialog", "kHz"))
|
||||
self.freq_combox.setItemText(2, _translate("t1dialog", "Hz"))
|
||||
self.groupBox.setTitle(_translate("t1dialog", "Model"))
|
||||
self.groupBox_5.setTitle(_translate("t1dialog", "Pick T1 minimon"))
|
||||
self.interpol_combobox.setItemText(0, _translate("t1dialog", "Data minimum"))
|
||||
self.interpol_combobox.setItemText(1, _translate("t1dialog", "Parabola"))
|
||||
self.interpol_combobox.setItemText(2, _translate("t1dialog", "Cubic spline"))
|
||||
self.interpol_combobox.setItemText(3, _translate("t1dialog", "Akima spline"))
|
||||
self.label_9.setText(_translate("t1dialog", "Interpolate"))
|
||||
self.lineEdit_2.setPlaceholderText(_translate("t1dialog", "1 K"))
|
||||
self.label_10.setText(_translate("t1dialog", "--"))
|
||||
self.lineEdit_3.setPlaceholderText(_translate("t1dialog", "2000 K"))
|
||||
self.label_11.setText(_translate("t1dialog", "Minimon"))
|
||||
self.label_13.setText(_translate("t1dialog", "x value"))
|
||||
self.label_12.setText(_translate("t1dialog", "y value"))
|
||||
self.t1min_toolButton.setText(_translate("t1dialog", "Set"))
|
||||
self.groupBox_3.setTitle(_translate("t1dialog", "Result"))
|
||||
self.tau_combox.setStatusTip(_translate("t1dialog", "NOTE: Mean values are not available for all spectral densities. For more information ask someone."))
|
||||
self.tau_combox.setItemText(0, _translate("t1dialog", "Fit parameter: τ"))
|
||||
self.tau_combox.setItemText(1, _translate("t1dialog", "Peak time: τₚ"))
|
||||
self.tau_combox.setItemText(2, _translate("t1dialog", "Arithmetic mean: ⟨τ⟩"))
|
||||
self.tau_combox.setItemText(3, _translate("t1dialog", "Geometric mean: exp(⟨ln τ⟩)"))
|
||||
self.checkBox_interpol.setText(_translate("t1dialog", "Use minimon interpolation"))
|
||||
self.graph_checkbox.setText(_translate("t1dialog", "New graph?"))
|
||||
self.label.setText(_translate("t1dialog", "Calculated minimon"))
|
||||
self.calc_pushButton.setText(_translate("t1dialog", "Calculate"))
|
138
src/gui_qt/_py/tntdialog.py
Normal file
138
src/gui_qt/_py/tntdialog.py
Normal file
@ -0,0 +1,138 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/tntdialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_tntdialog(object):
|
||||
def setupUi(self, tntdialog):
|
||||
tntdialog.setObjectName("tntdialog")
|
||||
tntdialog.resize(373, 482)
|
||||
self.gridLayout = QtWidgets.QGridLayout(tntdialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.widget_3 = QDelayWidget(tntdialog)
|
||||
self.widget_3.setObjectName("widget_3")
|
||||
self.gridLayout.addWidget(self.widget_3, 3, 1, 1, 2)
|
||||
self.label_3 = QtWidgets.QLabel(tntdialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
|
||||
self.label_3.setSizePolicy(sizePolicy)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 0, 2, 1, 1)
|
||||
self.widget = QDelayWidget(tntdialog)
|
||||
self.widget.setObjectName("widget")
|
||||
self.gridLayout.addWidget(self.widget, 1, 1, 1, 2)
|
||||
self.label_2 = QtWidgets.QLabel(tntdialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 0, 1, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 6, 1, 1, 1)
|
||||
self.widget_2 = QDelayWidget(tntdialog)
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.gridLayout.addWidget(self.widget_2, 2, 1, 1, 2)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(tntdialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayout.addWidget(self.buttonBox, 9, 1, 1, 2)
|
||||
self.frame = QtWidgets.QFrame(tntdialog)
|
||||
self.frame.setObjectName("frame")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.frame)
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setSpacing(0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.checkBox_2 = QtWidgets.QCheckBox(self.frame)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.checkBox_2.sizePolicy().hasHeightForWidth())
|
||||
self.checkBox_2.setSizePolicy(sizePolicy)
|
||||
self.checkBox_2.setObjectName("checkBox_2")
|
||||
self.gridLayout_2.addWidget(self.checkBox_2, 3, 0, 1, 1)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_5 = QtWidgets.QLabel(self.frame)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_2.addWidget(self.label_5)
|
||||
self.start_lineedit = QtWidgets.QLineEdit(self.frame)
|
||||
self.start_lineedit.setObjectName("start_lineedit")
|
||||
self.horizontalLayout_2.addWidget(self.start_lineedit)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.label_6 = QtWidgets.QLabel(self.frame)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.horizontalLayout_2.addWidget(self.label_6)
|
||||
self.end_lineedit = QtWidgets.QLineEdit(self.frame)
|
||||
self.end_lineedit.setFrame(True)
|
||||
self.end_lineedit.setObjectName("end_lineedit")
|
||||
self.horizontalLayout_2.addWidget(self.end_lineedit)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 2)
|
||||
self.label = QtWidgets.QLabel(self.frame)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.gridLayout_2.addWidget(self.lineEdit, 0, 1, 1, 1)
|
||||
self.spinBox = QtWidgets.QSpinBox(self.frame)
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.gridLayout_2.addWidget(self.spinBox, 3, 1, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.frame)
|
||||
self.checkBox.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout_2.addWidget(self.checkBox, 4, 0, 1, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setContentsMargins(25, -1, -1, -1)
|
||||
self.horizontalLayout.setSpacing(0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.pushButton = QtWidgets.QPushButton(self.frame)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.horizontalLayout.addWidget(self.pushButton)
|
||||
self.pushButton_2 = QtWidgets.QPushButton(self.frame)
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.horizontalLayout.addWidget(self.pushButton_2)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout, 4, 1, 1, 1)
|
||||
self.gridLayout.addWidget(self.frame, 8, 1, 1, 2)
|
||||
self.frame_2 = QtWidgets.QFrame(tntdialog)
|
||||
self.frame_2.setObjectName("frame_2")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.frame_2)
|
||||
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_4 = QtWidgets.QLabel(self.frame_2)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout_3.addWidget(self.label_4)
|
||||
self.unknown_delay_combobox = QtWidgets.QComboBox(self.frame_2)
|
||||
self.unknown_delay_combobox.setObjectName("unknown_delay_combobox")
|
||||
self.horizontalLayout_3.addWidget(self.unknown_delay_combobox)
|
||||
self.gridLayout.addWidget(self.frame_2, 4, 1, 1, 2)
|
||||
|
||||
self.retranslateUi(tntdialog)
|
||||
self.buttonBox.accepted.connect(tntdialog.accept)
|
||||
self.buttonBox.rejected.connect(tntdialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(tntdialog)
|
||||
|
||||
def retranslateUi(self, tntdialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
tntdialog.setWindowTitle(_translate("tntdialog", "Read tnt file"))
|
||||
self.label_3.setText(_translate("tntdialog", "TextLabel"))
|
||||
self.label_2.setText(_translate("tntdialog", "Dimensions"))
|
||||
self.checkBox_2.setText(_translate("tntdialog", "Staggered range"))
|
||||
self.label_5.setText(_translate("tntdialog", "Start"))
|
||||
self.start_lineedit.setPlaceholderText(_translate("tntdialog", "0"))
|
||||
self.label_6.setText(_translate("tntdialog", "End"))
|
||||
self.end_lineedit.setPlaceholderText(_translate("tntdialog", "1"))
|
||||
self.label.setText(_translate("tntdialog", "Name"))
|
||||
self.checkBox.setToolTip(_translate("tntdialog", "NOTE: There is no inspection if start and end are valid values."))
|
||||
self.checkBox.setText(_translate("tntdialog", "Logarithmic scale"))
|
||||
self.pushButton.setText(_translate("tntdialog", "Apply"))
|
||||
self.pushButton_2.setText(_translate("tntdialog", "Cancel"))
|
||||
self.label_4.setText(_translate("tntdialog", "Unassigned lists"))
|
||||
from widgets.subwidgets import QDelayWidget
|
139
src/gui_qt/_py/typeconversion.py
Normal file
139
src/gui_qt/_py/typeconversion.py
Normal file
@ -0,0 +1,139 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/typeconversion.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(839, 502)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout_2.setSpacing(3)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.label_4 = QtWidgets.QLabel(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
|
||||
self.label_4.setSizePolicy(sizePolicy)
|
||||
self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.verticalLayout_2.addWidget(self.label_4)
|
||||
self.splitter = QtWidgets.QSplitter(Dialog)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.set_list = QtWidgets.QListWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.set_list.sizePolicy().hasHeightForWidth())
|
||||
self.set_list.setSizePolicy(sizePolicy)
|
||||
self.set_list.setDragEnabled(True)
|
||||
self.set_list.setDragDropMode(QtWidgets.QAbstractItemView.DragOnly)
|
||||
self.set_list.setObjectName("set_list")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.splitter)
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.verticalLayoutWidget)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setHorizontalSpacing(0)
|
||||
self.gridLayout.setVerticalSpacing(2)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.simple_button = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.simple_button.setChecked(True)
|
||||
self.simple_button.setObjectName("simple_button")
|
||||
self.buttonGroup = QtWidgets.QButtonGroup(Dialog)
|
||||
self.buttonGroup.setObjectName("buttonGroup")
|
||||
self.buttonGroup.addButton(self.simple_button)
|
||||
self.gridLayout.addWidget(self.simple_button, 0, 0, 1, 1)
|
||||
self.merge_button = QtWidgets.QRadioButton(self.verticalLayoutWidget)
|
||||
self.merge_button.setObjectName("merge_button")
|
||||
self.buttonGroup.addButton(self.merge_button)
|
||||
self.gridLayout.addWidget(self.merge_button, 0, 1, 1, 1)
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(self.verticalLayoutWidget)
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page_1 = QtWidgets.QWidget()
|
||||
self.page_1.setObjectName("page_1")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.page_1)
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_3.setSpacing(0)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.simple_table = QtWidgets.QTableWidget(self.page_1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.simple_table.sizePolicy().hasHeightForWidth())
|
||||
self.simple_table.setSizePolicy(sizePolicy)
|
||||
self.simple_table.setDragDropMode(QtWidgets.QAbstractItemView.DropOnly)
|
||||
self.simple_table.setObjectName("simple_table")
|
||||
self.simple_table.setColumnCount(2)
|
||||
self.simple_table.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.simple_table.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.simple_table.setHorizontalHeaderItem(1, item)
|
||||
self.simple_table.horizontalHeader().setStretchLastSection(True)
|
||||
self.verticalLayout_3.addWidget(self.simple_table)
|
||||
self.stackedWidget.addWidget(self.page_1)
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.page_2)
|
||||
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_5.setSpacing(0)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.merge_table = QtWidgets.QTableWidget(self.page_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.merge_table.sizePolicy().hasHeightForWidth())
|
||||
self.merge_table.setSizePolicy(sizePolicy)
|
||||
self.merge_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.merge_table.setDragDropMode(QtWidgets.QAbstractItemView.DropOnly)
|
||||
self.merge_table.setDefaultDropAction(QtCore.Qt.CopyAction)
|
||||
self.merge_table.setObjectName("merge_table")
|
||||
self.merge_table.setColumnCount(3)
|
||||
self.merge_table.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.merge_table.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.merge_table.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.merge_table.setHorizontalHeaderItem(2, item)
|
||||
self.merge_table.horizontalHeader().setStretchLastSection(True)
|
||||
self.verticalLayout_5.addWidget(self.merge_table)
|
||||
self.stackedWidget.addWidget(self.page_2)
|
||||
self.gridLayout.addWidget(self.stackedWidget, 1, 0, 1, 2)
|
||||
self.verticalLayout_2.addWidget(self.splitter)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout_2.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Change type"))
|
||||
self.label_4.setText(_translate("Dialog", "Drag & drop datasets and select new type."))
|
||||
self.simple_button.setText(_translate("Dialog", "Simple conversion"))
|
||||
self.merge_button.setText(_translate("Dialog", "Merge to complex set"))
|
||||
item = self.simple_table.horizontalHeaderItem(0)
|
||||
item.setText(_translate("Dialog", "Set"))
|
||||
item = self.simple_table.horizontalHeaderItem(1)
|
||||
item.setText(_translate("Dialog", "Type"))
|
||||
item = self.merge_table.horizontalHeaderItem(0)
|
||||
item.setText(_translate("Dialog", "Real"))
|
||||
item = self.merge_table.horizontalHeaderItem(1)
|
||||
item.setText(_translate("Dialog", "Imag"))
|
||||
item = self.merge_table.horizontalHeaderItem(2)
|
||||
item.setText(_translate("Dialog", "Type"))
|
50
src/gui_qt/_py/untitled.py
Normal file
50
src/gui_qt/_py/untitled.py
Normal file
@ -0,0 +1,50 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/untitled.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(800, 600)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.toolButton = QtWidgets.QToolButton(self.centralwidget)
|
||||
self.toolButton.setGeometry(QtCore.QRect(0, 0, 31, 34))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 30))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuDfgdfg = QtWidgets.QMenu(self.menubar)
|
||||
self.menuDfgdfg.setObjectName("menuDfgdfg")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
self.toolBar = QtWidgets.QToolBar(MainWindow)
|
||||
self.toolBar.setObjectName("toolBar")
|
||||
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
||||
self.actionAsdasd = QtWidgets.QAction(MainWindow)
|
||||
self.actionAsdasd.setObjectName("actionAsdasd")
|
||||
self.menuDfgdfg.addAction(self.actionAsdasd)
|
||||
self.menubar.addAction(self.menuDfgdfg.menuAction())
|
||||
self.toolBar.addSeparator()
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.toolButton.setText(_translate("MainWindow", "..."))
|
||||
self.menuDfgdfg.setTitle(_translate("MainWindow", "dfgdfg"))
|
||||
self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar"))
|
||||
self.actionAsdasd.setText(_translate("MainWindow", "asdasd"))
|
98
src/gui_qt/_py/userfitassist.py
Normal file
98
src/gui_qt/_py/userfitassist.py
Normal file
@ -0,0 +1,98 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/userfitassist.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(675, 682)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label_3 = QtWidgets.QLabel(Dialog)
|
||||
self.label_3.setIndent(4)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.verticalLayout.addWidget(self.label_3)
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(Dialog)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.verticalLayout.addWidget(self.lineEdit_2)
|
||||
self.label_4 = QtWidgets.QLabel(Dialog)
|
||||
self.label_4.setIndent(4)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.verticalLayout.addWidget(self.label_4)
|
||||
self.lineEdit_3 = QtWidgets.QLineEdit(Dialog)
|
||||
self.lineEdit_3.setObjectName("lineEdit_3")
|
||||
self.verticalLayout.addWidget(self.lineEdit_3)
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2.setIndent(4)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
self.lineEdit = QtWidgets.QLineEdit(Dialog)
|
||||
self.lineEdit.setText("")
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.verticalLayout.addWidget(self.lineEdit)
|
||||
self.parameterLabel = QtWidgets.QLabel(Dialog)
|
||||
self.parameterLabel.setIndent(4)
|
||||
self.parameterLabel.setObjectName("parameterLabel")
|
||||
self.verticalLayout.addWidget(self.parameterLabel)
|
||||
self.parameterLineEdit = QtWidgets.QLineEdit(Dialog)
|
||||
self.parameterLineEdit.setObjectName("parameterLineEdit")
|
||||
self.verticalLayout.addWidget(self.parameterLineEdit)
|
||||
self.checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.verticalLayout.addWidget(self.checkBox)
|
||||
self.externalParametersLineEdit = QtWidgets.QLineEdit(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.externalParametersLineEdit.sizePolicy().hasHeightForWidth())
|
||||
self.externalParametersLineEdit.setSizePolicy(sizePolicy)
|
||||
self.externalParametersLineEdit.setObjectName("externalParametersLineEdit")
|
||||
self.verticalLayout.addWidget(self.externalParametersLineEdit)
|
||||
self.checkBox_2 = QtWidgets.QCheckBox(Dialog)
|
||||
self.checkBox_2.setObjectName("checkBox_2")
|
||||
self.verticalLayout.addWidget(self.checkBox_2)
|
||||
self.tableWidget = QtWidgets.QTableWidget(Dialog)
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setColumnCount(0)
|
||||
self.tableWidget.setRowCount(0)
|
||||
self.verticalLayout.addWidget(self.tableWidget)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Save)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
self.label_3.setBuddy(self.lineEdit_2)
|
||||
self.label_4.setBuddy(self.lineEdit_3)
|
||||
self.label_2.setBuddy(self.lineEdit)
|
||||
self.parameterLabel.setBuddy(self.parameterLineEdit)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label_3.setText(_translate("Dialog", "Name"))
|
||||
self.lineEdit_2.setPlaceholderText(_translate("Dialog", "Name of function, e.g. Hopperbagger"))
|
||||
self.label_4.setText(_translate("Dialog", "Group"))
|
||||
self.lineEdit_3.setPlaceholderText(_translate("Dialog", "Type of function, e.g., Relaxation, Diffusion, Dredge,..."))
|
||||
self.label_2.setText(_translate("Dialog", "Equation"))
|
||||
self.lineEdit.setPlaceholderText(_translate("Dialog", "\\alpha + B*exp(x*C_{33}) + D"))
|
||||
self.parameterLabel.setText(_translate("Dialog", "Parameters"))
|
||||
self.parameterLineEdit.setPlaceholderText(_translate("Dialog", "\\alpha B C_{33}"))
|
||||
self.checkBox.setText(_translate("Dialog", "Fixed parameter"))
|
||||
self.externalParametersLineEdit.setPlaceholderText(_translate("Dialog", "D"))
|
||||
self.checkBox_2.setText(_translate("Dialog", "Selection"))
|
||||
self.buttonBox.setToolTip(_translate("Dialog", "Fit model is saved in myfitmodels.py and ready to use without restart."))
|
64
src/gui_qt/_py/usermodeleditor.py
Normal file
64
src/gui_qt/_py/usermodeleditor.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/usermodeleditor.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(800, 600)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.edit_field = CodeEditor(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.edit_field.setFont(font)
|
||||
self.edit_field.setObjectName("edit_field")
|
||||
self.verticalLayout.addWidget(self.edit_field)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 30))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuFile = QtWidgets.QMenu(self.menubar)
|
||||
self.menuFile.setObjectName("menuFile")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
self.actionOpen = QtWidgets.QAction(MainWindow)
|
||||
self.actionOpen.setObjectName("actionOpen")
|
||||
self.actionSave = QtWidgets.QAction(MainWindow)
|
||||
self.actionSave.setObjectName("actionSave")
|
||||
self.actionSave_as = QtWidgets.QAction(MainWindow)
|
||||
self.actionSave_as.setObjectName("actionSave_as")
|
||||
self.actionClose = QtWidgets.QAction(MainWindow)
|
||||
self.actionClose.setObjectName("actionClose")
|
||||
self.menuFile.addAction(self.actionOpen)
|
||||
self.menuFile.addAction(self.actionSave)
|
||||
self.menuFile.addAction(self.actionSave_as)
|
||||
self.menuFile.addAction(self.actionClose)
|
||||
self.menubar.addAction(self.menuFile.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "Editor"))
|
||||
self.menuFile.setTitle(_translate("MainWindow", "File"))
|
||||
self.actionOpen.setText(_translate("MainWindow", "Open..."))
|
||||
self.actionSave.setText(_translate("MainWindow", "Save"))
|
||||
self.actionSave_as.setText(_translate("MainWindow", "Save as..."))
|
||||
self.actionClose.setText(_translate("MainWindow", "Close"))
|
||||
from ..lib.codeeditor import CodeEditor
|
107
src/gui_qt/_py/valueeditor.py
Normal file
107
src/gui_qt/_py/valueeditor.py
Normal file
@ -0,0 +1,107 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'resources/_ui/valueeditor.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MaskDialog(object):
|
||||
def setupUi(self, MaskDialog):
|
||||
MaskDialog.setObjectName("MaskDialog")
|
||||
MaskDialog.resize(383, 645)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(MaskDialog)
|
||||
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
|
||||
self.verticalLayout.setSpacing(3)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.graph_combobox = QtWidgets.QComboBox(MaskDialog)
|
||||
self.graph_combobox.setObjectName("graph_combobox")
|
||||
self.verticalLayout.addWidget(self.graph_combobox)
|
||||
self.set_combobox = QtWidgets.QComboBox(MaskDialog)
|
||||
self.set_combobox.setObjectName("set_combobox")
|
||||
self.verticalLayout.addWidget(self.set_combobox)
|
||||
self.tableView = QtWidgets.QTableView(MaskDialog)
|
||||
self.tableView.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.tableView.setObjectName("tableView")
|
||||
self.verticalLayout.addWidget(self.tableView)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(MaskDialog)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.spinBox = QtWidgets.QSpinBox(MaskDialog)
|
||||
self.spinBox.setMinimum(1)
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.horizontalLayout.addWidget(self.spinBox)
|
||||
self.toolButton = QtWidgets.QToolButton(MaskDialog)
|
||||
self.toolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.toolButton.setAutoRaise(True)
|
||||
self.toolButton.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.horizontalLayout.addWidget(self.toolButton)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.line = QtWidgets.QFrame(MaskDialog)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.line.setLineWidth(3)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setObjectName("line")
|
||||
self.verticalLayout.addWidget(self.line)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_2.setSpacing(3)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.add_button = QtWidgets.QPushButton(MaskDialog)
|
||||
icon = QtGui.QIcon.fromTheme("list-add")
|
||||
self.add_button.setIcon(icon)
|
||||
self.add_button.setObjectName("add_button")
|
||||
self.horizontalLayout_2.addWidget(self.add_button)
|
||||
self.delete_button = QtWidgets.QPushButton(MaskDialog)
|
||||
icon = QtGui.QIcon.fromTheme("list-remove")
|
||||
self.delete_button.setIcon(icon)
|
||||
self.delete_button.setObjectName("delete_button")
|
||||
self.horizontalLayout_2.addWidget(self.delete_button)
|
||||
self.split_button = QtWidgets.QPushButton(MaskDialog)
|
||||
self.split_button.setObjectName("split_button")
|
||||
self.horizontalLayout_2.addWidget(self.split_button)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.line_2 = QtWidgets.QFrame(MaskDialog)
|
||||
self.line_2.setLineWidth(3)
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.verticalLayout.addWidget(self.line_2)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setContentsMargins(-1, 0, -1, -1)
|
||||
self.horizontalLayout_3.setSpacing(3)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.mask_button = QtWidgets.QPushButton(MaskDialog)
|
||||
self.mask_button.setObjectName("mask_button")
|
||||
self.horizontalLayout_3.addWidget(self.mask_button)
|
||||
self.unmaskbutton = QtWidgets.QPushButton(MaskDialog)
|
||||
self.unmaskbutton.setObjectName("unmaskbutton")
|
||||
self.horizontalLayout_3.addWidget(self.unmaskbutton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
||||
self.label.setBuddy(self.spinBox)
|
||||
|
||||
self.retranslateUi(MaskDialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(MaskDialog)
|
||||
|
||||
def retranslateUi(self, MaskDialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MaskDialog.setWindowTitle(_translate("MaskDialog", "Form"))
|
||||
self.label.setText(_translate("MaskDialog", "Go to line:"))
|
||||
self.toolButton.setText(_translate("MaskDialog", "Go Go Power Rangers!"))
|
||||
self.add_button.setText(_translate("MaskDialog", "Add row"))
|
||||
self.delete_button.setText(_translate("MaskDialog", "Delete rows"))
|
||||
self.split_button.setText(_translate("MaskDialog", "Split after selection"))
|
||||
self.mask_button.setToolTip(_translate("MaskDialog", "<html><head/><body><p>Masked rows are shown in green</p></body></html>"))
|
||||
self.mask_button.setText(_translate("MaskDialog", "Hide/Show selected"))
|
||||
self.unmaskbutton.setText(_translate("MaskDialog", "Show all"))
|
0
src/gui_qt/data/__init__.py
Normal file
0
src/gui_qt/data/__init__.py
Normal file
682
src/gui_qt/data/container.py
Normal file
682
src/gui_qt/data/container.py
Normal file
@ -0,0 +1,682 @@
|
||||
from __future__ import annotations
|
||||
from collections import OrderedDict
|
||||
from itertools import cycle
|
||||
from typing import Any
|
||||
|
||||
import numpy as np
|
||||
from pyqtgraph import mkPen
|
||||
|
||||
from nmreval.data.points import Points
|
||||
from nmreval.data.signals import Signal
|
||||
from nmreval.utils.text import convert
|
||||
from nmreval.data.bds import BDS
|
||||
from nmreval.lib.colors import BaseColor, TUColors
|
||||
from nmreval.lib.lines import LineStyle
|
||||
from nmreval.lib.symbols import SymbolStyle, symbolcycle
|
||||
from nmreval.data.nmr import Spectrum, FID
|
||||
|
||||
from ..Qt import QtCore, QtGui
|
||||
from ..io.exporters import GraceExporter
|
||||
from ..lib.decorators import plot_update
|
||||
from ..lib.pg_objects import ErrorBars, PlotItem
|
||||
|
||||
|
||||
class ExperimentContainer(QtCore.QObject):
|
||||
dataChanged = QtCore.pyqtSignal(str)
|
||||
labelChanged = QtCore.pyqtSignal(str, str)
|
||||
groupChanged = QtCore.pyqtSignal(str, str)
|
||||
colors = cycle(TUColors)
|
||||
|
||||
def __init__(self, identifier, data, **kwargs):
|
||||
super().__init__()
|
||||
self.id = str(identifier)
|
||||
|
||||
self._fits = []
|
||||
self._data = data
|
||||
self._manager = kwargs.get('manager')
|
||||
self.graph = ''
|
||||
|
||||
self.mode = 'point'
|
||||
self.plot_real = None
|
||||
self.plot_imag = None
|
||||
self.plot_error = None
|
||||
|
||||
self.actions = {}
|
||||
self._update_actions()
|
||||
|
||||
def _init_plot(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def __getitem__(self, item):
|
||||
try:
|
||||
return self._data[item]
|
||||
except KeyError:
|
||||
raise KeyError('Unknown key %s' % str(item)) from None
|
||||
|
||||
def __del__(self):
|
||||
del self._data
|
||||
del self.plot_real
|
||||
del self.plot_imag
|
||||
del self.plot_error
|
||||
|
||||
def __repr__(self):
|
||||
return 'name:' + self.name
|
||||
|
||||
def __len__(self):
|
||||
return len(self._data)
|
||||
|
||||
def copy(self, full: bool = False, keep_color: bool = True):
|
||||
if full:
|
||||
pen_dict = {}
|
||||
if keep_color:
|
||||
pen_dict = {
|
||||
'symbol': self.plot_real.symbol,
|
||||
'symbolcolor': self.plot_real.symbolcolor,
|
||||
'symbolsize': self.plot_real.symbolsize,
|
||||
'linestyle': self.plot_real.linestyle,
|
||||
'linecolor': self.plot_real.linecolor,
|
||||
'linewidth': self.plot_real.linewidth,
|
||||
}
|
||||
|
||||
new_data = type(self)(str(self.id), self._data.copy(), manager=self._manager, **pen_dict)
|
||||
new_data.mode = self.mode
|
||||
|
||||
if keep_color and self.plot_imag is not None:
|
||||
new_data.plot_imag.set_symbol(symbol=self.plot_imag.symbol, size=self.plot_imag.symbolsize,
|
||||
color=self.plot_imag.symbolcolor)
|
||||
new_data.plot_imag.set_line(style=self.plot_imag.linestyle, width=self.plot_imag.linewidth,
|
||||
color=self.plot_imag.linecolor)
|
||||
|
||||
return new_data
|
||||
|
||||
else:
|
||||
return self._data.copy()
|
||||
|
||||
def change_type(self, data):
|
||||
if isinstance(data, (FID, Spectrum, BDS)):
|
||||
new_type = SignalContainer
|
||||
elif isinstance(data, Points):
|
||||
new_type = PointContainer
|
||||
else:
|
||||
raise TypeError('Unknown data type')
|
||||
|
||||
# pen_dict = {
|
||||
# 'symbol': self.plot_real.symbol,
|
||||
# 'symbolcolor': self.plot_real.symbolcolor,
|
||||
# 'symbolsize': self.plot_real.symbolsize,
|
||||
# 'linestyle': self.plot_real.linestyle,
|
||||
# 'linecolor': self.plot_real.linecolor,
|
||||
# 'linewidth': self.plot_real.linewidth,
|
||||
# }
|
||||
|
||||
new_data = new_type(str(self.id), data, manager=self._manager)
|
||||
|
||||
# if new_data.plot_imag is not None:
|
||||
# if self.plot_imag is not None:
|
||||
# new_data.plot_imag.set_symbol(symbol=self.plot_imag.symbol, size=self.plot_imag.symbolsize,
|
||||
# color=self.plot_imag.symbolcolor)
|
||||
# new_data.plot_imag.set_line(style=self.plot_imag.linestyle, width=self.plot_imag.linewidth,
|
||||
# color=self.plot_imag.linecolor)
|
||||
# else:
|
||||
# new_data.plot_imag.set_symbol(symbol=self.plot_real.symbol, size=self.plot_real.symbolsize,
|
||||
# color=self.plot_real.symbolcolor)
|
||||
# new_data.plot_imag.set_line(style=self.plot_real.linestyle, width=self.plot_real.linewidth,
|
||||
# color=self.plot_real.linecolor)
|
||||
|
||||
return new_data
|
||||
|
||||
@property
|
||||
def x(self):
|
||||
return self._data.x[self._data.mask]
|
||||
|
||||
@x.setter
|
||||
@plot_update
|
||||
def x(self, value):
|
||||
if len(self._data.x) == len(value):
|
||||
self._data.x = value
|
||||
elif len(self._data.x[self._data.mask]) == len(value):
|
||||
self._data.x = value
|
||||
self._data.y = self._data.y[self._data.mask]
|
||||
self._data.mask = np.ma.array(np.ones_like(self._data.x, dtype=bool))
|
||||
else:
|
||||
raise ValueError('x and y have different dimensions!')
|
||||
|
||||
@property
|
||||
def y(self):
|
||||
return self._data.y[self._data.mask]
|
||||
|
||||
@y.setter
|
||||
@plot_update
|
||||
def y(self, value):
|
||||
if len(self._data.y) == len(value):
|
||||
self._data.y = value
|
||||
elif len(self._data.y[self._data.mask]) == len(value):
|
||||
self._data.y = value
|
||||
self._data.x = self._data.x[self._data.mask]
|
||||
self._data.mask = np.ma.array(np.ones_like(self._data.y, dtype=bool))
|
||||
else:
|
||||
raise ValueError('x and y have different dimensions!')
|
||||
|
||||
@property
|
||||
def y_err(self):
|
||||
return self._data.y_err[self._data.mask]
|
||||
|
||||
@y_err.setter
|
||||
@plot_update
|
||||
def y_err(self, value):
|
||||
if len(self._data.y_err) == len(value):
|
||||
self._data.y_err = value
|
||||
elif len(self._data.y[self._data.mask]) == len(value):
|
||||
self._data.y_err[self._data.mask] = value
|
||||
else:
|
||||
raise ValueError('y_err has not correct length')
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._data.name
|
||||
|
||||
@name.setter
|
||||
@plot_update
|
||||
def name(self, value: str):
|
||||
self._data.name = value
|
||||
self.plot_real.opts['name'] = value
|
||||
try:
|
||||
self.plot_imag.opts['name'] = value
|
||||
except AttributeError:
|
||||
pass
|
||||
try:
|
||||
num_val = float(value)
|
||||
self._data.value = num_val
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
@property
|
||||
def value(self):
|
||||
return self._data.value
|
||||
|
||||
@value.setter
|
||||
def value(self, val):
|
||||
self._data.value = float(val)
|
||||
|
||||
@property
|
||||
def group(self):
|
||||
return str(self._data['group'])
|
||||
|
||||
@group.setter
|
||||
def group(self, valium):
|
||||
self._data['group'] = str(valium)
|
||||
self.groupChanged.emit(self.id, str(valium))
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
return self._data
|
||||
|
||||
@data.setter
|
||||
@plot_update
|
||||
def data(self, new_data):
|
||||
self._data = new_data
|
||||
self._update_actions()
|
||||
|
||||
@property
|
||||
def opts(self):
|
||||
return self._data.meta
|
||||
|
||||
@property
|
||||
def plots(self):
|
||||
return self.plot_real, self.plot_imag, self.plot_error
|
||||
|
||||
def get_state(self):
|
||||
ret_dic = {
|
||||
'id': self.id,
|
||||
'data': self._data.get_state(),
|
||||
'mode': self.mode,
|
||||
'fits': self._fits,
|
||||
'real': ({'symbol': self.plot_real.symbol.value,
|
||||
'size': self.plot_real.symbolsize,
|
||||
'color': self.plot_real.symbolcolor.value},
|
||||
{'style': self.plot_real.linestyle.value,
|
||||
'width': self.plot_real.linewidth,
|
||||
'color': self.plot_real.linecolor.value})
|
||||
}
|
||||
|
||||
if self.plot_imag is not None:
|
||||
ret_dic['imag'] = ({'symbol': self.plot_imag.symbol.value,
|
||||
'size': self.plot_imag.symbolsize,
|
||||
'color': self.plot_imag.symbolcolor.value},
|
||||
{'style': self.plot_imag.linestyle.value,
|
||||
'width': self.plot_imag.linewidth,
|
||||
'color': self.plot_imag.linecolor.value})
|
||||
|
||||
return ret_dic
|
||||
|
||||
def get_fits(self):
|
||||
return [self._manager[idx] for idx in self._fits]
|
||||
|
||||
def has_fits(self):
|
||||
return len(self._fits) != 0
|
||||
|
||||
def set_fits(self, value: str | list, replace: bool = False):
|
||||
if isinstance(value, str):
|
||||
value = [value]
|
||||
|
||||
if replace:
|
||||
if isinstance(value, list):
|
||||
self._fits = value
|
||||
else:
|
||||
raise TypeError()
|
||||
else:
|
||||
self._fits.extend(value)
|
||||
|
||||
def _update_actions(self):
|
||||
self.actions.update({'sort': self._data.sort,
|
||||
'cut': self._data.cut,
|
||||
'norm': self._data.normalize,
|
||||
'center': self.center})
|
||||
|
||||
@plot_update
|
||||
def update(self, opts: dict):
|
||||
self._data.update(opts)
|
||||
|
||||
def get_properties(self) -> dict:
|
||||
props = OrderedDict()
|
||||
props['General'] = OrderedDict([('Name', self.name),
|
||||
('Value', str(self.value)),
|
||||
('Group', str(self.group))])
|
||||
props['Symbol'] = OrderedDict()
|
||||
props['Line'] = OrderedDict()
|
||||
|
||||
props['Symbol']['Symbol'] = self.plot_real.symbol
|
||||
props['Symbol']['Size'] = self.plot_real.symbolsize
|
||||
props['Symbol']['Color'] = self.plot_real.symbolcolor
|
||||
|
||||
props['Line']['Style'] = self.plot_real.linestyle
|
||||
props['Line']['Width'] = self.plot_real.linewidth
|
||||
props['Line']['Color'] = self.plot_real.linecolor
|
||||
|
||||
if self.plot_imag is not None:
|
||||
props['Symbol']['Symbol (imag)'] = self.plot_imag.symbol
|
||||
props['Symbol']['Size (imag)'] = self.plot_imag.symbolsize
|
||||
props['Symbol']['Color (imag)'] = self.plot_imag.symbolcolor
|
||||
|
||||
props['Line']['Style (imag)'] = self.plot_imag.linestyle
|
||||
props['Line']['Width (imag)'] = self.plot_imag.linewidth
|
||||
props['Line']['Color (imag)'] = self.plot_imag.linecolor
|
||||
|
||||
return props
|
||||
|
||||
def setColor(self, color, symbol=False, line=False, mode='real'):
|
||||
if mode in ['real', 'all']:
|
||||
self.plot_real.set_color(color, symbol=symbol, line=line)
|
||||
if self.plot_error is not None:
|
||||
err_pen = self.plot_error.opts['pen']
|
||||
err_pen.setColor(QtGui.QColor(*self.plot_real.symbolcolor.rgb()))
|
||||
self.plot_error.setData(pen=err_pen)
|
||||
|
||||
elif mode == 'imag' and self.plot_imag is not None:
|
||||
self.plot_imag.set_color(color, symbol=symbol, line=line)
|
||||
else:
|
||||
print('Updating color failed for ' + str(self.id))
|
||||
|
||||
def setSymbol(self, symbol=None, color=None, size=None, mode='real'):
|
||||
if mode in ['real', 'all']:
|
||||
self.plot_real.set_symbol(symbol=symbol, size=size, color=color)
|
||||
if color is not None and self.plot_error is not None and self.plot_real.symbol != SymbolStyle.No:
|
||||
err_pen = self.plot_error.opts['pen']
|
||||
err_pen.setColor(QtGui.QColor(*self.plot_real.symbolcolor.rgb()))
|
||||
self.plot_error.setData(pen=err_pen)
|
||||
elif mode in ['imag', 'all'] and self.plot_imag is not None:
|
||||
self.plot_imag.set_symbol(symbol=symbol, size=size, color=color)
|
||||
else:
|
||||
print('Updating symbol failed for ' + str(self.id))
|
||||
|
||||
def setLine(self, width=None, style=None, color=None, mode='real'):
|
||||
if mode in ['real', 'all']:
|
||||
self.plot_real.set_line(width=width, style=style, color=color)
|
||||
if color is not None and self.plot_error is not None and self.plot_real.symbol == SymbolStyle.No:
|
||||
err_pen = self.plot_error.opts['pen']
|
||||
err_pen.setColor(QtGui.QColor(*self.plot_real.linecolor.rgb()))
|
||||
self.plot_error.setData(pen=err_pen)
|
||||
elif mode in ['imag', 'all'] and self.plot_imag is not None:
|
||||
self.plot_imag.set_line(width=width, style=style, color=color)
|
||||
else:
|
||||
print('Updating line failed for ' + str(self.id))
|
||||
|
||||
def update_property(self, key1: str, key2: str, value: Any):
|
||||
keykey = key2.split()
|
||||
if len(keykey) == 1:
|
||||
if key1 == 'Symbol':
|
||||
self.setSymbol(mode='real', **{key2.lower(): value})
|
||||
|
||||
elif key1 == 'Line':
|
||||
self.setLine(mode='real', **{key2.lower(): value})
|
||||
|
||||
elif key1 == 'General':
|
||||
setattr(self, key2.lower(), value)
|
||||
|
||||
else:
|
||||
if key1 == 'Symbol':
|
||||
self.setSymbol(mode='imag', **{keykey[0].lower(): value})
|
||||
|
||||
elif key1 == 'Line':
|
||||
self.setLine(mode='imag', **{keykey[0].lower(): value})
|
||||
|
||||
def points(self, params: dict):
|
||||
return self._data.points(**params)
|
||||
|
||||
@plot_update
|
||||
def apply(self, func: str, args: tuple):
|
||||
if func in self.actions:
|
||||
f = self.actions[func]
|
||||
f(*args)
|
||||
|
||||
return self
|
||||
|
||||
@plot_update
|
||||
def unsort(self, order: np.ndarray):
|
||||
# this exists only to update plots after an undo action
|
||||
self._data.x = self._data.x[order]
|
||||
self._data.y = self._data.y[order]
|
||||
self._data.y_err = self._data.y_err[order]
|
||||
self._data.mask = self._data.mask[order]
|
||||
|
||||
def save(self, fname):
|
||||
ext = fname.suffix
|
||||
if ext == '.agr':
|
||||
dic = self._manager.graphs[self.graph].get_state()
|
||||
dic['items'] = [self.plot_real.get_data_opts()]
|
||||
if self.plot_imag is not None:
|
||||
dic['items'].append(self.plot_imag.get_data_opts())
|
||||
|
||||
GraceExporter(dic).export(fname)
|
||||
|
||||
elif ext in ['.dat', '.txt']:
|
||||
self._data.savetxt(fname, err=True)
|
||||
|
||||
else:
|
||||
raise ValueError('Unknown extension ' + ext)
|
||||
|
||||
@plot_update
|
||||
def setvalues(self, pos, valium):
|
||||
xy, position = pos
|
||||
if xy == 0:
|
||||
self._data.x[position] = valium
|
||||
elif xy == 1:
|
||||
self._data.y[position] = valium
|
||||
else:
|
||||
self._data.y_err[position] = valium
|
||||
|
||||
@property
|
||||
def mask(self):
|
||||
return self._data.mask
|
||||
|
||||
@mask.setter
|
||||
@plot_update
|
||||
def mask(self, m):
|
||||
self._data.mask = np.asarray(m, dtype=bool)
|
||||
|
||||
@plot_update
|
||||
def add(self, m):
|
||||
if isinstance(m, (np.ndarray, list, tuple)):
|
||||
self._data.append(m[0], m[1], y_err=m[2])
|
||||
elif isinstance(m, (Points, ExperimentContainer)):
|
||||
self._data.append(m.x, m.y, y_err=m.y_err)
|
||||
else:
|
||||
raise TypeError('Unknown type ' + type(m))
|
||||
|
||||
@plot_update
|
||||
def remove(self, m):
|
||||
self._data.remove(m)
|
||||
|
||||
@plot_update
|
||||
def center(self) -> float:
|
||||
offset = self.x[np.argmax(self.y.real)]
|
||||
self._data._x -= offset
|
||||
|
||||
return offset
|
||||
|
||||
def get_namespace(self, i: int = None, j: int = None) -> dict:
|
||||
if (i is None) and (j is None):
|
||||
prefix = ''
|
||||
else:
|
||||
prefix = 'g[%i].s[%i].' % (i, j)
|
||||
|
||||
namespace = {prefix + 'x': (self.x, 'x values'),
|
||||
prefix + 'y': [self.y, 'y values'],
|
||||
prefix + 'y_err': (self.y_err, 'y error values'),
|
||||
prefix + 'value': (self.value, str(self.value))}
|
||||
|
||||
if len(self._fits) == 1:
|
||||
namespace.update({
|
||||
"%sfit['%s']" % (prefix, convert(pname, old='tex', new='str')): (pvalue.value, str(pvalue.value))
|
||||
for (pname, pvalue) in self._manager[self._fits[0]].parameter.items()
|
||||
})
|
||||
else:
|
||||
for k, f in enumerate(self._fits):
|
||||
namespace.update({
|
||||
"%sfit['%s_%d']" % (prefix, convert(pname, old='tex', new='str'), k): (pvalue.value, str(pvalue.value))
|
||||
for (pname, pvalue) in self._manager[f].parameter.items()
|
||||
})
|
||||
|
||||
return namespace
|
||||
|
||||
def eval_expression(self, cmds, namespace):
|
||||
namespace.update({'x': self.x, 'y': self.y, 'y_err': self.y_err, 'value': self.value})
|
||||
|
||||
if len(self._fits) == 1:
|
||||
namespace.update({"fit['%s']" % (convert(pname, old='tex', new='str')): pvalue.value
|
||||
for (pname, pvalue) in self._manager[self._fits[0]].parameter.items()})
|
||||
else:
|
||||
for k, f in enumerate(self._fits):
|
||||
namespace.update({"fit['%s_%i']" % (convert(pname, old='tex', new='str'), k): pvalue.value
|
||||
for (pname, pvalue) in self._manager[f].parameter.items()})
|
||||
|
||||
new_data = self.copy()
|
||||
for c in cmds:
|
||||
if c:
|
||||
exec(c, globals(), namespace)
|
||||
|
||||
new_data.set_data(x=namespace['x'], y=namespace['y'], y_err=namespace['y_err'])
|
||||
new_data.value = namespace['value']
|
||||
|
||||
return new_data
|
||||
|
||||
|
||||
class PointContainer(ExperimentContainer):
|
||||
symbols = symbolcycle()
|
||||
|
||||
def __init__(self, identifier, data, **kwargs):
|
||||
super().__init__(identifier, data, **kwargs)
|
||||
|
||||
self.mode = 'pts'
|
||||
self._init_plot(**kwargs)
|
||||
|
||||
def _init_plot(self, **kwargs):
|
||||
self.plot_imag = None
|
||||
|
||||
color = kwargs.get('color', None)
|
||||
symcolor = kwargs.get('symbolcolor', color)
|
||||
linecolor = kwargs.get('linecolor', color)
|
||||
|
||||
if symcolor is None and linecolor is None:
|
||||
color = next(self.colors)
|
||||
symcolor = color
|
||||
linecolor = color
|
||||
elif symcolor is None:
|
||||
symcolor = linecolor
|
||||
elif linecolor is None:
|
||||
linecolor = symcolor
|
||||
|
||||
sym_kwargs = {
|
||||
'symbol': kwargs.get('symbol', None),
|
||||
'size': kwargs.get('symbolsize', 10),
|
||||
'color': symcolor
|
||||
}
|
||||
|
||||
line_kwargs = {
|
||||
'style': kwargs.get('linestyle', None),
|
||||
'width': kwargs.get('linewidth', 1),
|
||||
'color': linecolor
|
||||
}
|
||||
|
||||
if sym_kwargs['symbol'] is None and line_kwargs['style'] is None:
|
||||
if len(self._data) > 500:
|
||||
line_kwargs['style'] = LineStyle.Solid
|
||||
sym_kwargs['symbol'] = SymbolStyle.No
|
||||
else:
|
||||
line_kwargs['style'] = LineStyle.No
|
||||
sym_kwargs['symbol'] = next(PointContainer.symbols)
|
||||
|
||||
self.plot_real = PlotItem(x=self._data.x, y=self._data.y, name=self.name,
|
||||
symbol=None, pen=None, connect='finite')
|
||||
|
||||
self.setSymbol(mode='real', **sym_kwargs)
|
||||
self.setLine(mode='real', **line_kwargs)
|
||||
|
||||
if sym_kwargs['symbol'] != SymbolStyle.No:
|
||||
self.plot_error = ErrorBars(x=self._data.x, y=self._data.y, top=self._data.y_err, bottom=self._data.y_err,
|
||||
pen=mkPen({'color': self.plot_real.symbolcolor.rgb()}))
|
||||
else:
|
||||
self.plot_error = ErrorBars(x=self._data.x, y=self._data.y, top=self._data.y_err, bottom=self._data.y_err,
|
||||
pen=mkPen({'color': self.plot_real.linecolor.rgb()}))
|
||||
|
||||
|
||||
class FitContainer(ExperimentContainer):
|
||||
def __init__(self, identifier, data, **kwargs):
|
||||
super().__init__(identifier, data, **kwargs)
|
||||
self.fitted_key = kwargs.get('src', '')
|
||||
self.mode = 'fit'
|
||||
self.parent_set = kwargs.get('src', '')
|
||||
|
||||
self._init_plot(**kwargs)
|
||||
|
||||
for n in ['statistics', 'nobs', 'nvar', 'parameter', 'model_name']:
|
||||
setattr(self, n, getattr(data, n))
|
||||
|
||||
def _init_plot(self, **kwargs):
|
||||
color = kwargs.get('color', (0, 0, 0))
|
||||
if isinstance(color, BaseColor):
|
||||
color = color.rgb()
|
||||
|
||||
self.plot_real = PlotItem(x=self._data.x, y=self._data.y.real, name=self.name,
|
||||
pen=mkPen({'color': color}),
|
||||
connect='finite', symbol=None)
|
||||
|
||||
if np.iscomplexobj(self._data.y):
|
||||
self.plot_imag = PlotItem(x=self._data.x, y=self._data.y.imag, name=self.name,
|
||||
pen=mkPen({'color': color}),
|
||||
connect='finite', symbol=None)
|
||||
|
||||
@property
|
||||
def fitted_key(self):
|
||||
return self._data.idx
|
||||
|
||||
@fitted_key.setter
|
||||
def fitted_key(self, val):
|
||||
self._data.idx = val
|
||||
|
||||
def get_namespace(self, i: int = None, j: int = None):
|
||||
namespace = super().get_namespace(i, j)
|
||||
|
||||
namespace.update({
|
||||
"g[%i].s[%i].fit['%s']" % (i, j, convert(pname, old='latex', new='plain')): (pvalue.value, str(pvalue.value))
|
||||
for (pname, pvalue) in self._data.parameter.items()
|
||||
})
|
||||
|
||||
return namespace
|
||||
|
||||
|
||||
class SignalContainer(ExperimentContainer):
|
||||
symbols = symbolcycle()
|
||||
|
||||
def __init__(self, identifier, data, symbol=None, **kwargs):
|
||||
super().__init__(identifier, data, **kwargs)
|
||||
|
||||
self.mode = 'signal'
|
||||
self._init_plot(symbol=symbol, **kwargs)
|
||||
|
||||
def _init_plot(self, **kwargs):
|
||||
self.plot_real = PlotItem(x=self._data.x, y=self._data.y.real, name=self.name,
|
||||
symbol=None, pen=None, connect='finite')
|
||||
self.plot_imag = PlotItem(x=self._data.x, y=self._data.y.imag, name=self.name,
|
||||
symbol=None, pen=None, connect='finite')
|
||||
|
||||
color = kwargs.get('color', None)
|
||||
symcolor = kwargs.get('symbolcolor', color)
|
||||
linecolor = kwargs.get('linecolor', color)
|
||||
|
||||
if symcolor is None and linecolor is None:
|
||||
color = next(self.colors)
|
||||
symcolor = color
|
||||
linecolor = color
|
||||
elif symcolor is None:
|
||||
symcolor = linecolor
|
||||
elif linecolor is None:
|
||||
linecolor = symcolor
|
||||
|
||||
sym_kwargs = {
|
||||
'symbol': kwargs.get('symbol', None),
|
||||
'size': kwargs.get('symbolsize', 10),
|
||||
'color': symcolor
|
||||
}
|
||||
|
||||
line_kwargs = {
|
||||
'style': kwargs.get('linestyle', None),
|
||||
'width': kwargs.get('linewidth', 1),
|
||||
'color': linecolor
|
||||
}
|
||||
|
||||
if isinstance(self._data, BDS):
|
||||
self.mode = 'bds'
|
||||
if sym_kwargs['symbol'] is None and line_kwargs['style'] is None:
|
||||
if len(self._data) <= 91:
|
||||
sym_kwargs['symbol'] = next(PointContainer.symbols)
|
||||
line_kwargs['style'] = LineStyle.No
|
||||
else:
|
||||
line_kwargs['style'] = LineStyle.Solid
|
||||
sym_kwargs['symbol'] = SymbolStyle.No
|
||||
|
||||
elif isinstance(self._data, Signal):
|
||||
if line_kwargs['style'] is None and sym_kwargs['symbol'] is None:
|
||||
line_kwargs['style'] = LineStyle.Solid
|
||||
sym_kwargs['symbol'] = SymbolStyle.No
|
||||
|
||||
if isinstance(self._data, FID):
|
||||
self.mode = 'fid'
|
||||
else:
|
||||
self.mode = 'spectrum'
|
||||
else:
|
||||
raise TypeError('Unknown class %s, should be FID, Spectrum, or BDS.' % type(self._data))
|
||||
|
||||
for mode in ['real', 'imag']:
|
||||
if mode == 'imag' and line_kwargs['style'] != LineStyle.No:
|
||||
line_kwargs['style'] = LineStyle.Dashed
|
||||
self.setSymbol(mode=mode, **sym_kwargs)
|
||||
self.setLine(mode=mode, **line_kwargs)
|
||||
|
||||
def _update_actions(self):
|
||||
super()._update_actions()
|
||||
|
||||
self.actions.update({'ph': self._data.manual_phase, 'bls': self._data.baseline_spline})
|
||||
if isinstance(self._data, Spectrum):
|
||||
self.actions.update({'bl': self._data.baseline, 'ls': self._data.shift,
|
||||
'divide': self._data.divide, 'ft': self.fourier})
|
||||
self.mode = 'spectrum'
|
||||
|
||||
elif isinstance(self._data, FID):
|
||||
self.actions.update({'bl': self._data.baseline, 'ls': self._data.shift,
|
||||
'zf': self._data.zerofill, 'divide': self._data.divide,
|
||||
'ap': self._data.apod, 'ft': self.fourier})
|
||||
self.mode = 'fid'
|
||||
|
||||
@plot_update
|
||||
def fourier(self, mode='normal'):
|
||||
if mode == 'normal':
|
||||
self._data = self._data.fourier()
|
||||
elif mode == 'depake':
|
||||
try:
|
||||
self._data = self._data.fft_depake()
|
||||
except AttributeError:
|
||||
return
|
||||
self._update_actions()
|
||||
|
||||
return self
|
152
src/gui_qt/data/conversion.py
Normal file
152
src/gui_qt/data/conversion.py
Normal file
@ -0,0 +1,152 @@
|
||||
from ..Qt import QtWidgets, QtCore, QtGui
|
||||
from .._py.typeconversion import Ui_Dialog
|
||||
|
||||
|
||||
class ConversionDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
convertSets = QtCore.pyqtSignal(list)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.simple_table.installEventFilter(self)
|
||||
self.merge_table.installEventFilter(self)
|
||||
|
||||
self._simple_table_dropevent = self.simple_table.dropEvent
|
||||
self.simple_table.dropEvent = self._drop_on_simple_table
|
||||
|
||||
self._merge_table_dropevent = self.merge_table.dropEvent
|
||||
self.merge_table.dropEvent = self._drop_on_simple_table
|
||||
|
||||
self.buttonGroup.buttonClicked.connect(self.change_table)
|
||||
|
||||
def set_graphs(self, graphs: dict):
|
||||
self.set_list.clear()
|
||||
self.simple_table.clear()
|
||||
self.simple_table.setHorizontalHeaderLabels(['Simple', 'Type'])
|
||||
self.merge_table.clear()
|
||||
self.merge_table.setHorizontalHeaderLabels(['Real', 'Imag', 'Type'])
|
||||
|
||||
for graph, datasets in graphs.items():
|
||||
for set_id, set_name in datasets:
|
||||
item_name = set_name + ' (' + graph[1] + ')'
|
||||
|
||||
item1 = QtWidgets.QListWidgetItem(item_name)
|
||||
item1.setData(QtCore.Qt.UserRole, set_id)
|
||||
item1.setData(QtCore.Qt.UserRole+1, graph[0])
|
||||
self.set_list.addItem(item1)
|
||||
|
||||
def eventFilter(self, src: QtCore.QObject, evt: QtCore.QEvent):
|
||||
if evt.type() in [QtCore.QEvent.DragEnter, QtCore.QEvent.DragMove]:
|
||||
evt.accept()
|
||||
return True
|
||||
|
||||
if evt.type() == QtCore.QEvent.KeyPress and evt.key() == QtCore.Qt.Key_Delete:
|
||||
if src == self.simple_table:
|
||||
type_idx = 1
|
||||
else:
|
||||
type_idx = 2
|
||||
|
||||
if len(src.selectedIndexes()) > 0:
|
||||
idx = src.selectedIndexes()[0]
|
||||
row, col = idx.row(), idx.column()
|
||||
|
||||
if col != type_idx:
|
||||
src.takeItem(row, col)
|
||||
is_empty = all(src.item(row, i) is None for i in range(type_idx))
|
||||
if is_empty:
|
||||
src.removeRow(row)
|
||||
|
||||
return True
|
||||
|
||||
return super().eventFilter(src, evt)
|
||||
|
||||
def _drop_on_simple_table(self, evt: QtGui.QDropEvent):
|
||||
"""
|
||||
event filter does not receive dropevents?
|
||||
"""
|
||||
if self.stackedWidget.currentIndex() == 0:
|
||||
table = self.simple_table
|
||||
type_column = 1
|
||||
default_drop = self._simple_table_dropevent
|
||||
type_name = ['Points', 'FID', 'Spectrum', 'BDS']
|
||||
else:
|
||||
table = self.merge_table
|
||||
type_column = 2
|
||||
default_drop = self._merge_table_dropevent
|
||||
type_name = ['FID', 'Spectrum', 'BDS']
|
||||
|
||||
pos = evt.pos()
|
||||
drop_col = table.columnAt(pos.x())
|
||||
if drop_col == type_column:
|
||||
evt.ignore()
|
||||
else:
|
||||
drop_row = table.rowAt(pos.y())
|
||||
default_drop(evt)
|
||||
|
||||
if drop_row == -1:
|
||||
w = QtWidgets.QComboBox()
|
||||
w.addItems(type_name)
|
||||
item = QtWidgets.QTableWidgetItem('')
|
||||
drop_row = table.rowAt(pos.y())
|
||||
table.setItem(drop_row, type_column, item)
|
||||
table.setCellWidget(drop_row, type_column, w)
|
||||
|
||||
item = table.item(drop_row, drop_col)
|
||||
idx = table.indexFromItem(item)
|
||||
|
||||
if idx.row() == -1 and idx.column() == -1:
|
||||
item = table.takeItem(drop_row, 0)
|
||||
table.setItem(drop_row, drop_col, item)
|
||||
|
||||
if item is not None:
|
||||
item.setToolTip(item.text())
|
||||
|
||||
table.resizeColumnsToContents()
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QAbstractButton)
|
||||
def change_table(self, button: QtWidgets.QAbstractButton):
|
||||
idx = [self.simple_button, self.merge_button].index(button)
|
||||
self.stackedWidget.setCurrentIndex(idx)
|
||||
|
||||
def collect_args(self) -> list:
|
||||
src_sets = []
|
||||
for row in range(self.simple_table.rowCount()):
|
||||
item = self.simple_table.item(row, 0)
|
||||
set_id = item.data(QtCore.Qt.UserRole)
|
||||
graph_id = item.data(QtCore.Qt.UserRole+1)
|
||||
type_idx = self.simple_table.cellWidget(row, 1).currentIndex()
|
||||
|
||||
src_sets.append((set_id, graph_id, type_idx))
|
||||
|
||||
for row in range(self.merge_table.rowCount()):
|
||||
item = self.merge_table.item(row, 0)
|
||||
graph_id = ''
|
||||
if item is not None:
|
||||
set_id_real = item.data(QtCore.Qt.UserRole)
|
||||
graph_id = item.data(QtCore.Qt.UserRole+1)
|
||||
else:
|
||||
set_id_real = ''
|
||||
|
||||
item = self.merge_table.item(row, 1)
|
||||
if item is not None:
|
||||
set_id_imag = item.data(QtCore.Qt.UserRole)
|
||||
graph_id = item.data(QtCore.Qt.UserRole+1) if graph_id == '' else graph_id
|
||||
else:
|
||||
set_id_imag = ''
|
||||
type_idx = self.merge_table.cellWidget(row, 2).currentIndex() + 1
|
||||
|
||||
src_sets.append((set_id_real, set_id_imag, graph_id, type_idx))
|
||||
|
||||
self.convertSets.emit(src_sets)
|
||||
|
||||
return src_sets
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QAbstractButton, name='on_buttonBox_clicked')
|
||||
def button_clicked(self, button):
|
||||
role = self.buttonBox.buttonRole(button)
|
||||
if role == self.buttonBox.RejectRole:
|
||||
self.close()
|
||||
else:
|
||||
self.collect_args()
|
||||
self.accept()
|
1
src/gui_qt/data/datawidget/__init__.py
Normal file
1
src/gui_qt/data/datawidget/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .datawidget import *
|
494
src/gui_qt/data/datawidget/datawidget.py
Normal file
494
src/gui_qt/data/datawidget/datawidget.py
Normal file
@ -0,0 +1,494 @@
|
||||
from typing import List, Tuple, Union
|
||||
|
||||
from nmreval.lib.colors import available_cycles
|
||||
|
||||
from .properties import PropWidget
|
||||
from ...Qt import QtWidgets, QtGui, QtCore
|
||||
from ..._py.datawidget import Ui_DataWidget
|
||||
from ...lib import make_action_icons
|
||||
from ...lib.delegates import HeaderDelegate
|
||||
|
||||
|
||||
class DataTree(QtWidgets.QTreeWidget):
|
||||
stateChanged = QtCore.pyqtSignal(list, list) # selected, deselected
|
||||
keyChanged = QtCore.pyqtSignal(str, str) # id, text
|
||||
positionChanged = QtCore.pyqtSignal(QtWidgets.QTreeWidgetItem)
|
||||
deleteItem = QtCore.pyqtSignal(list)
|
||||
moveItem = QtCore.pyqtSignal(list, str, str, int) # items, from, to, new row
|
||||
copyItem = QtCore.pyqtSignal(list, str)
|
||||
saveFits = QtCore.pyqtSignal(list)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.setColumnCount(1)
|
||||
self.invisibleRootItem().setFlags(self.invisibleRootItem().flags() ^ QtCore.Qt.ItemIsDropEnabled)
|
||||
|
||||
self.itemChanged.connect(self.data_change)
|
||||
self.itemClicked.connect(self.new_selection)
|
||||
|
||||
self.setColumnCount(2)
|
||||
|
||||
self.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.setDragDropMode(QtWidgets.QTreeView.InternalMove)
|
||||
self.setDefaultDropAction(QtCore.Qt.IgnoreAction)
|
||||
self.setSelectionMode(QtWidgets.QTreeView.ExtendedSelection)
|
||||
self.setSelectionBehavior(QtWidgets.QTreeView.SelectRows)
|
||||
|
||||
self._checked_graphs = set()
|
||||
self._checked_sets = set()
|
||||
self.management = None
|
||||
|
||||
header = QtWidgets.QHeaderView(QtCore.Qt.Horizontal, self)
|
||||
self.setHeader(header)
|
||||
header.setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch)
|
||||
header.setVisible(False)
|
||||
header.moveSection(1, 0)
|
||||
self.setColumnWidth(1, 16)
|
||||
self.setItemDelegateForColumn(1, HeaderDelegate())
|
||||
|
||||
def add_graph(self, idd: str, name: str):
|
||||
item = QtWidgets.QTreeWidgetItem()
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDropEnabled | QtCore.Qt.ItemIsEditable |
|
||||
QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsUserCheckable)
|
||||
item.setText(0, name)
|
||||
item.setData(0, QtCore.Qt.UserRole, idd)
|
||||
item.setCheckState(0, QtCore.Qt.Checked)
|
||||
|
||||
self.addTopLevelItem(item)
|
||||
self._checked_graphs.add(idd)
|
||||
item.setExpanded(True)
|
||||
|
||||
def add_item(self, items: Union[tuple, List[tuple]], gid: str):
|
||||
if isinstance(items, tuple):
|
||||
items = [items]
|
||||
|
||||
for row in range(self.invisibleRootItem().childCount()):
|
||||
graph = self.invisibleRootItem().child(row)
|
||||
if graph.data(0, QtCore.Qt.UserRole) == gid:
|
||||
for (idd, name) in items:
|
||||
item = QtWidgets.QTreeWidgetItem([name])
|
||||
item.setData(0, QtCore.Qt.UserRole, idd)
|
||||
item.setCheckState(0, QtCore.Qt.Checked)
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDragEnabled | QtCore.Qt.ItemIsEditable |
|
||||
QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsUserCheckable)
|
||||
graph.addChild(item)
|
||||
self._checked_sets.add(idd)
|
||||
|
||||
self.resizeColumnToContents(0)
|
||||
break
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QTreeWidgetItem)
|
||||
def data_change(self, item: QtWidgets.QTreeWidgetItem) -> Tuple[set, set]:
|
||||
idd = item.data(0, QtCore.Qt.UserRole)
|
||||
is_selected = item.checkState(0) == QtCore.Qt.Checked
|
||||
to_be_hidden = set()
|
||||
to_be_shown = set()
|
||||
|
||||
# item is top-level item / graph
|
||||
if item.parent() is None:
|
||||
was_selected = idd in self._checked_graphs
|
||||
|
||||
# check state changed to selected
|
||||
if is_selected != was_selected:
|
||||
# check state changed to checked
|
||||
if is_selected:
|
||||
self._checked_graphs.add(idd)
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(item)
|
||||
iterator += 1
|
||||
self.blockSignals(True)
|
||||
for i in range(item.childCount()):
|
||||
child = item.child(i)
|
||||
child.setCheckState(0, QtCore.Qt.Checked)
|
||||
to_be_shown.add(child.data(0, QtCore.Qt.UserRole))
|
||||
self._checked_sets.add(child.data(0, QtCore.Qt.UserRole))
|
||||
self.blockSignals(False)
|
||||
|
||||
# check state change to unchecked
|
||||
else:
|
||||
self._checked_graphs.remove(idd)
|
||||
self.blockSignals(True)
|
||||
for i in range(item.childCount()):
|
||||
child = item.child(i)
|
||||
child.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
to_be_hidden.add(child.data(0, QtCore.Qt.UserRole))
|
||||
try:
|
||||
self._checked_sets.remove(child.data(0, QtCore.Qt.UserRole))
|
||||
except KeyError:
|
||||
pass
|
||||
self.blockSignals(False)
|
||||
|
||||
else:
|
||||
self.keyChanged.emit(idd, item.text(0))
|
||||
|
||||
# item is a set
|
||||
else:
|
||||
was_selected = idd in self._checked_sets
|
||||
if is_selected != was_selected:
|
||||
if is_selected:
|
||||
to_be_shown.add(idd)
|
||||
self._checked_sets.add(idd)
|
||||
|
||||
else:
|
||||
to_be_hidden.add(idd)
|
||||
try:
|
||||
self._checked_sets.remove(idd)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
else:
|
||||
self.keyChanged.emit(idd, item.text(0))
|
||||
|
||||
if to_be_shown or to_be_hidden:
|
||||
self.stateChanged.emit(list(to_be_shown), list(to_be_hidden))
|
||||
|
||||
return to_be_shown, to_be_hidden
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QTreeWidgetItem)
|
||||
def new_selection(self, item: QtWidgets.QTreeWidgetItem):
|
||||
if item.parent() is None:
|
||||
self.management.select_window(item.data(0, QtCore.Qt.UserRole))
|
||||
|
||||
def dropEvent(self, evt: QtGui.QDropEvent):
|
||||
dropped_index = self.indexAt(evt.pos())
|
||||
if not dropped_index.isValid():
|
||||
return
|
||||
|
||||
to_parent = self.itemFromIndex(dropped_index).parent()
|
||||
append = False
|
||||
if not to_parent:
|
||||
# dropped on graph item -> append items
|
||||
to_parent = self.itemFromIndex(dropped_index)
|
||||
append = True
|
||||
|
||||
# index may change
|
||||
persistent_drop = QtCore.QPersistentModelIndex(dropped_index)
|
||||
|
||||
tobemoved = []
|
||||
take_from = []
|
||||
for it in self.selectedItems():
|
||||
from_parent = it.parent()
|
||||
if from_parent is None:
|
||||
continue
|
||||
|
||||
from_parent.removeChild(it)
|
||||
tobemoved.append(it)
|
||||
take_from.append(from_parent.data(0, QtCore.Qt.UserRole))
|
||||
|
||||
pos = QtCore.QModelIndex(persistent_drop)
|
||||
if self.dropIndicatorPosition() == QtWidgets.QAbstractItemView.BelowItem:
|
||||
pos = pos.sibling(pos.row()+1, 0)
|
||||
|
||||
row = pos.row()
|
||||
if (row == -1) or append:
|
||||
to_parent.addChildren(tobemoved)
|
||||
else:
|
||||
to_parent.insertChildren(row, tobemoved)
|
||||
|
||||
self.management.move_sets([it.data(0, QtCore.Qt.UserRole) for it in tobemoved],
|
||||
to_parent.data(0, QtCore.Qt.UserRole), take_from,
|
||||
pos=-1 if append else row)
|
||||
|
||||
def move_sets(self, sid: str, gid_in: str, gid_out: str):
|
||||
self.blockSignals(True)
|
||||
to_parent = None
|
||||
from_parent = None
|
||||
it = None
|
||||
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
if item is not None:
|
||||
data = item.data(0, QtCore.Qt.UserRole)
|
||||
if data == gid_out:
|
||||
from_parent = item
|
||||
|
||||
elif data == gid_in:
|
||||
to_parent = item
|
||||
|
||||
elif data == sid:
|
||||
it = item
|
||||
|
||||
iterator += 1
|
||||
|
||||
if (from_parent is None) or (to_parent is None) or (it is None):
|
||||
print('Komisch')
|
||||
return
|
||||
|
||||
from_parent.removeChild(it)
|
||||
to_parent.addChild(it)
|
||||
|
||||
self.blockSignals(False)
|
||||
|
||||
def set_name(self, sid, name):
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
if item is not None:
|
||||
data = item.data(0, QtCore.Qt.UserRole)
|
||||
if data == sid:
|
||||
if name != item.text(0):
|
||||
item.setText(0, name)
|
||||
break
|
||||
|
||||
iterator += 1
|
||||
|
||||
def keyPressEvent(self, evt: QtGui.QKeyEvent):
|
||||
if evt.key() == QtCore.Qt.Key_Delete:
|
||||
rm_sets = []
|
||||
rm_graphs = []
|
||||
for idx in self.selectedIndexes():
|
||||
if idx.column() == 1:
|
||||
continue
|
||||
item = self.itemFromIndex(idx)
|
||||
if item.parent() is None:
|
||||
for c_i in range(item.childCount()):
|
||||
rm_sets.append(item.child(c_i).data(0, QtCore.Qt.UserRole))
|
||||
rm_graphs.append(item.data(0, QtCore.Qt.UserRole))
|
||||
else:
|
||||
rm_sets.append(item.data(0, QtCore.Qt.UserRole))
|
||||
|
||||
# self.deleteItem.emit(rm_sets+rm_graphs)
|
||||
self.management.delete_sets(rm_sets+rm_graphs)
|
||||
|
||||
elif evt.key() == QtCore.Qt.Key_Space:
|
||||
sets = []
|
||||
from_parent = []
|
||||
|
||||
for idx in self.selectedIndexes():
|
||||
if idx.column() != 0:
|
||||
continue
|
||||
item = self.itemFromIndex(idx)
|
||||
|
||||
if item.parent() is None:
|
||||
is_selected = item.checkState(0)
|
||||
self.blockSignals(True)
|
||||
for i in range(item.childCount()):
|
||||
child = item.child(i)
|
||||
from_parent.append(child)
|
||||
self.blockSignals(False)
|
||||
if is_selected == QtCore.Qt.Checked:
|
||||
item.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
else:
|
||||
item.setCheckState(0, QtCore.Qt.Checked)
|
||||
|
||||
else:
|
||||
sets.append(item)
|
||||
|
||||
for it in sets:
|
||||
if it in from_parent:
|
||||
continue
|
||||
it.setCheckState(0, QtCore.Qt.Unchecked if it.checkState(0) == QtCore.Qt.Checked else QtCore.Qt.Checked)
|
||||
else:
|
||||
super().keyPressEvent(evt)
|
||||
|
||||
def mousePressEvent(self, evt: QtGui.QMouseEvent):
|
||||
# disable drag-and-drop when column 1 ('header') is clicked
|
||||
idx = self.indexAt(evt.pos())
|
||||
self.setDragEnabled(idx.column() == 0)
|
||||
super().mousePressEvent(evt)
|
||||
|
||||
def remove_item(self, ids: list):
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
_id = item.data(0, QtCore.Qt.UserRole)
|
||||
if _id in ids:
|
||||
try:
|
||||
idx = item.parent().indexOfChild(item)
|
||||
item.parent().takeChild(idx)
|
||||
if _id in self._checked_sets:
|
||||
self._checked_sets.remove(_id)
|
||||
except AttributeError:
|
||||
idx = self.invisibleRootItem().indexOfChild(item)
|
||||
self.invisibleRootItem().takeChild(idx)
|
||||
self._checked_graphs.remove(_id)
|
||||
|
||||
iterator += 1
|
||||
|
||||
def contextMenuEvent(self, evt, color_list=None):
|
||||
menu = QtWidgets.QMenu()
|
||||
_ = menu.addAction('Hello')
|
||||
_.setEnabled(False)
|
||||
menu.addSeparator()
|
||||
|
||||
idx = self.selectedIndexes()
|
||||
|
||||
if self.invisibleRootItem().childCount() == 0 and len(idx) == 0:
|
||||
rdn_action = menu.addAction('Randomness')
|
||||
|
||||
action = menu.exec(evt.globalPos())
|
||||
|
||||
if action == rdn_action:
|
||||
import webbrowser
|
||||
webbrowser.open('https://en.wikipedia.org/wiki/Special:Random')
|
||||
|
||||
else:
|
||||
del_action = menu.addAction('Exterminate')
|
||||
cp_action = menu.addAction('Replicate')
|
||||
cat_action = menu.addAction('Join us!')
|
||||
plt_action = None
|
||||
save_action = None
|
||||
menu.addSeparator()
|
||||
col_menu = menu.addMenu('Color cycle')
|
||||
for c in available_cycles.keys():
|
||||
col_menu.addAction(c)
|
||||
|
||||
idx = {}
|
||||
has_fits = False
|
||||
for i in self.selectedIndexes():
|
||||
if i.column() == 0:
|
||||
continue
|
||||
|
||||
item = self.itemFromIndex(i)
|
||||
parent = item.parent()
|
||||
if parent is None:
|
||||
continue
|
||||
|
||||
else:
|
||||
graph_id = parent.data(0, QtCore.Qt.UserRole)
|
||||
if graph_id not in idx:
|
||||
idx[graph_id] = []
|
||||
# collect sets in their graph
|
||||
idx[graph_id].append(item.data(0, QtCore.Qt.UserRole))
|
||||
data = self.management[item.data(0, QtCore.Qt.UserRole)]
|
||||
if data.mode == 'fit':
|
||||
has_fits = True
|
||||
|
||||
if has_fits:
|
||||
menu.addSeparator()
|
||||
plt_action = menu.addAction('Plot fit parameter')
|
||||
save_action = menu.addAction('Save fit parameter')
|
||||
|
||||
action = menu.exec(evt.globalPos())
|
||||
|
||||
s = []
|
||||
for gid, sets in idx.items():
|
||||
s.extend(sets)
|
||||
|
||||
if action == del_action:
|
||||
self.management.delete_sets(s)
|
||||
|
||||
elif action == cp_action:
|
||||
for gid, sets in idx.items():
|
||||
self.management.copy_sets(sets, gid)
|
||||
|
||||
elif action == cat_action:
|
||||
self.management.cat(s)
|
||||
|
||||
elif action == plt_action:
|
||||
self.management.make_fit_parameter(s)
|
||||
|
||||
elif action == save_action:
|
||||
self.saveFits.emit(s)
|
||||
|
||||
elif action.parent() == col_menu:
|
||||
self.management.set_cycle(s, action.text())
|
||||
|
||||
evt.accept()
|
||||
|
||||
def highlight(self, gid: str):
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
if item is not None:
|
||||
if item.data(0, QtCore.Qt.UserRole) == gid:
|
||||
item.setBackground(0, QtGui.QBrush(QtGui.QColor('gray')))
|
||||
else:
|
||||
item.setBackground(0, QtGui.QBrush())
|
||||
iterator += 1
|
||||
|
||||
def uncheck_sets(self, sets: List[str]):
|
||||
self.blockSignals(True)
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
if item is not None:
|
||||
if item.data(0, QtCore.Qt.UserRole) in sets:
|
||||
item.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
iterator += 1
|
||||
self.blockSignals(False)
|
||||
|
||||
|
||||
class DataWidget(QtWidgets.QWidget, Ui_DataWidget):
|
||||
keyChanged = QtCore.pyqtSignal(str, str)
|
||||
deleteItem = QtCore.pyqtSignal(list)
|
||||
startShowProperty = QtCore.pyqtSignal(list)
|
||||
propertyChanged = QtCore.pyqtSignal(list, str, str, object)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.setupUi(self)
|
||||
self.tree = DataTree(self)
|
||||
self.verticalLayout.addWidget(self.tree)
|
||||
self.tree.selectionModel().selectionChanged.connect(lambda x, y: self.show_property(x))
|
||||
|
||||
self.tree.keyChanged.connect(lambda x, y: self.keyChanged.emit(x, y))
|
||||
|
||||
self.proptable = PropWidget(self)
|
||||
self.propwidget.addWidget(self.proptable)
|
||||
self.propwidget.setText('Properties')
|
||||
self.propwidget.expansionChanged.connect(self.show_property)
|
||||
self.proptable.propertyChanged.connect(self.change_property)
|
||||
|
||||
make_action_icons(self)
|
||||
|
||||
def add_graph(self, idd: str, name: str):
|
||||
self.tree.blockSignals(True)
|
||||
self.tree.add_graph(idd, name)
|
||||
self.tree.blockSignals(False)
|
||||
|
||||
def add_item(self, idd: str, name: str, gid: str):
|
||||
self.tree.blockSignals(True)
|
||||
self.tree.add_item((idd, name), gid)
|
||||
self.tree.blockSignals(False)
|
||||
|
||||
def add_item_list(self, loi: list, gid: str):
|
||||
self.tree.blockSignals(True)
|
||||
self.tree.add_item(loi, gid)
|
||||
self.tree.blockSignals(False)
|
||||
|
||||
def remove_item(self, key):
|
||||
self.tree.remove_item(key)
|
||||
|
||||
def show_property(self, _: QtCore.QModelIndex = None):
|
||||
if not self.propwidget.isExpanded():
|
||||
return
|
||||
|
||||
sid = []
|
||||
for i in self.tree.selectedIndexes():
|
||||
if i.column() == 0:
|
||||
sid.append(i.data(role=QtCore.Qt.UserRole))
|
||||
|
||||
self.startShowProperty.emit(sid)
|
||||
|
||||
@QtCore.pyqtSlot(dict)
|
||||
def set_properties(self, props: dict):
|
||||
self.proptable.populate(props)
|
||||
|
||||
def change_property(self, key1, key2, value):
|
||||
ids = [item.data(0, QtCore.Qt.UserRole) for item in self.tree.selectedItems()]
|
||||
if key2 == 'Value':
|
||||
try:
|
||||
value = float(value)
|
||||
except ValueError:
|
||||
QtWidgets.QMessageBox.warning(self, 'Invalid entry',
|
||||
'Value %r is not a valid number for `value`.' % value)
|
||||
return
|
||||
|
||||
self.propertyChanged.emit(ids, key1, key2, value)
|
||||
|
||||
def uncheck_sets(self, sets: List[str]):
|
||||
self.tree.uncheck_sets(sets)
|
||||
|
||||
def set_name(self, sid, value):
|
||||
self.tree.set_name(sid, value)
|
||||
|
||||
@property
|
||||
def management(self):
|
||||
return self.tree.management
|
||||
|
||||
@management.setter
|
||||
def management(self, value):
|
||||
self.tree.management = value
|
78
src/gui_qt/data/datawidget/properties.py
Normal file
78
src/gui_qt/data/datawidget/properties.py
Normal file
@ -0,0 +1,78 @@
|
||||
from ...Qt import QtWidgets, QtCore, QtGui
|
||||
from ...lib.delegates import PropertyDelegate
|
||||
|
||||
|
||||
class PropWidget(QtWidgets.QWidget):
|
||||
propertyChanged = QtCore.pyqtSignal(str, str, object)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.layout = QtWidgets.QVBoxLayout(self)
|
||||
self.layout.setContentsMargins(2, 2, 2, 2)
|
||||
self.tab = QtWidgets.QTabWidget(self)
|
||||
self.layout.addWidget(self.tab)
|
||||
self.pages = []
|
||||
|
||||
self.tab.currentChanged.connect(self.tab_change)
|
||||
|
||||
self._tab_idx = 0
|
||||
|
||||
def populate(self, props: dict):
|
||||
self.pages = []
|
||||
self.tab.blockSignals(True)
|
||||
while self.tab.count():
|
||||
self.tab.removeTab(0)
|
||||
|
||||
for k, v in props.items():
|
||||
table = PropTable(self)
|
||||
table.populate(v)
|
||||
table.itemChanged.connect(self.property_change)
|
||||
self.tab.addTab(table, k)
|
||||
self.pages.append(table)
|
||||
self.tab.blockSignals(False)
|
||||
|
||||
self.tab.setCurrentIndex(self._tab_idx)
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QTableWidgetItem)
|
||||
def property_change(self, item: QtWidgets.QTableWidgetItem):
|
||||
tab_idx = self.tab.currentIndex()
|
||||
table = self.pages[tab_idx]
|
||||
idx = table.indexFromItem(item)
|
||||
self.propertyChanged.emit(self.tab.tabText(tab_idx),
|
||||
table.item(idx.row(), idx.column()-1).text(),
|
||||
item.data(QtCore.Qt.DisplayRole))
|
||||
|
||||
@QtCore.pyqtSlot(int)
|
||||
def tab_change(self, idx: int):
|
||||
self._tab_idx = idx
|
||||
|
||||
|
||||
class PropTable(QtWidgets.QTableWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.setColumnCount(2)
|
||||
self.setItemDelegateForColumn(1, PropertyDelegate())
|
||||
self.horizontalHeader().setStretchLastSection(True)
|
||||
self.verticalHeader().setVisible(False)
|
||||
self.horizontalHeader().setVisible(False)
|
||||
self.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
|
||||
def populate(self, prop: dict):
|
||||
self.clear()
|
||||
self.setRowCount(0)
|
||||
self.blockSignals(True)
|
||||
for k, v in prop.items():
|
||||
value_item = QtWidgets.QTableWidgetItem('')
|
||||
value_item.setData(QtCore.Qt.DisplayRole, v)
|
||||
|
||||
key_item = QtWidgets.QTableWidgetItem(k)
|
||||
key_item.setFlags(QtCore.Qt.NoItemFlags)
|
||||
key_item.setForeground(QtGui.QBrush(QtGui.QColor(0, 0, 0)))
|
||||
|
||||
self.setRowCount(self.rowCount()+1)
|
||||
self.setItem(self.rowCount()-1, 0, key_item)
|
||||
self.setItem(self.rowCount()-1, 1, value_item)
|
||||
self.blockSignals(False)
|
213
src/gui_qt/data/integral_widget.py
Normal file
213
src/gui_qt/data/integral_widget.py
Normal file
@ -0,0 +1,213 @@
|
||||
from itertools import cycle
|
||||
|
||||
import pyqtgraph as pg
|
||||
from numpy import nanmax, nanmin, inf, argsort, where
|
||||
try:
|
||||
# numpy > 1.19 renamed some integration functions
|
||||
from scipy.integrate import cumulative_trapezoid
|
||||
except ImportError:
|
||||
from scipy.integrate import cumtrapz as cumulative_trapezoid
|
||||
|
||||
from ..Qt import QtWidgets, QtCore, QtGui
|
||||
from .._py.integral_widget import Ui_Form
|
||||
|
||||
|
||||
class IntegralWidget(QtWidgets.QWidget, Ui_Form):
|
||||
colors = cycle(['red', 'green', 'blue', 'cyan', 'magenta',
|
||||
'darkRed', 'darkGreen', 'darkBlue', 'darkCyan', 'darkMagenta'])
|
||||
|
||||
requestData = QtCore.pyqtSignal(str)
|
||||
item_deleted = QtCore.pyqtSignal(pg.GraphicsObject)
|
||||
newData = QtCore.pyqtSignal(str, list)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.connected_figure = ''
|
||||
self.graph_shown = None
|
||||
self.shown_set = None
|
||||
|
||||
self._data = None
|
||||
self.ranges = []
|
||||
self.lines = []
|
||||
|
||||
self.max_area = 0
|
||||
self.max_y = inf
|
||||
self.min_y = -inf
|
||||
|
||||
def __call__(self, graph_name, items):
|
||||
self.label_2.setText(f'Connected to <b>{graph_name}</b>')
|
||||
|
||||
self.clear()
|
||||
|
||||
self.set_combobox.blockSignals(True)
|
||||
self.set_combobox.clear()
|
||||
|
||||
for sid, name in items:
|
||||
self.set_combobox.addItem(name, userData=sid)
|
||||
|
||||
self.set_combobox.blockSignals(False)
|
||||
|
||||
self.set_combobox.setCurrentIndex(0)
|
||||
self.set_combobox.currentIndexChanged.emit(0)
|
||||
|
||||
return self
|
||||
|
||||
def keyPressEvent(self, e):
|
||||
if e.key() == QtCore.Qt.Key_Delete:
|
||||
self.remove_integral()
|
||||
else:
|
||||
super().keyPressEvent(e)
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_set_combobox_currentIndexChanged')
|
||||
def change_set(self, idx: int):
|
||||
key = self.set_combobox.itemData(idx)
|
||||
self.requestData.emit(key)
|
||||
|
||||
def set_data(self, ptr):
|
||||
self._data = ptr
|
||||
self.max_y = nanmax(self._data.y.real)
|
||||
self.min_y = nanmin(self._data.y.real)
|
||||
for idx, rnge in enumerate(self.ranges):
|
||||
self._update_values(idx, rnge)
|
||||
|
||||
def add(self, pos):
|
||||
x = pos[0]
|
||||
self.ranges.append((x, x * 1.1))
|
||||
|
||||
c = next(IntegralWidget.colors)
|
||||
qc = QtGui.QColor(c)
|
||||
qc.setAlpha(40)
|
||||
region = pg.LinearRegionItem(values=[x, x*1.1], brush=QtGui.QBrush(qc), pen=pg.mkPen(QtGui.QColor(c)))
|
||||
integral_plot = pg.PlotDataItem(x=[], y=[])
|
||||
region.sigRegionChanged.connect(self._update_integral)
|
||||
|
||||
self.lines.append((region, integral_plot))
|
||||
self.areas.append(0)
|
||||
self._make_entry(c)
|
||||
|
||||
return region, integral_plot
|
||||
|
||||
def _make_entry(self, c):
|
||||
item = QtWidgets.QTreeWidgetItem()
|
||||
item.setText(0, f'Integral {len(self.ranges)}')
|
||||
|
||||
item.setForeground(0, QtGui.QBrush(QtGui.QColor(c)))
|
||||
|
||||
pts_i = self.ranges[-1]
|
||||
item_list = []
|
||||
for text, val in [('Start', pts_i[0]), ('Stop', pts_i[1]), ('Areas', 0), ('Ratio', 1.)]:
|
||||
child = QtWidgets.QTreeWidgetItem()
|
||||
child.setFlags(QtCore.Qt.NoItemFlags)
|
||||
child.setText(0, f'{text}: {val:.5g}')
|
||||
child.setForeground(0, QtGui.QBrush(QtGui.QColor('black')))
|
||||
|
||||
item_list.append(child)
|
||||
|
||||
item.addChildren(item_list)
|
||||
|
||||
self.treeWidget.addTopLevelItem(item)
|
||||
self.treeWidget.expandToDepth(1)
|
||||
|
||||
self._update_values(len(self.ranges) - 1, pts_i)
|
||||
|
||||
def _update_integral(self):
|
||||
idx = None
|
||||
sender = self.sender()
|
||||
for i, (reg, _) in enumerate(self.lines):
|
||||
if sender == reg:
|
||||
idx = i
|
||||
break
|
||||
|
||||
if idx is None:
|
||||
return
|
||||
|
||||
self._update_values(idx, sender.getRegion())
|
||||
|
||||
def _update_values(self, idx, new_range):
|
||||
self.ranges[idx] = new_range
|
||||
area = self.calc_integral(idx, *new_range)
|
||||
|
||||
item = self.treeWidget.topLevelItem(idx)
|
||||
item.child(0).setText(0, f'Start: {new_range[0]:.5g}')
|
||||
item.child(1).setText(0, f'Stop: {new_range[1]:.5g}')
|
||||
|
||||
if area is not None:
|
||||
self.areas[idx] = area
|
||||
item.child(2).setText(0, f'Area: {area:.5g}')
|
||||
if self.max_area > 0:
|
||||
self._set_ratios(idx, self.max_area)
|
||||
|
||||
curr_max = max(self.areas)
|
||||
if curr_max != self.max_area:
|
||||
if curr_max > 0:
|
||||
root = self.treeWidget.invisibleRootItem()
|
||||
for i in range(root.childCount()):
|
||||
self._set_ratios(i, curr_max)
|
||||
self.max_area = curr_max
|
||||
|
||||
def _set_ratios(self, idx, max_value):
|
||||
item = self.treeWidget.invisibleRootItem().child(idx)
|
||||
area_i = self.areas[idx]
|
||||
item.child(3).setText(0, f'Ratio: {area_i / max_value:.3g}')
|
||||
|
||||
integral_line = self.lines[idx][1]
|
||||
x_i, y_i = integral_line.getData()
|
||||
scale = (self.max_y - self.min_y) / y_i[-1] * (area_i / max_value)
|
||||
integral_line.setData(x=x_i, y=y_i * scale)
|
||||
|
||||
def calc_integral(self, idx, x_min, x_max):
|
||||
int_range = where((self._data.x >= x_min) & (self._data.x <= x_max))[0]
|
||||
if len(int_range) > 1:
|
||||
x_int = self._data.x[int_range]
|
||||
y_int = self._data.y[int_range].real
|
||||
order = argsort(x_int)
|
||||
|
||||
integral = cumulative_trapezoid(y=y_int[order], x=x_int[order], initial=0)
|
||||
scale = (self.max_y-self.min_y) / integral[-1]
|
||||
self.lines[idx][1].setData(x=x_int[order], y=integral*scale + self.min_y)
|
||||
|
||||
return integral[-1]
|
||||
|
||||
else:
|
||||
self.lines[idx][1].setData(x=[], y=[])
|
||||
return None
|
||||
|
||||
def remove_integral(self):
|
||||
root = self.treeWidget.invisibleRootItem()
|
||||
for item in self.treeWidget.selectedItems():
|
||||
idx = root.indexOfChild(item)
|
||||
|
||||
self.ranges.pop(idx)
|
||||
self.item_deleted.emit(self.lines[idx][0])
|
||||
self.item_deleted.emit(self.lines[idx][1])
|
||||
self.lines.pop(idx)
|
||||
self.areas.pop(idx)
|
||||
self.treeWidget.takeTopLevelItem(idx)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_pushButton_clicked')
|
||||
def convert_to_datasets(self):
|
||||
set_id = self.set_combobox.currentData()
|
||||
values = []
|
||||
for i in range(len(self.ranges)):
|
||||
x_i, y_i = self.lines[i][1].getData()
|
||||
start_i, stop_i = self.ranges[i]
|
||||
area_i = self.areas[i]
|
||||
values.append((x_i, y_i, start_i, stop_i, area_i))
|
||||
|
||||
self.newData.emit(set_id, values)
|
||||
|
||||
def clear(self):
|
||||
self.connected_figure = ''
|
||||
self.graph_shown = None
|
||||
self.shown_set = None
|
||||
|
||||
self._data = None
|
||||
self.ranges = []
|
||||
self.lines = []
|
||||
|
||||
self.max_area = 0
|
||||
self.max_y = inf
|
||||
self.min_y = -inf
|
||||
|
41
src/gui_qt/data/interpolate_dialog.py
Normal file
41
src/gui_qt/data/interpolate_dialog.py
Normal file
@ -0,0 +1,41 @@
|
||||
from numpy import linspace, logspace, log10
|
||||
|
||||
from ..Qt import QtWidgets, QtCore
|
||||
from .._py.interpol_dialog import Ui_Dialog
|
||||
|
||||
|
||||
class QInterpol(QtWidgets.QDialog, Ui_Dialog):
|
||||
ready = QtCore.pyqtSignal(dict)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.setupUi(self)
|
||||
|
||||
self.on_comboBox_2_currentIndexChanged(0)
|
||||
|
||||
@QtCore.pyqtSlot(int)
|
||||
def on_comboBox_2_currentIndexChanged(self, idx: int):
|
||||
if idx == 0:
|
||||
self.frame.hide()
|
||||
self.frame_2.show()
|
||||
else:
|
||||
self.frame.show()
|
||||
self.frame_2.hide()
|
||||
|
||||
def accept(self):
|
||||
ret_dic = {'kind': self.comboBox.currentIndex(), 'ylog': self.checkBox_2.isChecked()}
|
||||
if self.comboBox_2.currentIndex() == 0:
|
||||
ret_dic['xaxis'] = int(self.lineEdit.text())
|
||||
else:
|
||||
if self.checkBox.isChecked():
|
||||
ret_dic['xaxis'] = logspace(log10(float(self.lineEdit_2.text())),
|
||||
log10(float(self.lineEdit_3.text())),
|
||||
num=int(self.lineEdit_4.text()))
|
||||
else:
|
||||
ret_dic['xaxis'] = linspace(float(self.lineEdit_2.text()),
|
||||
float(self.lineEdit_3.text()),
|
||||
num=int(self.lineEdit_4.text()))
|
||||
ret_dic['idx'] = [i.row() for i in self.listWidget.selectedIndexes()]
|
||||
self.ready.emit(ret_dic)
|
||||
self.close()
|
114
src/gui_qt/data/plot_dialog.py
Normal file
114
src/gui_qt/data/plot_dialog.py
Normal file
@ -0,0 +1,114 @@
|
||||
from random import randint
|
||||
|
||||
import numpy as np
|
||||
|
||||
from nmreval import models
|
||||
from nmreval.lib.importer import find_models
|
||||
from nmreval.lib.utils import valid_function
|
||||
|
||||
from ..Qt import QtGui, QtCore, QtWidgets
|
||||
from .._py.setbyfunction_dialog import Ui_NewCurveDialog
|
||||
|
||||
|
||||
class QPlotDialog(QtWidgets.QDialog, Ui_NewCurveDialog):
|
||||
line_created = QtCore.pyqtSignal(object)
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
|
||||
self._function = find_models(models)
|
||||
|
||||
self.lineEdit_3.setValidator(QtGui.QDoubleValidator())
|
||||
self.lineEdit_4.setValidator(QtGui.QDoubleValidator())
|
||||
self.lineEdit_5.setValidator(QtGui.QIntValidator().setBottom(0))
|
||||
|
||||
self.buttonBox.accepted.connect(self.make_line)
|
||||
|
||||
for cb in [self.comboBox, self.comboBox_2, self.comboBox_4, self.comboBox_5]:
|
||||
cb.setCurrentIndex(randint(0, cb.count()))
|
||||
|
||||
for cb in [self.comboBox_6, self.comboBox_7]:
|
||||
self.load_models(cb)
|
||||
|
||||
def load_models(self, cb: QtWidgets.QComboBox):
|
||||
for f in self._function:
|
||||
cb.addItem(f'{f.name} ({f.type})', userData=f)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_pushButton_clicked')
|
||||
def check_input(self):
|
||||
err = []
|
||||
try:
|
||||
start = float(self.lineEdit_3.text())
|
||||
except ValueError:
|
||||
err.append(0)
|
||||
start = 1
|
||||
try:
|
||||
stop = float(self.lineEdit_4.text())
|
||||
except ValueError:
|
||||
err.append(1)
|
||||
stop = 10
|
||||
|
||||
try:
|
||||
nums = int(self.lineEdit_5.text())
|
||||
except ValueError:
|
||||
err.append(2)
|
||||
nums = 10
|
||||
|
||||
if self.checkBox.isChecked():
|
||||
if start <= 0 or stop <= 0:
|
||||
err.append(3)
|
||||
start, stop = abs(start)+1e-12, abs(stop)
|
||||
grid = np.geomspace(start, stop, num=nums)
|
||||
else:
|
||||
grid = np.linspace(start, stop, num=nums)
|
||||
|
||||
x_func = self.lineEdit.text()
|
||||
x, isok = valid_function(x_func, extra_namespace={'i': grid})
|
||||
if not isok:
|
||||
err.append(4)
|
||||
x = grid
|
||||
|
||||
y_func = self.lineEdit_2.text()
|
||||
y, isok = valid_function(y_func, extra_namespace={'i': grid, 'x':x})
|
||||
if not isok:
|
||||
err.append(5)
|
||||
|
||||
msg_err = {0: 'Invalid value for grid start',
|
||||
1: 'Invalid value for grid end',
|
||||
2: 'Invalid number of grid steps',
|
||||
3: 'Negative numbers in logarithmic grid',
|
||||
4: 'Invalid expression for x',
|
||||
5: 'Invalid expression for y'
|
||||
}
|
||||
|
||||
if err:
|
||||
m = '\n'.join([msg_err[e] for e in err])
|
||||
QtWidgets.QMessageBox().information(self, 'Error detected', m)
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def make_line(self):
|
||||
if not self.check_input():
|
||||
return
|
||||
|
||||
start = float(self.lineEdit_3.text())
|
||||
stop = float(self.lineEdit_4.text())
|
||||
nums = int(self.lineEdit_5.text())
|
||||
if self.checkBox.isChecked():
|
||||
x = np.geomspace(start, stop, num=nums)
|
||||
else:
|
||||
x = np.linspace(start, stop, num=nums)
|
||||
x_func = self.lineEdit.text()
|
||||
y_func = self.lineEdit_2.text()
|
||||
|
||||
sym = self.comboBox.currentText()
|
||||
lin = self.comboBox_2.currentText()
|
||||
|
||||
name = self.lineEdit_6.text()
|
||||
if not name:
|
||||
name = 'self done'
|
||||
|
||||
lw = self.doubleSpinBox.value()
|
||||
sw = self.spinBox.value()
|
196
src/gui_qt/data/point_select.py
Normal file
196
src/gui_qt/data/point_select.py
Normal file
@ -0,0 +1,196 @@
|
||||
import re
|
||||
|
||||
from ..Qt import QtCore, QtWidgets
|
||||
from .._py.ptstab import Ui_Form
|
||||
from ..lib.pg_objects import LogInfiniteLine, RegionItem
|
||||
|
||||
__all__ = ['PointSelectWidget']
|
||||
|
||||
|
||||
REGION_RE = re.compile(r'(?P<first>[+-]*\d+(?:\.\d*)*(?:[eE][+-]*\d+)*)'
|
||||
r'(?: ?- ?(?P<second>[+-]*\d+(?:\.\d*)*(?:[eE][+-]*\d+)*))*')
|
||||
|
||||
|
||||
class PointSelectWidget(QtWidgets.QWidget, Ui_Form):
|
||||
widget_closed = QtCore.pyqtSignal()
|
||||
points_selected = QtCore.pyqtSignal(dict, str)
|
||||
point_removed = QtCore.pyqtSignal(LogInfiniteLine)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.pts = []
|
||||
self.pts_lines = []
|
||||
self.nop = 0
|
||||
self._prev_pos = ''
|
||||
self._last_item = None
|
||||
self.connected_figure = ''
|
||||
|
||||
self.okButton.clicked.connect(self.apply)
|
||||
self.deleteButton.clicked.connect(self.remove_points)
|
||||
self.peaktable.itemChanged.connect(self.editing_finished)
|
||||
self.peaktable.itemDoubleClicked.connect(self.editing_started)
|
||||
|
||||
def keyPressEvent(self, e):
|
||||
if e.key() == QtCore.Qt.Key_Delete:
|
||||
self.remove_points()
|
||||
elif e.key() == QtCore.Qt.Key_F2:
|
||||
self.editing_started()
|
||||
else:
|
||||
super().keyPressEvent(e)
|
||||
|
||||
def clear(self):
|
||||
self.pts = []
|
||||
self.nop = 0
|
||||
self.peaktable.clear()
|
||||
self.pts_lines = []
|
||||
|
||||
@QtCore.pyqtSlot(tuple, bool)
|
||||
def add(self, pos: tuple, double: bool):
|
||||
x = pos[0]
|
||||
if double:
|
||||
self.removepoint(-1)
|
||||
|
||||
self.pts.append((x, x*1.1))
|
||||
item = RegionItem(values=[x, x*1.1], mode='mid')
|
||||
item.sigRegionChanged.connect(self._update_region)
|
||||
else:
|
||||
self.pts.append(x)
|
||||
item = LogInfiniteLine(pos=x, movable=True)
|
||||
item.sigPositionChanged.connect(self._update_line)
|
||||
|
||||
self.pts_lines.append(item)
|
||||
self.nop += 1
|
||||
self._makerow()
|
||||
|
||||
return item
|
||||
|
||||
def remove_points(self):
|
||||
for i in sorted(self.peaktable.selectedIndexes(), key=lambda x: x.row(), reverse=True):
|
||||
self.removepoint(pos=i.row())
|
||||
|
||||
def removepoint(self, pos=0):
|
||||
if pos == -1:
|
||||
pos = len(self.pts) - 1
|
||||
|
||||
try:
|
||||
self.pts.pop(pos)
|
||||
self.nop -= 1
|
||||
item = self.peaktable.takeItem(pos)
|
||||
del item
|
||||
|
||||
del_line = self.pts_lines.pop(pos)
|
||||
self.point_removed.emit(del_line)
|
||||
del del_line
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
def _makerow(self):
|
||||
if isinstance(self.pts[-1], tuple):
|
||||
item = QtWidgets.QListWidgetItem(f'{self.pts[-1][0]:.5g} - {self.pts[-1][1]:.5g}')
|
||||
else:
|
||||
item = QtWidgets.QListWidgetItem(f'{self.pts[-1]:.5g}')
|
||||
item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEditable)
|
||||
self.peaktable.blockSignals(True)
|
||||
self.peaktable.addItem(item)
|
||||
self.peaktable.blockSignals(False)
|
||||
|
||||
def closeEvent(self, evt):
|
||||
self.widget_closed.emit()
|
||||
super().closeEvent(evt)
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def apply(self) -> dict:
|
||||
ret_dic = {'avg_range': [self.left_pt.value(), self.right_pt.value()],
|
||||
'avg_mode': {0: 'mean', 1: 'sum', 2: 'integral'}[self.average_combobox.currentIndex()],
|
||||
'special': None, 'idx': None,
|
||||
'xy': (self.xbutton.isChecked(), self.ybutton.isChecked())}
|
||||
|
||||
if self.groupBox_2.isChecked():
|
||||
ret_dic['special'] = {0: 'max', 1: 'absmax', 2: 'min', 3: 'absmin'}[self.special_comboBox.currentIndex()]
|
||||
|
||||
if len(self.pts) != 0:
|
||||
ret_dic['idx'] = self.pts
|
||||
|
||||
if self.graph_checkbox.isChecked():
|
||||
gid = ''
|
||||
else:
|
||||
gid = self.graph_combobox.currentData()
|
||||
|
||||
self.points_selected.emit(ret_dic, gid)
|
||||
|
||||
return ret_dic
|
||||
|
||||
def _update_region(self):
|
||||
try:
|
||||
idx = self.pts_lines.index(self.sender())
|
||||
except ValueError:
|
||||
return
|
||||
|
||||
self.pts[idx] = self.sender().getRegion()
|
||||
self.peaktable.blockSignals(True)
|
||||
self.peaktable.item(idx).setText('{:.5g} - {:.5g}'.format(*self.pts[idx]))
|
||||
self.peaktable.blockSignals(False)
|
||||
|
||||
def _update_line(self):
|
||||
try:
|
||||
idx = self.pts_lines.index(self.sender())
|
||||
except ValueError:
|
||||
return
|
||||
|
||||
self.pts[idx] = self.sender().value()
|
||||
self.peaktable.blockSignals(True)
|
||||
self.peaktable.item(idx).setText(f'{self.pts[idx]:.5g}')
|
||||
self.peaktable.blockSignals(False)
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QListWidgetItem)
|
||||
def editing_started(self, item=None):
|
||||
if item is None:
|
||||
item = self.peaktable.selectedItems()[0]
|
||||
self._prev_pos = item.text()
|
||||
self.peaktable.editItem(item)
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QListWidgetItem)
|
||||
def editing_finished(self, it: QtWidgets.QListWidgetItem):
|
||||
m = re.match(REGION_RE, it.text()).groupdict()
|
||||
undo = True
|
||||
if m:
|
||||
start, stop = m['first'], m['second']
|
||||
row = self.peaktable.row(it)
|
||||
it_pts = self.pts_lines[row]
|
||||
if ((stop is None) and isinstance(it_pts, RegionItem)) or \
|
||||
((stop is not None) and isinstance(it_pts, LogInfiniteLine)):
|
||||
QtWidgets.QMessageBox().information(self, 'Invalid type',
|
||||
'Conversion between point and region is not possible.')
|
||||
else:
|
||||
if stop is None:
|
||||
it_pts.blockSignals(True)
|
||||
it_pts.setValue(float(start))
|
||||
it_pts.blockSignals(False)
|
||||
self.pts[row] = float(start)
|
||||
else:
|
||||
start, stop = float(start), float(stop)
|
||||
pos = (min(start, stop), max(start, stop))
|
||||
self.pts[row] = pos
|
||||
self.peaktable.blockSignals(True)
|
||||
it.setText(f'{pos[0]:.5g} - {pos[1]:.5g}')
|
||||
self.peaktable.blockSignals(False)
|
||||
it_pts.blockSignals(True)
|
||||
it_pts.setRegion(pos)
|
||||
it_pts.blockSignals(False)
|
||||
undo = False
|
||||
|
||||
if undo:
|
||||
self.peaktable.blockSignals(True)
|
||||
it.setText(self._prev_pos)
|
||||
self.peaktable.blockSignals(False)
|
||||
|
||||
def set_graphs(self, graphs: list):
|
||||
self.graph_combobox.clear()
|
||||
for g in graphs:
|
||||
self.graph_combobox.addItem(g[1], userData=g[0])
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_graph_checkbox_stateChanged')
|
||||
def changed_state(self, checked):
|
||||
self.graph_combobox.setEnabled(checked!=QtCore.Qt.Checked)
|
177
src/gui_qt/data/shift_graphs.py
Normal file
177
src/gui_qt/data/shift_graphs.py
Normal file
@ -0,0 +1,177 @@
|
||||
import numpy as np
|
||||
from itertools import cycle
|
||||
|
||||
from pyqtgraph import mkColor, mkPen
|
||||
|
||||
from nmreval.lib.colors import Tab10
|
||||
|
||||
from ..Qt import QtGui, QtCore, QtWidgets
|
||||
from .._py.shift_scale_dialog import Ui_shift_dialog
|
||||
from ..lib.pg_objects import PlotItem
|
||||
from ..lib.spinboxes import SciSpinBox
|
||||
|
||||
|
||||
class QShift(QtWidgets.QDialog, Ui_shift_dialog):
|
||||
valuesChanged = QtCore.pyqtSignal(dict, tuple)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.graphicsView.setMenuEnabled(False)
|
||||
self.splitter.setSizes([int(self.width()/4), int(self.width()*2/3)])
|
||||
|
||||
self.movements = {}
|
||||
self.data = {}
|
||||
self._colors = cycle(Tab10)
|
||||
|
||||
delegate = SpinBoxDelegate()
|
||||
delegate.valueChanged.connect(self.shift)
|
||||
self.shift_table.setItemDelegate(delegate)
|
||||
self.x_shift_spinbox.valueChanged.connect(lambda: self.glob_shift('h'))
|
||||
self.y_shift_spinbox.valueChanged.connect(lambda: self.glob_shift('v'))
|
||||
|
||||
delegate = SpinBoxDelegate()
|
||||
delegate.valueChanged.connect(self.scale)
|
||||
self.scale_table.setItemDelegate(delegate)
|
||||
self.x_scale_spinbox.valueChanged.connect(lambda: self.glob_scale('h'))
|
||||
self.y_scale_spinbox.valueChanged.connect(lambda: self.glob_scale('v'))
|
||||
|
||||
def add_item(self, idx, name, x, y):
|
||||
color = mkColor(next(self._colors).rgb())
|
||||
if np.iscomplexobj(y):
|
||||
pl = [PlotItem(x, y.real, name=name, pen=mkPen(color=color)),
|
||||
PlotItem(x, y.imag, name=name, pen=mkPen(color=color))]
|
||||
else:
|
||||
pl = [PlotItem(x, y, name=name, pen=mkPen(color=color))]
|
||||
|
||||
self.data[idx] = (pl, x, y)
|
||||
|
||||
# [[horizontal shift, vertical shift], [horizontal scale, vertical scale]]
|
||||
self.movements[idx] = [[0, 0], [1, 1]]
|
||||
|
||||
for i, tw in enumerate([self.shift_table, self.scale_table]):
|
||||
tw.blockSignals(True)
|
||||
row = tw.rowCount()
|
||||
tw.insertRow(row)
|
||||
|
||||
item = QtWidgets.QTableWidgetItem(name)
|
||||
item.setForeground(QtGui.QBrush(color))
|
||||
item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled)
|
||||
item.setCheckState(QtCore.Qt.Checked)
|
||||
item.setData(QtCore.Qt.UserRole, idx)
|
||||
tw.setItem(row, 0, item)
|
||||
|
||||
tw.setItem(row, 1, QtWidgets.QTableWidgetItem(str(i)))
|
||||
tw.setItem(row, 2, QtWidgets.QTableWidgetItem(str(i)))
|
||||
|
||||
tw.blockSignals(False)
|
||||
for i in pl:
|
||||
self.graphicsView.addItem(i)
|
||||
|
||||
def set_graphs(self, graphs: list):
|
||||
for key, name in graphs:
|
||||
self.data_combobox.addItem(name, userData=key)
|
||||
self.values_combobox.addItem(name, userData=key)
|
||||
|
||||
def glob_shift_scale(self, widget: QtWidgets.QTableWidget, mode: int, col: int, value: float):
|
||||
for row in range(widget.rowCount()):
|
||||
if widget.item(row, 0).checkState() == QtCore.Qt.Checked:
|
||||
item = widget.item(row, col)
|
||||
item.setText(str(value))
|
||||
self.shift_scale(widget, mode, row, col-1, value)
|
||||
|
||||
def glob_shift(self, direction: str):
|
||||
if direction == 'h':
|
||||
val = self.x_shift_spinbox.value()
|
||||
self.glob_shift_scale(self.shift_table, 0, 1, val)
|
||||
else:
|
||||
val = self.y_shift_spinbox.value()
|
||||
self.glob_shift_scale(self.shift_table, 0, 2, val)
|
||||
|
||||
def glob_scale(self, direction: str):
|
||||
if direction == 'h':
|
||||
val = self.x_scale_spinbox.value()
|
||||
self.glob_shift_scale(self.scale_table, 1, 1, val)
|
||||
else:
|
||||
val = self.y_scale_spinbox.value()
|
||||
self.glob_shift_scale(self.scale_table, 1, 2, val)
|
||||
|
||||
def shift_scale(self, widget: QtWidgets.QTableWidget, mode: int,
|
||||
row: int, col: int, value: float):
|
||||
item = widget.item(row, 0)
|
||||
key = item.data(QtCore.Qt.UserRole)
|
||||
self.movements[key][mode][col] = value
|
||||
|
||||
(x_off, y_off), (x_scale, y_scale) = self.movements[key]
|
||||
|
||||
pl, x, y = self.data[key]
|
||||
y_part = [np.real, np.imag]
|
||||
for i, item in enumerate(pl):
|
||||
item.setData(x=x*x_scale+x_off, y=y_part[i](y) * y_scale + y_off)
|
||||
|
||||
@QtCore.pyqtSlot(int, int, float)
|
||||
def shift(self, row: int, column: int, value: float):
|
||||
self.shift_scale(self.shift_table, 0, row, column-1, value)
|
||||
|
||||
@QtCore.pyqtSlot(int, int, float)
|
||||
def scale(self, row: int, column: int, value: float):
|
||||
self.shift_scale(self.scale_table, 1, row, column-1, value)
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_xlog_checkbox_stateChanged')
|
||||
@QtCore.pyqtSlot(int, name='on_ylog_checkbox_stateChanged')
|
||||
def set_log(self, state: int):
|
||||
if self.sender() == self.xlog_checkbox:
|
||||
log_state = self.graphicsView.plotItem.ctrl.logXCheck
|
||||
else:
|
||||
log_state = self.graphicsView.plotItem.ctrl.logYCheck
|
||||
log_state.setCheckState(state)
|
||||
self.graphicsView.plotItem.updateLogMode()
|
||||
|
||||
def on_overwrite_checkbox_stateChanged(self, state: int):
|
||||
self.data_newgraph.setVisible(state != QtCore.Qt.Checked)
|
||||
self.data_combobox.setVisible(state != QtCore.Qt.Checked)
|
||||
|
||||
def on_value_checkbox_stateChanged(self, state: int):
|
||||
self.values_newgraph.setVisible(state == QtCore.Qt.Checked)
|
||||
self.values_combobox.setVisible(state == QtCore.Qt.Checked)
|
||||
|
||||
def on_data_newgraph_stateChanged(self, state: int):
|
||||
self.data_combobox.setEnabled(state != QtCore.Qt.Checked)
|
||||
|
||||
def on_values_newgraph_stateChanged(self, state: int):
|
||||
self.values_combobox.setEnabled(state != QtCore.Qt.Checked)
|
||||
|
||||
def accept(self):
|
||||
data_saving = None
|
||||
if not self.overwrite_checkbox.isChecked():
|
||||
if self.data_newgraph.isChecked():
|
||||
data_saving = ''
|
||||
else:
|
||||
data_saving = self.data_combobox.currentData()
|
||||
|
||||
value_saving = None
|
||||
if self.value_checkbox.isChecked():
|
||||
if self.values_newgraph.isChecked():
|
||||
value_saving = ''
|
||||
else:
|
||||
value_saving = self.values_combobox.currentData()
|
||||
|
||||
self.valuesChanged.emit(self.movements, (data_saving, value_saving))
|
||||
self.close()
|
||||
|
||||
|
||||
class SpinBoxDelegate(QtWidgets.QStyledItemDelegate):
|
||||
valueChanged = QtCore.pyqtSignal(int, int, float)
|
||||
|
||||
def createEditor(self, parent: QtWidgets.QWidget, option: QtWidgets.QStyleOptionViewItem,
|
||||
idx: QtCore.QModelIndex) -> QtWidgets.QWidget:
|
||||
editor = SciSpinBox(parent)
|
||||
editor.valueChanged.connect(self.new_value)
|
||||
|
||||
return editor
|
||||
|
||||
def new_value(self, val):
|
||||
# geht bestimmt besser...
|
||||
table = self.sender().parent().parent()
|
||||
self.valueChanged.emit(table.currentRow(), table.currentColumn(), val)
|
2
src/gui_qt/data/signaledit/__init__.py
Normal file
2
src/gui_qt/data/signaledit/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
from .phase_dialog import QApodDialog, QPhasedialog
|
||||
from .baseline_dialog import QBaselineDialog
|
94
src/gui_qt/data/signaledit/baseline_dialog.py
Normal file
94
src/gui_qt/data/signaledit/baseline_dialog.py
Normal file
@ -0,0 +1,94 @@
|
||||
import numpy as np
|
||||
import pyqtgraph as pg
|
||||
|
||||
from scipy.interpolate import splrep, splev
|
||||
|
||||
from ...Qt import QtCore, QtWidgets
|
||||
from ..._py.baseline_dialog import Ui_SignalEdit
|
||||
|
||||
|
||||
class QBaselineDialog(QtWidgets.QDialog, Ui_SignalEdit):
|
||||
finished = QtCore.pyqtSignal(str, tuple)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.data = None
|
||||
|
||||
self.graph = pg.PlotDataItem(x=[], y=[], pen=pg.mkPen({'color': 'b'}), name='Original')
|
||||
self.graph_corr = pg.PlotDataItem(x=[], y=[], pen=pg.mkPen({'color': 'r'}), name='Corrected')
|
||||
self.baseline = pg.PlotDataItem(x=[], y=[], name='Baseline')
|
||||
|
||||
self.anchors = []
|
||||
self.anchor_lines = []
|
||||
self.spline = None
|
||||
|
||||
self.legend = self.graphicsView.addLegend()
|
||||
|
||||
self.graphicsView.scene().sigMouseClicked.connect(self.add_node)
|
||||
self.graphicsView.addItem(self.graph_corr)
|
||||
self.graphicsView.addItem(self.graph)
|
||||
self.graphicsView.addItem(self.baseline)
|
||||
|
||||
def add_data(self, x, y):
|
||||
if self.data is not None:
|
||||
QtWidgets.QMessageBox().information(self, 'Invalid number of datasets',
|
||||
'Baseline correction is only working on one set at a time.')
|
||||
self.close()
|
||||
self.anchors.extend([np.min(x), np.max(x)])
|
||||
self.data = (x, y)
|
||||
self.graph.setData(x=x, y=y.real)
|
||||
self.graph_corr.setData(x=x, y=y.real)
|
||||
|
||||
def accept(self):
|
||||
self.finished.emit('bls', (splev(self.data[0], self.spline),))
|
||||
self.close()
|
||||
|
||||
def add_node(self, evt):
|
||||
vb = self.graphicsView.plotItem.vb
|
||||
|
||||
if self.graphicsView.plotItem.sceneBoundingRect().contains(evt.scenePos()) and evt.button() == 1:
|
||||
pos = vb.mapSceneToView(evt.scenePos())
|
||||
x = pos.x()
|
||||
|
||||
self.anchors.append(x)
|
||||
self.anchors.sort()
|
||||
row = self.anchors.index(x)
|
||||
self.listWidget.insertItem(row-1, QtWidgets.QListWidgetItem(str(x)))
|
||||
|
||||
inf_line = pg.InfiniteLine(pos=x)
|
||||
self.anchor_lines.insert(row-1, inf_line)
|
||||
self.graphicsView.addItem(inf_line)
|
||||
|
||||
self.change_baseline()
|
||||
|
||||
def change_baseline(self):
|
||||
if self.data:
|
||||
x, y = self.data
|
||||
|
||||
def mean(xx):
|
||||
return np.mean(y[max(0, np.argmin(abs(x-xx))-5):min(len(x), np.argmin(abs(x-xx))+6)].real)
|
||||
|
||||
y_node = [mean(x_node) for x_node in self.anchors]
|
||||
try:
|
||||
self.spline = splrep(self.anchors, y_node, per=False)
|
||||
except TypeError:
|
||||
self.spline = splrep(self.anchors, y_node, per=False, k=1)
|
||||
|
||||
bl = splev(x, self.spline)
|
||||
|
||||
self.baseline.setData(x=x, y=bl)
|
||||
self.graph_corr.setData(x=x, y=y.real-bl)
|
||||
|
||||
def keyPressEvent(self, evt):
|
||||
if self.listWidget.hasFocus() and evt.key() == QtCore.Qt.Key_Delete:
|
||||
r = self.listWidget.currentRow()
|
||||
self.anchors.pop(r+1)
|
||||
listitem = self.listWidget.takeItem(r)
|
||||
del listitem
|
||||
self.graphicsView.removeItem(self.anchor_lines.pop(r))
|
||||
self.change_baseline()
|
||||
|
||||
else:
|
||||
super().keyPressEvent(evt)
|
92
src/gui_qt/data/signaledit/editsignalwidget.py
Normal file
92
src/gui_qt/data/signaledit/editsignalwidget.py
Normal file
@ -0,0 +1,92 @@
|
||||
from src.nmreval.math import apodization
|
||||
from src.nmreval.lib.importer import find_models
|
||||
from src.nmreval.utils.text import convert
|
||||
|
||||
from ...Qt import QtCore, QtWidgets, QtGui
|
||||
from ...lib.forms import FormWidget
|
||||
from ..._py.editsignalwidget import Ui_Form
|
||||
|
||||
|
||||
class EditSignalWidget(QtWidgets.QWidget, Ui_Form):
|
||||
do_something = QtCore.pyqtSignal(str, tuple)
|
||||
get_values = QtCore.pyqtSignal()
|
||||
preview_triggered = QtCore.pyqtSignal(str)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.apodlist = find_models(apodization)
|
||||
|
||||
self.lineEdit.hide()
|
||||
self.lineEdit.setValidator(QtGui.QDoubleValidator())
|
||||
|
||||
for ap in self.apodlist:
|
||||
self.apodcombobox.addItem(str(ap().name))
|
||||
self.change_apodization(0)
|
||||
|
||||
self.baselinebutton.clicked.connect(lambda: self.apply_changes('bl'))
|
||||
self.zfbutton.clicked.connect(lambda: self.apply_changes('zf'))
|
||||
self.phasebutton.clicked.connect(lambda: self.apply_changes('ph'))
|
||||
self.apodbutton.clicked.connect(lambda: self.apply_changes('ap'))
|
||||
self.leftshiftbutton.clicked.connect(lambda: self.apply_changes('ls'))
|
||||
self.fourierutton.clicked.connect(lambda: self.apply_changes('ft'))
|
||||
|
||||
self.pushButton.clicked.connect(lambda: self.preview_triggered.emit('ap'))
|
||||
self.pushButton_2.clicked.connect(lambda: self.preview_triggered.emit('ph'))
|
||||
|
||||
@QtCore.pyqtSlot(str)
|
||||
def apply_changes(self, sender):
|
||||
if sender in ['bl', 'zf', 'ft']:
|
||||
self.do_something.emit(sender, tuple())
|
||||
|
||||
elif sender == 'ls':
|
||||
if self.comboBox.currentIndex() == 0:
|
||||
_nop = int(self.lsspinBox.text())
|
||||
stype = 'pts'
|
||||
else:
|
||||
try:
|
||||
_nop = float(self.lineEdit.text())
|
||||
except ValueError:
|
||||
_nop = 0.0
|
||||
stype = 'time'
|
||||
self.do_something.emit(sender, (_nop, stype))
|
||||
|
||||
elif sender == 'ap':
|
||||
apodmodel = self.apodlist[self.apodcombobox.currentIndex()]
|
||||
p = [float(x.text()) for x in self.groupBox_3.findChildren(QtWidgets.QLineEdit)]
|
||||
self.do_something.emit(sender, (p, apodmodel))
|
||||
|
||||
elif sender == 'ph':
|
||||
ph0 = float(self.ph0slider.value())
|
||||
ph1 = float(self.ph1slider.value())
|
||||
pvt = float(self.pivot_lineedit.text())
|
||||
self.do_something.emit(sender, (ph0, ph1, pvt))
|
||||
|
||||
else:
|
||||
print('You should never reach this by accident.')
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_apodcombobox_currentIndexChanged')
|
||||
def change_apodization(self, index):
|
||||
apod_func = self.apodlist[index]
|
||||
self.label_2.setText(convert(apod_func.equation))
|
||||
|
||||
while self.verticalLayout_8.count():
|
||||
item = self.verticalLayout_8.takeAt(0)
|
||||
try:
|
||||
item.widget().deleteLater()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
for k, v in enumerate(apod_func.params):
|
||||
widgt = FormWidget(name=v)
|
||||
self.verticalLayout_8.addWidget(widgt)
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_comboBox_currentIndexChanged')
|
||||
def change_ls(self, idx):
|
||||
if idx:
|
||||
self.lineEdit.show()
|
||||
self.lsspinBox.hide()
|
||||
else:
|
||||
self.lineEdit.hide()
|
||||
self.lsspinBox.show()
|
208
src/gui_qt/data/signaledit/phase_dialog.py
Normal file
208
src/gui_qt/data/signaledit/phase_dialog.py
Normal file
@ -0,0 +1,208 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import numpy as np
|
||||
from pyqtgraph import mkPen
|
||||
from numpy import inf, linspace
|
||||
from numpy.fft import fft, fftfreq, fftshift
|
||||
|
||||
from ...lib.pg_objects import PlotItem, LogInfiniteLine
|
||||
from nmreval.lib.importer import find_models
|
||||
from nmreval.math import apodization as apodization
|
||||
from nmreval.utils.text import convert
|
||||
|
||||
from ...Qt import QtCore, QtWidgets
|
||||
from ..._py.apod_dialog import Ui_ApodEdit
|
||||
from ..._py.phase_corr_dialog import Ui_SignalEdit
|
||||
from ...lib.forms import FormWidget
|
||||
|
||||
|
||||
class QPreviewDialogs(QtWidgets.QDialog):
|
||||
finished = QtCore.pyqtSignal(str, tuple)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.data = []
|
||||
self.graphs = []
|
||||
|
||||
self.mode = ''
|
||||
|
||||
def setRange(self, xlim: list, ylim: list, logmode: list[bool]):
|
||||
self.graphicsView.getPlotItem().setLogMode(x=logmode[0], y=logmode[1])
|
||||
if logmode[0]:
|
||||
xlim = [np.log10(x) for x in xlim]
|
||||
if logmode[1]:
|
||||
ylim = [np.log10(y) for y in ylim]
|
||||
|
||||
self.graphicsView.setRange(xRange=xlim, yRange=ylim, padding=0, disableAutoRange=True)
|
||||
|
||||
def add_data(self, x, y):
|
||||
self.data.append((x, y))
|
||||
real_plt = PlotItem(x=x, y=y.real, pen=mkPen('b'), )
|
||||
imag_plt = PlotItem(x=x, y=y.imag, pen=mkPen('r'))
|
||||
self.graphs.append((real_plt, imag_plt))
|
||||
self.graphicsView.addItem(real_plt)
|
||||
self.graphicsView.addItem(imag_plt)
|
||||
|
||||
def done(self, val):
|
||||
self.cleanup()
|
||||
super().done(val)
|
||||
|
||||
def close(self):
|
||||
self.cleanup()
|
||||
super().close()
|
||||
|
||||
def accept(self):
|
||||
self.finished.emit(self.mode, self.get_value())
|
||||
super().accept()
|
||||
|
||||
def get_value(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def cleanup(self):
|
||||
self.blockSignals(True)
|
||||
|
||||
for line in self.graphs:
|
||||
for g in line:
|
||||
self.graphicsView.removeItem(g)
|
||||
del g
|
||||
|
||||
self.graphicsView.clear()
|
||||
|
||||
self.data = []
|
||||
self.graphs = []
|
||||
|
||||
self.blockSignals(False)
|
||||
|
||||
|
||||
class QPhasedialog(QPreviewDialogs, Ui_SignalEdit):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.mode = 'ph'
|
||||
|
||||
self.pvt_line = LogInfiniteLine(pos=0, movable=True)
|
||||
self.graphicsView.addItem(self.pvt_line)
|
||||
self.pvt_line.sigPositionChanged.connect(self.move_line)
|
||||
|
||||
@QtCore.pyqtSlot(float, name='on_ph1slider_valueChanged')
|
||||
@QtCore.pyqtSlot(float, name='on_ph0slider_valueChanged')
|
||||
def _temp_phase(self, *args):
|
||||
ph0, ph1, pvt = self.get_value()
|
||||
self.pvt_line.setValue(pvt)
|
||||
|
||||
for i, (x, y) in enumerate(self.data):
|
||||
phasecorr = np.exp(-1j * (ph0 + ph1*(x-pvt)/np.max(x))*np.pi/180.)
|
||||
_y = y * phasecorr
|
||||
|
||||
self.graphs[i][0].setData(x=x, y=_y.real)
|
||||
self.graphs[i][1].setData(x=x, y=_y.imag)
|
||||
|
||||
def get_value(self):
|
||||
return float(self.ph0slider.text()), float(self.ph1slider.text()), float(self.pivot_lineedit.text())
|
||||
|
||||
def move_line(self, evt):
|
||||
self.pivot_lineedit.setText(str(int(evt.value())))
|
||||
|
||||
|
||||
class QApodDialog(QPreviewDialogs, Ui_ApodEdit):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self._limits = (-inf, inf), -inf
|
||||
|
||||
self.apods = []
|
||||
self.apods = find_models(apodization)
|
||||
|
||||
self.apodcombobox.blockSignals(True)
|
||||
for ap in self.apods:
|
||||
self.apodcombobox.addItem(ap().name)
|
||||
self.apodcombobox.blockSignals(False)
|
||||
|
||||
self.apod_graph = PlotItem(x=[], y=[])
|
||||
self.graphicsView.addItem(self.apod_graph)
|
||||
|
||||
self.mode = 'ap'
|
||||
|
||||
self.change_apodization(0)
|
||||
|
||||
def add_data(self, x, y):
|
||||
real_plt = PlotItem(x=x, y=y.real, pen=mkPen('b'))
|
||||
# imag_plt = (x=x, y=y.imag, pen=pg.mkPen('r'))
|
||||
self.graphicsView.addItem(real_plt)
|
||||
# self.graphicsView.addItem(imag_plt)
|
||||
|
||||
y_fft = fftshift(fft(y))
|
||||
x_fft = fftshift(fftfreq(len(x), d=x[1]-x[0]))
|
||||
real_plt_fft = PlotItem(x=x_fft, y=y_fft.real, pen=mkPen('b'))
|
||||
# imag_plt_fft = pg.PlotDataItem(x=x_fft, y=y_fft.imag, pen=pg.mkPen('b'))
|
||||
self.graphicsView_2.addItem(real_plt_fft)
|
||||
# self.graphicsView_2.addItem(imag_plt_fft)
|
||||
|
||||
self.graphs.append((real_plt, real_plt_fft))
|
||||
self.data.append((x, y, x_fft))
|
||||
|
||||
xlimits = (max(x.min(), self._limits[0][0]), min(x.max(), self._limits[0][1]))
|
||||
ylimit = max(self._limits[1], y.real.max())
|
||||
self._limits = xlimits, ylimit
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_apodcombobox_currentIndexChanged')
|
||||
def change_apodization(self, index):
|
||||
# delete old widgets
|
||||
self.eqn_label.setText(convert(self.apods[index].equation))
|
||||
while self.widget_layout.count():
|
||||
item = self.widget_layout.takeAt(0)
|
||||
try:
|
||||
item.widget().deleteLater()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
# set up parameter widgets for new model
|
||||
for k, v in enumerate(self.apods[index]().params):
|
||||
widgt = FormWidget(name=v)
|
||||
widgt.valueChanged.connect(self._temp_apod)
|
||||
self.widget_layout.addWidget(widgt)
|
||||
|
||||
self.widget_layout.addStretch()
|
||||
self._temp_apod()
|
||||
|
||||
def _temp_apod(self):
|
||||
apodmodel = self.apods[self.apodcombobox.currentIndex()]
|
||||
p = self._get_parameter()
|
||||
|
||||
if self.data:
|
||||
for i, (x, y, x_fft) in enumerate(self.data):
|
||||
y2 = apodmodel.apod(x, *p)
|
||||
_y = y2 * y
|
||||
self.graphs[i][0].setData(x=x, y=_y.real)
|
||||
# self.graphs[i][1].setData(y=_y.imag)
|
||||
y_fft = fftshift(fft(_y))
|
||||
self.graphs[i][1].setData(x=x_fft, y=y_fft.real)
|
||||
# self.graphs[i][3].setData(y=y_fft.imag)
|
||||
|
||||
_x_apod = linspace(self._limits[0][0], self._limits[0][1])
|
||||
try:
|
||||
_y_apod = apodmodel.apod(_x_apod, *p)
|
||||
self.apod_graph.setData(x=_x_apod, y=self._limits[1]*_y_apod)
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
def _get_parameter(self):
|
||||
p = []
|
||||
for i in range(self.widget_layout.count()):
|
||||
item = self.widget_layout.itemAt(i)
|
||||
w = item.widget()
|
||||
try:
|
||||
p.append(w.value)
|
||||
except AttributeError:
|
||||
continue
|
||||
|
||||
return p
|
||||
|
||||
def get_value(self):
|
||||
apodmodel = self.apods[self.apodcombobox.currentIndex()]
|
||||
p = self._get_parameter()
|
||||
|
||||
return p, apodmodel
|
357
src/gui_qt/data/valueeditwidget.py
Normal file
357
src/gui_qt/data/valueeditwidget.py
Normal file
@ -0,0 +1,357 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import numpy as np
|
||||
|
||||
from ..Qt import QtGui, QtCore, QtWidgets
|
||||
from .._py.valueeditor import Ui_MaskDialog
|
||||
|
||||
|
||||
class ValueEditWidget(QtWidgets.QWidget, Ui_MaskDialog):
|
||||
requestData = QtCore.pyqtSignal(str)
|
||||
maskSignal = QtCore.pyqtSignal(str, list)
|
||||
itemChanged = QtCore.pyqtSignal(str, tuple, object)
|
||||
itemDeleted = QtCore.pyqtSignal(str, list)
|
||||
itemAdded = QtCore.pyqtSignal(str)
|
||||
values_selected = QtCore.pyqtSignal(str, list, list)
|
||||
split_signal = QtCore.pyqtSignal(str, int)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.setupUi(self)
|
||||
|
||||
self.connected_figure = None
|
||||
self.shown_set = None
|
||||
self.items = {}
|
||||
|
||||
self.model = ValueModel()
|
||||
self.model.itemChanged.connect(self.update_items)
|
||||
|
||||
self.selection_model = QtCore.QItemSelectionModel(self.model)
|
||||
self.selection_model.selectionChanged.connect(self.show_position)
|
||||
|
||||
self.tableView.setModel(self.model)
|
||||
self.tableView.setSelectionModel(self.selection_model)
|
||||
self.tableView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||
self.tableView.customContextMenuRequested.connect(self.ctx)
|
||||
|
||||
self.graph_combobox.currentIndexChanged.connect(self._populate_sets)
|
||||
self.set_combobox.currentIndexChanged.connect(self._populate_table)
|
||||
|
||||
def __call__(self, items: dict):
|
||||
self.items = items
|
||||
|
||||
self.graph_combobox.blockSignals(True)
|
||||
self.graph_combobox.clear()
|
||||
for k, v in items.items():
|
||||
self.graph_combobox.addItem(k[1], userData=k[0])
|
||||
self.graph_combobox.blockSignals(False)
|
||||
|
||||
idx = self.graph_combobox.findData(self.connected_figure)
|
||||
if idx == -1:
|
||||
idx = 0
|
||||
|
||||
self.graph_combobox.setCurrentIndex(idx)
|
||||
self.graph_combobox.currentIndexChanged.emit(idx)
|
||||
|
||||
return self
|
||||
|
||||
@QtCore.pyqtSlot(int)
|
||||
def _populate_sets(self, idx: int):
|
||||
if idx == -1:
|
||||
self.graph_combobox.setCurrentIndex(0)
|
||||
return
|
||||
|
||||
self.set_combobox.blockSignals(True)
|
||||
self.set_combobox.clear()
|
||||
self.connected_figure = self.graph_combobox.currentData()
|
||||
|
||||
if self.items:
|
||||
for sid, name in self.items[(self.graph_combobox.currentData(), self.graph_combobox.currentText())]:
|
||||
self.set_combobox.addItem(name, userData=sid)
|
||||
self.set_combobox.blockSignals(False)
|
||||
|
||||
sidx = self.set_combobox.findData(self.shown_set)
|
||||
if sidx == -1:
|
||||
sidx = 0
|
||||
|
||||
self.set_combobox.setCurrentIndex(sidx)
|
||||
self.set_combobox.currentIndexChanged.emit(sidx)
|
||||
|
||||
@QtCore.pyqtSlot(int)
|
||||
def _populate_table(self, idx):
|
||||
self.selection_model.clearSelection()
|
||||
self.shown_set = self.set_combobox.itemData(idx)
|
||||
self.requestData.emit(self.set_combobox.itemData(idx))
|
||||
|
||||
def set_data(self, data: list, mask: np.ndarray):
|
||||
self.selection_model.clearSelection()
|
||||
self.model.loadData(data, mask)
|
||||
self.spinBox.setMaximum(self.model.rowCount())
|
||||
|
||||
def remove_graph(self):
|
||||
# remove everything
|
||||
self.connected_figure = None
|
||||
self.items = {}
|
||||
self.selection_model.clear()
|
||||
while self.model.rowCount():
|
||||
self.model.removeRow(0)
|
||||
self.graph_combobox.clear()
|
||||
self.set_combobox.clear()
|
||||
|
||||
def ctx(self, pos: QtCore.QPoint):
|
||||
idx = self.tableView.indexAt(pos)
|
||||
if not idx.isValid():
|
||||
return
|
||||
|
||||
menu = QtWidgets.QMenu()
|
||||
menu.addSeparator()
|
||||
|
||||
hide_action = menu.addAction('Hide/Show')
|
||||
del_action = menu.addAction('Delete')
|
||||
split_action = menu.addAction('Split after selection')
|
||||
cpc_action = menu.addAction('Copy to clipboard')
|
||||
action = menu.exec(self.tableView.viewport().mapToGlobal(pos))
|
||||
|
||||
if action == hide_action:
|
||||
self.mask_row()
|
||||
elif action == del_action:
|
||||
self.delete_item()
|
||||
elif action == cpc_action:
|
||||
self.copy_selection()
|
||||
elif action == split_action:
|
||||
self.split()
|
||||
|
||||
def keyPressEvent(self, evt):
|
||||
if evt.matches(QtGui.QKeySequence.Copy):
|
||||
self.copy_selection()
|
||||
elif evt.key() == QtCore.Qt.Key_Delete:
|
||||
self.delete_item()
|
||||
else:
|
||||
super().keyPressEvent(evt)
|
||||
|
||||
def copy_selection(self) -> str:
|
||||
table = ''
|
||||
for r in self.selection_model.selectedRows():
|
||||
table += self.model.data(r) + '\t'
|
||||
table += '\t'.join([self.model.data(r.sibling(r.row(), i)) for i in [1, 2]]) + '\n'
|
||||
|
||||
QtWidgets.QApplication.clipboard().setText(table)
|
||||
|
||||
return table
|
||||
|
||||
@QtCore.pyqtSlot(name='on_split_button_clicked')
|
||||
def split(self):
|
||||
self.split_signal.emit(self.set_combobox.currentData(),
|
||||
self.selection_model.selectedRows()[-1].row()+1)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_mask_button_clicked')
|
||||
def mask_row(self):
|
||||
for r in self.selection_model.selectedRows():
|
||||
self.model.setData(r, not self.model.data(r, ValueModel.maskRole), ValueModel.maskRole)
|
||||
self.maskSignal.emit(self.set_combobox.currentData(), self.model.mask)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_unmaskbutton_clicked')
|
||||
def unmask(self):
|
||||
self.model.unmask()
|
||||
self.maskSignal.emit(self.set_combobox.currentData(), self.model.mask)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_delete_button_clicked')
|
||||
def delete_item(self):
|
||||
idx = [r.row() for r in self.selection_model.selectedRows()]
|
||||
success = False
|
||||
for i in sorted(idx, reverse=True):
|
||||
success = self.model.removeRow(i)
|
||||
|
||||
if success:
|
||||
self.itemDeleted.emit(self.set_combobox.currentData(), idx)
|
||||
self.spinBox.setMaximum(self.spinBox.maximum()-len(idx))
|
||||
|
||||
@QtCore.pyqtSlot(name='on_add_button_clicked')
|
||||
def new_value(self):
|
||||
success = self.model.addRows()
|
||||
if success:
|
||||
self.spinBox.setMaximum(self.spinBox.maximum()+1)
|
||||
self.itemAdded.emit(self.set_combobox.currentData())
|
||||
|
||||
@QtCore.pyqtSlot(int, int, str)
|
||||
def update_items(self, col, row, val):
|
||||
sid = self.set_combobox.currentData()
|
||||
new_value = complex(val)
|
||||
new_value = new_value.real if new_value.imag == 0 else new_value
|
||||
|
||||
self.itemChanged.emit(sid, (col, row), new_value)
|
||||
|
||||
@QtCore.pyqtSlot(QtCore.QItemSelection, QtCore.QItemSelection)
|
||||
def show_position(self, *_):
|
||||
xvals = []
|
||||
yvals = []
|
||||
for idx in self.selection_model.selectedRows():
|
||||
xvals.append(float(self.model.data(idx)))
|
||||
try:
|
||||
yvals.append(float(self.model.data(idx.sibling(idx.row(), 1))))
|
||||
except ValueError:
|
||||
yvals.append(complex(self.model.data(idx.sibling(idx.row(), 1))).real)
|
||||
|
||||
self.values_selected.emit(self.connected_figure, xvals, yvals)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_toolButton_clicked')
|
||||
def goto(self):
|
||||
self.tableView.scrollTo(self.model.index(self.spinBox.value()-1, 0))
|
||||
|
||||
|
||||
class ValueModel(QtCore.QAbstractTableModel):
|
||||
"""
|
||||
TableModel with lazy loading
|
||||
"""
|
||||
itemChanged = QtCore.pyqtSignal(int, int, str)
|
||||
load_number = 20
|
||||
maskRole = QtCore.Qt.UserRole+321
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self._data = None
|
||||
self.total_rows = 0
|
||||
self.rows_loaded = 0
|
||||
self.mask = None
|
||||
self.headers = ['x', 'y', '\u0394y']
|
||||
for i, hd in enumerate(self.headers):
|
||||
self.setHeaderData(i, QtCore.Qt.Horizontal, hd)
|
||||
|
||||
def rowCount(self, *args, **kwargs) -> int:
|
||||
return self.total_rows
|
||||
|
||||
def columnCount(self, *args, **kwargs) -> int:
|
||||
return len(self.headers)
|
||||
|
||||
def loadData(self, data: list[np.ndarray], mask: np.ndarray):
|
||||
self.beginResetModel()
|
||||
self._data = []
|
||||
for x, y, y_err in zip(*data):
|
||||
self._data.append([x, y, y_err])
|
||||
self.total_rows = len(self._data)
|
||||
|
||||
self.mask = mask.tolist()
|
||||
|
||||
self.endResetModel()
|
||||
self.dataChanged.emit(self.index(0, 0), self.index(0, 1), [QtCore.Qt.DisplayRole])
|
||||
|
||||
def data(self, idx: QtCore.QModelIndex, role=QtCore.Qt.DisplayRole) -> Any:
|
||||
if not idx.isValid():
|
||||
return
|
||||
|
||||
row = idx.row()
|
||||
if role in [QtCore.Qt.DisplayRole, QtCore.Qt.EditRole]:
|
||||
val = self._data[row][idx.column()]
|
||||
if isinstance(val, complex):
|
||||
return f'{val.real:.8g}{val.imag:+.8g}j'
|
||||
else:
|
||||
return f'{val:.8g}'
|
||||
|
||||
elif role == QtCore.Qt.BackgroundRole:
|
||||
pal = QtGui.QGuiApplication.palette()
|
||||
if not self.mask[row]:
|
||||
return pal.color(QtGui.QPalette.Disabled, QtGui.QPalette.Base)
|
||||
else:
|
||||
return pal.color(QtGui.QPalette.Base)
|
||||
|
||||
elif role == QtCore.Qt.ForegroundRole:
|
||||
pal = QtGui.QGuiApplication.palette()
|
||||
if not self.mask[row]:
|
||||
return pal.color(QtGui.QPalette.Disabled, QtGui.QPalette.Text)
|
||||
else:
|
||||
return pal.color(QtGui.QPalette.Text)
|
||||
|
||||
elif role == ValueModel.maskRole:
|
||||
return self.mask[row]
|
||||
|
||||
else:
|
||||
return
|
||||
|
||||
def setData(self, idx: QtCore.QModelIndex, value: str | bool, role=QtCore.Qt.DisplayRole) -> Any:
|
||||
col, row = idx.column(), idx.row()
|
||||
|
||||
if role == ValueModel.maskRole:
|
||||
self.mask[row] = bool(value)
|
||||
self.dataChanged.emit(self.index(0, 0), self.index(0, 1), [role])
|
||||
|
||||
return True
|
||||
|
||||
if value:
|
||||
if role == QtCore.Qt.EditRole:
|
||||
try:
|
||||
value = complex(value)
|
||||
except ValueError:
|
||||
# not a number
|
||||
return False
|
||||
self._data[row][col] = value.real if value.imag == 0 else value
|
||||
self.itemChanged.emit(col, row, str(value))
|
||||
self.dataChanged.emit(self.index(0, 0), self.index(0, 1), [role])
|
||||
|
||||
else:
|
||||
return super().setData(idx, value, role=role)
|
||||
|
||||
return True
|
||||
|
||||
else:
|
||||
return False
|
||||
|
||||
def headerData(self, section: int, orientation, role=QtCore.Qt.DisplayRole) -> Any:
|
||||
if role == QtCore.Qt.DisplayRole:
|
||||
if orientation == QtCore.Qt.Horizontal:
|
||||
return self.headers[section]
|
||||
else:
|
||||
return str(section+1)
|
||||
|
||||
return
|
||||
|
||||
def canFetchMore(self, idx: QtCore.QModelIndex) -> bool:
|
||||
if not idx.isValid():
|
||||
return False
|
||||
|
||||
return self.total_rows > self.rows_loaded
|
||||
|
||||
def fetchMore(self, idx: QtCore.QModelIndex):
|
||||
remaining = self.total_rows - self.rows_loaded
|
||||
to_be_loaded = min(remaining, ValueModel.load_number)
|
||||
|
||||
self.beginInsertRows(QtCore.QModelIndex(), self.rows_loaded, self.rows_loaded + to_be_loaded - 1)
|
||||
self.rows_loaded += to_be_loaded
|
||||
self.endInsertRows()
|
||||
|
||||
def flags(self, idx: QtCore.QModelIndex) -> QtCore.Qt.ItemFlag:
|
||||
return QtCore.QAbstractTableModel.flags(self, idx) | QtCore.Qt.ItemIsEditable
|
||||
|
||||
def removeRows(self, pos: int, rows: int, parent=None, *args, **kwargs) -> bool:
|
||||
self.beginRemoveRows(parent, pos, pos+rows-1)
|
||||
|
||||
for _ in range(rows):
|
||||
self._data.pop(pos)
|
||||
self.mask.pop(pos)
|
||||
|
||||
self.endRemoveRows()
|
||||
self.total_rows -= rows
|
||||
|
||||
return True
|
||||
|
||||
def addRows(self, num=1):
|
||||
return self.insertRows(self.rowCount(), num)
|
||||
|
||||
def insertRows(self, pos: int, rows: int, parent=QtCore.QModelIndex(), *args, **kwargs):
|
||||
self.beginInsertRows(parent, pos, pos+rows-1)
|
||||
|
||||
for _ in range(rows):
|
||||
self._data.insert(pos, [0.0] * self.columnCount())
|
||||
self.mask.insert(pos, True)
|
||||
self.total_rows += rows
|
||||
|
||||
self.endInsertRows()
|
||||
|
||||
return True
|
||||
|
||||
def unmask(self):
|
||||
self.mask = [True] * self.total_rows
|
||||
self.dataChanged.emit(self.index(0, 0), self.index(0, 1), [ValueModel.maskRole])
|
0
src/gui_qt/fit/__init__.py
Normal file
0
src/gui_qt/fit/__init__.py
Normal file
460
src/gui_qt/fit/fit_forms.py
Normal file
460
src/gui_qt/fit/fit_forms.py
Normal file
@ -0,0 +1,460 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from nmreval.utils.text import convert
|
||||
|
||||
from ..Qt import QtCore, QtWidgets, QtGui
|
||||
from .._py.fitmodelwidget import Ui_FitParameter
|
||||
from .._py.save_fitmodel_dialog import Ui_SaveDialog
|
||||
from ..lib import get_icon
|
||||
|
||||
|
||||
class FitModelWidget(QtWidgets.QWidget, Ui_FitParameter):
|
||||
value_requested = QtCore.pyqtSignal(object)
|
||||
value_changed = QtCore.pyqtSignal(str)
|
||||
state_changed = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, label: str = 'Fitparameter', parent=None, fixed: bool = False):
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.parametername.setText(label + ' ')
|
||||
|
||||
validator = QtGui.QDoubleValidator()
|
||||
validator.setDecimals(9)
|
||||
self.parameter_line.setValidator(validator)
|
||||
self.parameter_line.setText('1')
|
||||
self.parameter_line.setMaximumWidth(60)
|
||||
self.lineEdit.setMaximumWidth(60)
|
||||
self.lineEdit_2.setMaximumWidth(60)
|
||||
|
||||
self.label_3.setText(f'< {label} <')
|
||||
|
||||
self.checkBox.stateChanged.connect(self.enableBounds)
|
||||
self.global_checkbox.stateChanged.connect(lambda: self.state_changed.emit())
|
||||
self.parameter_line.values_requested.connect(lambda: self.value_requested.emit(self))
|
||||
self.parameter_line.editingFinished.connect(lambda: self.value_changed.emit(self.parameter_line.text()))
|
||||
self.fixed_check.toggled.connect(self.set_fixed)
|
||||
|
||||
if fixed:
|
||||
self.fixed_check.hide()
|
||||
|
||||
self.menu = QtWidgets.QMenu(self)
|
||||
self.add_links()
|
||||
|
||||
self.is_linked = None
|
||||
self.parameter_pos = None
|
||||
self.func_idx = None
|
||||
|
||||
self._linetext = '1'
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return convert(self.parametername.text().strip(), old='html', new='str')
|
||||
|
||||
def set_parameter_string(self, p: str):
|
||||
self.parameter_line.setText(p)
|
||||
self.parameter_line.setToolTip(p)
|
||||
|
||||
def set_bounds(self, lb: float, ub: float, cbox: bool = True):
|
||||
self.checkBox.setCheckState(QtCore.Qt.Checked if cbox else QtCore.Qt.Unchecked)
|
||||
for val, bds_line in [(lb, self.lineEdit), (ub, self.lineEdit_2)]:
|
||||
if val is not None:
|
||||
bds_line.setText(str(val))
|
||||
else:
|
||||
bds_line.setText('')
|
||||
|
||||
def enableBounds(self, value: int):
|
||||
self.lineEdit.setEnabled(value == 2)
|
||||
self.lineEdit_2.setEnabled(value == 2)
|
||||
|
||||
def set_parameter(self, p: float | None, bds: tuple[float, float, bool] = None,
|
||||
fixed: bool = None, glob: bool = None):
|
||||
if p is None:
|
||||
# bad hack: linked parameter return (None, linked parameter)
|
||||
# if p is None -> parameter is linked to argument given by bds
|
||||
self.link_parameter(linkto=bds)
|
||||
else:
|
||||
ptext = f'{p:.4g}'
|
||||
|
||||
self.set_parameter_string(ptext)
|
||||
|
||||
if bds is not None:
|
||||
self.set_bounds(*bds)
|
||||
|
||||
if fixed is not None:
|
||||
self.fixed_check.setCheckState(QtCore.Qt.Unchecked if fixed else QtCore.Qt.Checked)
|
||||
|
||||
if glob is not None:
|
||||
self.global_checkbox.setCheckState(QtCore.Qt.Checked if glob else QtCore.Qt.Unchecked)
|
||||
|
||||
def get_parameter(self):
|
||||
if self.is_linked:
|
||||
try:
|
||||
p = float(self._linetext)
|
||||
except ValueError:
|
||||
p = 1.0
|
||||
else:
|
||||
try:
|
||||
p = float(self.parameter_line.text().replace(',', '.'))
|
||||
except ValueError:
|
||||
_ = QtWidgets.QMessageBox().warning(self, 'Invalid value',
|
||||
f'{self.parametername.text()} contains invalid values',
|
||||
QtWidgets.QMessageBox.Cancel)
|
||||
return None
|
||||
|
||||
if self.checkBox.isChecked():
|
||||
try:
|
||||
lb = float(self.lineEdit.text().replace(',', '.'))
|
||||
except ValueError:
|
||||
lb = None
|
||||
|
||||
try:
|
||||
rb = float(self.lineEdit_2.text().replace(',', '.'))
|
||||
except ValueError:
|
||||
rb = None
|
||||
else:
|
||||
lb = rb = None
|
||||
|
||||
bounds = (lb, rb)
|
||||
|
||||
return p, bounds, not self.fixed_check.isChecked(), self.global_checkbox.isChecked(), self.is_linked
|
||||
|
||||
@QtCore.pyqtSlot(bool)
|
||||
def set_fixed(self, state: bool):
|
||||
# self.global_checkbox.setVisible(not state)
|
||||
self.frame.setVisible(not state)
|
||||
|
||||
def add_links(self, parameter: dict = None):
|
||||
if parameter is None:
|
||||
parameter = {}
|
||||
self.menu.clear()
|
||||
|
||||
ac = QtWidgets.QAction('Link to...', self)
|
||||
ac.triggered.connect(self.link_parameter)
|
||||
self.menu.addAction(ac)
|
||||
|
||||
for model_key, model_funcs in parameter.items():
|
||||
m = QtWidgets.QMenu('Model ' + model_key, self)
|
||||
for func_name, func_params in model_funcs.items():
|
||||
m2 = QtWidgets.QMenu(func_name, m)
|
||||
for p_name, idx in func_params:
|
||||
ac = QtWidgets.QAction(p_name, m2)
|
||||
ac.setData((model_key, *idx))
|
||||
ac.triggered.connect(self.link_parameter)
|
||||
m2.addAction(ac)
|
||||
m.addMenu(m2)
|
||||
self.menu.addMenu(m)
|
||||
|
||||
self.toolButton.setMenu(self.menu)
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def link_parameter(self, linkto=None):
|
||||
if linkto is None:
|
||||
action = self.sender()
|
||||
else:
|
||||
action = False
|
||||
for m in self.menu.actions():
|
||||
if m.menu():
|
||||
for a in m.menu().actions():
|
||||
if a.data() == linkto:
|
||||
action = a
|
||||
break
|
||||
if action:
|
||||
break
|
||||
|
||||
if (self.func_idx, self.parameter_pos) == action.data():
|
||||
return
|
||||
|
||||
try:
|
||||
new_text = f'Linked to {action.parentWidget().title()}.{action.text()}'
|
||||
self._linetext = self.parameter_line.text()
|
||||
self.parameter_line.setText(new_text)
|
||||
self.parameter_line.setEnabled(False)
|
||||
self.global_checkbox.hide()
|
||||
self.global_checkbox.blockSignals(True)
|
||||
self.global_checkbox.setCheckState(QtCore.Qt.Checked)
|
||||
self.global_checkbox.blockSignals(False)
|
||||
self.frame.hide()
|
||||
self.is_linked = action.data()
|
||||
|
||||
except AttributeError:
|
||||
self.parameter_line.setText(self._linetext)
|
||||
self.parameter_line.setEnabled(True)
|
||||
if self.fixed_check.isEnabled():
|
||||
self.global_checkbox.show()
|
||||
self.frame.show()
|
||||
self.is_linked = None
|
||||
|
||||
self.state_changed.emit()
|
||||
|
||||
|
||||
class QSaveModelDialog(QtWidgets.QDialog, Ui_SaveDialog):
|
||||
def __init__(self, types=None, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
if types is None:
|
||||
types = []
|
||||
|
||||
self.comboBox.blockSignals(True)
|
||||
self.comboBox.addItems(types)
|
||||
self.comboBox.addItem('New group...')
|
||||
self.comboBox.blockSignals(False)
|
||||
|
||||
self.frame.hide()
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_comboBox_currentIndexChanged')
|
||||
def new_group(self, idx: int):
|
||||
if idx == self.comboBox.count() - 1:
|
||||
self.frame.show()
|
||||
else:
|
||||
self.lineEdit_2.clear()
|
||||
self.frame.hide()
|
||||
|
||||
@QtCore.pyqtSlot(name='on_toolButton_clicked')
|
||||
def accept_group(self):
|
||||
self.comboBox.insertItem(self.comboBox.count() - 1, self.lineEdit_2.text())
|
||||
self.comboBox.setCurrentIndex(self.comboBox.count() - 2)
|
||||
|
||||
def accept(self):
|
||||
if self.lineEdit.text():
|
||||
self.close()
|
||||
|
||||
|
||||
class FitModelTree(QtWidgets.QTreeWidget):
|
||||
icons = ['plus', 'mal_icon', 'minus_icon', 'geteilt_icon']
|
||||
|
||||
treeChanged = QtCore.pyqtSignal()
|
||||
itemRemoved = QtCore.pyqtSignal(int)
|
||||
|
||||
counterRole = QtCore.Qt.UserRole + 1
|
||||
operatorRole = QtCore.Qt.UserRole + 2
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setHeaderHidden(True)
|
||||
self.setDragEnabled(True)
|
||||
self.setDragDropMode(QtWidgets.QTreeWidget.InternalMove)
|
||||
self.setDefaultDropAction(QtCore.Qt.MoveAction)
|
||||
|
||||
self.itemSelectionChanged.connect(lambda: self.treeChanged.emit())
|
||||
|
||||
def keyPressEvent(self, evt):
|
||||
operators = [QtCore.Qt.Key_Plus, QtCore.Qt.Key_Asterisk,
|
||||
QtCore.Qt.Key_Minus, QtCore.Qt.Key_Slash]
|
||||
|
||||
if evt.key() == QtCore.Qt.Key_Delete:
|
||||
for item in self.selectedItems():
|
||||
self.remove_function(item)
|
||||
|
||||
elif evt.key() == QtCore.Qt.Key_Space:
|
||||
for item in self.treeWidget.selectedItems():
|
||||
item.setCheckState(0, QtCore.Qt.Checked) if item.checkState(
|
||||
0) == QtCore.Qt.Unchecked else item.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
|
||||
elif evt.key() in operators:
|
||||
idx = operators.index(evt.key())
|
||||
for item in self.selectedItems():
|
||||
item.setData(0, self.operatorRole, idx)
|
||||
item.setIcon(0, get_icon(self.icons[idx]))
|
||||
|
||||
else:
|
||||
super().keyPressEvent(evt)
|
||||
|
||||
def dropEvent(self, evt: QtGui.QDropEvent):
|
||||
super().dropEvent(evt)
|
||||
self.treeChanged.emit()
|
||||
|
||||
def remove_function(self, item: QtWidgets.QTreeWidgetItem):
|
||||
"""
|
||||
Remove function and children from tree and dictionary
|
||||
"""
|
||||
while item.childCount():
|
||||
self.remove_function(item.child(0))
|
||||
|
||||
if item.parent():
|
||||
item.parent().removeChild(item)
|
||||
else:
|
||||
self.invisibleRootItem().removeChild(item)
|
||||
|
||||
idx = item.data(0, self.counterRole)
|
||||
self.itemRemoved.emit(idx)
|
||||
|
||||
def add_function(self, idx: int, cnt: int, op: int, name: str, color: QtGui.QColor | str | tuple,
|
||||
parent: QtWidgets.QTreeWidgetItem = None, children: list = None, active: bool = True, **kwargs):
|
||||
"""
|
||||
Add function to tree and dictionary of functions.
|
||||
"""
|
||||
if not isinstance(color, QtGui.QColor):
|
||||
if isinstance(color, tuple):
|
||||
color = QtGui.QColor.fromRgbF(*color)
|
||||
else:
|
||||
color = QtGui.QColor(color)
|
||||
|
||||
it = QtWidgets.QTreeWidgetItem()
|
||||
it.setData(0, QtCore.Qt.UserRole, idx)
|
||||
it.setData(0, self.counterRole, cnt)
|
||||
it.setData(0, self.operatorRole, op)
|
||||
it.setText(0, name)
|
||||
it.setForeground(0, QtGui.QBrush(color))
|
||||
|
||||
it.setIcon(0, get_icon(self.icons[op]))
|
||||
it.setCheckState(0, QtCore.Qt.Checked if active else QtCore.Qt.Unchecked)
|
||||
|
||||
if parent is None:
|
||||
self.addTopLevelItem(it)
|
||||
else:
|
||||
parent.addChild(it)
|
||||
|
||||
if children is not None:
|
||||
for c in children:
|
||||
self.add_function(**c, parent=it)
|
||||
|
||||
self.setCurrentIndex(self.indexFromItem(it, 0))
|
||||
|
||||
def sizeHint(self):
|
||||
w = super().sizeHint().width()
|
||||
return QtCore.QSize(w, 100)
|
||||
|
||||
def get_selected(self):
|
||||
try:
|
||||
it = self.selectedItems()[0]
|
||||
function_nr = it.data(0, QtCore.Qt.UserRole)
|
||||
idx = it.data(0, self.counterRole)
|
||||
|
||||
except IndexError:
|
||||
function_nr = None
|
||||
idx = None
|
||||
|
||||
return function_nr, idx
|
||||
|
||||
def get_functions(self, full: bool = True, pos: int = -1, return_pos: bool = False, parent=None):
|
||||
"""
|
||||
Create nested list of functions in tree. Parameters saved are idx (Index of function in list of all functions),
|
||||
cnt (counter of number to associate with functione values), ops (+, -, *, /), and maybe children.
|
||||
"""
|
||||
if parent is None:
|
||||
parent = self.invisibleRootItem()
|
||||
|
||||
funcs = []
|
||||
for i in range(parent.childCount()):
|
||||
pos += 1
|
||||
it = parent.child(i)
|
||||
|
||||
child = {
|
||||
'idx': it.data(0, QtCore.Qt.UserRole),
|
||||
'op': it.data(0, self.operatorRole),
|
||||
'pos': pos,
|
||||
'active': (it.checkState(0) == QtCore.Qt.Checked),
|
||||
'children': []
|
||||
}
|
||||
|
||||
if full:
|
||||
child['name'] = it.text(0)
|
||||
child['cnt'] = it.data(0, self.counterRole)
|
||||
child['color'] = it.foreground(0).color().getRgbF()
|
||||
|
||||
if it.childCount():
|
||||
child['children'], pos = self.get_functions(full=full, parent=it, pos=pos, return_pos=True)
|
||||
|
||||
funcs.append(child)
|
||||
|
||||
if return_pos:
|
||||
return funcs, pos
|
||||
else:
|
||||
return funcs
|
||||
|
||||
|
||||
class FitTableWidget(QtWidgets.QTableWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.horizontalHeader().hide()
|
||||
self.verticalHeader().hide()
|
||||
self.setColumnCount(2)
|
||||
self.setSelectionBehavior(QtWidgets.QTableWidget.SelectRows)
|
||||
self.horizontalHeader().setStretchLastSection(True)
|
||||
self.hideColumn(1)
|
||||
|
||||
def add_model(self, idx: str):
|
||||
model_count = 0
|
||||
for r in range(self.rowCount()):
|
||||
cb = self.cellWidget(r, 1)
|
||||
cb.addItem('Model ' + str(idx), userData=idx)
|
||||
model_count = cb.count()
|
||||
|
||||
if model_count > 2:
|
||||
if self.isColumnHidden(1):
|
||||
self.showColumn(1)
|
||||
self.resizeColumnToContents(0)
|
||||
self.setColumnWidth(1, self.columnWidth(0) - self.columnWidth(1))
|
||||
|
||||
def remove_model(self, idx: str):
|
||||
model_count = 0
|
||||
for r in range(self.rowCount()):
|
||||
cb = self.cellWidget(r, 1)
|
||||
if cb.currentData() == idx:
|
||||
cb.setCurrentIndex(0)
|
||||
cb.removeItem(cb.findData(idx))
|
||||
model_count = cb.count()
|
||||
|
||||
if model_count == 2:
|
||||
self.hideColumn(1)
|
||||
self.resizeColumnToContents(0)
|
||||
|
||||
def load(self, set_ids: list[str]):
|
||||
self.blockSignals(True)
|
||||
|
||||
while self.rowCount():
|
||||
self.removeRow(0)
|
||||
|
||||
self.setColumnCount(2)
|
||||
self.hideColumn(1)
|
||||
|
||||
for (sid, name) in set_ids:
|
||||
item = QtWidgets.QTableWidgetItem(name)
|
||||
item.setCheckState(QtCore.Qt.Checked)
|
||||
item.setData(QtCore.Qt.UserRole+1, sid)
|
||||
row = self.rowCount()
|
||||
self.setRowCount(row+1)
|
||||
self.setItem(row, 0, item)
|
||||
|
||||
item2 = QtWidgets.QTableWidgetItem('')
|
||||
self.setItem(row, 1, item2)
|
||||
cb = QtWidgets.QComboBox(parent=self)
|
||||
cb.addItem('Default')
|
||||
self.setCellWidget(row, 1, cb)
|
||||
|
||||
self.blockSignals(False)
|
||||
|
||||
def collect_data(self, default: str = None, include_name: bool = False) -> dict:
|
||||
data = {}
|
||||
|
||||
for i in range(self.rowCount()):
|
||||
item = self.item(i, 0)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
mod = self.cellWidget(i, 1).currentData()
|
||||
if mod is None:
|
||||
mod = default
|
||||
|
||||
if include_name:
|
||||
arg = (item.data(QtCore.Qt.UserRole+1), item.text())
|
||||
else:
|
||||
arg = item.data(QtCore.Qt.UserRole+1)
|
||||
|
||||
if mod not in data:
|
||||
data[mod] = []
|
||||
data[mod].append(arg)
|
||||
|
||||
return data
|
||||
|
||||
def data_list(self, include_name: bool = True) -> list:
|
||||
ret_val = []
|
||||
for i in range(self.rowCount()):
|
||||
item = self.item(i, 0)
|
||||
if include_name:
|
||||
ret_val.append((item.data(QtCore.Qt.UserRole+1), item.text()))
|
||||
else:
|
||||
ret_val.append(item.data(QtCore.Qt.UserRole+1))
|
||||
|
||||
return ret_val
|
327
src/gui_qt/fit/fit_parameter.py
Normal file
327
src/gui_qt/fit/fit_parameter.py
Normal file
@ -0,0 +1,327 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from nmreval.utils.text import convert
|
||||
|
||||
from ..Qt import QtWidgets, QtCore, QtGui
|
||||
from .._py.fitfuncwidget import Ui_FormFit
|
||||
from ..lib.forms import SelectionWidget
|
||||
from .fit_forms import FitModelWidget
|
||||
|
||||
|
||||
class QFitParameterWidget(QtWidgets.QWidget, Ui_FormFit):
|
||||
value_requested = QtCore.pyqtSignal(int)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.func = None
|
||||
self.func_idx = None
|
||||
self.max_width = QtCore.QSize(0, 0)
|
||||
self.global_parameter = []
|
||||
self.data_parameter = []
|
||||
self.glob_values = None
|
||||
self.data_values = {}
|
||||
|
||||
self.scrollwidget.setLayout(QtWidgets.QVBoxLayout())
|
||||
self.scrollwidget2.setLayout(QtWidgets.QVBoxLayout())
|
||||
|
||||
def eventFilter(self, src: QtCore.QObject, evt: QtCore.QEvent):
|
||||
if isinstance(evt, QtGui.QKeyEvent):
|
||||
if (evt.key() == QtCore.Qt.Key_Right) and \
|
||||
(evt.modifiers() == QtCore.Qt.ControlModifier | QtCore.Qt.ShiftModifier):
|
||||
self.change_single_parameter(src.value, sender=src)
|
||||
self.select_next_preview(1)
|
||||
|
||||
return True
|
||||
|
||||
elif (evt.key() == QtCore.Qt.Key_Left) and \
|
||||
(evt.modifiers() == QtCore.Qt.ControlModifier | QtCore.Qt.ShiftModifier):
|
||||
self.change_single_parameter(src.value, sender=src)
|
||||
self.select_next_preview(-1)
|
||||
|
||||
return True
|
||||
|
||||
return super().eventFilter(src, evt)
|
||||
|
||||
def load(self, data):
|
||||
self.comboBox.blockSignals(True)
|
||||
while self.comboBox.count():
|
||||
self.comboBox.removeItem(0)
|
||||
|
||||
for sid, name in data:
|
||||
self.comboBox.addItem(name, userData=sid)
|
||||
self._make_parameter(sid)
|
||||
self.comboBox.blockSignals(False)
|
||||
self.change_data(0)
|
||||
|
||||
def set_function(self, func, idx):
|
||||
self.func = func
|
||||
self.func_idx = idx
|
||||
|
||||
self.glob_values = [1] * len(func.params)
|
||||
|
||||
for k, v in enumerate(func.params):
|
||||
name = convert(v)
|
||||
widgt = FitModelWidget(label=name, parent=self.scrollwidget)
|
||||
widgt.parameter_pos = k
|
||||
widgt.func_idx = idx
|
||||
try:
|
||||
widgt.set_bounds(*func.bounds[k], False)
|
||||
except (AttributeError, IndexError):
|
||||
pass
|
||||
|
||||
size = widgt.parametername.sizeHint()
|
||||
if self.max_width.width() < size.width():
|
||||
self.max_width = size
|
||||
|
||||
widgt.state_changed.connect(self.make_global)
|
||||
widgt.value_requested.connect(self.look_for_value)
|
||||
widgt.value_changed.connect(self.change_global_parameter)
|
||||
|
||||
self.global_parameter.append(widgt)
|
||||
self.scrollwidget.layout().addWidget(widgt)
|
||||
|
||||
widgt2 = ParameterSingleWidget(name=name, parent=self.scrollwidget2)
|
||||
widgt2.valueChanged.connect(self.change_single_parameter)
|
||||
widgt2.removeSingleValue.connect(self.change_single_parameter)
|
||||
widgt2.installEventFilter(self)
|
||||
self.scrollwidget2.layout().addWidget(widgt2)
|
||||
self.data_parameter.append(widgt2)
|
||||
|
||||
for w1, w2 in zip(self.global_parameter, self.data_parameter):
|
||||
w1.parametername.setFixedSize(self.max_width)
|
||||
w1.checkBox.setFixedSize(self.max_width)
|
||||
w2.label.setFixedSize(self.max_width)
|
||||
|
||||
if hasattr(func, 'choices') and func.choices is not None:
|
||||
cbox = func.choices
|
||||
for c in cbox:
|
||||
widgt = SelectionWidget(*c)
|
||||
widgt.selectionChanged.connect(self.change_global_choice)
|
||||
self.global_parameter.append(widgt)
|
||||
self.glob_values.append(widgt.value)
|
||||
self.scrollwidget.layout().addWidget(widgt)
|
||||
|
||||
widgt2 = SelectionWidget(*c)
|
||||
widgt2.selectionChanged.connect(self.change_single_choice)
|
||||
self.data_parameter.append(widgt2)
|
||||
self.scrollwidget2.layout().addWidget(widgt2)
|
||||
|
||||
for i in range(self.comboBox.count()):
|
||||
self._make_parameter(self.comboBox.itemData(i))
|
||||
|
||||
self.scrollwidget.layout().addStretch(1)
|
||||
self.scrollwidget2.layout().addStretch(1)
|
||||
|
||||
def set_links(self, parameter):
|
||||
for w in self.global_parameter:
|
||||
if isinstance(w, FitModelWidget):
|
||||
w.add_links(parameter)
|
||||
|
||||
@QtCore.pyqtSlot(str)
|
||||
def change_global_parameter(self, value: str, idx: int = None):
|
||||
if idx is None:
|
||||
idx = self.global_parameter.index(self.sender())
|
||||
|
||||
self.glob_values[idx] = float(value)
|
||||
if self.data_values[self.comboBox.currentData()][idx] is None:
|
||||
self.data_parameter[idx].blockSignals(True)
|
||||
self.data_parameter[idx].value = float(value)
|
||||
self.data_parameter[idx].blockSignals(False)
|
||||
|
||||
@QtCore.pyqtSlot(str, object)
|
||||
def change_global_choice(self, _, value):
|
||||
idx = self.global_parameter.index(self.sender())
|
||||
self.glob_values[idx] = value
|
||||
if self.data_values[self.comboBox.currentData()][idx] is None:
|
||||
self.data_parameter[idx].blockSignals(True)
|
||||
self.data_parameter[idx].value = value
|
||||
self.data_parameter[idx].blockSignals(False)
|
||||
|
||||
def change_single_parameter(self, value: float = None, sender=None):
|
||||
if sender is None:
|
||||
sender = self.sender()
|
||||
idx = self.data_parameter.index(sender)
|
||||
self.data_values[self.comboBox.currentData()][idx] = value
|
||||
# look for global parameter values if value is reset, ie None
|
||||
if value is None:
|
||||
self.change_data(self.comboBox.currentIndex())
|
||||
|
||||
def change_single_choice(self, _, value, sender=None):
|
||||
if sender is None:
|
||||
sender = self.sender()
|
||||
idx = self.data_parameter.index(sender)
|
||||
self.data_values[self.comboBox.currentData()][idx] = value
|
||||
|
||||
@QtCore.pyqtSlot(object)
|
||||
def look_for_value(self, sender):
|
||||
self.value_requested.emit(self.global_parameter.index(sender))
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def make_global(self):
|
||||
# disable single parameter if it is set global, enable if global is unset
|
||||
widget = self.sender()
|
||||
idx = self.global_parameter.index(widget)
|
||||
enable = (widget.global_checkbox.checkState() == QtCore.Qt.Unchecked) and (widget.is_linked is None)
|
||||
self.data_parameter[idx].setEnabled(enable)
|
||||
|
||||
def select_next_preview(self, direction):
|
||||
curr_idx = self.comboBox.currentIndex()
|
||||
next_idx = (curr_idx + direction) % self.comboBox.count()
|
||||
self.comboBox.setCurrentIndex(next_idx)
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_comboBox_currentIndexChanged')
|
||||
def change_data(self, idx: int):
|
||||
# new dataset is selected, look for locally set parameter else use global values
|
||||
sid = self.comboBox.itemData(idx)
|
||||
if sid not in self.data_values:
|
||||
self._make_parameter(sid)
|
||||
|
||||
for i, value in enumerate(self.data_values[sid]):
|
||||
w = self.data_parameter[i]
|
||||
w.blockSignals(True)
|
||||
if value is None:
|
||||
w.value = self.glob_values[i]
|
||||
else:
|
||||
w.value = value
|
||||
w.blockSignals(False)
|
||||
|
||||
def _make_parameter(self, sid):
|
||||
if sid not in self.data_values:
|
||||
self.data_values[sid] = [None] * len(self.data_parameter)
|
||||
|
||||
def get_parameter(self, use_func=None):
|
||||
bds = []
|
||||
is_global = []
|
||||
is_fixed = []
|
||||
globs = []
|
||||
is_linked = []
|
||||
|
||||
for g in self.global_parameter:
|
||||
if isinstance(g, FitModelWidget):
|
||||
p_i, bds_i, fixed_i, global_i, link_i = g.get_parameter()
|
||||
|
||||
globs.append(p_i)
|
||||
bds.append(bds_i)
|
||||
is_fixed.append(fixed_i)
|
||||
is_global.append(global_i)
|
||||
is_linked.append(link_i)
|
||||
|
||||
lb, ub = list(zip(*bds))
|
||||
|
||||
data_parameter = {}
|
||||
if use_func is None:
|
||||
use_func = list(self.data_values.keys())
|
||||
|
||||
global_p = None
|
||||
for sid, parameter in self.data_values.items():
|
||||
if sid not in use_func:
|
||||
continue
|
||||
|
||||
kw_p = {}
|
||||
p = []
|
||||
if global_p is None:
|
||||
global_p = {'p': [], 'idx': [], 'var': [], 'ub': [], 'lb': []}
|
||||
|
||||
for i, (p_i, g) in enumerate(zip(parameter, self.global_parameter)):
|
||||
if isinstance(g, FitModelWidget):
|
||||
if (p_i is None) or is_global[i]:
|
||||
p.append(globs[i])
|
||||
if is_global[i]:
|
||||
if i not in global_p['idx']:
|
||||
global_p['p'].append(globs[i])
|
||||
global_p['idx'].append(i)
|
||||
global_p['var'].append(is_fixed[i])
|
||||
global_p['ub'].append(ub[i])
|
||||
global_p['lb'].append(lb[i])
|
||||
else:
|
||||
p.append(p_i)
|
||||
|
||||
try:
|
||||
if p[i] > ub[i]:
|
||||
raise ValueError(f'Parameter {g.name} is outside bounds ({lb[i]}, {ub[i]})')
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
if p[i] < lb[i]:
|
||||
raise ValueError(f'Parameter {g.name} is outside bounds ({lb[i]}, {ub[i]})')
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
else:
|
||||
if p_i is None:
|
||||
kw_p.update(g.value)
|
||||
elif isinstance(p_i, dict):
|
||||
kw_p.update(p_i)
|
||||
else:
|
||||
kw_p[g.argname] = p_i
|
||||
|
||||
data_parameter[sid] = (p, kw_p)
|
||||
|
||||
return data_parameter, lb, ub, is_fixed, global_p, is_linked
|
||||
|
||||
def set_parameter(self, set_id: str | None, parameter: list[float]) -> int:
|
||||
if set_id is None:
|
||||
for val, g in zip(parameter, self.global_parameter):
|
||||
if isinstance(g, SelectionWidget):
|
||||
continue
|
||||
g.set_parameter(val)
|
||||
|
||||
else:
|
||||
new_param = self.data_values[set_id]
|
||||
min_len = min(len(new_param), len(parameter))
|
||||
for i in range(min_len):
|
||||
new_param[i] = parameter[i]
|
||||
|
||||
self.change_data(self.comboBox.currentIndex())
|
||||
|
||||
return len(self.global_parameter)
|
||||
|
||||
|
||||
class ParameterSingleWidget(QtWidgets.QWidget):
|
||||
valueChanged = QtCore.pyqtSignal(object)
|
||||
removeSingleValue = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, name: str, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self._init_ui()
|
||||
|
||||
self._name = name
|
||||
self.label.setText(convert(name))
|
||||
|
||||
self.value_line.setValidator(QtGui.QDoubleValidator())
|
||||
self.value_line.textChanged.connect(lambda: self.valueChanged.emit(self.value) if self.value is not None else 0)
|
||||
self.reset_button.clicked.connect(lambda x: self.removeSingleValue.emit())
|
||||
|
||||
def _init_ui(self):
|
||||
layout = QtWidgets.QHBoxLayout(self)
|
||||
layout.setContentsMargins(2, 2, 2, 2)
|
||||
layout.setSpacing(2)
|
||||
|
||||
self.label = QtWidgets.QLabel(self)
|
||||
layout.addWidget(self.label)
|
||||
|
||||
layout.addSpacerItem(QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum))
|
||||
|
||||
self.value_line = QtWidgets.QLineEdit(self)
|
||||
layout.addWidget(self.value_line)
|
||||
|
||||
self.reset_button = QtWidgets.QToolButton(self)
|
||||
self.reset_button.setText('Use global')
|
||||
layout.addWidget(self.reset_button)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
@property
|
||||
def value(self) -> float:
|
||||
try:
|
||||
return float(self.value_line.text().replace(',', '.'))
|
||||
except ValueError:
|
||||
return 0.0
|
||||
|
||||
@value.setter
|
||||
def value(self, val):
|
||||
self.value_line.setText(f'{float(val):.5g}')
|
213
src/gui_qt/fit/fitfunction.py
Normal file
213
src/gui_qt/fit/fitfunction.py
Normal file
@ -0,0 +1,213 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from itertools import cycle, count
|
||||
|
||||
from nmreval.configs import config_paths
|
||||
from nmreval import models
|
||||
from nmreval.lib.importer import find_models
|
||||
from nmreval.lib.colors import BaseColor, Tab10
|
||||
from nmreval.utils.text import convert
|
||||
|
||||
from ..lib import get_icon
|
||||
from .._py.fitfunctionwidget import Ui_Form
|
||||
from ..Qt import QtWidgets, QtCore, QtGui
|
||||
|
||||
class QFunctionWidget(QtWidgets.QWidget, Ui_Form):
|
||||
func_cnt = count()
|
||||
func_colors = cycle(Tab10)
|
||||
op_names = ['plus_icon', 'mal_icon', 'minus_icon', 'geteilt_icon']
|
||||
|
||||
newFunction = QtCore.pyqtSignal(int, int)
|
||||
treeChanged = QtCore.pyqtSignal()
|
||||
itemRemoved = QtCore.pyqtSignal(int)
|
||||
showFunction = QtCore.pyqtSignal(int)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.setupUi(self)
|
||||
|
||||
self._types = []
|
||||
self.functions = find_models(models)
|
||||
try:
|
||||
self.functions += find_models(config_paths() / 'usermodels.py')
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
for m in self.functions:
|
||||
try:
|
||||
m.type
|
||||
except AttributeError:
|
||||
m.type = 'Other'
|
||||
|
||||
if m.type not in self._types:
|
||||
self._types.append(m.type)
|
||||
|
||||
self.typecomboBox.addItems(sorted(self._types))
|
||||
|
||||
self.functree.treeChanged.connect(lambda: self.treeChanged.emit())
|
||||
self.functree.itemRemoved.connect(self.remove_function)
|
||||
|
||||
self.iscomplex = False
|
||||
self.complex_widget.hide()
|
||||
|
||||
for i, op_icon in enumerate(self.op_names):
|
||||
self.operator_combobox.setItemIcon(i, get_icon(op_icon))
|
||||
|
||||
def __len__(self) -> int:
|
||||
num = 0
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self.functree)
|
||||
while iterator.value():
|
||||
num += 1
|
||||
iterator += 1
|
||||
|
||||
return num
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_typecomboBox_currentIndexChanged')
|
||||
def change_group(self, idx: int):
|
||||
"""
|
||||
Change items in fitcombobox to new entries
|
||||
"""
|
||||
self.fitcomboBox.blockSignals(True)
|
||||
while self.fitcomboBox.count():
|
||||
self.fitcomboBox.removeItem(0)
|
||||
|
||||
selected_type = self.typecomboBox.itemText(idx)
|
||||
for m in self.functions:
|
||||
if m.type == selected_type:
|
||||
self.fitcomboBox.addItem(m.name, userData=self.functions.index(m))
|
||||
self.fitcomboBox.blockSignals(False)
|
||||
self.on_fitcomboBox_currentIndexChanged(0)
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_fitcomboBox_currentIndexChanged')
|
||||
def change_function(self, idx: int):
|
||||
"""
|
||||
Display new equation on changing function
|
||||
"""
|
||||
index = self.fitcomboBox.itemData(idx)
|
||||
if self.functions:
|
||||
fitfunc = self.functions[index]
|
||||
try:
|
||||
self.fitequation.setText(convert(fitfunc.equation))
|
||||
except AttributeError:
|
||||
self.fitequation.setText('')
|
||||
|
||||
@QtCore.pyqtSlot(name='on_use_function_button_clicked')
|
||||
def new_function(self):
|
||||
idx = self.fitcomboBox.itemData(self.fitcomboBox.currentIndex())
|
||||
cnt = next(self.func_cnt)
|
||||
op = self.operator_combobox.currentIndex()
|
||||
name = self.functions[idx].name
|
||||
col = next(self.func_colors)
|
||||
|
||||
self.newFunction.emit(idx, cnt)
|
||||
|
||||
self.add_function(idx, cnt, op, name, col)
|
||||
|
||||
def add_function(self, idx: int, cnt: int, op: int,
|
||||
name: str, color: str | tuple[float, float, float] | BaseColor, **kwargs):
|
||||
"""
|
||||
Add function to tree and dictionary of functions.
|
||||
"""
|
||||
if isinstance(color, BaseColor):
|
||||
qcolor = QtGui.QColor.fromRgbF(*color.rgb(normed=True))
|
||||
elif isinstance(color, tuple):
|
||||
qcolor = QtGui.QColor.fromRgbF(*color)
|
||||
else:
|
||||
qcolor = QtGui.QColor(color)
|
||||
self.functree.add_function(idx, cnt, op, name, qcolor, **kwargs)
|
||||
|
||||
f = self.functions[idx]
|
||||
if hasattr(f, 'iscomplex') and f.iscomplex:
|
||||
self.iscomplex = True
|
||||
self.complex_widget.show()
|
||||
|
||||
@QtCore.pyqtSlot(int)
|
||||
def remove_function(self, idx: int):
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self.functree)
|
||||
self.iscomplex = False
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
f = self.functions[item.data(0, QtCore.Qt.UserRole)]
|
||||
if hasattr(f, 'iscomplex') and f.iscomplex:
|
||||
self.iscomplex = True
|
||||
break
|
||||
|
||||
iterator += 1
|
||||
self.complex_widget.setVisible(self.iscomplex)
|
||||
|
||||
self.itemRemoved.emit(idx)
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QTreeWidgetItem, int, name='on_functree_itemClicked')
|
||||
def show_parameter(self, item: QtWidgets.QTreeWidgetItem, _: int):
|
||||
self.showFunction.emit(item.data(0, self.functree.counterRole))
|
||||
|
||||
def get_selected(self):
|
||||
function_nr, idx = self.functree.get_selected()
|
||||
|
||||
if function_nr is not None:
|
||||
return self.functions[function_nr], idx
|
||||
else:
|
||||
return None, None
|
||||
|
||||
def get_functions(self, full: bool = True, clsname=False, include_all: bool = True):
|
||||
"""
|
||||
Create nested list of functions in tree. Parameters saved are idx (Index of function in list of all functions),
|
||||
cnt (counter of number to associate with functione values), ops (+, -, *, /), and maybe children.
|
||||
"""
|
||||
|
||||
used_functions = self.functree.get_functions(full=full)
|
||||
self._prepare_function_for_model(used_functions, full=full, clsname=clsname, include_all=include_all)
|
||||
|
||||
return used_functions
|
||||
|
||||
def _prepare_function_for_model(self, func_list: list[dict],
|
||||
full: bool = True, clsname: bool = False, include_all: bool = True):
|
||||
|
||||
for func_args in func_list:
|
||||
is_active = func_args.get('active')
|
||||
if (not is_active) and (not include_all):
|
||||
continue
|
||||
|
||||
if not clsname:
|
||||
func_args['func'] = self.functions[func_args['idx']]
|
||||
else:
|
||||
func_args['func'] = self.functions[func_args['idx']].name
|
||||
|
||||
if not full:
|
||||
func_args.pop('active')
|
||||
func_args.pop('idx')
|
||||
|
||||
if func_args['children']:
|
||||
self._prepare_function_for_model(func_args['children'],
|
||||
full=full, clsname=clsname,
|
||||
include_all=include_all)
|
||||
|
||||
def get_parameter_list(self):
|
||||
all_parameters = {}
|
||||
|
||||
iterator = QtWidgets.QTreeWidgetItemIterator(self.functree)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
f = self.functions[item.data(0, QtCore.Qt.UserRole)]
|
||||
cnt = item.data(0, self.functree.counterRole)
|
||||
all_parameters[f'{f.name}_{cnt}'] = [(convert(pp, new='str'), (cnt, i)) for i, pp in enumerate(f.params)]
|
||||
|
||||
iterator += 1
|
||||
|
||||
return all_parameters
|
||||
|
||||
def get_complex_state(self):
|
||||
return self.complex_comboBox.currentIndex() if self.iscomplex else None
|
||||
|
||||
def set_complex_state(self, state):
|
||||
if state is not None:
|
||||
self.complex_comboBox.setCurrentIndex(state)
|
||||
|
||||
def clear(self):
|
||||
self.functree.blockSignals(True)
|
||||
self.functree.clear()
|
||||
self.functree.blockSignals(False)
|
||||
|
||||
self.complex_comboBox.setCurrentIndex(0)
|
||||
self.complex_widget.hide()
|
474
src/gui_qt/fit/fitwindow.py
Normal file
474
src/gui_qt/fit/fitwindow.py
Normal file
@ -0,0 +1,474 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from functools import reduce
|
||||
from itertools import count, cycle
|
||||
from operator import add
|
||||
from string import ascii_letters
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
import numpy as np
|
||||
from pyqtgraph import mkPen
|
||||
|
||||
from nmreval.fit._meta import MultiModel, ModelFactory
|
||||
from nmreval.fit.result import FitResult
|
||||
|
||||
from .fit_forms import FitTableWidget
|
||||
from .fit_parameter import QFitParameterWidget
|
||||
from ..lib.pg_objects import PlotItem
|
||||
from ..Qt import QtGui, QtCore, QtWidgets
|
||||
from .._py.fitdialog import Ui_FitDialog
|
||||
|
||||
|
||||
class QFitDialog(QtWidgets.QWidget, Ui_FitDialog):
|
||||
func_cnt = count()
|
||||
model_cnt = cycle(ascii_letters)
|
||||
preview_num = 201
|
||||
|
||||
preview_emit = QtCore.pyqtSignal(dict, int, bool)
|
||||
fitStartSig = QtCore.pyqtSignal(dict, list, dict)
|
||||
abortFit = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, mgmt=None, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.parameters = {}
|
||||
self.preview_lines = []
|
||||
self._current_function = None
|
||||
self.param_widgets = {}
|
||||
self._management = mgmt
|
||||
|
||||
self._current_model = next(QFitDialog.model_cnt)
|
||||
self.show_combobox.setItemData(0, self._current_model, QtCore.Qt.UserRole)
|
||||
self.default_combobox.setItemData(0, self._current_model, QtCore.Qt.UserRole)
|
||||
|
||||
self.data_table = FitTableWidget(self.data_widget)
|
||||
self.data_widget.addWidget(self.data_table)
|
||||
self.data_widget.setText('Data')
|
||||
|
||||
self.models = {}
|
||||
self._func_list = {}
|
||||
self._complex = {}
|
||||
|
||||
self.connected_figure = ''
|
||||
|
||||
self.model_frame.hide()
|
||||
self.preview_button.hide()
|
||||
|
||||
self.abort_button.clicked.connect(lambda: self.abortFit.emit())
|
||||
|
||||
self.functionwidget.newFunction.connect(self.add_function)
|
||||
self.functionwidget.showFunction.connect(self.show_function_parameter)
|
||||
self.functionwidget.itemRemoved.connect(self.remove_function)
|
||||
|
||||
@QtCore.pyqtSlot(int, int)
|
||||
def add_function(self, function_idx: int, function_id: int):
|
||||
self.show_function_parameter(function_id, function_idx)
|
||||
self.newmodel_button.setEnabled(True)
|
||||
|
||||
@QtCore.pyqtSlot(int)
|
||||
def remove_function(self, idx: int):
|
||||
"""
|
||||
Remove function and children from tree and dictionary
|
||||
"""
|
||||
w = self.param_widgets[idx]
|
||||
self.stackedWidget.removeWidget(w)
|
||||
w.deleteLater()
|
||||
del self.param_widgets[idx]
|
||||
|
||||
if len(self.functionwidget) == 0:
|
||||
# empty model
|
||||
self.newmodel_button.setEnabled(False)
|
||||
self.deletemodel_button.setEnabled(False)
|
||||
self._current_function = None
|
||||
|
||||
else:
|
||||
f_tree = self.functionwidget.functree
|
||||
func_idx = f_tree.currentItem().data(0, f_tree.counterRole)
|
||||
self._current_function = self.functionwidget.functions[func_idx]
|
||||
|
||||
@QtCore.pyqtSlot(int)
|
||||
def show_function_parameter(self, function_id: int, function_idx: int = None):
|
||||
"""
|
||||
Display parameter associated with selected function.
|
||||
"""
|
||||
if function_id in self.param_widgets:
|
||||
dialog = self.param_widgets[function_id]
|
||||
|
||||
else:
|
||||
# create new widget for function
|
||||
if function_idx is not None:
|
||||
function = self.functionwidget.functions[function_idx]
|
||||
else:
|
||||
raise ValueError('No function index given')
|
||||
|
||||
if function is None:
|
||||
return
|
||||
|
||||
dialog = QFitParameterWidget()
|
||||
data_names = self.data_table.data_list(include_name=True)
|
||||
|
||||
dialog.set_function(function, function_idx)
|
||||
dialog.load(data_names)
|
||||
dialog.value_requested.connect(self.look_value)
|
||||
|
||||
self.stackedWidget.addWidget(dialog)
|
||||
self.param_widgets[function_id] = dialog
|
||||
|
||||
self.stackedWidget.setCurrentWidget(dialog)
|
||||
|
||||
# collect parameter names etc. to allow linkage
|
||||
self._func_list[self._current_model] = self.functionwidget.get_parameter_list()
|
||||
dialog.set_links(self._func_list)
|
||||
|
||||
# show same tab (general parameter/Data parameter)
|
||||
tab_idx = 0
|
||||
if self._current_function is not None:
|
||||
tab_idx = self.param_widgets[self._current_function].tabWidget.currentIndex()
|
||||
dialog.tabWidget.setCurrentIndex(tab_idx)
|
||||
|
||||
self._current_function = function_id
|
||||
|
||||
def look_value(self, idx: int):
|
||||
func_widget = self.param_widgets[self._current_function]
|
||||
set_ids = [func_widget.comboBox.itemData(i) for i in range(func_widget.comboBox.count())]
|
||||
for s in set_ids:
|
||||
func_widget.data_values[s][idx] = self._management[s].value
|
||||
func_widget.change_data(func_widget.comboBox.currentIndex())
|
||||
|
||||
def get_functions(self):
|
||||
""" update functions, parameters"""
|
||||
self.models[self._current_model] = self.functionwidget.get_functions()
|
||||
self._complex[self._current_model] = self.functionwidget.get_complex_state()
|
||||
self._func_list[self._current_model] = self.functionwidget.get_parameter_list()
|
||||
|
||||
def load(self, ids: List[str]):
|
||||
"""
|
||||
Add name and id of dataset to list.
|
||||
"""
|
||||
self.data_table.load(ids)
|
||||
if self.models:
|
||||
for m in self.models.keys():
|
||||
self.data_table.add_model(m)
|
||||
else:
|
||||
self.data_table.add_model(self._current_model)
|
||||
|
||||
for dialog in self.param_widgets.values():
|
||||
dialog.load(ids)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_newmodel_button_clicked')
|
||||
def make_new_model(self):
|
||||
"""
|
||||
Save model with all its functions in dictionary and adjust gui.
|
||||
"""
|
||||
self.deletemodel_button.setEnabled(True)
|
||||
self.model_frame.show()
|
||||
idx = next(QFitDialog.model_cnt)
|
||||
|
||||
self.data_table.add_model(idx)
|
||||
|
||||
self.default_combobox.addItem('Model '+idx, userData=idx)
|
||||
self.show_combobox.addItem('Model '+idx, userData=idx)
|
||||
self.show_combobox.setItemData(self.show_combobox.count()-1, idx, QtCore.Qt.UserRole)
|
||||
self.show_combobox.setCurrentIndex(self.show_combobox.count()-1)
|
||||
|
||||
self._current_model = idx
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_show_combobox_currentIndexChanged')
|
||||
def change_model(self, idx: int):
|
||||
"""
|
||||
Save old model and display new model.
|
||||
"""
|
||||
self.get_functions()
|
||||
self.functionwidget.clear()
|
||||
|
||||
self._current_model = self.show_combobox.itemData(idx, QtCore.Qt.UserRole)
|
||||
if self._current_model in self.models and len(self.models[self._current_model]):
|
||||
for el in self.models[self._current_model]:
|
||||
self.functionwidget.add_function(**el)
|
||||
self.functionwidget.set_complex_state(self._complex[self._current_model])
|
||||
else:
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_deletemodel_button_clicked')
|
||||
def remove_model(self):
|
||||
model_id = self._current_model
|
||||
|
||||
self.show_combobox.removeItem(self.show_combobox.findData(model_id))
|
||||
self.default_combobox.removeItem(self.default_combobox.findData(model_id))
|
||||
|
||||
for m in self.models[model_id]:
|
||||
func_id = m['cnt']
|
||||
self.stackedWidget.removeWidget(self.param_widgets[func_id])
|
||||
|
||||
self.param_widgets.pop(func_id)
|
||||
|
||||
self._complex.pop(model_id)
|
||||
self._func_list.pop(model_id)
|
||||
self.models.pop(model_id)
|
||||
|
||||
self.data_table.remove_model(model_id)
|
||||
|
||||
if len(self.models) == 1:
|
||||
self.model_frame.hide()
|
||||
|
||||
def _prepare(self, model: list, function_use: list = None,
|
||||
parameter: dict = None, add_idx: bool = False, cnt: int = 0) -> Tuple[dict, int]:
|
||||
if parameter is None:
|
||||
parameter = {'parameter': {}, 'lb': (), 'ub': (), 'var': [],
|
||||
'glob': {'idx': [], 'p': [], 'var': [], 'lb': [], 'ub': []},
|
||||
'links': [], 'color': []}
|
||||
|
||||
for i, f in enumerate(model):
|
||||
if not f['active']:
|
||||
continue
|
||||
|
||||
try:
|
||||
p, lb, ub, var, glob, links = self.param_widgets[f['cnt']].get_parameter(function_use)
|
||||
except ValueError as e:
|
||||
_ = QtWidgets.QMessageBox().warning(self, 'Invalid value', str(e),
|
||||
QtWidgets.QMessageBox.Ok)
|
||||
return {}, -1
|
||||
|
||||
p_len = len(parameter['lb'])
|
||||
|
||||
parameter['lb'] += lb
|
||||
parameter['ub'] += ub
|
||||
parameter['var'] += var
|
||||
parameter['links'] += links
|
||||
parameter['color'] += [f['color']]
|
||||
|
||||
for p_k, v_k in p.items():
|
||||
if add_idx:
|
||||
kw_k = {f'{k}_{cnt}': v for k, v in v_k[1].items()}
|
||||
else:
|
||||
kw_k = v_k[1]
|
||||
|
||||
if p_k in parameter['parameter']:
|
||||
params, kw = parameter['parameter'][p_k]
|
||||
params += v_k[0]
|
||||
kw.update(kw_k)
|
||||
else:
|
||||
parameter['parameter'][p_k] = (v_k[0], kw_k)
|
||||
|
||||
for g_k, g_v in glob.items():
|
||||
if g_k != 'idx':
|
||||
parameter['glob'][g_k] += g_v
|
||||
else:
|
||||
parameter['glob']['idx'] += [idx_i + p_len for idx_i in g_v]
|
||||
|
||||
if add_idx:
|
||||
cnt += 1
|
||||
|
||||
if f['children']:
|
||||
# recurse for children
|
||||
child_parameter, cnt = self._prepare(f['children'], parameter=parameter, add_idx=add_idx, cnt=cnt)
|
||||
|
||||
return parameter, cnt
|
||||
|
||||
@QtCore.pyqtSlot(name='on_fit_button_clicked')
|
||||
def start_fit(self):
|
||||
self.get_functions()
|
||||
|
||||
data = self.data_table.collect_data(default=self.default_combobox.currentData())
|
||||
|
||||
func_dict = {}
|
||||
for k, mod in self.models.items():
|
||||
func, order, param_len = ModelFactory.create_from_list(mod)
|
||||
|
||||
if func is None:
|
||||
continue
|
||||
|
||||
if k in data:
|
||||
parameter, _ = self._prepare(mod, function_use=data[k], add_idx=isinstance(func, MultiModel))
|
||||
if parameter is None:
|
||||
return
|
||||
|
||||
parameter['func'] = func
|
||||
parameter['order'] = order
|
||||
parameter['len'] = param_len
|
||||
parameter['complex'] = self._complex[k]
|
||||
if self._complex[k] is not None:
|
||||
for p_k, p_v in parameter['parameter'].items():
|
||||
p_v[1].update({'complex_mode': self._complex[k]})
|
||||
parameter['parameter'][p_k] = p_v[0], p_v[1]
|
||||
|
||||
func_dict[k] = parameter
|
||||
|
||||
replaceable = []
|
||||
for k, v in func_dict.items():
|
||||
for i, link_i in enumerate(v['links']):
|
||||
if link_i is None:
|
||||
continue
|
||||
|
||||
rep_model, rep_func, rep_pos = link_i
|
||||
try:
|
||||
f = func_dict[rep_model]
|
||||
except KeyError:
|
||||
QtWidgets.QMessageBox().warning(self, 'Invalid value',
|
||||
'Parameter cannot be linked: Model is unused',
|
||||
QtWidgets.QMessageBox.Ok)
|
||||
return
|
||||
|
||||
try:
|
||||
f_idx = f['order'].index(rep_func)
|
||||
except ValueError:
|
||||
QtWidgets.QMessageBox().warning(self, 'Invalid value',
|
||||
'Parameter cannot be linked: '
|
||||
'Function is probably not checked or deleted',
|
||||
QtWidgets.QMessageBox.Ok)
|
||||
return
|
||||
|
||||
repl_idx = sum(f['len'][:f_idx])+rep_pos
|
||||
if repl_idx not in f['glob']['idx']:
|
||||
_ = QtWidgets.QMessageBox().warning(self, 'Invalid value',
|
||||
'Parameter cannot be linked: '
|
||||
'Destination is not a global parameter.',
|
||||
QtWidgets.QMessageBox.Ok)
|
||||
return
|
||||
|
||||
replaceable.append((k, i, rep_model, repl_idx))
|
||||
|
||||
replace_value = None
|
||||
for p_k in f['parameter'].values():
|
||||
replace_value = p_k[0][repl_idx]
|
||||
break
|
||||
|
||||
if replace_value is not None:
|
||||
for p_k in v['parameter'].values():
|
||||
p_k[0][i] = replace_value
|
||||
|
||||
weight = ['None', 'y', 'y2', 'Deltay'][self.weight_combobox.currentIndex()]
|
||||
|
||||
fit_args = {'we': weight}
|
||||
|
||||
if func_dict:
|
||||
self.fitStartSig.emit(func_dict, replaceable, fit_args)
|
||||
|
||||
return func_dict
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_preview_checkbox_stateChanged')
|
||||
def show_preview(self, state: int):
|
||||
if state:
|
||||
self.preview_button.show()
|
||||
self.preview_checkbox.setText('')
|
||||
|
||||
self._prepare_preview()
|
||||
|
||||
else:
|
||||
self.preview_emit.emit({}, -1, False)
|
||||
self.preview_lines = []
|
||||
self.preview_button.hide()
|
||||
self.preview_checkbox.setText('Preview')
|
||||
|
||||
@QtCore.pyqtSlot(name='on_preview_button_clicked')
|
||||
def _prepare_preview(self):
|
||||
self.get_functions()
|
||||
|
||||
default_model = self.default_combobox.currentData()
|
||||
data = self.data_table.collect_data(default=default_model)
|
||||
|
||||
func_dict = {}
|
||||
for k, mod in self.models.items():
|
||||
func, order, param_len = ModelFactory.create_from_list(mod)
|
||||
multiple_funcs = isinstance(func, MultiModel)
|
||||
|
||||
if k in data:
|
||||
parameter, _ = self._prepare(mod, function_use=data[k], add_idx=multiple_funcs)
|
||||
parameter['func'] = func
|
||||
parameter['order'] = order
|
||||
parameter['len'] = param_len
|
||||
|
||||
func_dict[k] = parameter
|
||||
|
||||
for v in func_dict.values():
|
||||
for i, link_i in enumerate(v['links']):
|
||||
if link_i is None:
|
||||
continue
|
||||
|
||||
rep_model, rep_func, rep_pos = link_i
|
||||
f = func_dict[rep_model]
|
||||
f_idx = f['order'].index(rep_func)
|
||||
repl_idx = sum(f['len'][:f_idx]) + rep_pos
|
||||
|
||||
replace_value = None
|
||||
for p_k in f['parameter'].values():
|
||||
replace_value = p_k[0][repl_idx]
|
||||
break
|
||||
|
||||
if replace_value is not None:
|
||||
for p_k in v['parameter'].values():
|
||||
p_k[0][i] = replace_value
|
||||
|
||||
self.preview_emit.emit(func_dict, QFitDialog.preview_num, True)
|
||||
|
||||
def make_previews(self, x, models_parameters: dict):
|
||||
self.preview_lines = []
|
||||
|
||||
for k, model in models_parameters.items():
|
||||
f = model['func']
|
||||
is_complex = self._complex[k]
|
||||
|
||||
parameters = model['parameter']
|
||||
color = model['color']
|
||||
|
||||
for p, kwargs in parameters.values():
|
||||
if is_complex is not None:
|
||||
y = f.func(x, *p, complex_mode=is_complex, **kwargs)
|
||||
if np.iscomplexobj(y):
|
||||
self.preview_lines.append(PlotItem(x=x, y=y.real, pen=mkPen(width=3)))
|
||||
self.preview_lines.append(PlotItem(x=x, y=y.imag, pen=mkPen(width=3)))
|
||||
else:
|
||||
self.preview_lines.append(PlotItem(x=x, y=y, pen=mkPen(width=3)))
|
||||
else:
|
||||
y = f.func(x, *p, **kwargs)
|
||||
self.preview_lines.append(PlotItem(x=x, y=y, pen=mkPen(width=3)))
|
||||
|
||||
if isinstance(f, MultiModel):
|
||||
sub_kwargs = kwargs.copy()
|
||||
if is_complex is not None:
|
||||
sub_kwargs.update({'complex_mode': is_complex})
|
||||
|
||||
for i, s in enumerate(f.subs(x, *p, **sub_kwargs)):
|
||||
pen_i = mkPen(QtGui.QColor.fromRgbF(*color[i]))
|
||||
if np.iscomplexobj(s):
|
||||
self.preview_lines.append(PlotItem(x=x, y=s.real, pen=pen_i))
|
||||
self.preview_lines.append(PlotItem(x=x, y=s.imag, pen=pen_i))
|
||||
else:
|
||||
self.preview_lines.append(PlotItem(x=x, y=s, pen=pen_i))
|
||||
|
||||
return self.preview_lines
|
||||
|
||||
def set_parameter(self, parameter: Dict[str, FitResult]):
|
||||
# which data uses which model
|
||||
data = self.data_table.collect_data(default=self.default_combobox.currentData())
|
||||
|
||||
glob_fit_parameter = []
|
||||
|
||||
for fitted_model, fitted_data in data.items():
|
||||
for fit_id, fit_curve in parameter.items():
|
||||
if fit_id in fitted_data:
|
||||
fit_parameter = list(fit_curve.parameter.values())
|
||||
glob_fit_parameter.append(fit_parameter)
|
||||
|
||||
self.set_parameter_iter(fit_id, [p.value for p in fit_parameter], self.models[fitted_model])
|
||||
|
||||
mean_parameter = [reduce(add, p, 0)/len(p) for p in zip(*glob_fit_parameter)]
|
||||
|
||||
self.set_parameter_iter(None, mean_parameter, self.models[fitted_model])
|
||||
|
||||
def set_parameter_iter(self, fit_id: str | None, param: List[float], functions: List, cnt: int = 0):
|
||||
for model_p in functions:
|
||||
if model_p['active']:
|
||||
cnt += self.param_widgets[model_p['cnt']].set_parameter(fit_id, param[cnt:])
|
||||
if model_p['children']:
|
||||
cnt += self.set_parameter_iter(fit_id, param, model_p['children'], cnt=cnt)
|
||||
|
||||
return cnt
|
||||
|
||||
def closeEvent(self, evt: QtGui.QCloseEvent):
|
||||
self.preview_emit.emit({}, -1, False)
|
||||
self.preview_lines = []
|
||||
|
||||
super().closeEvent(evt)
|
449
src/gui_qt/fit/function_creation_dialog.py
Normal file
449
src/gui_qt/fit/function_creation_dialog.py
Normal file
@ -0,0 +1,449 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import numbers
|
||||
import textwrap
|
||||
from typing import Any
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gui_qt.Qt import QtCore, QtWidgets, QtGui
|
||||
from gui_qt._py.fitcreationdialog import Ui_Dialog
|
||||
from gui_qt.lib.namespace import QNamespaceWidget
|
||||
|
||||
__all__ = ['QUserFitCreator']
|
||||
|
||||
validator = QtGui.QRegExpValidator(QtCore.QRegExp('[A-Za-z]\S*'))
|
||||
|
||||
|
||||
class QUserFitCreator(QtWidgets.QDialog, Ui_Dialog):
|
||||
classCreated = QtCore.pyqtSignal(object)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.description_widget = DescWidget(self)
|
||||
self.args_widget = ArgWidget(self)
|
||||
self.kwargs_widget = KwargsWidget(self)
|
||||
self.kwargs_widget.Changed.connect(self.update_function)
|
||||
self.namespace_widget = QNamespaceWidget(self)
|
||||
self.namespace_widget.make_namespace()
|
||||
self.namespace_widget.sendKey.connect(self.namespace_made)
|
||||
|
||||
for b, w in [(self.description_box, self.description_widget), (self.args_box, self.args_widget),
|
||||
(self.kwargs_box, self.kwargs_widget), (self.namespace_box, self.namespace_widget)]:
|
||||
b.layout().addWidget(w)
|
||||
try:
|
||||
w.Changed.connect(self.update_function)
|
||||
except AttributeError:
|
||||
pass
|
||||
b.layout().addStretch()
|
||||
|
||||
self._imports = set()
|
||||
|
||||
self.update_function()
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
return self
|
||||
|
||||
def update_function(self):
|
||||
try:
|
||||
var = self.args_widget.get_parameter()
|
||||
var += self.kwargs_widget.get_parameter()
|
||||
|
||||
k = ''
|
||||
for imps in self._imports:
|
||||
if len(imps) == 2:
|
||||
k += f'from {imps[0]} import {imps[1]}\n'
|
||||
elif imps[0] == 'numpy':
|
||||
k += 'import numpy as np\n'
|
||||
|
||||
if len(self._imports):
|
||||
k += '\n\n'
|
||||
|
||||
k += self.description_widget.get_strings()
|
||||
k += self.args_widget.get_strings()
|
||||
k += self.kwargs_widget.get_strings()
|
||||
|
||||
k += '\n @staticmethod\n'
|
||||
k += f" def func(x, {', '.join(var)}):\n"
|
||||
|
||||
self.plainTextEdit.setPlainText(k)
|
||||
except Exception as e:
|
||||
QtWidgets.QMessageBox.warning(self, 'Failure', f'Error found: {e.args[0]}')
|
||||
|
||||
def change_visibility(self):
|
||||
sender = self.sender()
|
||||
|
||||
for box in (self.description_box, self.args_box, self.kwargs_box, self.namespace_box):
|
||||
box.blockSignals(True)
|
||||
box.setExpansion(sender == box)
|
||||
box.blockSignals(False)
|
||||
|
||||
def namespace_made(self, invalue: str):
|
||||
ns = self.namespace_widget.namespace.namespace
|
||||
func_value = ns[invalue][0]
|
||||
ret_func = ''
|
||||
|
||||
if func_value is None:
|
||||
ret_func = invalue
|
||||
|
||||
elif isinstance(func_value, numbers.Number):
|
||||
ret_func = func_value
|
||||
|
||||
elif isinstance(func_value, np.ufunc):
|
||||
self._imports.add(('numpy',))
|
||||
ret_func = 'np.'+func_value.__name__ + '(x)'
|
||||
|
||||
else:
|
||||
f_string = ns[invalue][-1]
|
||||
args = f_string[f_string.find('('):]
|
||||
if inspect.ismethod(func_value):
|
||||
ret_func = func_value.__self__.__name__ + '.func'+args
|
||||
elif hasattr(func_value, '__qualname__'):
|
||||
ret_func = func_value.__qualname__.split('.')[0]
|
||||
self._imports.add((inspect.getmodule(func_value).__name__, ret_func))
|
||||
|
||||
self.plainTextEdit.insertPlainText(ret_func)
|
||||
self.update_function()
|
||||
|
||||
|
||||
class KwargsWidget(QtWidgets.QWidget):
|
||||
Changed = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
self._num_kwargs = 0
|
||||
|
||||
self._setup_ui()
|
||||
|
||||
def _setup_ui(self):
|
||||
layout = QtWidgets.QGridLayout()
|
||||
layout.setContentsMargins(3, 3, 3, 3)
|
||||
layout.setHorizontalSpacing(3)
|
||||
|
||||
self.use_nuclei = QtWidgets.QCheckBox('Add gyromagnetic ratio', self)
|
||||
self.use_nuclei.stateChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.use_nuclei, 0, 0, 1, 3)
|
||||
|
||||
self.choices = QtWidgets.QTabWidget(self)
|
||||
layout.addWidget(self.choices, 1, 0, 1, 3)
|
||||
|
||||
self.add_choice_button = QtWidgets.QPushButton('Add choice', self)
|
||||
self.add_choice_button.clicked.connect(self.add_choice)
|
||||
layout.addWidget(self.add_choice_button, 2, 0, 1, 1)
|
||||
|
||||
self.rem_choice_button = QtWidgets.QPushButton('Remove choice', self)
|
||||
self.rem_choice_button.clicked.connect(self.remove_choice)
|
||||
layout.addWidget(self.rem_choice_button, 2, 1, 1, 1)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
def add_choice(self):
|
||||
cnt = self._num_kwargs
|
||||
c = ChoiceWidget(cnt, self)
|
||||
c.Changed.connect(self.update_choice)
|
||||
self.choices.addTab(c, c.name_line.text())
|
||||
|
||||
self._num_kwargs += 1
|
||||
|
||||
self.choices.setCurrentIndex(cnt)
|
||||
self.Changed.emit()
|
||||
|
||||
def remove_choice(self):
|
||||
cnt = self.choices.currentIndex()
|
||||
self.choices.removeTab(cnt)
|
||||
self.Changed.emit()
|
||||
|
||||
def update_choice(self):
|
||||
idx = self.choices.currentIndex()
|
||||
self.choices.setTabText(idx, self.sender().name_line.text())
|
||||
self.Changed.emit()
|
||||
|
||||
def get_parameter(self):
|
||||
if self.use_nuclei.isChecked():
|
||||
var = ['nucleus=2.67522128e7']
|
||||
else:
|
||||
var = []
|
||||
var += [self.choices.widget(idx).get_parameter() for idx in range(self.choices.count())]
|
||||
|
||||
return var
|
||||
|
||||
def get_strings(self) -> str:
|
||||
kwargs = []
|
||||
if self.use_nuclei.isChecked():
|
||||
kwargs.append("(r'\gamma', 'nucleus', gamma)")
|
||||
|
||||
for i in range(self.choices.count()):
|
||||
kwargs.append(self.choices.widget(i).get_strings())
|
||||
if kwargs:
|
||||
return f" choices = {', '.join(kwargs)}\n"
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
||||
class ChoiceWidget(QtWidgets.QWidget):
|
||||
Changed = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, idx: int, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self._setup_ui()
|
||||
|
||||
self.name_line.setText('choice' + str(idx))
|
||||
self.add_option()
|
||||
|
||||
def _setup_ui(self):
|
||||
layout = QtWidgets.QGridLayout()
|
||||
layout.setContentsMargins(3, 3, 3, 3)
|
||||
layout.setHorizontalSpacing(3)
|
||||
|
||||
self.name_label = QtWidgets.QLabel('Name', self)
|
||||
layout.addWidget(self.name_label, 0, 0, 1, 1)
|
||||
self.name_line = QtWidgets.QLineEdit(self)
|
||||
self.name_line.textChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.name_line, 0, 1, 1, 1)
|
||||
|
||||
self.disp_label = QtWidgets.QLabel('Disp. name', self)
|
||||
layout.addWidget(self.disp_label, 1, 0, 1, 1)
|
||||
self.display_line = QtWidgets.QLineEdit(self)
|
||||
self.display_line.textChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.display_line, 1, 1, 1, 1)
|
||||
|
||||
self.add_button = QtWidgets.QPushButton('Add option', self)
|
||||
self.add_button.clicked.connect(self.add_option)
|
||||
layout.addWidget(self.add_button, 2, 0, 1, 2)
|
||||
|
||||
self.remove_button = QtWidgets.QPushButton('Remove option', self)
|
||||
self.remove_button.clicked.connect(self.remove_option)
|
||||
layout.addWidget(self.remove_button, 3, 0, 1, 2)
|
||||
|
||||
self.table = QtWidgets.QTableWidget(self)
|
||||
self.table.setColumnCount(3)
|
||||
self.table.setHorizontalHeaderLabels(['Name', 'Value', 'Type'])
|
||||
self.table.itemChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.table, 0, 2, 4, 1)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
def add_option(self):
|
||||
self.table.blockSignals(True)
|
||||
row = self.table.rowCount()
|
||||
self.table.setRowCount(row+1)
|
||||
|
||||
self.table.setItem(row, 0, QtWidgets.QTableWidgetItem('opt' + str(row)))
|
||||
lineedit = QtWidgets.QLineEdit()
|
||||
lineedit.setValidator(validator)
|
||||
lineedit.setFrame(False)
|
||||
lineedit.setText('opt'+str(row))
|
||||
lineedit.textChanged.connect(lambda x: self.Changed.emit())
|
||||
self.table.setCellWidget(row, 0, lineedit)
|
||||
self.table.setItem(row, 1, QtWidgets.QTableWidgetItem('None'))
|
||||
|
||||
self.table.setItem(row, 2, QtWidgets.QTableWidgetItem(''))
|
||||
cb = QtWidgets.QComboBox()
|
||||
cb.addItems(['None', 'str', 'float', 'int', 'bool'])
|
||||
cb.currentIndexChanged.connect(lambda x: self.Changed.emit())
|
||||
self.table.setCellWidget(row, 2, cb)
|
||||
|
||||
self.table.blockSignals(False)
|
||||
|
||||
self.Changed.emit()
|
||||
|
||||
def remove_option(self):
|
||||
if self.table.rowCount() > 1:
|
||||
self.table.blockSignals(True)
|
||||
self.table.removeRow(self.table.currentRow())
|
||||
self.table.blockSignals(False)
|
||||
self.Changed.emit()
|
||||
|
||||
def get_parameter(self) -> str:
|
||||
return f'{self.name_line.text()}={self._make_value(0)!r}'
|
||||
|
||||
def get_strings(self) -> str:
|
||||
opts = []
|
||||
for i in range(self.table.rowCount()):
|
||||
name = self.table.item(i, 0).text()
|
||||
val = self._make_value(i)
|
||||
opts.append(f'{name!r}: {val!r}')
|
||||
|
||||
opts = f"{{{', '.join(opts)}}}"
|
||||
|
||||
disp = self.display_line.text()
|
||||
name = self.name_line.text()
|
||||
if disp == '':
|
||||
ret_val = '(' + ', '.join([repr(name), repr(name), opts]) + ')'
|
||||
else:
|
||||
ret_val = '(' + ', '.join([repr(name), repr(disp), opts]) + ')'
|
||||
|
||||
return ret_val
|
||||
|
||||
def _make_value(self, i) -> Any:
|
||||
dtype = self.table.cellWidget(i, 2).currentIndex()
|
||||
val = self.table.item(i, 1).text()
|
||||
cast = [None, str, float, int, bool]
|
||||
if dtype == 0:
|
||||
val = None
|
||||
else:
|
||||
try:
|
||||
val = cast[dtype](val)
|
||||
except:
|
||||
raise ValueError(f'Invalid argument for {self.table.cellWidget(i, 0).text()}')
|
||||
|
||||
return val
|
||||
|
||||
|
||||
class ArgWidget(QtWidgets.QWidget):
|
||||
Changed = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self._setup_ui()
|
||||
|
||||
def _setup_ui(self):
|
||||
layout = QtWidgets.QGridLayout()
|
||||
layout.setContentsMargins(3, 3, 3, 3)
|
||||
layout.setHorizontalSpacing(3)
|
||||
|
||||
self.table = QtWidgets.QTableWidget(self)
|
||||
self.table.setColumnCount(4)
|
||||
self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
self.table.setRowCount(0)
|
||||
self.table.setHorizontalHeaderLabels(['Variable', 'Disp. name', 'Lower bound', 'Upper bound'])
|
||||
self.table.itemChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.table, 0, 0, 1, 3)
|
||||
|
||||
self.add_button = QtWidgets.QPushButton('Add parameter', self)
|
||||
self.add_button.clicked.connect(self.add_variable)
|
||||
layout.addWidget(self.add_button, 1, 0, 1, 1)
|
||||
|
||||
self.rem_button = QtWidgets.QPushButton('Remove parameter', self)
|
||||
self.rem_button.clicked.connect(self.remove_variable)
|
||||
layout.addWidget(self.rem_button, 1, 1, 1, 1)
|
||||
|
||||
spacer = QtWidgets.QSpacerItem(0, 0)
|
||||
layout.addItem(spacer, 1, 2, 1, 1)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
def add_variable(self):
|
||||
self.table.blockSignals(True)
|
||||
row = self.table.rowCount()
|
||||
self.table.setRowCount(row + 1)
|
||||
|
||||
self.table.setItem(row, 0, QtWidgets.QTableWidgetItem('p' + str(row)))
|
||||
# arguments cannot start with a number or have spaces
|
||||
lineedit = QtWidgets.QLineEdit()
|
||||
lineedit.setValidator(validator)
|
||||
lineedit.setFrame(False)
|
||||
lineedit.setText('p'+str(row))
|
||||
lineedit.textChanged.connect(lambda x: self.Changed.emit())
|
||||
self.table.setCellWidget(row, 0, lineedit)
|
||||
|
||||
self.table.setItem(row, 1, QtWidgets.QTableWidgetItem('p_{' + str(row) + '}'))
|
||||
self.table.setItem(row, 2, QtWidgets.QTableWidgetItem('--'))
|
||||
self.table.setItem(row, 3, QtWidgets.QTableWidgetItem('--'))
|
||||
self.table.blockSignals(False)
|
||||
|
||||
self.Changed.emit()
|
||||
|
||||
def remove_variable(self):
|
||||
self.table.blockSignals(True)
|
||||
self.table.removeRow(self.table.currentRow())
|
||||
self.table.blockSignals(False)
|
||||
|
||||
self.Changed.emit()
|
||||
|
||||
def get_parameter(self) -> list[str]:
|
||||
var = []
|
||||
for row in range(self.table.rowCount()):
|
||||
var.append(self.table.cellWidget(row, 0).text())
|
||||
|
||||
return var
|
||||
|
||||
def get_strings(self):
|
||||
args = []
|
||||
bnds = []
|
||||
for row in range(self.table.rowCount()):
|
||||
args.append(self.table.item(row, 1).text())
|
||||
lb = self.table.item(row, 2).text()
|
||||
lb = None if lb in ['--', 'None'] else float(lb)
|
||||
|
||||
ub = self.table.item(row, 3).text()
|
||||
ub = None if ub in ['--', 'None'] else float(ub)
|
||||
|
||||
if ub is not None and lb is not None:
|
||||
if not (lb < ub):
|
||||
raise ValueError('Some bounds are invalid')
|
||||
|
||||
bnds.append(f'({lb}, {ub})')
|
||||
|
||||
stringi = f' params = {args}\n'
|
||||
stringi += f" bounds = [{', '.join(bnds)}]\n"
|
||||
|
||||
return stringi
|
||||
|
||||
|
||||
class DescWidget(QtWidgets.QWidget):
|
||||
Changed = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self._setup_ui()
|
||||
|
||||
def _setup_ui(self):
|
||||
layout = QtWidgets.QGridLayout()
|
||||
layout.setContentsMargins(3, 3, 3, 3)
|
||||
layout.setSpacing(3)
|
||||
|
||||
self.klass_label = QtWidgets.QLabel('Class', self)
|
||||
layout.addWidget(self.klass_label, 0, 0, 1, 1)
|
||||
self.klass_lineedit = QtWidgets.QLineEdit(self)
|
||||
self.klass_lineedit.setValidator(validator)
|
||||
self.klass_lineedit.setText('UserClass')
|
||||
self.klass_lineedit.textChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.klass_lineedit, 0, 1, 1, 1)
|
||||
|
||||
self.name_label = QtWidgets.QLabel('Name', self)
|
||||
layout.addWidget(self.name_label, 1, 0, 1, 1)
|
||||
self.name_lineedit = QtWidgets.QLineEdit(self)
|
||||
self.name_lineedit.setText('Name of function')
|
||||
self.name_lineedit.textChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.name_lineedit, 1, 1, 1, 1)
|
||||
|
||||
self.group_label = QtWidgets.QLabel('Group', self)
|
||||
layout.addWidget(self.group_label, 2, 0, 1, 1)
|
||||
self.group_lineedit = QtWidgets.QLineEdit(self)
|
||||
self.group_lineedit.setText('User-defined')
|
||||
self.group_lineedit.textChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.group_lineedit, 2, 1, 1, 1)
|
||||
|
||||
self.eq_label = QtWidgets.QLabel('Disp. equation', self)
|
||||
layout.addWidget(self.eq_label, 3, 0, 1, 1)
|
||||
self.eq_lineedit = QtWidgets.QLineEdit(self)
|
||||
self.eq_lineedit.textChanged.connect(lambda x: self.Changed.emit())
|
||||
layout.addWidget(self.eq_lineedit, 3, 1, 1, 1)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
def get_strings(self) -> str:
|
||||
if self.klass_lineedit.text() == '':
|
||||
raise ValueError('Class name is empty')
|
||||
stringi = f'class {self.klass_lineedit.text()}:\n' \
|
||||
f' name = {self.name_lineedit.text()!r}\n' \
|
||||
f' group = {self.group_lineedit.text()!r}\n' \
|
||||
f' equation = {self.eq_lineedit.text()!r}\n'
|
||||
|
||||
return stringi
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
app = QtWidgets.QApplication([])
|
||||
win = QUserFitCreator()
|
||||
win.show()
|
||||
|
||||
sys.exit(app.exec())
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user