updating selected profile part when solder data changes
This commit is contained in:
parent
4ad06f77d4
commit
40b2130561
|
@ -51,6 +51,8 @@ class Plotter(FigureCanvas):
|
||||||
self.selx = list()
|
self.selx = list()
|
||||||
self.sely = list()
|
self.sely = list()
|
||||||
|
|
||||||
|
self.selected_ix = 0
|
||||||
|
|
||||||
self.setParent(parent)
|
self.setParent(parent)
|
||||||
self.myapp = myapp
|
self.myapp = myapp
|
||||||
self.solder = None
|
self.solder = None
|
||||||
|
@ -81,8 +83,7 @@ class Plotter(FigureCanvas):
|
||||||
def set_picked(self, ix):
|
def set_picked(self, ix):
|
||||||
if isinstance(ix, QtCore.QModelIndex):
|
if isinstance(ix, QtCore.QModelIndex):
|
||||||
ix = ix.row()
|
ix = ix.row()
|
||||||
self.selx = numpy.array(map(float, self.x[ix:ix + 2]))
|
self.selected_ix = ix
|
||||||
self.sely = numpy.array(map(float, self.y[ix:ix + 2]))
|
|
||||||
self.updated = True
|
self.updated = True
|
||||||
|
|
||||||
def update_figure(self):
|
def update_figure(self):
|
||||||
|
@ -105,6 +106,9 @@ class Plotter(FigureCanvas):
|
||||||
self.plot_data.set_xdata(self.x)
|
self.plot_data.set_xdata(self.x)
|
||||||
self.plot_data.set_ydata(self.y)
|
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_xdata(self.selx)
|
||||||
self.selection_data.set_ydata(self.sely)
|
self.selection_data.set_ydata(self.sely)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue