diff --git a/Readme.md b/Readme.md index 601bf8a28..12a252774 100644 --- a/Readme.md +++ b/Readme.md @@ -17,7 +17,7 @@ Funcube Dongle Pro+ USB drivers are broken on some hardware with recent kernels. BladeRF ======= -No support. Ends up with: `Hierarchical blocks do not yet support arbitrary or variable numbers of inputs or outputs` +You need a very recent (May 2015) version of gr-osmosdr. 0.1.1 does not work but 0.1.5 does. Check to which library points the symbolic link `libgnuradio-osmosdr.so`. It should be something like: `libgnuradio-osmosdr-0.1.5git.so.0.0.` ========== For Ubuntu @@ -67,6 +67,10 @@ Known Issues - Does not work properly for RTL-SDR sampling rates not multiple of AF sampling rate (48000 Hz). This is because the interpolator/decimator is not a rational resampler actually (just does one or the other). For now please use 288, 1152 or 1536 kHz sampling rates, - RTL frontend will have bad aliasing in noisy environments. Considering the size of the hardware there is no place for proper filters. With good filtering and a good antenna up front these devices work remarkably well for the price! - Aliasing can be annoying for broadcast FM. In this case try to shift the signal until you find a clear background for your station. This is a limitation of the RTL hardware so just use this workaround. + - GNU Radio plugin is still not fully functional: + - Current settings are not saved and retrieved on the next session + - DC offset and I/Q policy is not working properly and has been disabled (effectively enforces the + "keep" mode always) =================== Done since the fork @@ -87,12 +91,12 @@ Done since the fork - Make the low cutoff frequency of the SSB filter variable so it can be used for CW also. - NFM demodulation without using atan and smooth squelch with AGC suppressing most clicks on low level signals and hiss on carrier tails. Only useful modulation comes through. - Added working WFM demodulation. Optimized for no atan2. + - Improved GNU Radio plugin usability with most settings saved on a preset ===== To Do ===== - - Missing de-emphasis on WFM - Enhance WFM (stereo, RDS?) - Make the the SSB filter frequency bounds tunable so that it can be used for CW. Change marker overlay accordingly. - Possibility to completely undock the receiver in a separate window. Useful when there are many receivers diff --git a/include-gpl/mainwindow.h b/include-gpl/mainwindow.h index d2beede0e..624a87eaa 100644 --- a/include-gpl/mainwindow.h +++ b/include-gpl/mainwindow.h @@ -122,6 +122,7 @@ private slots: void on_action_View_Fullscreen_toggled(bool checked); void on_presetSave_clicked(); void on_presetUpdate_clicked(); + void on_presetLastLoad_clicked(); void on_presetLoad_clicked(); void on_presetDelete_clicked(); void on_presetTree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); diff --git a/include/util/stacktrace.h b/include/util/stacktrace.h new file mode 100644 index 000000000..49a5e5c0a --- /dev/null +++ b/include/util/stacktrace.h @@ -0,0 +1,93 @@ +// stacktrace.h (c) 2008, Timo Bingmann from http://idlebox.net/ +// published under the WTFPL v2.0 + +#ifndef _STACKTRACE_H_ +#define _STACKTRACE_H_ + +#include +#include +#include +#include + +/** Print a demangled stack backtrace of the caller function to FILE* out. */ +static inline void print_stacktrace(FILE *out = stderr, unsigned int max_frames = 63) +{ + fprintf(out, "stack trace:\n"); + + // storage array for stack trace address data + void* addrlist[max_frames+1]; + + // retrieve current stack addresses + int addrlen = backtrace(addrlist, sizeof(addrlist) / sizeof(void*)); + + if (addrlen == 0) { + fprintf(out, " \n"); + return; + } + + // resolve addresses into strings containing "filename(function+address)", + // this array must be free()-ed + char** symbollist = backtrace_symbols(addrlist, addrlen); + + // allocate string which will be filled with the demangled function name + size_t funcnamesize = 256; + char* funcname = (char*)malloc(funcnamesize); + + // iterate over the returned symbol lines. skip the first, it is the + // address of this function. + for (int i = 1; i < addrlen; i++) + { + char *begin_name = 0, *begin_offset = 0, *end_offset = 0; + + // find parentheses and +address offset surrounding the mangled name: + // ./module(function+0x15c) [0x8048a6d] + for (char *p = symbollist[i]; *p; ++p) + { + if (*p == '(') + begin_name = p; + else if (*p == '+') + begin_offset = p; + else if (*p == ')' && begin_offset) { + end_offset = p; + break; + } + } + + if (begin_name && begin_offset && end_offset + && begin_name < begin_offset) + { + *begin_name++ = '\0'; + *begin_offset++ = '\0'; + *end_offset = '\0'; + + // mangled name is now in [begin_name, begin_offset) and caller + // offset in [begin_offset, end_offset). now apply + // __cxa_demangle(): + + int status; + char* ret = abi::__cxa_demangle(begin_name, + funcname, &funcnamesize, &status); + if (status == 0) { + funcname = ret; // use possibly realloc()-ed string + fprintf(out, " %s : %s+%s\n", + symbollist[i], funcname, begin_offset); + } + else { + // demangling failed. Output function name as a C function with + // no arguments. + fprintf(out, " %s : %s()+%s\n", + symbollist[i], begin_name, begin_offset); + } + } + else + { + // couldn't parse the line? print the whole line. + fprintf(out, " %s\n", symbollist[i]); + } + } + + free(funcname); + free(symbollist); +} + +#endif // _STACKTRACE_H_ diff --git a/plugins/samplesource/CMakeLists.txt b/plugins/samplesource/CMakeLists.txt index a85c0a642..e48d7b8b6 100644 --- a/plugins/samplesource/CMakeLists.txt +++ b/plugins/samplesource/CMakeLists.txt @@ -6,9 +6,9 @@ find_package(LibUSB) add_subdirectory(gnuradio) #add_subdirectory(remote) -if(LIBUSB_FOUND AND LIBOSMOSDR_FOUND) - add_subdirectory(osmosdr) -endif(LIBUSB_FOUND AND LIBOSMOSDR_FOUND) +#if(LIBUSB_FOUND AND LIBOSMOSDR_FOUND) +# add_subdirectory(osmosdr) +#endif(LIBUSB_FOUND AND LIBOSMOSDR_FOUND) if(V4L-RTL) FIND_LIBRARY (LIBV4L2 v4l2) diff --git a/plugins/samplesource/gnuradio/gnuradiogui.cpp b/plugins/samplesource/gnuradio/gnuradiogui.cpp index 537894a22..34cb14477 100644 --- a/plugins/samplesource/gnuradio/gnuradiogui.cpp +++ b/plugins/samplesource/gnuradio/gnuradiogui.cpp @@ -36,7 +36,8 @@ GNURadioGui::GNURadioGui(PluginAPI* pluginAPI, QWidget* parent) : { ui->setupUi(this); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); - displaySettings(); + //displaySettings(); + updateDisplayDevices(); m_sampleSource = new GNURadioInput(m_pluginAPI->getMainWindowMessageQueue()); m_pluginAPI->setSampleSource(m_sampleSource); @@ -119,32 +120,24 @@ bool GNURadioGui::handleMessage(Message* message) m_bandwidths = rep->getBandwidths(); /* insert 0 which will become "Auto" in the combo box */ m_bandwidths.insert(m_bandwidths.begin(), 0); - displaySettings(); + //displaySettings(); + updateDisplayConstants(); return true; } else { return false; } } -void GNURadioGui::displaySettings() +void GNURadioGui::updateDisplayDevices() { - int oldIndex = 0; - - oldIndex = ui->cboDevices->currentIndex(); - ui->cboDevices->clear(); - - QString oldArgs = ui->txtDeviceArgs->text(); - + // Device list osmosdr::devices_t devices = osmosdr::device::find(); - for ( uint i = 0; i < devices.size(); i++ ) - { + for ( uint i = 0; i < devices.size(); i++ ) { osmosdr::device_t dev = devices[i]; - QString label; - if ( dev.count( "label" ) ) - { + if ( dev.count( "label" ) ) { label = QString(dev[ "label" ].c_str()); dev.erase("label"); } @@ -155,29 +148,16 @@ void GNURadioGui::displaySettings() ui->cboDevices->addItem(label); } - if ( ui->cboDevices->count() && oldIndex >= 0 ) - { - if ( oldIndex > ui->cboDevices->count() - 1 ) - oldIndex = 0; - - ui->cboDevices->setCurrentIndex(oldIndex); - - if ( oldArgs.length() == 0 ) - ui->txtDeviceArgs->setText( m_devs[oldIndex].second ); + if ( ui->cboDevices->count() ) { + ui->cboDevices->setEnabled(true); + } else { + ui->cboDevices->setEnabled(false); } +} - if ( oldArgs.length() ) - ui->txtDeviceArgs->setText( oldArgs ); - - ui->centerFrequency->setValueRange(7, - unsigned(m_freqMin / 1000.0), - unsigned(m_freqMax / 1000.0)); - - ui->centerFrequency->setValue(m_generalSettings.m_centerFrequency / 1000); - - ui->sldFreqCorr->setRange(-100, +100); - ui->sldFreqCorr->setValue( m_freqCorr ); - ui->lblFreqCorr->setText(tr("%1").arg(ui->sldFreqCorr->value())); +void GNURadioGui::updateDisplayConstants() +{ + // Device specific gain controls m_gainControls.clear(); QVBoxLayout *layoutGains = ui->verticalLayoutGains; @@ -213,17 +193,20 @@ void GNURadioGui::displaySettings() QPair< QSlider*, QLabel* > pair2( gainSlider, gainLabel ); m_gainControls.push_back( pair2 ); - connect(gainSlider, SIGNAL(valueChanged(int)), - this, SLOT(on_sldGain_valueChanged(int))); - layout->addWidget(gainName); layout->addWidget(gainSlider); layout->addWidget(gainLabel); + m_gainSliders.push_back(gainSlider); + m_gainLabels.push_back(gainLabel); + layoutGains->addLayout(layout); std::vector gain_values = pair.second; + connect(gainSlider, SIGNAL(valueChanged(int)), + this, SLOT(on_sldGain_valueChanged(int))); + if ( gain_values.size() ) { gainSlider->setRange(0, gain_values.size() - 1); gainSlider->setValue(gain_values.size() / 4); @@ -233,17 +216,12 @@ void GNURadioGui::displaySettings() } } - oldIndex = ui->cboSampleRate->currentIndex(); - ui->cboSampleRate->clear(); + // Sample rate - for ( uint i = 0; i < m_sampRates.size(); i++ ) - ui->cboSampleRate->addItem( QString::number(m_sampRates[i] / 1e6) ); - - if ( oldIndex > ui->cboSampleRate->count() - 1 ) - oldIndex = 0; - - if ( ui->cboSampleRate->count() && oldIndex >= 0 ) - ui->cboSampleRate->setCurrentIndex(oldIndex); + if (m_sampRates.size()) { + for ( uint i = 0; i < m_sampRates.size(); i++ ) + ui->cboSampleRate->addItem( QString::number(m_sampRates[i] / 1e6) ); + } if ( ui->cboSampleRate->count() ) { ui->cboSampleRate->setEnabled(true); @@ -251,68 +229,53 @@ void GNURadioGui::displaySettings() ui->cboSampleRate->setEnabled(false); } - oldIndex = ui->cboAntennas->currentIndex(); - ui->cboAntennas->clear(); + // Antenna if ( m_antennas.size() ) { for ( uint i = 0; i < m_antennas.size(); i++ ) ui->cboAntennas->addItem( m_antennas[i] ); + } - if ( oldIndex > ui->cboAntennas->count() - 1 ) - oldIndex = 0; - - if ( ui->cboAntennas->count() && oldIndex >= 0 ) - ui->cboAntennas->setCurrentIndex(oldIndex); - + if (ui->cboAntennas->count()) { ui->cboAntennas->setEnabled(true); } else { ui->cboAntennas->setEnabled(false); } - oldIndex = ui->cboDCOffset->currentIndex(); - ui->cboDCOffset->clear(); + // DC offset policy if ( m_dcoffs.size() ) { for ( uint i = 0; i < m_dcoffs.size(); i++ ) ui->cboDCOffset->addItem( m_dcoffs[i] ); + } - if ( ui->cboDCOffset->count() && oldIndex >= 0 ) - ui->cboDCOffset->setCurrentIndex(oldIndex); - + if (ui->cboDCOffset->count()) { ui->cboDCOffset->setEnabled(true); } else { ui->cboDCOffset->setEnabled(false); } - oldIndex = ui->cboIQBalance->currentIndex(); - ui->cboIQBalance->clear(); + // I/Q balance policy if ( m_iqbals.size() ) { for ( uint i = 0; i < m_iqbals.size(); i++ ) ui->cboIQBalance->addItem( m_iqbals[i] ); + } - if ( ui->cboIQBalance->count() && oldIndex >= 0 ) - ui->cboIQBalance->setCurrentIndex(oldIndex); - + if (ui->cboIQBalance->count()) { ui->cboIQBalance->setEnabled(true); } else { ui->cboIQBalance->setEnabled(false); } - oldIndex = ui->cboBandwidth->currentIndex(); - ui->cboBandwidth->clear(); + // Bandwidths - for ( uint i = 0; i < m_bandwidths.size(); i++ ) + for ( uint i = 0; i < m_bandwidths.size(); i++ ) { if ( 0.0 == m_bandwidths[i] ) ui->cboBandwidth->addItem( "Auto" ); else ui->cboBandwidth->addItem( QString::number(m_bandwidths[i] / 1e6) ); - - if ( oldIndex > ui->cboBandwidth->count() - 1 ) - oldIndex = 0; - - if ( ui->cboBandwidth->count() && oldIndex >= 0 ) - ui->cboBandwidth->setCurrentIndex(oldIndex); + } if ( ui->cboBandwidth->count() ) { ui->cboBandwidth->setEnabled(true); @@ -321,6 +284,141 @@ void GNURadioGui::displaySettings() } } +void GNURadioGui::displaySettings() +{ + int oldIndex = 0; + + // Device list + + oldIndex = ui->cboDevices->currentIndex(); + QString oldArgs = ui->txtDeviceArgs->text(); + + if ( ui->cboDevices->count() && oldIndex >= 0 ) + { + if ( oldIndex > ui->cboDevices->count() - 1 ) + oldIndex = 0; + + ui->cboDevices->setCurrentIndex(oldIndex); + + if ( oldArgs.length() == 0 ) + ui->txtDeviceArgs->setText( m_devs[oldIndex].second ); + } + + if ( oldArgs.length() ) + ui->txtDeviceArgs->setText( oldArgs ); + + // Center frequency + + ui->centerFrequency->setValueRange(7, + unsigned(m_freqMin / 1000.0), + unsigned(m_freqMax / 1000.0)); + + ui->centerFrequency->setValue(m_generalSettings.m_centerFrequency / 1000); + + // Device specific gain controls + + for ( uint i = 0; i < m_namedGains.size(); i++ ) + { + double gain = m_settings.m_namedGains[i].second; + int sliderIndex = getGainIndex(m_namedGains[i].second, gain); + m_gainSliders[i]->setValue(sliderIndex); + m_gainLabels[i]->setText(tr("%1").arg(gain)); + } + + // Frequency correction + + ui->sldFreqCorr->setRange(-100, +100); + ui->sldFreqCorr->setValue( m_freqCorr ); + ui->lblFreqCorr->setText(tr("%1").arg(ui->sldFreqCorr->value())); + + // Sample rate + ui->cboSampleRate->setCurrentIndex(getSampleRateIndex(m_settings.m_sampRate)); + + // Antenna + ui->cboAntennas->setCurrentIndex(getAntennaIndex(m_settings.m_antenna)); + + // DC offset policy + ui->cboDCOffset->setCurrentIndex(getDCOffsetIndex(m_settings.m_dcoff)); + + // I/Q balance policy + ui->cboIQBalance->setCurrentIndex(getIQBalanceIndex(m_settings.m_iqbal)); + + // Bandwidth + ui->cboBandwidth->setCurrentIndex(getBandwidthIndex(m_settings.m_bandwidth)); +} + +int GNURadioGui::getSampleRateIndex(double sampleRate) +{ + int index = m_sampRates.size() - 1; + + for ( uint i = 0; i < m_sampRates.size(); i++ ) { + if (sampleRate >= m_sampRates[i]) { + index = i; + } + } + + return index; +} + +int GNURadioGui::getGainIndex(std::vector steps, double gain) +{ + int index = 0; + + for (std::vector::const_iterator it = steps.begin(); it != steps.end(); ++it, index++) { + if (gain <= *it) { + break; + } + } + + return index; +} + +int GNURadioGui::getBandwidthIndex(double bandwidth) +{ + int index = 0; + + for ( uint i = 0; i < m_bandwidths.size(); index++ ) { + if (bandwidth <= m_bandwidths[i]) { + break; + } + } + + return index; +} + +int GNURadioGui::getDCOffsetIndex(QString offsetStr) +{ + for ( uint i = 0; i < m_dcoffs.size(); i++ ) { + if (offsetStr == m_dcoffs[i]) { + return i; + } + } + + return 0; +} + +int GNURadioGui::getIQBalanceIndex(QString iqBalanceStr) +{ + for ( uint i = 0; i < m_iqbals.size(); i++ ) { + if (iqBalanceStr == m_iqbals[i]) { + return i; + } + } + + return 0; +} + +int GNURadioGui::getAntennaIndex(QString antennaStr) +{ + for ( uint i = 0; i < m_antennas.size(); i++ ) { + if (antennaStr == m_antennas[i]) { + return i; + } + } + + return 0; +} + void GNURadioGui::sendSettings() { if(!m_updateTimer.isActive()) diff --git a/plugins/samplesource/gnuradio/gnuradiogui.h b/plugins/samplesource/gnuradio/gnuradiogui.h index 1954619d4..2fcbeb42b 100644 --- a/plugins/samplesource/gnuradio/gnuradiogui.h +++ b/plugins/samplesource/gnuradio/gnuradiogui.h @@ -76,11 +76,19 @@ private: SampleSource::GeneralSettings m_generalSettings; QTimer m_updateTimer; + void updateDisplayDevices(); + void updateDisplayConstants(); void displaySettings(); void sendSettings(); private slots: void updateHardware(); + int getSampleRateIndex(double sampleRate); + int getDCOffsetIndex(QString offsetStr); + int getIQBalanceIndex(QString iqBalanceStr); + int getAntennaIndex(QString antennaStr); + int getBandwidthIndex(double bandwidth); + int getGainIndex(std::vector steps, double gain); void on_cboDevices_currentIndexChanged(int index); void on_txtDeviceArgs_textChanged(const QString &arg1); diff --git a/plugins/samplesource/gnuradio/gnuradiogui.ui b/plugins/samplesource/gnuradio/gnuradiogui.ui index 9053e7847..6eb00c2fc 100644 --- a/plugins/samplesource/gnuradio/gnuradiogui.ui +++ b/plugins/samplesource/gnuradio/gnuradiogui.ui @@ -6,8 +6,8 @@ 0 0 - 186 - 261 + 201 + 276 @@ -156,10 +156,6 @@ - - - - diff --git a/plugins/samplesource/gnuradio/gnuradioinput.cpp b/plugins/samplesource/gnuradio/gnuradioinput.cpp index 87ec35029..996abf7cd 100644 --- a/plugins/samplesource/gnuradio/gnuradioinput.cpp +++ b/plugins/samplesource/gnuradio/gnuradioinput.cpp @@ -31,8 +31,8 @@ GNURadioInput::Settings::Settings() : m_freqCorr(0), m_sampRate(0), m_antenna(""), - m_dcoff(""), - m_iqbal(""), + m_dcoff("Keep"), + m_iqbal("Keep"), m_bandwidth(0) { } @@ -43,20 +43,27 @@ void GNURadioInput::Settings::resetToDefaults() m_sampRate = 0; m_freqCorr = 0; m_antenna = ""; - m_dcoff = ""; - m_iqbal = ""; + m_dcoff = "Keep"; + m_iqbal = "Keep"; m_bandwidth = 0; } QByteArray GNURadioInput::Settings::serialize() const { SimpleSerializer s(1); -// s.writeString(1, m_args); -// s.writeDouble(2, m_freqCorr); -// s.writeDouble(3, m_sampRate); -// s.writeString(4, m_antenna); -// s.writeString(5, m_dcoff); -// s.writeString(5, m_iqbal); + s.writeString(1, m_args); + s.writeDouble(2, m_freqCorr); + s.writeDouble(3, m_sampRate); + s.writeString(4, m_antenna); + s.writeString(5, m_dcoff); + s.writeString(6, m_iqbal); + s.writeDouble(7, m_bandwidth); + + for (int i=0; i < m_namedGains.size(); i++) + { + s.writeDouble(100+i, m_namedGains[i].second); + } + return s.final(); } @@ -70,12 +77,21 @@ bool GNURadioInput::Settings::deserialize(const QByteArray& data) } if(d.getVersion() == 1) { -// d.readString(1, &m_args, ""); -// d.readDouble(2, &m_freqCorr, 0); -// d.readDouble(3, &m_sampRate, 0); -// d.readString(4, &m_antenna, ""); -// d.readString(5, &m_dcoff, ""); -// d.readString(5, &m_iqbal, ""); + d.readString(1, &m_args, ""); + d.readDouble(2, &m_freqCorr, 0); + d.readDouble(3, &m_sampRate, 0); + d.readString(4, &m_antenna, ""); + d.readString(5, &m_dcoff, "Keep"); + d.readString(6, &m_iqbal, "Keep"); + d.readDouble(7, &m_bandwidth, 0); + + for (int i = 0; i < m_namedGains.size(); i++) + { + double value; + d.readDouble(100+i, &value, 0); + m_namedGains[i].second = value; + } + return true; } else { resetToDefaults(); @@ -125,7 +141,7 @@ bool GNURadioInput::startInput(int device) m_GnuradioThread->startWork(); mutexLocker.unlock(); - applySettings(m_generalSettings, m_settings, true); + //applySettings(m_generalSettings, m_settings, true); if(m_GnuradioThread != NULL) { osmosdr::source::sptr radio = m_GnuradioThread->radio(); @@ -289,6 +305,8 @@ bool GNURadioInput::applySettings(const GeneralSettings& generalSettings, radio->set_antenna( m_settings.m_antenna.toStdString() ); } + /* Removed as it is incapable of handling it correctly (initialize at "Keep"). + * For BladeRF it must be done via bladerRF-cli */ if((m_settings.m_dcoff != settings.m_dcoff) || force) { m_settings.m_dcoff = settings.m_dcoff; @@ -297,7 +315,7 @@ bool GNURadioInput::applySettings(const GeneralSettings& generalSettings, if ( m_dcoffs[i] != m_settings.m_dcoff ) continue; - radio->set_dc_offset_mode( i ); + //radio->set_dc_offset_mode( i ); break; } } @@ -310,7 +328,7 @@ bool GNURadioInput::applySettings(const GeneralSettings& generalSettings, if ( m_iqbals[i] != m_settings.m_iqbal ) continue; - radio->set_iq_balance_mode( i ); + //radio->set_iq_balance_mode( i ); break; } } diff --git a/plugins/samplesource/gnuradio/gnuradioplugin.cpp b/plugins/samplesource/gnuradio/gnuradioplugin.cpp index 8ad218087..045b65cf7 100644 --- a/plugins/samplesource/gnuradio/gnuradioplugin.cpp +++ b/plugins/samplesource/gnuradio/gnuradioplugin.cpp @@ -8,10 +8,10 @@ const PluginDescriptor GNURadioPlugin::m_pluginDescriptor = { QString("GR-OsmoSDR Input"), QString("1.0"), - QString("(c) Dimitri Stolnikov "), - QString("http://sdr.osmocom.org/trac/wiki/GrOsmoSDR"), + QString("(c) Edouard Griffiths, F4EXB"), + QString("https://github.com/f4exb/rtl-sdrangelove/tree/f4exb"), true, - QString("http://cgit.osmocom.org/cgit/gr-osmosdr") + QString("https://github.com/f4exb/rtl-sdrangelove/tree/f4exb") }; GNURadioPlugin::GNURadioPlugin(QObject* parent) : diff --git a/plugins/samplesource/gnuradio/gnuradiothread.cpp b/plugins/samplesource/gnuradio/gnuradiothread.cpp index 995b82ab7..9e70d3ebb 100644 --- a/plugins/samplesource/gnuradio/gnuradiothread.cpp +++ b/plugins/samplesource/gnuradio/gnuradiothread.cpp @@ -24,8 +24,6 @@ #include #include -#include - //////////////////////////////////////////////////////////////////////////////// class gr_adaptor; @@ -130,7 +128,6 @@ void GnuradioThread::stopWork() void GnuradioThread::run() { m_top = gr::make_top_block( "flowgraph" ); - std::cerr << "GnuradioThread::run: " << m_args.toStdString() << std::endl; m_src = osmosdr::source::make( m_args.toStdString() ); /* now since we've constructed our shared objects, we allow the calling diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index 6ec9966ca..06def4656 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -442,6 +442,12 @@ void MainWindow::on_presetUpdate_clicked() } } +void MainWindow::on_presetLastLoad_clicked() +{ + m_settings.load(); + applySettings(); +} + void MainWindow::on_presetLoad_clicked() { QTreeWidgetItem* item = ui->presetTree->currentItem(); diff --git a/sdrbase/mainwindow.ui b/sdrbase/mainwindow.ui index e6ab61270..19e31e7bf 100644 --- a/sdrbase/mainwindow.ui +++ b/sdrbase/mainwindow.ui @@ -156,7 +156,7 @@ - + Load selected preset @@ -176,7 +176,7 @@ - + Qt::Horizontal @@ -209,7 +209,7 @@ - + true @@ -246,6 +246,26 @@ + + + + Load settings saved at last exit + + + ... + + + + :/preset-last.png:/preset-last.png + + + + 16 + 16 + + + + diff --git a/sdrbase/resources/preset-last.png b/sdrbase/resources/preset-last.png new file mode 100644 index 000000000..0fb90931b Binary files /dev/null and b/sdrbase/resources/preset-last.png differ diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc index a4976fbe2..5fc9df129 100644 --- a/sdrbase/resources/res.qrc +++ b/sdrbase/resources/res.qrc @@ -13,5 +13,6 @@ maxhold.png grid.png invertspectrum.png + preset-last.png