summaryrefslogtreecommitdiff
path: root/gr-qtgui/src/lib/qtgui_sink_c.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/src/lib/qtgui_sink_c.cc')
-rw-r--r--gr-qtgui/src/lib/qtgui_sink_c.cc28
1 files changed, 20 insertions, 8 deletions
diff --git a/gr-qtgui/src/lib/qtgui_sink_c.cc b/gr-qtgui/src/lib/qtgui_sink_c.cc
index 7340141a69..c12c451b00 100644
--- a/gr-qtgui/src/lib/qtgui_sink_c.cc
+++ b/gr-qtgui/src/lib/qtgui_sink_c.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2008,2009 Free Software Foundation, Inc.
+ * Copyright 2008,2009,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -40,7 +40,7 @@ qtgui_make_sink_c (int fftsize, int wintype,
bool use_openGL,
QWidget *parent)
{
- return qtgui_sink_c_sptr (new qtgui_sink_c (fftsize, wintype,
+ return gnuradio::get_initial_sptr(new qtgui_sink_c (fftsize, wintype,
fc, bw, name,
plotfreq, plotwaterfall,
plotwaterfall3d, plottime,
@@ -64,10 +64,13 @@ qtgui_sink_c::qtgui_sink_c (int fftsize, int wintype,
d_wintype((gr_firdes::win_type)(wintype)),
d_center_freq(fc), d_bandwidth(bw), d_name(name),
d_plotfreq(plotfreq), d_plotwaterfall(plotwaterfall),
- d_plotwaterfall3d(plotwaterfall3d), d_plottime(plottime),
- d_plotconst(plotconst),
+ d_plottime(plottime), d_plotconst(plotconst),
d_parent(parent)
{
+ if(plotwaterfall3d == true) {
+ fprintf(stderr, "Warning: plotting Waterfall3D has been removed; enabling plotwaterfall3d has no effect.\n");
+ }
+
d_main_gui = NULL;
pthread_mutex_init(&d_pmutex, NULL);
lock();
@@ -88,7 +91,7 @@ qtgui_sink_c::qtgui_sink_c (int fftsize, int wintype,
qtgui_sink_c::~qtgui_sink_c()
{
- delete d_object;
+ delete d_main_gui;
delete [] d_residbuf;
delete d_fft;
}
@@ -141,10 +144,12 @@ qtgui_sink_c::initialize(const bool opengl)
d_main_gui->OpenSpectrumWindow(d_parent,
d_plotfreq, d_plotwaterfall,
- d_plotwaterfall3d, d_plottime,
- d_plotconst,
+ d_plottime, d_plotconst,
opengl);
+ // initialize update time to 10 times a second
+ set_update_time(0.1);
+
d_object = new qtgui_obj(d_qApplication);
qApp->postEvent(d_object, new qtgui_event(&d_pmutex));
}
@@ -208,6 +213,13 @@ qtgui_sink_c::set_frequency_axis(double min, double max)
}
void
+qtgui_sink_c::set_update_time(double t)
+{
+ d_update_time = t;
+ d_main_gui->SetUpdateTime(d_update_time);
+}
+
+void
qtgui_sink_c::fft(const gr_complex *data_in, int size)
{
if (d_window.size()) {
@@ -300,7 +312,7 @@ qtgui_sink_c::general_work (int noutput_items,
d_main_gui->UpdateWindow(true, d_fft->get_outbuf(), d_fftsize,
NULL, 0, (float*)d_residbuf, d_fftsize,
- 1.0/4.0, currentTime, true);
+ currentTime, true);
}
// Otherwise, copy what we received into the residbuf for next time
else {