diff options
-rw-r--r-- | gr-qtgui/CMakeLists.txt | 9 | ||||
-rw-r--r-- | gr-qtgui/doc/qtgui.dox | 22 | ||||
-rw-r--r-- | gr-qtgui/gr-qtgui.conf | 10 | ||||
-rw-r--r-- | gr-qtgui/lib/const_sink_c_impl.cc | 10 | ||||
-rw-r--r-- | gr-qtgui/lib/freq_sink_c_impl.cc | 5 | ||||
-rw-r--r-- | gr-qtgui/lib/freq_sink_c_impl.h | 2 | ||||
-rw-r--r-- | gr-qtgui/lib/freq_sink_f_impl.cc | 3 | ||||
-rw-r--r-- | gr-qtgui/lib/histogram_sink_f_impl.cc | 10 | ||||
-rw-r--r-- | gr-qtgui/lib/sink_c_impl.cc | 3 | ||||
-rw-r--r-- | gr-qtgui/lib/sink_f_impl.cc | 3 | ||||
-rw-r--r-- | gr-qtgui/lib/time_raster_sink_b_impl.cc | 9 | ||||
-rw-r--r-- | gr-qtgui/lib/time_raster_sink_f_impl.cc | 9 | ||||
-rw-r--r-- | gr-qtgui/lib/time_sink_c_impl.cc | 9 | ||||
-rw-r--r-- | gr-qtgui/lib/time_sink_f_impl.cc | 9 | ||||
-rw-r--r-- | gr-qtgui/lib/waterfall_sink_c_impl.cc | 13 | ||||
-rw-r--r-- | gr-qtgui/lib/waterfall_sink_f_impl.cc | 15 | ||||
-rw-r--r-- | grc/python/flow_graph.tmpl | 1 |
17 files changed, 109 insertions, 33 deletions
diff --git a/gr-qtgui/CMakeLists.txt b/gr-qtgui/CMakeLists.txt index a3a72dce43..13cbfb2e1f 100644 --- a/gr-qtgui/CMakeLists.txt +++ b/gr-qtgui/CMakeLists.txt @@ -132,4 +132,13 @@ install( COMPONENT "qtgui_devel" ) +######################################################################## +# Install the conf file +######################################################################## +install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr-qtgui.conf + DESTINATION ${GR_PREFSDIR} + COMPONENT "qtgui" +) + endif(ENABLE_GR_QTGUI) diff --git a/gr-qtgui/doc/qtgui.dox b/gr-qtgui/doc/qtgui.dox index beb1055e90..cbe5b831fb 100644 --- a/gr-qtgui/doc/qtgui.dox +++ b/gr-qtgui/doc/qtgui.dox @@ -181,4 +181,26 @@ style, markers, etc.), the ability to start and stop the display, the ability to save to a file, and other plot-specific controls (FFT size for the frequency and waterfall plots, etc.). +\section Configuration + +There is currently a single configuration option in the preferences +files to set the rendering engine of the QTGUI sinks. Located in +etc/gnuradio/conf.d/gr-qtgui.conf: + +\verbatim +[qtgui] +style = raster +\endverbatim + +The available styles are: + +\li opengl: the fastest but not likely to always work +\li raster: fast and stable; terrible X forwarding performance +\li native: most compute intensive; very good over X + +We default this setting to raster for the mix of performance and +usability. When using QTGUI sinks through an X-forwarding session over +SSH, switch to using 'native' for a significant speed boost on the +remote end. + */ diff --git a/gr-qtgui/gr-qtgui.conf b/gr-qtgui/gr-qtgui.conf new file mode 100644 index 0000000000..66354cfd4b --- /dev/null +++ b/gr-qtgui/gr-qtgui.conf @@ -0,0 +1,10 @@ +# This file contains system wide configuration data for GNU Radio. +# You may override any setting on a per-user basis by editing +# ~/.gnuradio/config.conf + +[qtgui] +# 'raster', 'native', or 'opengl' +# - 'opengl' is the fastest but not likely to always work +# - 'raster' is fast and stable; terrible X forwarding performance +# - 'native' most compute intensive; very good over X +style = raster diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc index fd9338f111..8b1a804fd2 100644 --- a/gr-qtgui/lib/const_sink_c_impl.cc +++ b/gr-qtgui/lib/const_sink_c_impl.cc @@ -26,14 +26,14 @@ #include "const_sink_c_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> -#include <gnuradio/fft/fft.h> #include <qwt_symbol.h> namespace gr { namespace qtgui { - + const_sink_c::sptr const_sink_c::make(int size, const std::string &name, @@ -110,6 +110,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -272,8 +274,8 @@ namespace gr { memset(d_residbufs_imag[i], 0, newsize*sizeof(double)); } - // Set new size and reset buffer index - // (throws away any currently held data, but who cares?) + // Set new size and reset buffer index + // (throws away any currently held data, but who cares?) d_size = newsize; d_index = 0; diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc index e86974fa31..ff375976fb 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.cc +++ b/gr-qtgui/lib/freq_sink_c_impl.cc @@ -26,6 +26,7 @@ #include "freq_sink_c_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> #include <qwt_symbol.h> @@ -132,7 +133,9 @@ namespace gr { d_qApplication = qApp; } else { - d_qApplication = new QApplication(d_argc, &d_argv); + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); + d_qApplication = new QApplication(d_argc, &d_argv); } d_main_gui = new FreqDisplayForm(d_nconnections, d_parent); diff --git a/gr-qtgui/lib/freq_sink_c_impl.h b/gr-qtgui/lib/freq_sink_c_impl.h index 8079c816f6..f068e657f5 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.h +++ b/gr-qtgui/lib/freq_sink_c_impl.h @@ -32,7 +32,7 @@ namespace gr { namespace qtgui { - + class QTGUI_API freq_sink_c_impl : public freq_sink_c { private: diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc index 8dca8151d7..f2dfb4f56c 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.cc +++ b/gr-qtgui/lib/freq_sink_f_impl.cc @@ -26,6 +26,7 @@ #include "freq_sink_f_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> #include <qwt_symbol.h> @@ -132,6 +133,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index 8a3ba6987e..07620a1246 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -26,14 +26,14 @@ #include "histogram_sink_f_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> -#include <gnuradio/fft/fft.h> #include <qwt_symbol.h> namespace gr { namespace qtgui { - + histogram_sink_f::sptr histogram_sink_f::make(int size, int bins, double xmin, double xmax, @@ -109,6 +109,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -270,8 +272,8 @@ namespace gr { memset(d_residbufs[i], 0, newsize*sizeof(double)); } - // Set new size and reset buffer index - // (throws away any currently held data, but who cares?) + // Set new size and reset buffer index + // (throws away any currently held data, but who cares?) d_size = newsize; d_index = 0; diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc index d9341bab88..b810a450b6 100644 --- a/gr-qtgui/lib/sink_c_impl.cc +++ b/gr-qtgui/lib/sink_c_impl.cc @@ -26,6 +26,7 @@ #include "sink_c_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> @@ -122,6 +123,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc index 178eb1b971..ef194f9ead 100644 --- a/gr-qtgui/lib/sink_f_impl.cc +++ b/gr-qtgui/lib/sink_f_impl.cc @@ -26,6 +26,7 @@ #include "sink_f_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> @@ -122,6 +123,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc index 26daffe7bb..84f702b3d5 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc @@ -26,12 +26,13 @@ #include "time_raster_sink_b_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> namespace gr { namespace qtgui { - + time_raster_sink_b::sptr time_raster_sink_b::make(double samp_rate, double rows, double cols, @@ -84,7 +85,7 @@ namespace gr { d_tmpflt = (float*)volk_malloc(d_icols*sizeof(float), volk_get_alignment()); memset(d_tmpflt, 0, d_icols*sizeof(float)); - + for(int i = 0; i < d_nconnections; i++) { d_residbufs.push_back((double*)volk_malloc(d_icols*sizeof(double), volk_get_alignment())); @@ -123,6 +124,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -417,7 +420,7 @@ namespace gr { volk_32f_convert_64f_u(&d_residbufs[n][d_index], d_tmpflt, resid); } - + if(gr::high_res_timer_now() - d_last_time > d_update_time) { d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc index 10b7f762ca..beb2937b83 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc @@ -26,12 +26,13 @@ #include "time_raster_sink_f_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> namespace gr { namespace qtgui { - + time_raster_sink_f::sptr time_raster_sink_f::make(double samp_rate, double rows, double cols, @@ -82,7 +83,7 @@ namespace gr { d_tmpflt = (float*)volk_malloc(d_icols*sizeof(float), volk_get_alignment()); memset(d_tmpflt, 0, d_icols*sizeof(float)); - + for(int i = 0; i < d_nconnections; i++) { d_residbufs.push_back((double*)volk_malloc(d_icols*sizeof(double), volk_get_alignment())); @@ -121,6 +122,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -413,7 +416,7 @@ namespace gr { volk_32f_convert_64f_u(&d_residbufs[n][d_index], d_tmpflt, resid); } - + // Update the plot if its time if(gr::high_res_timer_now() - d_last_time > d_update_time) { d_last_time = gr::high_res_timer_now(); diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index f24657830f..6cd314697c 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -26,6 +26,7 @@ #include "time_sink_c_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> #include <gnuradio/fft/fft.h> @@ -33,7 +34,7 @@ namespace gr { namespace qtgui { - + time_sink_c::sptr time_sink_c::make(int size, double samp_rate, const std::string &name, @@ -112,6 +113,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -292,8 +295,8 @@ namespace gr { if(newsize != d_size) { gr::thread::scoped_lock lock(d_mutex); - // Set new size and reset buffer index - // (throws away any currently held data, but who cares?) + // Set new size and reset buffer index + // (throws away any currently held data, but who cares?) d_size = newsize; d_buffer_size = 2*d_size; diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc index 596a416541..7bbda19d13 100644 --- a/gr-qtgui/lib/time_sink_f_impl.cc +++ b/gr-qtgui/lib/time_sink_f_impl.cc @@ -28,6 +28,7 @@ #include <gnuradio/io_signature.h> #include <gnuradio/block_detail.h> #include <gnuradio/buffer.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> #include <gnuradio/fft/fft.h> @@ -35,7 +36,7 @@ namespace gr { namespace qtgui { - + time_sink_f::sptr time_sink_f::make(int size, double samp_rate, const std::string &name, @@ -114,6 +115,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -294,8 +297,8 @@ namespace gr { if(newsize != d_size) { gr::thread::scoped_lock lock(d_mutex); - // Set new size and reset buffer index - // (throws away any currently held data, but who cares?) + // Set new size and reset buffer index + // (throws away any currently held data, but who cares?) d_size = newsize; d_buffer_size = 2*d_size; diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc index 9fc4f2163f..3727c01a40 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc @@ -26,13 +26,14 @@ #include "waterfall_sink_c_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> #include <qwt_symbol.h> namespace gr { namespace qtgui { - + waterfall_sink_c::sptr waterfall_sink_c::make(int fftsize, int wintype, double fc, double bw, @@ -131,6 +132,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -330,7 +333,7 @@ namespace gr { d_fft->execute(); // compute the fft volk_32fc_s32f_x2_power_spectral_density_32f_a(data_out, d_fft->get_outbuf(), - size, 1.0, size); + size, 1.0, size); // Perform shift operation unsigned int len = (unsigned int)(floor(size/2.0)); @@ -383,8 +386,8 @@ namespace gr { memset(d_magbufs[i], 0, newfftsize*sizeof(double)); } - // Set new fft size and reset buffer index - // (throws away any currently held data, but who cares?) + // Set new fft size and reset buffer index + // (throws away any currently held data, but who cares?) d_fftsize = newfftsize; d_index = 0; @@ -433,7 +436,7 @@ namespace gr { } //volk_32f_convert_64f_a(d_magbufs[n], d_fbuf, d_fftsize); } - + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new WaterfallUpdateEvent(d_magbufs, diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc index 50525f1903..4d2da01d5b 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc @@ -26,12 +26,13 @@ #include "waterfall_sink_f_impl.h" #include <gnuradio/io_signature.h> +#include <gnuradio/prefs.h> #include <string.h> #include <volk/volk.h> namespace gr { namespace qtgui { - + waterfall_sink_f::sptr waterfall_sink_f::make(int fftsize, int wintype, double fc, double bw, @@ -130,6 +131,8 @@ namespace gr { d_qApplication = qApp; } else { + std::string style = prefs::singleton()->get_string("qtgui", "style", "raster"); + QApplication::setGraphicsSystem(QString(style.c_str())); d_qApplication = new QApplication(d_argc, &d_argv); } @@ -326,13 +329,13 @@ namespace gr { if(d_window.size()) { volk_32fc_32f_multiply_32fc_a(d_fft->get_inbuf(), dst, - &d_window.front(), size); + &d_window.front(), size); } d_fft->execute(); // compute the fft volk_32fc_s32f_x2_power_spectral_density_32f_a(data_out, d_fft->get_outbuf(), - size, 1.0, size); + size, 1.0, size); // Perform shift operation unsigned int len = (unsigned int)(floor(size/2.0)); @@ -384,8 +387,8 @@ namespace gr { memset(d_magbufs[i], 0, newfftsize*sizeof(double)); } - // Set new fft size and reset buffer index - // (throws away any currently held data, but who cares?) + // Set new fft size and reset buffer index + // (throws away any currently held data, but who cares?) d_fftsize = newfftsize; d_index = 0; @@ -434,7 +437,7 @@ namespace gr { } //volk_32f_convert_64f_a(d_magbufs[n], d_fbuf, d_fftsize); } - + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new WaterfallUpdateEvent(d_magbufs, diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index fe1155bb50..7c6998ab73 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -315,6 +315,7 @@ if __name__ == '__main__': tb.Wait() #end if #elif $generate_options == 'qt_gui' + Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster')) qapp = Qt.QApplication(sys.argv) tb = $(class_name)($(', '.join($params_eq_list))) #if $flow_graph.get_option('run') |