GNU Radio 3.3.0 C++ API
|
00001 #ifndef SPECTRUM_DISPLAY_FORM_H 00002 #define SPECTRUM_DISPLAY_FORM_H 00003 00004 #include "spectrumdisplayform_ui.h" 00005 00006 class SpectrumGUIClass; 00007 #include <SpectrumGUIClass.h> 00008 00009 #include <SpectrumGUIClass.h> 00010 #include <FrequencyDisplayPlot.h> 00011 #include <WaterfallDisplayPlot.h> 00012 #include <Waterfall3DDisplayPlot.h> 00013 #include <TimeDomainDisplayPlot.h> 00014 #include <ConstellationDisplayPlot.h> 00015 #include <QValidator> 00016 #include <QTimer> 00017 #include <vector> 00018 00019 class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm 00020 { 00021 Q_OBJECT 00022 00023 public: 00024 SpectrumDisplayForm(bool useOpenGL = true, QWidget* parent = 0); 00025 ~SpectrumDisplayForm(); 00026 00027 void setSystem( SpectrumGUIClass * newSystem, const uint64_t numFFTDataPoints, 00028 const uint64_t numTimeDomainDataPoints ); 00029 00030 int GetAverageCount(); 00031 void SetAverageCount( const int newCount ); 00032 void Reset(); 00033 void AverageDataReset(); 00034 void ResizeBuffers( const uint64_t numFFTDataPoints, 00035 const uint64_t numTimeDomainDataPoints ); 00036 00037 public slots: 00038 void resizeEvent( QResizeEvent * e ); 00039 void customEvent( QEvent * e ); 00040 void AvgLineEdit_valueChanged( int valueString ); 00041 void MaxHoldCheckBox_toggled( bool newState ); 00042 void MinHoldCheckBox_toggled( bool newState ); 00043 void MinHoldResetBtn_clicked(); 00044 void MaxHoldResetBtn_clicked(); 00045 void TabChanged(int index); 00046 00047 void SetFrequencyRange( const double newCenterFrequency, 00048 const double newStartFrequency, 00049 const double newStopFrequency ); 00050 void closeEvent( QCloseEvent * e ); 00051 void WindowTypeChanged( int newItem ); 00052 void UseRFFrequenciesCB( bool useRFFlag ); 00053 void waterfallMaximumIntensityChangedCB(double); 00054 void waterfallMinimumIntensityChangedCB(double); 00055 void WaterfallIntensityColorTypeChanged(int); 00056 void WaterfallAutoScaleBtnCB(); 00057 void waterfall3DMaximumIntensityChangedCB(double); 00058 void waterfall3DMinimumIntensityChangedCB(double); 00059 void Waterfall3DIntensityColorTypeChanged(int); 00060 void Waterfall3DAutoScaleBtnCB(); 00061 void FFTComboBoxSelectedCB(const QString&); 00062 00063 void ToggleTabFrequency(const bool state); 00064 void ToggleTabWaterfall(const bool state); 00065 void ToggleTabWaterfall3D(const bool state); 00066 void ToggleTabTime(const bool state); 00067 void ToggleTabConstellation(const bool state); 00068 00069 void SetTimeDomainAxis(double min, double max); 00070 void SetConstellationAxis(double xmin, double xmax, 00071 double ymin, double ymax); 00072 void SetConstellationPenSize(int size); 00073 void SetFrequencyAxis(double min, double max); 00074 void SetUpdateTime(double t); 00075 00076 private slots: 00077 void newFrequencyData( const SpectrumUpdateEvent* ); 00078 void UpdateGuiTimer(); 00079 00080 protected: 00081 00082 private: 00083 void _AverageHistory( const double * newBuffer ); 00084 00085 bool _useOpenGL; 00086 int _historyEntryCount; 00087 int _historyEntry; 00088 std::vector<double*>* _historyVector; 00089 double* _averagedValues; 00090 uint64_t _numRealDataPoints; 00091 double* _realFFTDataPoints; 00092 QIntValidator* _intValidator; 00093 FrequencyDisplayPlot* _frequencyDisplayPlot; 00094 WaterfallDisplayPlot* _waterfallDisplayPlot; 00095 Waterfall3DDisplayPlot* _waterfall3DDisplayPlot; 00096 TimeDomainDisplayPlot* _timeDomainDisplayPlot; 00097 ConstellationDisplayPlot* _constellationDisplayPlot; 00098 SpectrumGUIClass* _system; 00099 bool _systemSpecifiedFlag; 00100 double _centerFrequency; 00101 double _startFrequency; 00102 double _noiseFloorAmplitude; 00103 double _peakFrequency; 00104 double _peakAmplitude; 00105 static int _openGLWaterfall3DFlag; 00106 double _stopFrequency; 00107 00108 //SpectrumUpdateEvent _lastSpectrumEvent; 00109 00110 // whether or not to use a particular display 00111 int d_plot_fft; 00112 int d_plot_waterfall; 00113 int d_plot_waterfall3d; 00114 int d_plot_time; 00115 int d_plot_constellation; 00116 00117 QTimer *displayTimer; 00118 double d_update_time; 00119 }; 00120 00121 #endif /* SPECTRUM_DISPLAY_FORM_H */