From 685d5595c4a9d8b36807ee56319e48ce1412c7d7 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 10 Jun 2017 03:10:30 +0200 Subject: [PATCH] SDRdaemonSource: do not set Tx delay when sample rate is null --- .../samplesource/sdrdaemonsource/sdrdaemonsourcegui.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcegui.cpp b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcegui.cpp index fd7ff5c98..b9db31698 100644 --- a/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcegui.cpp +++ b/plugins/samplesource/sdrdaemonsource/sdrdaemonsourcegui.cpp @@ -304,7 +304,12 @@ void SDRdaemonSourceGui::updateSampleRateAndFrequency() void SDRdaemonSourceGui::updateTxDelay() { - m_txDelay = ((127*127*m_settings.m_txDelay) / m_sampleRate)/(128 + m_nbFECBlocks); + if (m_sampleRate == 0) { + m_txDelay = 0.0; // 0 value will not set the Tx delay + } else { + m_txDelay = ((127*127*m_settings.m_txDelay) / m_sampleRate)/(128 + m_nbFECBlocks); + } + ui->txDelayText->setToolTip(tr("%1 us").arg(QString::number(m_txDelay*1e6, 'f', 0))); }