diff --git a/src/applications/gqrx/mainwindow.cpp b/src/applications/gqrx/mainwindow.cpp index 2b6ce03a3c..bc8887a6ff 100644 --- a/src/applications/gqrx/mainwindow.cpp +++ b/src/applications/gqrx/mainwindow.cpp @@ -2136,6 +2136,7 @@ void MainWindow::iqFftTimeout() unsigned int fftsize; unsigned int i; qint64 fft_approx_timestamp; + qint64 fft_start=QDateTime::currentMSecsSinceEpoch(); // FIXME: fftsize is a reference rx->get_iq_fft_data(d_fftData, fftsize); @@ -2156,6 +2157,8 @@ void MainWindow::iqFftTimeout() } ui->plotter->setNewFftData(d_iirFftData, d_realFftData, fftsize, fft_approx_timestamp); + d_fft_duration+=(double(QDateTime::currentMSecsSinceEpoch()-fft_start)-d_fft_duration)*0.1; + uiDockFft->setFftLag(d_fft_duration>iq_fft_timer->interval()); } void MainWindow::iqFftToMag(unsigned int fftsize, std::complex* fftData, float* realFftData) const diff --git a/src/applications/gqrx/mainwindow.h b/src/applications/gqrx/mainwindow.h index 55e0e0b20d..c19c5917ce 100644 --- a/src/applications/gqrx/mainwindow.h +++ b/src/applications/gqrx/mainwindow.h @@ -145,6 +145,7 @@ public slots: std::condition_variable waterfall_background_ready; int waterfall_background_threads{0}; std::thread waterfall_background_thread; + double d_fft_duration{0.0}; private: void updateHWFrequencyRange(bool ignore_limits); diff --git a/src/qtgui/dockfft.cpp b/src/qtgui/dockfft.cpp index 723fa5b145..2f6cb4fc0e 100644 --- a/src/qtgui/dockfft.cpp +++ b/src/qtgui/dockfft.cpp @@ -636,6 +636,11 @@ void DockFft::on_threadsComboBox_currentTextChanged(const QString &text) emit wfThreadsChanged(val); } +void DockFft::setFftLag(bool l) +{ + ui->fftRateLabel->setStyleSheet(l?"background:red;":""); +} + /** Update RBW and FFT overlab labels */ void DockFft::updateInfoLabels(void) { diff --git a/src/qtgui/dockfft.h b/src/qtgui/dockfft.h index 131bbcc6ff..099aa70e85 100644 --- a/src/qtgui/dockfft.h +++ b/src/qtgui/dockfft.h @@ -46,6 +46,7 @@ class DockFft : public QDockWidget int setFftSize(int fft_size); void setSampleRate(float sample_rate); + void setFftLag(bool); void saveSettings(QSettings *settings); void readSettings(QSettings *settings);