Skip to content

Commit

Permalink
dockfft: Lag indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
vladisslav2011 committed Aug 4, 2023
1 parent f1fa931 commit 2feab90
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/applications/gqrx/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<float>* fftData, float* realFftData) const
Expand Down
1 change: 1 addition & 0 deletions src/applications/gqrx/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/qtgui/dockfft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions src/qtgui/dockfft.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2feab90

Please sign in to comment.