diff options
author | Tom Rondeau <tom@trondeau.com> | 2013-08-02 16:54:16 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2013-08-02 16:58:13 -0400 |
commit | bd043f9c74d32a63e42547c023c68abe2f1d5e2b (patch) | |
tree | 8da38fa103ecfc2f4049f4b1a5b53a9b3c5722a0 /gr-qtgui/lib/histogram_sink_f_impl.cc | |
parent | 1f03cbc66bc5b60a9997e78be349e259ea739114 (diff) |
qtgui: improved handling of scale in histogram plots.
Mouse scroll zooms in/out horizonatally. Added auto-scale feature, can set x-min and max in constructor.
Mouse scroll in constellation plot now does both axes at the same time.
Diffstat (limited to 'gr-qtgui/lib/histogram_sink_f_impl.cc')
-rw-r--r-- | gr-qtgui/lib/histogram_sink_f_impl.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index 293fb2c0ec..cd4012f4f5 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -36,23 +36,25 @@ namespace gr { histogram_sink_f::sptr histogram_sink_f::make(int size, int bins, - const std::string &name, - int nconnections, - QWidget *parent) + double xmin, double xmax, + const std::string &name, + int nconnections, + QWidget *parent) { return gnuradio::get_initial_sptr - (new histogram_sink_f_impl(size, bins, name, + (new histogram_sink_f_impl(size, bins, xmin, xmax, name, nconnections, parent)); } histogram_sink_f_impl::histogram_sink_f_impl(int size, int bins, + double xmin, double xmax, const std::string &name, int nconnections, QWidget *parent) : sync_block("histogram_sink_f", io_signature::make(nconnections, nconnections, sizeof(float)), io_signature::make(0, 0, 0)), - d_size(size), d_bins(bins), d_name(name), + d_size(size), d_bins(bins), d_xmin(xmin), d_xmax(xmax), d_name(name), d_nconnections(nconnections), d_parent(parent) { d_main_gui = NULL; @@ -102,7 +104,9 @@ namespace gr { } d_main_gui = new HistogramDisplayForm(d_nconnections, d_parent); + d_main_gui->setNumBins(d_bins); d_main_gui->setNPoints(d_size); + d_main_gui->setXaxis(d_xmin, d_xmax); // initialize update time to 10 times a second set_update_time(0.1); @@ -135,6 +139,12 @@ namespace gr { } void + histogram_sink_f_impl::set_x_axis(double min, double max) + { + d_main_gui->setXaxis(min, max); + } + + void histogram_sink_f_impl::set_update_time(double t) { //convert update time to ticks |