diff --git a/debian/changelog b/debian/changelog index 613672eee..8ed0f20a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sdrangel (3.3.3-1) unstable; urgency=medium + + * HackRF, BladeRF, RTLSDR plugins: continuous sample rate setting + + -- Edouard Griffiths, F4EXB Sun, 16 Apr 2017 23:14:18 +0100 + sdrangel (3.3.2-1) unstable; urgency=medium * ATV plugins: added 405 lines, 20 and 16 FPS modes diff --git a/plugins/samplesource/hackrfinput/hackrfinput.cpp b/plugins/samplesource/hackrfinput/hackrfinput.cpp index a83d9aa95..ff725da22 100644 --- a/plugins/samplesource/hackrfinput/hackrfinput.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinput.cpp @@ -287,11 +287,11 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force) if (rc != HACKRF_SUCCESS) { - qCritical("HackRFInput::applySettings: could not set sample rate TO %d kS/s: %s", m_settings.m_devSampleRate, hackrf_error_name(rc)); + qCritical("HackRFInput::applySettings: could not set sample rate TO %llu S/s: %s", m_settings.m_devSampleRate, hackrf_error_name(rc)); } else { - qDebug("HackRFInput::applySettings: sample rate set to %d kS/s", m_settings.m_devSampleRate); + qDebug("HackRFInput::applySettings: sample rate set to %llu S/s", m_settings.m_devSampleRate); m_hackRFThread->setSamplerate(m_settings.m_devSampleRate); } } @@ -469,8 +469,8 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force) qDebug() << "HackRFInput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz" << " device center freq: " << deviceCenterFrequency << " Hz" - << " device sample rate: " << m_settings.m_devSampleRate << "Hz" - << " Actual sample rate: " << m_settings.m_devSampleRate/(1<centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->centerFrequency->setValueRange(7, 0U, 7250000U); + ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::ReverseGreenYellow)); + ui->sampleRate->setValueRange(8, 2400000U, 20000000U); + connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); @@ -51,7 +54,6 @@ HackRFInputGui::HackRFInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : m_sampleSource = new HackRFInput(m_deviceAPI); - displaySampleRates(); displayBandwidths(); m_deviceAPI->setSource(m_sampleSource); @@ -165,7 +167,7 @@ void HackRFInputGui::updateSampleRateAndFrequency() { m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); - ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000)); + ui->deviceRateText->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'f', 0))); } void HackRFInputGui::displaySettings() @@ -178,8 +180,7 @@ void HackRFInputGui::displaySettings() ui->dcOffset->setChecked(m_settings.m_dcBlock); ui->iqImbalance->setChecked(m_settings.m_iqCorrection); - unsigned int sampleRateIndex = HackRFSampleRates::getRateIndex(m_settings.m_devSampleRate); - ui->sampleRate->setCurrentIndex(sampleRateIndex); + ui->sampleRate->setValue(m_settings.m_devSampleRate); ui->biasT->setChecked(m_settings.m_biasT); @@ -198,29 +199,6 @@ void HackRFInputGui::displaySettings() ui->vga->setValue(m_settings.m_vgaGain); } -void HackRFInputGui::displaySampleRates() -{ - int savedIndex = HackRFSampleRates::getRateIndex(m_settings.m_devSampleRate); - ui->sampleRate->blockSignals(true); - ui->sampleRate->clear(); - - for (int i = 0; i < HackRFSampleRates::m_nb_rates; i++) - { - ui->sampleRate->addItem(QString("%1").arg(QString::number(HackRFSampleRates::m_rates[i] / 1000.0f, 'f', 0))); - } - - ui->sampleRate->blockSignals(false); - - if (savedIndex < HackRFSampleRates::m_nb_rates) - { - ui->sampleRate->setCurrentIndex(savedIndex); - } - else - { - ui->sampleRate->setCurrentIndex((int) HackRFSampleRates::m_nb_rates-1); - } -} - void HackRFInputGui::displayBandwidths() { int savedIndex = HackRFBandwidths::getBandwidthIndex(m_settings.m_bandwidth/1000); @@ -250,12 +228,6 @@ void HackRFInputGui::sendSettings() m_updateTimer.start(100); } -void HackRFInputGui::on_centerFrequency_changed(quint64 value) -{ - m_settings.m_centerFrequency = value * 1000; - sendSettings(); -} - void HackRFInputGui::on_LOppm_valueChanged(int value) { m_settings.m_LOppmTenths = value; @@ -277,9 +249,9 @@ void HackRFInputGui::on_iqImbalance_toggled(bool checked) void HackRFInputGui::on_sampleRate_currentIndexChanged(int index) { - int newrate = HackRFSampleRates::getRate(index); - m_settings.m_devSampleRate = newrate; - sendSettings(); +// int newrate = HackRFSampleRates::getRate(index); +// m_settings.m_devOldSampleRate = newrate; +// sendSettings(); } void HackRFInputGui::on_bbFilter_currentIndexChanged(int index) @@ -301,6 +273,18 @@ void HackRFInputGui::on_lnaExt_stateChanged(int state) sendSettings(); } +void HackRFInputGui::on_centerFrequency_changed(quint64 value) +{ + m_settings.m_centerFrequency = value * 1000; + sendSettings(); +} + +void HackRFInputGui::on_newSampleRate_changed(quint64 value) +{ + m_settings.m_devSampleRate = value; + sendSettings(); +} + void HackRFInputGui::on_decim_currentIndexChanged(int index) { if ((index <0) || (index > 6)) diff --git a/plugins/samplesource/hackrfinput/hackrfinputgui.h b/plugins/samplesource/hackrfinput/hackrfinputgui.h index dfd83cd40..260897f61 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputgui.h +++ b/plugins/samplesource/hackrfinput/hackrfinputgui.h @@ -71,7 +71,6 @@ private: int m_lastEngineState; void displaySettings(); - void displaySampleRates(); void displayBandwidths(); void sendSettings(); void updateSampleRateAndFrequency(); @@ -79,6 +78,7 @@ private: private slots: void handleDSPMessages(); void on_centerFrequency_changed(quint64 value); + void on_newSampleRate_changed(quint64 value); void on_LOppm_valueChanged(int value); void on_dcOffset_toggled(bool checked); void on_iqImbalance_toggled(bool checked); diff --git a/plugins/samplesource/hackrfinput/hackrfinputgui.ui b/plugins/samplesource/hackrfinput/hackrfinputgui.ui index 61f526993..ba0a5deb3 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputgui.ui +++ b/plugins/samplesource/hackrfinput/hackrfinputgui.ui @@ -2,24 +2,16 @@ HackRFInputGui - - - 0 - 0 - 260 - 210 - - - + 0 0 - 260 - 210 + 310 + 300 @@ -49,6 +41,9 @@ + + 2 + @@ -118,16 +113,10 @@ - - - 0 - 0 - - 32 - 16 + 50 @@ -171,6 +160,12 @@ + + 2 + + + 2 + 3 @@ -214,6 +209,12 @@ + + 2 + + + 2 + @@ -290,11 +291,8 @@ - - - 3 - - + + @@ -302,40 +300,52 @@ 0 + + + 16 + 0 + + - Rate + SR - - - + + + + + 0 + 0 + + + - 70 - 16777215 + 32 + 16 + + + Monospace + 12 + + Device sample rate + sampleRateLabel - - + + - BBF + S/s - - - - RF bandpas filter - - - - - + + Qt::Horizontal @@ -347,10 +357,17 @@ - - + + - kS/s + BBF + + + + + + + RF bandpas filter @@ -358,6 +375,12 @@ + + 2 + + + 2 + 3 @@ -478,6 +501,12 @@ + + 2 + + + 2 + 3 @@ -539,6 +568,9 @@ + + 2 + 3 @@ -592,7 +624,7 @@ - + Qt::Vertical diff --git a/plugins/samplesource/hackrfinput/hackrfinputplugin.cpp b/plugins/samplesource/hackrfinput/hackrfinputplugin.cpp index 967c6bad0..574caed45 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputplugin.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinputplugin.cpp @@ -29,7 +29,7 @@ const PluginDescriptor HackRFInputPlugin::m_pluginDescriptor = { QString("HackRF Input"), - QString("3.3.0"), + QString("3.3.3"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/samplesource/hackrfinput/hackrfinputsettings.cpp b/plugins/samplesource/hackrfinput/hackrfinputsettings.cpp index 4d3066854..f4e784e74 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputsettings.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinputsettings.cpp @@ -29,7 +29,7 @@ void HackRFInputSettings::resetToDefaults() { m_centerFrequency = 435000 * 1000; m_LOppmTenths = 0; - m_devSampleRate = 2400000; + m_devOldSampleRate = 2400000; m_biasT = false; m_log2Decim = 0; m_fcPos = FC_POS_CENTER; @@ -46,7 +46,7 @@ QByteArray HackRFInputSettings::serialize() const SimpleSerializer s(1); s.writeS32(1, m_LOppmTenths); - s.writeU32(2, m_devSampleRate); + s.writeU32(2, m_devOldSampleRate); s.writeBool(3, m_biasT); s.writeU32(4, m_log2Decim); s.writeS32(5, m_fcPos); @@ -56,6 +56,7 @@ QByteArray HackRFInputSettings::serialize() const s.writeU32(9, m_vgaGain); s.writeBool(10, m_dcBlock); s.writeBool(11, m_iqCorrection); + s.writeU64(12, m_devSampleRate); return s.final(); } @@ -75,7 +76,7 @@ bool HackRFInputSettings::deserialize(const QByteArray& data) int intval; d.readS32(1, &m_LOppmTenths, 0); - d.readU32(2, &m_devSampleRate, 2400000); + d.readU32(2, &m_devOldSampleRate, 2400000); d.readBool(3, &m_biasT, false); d.readU32(4, &m_log2Decim, 0); d.readS32(5, &intval, 0); @@ -86,6 +87,7 @@ bool HackRFInputSettings::deserialize(const QByteArray& data) d.readU32(9, &m_vgaGain, 16); d.readBool(10, &m_dcBlock, false); d.readBool(11, &m_iqCorrection, false); + d.readU64(12, &m_devSampleRate, 2400000U); return true; } diff --git a/plugins/samplesource/hackrfinput/hackrfinputsettings.h b/plugins/samplesource/hackrfinput/hackrfinputsettings.h index dbc112189..ee089f40a 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputsettings.h +++ b/plugins/samplesource/hackrfinput/hackrfinputsettings.h @@ -28,12 +28,13 @@ struct HackRFInputSettings { quint64 m_centerFrequency; qint32 m_LOppmTenths; - quint32 m_devSampleRate; + quint32 m_devOldSampleRate; quint32 m_bandwidth; quint32 m_lnaGain; quint32 m_vgaGain; quint32 m_log2Decim; fcPos_t m_fcPos; + quint64 m_devSampleRate; bool m_biasT; bool m_lnaExt; bool m_dcBlock; diff --git a/sdrbase/gui/aboutdialog.ui b/sdrbase/gui/aboutdialog.ui index 705340686..b1b6db9ec 100644 --- a/sdrbase/gui/aboutdialog.ui +++ b/sdrbase/gui/aboutdialog.ui @@ -84,7 +84,7 @@ - <html><head/><body><p>Version 3.3.2 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">RTL-SDRangelove</span></a></p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> + <html><head/><body><p>Version 3.3.3 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">RTL-SDRangelove</span></a></p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> true diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index 5ffba92e6..8d1bc6df6 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -453,9 +453,9 @@ void MainWindow::createStatusBar() { QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); #if QT_VERSION >= 0x050400 - m_showSystemWidget = new QLabel("SDRangel v3.3.2 " + qtVersionStr + QSysInfo::prettyProductName(), this); + m_showSystemWidget = new QLabel("SDRangel v3.3.3 " + qtVersionStr + QSysInfo::prettyProductName(), this); #else - m_showSystemWidget = new QLabel("SDRangel v3.3.2 " + qtVersionStr, this); + m_showSystemWidget = new QLabel("SDRangel v3.3.3 " + qtVersionStr, this); #endif statusBar()->addPermanentWidget(m_showSystemWidget);