From 13167916a2700b85b63faafc695378570f8a328f Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 14 Dec 2021 16:52:32 +0100 Subject: Clean up GUI code and add menu for unlocking plots and restoring windows --- src/gui/net.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gui/net.py') diff --git a/src/gui/net.py b/src/gui/net.py index 715e7a0..121cc76 100644 --- a/src/gui/net.py +++ b/src/gui/net.py @@ -59,7 +59,7 @@ class network_plot(udpsource): """ Wraps a udpsource while at the same time intefacing with DearPyGUI as a plot element. """ - def __init__(self, url, dtype, nsamples , **kwargs): + def __init__(self, url, dtype, nsamples, **kwargs): udpsource.__init__(self, url, dtype) self.nsamples = nsamples @@ -78,6 +78,14 @@ class network_plot(udpsource): self.yvalues.extend(np.zeros(self.nsamples)) def _init_dpg_plot(self, **kwargs): + if "tag" in kwargs: + self.tag = kwargs["tag"] + + self.series_tag = f"{self.tag}_series" + self.xaxis_tag = f"{self.tag}_xaxis" + self.yaxis_tag = f"{self.tag}_yaxis" + self.window_tag = f"window_{self.tag}" + self.plot = dpg.plot(**kwargs) # Map `with' expressions to the underlying plot -- cgit v1.2.1