From ba331cf6f65dbbc3d1fa5a2e7dd39329ef4c7c79 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Mon, 19 Dec 2022 13:12:08 +0100 Subject: [PATCH] made it a bit more generic; naming --- mainwin.py | 6 +++--- plotdesc.py | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mainwin.py b/mainwin.py index 476c4a9..e4dceda 100644 --- a/mainwin.py +++ b/mainwin.py @@ -47,13 +47,13 @@ class MainWindow(QMainWindow): self.sig_make_new_plot.emit(name, pd) - def append_data(self, name, xy): + def append_data(self, name, point): lst = self.lst - lst.append(name, xy) + lst.append(name, point) for sub in self.mdi.subWindowList(): if sub.windowTitle() == name: pd = lst.data[name] - sub.plot.setData(pd.xs, pd.ys) + sub.plot.setData(*pd.data) def on_select_list_item(self, index): diff --git a/plotdesc.py b/plotdesc.py index be7f042..945681d 100644 --- a/plotdesc.py +++ b/plotdesc.py @@ -12,6 +12,11 @@ class PlotDescription: self.style = pg_plot_style() + @property + def data(self): + return (self.xs, self.ys) + + def append(self, xy): x, y = xy self.xs.append(x)