mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-29 05:22:25 -04:00
Improved GNU Radio plugin usability. Removed osmosdr completely from the build as it is superceded by GNU Radio
This commit is contained in:
parent
695a1ca526
commit
26b9c324e7
@ -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
|
||||
|
@ -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);
|
||||
|
93
include/util/stacktrace.h
Normal file
93
include/util/stacktrace.h
Normal file
@ -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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <execinfo.h>
|
||||
#include <cxxabi.h>
|
||||
|
||||
/** 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, " <empty, possibly corrupt>\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_
|
@ -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)
|
||||
|
@ -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<double> 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<double> steps, double gain)
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
for (std::vector<double>::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())
|
||||
|
@ -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<double> steps, double gain);
|
||||
|
||||
void on_cboDevices_currentIndexChanged(int index);
|
||||
void on_txtDeviceArgs_textChanged(const QString &arg1);
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>186</width>
|
||||
<height>261</height>
|
||||
<width>201</width>
|
||||
<height>276</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -156,10 +156,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="sldGain">
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="sldFreqCorr">
|
||||
<property name="minimum">
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,10 @@
|
||||
const PluginDescriptor GNURadioPlugin::m_pluginDescriptor = {
|
||||
QString("GR-OsmoSDR Input"),
|
||||
QString("1.0"),
|
||||
QString("(c) Dimitri Stolnikov <horiz0n@gmx.net>"),
|
||||
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) :
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include <gnuradio/sync_block.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
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
|
||||
|
@ -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();
|
||||
|
@ -156,7 +156,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="6">
|
||||
<item row="5" column="8">
|
||||
<widget class="QToolButton" name="presetLoad">
|
||||
<property name="toolTip">
|
||||
<string>Load selected preset</string>
|
||||
@ -176,7 +176,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4" colspan="2">
|
||||
<item row="5" column="5" colspan="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -209,7 +209,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" rowspan="4" colspan="6">
|
||||
<item row="1" column="1" rowspan="4" colspan="8">
|
||||
<widget class="QTreeWidget" name="presetTree">
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
@ -246,6 +246,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="7">
|
||||
<widget class="QToolButton" name="presetLoadLast">
|
||||
<property name="toolTip">
|
||||
<string>Load settings saved at last exit</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/res.qrc">
|
||||
<normaloff>:/preset-last.png</normaloff>:/preset-last.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
BIN
sdrbase/resources/preset-last.png
Normal file
BIN
sdrbase/resources/preset-last.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -13,5 +13,6 @@
|
||||
<file>maxhold.png</file>
|
||||
<file>grid.png</file>
|
||||
<file>invertspectrum.png</file>
|
||||
<file>preset-last.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Loading…
x
Reference in New Issue
Block a user