made it a bit more generic; naming

This commit is contained in:
2022-12-19 13:12:08 +01:00
parent 48e0c35c4f
commit ba331cf6f6
2 changed files with 8 additions and 3 deletions

View File

@ -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):

View File

@ -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)