mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-23 00:18:37 -05:00
BladeRF Tx support: rename Rx files and classes
This commit is contained in:
parent
607e89cea6
commit
b677fe4d32
@ -1,23 +1,23 @@
|
||||
project(bladerf)
|
||||
|
||||
set(bladerf_SOURCES
|
||||
bladerfgui.cpp
|
||||
bladerfinputgui.cpp
|
||||
bladerfinput.cpp
|
||||
bladerfplugin.cpp
|
||||
bladerfsettings.cpp
|
||||
bladerfthread.cpp
|
||||
bladerfinputplugin.cpp
|
||||
bladerfinputsettings.cpp
|
||||
bladerfinputthread.cpp
|
||||
)
|
||||
|
||||
set(bladerf_HEADERS
|
||||
bladerfgui.h
|
||||
bladerfinputgui.h
|
||||
bladerfinput.h
|
||||
bladerfplugin.h
|
||||
bladerfsettings.h
|
||||
bladerfthread.h
|
||||
bladerfinputplugin.h
|
||||
bladerfinputsettings.h
|
||||
bladerfinputthread.h
|
||||
)
|
||||
|
||||
set(bladerf_FORMS
|
||||
bladerfgui.ui
|
||||
bladerfinputgui.ui
|
||||
)
|
||||
|
||||
if (BUILD_DEBIAN)
|
||||
|
@ -25,19 +25,19 @@ INCLUDEPATH += $$LIBBLADERFSRC
|
||||
CONFIG(Release):build_subdir = release
|
||||
CONFIG(Debug):build_subdir = debug
|
||||
|
||||
SOURCES += bladerfgui.cpp\
|
||||
SOURCES += bladerfinputgui.cpp\
|
||||
bladerfinput.cpp\
|
||||
bladerfplugin.cpp\
|
||||
bladerfsettings.cpp\
|
||||
bladerfthread.cpp
|
||||
bladerfinputplugin.cpp\
|
||||
bladerfinputsettings.cpp\
|
||||
bladerfinputthread.cpp
|
||||
|
||||
HEADERS += bladerfgui.h\
|
||||
HEADERS += bladerfinputgui.h\
|
||||
bladerfinput.h\
|
||||
bladerfplugin.h\
|
||||
bladerfsettings.h\
|
||||
bladerfthread.h
|
||||
bladerfinputplugin.h\
|
||||
bladerfinputsettings.h\
|
||||
bladerfinputthread.h
|
||||
|
||||
FORMS += bladerfgui.ui
|
||||
FORMS += bladerfinputgui.ui
|
||||
|
||||
LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase
|
||||
LIBS += -L../../../libbladerf/$${build_subdir} -llibbladerf
|
||||
|
@ -21,12 +21,12 @@
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "bladerfgui.h"
|
||||
#include "bladerfinput.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
|
||||
#include "bladerfthread.h"
|
||||
#include "bladerfinputgui.h"
|
||||
#include "bladerfinputthread.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(BladerfInput::MsgConfigureBladerf, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladerfInput::MsgReportBladerf, Message)
|
||||
@ -101,7 +101,7 @@ bool BladerfInput::start(int device)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if((m_bladerfThread = new BladerfThread(m_dev, &m_sampleFifo)) == NULL) {
|
||||
if((m_bladerfThread = new BladerfInputThread(m_dev, &m_sampleFifo)) == NULL) {
|
||||
qFatal("out of memory");
|
||||
goto failed;
|
||||
}
|
||||
@ -174,7 +174,7 @@ bool BladerfInput::handleMessage(const Message& message)
|
||||
}
|
||||
}
|
||||
|
||||
bool BladerfInput::applySettings(const BladeRFSettings& settings, bool force)
|
||||
bool BladerfInput::applySettings(const BladeRFInputSettings& settings, bool force)
|
||||
{
|
||||
bool forwardChange = false;
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
@ -382,7 +382,7 @@ bool BladerfInput::applySettings(const BladeRFSettings& settings, bool force)
|
||||
qint64 f_img = deviceCenterFrequency;
|
||||
qint64 f_cut = deviceCenterFrequency + m_settings.m_bandwidth/2;
|
||||
|
||||
if ((m_settings.m_log2Decim == 0) || (m_settings.m_fcPos == BladeRFSettings::FC_POS_CENTER))
|
||||
if ((m_settings.m_log2Decim == 0) || (m_settings.m_fcPos == BladeRFInputSettings::FC_POS_CENTER))
|
||||
{
|
||||
deviceCenterFrequency = m_settings.m_centerFrequency;
|
||||
f_img = deviceCenterFrequency;
|
||||
@ -390,13 +390,13 @@ bool BladerfInput::applySettings(const BladeRFSettings& settings, bool force)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_settings.m_fcPos == BladeRFSettings::FC_POS_INFRA)
|
||||
if (m_settings.m_fcPos == BladeRFInputSettings::FC_POS_INFRA)
|
||||
{
|
||||
deviceCenterFrequency = m_settings.m_centerFrequency + (m_settings.m_devSampleRate / 4);
|
||||
f_img = deviceCenterFrequency + m_settings.m_devSampleRate/2;
|
||||
f_cut = deviceCenterFrequency + m_settings.m_bandwidth/2;
|
||||
}
|
||||
else if (m_settings.m_fcPos == BladeRFSettings::FC_POS_SUPRA)
|
||||
else if (m_settings.m_fcPos == BladeRFInputSettings::FC_POS_SUPRA)
|
||||
{
|
||||
deviceCenterFrequency = m_settings.m_centerFrequency - (m_settings.m_devSampleRate / 4);
|
||||
f_img = deviceCenterFrequency - m_settings.m_devSampleRate/2;
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
#include <dsp/devicesamplesource.h>
|
||||
|
||||
#include "bladerfsettings.h"
|
||||
#include <libbladeRF.h>
|
||||
#include <QString>
|
||||
#include "bladerfinputsettings.h"
|
||||
|
||||
class DeviceSourceAPI;
|
||||
class BladerfThread;
|
||||
class BladerfInputThread;
|
||||
|
||||
class BladerfInput : public DeviceSampleSource {
|
||||
public:
|
||||
@ -32,17 +32,17 @@ public:
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const BladeRFSettings& getSettings() const { return m_settings; }
|
||||
const BladeRFInputSettings& getSettings() const { return m_settings; }
|
||||
|
||||
static MsgConfigureBladerf* create(const BladeRFSettings& settings)
|
||||
static MsgConfigureBladerf* create(const BladeRFInputSettings& settings)
|
||||
{
|
||||
return new MsgConfigureBladerf(settings);
|
||||
}
|
||||
|
||||
private:
|
||||
BladeRFSettings m_settings;
|
||||
BladeRFInputSettings m_settings;
|
||||
|
||||
MsgConfigureBladerf(const BladeRFSettings& settings) :
|
||||
MsgConfigureBladerf(const BladeRFInputSettings& settings) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
{ }
|
||||
@ -79,15 +79,15 @@ public:
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
private:
|
||||
bool applySettings(const BladeRFSettings& settings, bool force);
|
||||
bool applySettings(const BladeRFInputSettings& settings, bool force);
|
||||
bladerf_lna_gain getLnaGain(int lnaGain);
|
||||
struct bladerf *open_bladerf_from_serial(const char *serial);
|
||||
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
BladeRFSettings m_settings;
|
||||
BladeRFInputSettings m_settings;
|
||||
struct bladerf* m_dev;
|
||||
BladerfThread* m_bladerfThread;
|
||||
BladerfInputThread* m_bladerfThread;
|
||||
QString m_deviceDescription;
|
||||
};
|
||||
|
||||
|
@ -19,19 +19,18 @@
|
||||
|
||||
#include <libbladeRF.h>
|
||||
|
||||
#include "ui_bladerfgui.h"
|
||||
#include "ui_bladerfinputgui.h"
|
||||
#include "gui/colormapper.h"
|
||||
#include "gui/glspectrum.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "bladerfgui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include <dsp/filerecord.h>
|
||||
#include "bladerfinputgui.h"
|
||||
|
||||
BladerfGui::BladerfGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
BladerfInputGui::BladerfInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::BladerfGui),
|
||||
ui(new Ui::BladerfInputGui),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_sampleSource(NULL),
|
||||
@ -71,7 +70,7 @@ BladerfGui::BladerfGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
BladerfGui::~BladerfGui()
|
||||
BladerfInputGui::~BladerfInputGui()
|
||||
{
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
@ -79,46 +78,46 @@ BladerfGui::~BladerfGui()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void BladerfGui::destroy()
|
||||
void BladerfInputGui::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void BladerfGui::setName(const QString& name)
|
||||
void BladerfInputGui::setName(const QString& name)
|
||||
{
|
||||
setObjectName(name);
|
||||
}
|
||||
|
||||
QString BladerfGui::getName() const
|
||||
QString BladerfInputGui::getName() const
|
||||
{
|
||||
return objectName();
|
||||
}
|
||||
|
||||
void BladerfGui::resetToDefaults()
|
||||
void BladerfInputGui::resetToDefaults()
|
||||
{
|
||||
m_settings.resetToDefaults();
|
||||
displaySettings();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
qint64 BladerfGui::getCenterFrequency() const
|
||||
qint64 BladerfInputGui::getCenterFrequency() const
|
||||
{
|
||||
return m_settings.m_centerFrequency;
|
||||
}
|
||||
|
||||
void BladerfGui::setCenterFrequency(qint64 centerFrequency)
|
||||
void BladerfInputGui::setCenterFrequency(qint64 centerFrequency)
|
||||
{
|
||||
m_settings.m_centerFrequency = centerFrequency;
|
||||
displaySettings();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
QByteArray BladerfGui::serialize() const
|
||||
QByteArray BladerfInputGui::serialize() const
|
||||
{
|
||||
return m_settings.serialize();
|
||||
}
|
||||
|
||||
bool BladerfGui::deserialize(const QByteArray& data)
|
||||
bool BladerfInputGui::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data)) {
|
||||
displaySettings();
|
||||
@ -130,7 +129,7 @@ bool BladerfGui::deserialize(const QByteArray& data)
|
||||
}
|
||||
}
|
||||
|
||||
bool BladerfGui::handleMessage(const Message& message)
|
||||
bool BladerfInputGui::handleMessage(const Message& message)
|
||||
{
|
||||
if (BladerfInput::MsgReportBladerf::match(message))
|
||||
{
|
||||
@ -143,7 +142,7 @@ bool BladerfGui::handleMessage(const Message& message)
|
||||
}
|
||||
}
|
||||
|
||||
void BladerfGui::handleDSPMessages()
|
||||
void BladerfInputGui::handleDSPMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
@ -165,14 +164,14 @@ void BladerfGui::handleDSPMessages()
|
||||
}
|
||||
}
|
||||
|
||||
void BladerfGui::updateSampleRateAndFrequency()
|
||||
void BladerfInputGui::updateSampleRateAndFrequency()
|
||||
{
|
||||
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
||||
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||
ui->deviceRateLabel->setText(tr("%1k").arg((float)m_sampleRate / 1000));
|
||||
}
|
||||
|
||||
void BladerfGui::displaySettings()
|
||||
void BladerfInputGui::displaySettings()
|
||||
{
|
||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||
|
||||
@ -200,45 +199,45 @@ void BladerfGui::displaySettings()
|
||||
ui->xb200->setCurrentIndex(getXb200Index(m_settings.m_xb200, m_settings.m_xb200Path, m_settings.m_xb200Filter));
|
||||
}
|
||||
|
||||
void BladerfGui::sendSettings()
|
||||
void BladerfInputGui::sendSettings()
|
||||
{
|
||||
if(!m_updateTimer.isActive())
|
||||
m_updateTimer.start(100);
|
||||
}
|
||||
|
||||
void BladerfGui::on_centerFrequency_changed(quint64 value)
|
||||
void BladerfInputGui::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_centerFrequency = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_dcOffset_toggled(bool checked)
|
||||
void BladerfInputGui::on_dcOffset_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_dcBlock = checked;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_iqImbalance_toggled(bool checked)
|
||||
void BladerfInputGui::on_iqImbalance_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_iqCorrection = checked;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_samplerate_currentIndexChanged(int index)
|
||||
void BladerfInputGui::on_samplerate_currentIndexChanged(int index)
|
||||
{
|
||||
int newrate = BladerfSampleRates::getRate(index);
|
||||
m_settings.m_devSampleRate = newrate * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_bandwidth_currentIndexChanged(int index)
|
||||
void BladerfInputGui::on_bandwidth_currentIndexChanged(int index)
|
||||
{
|
||||
int newbw = BladerfBandwidths::getBandwidth(index);
|
||||
m_settings.m_bandwidth = newbw * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_decim_currentIndexChanged(int index)
|
||||
void BladerfInputGui::on_decim_currentIndexChanged(int index)
|
||||
{
|
||||
if ((index <0) || (index > 5))
|
||||
return;
|
||||
@ -246,21 +245,21 @@ void BladerfGui::on_decim_currentIndexChanged(int index)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_fcPos_currentIndexChanged(int index)
|
||||
void BladerfInputGui::on_fcPos_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 0) {
|
||||
m_settings.m_fcPos = BladeRFSettings::FC_POS_INFRA;
|
||||
m_settings.m_fcPos = BladeRFInputSettings::FC_POS_INFRA;
|
||||
sendSettings();
|
||||
} else if (index == 1) {
|
||||
m_settings.m_fcPos = BladeRFSettings::FC_POS_SUPRA;
|
||||
m_settings.m_fcPos = BladeRFInputSettings::FC_POS_SUPRA;
|
||||
sendSettings();
|
||||
} else if (index == 2) {
|
||||
m_settings.m_fcPos = BladeRFSettings::FC_POS_CENTER;
|
||||
m_settings.m_fcPos = BladeRFInputSettings::FC_POS_CENTER;
|
||||
sendSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void BladerfGui::on_lna_currentIndexChanged(int index)
|
||||
void BladerfInputGui::on_lna_currentIndexChanged(int index)
|
||||
{
|
||||
qDebug() << "BladerfGui: LNA gain = " << index * 3 << " dB";
|
||||
|
||||
@ -271,7 +270,7 @@ void BladerfGui::on_lna_currentIndexChanged(int index)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_vga1_valueChanged(int value)
|
||||
void BladerfInputGui::on_vga1_valueChanged(int value)
|
||||
{
|
||||
if ((value < BLADERF_RXVGA1_GAIN_MIN) || (value > BLADERF_RXVGA1_GAIN_MAX))
|
||||
return;
|
||||
@ -281,7 +280,7 @@ void BladerfGui::on_vga1_valueChanged(int value)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_vga2_valueChanged(int value)
|
||||
void BladerfInputGui::on_vga2_valueChanged(int value)
|
||||
{
|
||||
if ((value < BLADERF_RXVGA2_GAIN_MIN) || (value > BLADERF_RXVGA2_GAIN_MAX))
|
||||
return;
|
||||
@ -291,7 +290,7 @@ void BladerfGui::on_vga2_valueChanged(int value)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_xb200_currentIndexChanged(int index)
|
||||
void BladerfInputGui::on_xb200_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 1) // bypass
|
||||
{
|
||||
@ -351,7 +350,7 @@ void BladerfGui::on_xb200_currentIndexChanged(int index)
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladerfGui::on_startStop_toggled(bool checked)
|
||||
void BladerfInputGui::on_startStop_toggled(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
{
|
||||
@ -368,7 +367,7 @@ void BladerfGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void BladerfGui::on_record_toggled(bool checked)
|
||||
void BladerfInputGui::on_record_toggled(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
{
|
||||
@ -382,7 +381,7 @@ void BladerfGui::on_record_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void BladerfGui::updateHardware()
|
||||
void BladerfInputGui::updateHardware()
|
||||
{
|
||||
qDebug() << "BladerfGui::updateHardware";
|
||||
BladerfInput::MsgConfigureBladerf* message = BladerfInput::MsgConfigureBladerf::create( m_settings);
|
||||
@ -390,7 +389,7 @@ void BladerfGui::updateHardware()
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
|
||||
void BladerfGui::updateStatus()
|
||||
void BladerfInputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceAPI->state();
|
||||
|
||||
@ -419,7 +418,7 @@ void BladerfGui::updateStatus()
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int BladerfGui::getXb200Index(bool xb_200, bladerf_xb200_path xb200Path, bladerf_xb200_filter xb200Filter)
|
||||
unsigned int BladerfInputGui::getXb200Index(bool xb_200, bladerf_xb200_path xb200Path, bladerf_xb200_filter xb200Filter)
|
||||
{
|
||||
if (xb_200)
|
||||
{
|
@ -14,8 +14,8 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_BLADERFGUI_H
|
||||
#define INCLUDE_BLADERFGUI_H
|
||||
#ifndef INCLUDE_BLADERFINPUTGUI_H
|
||||
#define INCLUDE_BLADERFINPUTGUI_H
|
||||
|
||||
#include <QTimer>
|
||||
#include "plugin/plugingui.h"
|
||||
@ -26,16 +26,16 @@ class DeviceSourceAPI;
|
||||
class FileRecord;
|
||||
|
||||
namespace Ui {
|
||||
class BladerfGui;
|
||||
class BladerfInputGui;
|
||||
class BladerfSampleRates;
|
||||
}
|
||||
|
||||
class BladerfGui : public QWidget, public PluginGUI {
|
||||
class BladerfInputGui : public QWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BladerfGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~BladerfGui();
|
||||
explicit BladerfInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~BladerfInputGui();
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -49,10 +49,10 @@ public:
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
private:
|
||||
Ui::BladerfGui* ui;
|
||||
Ui::BladerfInputGui* ui;
|
||||
|
||||
DeviceSourceAPI* m_deviceAPI;
|
||||
BladeRFSettings m_settings;
|
||||
BladeRFInputSettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
||||
std::vector<int> m_gains;
|
||||
@ -106,4 +106,4 @@ private:
|
||||
static unsigned int m_nb_halfbw;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_BLADERFGUI_H
|
||||
#endif // INCLUDE_BLADERFINPUTGUI_H
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BladerfGui</class>
|
||||
<widget class="QWidget" name="BladerfGui">
|
||||
<class>BladerfInputGui</class>
|
||||
<widget class="QWidget" name="BladerfInputGui">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
@ -19,11 +19,11 @@
|
||||
#include <libbladeRF.h>
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "bladerfgui.h"
|
||||
#include "bladerfplugin.h"
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "bladerfinputplugin.h"
|
||||
#include "bladerfinputgui.h"
|
||||
|
||||
const PluginDescriptor BlderfPlugin::m_pluginDescriptor = {
|
||||
const PluginDescriptor BlderfInputPlugin::m_pluginDescriptor = {
|
||||
QString("BladerRF Input"),
|
||||
QString("2.0.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
@ -32,24 +32,24 @@ const PluginDescriptor BlderfPlugin::m_pluginDescriptor = {
|
||||
QString("https://github.com/f4exb/sdrangel")
|
||||
};
|
||||
|
||||
const QString BlderfPlugin::m_deviceTypeID = BLADERF_DEVICE_TYPE_ID;
|
||||
const QString BlderfInputPlugin::m_deviceTypeID = BLADERF_DEVICE_TYPE_ID;
|
||||
|
||||
BlderfPlugin::BlderfPlugin(QObject* parent) :
|
||||
BlderfInputPlugin::BlderfInputPlugin(QObject* parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
const PluginDescriptor& BlderfPlugin::getPluginDescriptor() const
|
||||
const PluginDescriptor& BlderfInputPlugin::getPluginDescriptor() const
|
||||
{
|
||||
return m_pluginDescriptor;
|
||||
}
|
||||
|
||||
void BlderfPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
void BlderfInputPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
{
|
||||
pluginAPI->registerSampleSource(m_deviceTypeID, this);
|
||||
}
|
||||
|
||||
PluginInterface::SamplingDevices BlderfPlugin::enumSampleSources()
|
||||
PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
|
||||
{
|
||||
SamplingDevices result;
|
||||
struct bladerf_devinfo *devinfo = 0;
|
||||
@ -74,11 +74,11 @@ PluginInterface::SamplingDevices BlderfPlugin::enumSampleSources()
|
||||
return result;
|
||||
}
|
||||
|
||||
PluginGUI* BlderfPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
|
||||
PluginGUI* BlderfInputPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI)
|
||||
{
|
||||
if(sourceId == m_deviceTypeID)
|
||||
{
|
||||
BladerfGui* gui = new BladerfGui(deviceAPI);
|
||||
BladerfInputGui* gui = new BladerfInputGui(deviceAPI);
|
||||
*widget = gui;
|
||||
return gui;
|
||||
}
|
@ -14,8 +14,8 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_BLADERFPLUGIN_H
|
||||
#define INCLUDE_BLADERFPLUGIN_H
|
||||
#ifndef INCLUDE_BLADERFINPUTPLUGIN_H
|
||||
#define INCLUDE_BLADERFINPUTPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
@ -24,13 +24,13 @@ class PluginAPI;
|
||||
|
||||
#define BLADERF_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf"
|
||||
|
||||
class BlderfPlugin : public QObject, public PluginInterface {
|
||||
class BlderfInputPlugin : public QObject, public PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
Q_PLUGIN_METADATA(IID BLADERF_DEVICE_TYPE_ID)
|
||||
|
||||
public:
|
||||
explicit BlderfPlugin(QObject* parent = NULL);
|
||||
explicit BlderfInputPlugin(QObject* parent = NULL);
|
||||
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
@ -44,4 +44,4 @@ private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_BLADERFPLUGIN_H
|
||||
#endif // INCLUDE_BLADERFINPUTPLUGIN_H
|
@ -16,14 +16,15 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
#include "util/simpleserializer.h"
|
||||
#include "bladerfsettings.h"
|
||||
|
||||
BladeRFSettings::BladeRFSettings()
|
||||
#include "bladerfinputsettings.h"
|
||||
|
||||
BladeRFInputSettings::BladeRFInputSettings()
|
||||
{
|
||||
resetToDefaults();
|
||||
}
|
||||
|
||||
void BladeRFSettings::resetToDefaults()
|
||||
void BladeRFInputSettings::resetToDefaults()
|
||||
{
|
||||
m_centerFrequency = 435000*1000;
|
||||
m_devSampleRate = 3072000;
|
||||
@ -40,7 +41,7 @@ void BladeRFSettings::resetToDefaults()
|
||||
m_iqCorrection = false;
|
||||
}
|
||||
|
||||
QByteArray BladeRFSettings::serialize() const
|
||||
QByteArray BladeRFInputSettings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
|
||||
@ -60,7 +61,7 @@ QByteArray BladeRFSettings::serialize() const
|
||||
return s.final();
|
||||
}
|
||||
|
||||
bool BladeRFSettings::deserialize(const QByteArray& data)
|
||||
bool BladeRFInputSettings::deserialize(const QByteArray& data)
|
||||
{
|
||||
SimpleDeserializer d(data);
|
||||
|
@ -14,12 +14,12 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _BLADERF_BLADERFSETTINGS_H_
|
||||
#define _BLADERF_BLADERFSETTINGS_H_
|
||||
#ifndef _BLADERF_BLADERFINPUTSETTINGS_H_
|
||||
#define _BLADERF_BLADERFINPUTSETTINGS_H_
|
||||
|
||||
#include <libbladeRF.h>
|
||||
|
||||
struct BladeRFSettings {
|
||||
struct BladeRFInputSettings {
|
||||
typedef enum {
|
||||
FC_POS_INFRA = 0,
|
||||
FC_POS_SUPRA,
|
||||
@ -40,10 +40,10 @@ struct BladeRFSettings {
|
||||
bool m_dcBlock;
|
||||
bool m_iqCorrection;
|
||||
|
||||
BladeRFSettings();
|
||||
BladeRFInputSettings();
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
};
|
||||
|
||||
#endif /* _BLADERF_BLADERFSETTINGS_H_ */
|
||||
#endif /* _BLADERF_BLADERFINPUTSETTINGS_H_ */
|
@ -16,12 +16,12 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "bladerfthread.h"
|
||||
#include "dsp/samplesinkfifo.h"
|
||||
#include "bladerfinputthread.h"
|
||||
|
||||
|
||||
|
||||
BladerfThread::BladerfThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QObject* parent) :
|
||||
BladerfInputThread::BladerfInputThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QObject* parent) :
|
||||
QThread(parent),
|
||||
m_running(false),
|
||||
m_dev(dev),
|
||||
@ -32,12 +32,12 @@ BladerfThread::BladerfThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QO
|
||||
{
|
||||
}
|
||||
|
||||
BladerfThread::~BladerfThread()
|
||||
BladerfInputThread::~BladerfInputThread()
|
||||
{
|
||||
stopWork();
|
||||
}
|
||||
|
||||
void BladerfThread::startWork()
|
||||
void BladerfInputThread::startWork()
|
||||
{
|
||||
m_startWaitMutex.lock();
|
||||
start();
|
||||
@ -46,23 +46,23 @@ void BladerfThread::startWork()
|
||||
m_startWaitMutex.unlock();
|
||||
}
|
||||
|
||||
void BladerfThread::stopWork()
|
||||
void BladerfInputThread::stopWork()
|
||||
{
|
||||
m_running = false;
|
||||
wait();
|
||||
}
|
||||
|
||||
void BladerfThread::setLog2Decimation(unsigned int log2_decim)
|
||||
void BladerfInputThread::setLog2Decimation(unsigned int log2_decim)
|
||||
{
|
||||
m_log2Decim = log2_decim;
|
||||
}
|
||||
|
||||
void BladerfThread::setFcPos(int fcPos)
|
||||
void BladerfInputThread::setFcPos(int fcPos)
|
||||
{
|
||||
m_fcPos = fcPos;
|
||||
}
|
||||
|
||||
void BladerfThread::run()
|
||||
void BladerfInputThread::run()
|
||||
{
|
||||
int res;
|
||||
|
||||
@ -82,7 +82,7 @@ void BladerfThread::run()
|
||||
}
|
||||
|
||||
// Decimate according to specified log2 (ex: log2=4 => decim=16)
|
||||
void BladerfThread::callback(const qint16* buf, qint32 len)
|
||||
void BladerfInputThread::callback(const qint16* buf, qint32 len)
|
||||
{
|
||||
SampleVector::iterator it = m_convertBuffer.begin();
|
||||
|
@ -14,8 +14,8 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_BLADERFTHREAD_H
|
||||
#define INCLUDE_BLADERFTHREAD_H
|
||||
#ifndef INCLUDE_BLADERFINPUTTHREAD_H
|
||||
#define INCLUDE_BLADERFINPUTTHREAD_H
|
||||
|
||||
#include <QThread>
|
||||
#include <QMutex>
|
||||
@ -26,12 +26,12 @@
|
||||
|
||||
#define BLADERF_BLOCKSIZE (1<<14)
|
||||
|
||||
class BladerfThread : public QThread {
|
||||
class BladerfInputThread : public QThread {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BladerfThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
|
||||
~BladerfThread();
|
||||
BladerfInputThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
|
||||
~BladerfInputThread();
|
||||
|
||||
void startWork();
|
||||
void stopWork();
|
||||
@ -57,4 +57,4 @@ private:
|
||||
void callback(const qint16* buf, qint32 len);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_BLADERFTHREAD_H
|
||||
#endif // INCLUDE_BLADERFINPUTTHREAD_H
|
Loading…
Reference in New Issue
Block a user