summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/WaterfallDisplayPlot.h
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/lib/WaterfallDisplayPlot.h')
-rw-r--r--gr-qtgui/lib/WaterfallDisplayPlot.h91
1 files changed, 41 insertions, 50 deletions
diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h
index d189ca2cbd..fbb0131563 100644
--- a/gr-qtgui/lib/WaterfallDisplayPlot.h
+++ b/gr-qtgui/lib/WaterfallDisplayPlot.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc.
+ * Copyright 2008-2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,18 +20,15 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef WATERFALL_DISPLAY_PLOT_HPP
-#define WATERFALL_DISPLAY_PLOT_HPP
+#ifndef WATERFALL_DISPLAY_PLOT_H
+#define WATERFALL_DISPLAY_PLOT_H
#include <stdint.h>
#include <cstdio>
-#include <qwt_plot.h>
+#include <vector>
#include <qwt_plot_spectrogram.h>
-#include <qwt_plot_zoomer.h>
-#include <qwt_plot_panner.h>
-#include <qtgui_util.h>
-#include <waterfallGlobalData.h>
-
+#include "DisplayPlot.h"
+#include "waterfallGlobalData.h"
#include <gruel/high_res_timer.h>
#if QWT_VERSION < 0x060000
@@ -40,11 +37,17 @@
#include <qwt_compat.h>
#endif
-class WaterfallDisplayPlot:public QwtPlot{
+class WaterfallDisplayPlot: public DisplayPlot
+{
Q_OBJECT
+ Q_PROPERTY ( int intensity_color_map_type1 READ GetIntensityColorMapType1 WRITE SetIntensityColorMapType1 )
+ Q_PROPERTY ( QColor low_intensity_color READ GetUserDefinedLowIntensityColor WRITE SetUserDefinedLowIntensityColor )
+ Q_PROPERTY ( QColor high_intensity_color READ GetUserDefinedHighIntensityColor WRITE SetUserDefinedHighIntensityColor )
+
+
public:
- WaterfallDisplayPlot(QWidget*);
+ WaterfallDisplayPlot(int nplots, QWidget*);
virtual ~WaterfallDisplayPlot();
void Reset();
@@ -53,45 +56,40 @@ public:
const double, const bool,
const double units=1000.0,
const std::string &strunits = "kHz");
- double GetStartFrequency()const;
- double GetStopFrequency()const;
+ double GetStartFrequency() const;
+ double GetStopFrequency() const;
- void PlotNewData(const double* dataPoints, const int64_t numDataPoints,
- const double timePerFFT, const gruel::high_res_timer_type timestamp,
+ void PlotNewData(const std::vector<double*> dataPoints,
+ const int64_t numDataPoints,
+ const double timePerFFT,
+ const gruel::high_res_timer_type timestamp,
const int droppedFrames);
- void SetIntensityRange(const double minIntensity, const double maxIntensity);
+ // to be removed
+ void PlotNewData(const double* dataPoints,
+ const int64_t numDataPoints,
+ const double timePerFFT,
+ const gruel::high_res_timer_type timestamp,
+ const int droppedFrames);
- virtual void replot(void);
+ void SetIntensityRange(const double minIntensity, const double maxIntensity);
- int GetIntensityColorMapType()const;
- void SetIntensityColorMapType( const int, const QColor, const QColor );
- const QColor GetUserDefinedLowIntensityColor()const;
- const QColor GetUserDefinedHighIntensityColor()const;
+ void replot(void);
- enum{
- INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0,
- INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1,
- INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2,
- INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3,
- INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4
- };
+ int GetIntensityColorMapType(int) const;
+ int GetIntensityColorMapType1() const;
+ const QColor GetUserDefinedLowIntensityColor() const;
+ const QColor GetUserDefinedHighIntensityColor() const;
public slots:
- void resizeSlot( QSize *s );
-
- // Because of the preprocessing of slots in QT, these are no
- // easily separated by the version check. Make one for each
- // version until it's worked out.
- void OnPickerPointSelected(const QwtDoublePoint & p);
- void OnPickerPointSelected6(const QPointF & p);
+ void SetIntensityColorMapType(const int, const int, const QColor, const QColor);
+ void SetIntensityColorMapType1(int);
+ void SetUserDefinedLowIntensityColor(QColor);
+ void SetUserDefinedHighIntensityColor(QColor);
signals:
void UpdatedLowerIntensityLevel(const double);
void UpdatedUpperIntensityLevel(const double);
- void plotPointSelected(const QPointF p);
-
-protected:
private:
void _UpdateIntensityRangeDisplay();
@@ -100,28 +98,21 @@ private:
double _stopFrequency;
int _xAxisMultiplier;
- QwtPlotPanner* _panner;
- QwtPlotZoomer* _zoomer;
-
- QwtDblClickPlotPicker *_picker;
-
- WaterfallData *d_data;
+ std::vector<WaterfallData*> d_data;
#if QWT_VERSION < 0x060000
- PlotWaterfall *d_spectrogram;
+ std::vector<PlotWaterfall*> d_spectrogram;
#else
- QwtPlotSpectrogram *d_spectrogram;
+ std::vector<QwtPlotSpectrogram*> d_spectrogram;
#endif
gruel::high_res_timer_type _lastReplot;
bool _useCenterFrequencyFlag;
- int64_t _numPoints;
-
- int _intensityColorMapType;
+ std::vector<int> _intensityColorMapType;
QColor _userDefinedLowIntensityColor;
QColor _userDefinedHighIntensityColor;
};
-#endif /* WATERFALL_DISPLAY_PLOT_HPP */
+#endif /* WATERFALL_DISPLAY_PLOT_H */