aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/net.py
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2021-12-14 16:52:32 +0100
committerNao Pross <np@0hm.ch>2021-12-14 16:52:32 +0100
commit13167916a2700b85b63faafc695378570f8a328f (patch)
tree3570173461d4804bb8022246193fa4c53c06cdd8 /src/gui/net.py
parentAvoid sending EVERY sample over UDP (diff)
downloadFading-13167916a2700b85b63faafc695378570f8a328f.tar.gz
Fading-13167916a2700b85b63faafc695378570f8a328f.zip
Clean up GUI code and add menu for unlocking plots and restoring windows
Diffstat (limited to '')
-rw-r--r--src/gui/net.py10
1 files changed, 9 insertions, 1 deletions
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