From befadabc2f18b483c71250adfd7dbf42f66b16f0 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 27 Mar 2011 12:55:16 -0400 Subject: gr-qtgui: restructuring qtgui directory to new layout. --- gr-qtgui/lib/qtgui_sink_c.h | 127 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 gr-qtgui/lib/qtgui_sink_c.h (limited to 'gr-qtgui/lib/qtgui_sink_c.h') diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/lib/qtgui_sink_c.h new file mode 100644 index 000000000..bbf9983b0 --- /dev/null +++ b/gr-qtgui/lib/qtgui_sink_c.h @@ -0,0 +1,127 @@ +/* -*- c++ -*- */ +/* + * Copyright 2008,2009,2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_QTGUI_SINK_C_H +#define INCLUDED_QTGUI_SINK_C_H + +#include +#include +#include +#include +#include +#include +#include "SpectrumGUIClass.h" + +class qtgui_sink_c; +typedef boost::shared_ptr qtgui_sink_c_sptr; + +qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, + double fc=0, double bandwidth=1.0, + const std::string &name="Spectrum Display", + bool plotfreq=true, bool plotwaterfall=true, + bool plotwaterfall3d=true, bool plottime=true, + bool plotconst=true, + bool use_openGL=true, + QWidget *parent=NULL); + +class qtgui_sink_c : public gr_block +{ +private: + friend qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, + double fc, double bw, + const std::string &name, + bool plotfreq, bool plotwaterfall, + bool plotwaterfall3d, bool plottime, + bool plotconst, + bool use_openGL, + QWidget *parent); + qtgui_sink_c (int fftsize, int wintype, + double fc, double bw, + const std::string &name, + bool plotfreq, bool plotwaterfall, + bool plotwaterfall3d, bool plottime, + bool plotconst, + bool use_openGL, + QWidget *parent); + + void forecast(int noutput_items, gr_vector_int &ninput_items_required); + + // use opengl to force OpenGL on or off + // this might be necessary for sessions over SSH + void initialize(const bool opengl=true); + + int d_fftsize; + gr_firdes::win_type d_wintype; + std::vector d_window; + double d_center_freq; + double d_bandwidth; + std::string d_name; + + gruel::mutex d_mutex; + + bool d_shift; + gri_fft_complex *d_fft; + + int d_index; + gr_complex *d_residbuf; + + bool d_plotfreq, d_plotwaterfall, d_plottime, d_plotconst; + + double d_update_time; + + QWidget *d_parent; + SpectrumGUIClass *d_main_gui; + + void windowreset(); + void buildwindow(); + void fftresize(); + void fft(const gr_complex *data_in, int size); + +public: + ~qtgui_sink_c(); + void exec_(); + void lock(); + void unlock(); + QWidget* qwidget(); + PyObject* pyqwidget(); + + void set_frequency_range(const double centerfreq, + const double bandwidth); + + void set_time_domain_axis(double min, double max); + void set_constellation_axis(double xmin, double xmax, + double ymin, double ymax); + void set_constellation_pen_size(int size); + void set_frequency_axis(double min, double max); + + void set_update_time(double t); + + QApplication *d_qApplication; + qtgui_obj *d_object; + + int general_work (int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); +}; + +#endif /* INCLUDED_QTGUI_SINK_C_H */ -- cgit From 79fa80423ab962e550b57c1bde49673394d8e0db Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 27 Mar 2011 18:17:17 -0400 Subject: gr-qtgui: cleaning up handling of mutex --- gr-qtgui/lib/qtgui_sink_c.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'gr-qtgui/lib/qtgui_sink_c.h') diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/lib/qtgui_sink_c.h index bbf9983b0..bcdcf65ae 100644 --- a/gr-qtgui/lib/qtgui_sink_c.h +++ b/gr-qtgui/lib/qtgui_sink_c.h @@ -99,8 +99,6 @@ private: public: ~qtgui_sink_c(); void exec_(); - void lock(); - void unlock(); QWidget* qwidget(); PyObject* pyqwidget(); -- cgit From 414ff0e69704f8c75edfc2ad3284a9c1bba5e50c Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 4 Apr 2011 23:37:58 -0400 Subject: gr-qtgui: removing unnecessary mutex and qtevent objects. --- gr-qtgui/lib/qtgui_sink_c.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gr-qtgui/lib/qtgui_sink_c.h') diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/lib/qtgui_sink_c.h index bcdcf65ae..59b5acfe5 100644 --- a/gr-qtgui/lib/qtgui_sink_c.h +++ b/gr-qtgui/lib/qtgui_sink_c.h @@ -28,7 +28,7 @@ #include #include #include -#include +//#include #include "SpectrumGUIClass.h" class qtgui_sink_c; @@ -76,7 +76,7 @@ private: double d_bandwidth; std::string d_name; - gruel::mutex d_mutex; + //gruel::mutex d_mutex; bool d_shift; gri_fft_complex *d_fft; @@ -114,7 +114,7 @@ public: void set_update_time(double t); QApplication *d_qApplication; - qtgui_obj *d_object; + //qtgui_obj *d_object; int general_work (int noutput_items, gr_vector_int &ninput_items, -- cgit From 8f53f5a782a6500d191ba557b37e7e3785cf6e02 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Wed, 6 Apr 2011 00:22:29 -0400 Subject: gr-qtgui: removing references to 3D waterfall plot and changning QtGui API to remove bool that turns it on/off. --- gr-qtgui/lib/qtgui_sink_c.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'gr-qtgui/lib/qtgui_sink_c.h') diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/lib/qtgui_sink_c.h index 59b5acfe5..22ca07f77 100644 --- a/gr-qtgui/lib/qtgui_sink_c.h +++ b/gr-qtgui/lib/qtgui_sink_c.h @@ -28,7 +28,6 @@ #include #include #include -//#include #include "SpectrumGUIClass.h" class qtgui_sink_c; @@ -38,8 +37,7 @@ qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, double fc=0, double bandwidth=1.0, const std::string &name="Spectrum Display", bool plotfreq=true, bool plotwaterfall=true, - bool plotwaterfall3d=true, bool plottime=true, - bool plotconst=true, + bool plottime=true, bool plotconst=true, bool use_openGL=true, QWidget *parent=NULL); @@ -50,16 +48,14 @@ private: double fc, double bw, const std::string &name, bool plotfreq, bool plotwaterfall, - bool plotwaterfall3d, bool plottime, - bool plotconst, + bool plottime, bool plotconst, bool use_openGL, QWidget *parent); qtgui_sink_c (int fftsize, int wintype, double fc, double bw, const std::string &name, bool plotfreq, bool plotwaterfall, - bool plotwaterfall3d, bool plottime, - bool plotconst, + bool plottime, bool plotconst, bool use_openGL, QWidget *parent); -- cgit From c4050c5bdb55ce14565d0ade84bd518cc8c27ec5 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 10 Apr 2011 17:13:15 -0400 Subject: gr-qtgui: removed OpenGL calls; we still link against the QTOPENGL_LIBS because of some dependencies in Qwt. --- gr-qtgui/lib/qtgui_sink_c.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gr-qtgui/lib/qtgui_sink_c.h') diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/lib/qtgui_sink_c.h index 22ca07f77..1c9561704 100644 --- a/gr-qtgui/lib/qtgui_sink_c.h +++ b/gr-qtgui/lib/qtgui_sink_c.h @@ -38,7 +38,6 @@ qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, const std::string &name="Spectrum Display", bool plotfreq=true, bool plotwaterfall=true, bool plottime=true, bool plotconst=true, - bool use_openGL=true, QWidget *parent=NULL); class qtgui_sink_c : public gr_block @@ -49,21 +48,17 @@ private: const std::string &name, bool plotfreq, bool plotwaterfall, bool plottime, bool plotconst, - bool use_openGL, QWidget *parent); qtgui_sink_c (int fftsize, int wintype, double fc, double bw, const std::string &name, bool plotfreq, bool plotwaterfall, bool plottime, bool plotconst, - bool use_openGL, QWidget *parent); void forecast(int noutput_items, gr_vector_int &ninput_items_required); - // use opengl to force OpenGL on or off - // this might be necessary for sessions over SSH - void initialize(const bool opengl=true); + void initialize(); int d_fftsize; gr_firdes::win_type d_wintype; -- cgit From 41ad09b4f22228dd555ea73f2078cb9ff056b979 Mon Sep 17 00:00:00 2001 From: Mike Cornelius Date: Mon, 11 Apr 2011 00:48:29 -0400 Subject: gr-qtgui: adding double-click point selector to main gui widgets. --- gr-qtgui/lib/qtgui_sink_c.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'gr-qtgui/lib/qtgui_sink_c.h') diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/lib/qtgui_sink_c.h index 1c9561704..fb0cb6c5f 100644 --- a/gr-qtgui/lib/qtgui_sink_c.h +++ b/gr-qtgui/lib/qtgui_sink_c.h @@ -67,8 +67,6 @@ private: double d_bandwidth; std::string d_name; - //gruel::mutex d_mutex; - bool d_shift; gri_fft_complex *d_fft; @@ -105,7 +103,6 @@ public: void set_update_time(double t); QApplication *d_qApplication; - //qtgui_obj *d_object; int general_work (int noutput_items, gr_vector_int &ninput_items, -- cgit From 703338443db476e19fc42f57e5d9f76ff7ec1751 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 24 Apr 2011 19:33:23 -0700 Subject: qtgui: added GR_QTGUI_API declaration to qtgui library classes and functions --- gr-qtgui/lib/qtgui_sink_c.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gr-qtgui/lib/qtgui_sink_c.h') diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/lib/qtgui_sink_c.h index fb0cb6c5f..b0946885c 100644 --- a/gr-qtgui/lib/qtgui_sink_c.h +++ b/gr-qtgui/lib/qtgui_sink_c.h @@ -24,6 +24,7 @@ #define INCLUDED_QTGUI_SINK_C_H #include +#include #include #include #include @@ -33,17 +34,17 @@ class qtgui_sink_c; typedef boost::shared_ptr qtgui_sink_c_sptr; -qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, +GR_QTGUI_API qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, double fc=0, double bandwidth=1.0, const std::string &name="Spectrum Display", bool plotfreq=true, bool plotwaterfall=true, bool plottime=true, bool plotconst=true, QWidget *parent=NULL); -class qtgui_sink_c : public gr_block +class GR_QTGUI_API qtgui_sink_c : public gr_block { private: - friend qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, + friend GR_QTGUI_API qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype, double fc, double bw, const std::string &name, bool plotfreq, bool plotwaterfall, -- cgit