[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10808 - gnuradio/branches/developers/trondeau/qtdevel
From: |
trondeau |
Subject: |
[Commit-gnuradio] r10808 - gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib |
Date: |
Sun, 12 Apr 2009 10:29:58 -0600 (MDT) |
Author: trondeau
Date: 2009-04-12 10:29:58 -0600 (Sun, 12 Apr 2009)
New Revision: 10808
Modified:
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/qtgui_sink_c.cc
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/spectrumdisplayform.cc
Log:
working on improving update time and speed up performance
Modified:
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/qtgui_sink_c.cc
===================================================================
---
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/qtgui_sink_c.cc
2009-04-12 16:26:19 UTC (rev 10807)
+++
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/qtgui_sink_c.cc
2009-04-12 16:29:58 UTC (rev 10808)
@@ -231,41 +231,47 @@
// Update the FFT size from the application
fftresize();
windowreset();
+
+ const timespec currentTime = get_highres_clock();
+ const timespec lastUpdateGUITime = d_main_gui->GetLastGUIUpdateTime();
- if(d_index) {
- int filler = std::min(d_fftsize - d_index, noutput_items);
+ if(diff_timespec(currentTime, lastUpdateGUITime) > 0.25) {
- memcpy(&d_residbuf[d_index], &in[0], sizeof(gr_complex)*filler);
- d_index += filler;
- i = filler;
- j = filler;
- }
-
- if(d_index == d_fftsize) {
- d_index = 0;
- fft(d_residbuf, d_fftsize, d_fftdata);
+ if(d_index) {
+ int filler = std::min(d_fftsize - d_index, noutput_items);
+
+ memcpy(&d_residbuf[d_index], &in[0], sizeof(gr_complex)*filler);
+ d_index += filler;
+ i = filler;
+ j = filler;
+ }
- d_main_gui->UpdateWindow(true, d_fftdata, d_fftsize, NULL, 0,
- (float*)d_residbuf, d_fftsize,
- 1.0/4.0, convert_to_timespec(0.0), true);
- }
-
- for(; i < noutput_items; i+=d_fftsize) {
- if(noutput_items - i > d_fftsize) {
- j += d_fftsize;
- fft(&in[i], d_fftsize, d_fftdata);
+ if(d_index == d_fftsize) {
+ d_index = 0;
+ fft(d_residbuf, d_fftsize, d_fftdata);
d_main_gui->UpdateWindow(true, d_fftdata, d_fftsize, NULL, 0,
- (float*)&in[i], d_fftsize,
+ (float*)d_residbuf, d_fftsize,
1.0/4.0, convert_to_timespec(0.0), true);
}
+
+ for(; i < noutput_items; i+=d_fftsize) {
+ if(noutput_items - i > d_fftsize) {
+ j += d_fftsize;
+ fft(&in[i], d_fftsize, d_fftdata);
+
+ d_main_gui->UpdateWindow(true, d_fftdata, d_fftsize, NULL, 0,
+ (float*)&in[i], d_fftsize,
+ 1.0/4.0, convert_to_timespec(0.0), true);
+ }
+ }
+
+ if(noutput_items > j) {
+ d_index = noutput_items - j;
+ memcpy(d_residbuf, &in[j], sizeof(gr_complex)*d_index);
+ }
}
- if(noutput_items > j) {
- d_index = noutput_items - j;
- memcpy(d_residbuf, &in[j], sizeof(gr_complex)*d_index);
- }
-
pthread_mutex_unlock(&d_pmutex);
consume_each(noutput_items);
Modified:
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/spectrumdisplayform.cc
===================================================================
---
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/spectrumdisplayform.cc
2009-04-12 16:26:19 UTC (rev 10807)
+++
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/spectrumdisplayform.cc
2009-04-12 16:29:58 UTC (rev 10808)
@@ -189,26 +189,27 @@
imagTimeDomainDataPoints,
numTimeDomainDataPoints);
}
- }
- // Don't update the repeated data for the waterfall
- if(!repeatDataFlag){
- if(tabindex == d_plot_waterfall) {
- _waterfallDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints,
- timePerFFT, dataTimestamp,
-
spectrumUpdateEvent->getDroppedFFTFrames());
- }
- if( _openGLWaterfall3DFlag == 1 && (tabindex == d_plot_waterfall3d)) {
- _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints,
numFFTDataPoints,
+
+ // Don't update the repeated data for the waterfall
+ if(!repeatDataFlag){
+ if(tabindex == d_plot_waterfall) {
+ _waterfallDisplayPlot->PlotNewData(_realFFTDataPoints,
numFFTDataPoints,
timePerFFT, dataTimestamp,
spectrumUpdateEvent->getDroppedFFTFrames());
+ }
+ if( _openGLWaterfall3DFlag == 1 && (tabindex == d_plot_waterfall3d)) {
+ _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints,
numFFTDataPoints,
+ timePerFFT, dataTimestamp,
+
spectrumUpdateEvent->getDroppedFFTFrames());
+ }
}
+
+ // Tell the system the GUI has been updated
+ if(_systemSpecifiedFlag){
+ _system->SetLastGUIUpdateTime(generatedTimestamp);
+ _system->DecrementPendingGUIUpdateEvents();
+ }
}
-
- // Tell the system the GUI has been updated
- if(_systemSpecifiedFlag){
- _system->SetLastGUIUpdateTime(generatedTimestamp);
- _system->DecrementPendingGUIUpdateEvents();
- }
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10808 - gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib,
trondeau <=