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/TimeDomainDisplayPlot.h | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 gr-qtgui/lib/TimeDomainDisplayPlot.h (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h new file mode 100644 index 000000000..952b5c8cf --- /dev/null +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -0,0 +1,65 @@ +#ifndef TIME_DOMAIN_DISPLAY_PLOT_HPP +#define TIME_DOMAIN_DISPLAY_PLOT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class TimeDomainDisplayPlot:public QwtPlot{ + Q_OBJECT + +public: + TimeDomainDisplayPlot(QWidget*); + virtual ~TimeDomainDisplayPlot(); + + void PlotNewData(const double* realDataPoints, const double* imagDataPoints, + const int64_t numDataPoints, const double timeInterval); + + void SetImaginaryDataVisible(const bool); + + virtual void replot(); + + void set_yaxis(double min, double max); + void set_xaxis(double min, double max); + +public slots: + void resizeSlot( QSize *s ); + void SetSampleRate(double sr, double units, + const std::string &strunits); + +protected slots: + void LegendEntryChecked(QwtPlotItem *plotItem, bool on); + +protected: + +private: + void _resetXAxisPoints(); + + QwtPlotCurve* _real_plot_curve; + QwtPlotCurve* _imag_plot_curve; + + QwtPlotPanner* _panner; + QwtPlotZoomer* _zoomer; + + double* _realDataPoints; + double* _imagDataPoints; + double* _xAxisPoints; + + double _sampleRate; + + timespec _lastReplot; + + int64_t _numPoints; +}; + +#endif /* TIME_DOMAIN_DISPLAY_PLOT_HPP */ -- 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/TimeDomainDisplayPlot.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index 952b5c8cf..01338300c 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -11,9 +11,11 @@ #include #include #include +#include #include #include #include +#include class TimeDomainDisplayPlot:public QwtPlot{ Q_OBJECT @@ -37,6 +39,11 @@ public slots: void SetSampleRate(double sr, double units, const std::string &strunits); + void OnPickerPointSelected(const QwtDoublePoint & p); + +signals: + void plotPointSelected(const QPointF p); + protected slots: void LegendEntryChecked(QwtPlotItem *plotItem, bool on); @@ -51,6 +58,9 @@ private: QwtPlotPanner* _panner; QwtPlotZoomer* _zoomer; + QwtDblClickPlotPicker *_picker; + QwtPlotMagnifier *_magnifier; + double* _realDataPoints; double* _imagDataPoints; double* _xAxisPoints; -- cgit From 7ba2647977f9b302969208fa8548d1ca8dcddd4b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 18 Apr 2011 23:07:31 -0400 Subject: gr-qtgui: adding copyright dates to qtgui files. --- gr-qtgui/lib/TimeDomainDisplayPlot.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index 01338300c..328371e6a 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -1,3 +1,25 @@ +/* -*- c++ -*- */ +/* + * Copyright 2008,2009,2010,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 TIME_DOMAIN_DISPLAY_PLOT_HPP #define TIME_DOMAIN_DISPLAY_PLOT_HPP -- cgit From 01f44f64c916b4aa38bc81662d2c8b82c4cc0b57 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 23 Apr 2011 14:30:32 -0400 Subject: gr-qtgui: moving towards allowing time plot to have multiple connections. --- gr-qtgui/lib/TimeDomainDisplayPlot.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index 328371e6a..3a983a924 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -43,14 +44,12 @@ class TimeDomainDisplayPlot:public QwtPlot{ Q_OBJECT public: - TimeDomainDisplayPlot(QWidget*); + TimeDomainDisplayPlot(int nplots, QWidget*); virtual ~TimeDomainDisplayPlot(); - void PlotNewData(const double* realDataPoints, const double* imagDataPoints, + void PlotNewData(const int which, const double* dataPoints, const int64_t numDataPoints, const double timeInterval); - void SetImaginaryDataVisible(const bool); - virtual void replot(); void set_yaxis(double min, double max); @@ -74,8 +73,8 @@ protected: private: void _resetXAxisPoints(); - QwtPlotCurve* _real_plot_curve; - QwtPlotCurve* _imag_plot_curve; + int _nplots; + std::vector _plot_curve; QwtPlotPanner* _panner; QwtPlotZoomer* _zoomer; @@ -83,8 +82,7 @@ private: QwtDblClickPlotPicker *_picker; QwtPlotMagnifier *_magnifier; - double* _realDataPoints; - double* _imagDataPoints; + std::vector _dataPoints; double* _xAxisPoints; double _sampleRate; -- cgit From 0877adb2e194c9dfad2484519b2979e2bed93958 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 23 Apr 2011 15:11:17 -0400 Subject: gr-qtgui: Passing vectors of data to update plot for stability; also moving responsibility of keeping track of plot updates out to qtgui_sink instead of inside plot qidget. --- gr-qtgui/lib/TimeDomainDisplayPlot.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index 3a983a924..fbfba584b 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -47,7 +47,7 @@ public: TimeDomainDisplayPlot(int nplots, QWidget*); virtual ~TimeDomainDisplayPlot(); - void PlotNewData(const int which, const double* dataPoints, + void PlotNewData(const std::vector dataPoints, const int64_t numDataPoints, const double timeInterval); virtual void replot(); @@ -87,8 +87,6 @@ private: double _sampleRate; - timespec _lastReplot; - int64_t _numPoints; }; -- cgit From e251c885f19281ef918987e09c2aac1af6a952c2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 24 Apr 2011 00:31:39 -0400 Subject: gr-qtgui: provide function and slot for setting the labels of a time curve. --- gr-qtgui/lib/TimeDomainDisplayPlot.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index fbfba584b..bc8b0c862 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -54,6 +54,7 @@ public: void set_yaxis(double min, double max); void set_xaxis(double min, double max); + void set_title(int which, QString title); public slots: void resizeSlot( QSize *s ); -- cgit From 43a3a7296412dc52216e7f63856a86945f4ba438 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 24 Apr 2011 01:30:08 -0400 Subject: gr-qtgui: clean up --- gr-qtgui/lib/TimeDomainDisplayPlot.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index bc8b0c862..1693e7537 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -52,11 +52,11 @@ public: virtual void replot(); - void set_yaxis(double min, double max); - void set_xaxis(double min, double max); - void set_title(int which, QString title); - public slots: + void setYaxis(double min, double max); + void setXaxis(double min, double max); + void setTitle(int which, QString title); + void resizeSlot( QSize *s ); void SetSampleRate(double sr, double units, const std::string &strunits); -- cgit From 11de76b9214a59930ac8d8c031880b5bd293973d Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 24 Apr 2011 01:47:05 -0400 Subject: gr-qtgui: adding function and slot to set a time display curve's color. --- gr-qtgui/lib/TimeDomainDisplayPlot.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.h') diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index 1693e7537..4c7b1e319 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -56,6 +56,7 @@ public slots: void setYaxis(double min, double max); void setXaxis(double min, double max); void setTitle(int which, QString title); + void setColor(int which, QString color); void resizeSlot( QSize *s ); void SetSampleRate(double sr, double units, -- cgit