diff --git a/plugins/channelrx/freqscanner/freqscannergui.cpp b/plugins/channelrx/freqscanner/freqscannergui.cpp index 73c019430..d1931f8f6 100644 --- a/plugins/channelrx/freqscanner/freqscannergui.cpp +++ b/plugins/channelrx/freqscanner/freqscannergui.cpp @@ -101,9 +101,12 @@ bool FreqScannerGUI::handleMessage(const Message& message) DSPSignalNotification& notif = (DSPSignalNotification&) message; m_deviceCenterFrequency = notif.getCenterFrequency(); m_basebandSampleRate = notif.getSampleRate(); - ui->deltaFrequency->setValueRange(true, 7, 0, m_basebandSampleRate/2); - ui->deltaFrequencyLabel->setToolTip(tr("Range %1 %L2 Hz").arg(QChar(0xB1)).arg(m_basebandSampleRate/2)); - ui->channelBandwidth->setValueRange(true, 7, 0, m_basebandSampleRate); + if (m_basebandSampleRate != 0) + { + ui->deltaFrequency->setValueRange(true, 7, 0, m_basebandSampleRate/2); + ui->deltaFrequencyLabel->setToolTip(tr("Range %1 %L2 Hz").arg(QChar(0xB1)).arg(m_basebandSampleRate/2)); + ui->channelBandwidth->setValueRange(true, 7, 0, m_basebandSampleRate); + } if (m_channelMarker.getBandwidth() == 0) { m_channelMarker.setBandwidth(m_basebandSampleRate); } @@ -363,7 +366,7 @@ void FreqScannerGUI::onMenuDialogCalled(const QPoint &p) setTitleColor(m_settings.m_rgbColor); QList settingsKeys({ - "m_rgbColor", + "rgbColor", "title", "useReverseAPI", "reverseAPIAddress", diff --git a/plugins/channelrx/freqscanner/freqscannergui.ui b/plugins/channelrx/freqscanner/freqscannergui.ui index a22fa5160..7d6da12a2 100644 --- a/plugins/channelrx/freqscanner/freqscannergui.ui +++ b/plugins/channelrx/freqscanner/freqscannergui.ui @@ -313,12 +313,12 @@ - 45 + 54 0 - 100 ms + 1000 ms diff --git a/plugins/channelrx/freqscanner/freqscannersink.cpp b/plugins/channelrx/freqscanner/freqscannersink.cpp index b4d9689dc..ab1408967 100644 --- a/plugins/channelrx/freqscanner/freqscannersink.cpp +++ b/plugins/channelrx/freqscanner/freqscannersink.cpp @@ -171,8 +171,9 @@ Real FreqScannerSink::peakPower(int bin) const // Skip bin between halfway between channels // Then skip first and last bins, to avoid spectral leakage (particularly at DC) int startBin = bin - m_binsPerChannel/2 + 1 + 1; - Real maxMagSq = m_magSq[startBin]; - for (int i = 1; i < m_binsPerChannel - 2 - 1; i++) { + Real maxMagSq = std::numeric_limits::min(); + for (int i = 0; i < m_binsPerChannel - 2 - 1; i++) + { int idx = startBin + i; if ((idx < 0) || (idx >= m_fftSize)) { continue;