selecting x value as label for point selection should work
This commit is contained in:
parent
8d1ccd22fa
commit
f6b7ebec07
@ -14,29 +14,19 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||||||
class Ui_Form(object):
|
class Ui_Form(object):
|
||||||
def setupUi(self, Form):
|
def setupUi(self, Form):
|
||||||
Form.setObjectName("Form")
|
Form.setObjectName("Form")
|
||||||
Form.resize(498, 746)
|
Form.resize(417, 746)
|
||||||
self.gridLayout_2 = QtWidgets.QGridLayout(Form)
|
self.gridLayout = QtWidgets.QGridLayout(Form)
|
||||||
self.gridLayout_2.setVerticalSpacing(9)
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
self.label_2 = QtWidgets.QLabel(Form)
|
||||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
self.label_2.setObjectName("label_2")
|
||||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
self.gridLayout.addWidget(self.label_2, 0, 0, 1, 2)
|
||||||
self.lineEdit_2 = QtWidgets.QLineEdit(Form)
|
self.peaktable = QtWidgets.QListWidget(Form)
|
||||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
self.peaktable.setEditTriggers(QtWidgets.QAbstractItemView.DoubleClicked|QtWidgets.QAbstractItemView.EditKeyPressed)
|
||||||
self.horizontalLayout_2.addWidget(self.lineEdit_2)
|
self.peaktable.setObjectName("peaktable")
|
||||||
self.lineEdit = QtWidgets.QLineEdit(Form)
|
self.gridLayout.addWidget(self.peaktable, 1, 0, 1, 2)
|
||||||
self.lineEdit.setObjectName("lineEdit")
|
self.special_checkbox = QtWidgets.QCheckBox(Form)
|
||||||
self.horizontalLayout_2.addWidget(self.lineEdit)
|
self.special_checkbox.setObjectName("special_checkbox")
|
||||||
self.comboBox_2 = QtWidgets.QComboBox(Form)
|
self.gridLayout.addWidget(self.special_checkbox, 3, 0, 1, 1)
|
||||||
self.comboBox_2.setObjectName("comboBox_2")
|
|
||||||
self.comboBox_2.addItem("")
|
|
||||||
self.comboBox_2.addItem("")
|
|
||||||
self.horizontalLayout_2.addWidget(self.comboBox_2)
|
|
||||||
self.gridLayout_2.addLayout(self.horizontalLayout_2, 4, 1, 1, 1)
|
|
||||||
self.comboBox = QtWidgets.QComboBox(Form)
|
|
||||||
self.comboBox.setObjectName("comboBox")
|
|
||||||
self.comboBox.addItem("")
|
|
||||||
self.comboBox.addItem("")
|
|
||||||
self.gridLayout_2.addWidget(self.comboBox, 7, 1, 1, 1)
|
|
||||||
self.special_comboBox = QtWidgets.QComboBox(Form)
|
self.special_comboBox = QtWidgets.QComboBox(Form)
|
||||||
self.special_comboBox.setEnabled(False)
|
self.special_comboBox.setEnabled(False)
|
||||||
self.special_comboBox.setObjectName("special_comboBox")
|
self.special_comboBox.setObjectName("special_comboBox")
|
||||||
@ -44,59 +34,29 @@ class Ui_Form(object):
|
|||||||
self.special_comboBox.addItem("")
|
self.special_comboBox.addItem("")
|
||||||
self.special_comboBox.addItem("")
|
self.special_comboBox.addItem("")
|
||||||
self.special_comboBox.addItem("")
|
self.special_comboBox.addItem("")
|
||||||
self.gridLayout_2.addWidget(self.special_comboBox, 3, 1, 1, 1)
|
self.gridLayout.addWidget(self.special_comboBox, 3, 1, 1, 1)
|
||||||
self.graph_checkbox = QtWidgets.QCheckBox(Form)
|
spacerItem = QtWidgets.QSpacerItem(20, 30, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||||
self.graph_checkbox.setChecked(True)
|
self.gridLayout.addItem(spacerItem, 4, 0, 1, 1)
|
||||||
self.graph_checkbox.setObjectName("graph_checkbox")
|
|
||||||
self.gridLayout_2.addWidget(self.graph_checkbox, 8, 0, 1, 1)
|
|
||||||
self.label = QtWidgets.QLabel(Form)
|
|
||||||
self.label.setObjectName("label")
|
|
||||||
self.gridLayout_2.addWidget(self.label, 7, 0, 1, 1)
|
|
||||||
self.graph_combobox = QtWidgets.QComboBox(Form)
|
|
||||||
self.graph_combobox.setEnabled(False)
|
|
||||||
self.graph_combobox.setObjectName("graph_combobox")
|
|
||||||
self.gridLayout_2.addWidget(self.graph_combobox, 8, 1, 1, 1)
|
|
||||||
self.deleteButton = QtWidgets.QPushButton(Form)
|
|
||||||
icon = QtGui.QIcon.fromTheme("dialog-cancel")
|
|
||||||
self.deleteButton.setIcon(icon)
|
|
||||||
self.deleteButton.setObjectName("deleteButton")
|
|
||||||
self.gridLayout_2.addWidget(self.deleteButton, 2, 0, 1, 2)
|
|
||||||
self.peaktable = QtWidgets.QListWidget(Form)
|
|
||||||
self.peaktable.setEditTriggers(QtWidgets.QAbstractItemView.DoubleClicked|QtWidgets.QAbstractItemView.EditKeyPressed)
|
|
||||||
self.peaktable.setObjectName("peaktable")
|
|
||||||
self.gridLayout_2.addWidget(self.peaktable, 1, 0, 1, 2)
|
|
||||||
self.checkBox = QtWidgets.QCheckBox(Form)
|
|
||||||
self.checkBox.setObjectName("checkBox")
|
|
||||||
self.gridLayout_2.addWidget(self.checkBox, 3, 0, 1, 1)
|
|
||||||
self.okButton = QtWidgets.QPushButton(Form)
|
|
||||||
icon = QtGui.QIcon.fromTheme("dialog-ok")
|
|
||||||
self.okButton.setIcon(icon)
|
|
||||||
self.okButton.setObjectName("okButton")
|
|
||||||
self.gridLayout_2.addWidget(self.okButton, 9, 0, 1, 2)
|
|
||||||
self.label_5 = QtWidgets.QLabel(Form)
|
|
||||||
self.label_5.setObjectName("label_5")
|
|
||||||
self.gridLayout_2.addWidget(self.label_5, 5, 0, 1, 1)
|
|
||||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
|
||||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
|
||||||
self.xbutton = QtWidgets.QCheckBox(Form)
|
|
||||||
self.xbutton.setObjectName("xbutton")
|
|
||||||
self.horizontalLayout.addWidget(self.xbutton)
|
|
||||||
self.ybutton = QtWidgets.QCheckBox(Form)
|
|
||||||
self.ybutton.setChecked(True)
|
|
||||||
self.ybutton.setObjectName("ybutton")
|
|
||||||
self.horizontalLayout.addWidget(self.ybutton)
|
|
||||||
self.gridLayout_2.addLayout(self.horizontalLayout, 6, 1, 1, 1)
|
|
||||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
|
||||||
self.gridLayout_2.addItem(spacerItem, 10, 0, 1, 1)
|
|
||||||
self.label_3 = QtWidgets.QLabel(Form)
|
self.label_3 = QtWidgets.QLabel(Form)
|
||||||
self.label_3.setObjectName("label_3")
|
self.label_3.setObjectName("label_3")
|
||||||
self.gridLayout_2.addWidget(self.label_3, 4, 0, 1, 1)
|
self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
|
||||||
self.label_4 = QtWidgets.QLabel(Form)
|
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||||
self.label_4.setObjectName("label_4")
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
self.gridLayout_2.addWidget(self.label_4, 6, 0, 1, 1)
|
self.left_limit = QtWidgets.QLineEdit(Form)
|
||||||
self.label_2 = QtWidgets.QLabel(Form)
|
self.left_limit.setObjectName("left_limit")
|
||||||
self.label_2.setObjectName("label_2")
|
self.horizontalLayout_2.addWidget(self.left_limit)
|
||||||
self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 2)
|
self.right_limit = QtWidgets.QLineEdit(Form)
|
||||||
|
self.right_limit.setObjectName("right_limit")
|
||||||
|
self.horizontalLayout_2.addWidget(self.right_limit)
|
||||||
|
self.limit_combobox = QtWidgets.QComboBox(Form)
|
||||||
|
self.limit_combobox.setObjectName("limit_combobox")
|
||||||
|
self.limit_combobox.addItem("")
|
||||||
|
self.limit_combobox.addItem("")
|
||||||
|
self.horizontalLayout_2.addWidget(self.limit_combobox)
|
||||||
|
self.gridLayout.addLayout(self.horizontalLayout_2, 5, 1, 1, 1)
|
||||||
|
self.label_5 = QtWidgets.QLabel(Form)
|
||||||
|
self.label_5.setObjectName("label_5")
|
||||||
|
self.gridLayout.addWidget(self.label_5, 6, 0, 1, 1)
|
||||||
self.average_combobox = QtWidgets.QComboBox(Form)
|
self.average_combobox = QtWidgets.QComboBox(Form)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
@ -108,52 +68,93 @@ class Ui_Form(object):
|
|||||||
self.average_combobox.addItem("")
|
self.average_combobox.addItem("")
|
||||||
self.average_combobox.addItem("")
|
self.average_combobox.addItem("")
|
||||||
self.average_combobox.addItem("")
|
self.average_combobox.addItem("")
|
||||||
self.gridLayout_2.addWidget(self.average_combobox, 5, 1, 1, 1)
|
self.gridLayout.addWidget(self.average_combobox, 6, 1, 1, 1)
|
||||||
self.label.setBuddy(self.comboBox)
|
self.label_4 = QtWidgets.QLabel(Form)
|
||||||
|
self.label_4.setObjectName("label_4")
|
||||||
|
self.gridLayout.addWidget(self.label_4, 7, 0, 1, 1)
|
||||||
|
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||||
|
self.xbutton = QtWidgets.QCheckBox(Form)
|
||||||
|
self.xbutton.setObjectName("xbutton")
|
||||||
|
self.horizontalLayout.addWidget(self.xbutton)
|
||||||
|
self.ybutton = QtWidgets.QCheckBox(Form)
|
||||||
|
self.ybutton.setChecked(True)
|
||||||
|
self.ybutton.setObjectName("ybutton")
|
||||||
|
self.horizontalLayout.addWidget(self.ybutton)
|
||||||
|
self.gridLayout.addLayout(self.horizontalLayout, 7, 1, 1, 1)
|
||||||
|
self.label = QtWidgets.QLabel(Form)
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.gridLayout.addWidget(self.label, 8, 0, 1, 1)
|
||||||
|
self.group_box = QtWidgets.QComboBox(Form)
|
||||||
|
self.group_box.setObjectName("group_box")
|
||||||
|
self.group_box.addItem("")
|
||||||
|
self.group_box.addItem("")
|
||||||
|
self.gridLayout.addWidget(self.group_box, 8, 1, 1, 1)
|
||||||
|
spacerItem1 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||||
|
self.gridLayout.addItem(spacerItem1, 9, 0, 1, 1)
|
||||||
|
self.graph_checkbox = QtWidgets.QCheckBox(Form)
|
||||||
|
self.graph_checkbox.setChecked(True)
|
||||||
|
self.graph_checkbox.setObjectName("graph_checkbox")
|
||||||
|
self.gridLayout.addWidget(self.graph_checkbox, 10, 0, 1, 1)
|
||||||
|
self.graph_combobox = QtWidgets.QComboBox(Form)
|
||||||
|
self.graph_combobox.setEnabled(False)
|
||||||
|
self.graph_combobox.setObjectName("graph_combobox")
|
||||||
|
self.gridLayout.addWidget(self.graph_combobox, 10, 1, 1, 1)
|
||||||
|
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||||
|
self.gridLayout.addItem(spacerItem2, 12, 0, 1, 1)
|
||||||
|
self.okButton = QtWidgets.QPushButton(Form)
|
||||||
|
icon = QtGui.QIcon.fromTheme("dialog-ok")
|
||||||
|
self.okButton.setIcon(icon)
|
||||||
|
self.okButton.setObjectName("okButton")
|
||||||
|
self.gridLayout.addWidget(self.okButton, 11, 0, 1, 2)
|
||||||
|
self.deleteButton = QtWidgets.QPushButton(Form)
|
||||||
|
icon = QtGui.QIcon.fromTheme("dialog-cancel")
|
||||||
|
self.deleteButton.setIcon(icon)
|
||||||
|
self.deleteButton.setObjectName("deleteButton")
|
||||||
|
self.gridLayout.addWidget(self.deleteButton, 2, 0, 1, 2)
|
||||||
|
self.label_2.setBuddy(self.peaktable)
|
||||||
self.label_5.setBuddy(self.average_combobox)
|
self.label_5.setBuddy(self.average_combobox)
|
||||||
self.label_4.setBuddy(self.xbutton)
|
self.label_4.setBuddy(self.xbutton)
|
||||||
self.label_2.setBuddy(self.peaktable)
|
self.label.setBuddy(self.group_box)
|
||||||
|
|
||||||
self.retranslateUi(Form)
|
self.retranslateUi(Form)
|
||||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||||
Form.setTabOrder(self.peaktable, self.checkBox)
|
Form.setTabOrder(self.peaktable, self.limit_combobox)
|
||||||
Form.setTabOrder(self.checkBox, self.special_comboBox)
|
Form.setTabOrder(self.limit_combobox, self.average_combobox)
|
||||||
Form.setTabOrder(self.special_comboBox, self.comboBox_2)
|
|
||||||
Form.setTabOrder(self.comboBox_2, self.average_combobox)
|
|
||||||
Form.setTabOrder(self.average_combobox, self.xbutton)
|
Form.setTabOrder(self.average_combobox, self.xbutton)
|
||||||
Form.setTabOrder(self.xbutton, self.ybutton)
|
Form.setTabOrder(self.xbutton, self.ybutton)
|
||||||
Form.setTabOrder(self.ybutton, self.comboBox)
|
Form.setTabOrder(self.ybutton, self.group_box)
|
||||||
Form.setTabOrder(self.comboBox, self.graph_checkbox)
|
Form.setTabOrder(self.group_box, self.graph_checkbox)
|
||||||
Form.setTabOrder(self.graph_checkbox, self.graph_combobox)
|
Form.setTabOrder(self.graph_checkbox, self.graph_combobox)
|
||||||
|
|
||||||
def retranslateUi(self, Form):
|
def retranslateUi(self, Form):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
Form.setWindowTitle(_translate("Form", "Form"))
|
Form.setWindowTitle(_translate("Form", "Form"))
|
||||||
self.comboBox_2.setItemText(0, _translate("Form", "points"))
|
self.label_2.setText(_translate("Form", "Selected points and regions"))
|
||||||
self.comboBox_2.setItemText(1, _translate("Form", "range"))
|
self.peaktable.setToolTip(_translate("Form", "Edit by entering new value: \n"
|
||||||
self.comboBox.setItemText(0, _translate("Form", "\"Group\" value"))
|
"Single number for points (e.g. 1e-6); \n"
|
||||||
self.comboBox.setItemText(1, _translate("Form", "x value"))
|
"two numbers separated by space for regions (e.g. 1e-6 5e-6). \n"
|
||||||
|
"Changing between regions and points is NOT possible"))
|
||||||
|
self.special_checkbox.setText(_translate("Form", "Use special value"))
|
||||||
self.special_comboBox.setToolTip(_translate("Form", "Automatic selection of respective points"))
|
self.special_comboBox.setToolTip(_translate("Form", "Automatic selection of respective points"))
|
||||||
self.special_comboBox.setItemText(0, _translate("Form", "max(y)"))
|
self.special_comboBox.setItemText(0, _translate("Form", "max(y)"))
|
||||||
self.special_comboBox.setItemText(1, _translate("Form", "max(abs(y))"))
|
self.special_comboBox.setItemText(1, _translate("Form", "max(abs(y))"))
|
||||||
self.special_comboBox.setItemText(2, _translate("Form", "min(y)"))
|
self.special_comboBox.setItemText(2, _translate("Form", "min(y)"))
|
||||||
self.special_comboBox.setItemText(3, _translate("Form", "min(abs(y))"))
|
self.special_comboBox.setItemText(3, _translate("Form", "min(abs(y))"))
|
||||||
self.graph_checkbox.setText(_translate("Form", "New graph?"))
|
|
||||||
self.label.setText(_translate("Form", "Group by"))
|
|
||||||
self.deleteButton.setText(_translate("Form", "Delete selection"))
|
|
||||||
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.checkBox.setText(_translate("Form", "Use special value"))
|
|
||||||
self.okButton.setText(_translate("Form", "Apply"))
|
|
||||||
self.label_5.setText(_translate("Form", "Aggregation"))
|
|
||||||
self.xbutton.setText(_translate("Form", "x"))
|
|
||||||
self.ybutton.setText(_translate("Form", "y"))
|
|
||||||
self.label_3.setText(_translate("Form", "Region around points"))
|
self.label_3.setText(_translate("Form", "Region around points"))
|
||||||
self.label_4.setText(_translate("Form", "New set based on"))
|
self.limit_combobox.setItemText(0, _translate("Form", "points"))
|
||||||
self.label_2.setText(_translate("Form", "Selected points and regions"))
|
self.limit_combobox.setItemText(1, _translate("Form", "range"))
|
||||||
|
self.label_5.setText(_translate("Form", "Aggregation"))
|
||||||
self.average_combobox.setItemText(0, _translate("Form", "Mean"))
|
self.average_combobox.setItemText(0, _translate("Form", "Mean"))
|
||||||
self.average_combobox.setItemText(1, _translate("Form", "Sum"))
|
self.average_combobox.setItemText(1, _translate("Form", "Sum"))
|
||||||
self.average_combobox.setItemText(2, _translate("Form", "Integral"))
|
self.average_combobox.setItemText(2, _translate("Form", "Integral"))
|
||||||
self.average_combobox.setItemText(3, _translate("Form", "Std. deviation"))
|
self.average_combobox.setItemText(3, _translate("Form", "Std. deviation"))
|
||||||
|
self.label_4.setText(_translate("Form", "New set based on"))
|
||||||
|
self.xbutton.setText(_translate("Form", "x"))
|
||||||
|
self.ybutton.setText(_translate("Form", "y"))
|
||||||
|
self.label.setText(_translate("Form", "Group by"))
|
||||||
|
self.group_box.setItemText(0, _translate("Form", "\"Group\" value"))
|
||||||
|
self.group_box.setItemText(1, _translate("Form", "x value"))
|
||||||
|
self.graph_checkbox.setText(_translate("Form", "New graph?"))
|
||||||
|
self.okButton.setText(_translate("Form", "Apply"))
|
||||||
|
self.deleteButton.setText(_translate("Form", "Delete selection"))
|
||||||
|
@ -27,14 +27,18 @@ class PointSelectWidget(QtWidgets.QWidget, Ui_Form):
|
|||||||
self._last_item = None
|
self._last_item = None
|
||||||
self.connected_figure = ''
|
self.connected_figure = ''
|
||||||
|
|
||||||
|
self._avg_modes = ['mean', 'sum', 'integral', 'std']
|
||||||
|
self._special_values = ['max', 'absmax', 'min', 'absmin']
|
||||||
|
self._group_modes = ['group', 'x']
|
||||||
|
|
||||||
self.okButton.clicked.connect(self.apply)
|
self.okButton.clicked.connect(self.apply)
|
||||||
self.deleteButton.clicked.connect(self.remove_points)
|
self.deleteButton.clicked.connect(self.remove_points)
|
||||||
|
|
||||||
self.peaktable.itemChanged.connect(self.editing_finished)
|
self.peaktable.itemChanged.connect(self.editing_finished)
|
||||||
self.peaktable.itemDoubleClicked.connect(self.editing_started)
|
self.peaktable.itemDoubleClicked.connect(self.editing_started)
|
||||||
|
|
||||||
self.lineEdit.setValidator(QtGui.QDoubleValidator())
|
self.left_limit.setValidator(QtGui.QDoubleValidator())
|
||||||
self.lineEdit_2.setValidator(QtGui.QDoubleValidator())
|
self.right_limit.setValidator(QtGui.QDoubleValidator())
|
||||||
|
|
||||||
def keyPressEvent(self, e):
|
def keyPressEvent(self, e):
|
||||||
if e.key() == QtCore.Qt.Key.Key_Delete:
|
if e.key() == QtCore.Qt.Key.Key_Delete:
|
||||||
@ -107,28 +111,21 @@ class PointSelectWidget(QtWidgets.QWidget, Ui_Form):
|
|||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def apply(self) -> dict:
|
def apply(self) -> dict:
|
||||||
ret_dic = {
|
ret_dic = {
|
||||||
'avg_range': [self.left_pt.value(), self.right_pt.value()],
|
'avg_range': self.get_limits(),
|
||||||
'avg_mode': {0: 'mean', 1: 'sum', 2: 'integral', 3: 'std'}[self.average_combobox.currentIndex()],
|
'avg_mode': self._avg_modes[self.average_combobox.currentIndex()],
|
||||||
'special': None,
|
'special': None,
|
||||||
'idx': None,
|
'idx': None,
|
||||||
'xy': (self.xbutton.isChecked(), self.ybutton.isChecked()),
|
'xy': (self.xbutton.isChecked(), self.ybutton.isChecked()),
|
||||||
|
'groupby': self._group_modes[self.group_box.currentIndex()],
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.groupBox_2.isChecked():
|
if self.special_checkbox.isChecked():
|
||||||
ret_dic['special'] = {
|
ret_dic['special'] = self._special_values[self.special_comboBox.currentIndex()]
|
||||||
0: 'max',
|
|
||||||
1: 'absmax',
|
|
||||||
2: 'min',
|
|
||||||
3: 'absmin'
|
|
||||||
}[self.special_comboBox.currentIndex()]
|
|
||||||
|
|
||||||
if len(self.pts) != 0:
|
if len(self.pts) != 0:
|
||||||
ret_dic['idx'] = self.pts
|
ret_dic['idx'] = self.pts
|
||||||
|
|
||||||
if self.graph_checkbox.isChecked():
|
gid = self.graph_combobox.currentData() if not self.graph_checkbox.isChecked() else ''
|
||||||
gid = ''
|
|
||||||
else:
|
|
||||||
gid = self.graph_combobox.currentData()
|
|
||||||
|
|
||||||
self.points_selected.emit(ret_dic, gid)
|
self.points_selected.emit(ret_dic, gid)
|
||||||
|
|
||||||
@ -213,9 +210,20 @@ class PointSelectWidget(QtWidgets.QWidget, Ui_Form):
|
|||||||
def changed_state(self, checked):
|
def changed_state(self, checked):
|
||||||
self.graph_combobox.setEnabled(checked != QtCore.Qt.CheckState.Checked)
|
self.graph_combobox.setEnabled(checked != QtCore.Qt.CheckState.Checked)
|
||||||
|
|
||||||
@QtCore.pyqtSlot(int, name='on_comboBox_2_currentIndexChanged')
|
@QtCore.pyqtSlot(int, name='on_special_checkbox_stateChanged')
|
||||||
def change_limits(self, idx: int) -> None:
|
def changed_special(self, checked: int):
|
||||||
self.left_pt.setVisible(idx == 0)
|
self.graph_combobox.setEnabled(checked != QtCore.Qt.CheckState.Checked)
|
||||||
self.right_pt.setVisible(idx == 0)
|
|
||||||
self.doubleSpinBox.setVisible(idx == 1)
|
def get_limits(self) -> tuple[float, float, str]:
|
||||||
self.doubleSpinBox_2.setVisible(idx == 1)
|
try:
|
||||||
|
left = float(self.left_limit.text())
|
||||||
|
except ValueError:
|
||||||
|
left = 0.
|
||||||
|
|
||||||
|
try:
|
||||||
|
right = float(self.right_limit.text())
|
||||||
|
except ValueError:
|
||||||
|
right = 0.
|
||||||
|
|
||||||
|
return left, right, self.limit_combobox.currentText()
|
||||||
|
|
||||||
|
@ -791,17 +791,28 @@ class UpperManagement(QtCore.QObject):
|
|||||||
_active = self.graphs[self.current_graph].active
|
_active = self.graphs[self.current_graph].active
|
||||||
|
|
||||||
new_datasets = {}
|
new_datasets = {}
|
||||||
|
groupby = params.pop('groupby')
|
||||||
|
|
||||||
for sid in _active:
|
for sid in _active:
|
||||||
data_i = self.data[sid]
|
data_i = self.data[sid]
|
||||||
|
pts = data_i.points(params)
|
||||||
|
|
||||||
|
if groupby == 'group':
|
||||||
if data_i.group not in new_datasets:
|
if data_i.group not in new_datasets:
|
||||||
new_datasets[data_i.group] = [], []
|
new_datasets[data_i.group] = [], []
|
||||||
new_x_axis, _temp = new_datasets[data_i.group]
|
new_x_axis, _temp = new_datasets[data_i.group]
|
||||||
|
|
||||||
pts = data_i.points(params)
|
|
||||||
if pts:
|
if pts:
|
||||||
new_x_axis.append(data_i.value)
|
new_x_axis.append(data_i.value)
|
||||||
_temp.append(pts)
|
_temp.append(pts)
|
||||||
|
|
||||||
|
else:
|
||||||
|
for (_x, _y, _yerr) in pts:
|
||||||
|
if _x not in new_datasets:
|
||||||
|
new_datasets[_x] = [], []
|
||||||
|
new_x_axis, _temp = new_datasets[_x]
|
||||||
|
new_x_axis.append(data_i.value)
|
||||||
|
_temp.append([[_x, _y, _yerr]])
|
||||||
|
|
||||||
key_list = []
|
key_list = []
|
||||||
for label, (new_x_axis, _temp) in new_datasets.items():
|
for label, (new_x_axis, _temp) in new_datasets.items():
|
||||||
_temp = np.array(_temp) # (number of sets, number of picks, (x, y, y_err))
|
_temp = np.array(_temp) # (number of sets, number of picks, (x, y, y_err))
|
||||||
|
@ -273,9 +273,14 @@ class Points:
|
|||||||
def length(self):
|
def length(self):
|
||||||
return len(self._x)
|
return len(self._x)
|
||||||
|
|
||||||
def points(self, idx: list = None, special: str = None,
|
def points(
|
||||||
avg_range: tuple[int, int] = (0, 0), avg_mode: str = 'mean',
|
self,
|
||||||
pts: list = None) -> list[tuple]:
|
idx: list = None,
|
||||||
|
special: str = None,
|
||||||
|
avg_range: tuple[int, int] = (0, 0),
|
||||||
|
avg_mode: str = 'mean',
|
||||||
|
pts: list = None,
|
||||||
|
) -> list[tuple]:
|
||||||
"""
|
"""
|
||||||
Return (x, y) values at specified positions.
|
Return (x, y) values at specified positions.
|
||||||
|
|
||||||
|
@ -6,53 +6,42 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>498</width>
|
<width>417</width>
|
||||||
<height>746</height>
|
<height>746</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="verticalSpacing">
|
<item row="0" column="0" colspan="2">
|
||||||
<number>9</number>
|
<widget class="QLabel" name="label_2">
|
||||||
</property>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEdit_2"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEdit"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="comboBox_2">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>points</string>
|
<string>Selected points and regions</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item>
|
<cstring>peaktable</cstring>
|
||||||
<property name="text">
|
|
||||||
<string>range</string>
|
|
||||||
</property>
|
</property>
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="1" column="0" colspan="2">
|
||||||
</item>
|
<widget class="QListWidget" name="peaktable">
|
||||||
<item row="7" column="1">
|
<property name="toolTip">
|
||||||
<widget class="QComboBox" name="comboBox">
|
<string>Edit by entering new value:
|
||||||
<item>
|
Single number for points (e.g. 1e-6);
|
||||||
<property name="text">
|
two numbers separated by space for regions (e.g. 1e-6 5e-6).
|
||||||
<string>"Group" value</string>
|
Changing between regions and points is NOT possible</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
<property name="editTriggers">
|
||||||
<item>
|
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||||
<property name="text">
|
|
||||||
<string>x value</string>
|
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="special_checkbox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use special value</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
@ -85,76 +74,54 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="graph_checkbox">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>New graph?</string>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="sizeType">
|
||||||
<bool>true</bool>
|
<enum>QSizePolicy::Preferred</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
</item>
|
<size>
|
||||||
<item row="7" column="0">
|
<width>20</width>
|
||||||
<widget class="QLabel" name="label">
|
<height>30</height>
|
||||||
<property name="text">
|
</size>
|
||||||
<string>Group by</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
</spacer>
|
||||||
<cstring>comboBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="1">
|
|
||||||
<widget class="QComboBox" name="graph_combobox">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QPushButton" name="deleteButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Delete selection</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="dialog-cancel">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QListWidget" name="peaktable">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Edit by entering new value:
|
|
||||||
Single number for points (e.g. 1e-6);
|
|
||||||
two numbers separated by space for regions (e.g. 1e-6 5e-6).
|
|
||||||
Changing between regions and points is NOT possible</string>
|
|
||||||
</property>
|
|
||||||
<property name="editTriggers">
|
|
||||||
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QCheckBox" name="checkBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Use special value</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="0" colspan="2">
|
|
||||||
<widget class="QPushButton" name="okButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Apply</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="dialog-ok">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Region around points</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="left_limit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="right_limit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="limit_combobox">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>points</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>range</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Aggregation</string>
|
<string>Aggregation</string>
|
||||||
@ -165,70 +132,6 @@ Changing between regions and points is NOT possible</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="6" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="xbutton">
|
|
||||||
<property name="text">
|
|
||||||
<string>x</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="ybutton">
|
|
||||||
<property name="text">
|
|
||||||
<string>y</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="10" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Region around points</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>New set based on</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>xbutton</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Selected points and regions</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>peaktable</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QComboBox" name="average_combobox">
|
<widget class="QComboBox" name="average_combobox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
@ -258,17 +161,141 @@ Changing between regions and points is NOT possible</string>
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>New set based on</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>xbutton</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="xbutton">
|
||||||
|
<property name="text">
|
||||||
|
<string>x</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="ybutton">
|
||||||
|
<property name="text">
|
||||||
|
<string>y</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Group by</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>group_box</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="QComboBox" name="group_box">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>"Group" value</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>x value</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<spacer name="verticalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Preferred</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QCheckBox" name="graph_checkbox">
|
||||||
|
<property name="text">
|
||||||
|
<string>New graph?</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="1">
|
||||||
|
<widget class="QComboBox" name="graph_combobox">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="0" colspan="2">
|
||||||
|
<widget class="QPushButton" name="okButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Apply</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="dialog-ok">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QPushButton" name="deleteButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Delete selection</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="dialog-cancel">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>peaktable</tabstop>
|
<tabstop>peaktable</tabstop>
|
||||||
<tabstop>checkBox</tabstop>
|
<tabstop>limit_combobox</tabstop>
|
||||||
<tabstop>special_comboBox</tabstop>
|
|
||||||
<tabstop>comboBox_2</tabstop>
|
|
||||||
<tabstop>average_combobox</tabstop>
|
<tabstop>average_combobox</tabstop>
|
||||||
<tabstop>xbutton</tabstop>
|
<tabstop>xbutton</tabstop>
|
||||||
<tabstop>ybutton</tabstop>
|
<tabstop>ybutton</tabstop>
|
||||||
<tabstop>comboBox</tabstop>
|
<tabstop>group_box</tabstop>
|
||||||
<tabstop>graph_checkbox</tabstop>
|
<tabstop>graph_checkbox</tabstop>
|
||||||
<tabstop>graph_combobox</tabstop>
|
<tabstop>graph_combobox</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
|
Loading…
Reference in New Issue
Block a user