mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-22 08:04:49 -05:00
Fix crash and tidy up UI.
This commit is contained in:
parent
51ddd77aa3
commit
515e19f20b
@ -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<QString> settingsKeys({
|
||||
"m_rgbColor",
|
||||
"rgbColor",
|
||||
"title",
|
||||
"useReverseAPI",
|
||||
"reverseAPIAddress",
|
||||
|
@ -313,12 +313,12 @@
|
||||
<widget class="QLabel" name="tuneTimeText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>45</width>
|
||||
<width>54</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>100 ms</string>
|
||||
<string>1000 ms</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -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<Real>::min();
|
||||
for (int i = 0; i < m_binsPerChannel - 2 - 1; i++)
|
||||
{
|
||||
int idx = startBin + i;
|
||||
if ((idx < 0) || (idx >= m_fftSize)) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user