From ed838eb9be22d769247a9c63f23423c8c2f81f72 Mon Sep 17 00:00:00 2001 From: Marcus Leech <mleech@ripnet.com> Date: Mon, 21 May 2012 14:35:33 -0400 Subject: wxgui: allows LEFT click to set a flow-graph variable to the adjusted X value on either the FFT or waterfall display. --- gr-wxgui/src/python/plotter/channel_plotter.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gr-wxgui/src/python/plotter/channel_plotter.py') diff --git a/gr-wxgui/src/python/plotter/channel_plotter.py b/gr-wxgui/src/python/plotter/channel_plotter.py index a3a2b64519..4bcc36fd4c 100644 --- a/gr-wxgui/src/python/plotter/channel_plotter.py +++ b/gr-wxgui/src/python/plotter/channel_plotter.py @@ -56,6 +56,7 @@ class channel_plotter(grid_plotter_base): self._channels = dict() #init channel plotter self.register_init(self._init_channel_plotter) + self.callback = None def _init_channel_plotter(self): """ @@ -150,6 +151,13 @@ class channel_plotter(grid_plotter_base): label_str += '\n%s: %s'%(channel, common.eng_format(y_value, self.y_units)) return label_str + def _call_callback (self, x_val, y_val): + if self.callback != None: + self.callback(x_val, y_val) + + def set_callback (self, callback): + self.callback = callback + def _draw_legend(self): """ Draw the legend in the upper right corner. -- cgit v1.2.3