From 40b21305613a24403a913bb335b5f01140be2259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Wed, 28 Nov 2012 09:46:37 +0100 Subject: [PATCH] updating selected profile part when solder data changes --- reflowctl/reflowctl_gui.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reflowctl/reflowctl_gui.py b/reflowctl/reflowctl_gui.py index 4d3390e..5e9fb22 100755 --- a/reflowctl/reflowctl_gui.py +++ b/reflowctl/reflowctl_gui.py @@ -51,6 +51,8 @@ class Plotter(FigureCanvas): self.selx = list() self.sely = list() + self.selected_ix = 0 + self.setParent(parent) self.myapp = myapp self.solder = None @@ -81,8 +83,7 @@ class Plotter(FigureCanvas): def set_picked(self, ix): if isinstance(ix, QtCore.QModelIndex): ix = ix.row() - self.selx = numpy.array(map(float, self.x[ix:ix + 2])) - self.sely = numpy.array(map(float, self.y[ix:ix + 2])) + self.selected_ix = ix self.updated = True def update_figure(self): @@ -105,6 +106,9 @@ class Plotter(FigureCanvas): self.plot_data.set_xdata(self.x) self.plot_data.set_ydata(self.y) + self.selx = numpy.array(map(float, self.x[self.selected_ix:self.selected_ix + 2])) + self.sely = numpy.array(map(float, self.y[self.selected_ix:self.selected_ix + 2])) + self.selection_data.set_xdata(self.selx) self.selection_data.set_ydata(self.sely)