Commit f44697b2 authored by Yan's avatar Yan
Browse files

Minor fix in DRL, modified autozoomy

* in DRL table QComboBox should not be always selected (will need to
verify)
* autozoomy now auto-zooms when mass span selection is performed
parent 13a16edf
......@@ -273,7 +273,8 @@ def add_line(ds, drls, drlspectrum):
for i in range(drls['cors']):
corfor = QtWidgets.QComboBox()
corfor.setFocusProxy(drls['dt'])
#TODO: verify on windows that this fixed the weird selection issues
#corfor.setFocusProxy(drls['dt'])
corfor.setFrame(False)
drls['dt'].setCellWidget(newrow, 1+i*2, corfor)
drls['dt'].setItem(newrow, 2+i*2, QtWidgets.QTableWidgetItem())
......
......@@ -76,6 +76,7 @@ def pan_factory(axis, plot=None):
fig.canvas.mpl_disconnect(id_release)
if type(pd) is dict and "annotation" in pd:
ann_spec(ax, pd)
autozoomy(msdata['autoy'], ms_spec, msdata)
ax.figure.canvas.draw()
fig = axis.get_figure()
......@@ -83,10 +84,11 @@ def pan_factory(axis, plot=None):
lambda action: pan_fun(action, axis, plot))
def pick_masses(x_min, x_max, mpl_spectrum, mass_spect):
def pick_masses(x_min, x_max, ms_spec, msdata):
"""zoom the spectrum in x axis by mass range"""
mpl_spectrum.set_xlim(x_min, x_max)
ann_spec(mpl_spectrum, mass_spect)
ms_spec.set_xlim(x_min, x_max)
autozoomy(msdata['autoy'], ms_spec, msdata)
ann_spec(ms_spec, msdata)
def plot_subtime(mpl_spectrum, mpl_chromatogram, data_set, mass_spect,
......@@ -146,8 +148,10 @@ def autozoomy(state, ms_spec, msdata):
msdata['autoy'] = True
ms_spec.autoscale(True, 'y')
ymin = -0.01
ms_spec.set_ylim(ms_spec.get_ylim()[1]*ymin,
ms_spec.get_ylim()[1]*1.1)
argvis = dt.argsubselect(msdata['x'], *ms_spec.get_xlim())
ymax = max(msdata['y'][argvis])
ms_spec.set_ylim(ymax*ymin,
ymax*1.1)
ms_spec.figure.canvas.draw()
else:
msdata['autoy'] = False
......
Supports Markdown
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