Commit 75ea1514 authored by 3Yan's avatar 3Yan

Update routine incorporated in-depth

* when updating the parent window, the update routine is called so
  rest of the windows gets updated.
parent 55039425
......@@ -139,6 +139,22 @@ def update_spectrum(augCanvas, config):
augCanvas.ds.clear()
[augCanvas.ds.append(dict(chrom_dat=i[0], masses=i[1], matrix=i[2]))
for i in load_raw(augCanvas.filename, config.value("tmp_location"))]
if autoparams:
try:
(augCanvas.ms['params'], rawheaders,
augCanvas.chrom['machtype']) = load_params(
augCanvas.filename, config.value("tmp_location"))
segments = [len(subset['chrom_dat'][0])
for subset in augCanvas.ds]
indicies = [sum(segments[:i+1])
for i in range(len(segments))]
augCanvas.ms['headers'] = np.split(
rawheaders, indicies)[:-1]
except Exception as pex:
QtWidgets.QMessageBox.critical(None,
"File is incompatible with the rawautoparams",
"no parameters loaded!\n\n"
"Error message:\n{}".format(pex))
gt.populate(augCanvas)
augCanvas.spectplot.set_xlim(slims[0])
augCanvas.spectplot.set_ylim(slims[1])
......@@ -193,9 +209,11 @@ def oddeven_changed(augCanvas, config, oddevenact):
update_spectrum(augCanvas, config)
def key_pressed(event, augCanvas, config):
def key_pressed(event, augCanvas, config, update):
if event.key() == QtCore.Qt.Key_F5:
update_spectrum(augCanvas, config)
if augCanvas.filename:
update.signal.emit()
if event.key() == QtCore.Qt.Key_C:
if event.modifiers().__int__() == QtCore.Qt.ControlModifier:
if augCanvas.paramstable.underMouse():
......@@ -384,7 +402,7 @@ def main():
event, main_window, augCanvas, update, config, loadthread)
main_window.setAcceptDrops(True)
main_window.keyPressEvent = lambda event: key_pressed(
event, augCanvas, config)
event, augCanvas, config, update)
main_window.resizeEvent = lambda event: augCanvas.constrained_draw()
update.signal.connect(lambda: augCanvas.constrained_draw())
......
......@@ -541,6 +541,7 @@ def main_window(parent, augCanvas, update_signal):
QtWidgets.QMainWindow.closeEvent(widget, event)
def update_fnc():
logger.info('''udate routine called''')
update_drlspectrum(ds, drls, chromplot)
def update_ptrows():
......
......@@ -55,6 +55,8 @@ def pop_dial(augCanvas, drls, graph, labels):
graph.plot(np.asarray(pressures).T[1], relint[goodtimes], label=names[i],
color=(gt.colors[i % len(gt.colors)] / 255), marker=".",
markersize=2, linestyle="None")
graph.autoscale(True)
graph.figure.canvas.draw()
def main_window(parent, augCanvas, update_signal, drls):
......
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