forked from IPKM/nmreval
extrapolate_fit (#21)
New sets with arbitrary x range can be created from fit results Co-authored-by: Dominik Demuth <dominik.demuth@physik.tu-darmstadt.de> Reviewed-on: IPKM/nmreval#21
This commit is contained in:
@ -17,6 +17,7 @@ class DataTree(QtWidgets.QTreeWidget):
|
||||
moveItem = QtCore.pyqtSignal(list, str, str, int) # items, from, to, new row
|
||||
copyItem = QtCore.pyqtSignal(list, str)
|
||||
saveFits = QtCore.pyqtSignal(list)
|
||||
extendFits = QtCore.pyqtSignal(list)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent=parent)
|
||||
@ -387,6 +388,10 @@ class DataTree(QtWidgets.QTreeWidget):
|
||||
for c in available_cycles.keys():
|
||||
col_menu.addAction(c)
|
||||
|
||||
action = menu.exec(evt.globalPos())
|
||||
if action is None:
|
||||
return
|
||||
|
||||
graphs = []
|
||||
items = []
|
||||
for i in self.selectedIndexes():
|
||||
@ -395,7 +400,6 @@ class DataTree(QtWidgets.QTreeWidget):
|
||||
items.append(self.itemFromIndex(i))
|
||||
graphs.append(self.itemFromIndex(i).data(0, QtCore.Qt.UserRole))
|
||||
|
||||
action = menu.exec(evt.globalPos())
|
||||
if action == del_action:
|
||||
for gid in graphs:
|
||||
self.management.delete_graph(gid)
|
||||
@ -414,8 +418,7 @@ class DataTree(QtWidgets.QTreeWidget):
|
||||
del_action = menu.addAction('Exterminate sets')
|
||||
cp_action = menu.addAction('Replicate sets')
|
||||
cat_action = menu.addAction('Join us!')
|
||||
plt_action = None
|
||||
save_action = None
|
||||
plt_action = save_action = extend_action = None
|
||||
menu.addSeparator()
|
||||
col_menu = menu.addMenu('Color cycle')
|
||||
for c in available_cycles.keys():
|
||||
@ -446,6 +449,7 @@ class DataTree(QtWidgets.QTreeWidget):
|
||||
menu.addSeparator()
|
||||
plt_action = menu.addAction('Plot fit parameter')
|
||||
save_action = menu.addAction('Save fit parameter')
|
||||
extend_action = menu.addAction('Extrapolate fit')
|
||||
|
||||
action = menu.exec(evt.globalPos())
|
||||
|
||||
@ -469,6 +473,9 @@ class DataTree(QtWidgets.QTreeWidget):
|
||||
elif action == save_action:
|
||||
self.saveFits.emit(s)
|
||||
|
||||
elif action == extend_action:
|
||||
self.extendFits.emit(s)
|
||||
|
||||
elif action.parent() == col_menu:
|
||||
self.management.set_cycle(s, action.text())
|
||||
|
||||
|
Reference in New Issue
Block a user