forked from IPKM/nmreval
generalize binning
This commit is contained in:
@ -480,9 +480,9 @@ class ExperimentContainer(QtCore.QObject):
|
||||
|
||||
return new_data
|
||||
|
||||
def binning(self, digits: int):
|
||||
def binning(self, digits: float):
|
||||
new_data = self.copy(full=True)
|
||||
new_data.data = self._data.binning(decimals=digits)
|
||||
new_data.data = self._data.binning(value=digits)
|
||||
|
||||
return new_data
|
||||
|
||||
|
@ -67,9 +67,9 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.dsc_plot.removeItem(val)
|
||||
self.graphicsView_2.removeItem(val)
|
||||
|
||||
for plt in self._hodge.values():
|
||||
for key, plt in self._hodge.items():
|
||||
plt[0].setData(x=[], y=[])
|
||||
plt[1] = None
|
||||
self._hodge[key] = (plt[0], None)
|
||||
|
||||
self._dsc = {}
|
||||
self._plots = {}
|
||||
|
@ -702,7 +702,7 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
||||
dialog = BinningWindow(self)
|
||||
res = dialog.exec()
|
||||
if res:
|
||||
digits = dialog.spinbox.value()
|
||||
digits = float(dialog.spinbox.text())
|
||||
self.management.binning(digits)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_actionDerivation_triggered')
|
||||
|
@ -766,7 +766,7 @@ class UpperManagement(QtCore.QObject):
|
||||
|
||||
self.newData.emit(new_key, dest_graph)
|
||||
|
||||
def binning(self, digits: int):
|
||||
def binning(self, digits: float):
|
||||
_active = self.graphs[self.current_graph].active
|
||||
new_data = []
|
||||
for sid in _active:
|
||||
|
@ -1,4 +1,4 @@
|
||||
from ..Qt import QtWidgets
|
||||
from ..Qt import QtWidgets, QtGui
|
||||
|
||||
|
||||
class BinningWindow(QtWidgets.QDialog):
|
||||
@ -8,9 +8,9 @@ class BinningWindow(QtWidgets.QDialog):
|
||||
layout = QtWidgets.QFormLayout()
|
||||
|
||||
self.label = QtWidgets.QLabel('Digits (negative values position left of decimal point)')
|
||||
self.spinbox = QtWidgets.QSpinBox()
|
||||
self.spinbox.setMinimum(-10)
|
||||
self.spinbox.setMaximum(10)
|
||||
self.spinbox = QtWidgets.QLineEdit()
|
||||
self.spinbox.setValidator(QtGui.QDoubleValidator())
|
||||
self.spinbox.setText('1')
|
||||
layout.addRow(self.label, self.spinbox)
|
||||
|
||||
self.dialogbox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
|
||||
|
Reference in New Issue
Block a user