diff options
author | Josh Blum <josh@joshknows.com> | 2009-08-22 22:01:55 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2009-08-22 22:01:55 -0700 |
commit | b6c19491d34357ab2d6332f91733afe7367da92a (patch) | |
tree | aa132c124b85715f2036369b1255a6240a43ba2b /gr-wxgui | |
parent | f3c5010f9c9e8b82048a6d631418c9b5b482e593 (diff) |
automatic store for empty traces on enable
Diffstat (limited to 'gr-wxgui')
-rw-r--r-- | gr-wxgui/src/python/fft_window.py | 11 |
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) |