mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
fix: monitor.py clear command from BECPlotter CLI clear now flush database and clear the plots
This commit is contained in:
@ -613,6 +613,11 @@ class BECMonitor(pg.GraphicsLayoutWidget):
|
|||||||
self.client = client
|
self.client = client
|
||||||
self.dev = self.client.device_manager.devices
|
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)
|
@pyqtSlot(dict)
|
||||||
def on_instruction(self, msg_content: dict) -> None:
|
def on_instruction(self, msg_content: dict) -> None:
|
||||||
"""
|
"""
|
||||||
@ -620,6 +625,7 @@ class BECMonitor(pg.GraphicsLayoutWidget):
|
|||||||
Possible actions are:
|
Possible actions are:
|
||||||
- clear: Clear the plots
|
- clear: Clear the plots
|
||||||
- close: Close the GUI
|
- close: Close the GUI
|
||||||
|
- config_dialog: Open the configuration dialog
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
msg_content (dict): Message content with the instruction and parameters.
|
msg_content (dict): Message content with the instruction and parameters.
|
||||||
@ -629,6 +635,7 @@ class BECMonitor(pg.GraphicsLayoutWidget):
|
|||||||
|
|
||||||
if action == "clear":
|
if action == "clear":
|
||||||
self.flush()
|
self.flush()
|
||||||
|
self._close_all_plots()
|
||||||
elif action == "close":
|
elif action == "close":
|
||||||
self.close()
|
self.close()
|
||||||
elif action == "config_dialog":
|
elif action == "config_dialog":
|
||||||
|
Reference in New Issue
Block a user