Commit f6740c3c authored by Yan's avatar Yan
Browse files

Fix after uniting of spectrum variables

parent 0ff0d305
......@@ -322,7 +322,8 @@ def main():
type=bool))
intensitiesact.triggered.connect(lambda: config.setValue(
"view/intensities", intensitiesact.isChecked()))
intensitiesact.triggered.connect(lambda: gt.ann_spec(augCanvas))
intensitiesact.triggered.connect(lambda: gt.ann_spec(
augCanvas.spectplot, augCanvas.ms))
intensitiesact.triggered.connect(lambda: augCanvas.draw())
oddevenact = QtWidgets.QAction("&Odd / even", None, checkable=True,
checked=config.value("view/oddeven", type=bool))
......
......@@ -15,14 +15,14 @@ def argsubselect(array, minimum, maximum):
return args
def specttostr(spectrum, chrom_ds, fn, delim=" "):
lines = spectrum.get_lines()
def specttostr(augCanvas, delim=" "):
lines = augCanvas.spectplot.get_lines()
setnum = len(lines)
names = delim.join(["mass ion_count" for i in range(setnum)])
units = (delim+delim).join(["m/z" for i in range(setnum)])
description = ("{}_{:.4}-{:.4}_minutes_of_the_aquisition\n".format(
os.path.basename(fn[0]),
chrom_ds['t_start'], chrom_ds['t_end']))
os.path.basename(augCanvas.filename),
augCanvas.chrom['t_start'], augCanvas.chrom['t_end']))
header = "\n".join([names, units, description])
strdata = []
......@@ -35,9 +35,9 @@ def specttostr(spectrum, chrom_ds, fn, delim=" "):
return "{}{}".format(header, strdata)
def clip_spectstr(spectrum, chrom_ds, fn):
string = specttostr(spectrum, chrom_ds, fn, delim="\t")
QtWidgets.QApplication.clipboard().setText(string)
def clip_spectstr(augCanvas):
string = specttostr(augCanvas, delim="\t")
[QtWidgets.QApplication.clipboard().setText(string, i) for i in range(2)]
def table(labels, minsizex=600, minsizey=0):
......
......@@ -27,9 +27,9 @@ def get_save_filename(caption, fnfilter, suffix, parent):
return filename
def export_dial(spectrum, chrom_spec, fn, main_window):
def export_dial(augCanvas, main_window):
"""exports the chromatogram into the .dat file format"""
if fn[0] is None:
if not augCanvas.filename:
QtWidgets.QMessageBox.warning(
main_window, "Export spectrum",
"Nothing to export, cancelling request")
......@@ -38,5 +38,5 @@ def export_dial(spectrum, chrom_spec, fn, main_window):
"Export spectrum", "dat table (*.dat)", "dat", main_window)
if exp_f_name is not '':
expf = open(exp_f_name, 'w')
expf.write(dt.specttostr(spectrum, chrom_spec, fn))
expf.write(dt.specttostr(augCanvas))
expf.close
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