diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-09-06 12:01:23 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-09-06 12:01:23 -0400 |
commit | c9dc582402d2551ead29a60256fdf64a1d43534c (patch) | |
tree | 4e9fe56c173a8e080c84c4c113a5ac5c5f1c236c /gr-wxgui/src/python/plotter/grid_plotter_base.py | |
parent | 1300d48af4752037feac4fae7c3c64187cc0a5a8 (diff) | |
parent | a4e2e8a9a2c8a6bbd6d676a17b0e2732e11af09f (diff) |
Merge branch 'master' into gr_log
Conflicts:
CMakeLists.txt
cmake/Modules/GrMiscUtils.cmake
docs/doxygen/other/build_guide.dox
gnuradio-core/CMakeLists.txt
gr-digital/lib/CMakeLists.txt
Diffstat (limited to 'gr-wxgui/src/python/plotter/grid_plotter_base.py')
-rw-r--r-- | gr-wxgui/src/python/plotter/grid_plotter_base.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gr-wxgui/src/python/plotter/grid_plotter_base.py b/gr-wxgui/src/python/plotter/grid_plotter_base.py index 5eaa76bc0e..f1bc8f546d 100644 --- a/gr-wxgui/src/python/plotter/grid_plotter_base.py +++ b/gr-wxgui/src/python/plotter/grid_plotter_base.py @@ -85,7 +85,19 @@ class grid_plotter_base(plotter_base): self._point_label_cache.changed(True) self.update() self.unlock() - + + def call_freq_callback(self, coor): + x, y = self._point_label_coordinate + if x < self.padding_left or x > self.width-self.padding_right: return + if y < self.padding_top or y > self.height-self.padding_bottom: return + #scale to window bounds + x_win_scalar = float(x - self.padding_left)/(self.width-self.padding_left-self.padding_right) + y_win_scalar = float((self.height - y) - self.padding_bottom)/(self.height-self.padding_top-self.padding_bottom) + #scale to grid bounds + x_val = x_win_scalar*(self.x_max-self.x_min) + self.x_min + y_val = y_win_scalar*(self.y_max-self.y_min) + self.y_min + self._call_callback(x_val, y_val) + def enable_grid_aspect_ratio(self, enable=None): """ Enable/disable the grid aspect ratio. |