GNU Radio 3.7.1 C++ API
SpectrumGUIClass.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2008-2011 Free Software Foundation, Inc.
4
*
5
* This file is part of GNU Radio
6
*
7
* GNU Radio is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3, or (at your option)
10
* any later version.
11
*
12
* GNU Radio is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with GNU Radio; see the file COPYING. If not, write to
19
* the Free Software Foundation, Inc., 51 Franklin Street,
20
* Boston, MA 02110-1301, USA.
21
*/
22
23
#ifndef SPECTRUM_GUI_CLASS_HPP
24
#define SPECTRUM_GUI_CLASS_HPP
25
26
#include <
gnuradio/thread/thread.h
>
27
#include <qwidget.h>
28
#include <qapplication.h>
29
#include <qlabel.h>
30
#include <qslider.h>
31
#include <
gnuradio/qtgui/spectrumUpdateEvents.h
>
32
33
class
SpectrumDisplayForm
;
34
#include <
gnuradio/qtgui/spectrumdisplayform.h
>
35
36
#include <cmath>
37
38
#include <complex>
39
#include <vector>
40
#include <string>
41
42
/*!
43
* \brief QWidget class for controlling plotting.
44
* \ingroup qtgui_blk
45
*/
46
class
SpectrumGUIClass
47
{
48
public
:
49
SpectrumGUIClass
(
const
uint64_t
maxDataSize,
const
uint64_t
fftSize,
50
const
double
newCenterFrequency,
51
const
double
newStartFrequency,
52
const
double
newStopFrequency);
53
~SpectrumGUIClass
();
54
void
reset
();
55
56
void
openSpectrumWindow
(QWidget*,
57
const
bool
frequency=
true
,
const
bool
waterfall=
true
,
58
const
bool
time=
true
,
const
bool
constellation=
true
);
59
void
setDisplayTitle
(
const
std::string);
60
61
bool
getWindowOpenFlag
();
62
void
setWindowOpenFlag
(
const
bool
);
63
64
void
setFrequencyRange
(
const
double
,
const
double
,
const
double
);
65
double
getStartFrequency
();
66
double
getStopFrequency
();
67
double
getCenterFrequency
();
68
69
void
updateWindow
(
const
bool
,
const
float
*,
70
const
uint64_t
,
const
float
*,
71
const
uint64_t
,
const
float
*,
72
const
uint64_t
,
73
const
gr::high_res_timer_type
,
const
bool
);
74
75
float
getPowerValue
();
76
void
setPowerValue
(
const
float
);
77
78
int
getWindowType
();
79
void
setWindowType
(
const
int
);
80
81
int
getFFTSize
();
82
int
getFFTSizeIndex
();
83
void
setFFTSize
(
const
int
);
84
85
gr::high_res_timer_type
getLastGUIUpdateTime
();
86
void
setLastGUIUpdateTime
(
const
gr::high_res_timer_type
);
87
88
unsigned
int
getPendingGUIUpdateEvents
();
89
void
incrementPendingGUIUpdateEvents
();
90
void
decrementPendingGUIUpdateEvents
();
91
void
resetPendingGUIUpdateEvents
();
92
93
static
const
long
MAX_FFT_SIZE
;
94
static
const
long
MIN_FFT_SIZE
;
95
96
QWidget*
qwidget
();
97
98
void
setTimeDomainAxis
(
double
min
,
double
max);
99
void
setConstellationAxis
(
double
xmin,
double
xmax,
100
double
ymin,
double
ymax);
101
void
setConstellationPenSize
(
int
size);
102
void
setFrequencyAxis
(
double
min
,
double
max);
103
104
void
setUpdateTime
(
double
t);
105
106
protected
:
107
108
private
:
109
110
gr::thread::mutex
d_mutex;
111
int64_t
_dataPoints;
112
std::string _title;
113
double
_centerFrequency;
114
double
_startFrequency;
115
double
_stopFrequency;
116
float
_powerValue;
117
bool
_windowOpennedFlag;
118
int
_windowType;
119
int64_t
_lastDataPointCount;
120
int
_fftSize;
121
gr::high_res_timer_type
_lastGUIUpdateTime;
122
unsigned
int
_pendingGUIUpdateEventsCount;
123
int
_droppedEntriesCount;
124
bool
_fftBuffersCreatedFlag;
125
double
_updateTime;
126
127
SpectrumDisplayForm
* _spectrumDisplayForm;
128
129
float
* _fftPoints;
130
double
* _realTimeDomainPoints;
131
double
* _imagTimeDomainPoints;
132
};
133
134
#endif
/* SPECTRUM_GUI_CLASS_HPP */
gr-qtgui
include
gnuradio
qtgui
SpectrumGUIClass.h
Generated on Wed Oct 2 2013 01:55:46 for GNU Radio 3.7.1 C++ API by
1.8.4