Commit 5acb10b1 authored by Yan's avatar Yan

DRLtools - copy spectrum works

* added ctrl+c for DRL spectrum
parent 59ba6394
......@@ -13,7 +13,7 @@ from . import zcetools_help
from . import reactivitytools
__version__ = "0.0.32"
__version__ = "0.0.33"
__all__ = ['config', 'datatools', 'docks', 'drltools', 'drltoos_gui', 'filetools',
......
......@@ -30,6 +30,9 @@ def settings():
("imggen/zcespec_xinch", 5),
("imggen/zcespec_yinch", 2),
("imggen/zcespec_dpi", 300),
("imggen/drlspec_xinch", 10),
("imggen/drlspec_yinch", 4),
("imggen/drlspec_dpi", 300),
("imggen/reactspecspec_xinch", 3.5),
("imggen/reactspecspec_yinch", 2),
("imggen/reactspecspec_dpi", 300),
......
......@@ -14,6 +14,7 @@ import prasopes.filetools as ft
import prasopes.config as cf
import prasopes.reactivitytools as rt
import prasopes.drltools as drl
import prasopes.imagetools as imgt
import os.path
import logging
matplotlib.use("Qt5Agg")
......@@ -486,6 +487,12 @@ def paste_clip(ds, drls, drlspectrum):
and i < table.rowCount():
table.item(i, j).setText(col)
def paint_override(self, ds, drls, drlspectrum):
update_drlspectrum(ds, drls, self.plot)
self.plot.set_xlim(drlspectrum.get_xlim())
self.plot.set_ylim(drlspectrum.get_ylim())
self.plot.figure.canvas.draw()
def key_pressed(event, ds, drls, drlspectrum):
if event.key() == QtCore.Qt.Key_Delete:
......@@ -498,7 +505,13 @@ def key_pressed(event, ds, drls, drlspectrum):
update_profile(drls['pt'], row, ds)
if event.key() == QtCore.Qt.Key_C\
and event.modifiers().__int__() == QtCore.Qt.ControlModifier:
clip_range(drls)
if drls['dt'].underMouse() or drls['pt'].underMouse():
clip_range(drls)
else:
imggen = imgt.ImagePainter("drlspec")
imggen.popfig = lambda: paint_override(
imggen, ds, drls, drlspectrum)
imggen.clip()
if event.key() == QtCore.Qt.Key_V\
and event.modifiers().__int__() == QtCore.Qt.ControlModifier:
paste_clip(ds, drls, drlspectrum)
......
......@@ -63,6 +63,12 @@ class reactivityParam(QtWidgets.QHBoxLayout):
self.addWidget(self.dial, stretch=1)
def paint_override(self, augCanvas, drls, grph, labels, parselect):
pop_dial(augCanvas, drls, self.plot, labels, parselect)
self.plot.set_xlim(grph.get_xlim())
self.plot.set_ylim(grph.get_ylim())
def key_pressed(event, augCanvas, drls, grph, labels, parselect):
if event.key() == QtCore.Qt.Key_C:
if event.modifiers().__int__() == QtCore.Qt.ControlModifier:
......@@ -106,12 +112,6 @@ def update_parselect(augCanvas, parselect):
parselect.setCurrentIndex(index)
def paint_override(self, augCanvas, drls, grph, labels, parselect):
pop_dial(augCanvas, drls, self.plot, labels, parselect)
self.plot.set_xlim(grph.get_xlim())
self.plot.set_ylim(grph.get_ylim())
def pop_dial(augCanvas, drls, graph, labels, parselect):
logger.debug("populating reactivity dialog")
# Do not do anything when data set is not populated
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment