From ebd4fccda2321aa0dc108a5436fb4cc717911d4b Mon Sep 17 00:00:00 2001 From: wyzula-jan <133381102+wyzula-jan@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:59:36 +0100 Subject: [PATCH] fix: monitor.py clear command from BECPlotter CLI clear now flush database and clear the plots --- bec_widgets/widgets/monitor/monitor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bec_widgets/widgets/monitor/monitor.py b/bec_widgets/widgets/monitor/monitor.py index ce99f2f7..27dee8ce 100644 --- a/bec_widgets/widgets/monitor/monitor.py +++ b/bec_widgets/widgets/monitor/monitor.py @@ -613,6 +613,11 @@ class BECMonitor(pg.GraphicsLayoutWidget): self.client = client self.dev = self.client.device_manager.devices + def _close_all_plots(self): + """Close all plots.""" + for plot in self.plots.values(): + plot.clear() + @pyqtSlot(dict) def on_instruction(self, msg_content: dict) -> None: """ @@ -620,6 +625,7 @@ class BECMonitor(pg.GraphicsLayoutWidget): Possible actions are: - clear: Clear the plots - close: Close the GUI + - config_dialog: Open the configuration dialog Args: msg_content (dict): Message content with the instruction and parameters. @@ -629,6 +635,7 @@ class BECMonitor(pg.GraphicsLayoutWidget): if action == "clear": self.flush() + self._close_all_plots() elif action == "close": self.close() elif action == "config_dialog":