made it a bit more generic; naming
This commit is contained in:
@ -47,13 +47,13 @@ class MainWindow(QMainWindow):
|
|||||||
self.sig_make_new_plot.emit(name, pd)
|
self.sig_make_new_plot.emit(name, pd)
|
||||||
|
|
||||||
|
|
||||||
def append_data(self, name, xy):
|
def append_data(self, name, point):
|
||||||
lst = self.lst
|
lst = self.lst
|
||||||
lst.append(name, xy)
|
lst.append(name, point)
|
||||||
for sub in self.mdi.subWindowList():
|
for sub in self.mdi.subWindowList():
|
||||||
if sub.windowTitle() == name:
|
if sub.windowTitle() == name:
|
||||||
pd = lst.data[name]
|
pd = lst.data[name]
|
||||||
sub.plot.setData(pd.xs, pd.ys)
|
sub.plot.setData(*pd.data)
|
||||||
|
|
||||||
|
|
||||||
def on_select_list_item(self, index):
|
def on_select_list_item(self, index):
|
||||||
|
@ -12,6 +12,11 @@ class PlotDescription:
|
|||||||
self.style = pg_plot_style()
|
self.style = pg_plot_style()
|
||||||
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
def data(self):
|
||||||
|
return (self.xs, self.ys)
|
||||||
|
|
||||||
|
|
||||||
def append(self, xy):
|
def append(self, xy):
|
||||||
x, y = xy
|
x, y = xy
|
||||||
self.xs.append(x)
|
self.xs.append(x)
|
||||||
|
Reference in New Issue
Block a user