summaryrefslogtreecommitdiff
path: root/gr-wxgui
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2009-08-22 22:01:55 -0700
committerJosh Blum <josh@joshknows.com>2009-08-22 22:01:55 -0700
commitb6c19491d34357ab2d6332f91733afe7367da92a (patch)
treeaa132c124b85715f2036369b1255a6240a43ba2b /gr-wxgui
parentf3c5010f9c9e8b82048a6d631418c9b5b482e593 (diff)
automatic store for empty traces on enable
Diffstat (limited to 'gr-wxgui')
-rw-r--r--gr-wxgui/src/python/fft_window.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/gr-wxgui/src/python/fft_window.py b/gr-wxgui/src/python/fft_window.py
index 87712b1e24..0529e6a5d6 100644
--- a/gr-wxgui/src/python/fft_window.py
+++ b/gr-wxgui/src/python/fft_window.py
@@ -210,11 +210,18 @@ class fft_window(wx.Panel, pubsub.pubsub):
self._traces[my_trace] = self.samples
self.update_grid()
return store_trace
+ def new_toggle_trace(my_trace):
+ def toggle_trace(toggle):
+ #do an automatic store if toggled on and empty trace
+ if toggle and not len(self._traces[my_trace]):
+ self._traces[my_trace] = self.samples
+ self.update_grid()
+ return toggle_trace
self._traces[trace] = EMPTY_TRACE
self[TRACE_STORE_KEY+trace] = False
- self[TRACE_SHOW_KEY+trace] = True
+ self[TRACE_SHOW_KEY+trace] = False
self.subscribe(TRACE_STORE_KEY+trace, new_store_trace(trace))
- self.subscribe(TRACE_SHOW_KEY+trace, self.update_grid)
+ self.subscribe(TRACE_SHOW_KEY+trace, new_toggle_trace(trace))
#init panel and plot
wx.Panel.__init__(self, parent, style=wx.SIMPLE_BORDER)
self.plotter = plotter.channel_plotter(self)