mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
BladeRF output (2)
This commit is contained in:
parent
c27acf086e
commit
d75a576f69
@ -61,9 +61,6 @@ Bladerf1OutputGui::Bladerf1OutputGui(DeviceUISet *deviceUISet, QWidget* parent)
|
||||
|
||||
displaySettings();
|
||||
|
||||
char recFileNameCStr[30];
|
||||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceUISet->m_deviceSinkAPI->getDeviceUID());
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
|
@ -3,17 +3,17 @@ project(bladerf2output)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
set(bladerf2output_SOURCES
|
||||
# bladerf2outputgui.cpp
|
||||
bladerf2outputgui.cpp
|
||||
bladerf2output.cpp
|
||||
# bladerf2outputplugin.cpp
|
||||
bladerf2outputplugin.cpp
|
||||
bladerf2outputsettings.cpp
|
||||
bladerf2outputthread.cpp
|
||||
)
|
||||
|
||||
set(bladerf2output_HEADERS
|
||||
# bladerf2outputgui.h
|
||||
bladerf2outputgui.h
|
||||
bladerf2output.h
|
||||
# bladerf1soutputplugin.h
|
||||
bladerf1soutputplugin.h
|
||||
bladerf2outputsettings.h
|
||||
bladerf2outputthread.h
|
||||
)
|
||||
|
365
plugins/samplesink/bladerf2output/bladerf2outputgui.cpp
Normal file
365
plugins/samplesink/bladerf2output/bladerf2outputgui.cpp
Normal file
@ -0,0 +1,365 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2018 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// 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 as version 3 of the License, or //
|
||||
// //
|
||||
// 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. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <libbladeRF.h>
|
||||
|
||||
#include "ui_bladerf2outputgui.h"
|
||||
#include "gui/colormapper.h"
|
||||
#include "gui/glspectrum.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
|
||||
#include "bladerf2outputgui.h"
|
||||
|
||||
BladeRF2OutputGui::BladeRF2OutputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::BladeRF2OutputGui),
|
||||
m_deviceUISet(deviceUISet),
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleRate(0),
|
||||
m_lastEngineState(DSPDeviceSinkEngine::StNotStarted)
|
||||
{
|
||||
m_sampleSink = (BladeRF2Output*) m_deviceUISet->m_deviceSinkAPI->getSampleSink();
|
||||
int max, min, step;
|
||||
uint64_t f_min, f_max;
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
m_sampleSink->getFrequencyRange(f_min, f_max, step);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->centerFrequency->setValueRange(7, f_min/1000, f_max/1000);
|
||||
|
||||
m_sampleSink->getSampleRateRange(min, max, step);
|
||||
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
|
||||
ui->sampleRate->setValueRange(8, min, max);
|
||||
|
||||
m_sampleSink->getBandwidthRange(min, max, step);
|
||||
ui->bandwidth->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
|
||||
ui->bandwidth->setValueRange(5, min/1000, max/1000);
|
||||
|
||||
const std::vector<BladeRF2Output::GainMode>& modes = m_sampleSink->getGainModes();
|
||||
std::vector<BladeRF2Output::GainMode>::const_iterator it = modes.begin();
|
||||
|
||||
ui->gainMode->blockSignals(true);
|
||||
|
||||
for (; it != modes.end(); ++it) {
|
||||
ui->gainMode->addItem(it->m_name);
|
||||
}
|
||||
|
||||
ui->gainMode->blockSignals(false);
|
||||
|
||||
m_sampleSink->getGlobalGainRange(min, max, step);
|
||||
ui->gain->setMinimum(min);
|
||||
ui->gain->setMaximum(max);
|
||||
ui->gain->setPageStep(step);
|
||||
ui->gain->setSingleStep(step);
|
||||
|
||||
ui->label_decim->setText(QString::fromUtf8("I\u2191"));
|
||||
|
||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
m_statusTimer.start(500);
|
||||
|
||||
displaySettings();
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
m_sampleSink->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||
}
|
||||
|
||||
BladeRF2OutputGui::~BladeRF2OutputGui()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::setName(const QString& name)
|
||||
{
|
||||
setObjectName(name);
|
||||
}
|
||||
|
||||
QString BladeRF2OutputGui::getName() const
|
||||
{
|
||||
return objectName();
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::resetToDefaults()
|
||||
{
|
||||
m_settings.resetToDefaults();
|
||||
displaySettings();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
qint64 BladeRF2OutputGui::getCenterFrequency() const
|
||||
{
|
||||
return m_settings.m_centerFrequency;
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::setCenterFrequency(qint64 centerFrequency)
|
||||
{
|
||||
m_settings.m_centerFrequency = centerFrequency;
|
||||
displaySettings();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
QByteArray BladeRF2OutputGui::serialize() const
|
||||
{
|
||||
return m_settings.serialize();
|
||||
}
|
||||
|
||||
bool BladeRF2OutputGui::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data)) {
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
return true;
|
||||
} else {
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool BladeRF2OutputGui::handleMessage(const Message& message)
|
||||
{
|
||||
if (BladeRF2Output::MsgConfigureBladeRF2::match(message))
|
||||
{
|
||||
const BladeRF2Output::MsgConfigureBladeRF2& cfg = (BladeRF2Output::MsgConfigureBladeRF2&) message;
|
||||
m_settings = cfg.getSettings();
|
||||
blockApplySettings(true);
|
||||
int min, max, step;
|
||||
m_sampleSink->getGlobalGainRange(min, max, step);
|
||||
ui->gain->setMinimum(min);
|
||||
ui->gain->setMaximum(max);
|
||||
ui->gain->setPageStep(step);
|
||||
ui->gain->setSingleStep(step);
|
||||
displaySettings();
|
||||
blockApplySettings(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (BladeRF2Output::MsgReportGainRange::match(message))
|
||||
{
|
||||
const BladeRF2Output::MsgReportGainRange& cfg = (BladeRF2Output::MsgReportGainRange&) message;
|
||||
ui->gain->setMinimum(cfg.getMin());
|
||||
ui->gain->setMaximum(cfg.getMax());
|
||||
ui->gain->setSingleStep(cfg.getStep());
|
||||
ui->gain->setPageStep(cfg.getStep());
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (BladeRF2Output::MsgStartStop::match(message))
|
||||
{
|
||||
BladeRF2Output::MsgStartStop& notif = (BladeRF2Output::MsgStartStop&) message;
|
||||
blockApplySettings(true);
|
||||
ui->startStop->setChecked(notif.getStartStop());
|
||||
blockApplySettings(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::handleInputMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != 0)
|
||||
{
|
||||
qDebug("BladeRF2OutputGui::handleInputMessages: message: %s", message->getIdentifier());
|
||||
|
||||
if (DSPSignalNotification::match(*message))
|
||||
{
|
||||
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
||||
m_sampleRate = notif->getSampleRate();
|
||||
m_deviceCenterFrequency = notif->getCenterFrequency();
|
||||
qDebug("BladeRF2OutputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
|
||||
updateSampleRateAndFrequency();
|
||||
|
||||
delete message;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (handleMessage(*message))
|
||||
{
|
||||
delete message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::updateSampleRateAndFrequency()
|
||||
{
|
||||
m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
|
||||
m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||
ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::displaySettings()
|
||||
{
|
||||
blockApplySettings(true);
|
||||
|
||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||
ui->sampleRate->setValue(m_settings.m_devSampleRate);
|
||||
ui->bandwidth->setValue(m_settings.m_bandwidth / 1000);
|
||||
|
||||
ui->interp->setCurrentIndex(m_settings.m_log2Interp);
|
||||
|
||||
ui->gainText->setText(tr("%1 dB").arg(m_settings.m_globalGain));
|
||||
ui->gain->setValue(m_settings.m_globalGain);
|
||||
|
||||
if (m_settings.m_gainMode == BLADERF_GAIN_MANUAL) {
|
||||
ui->gain->setEnabled(true);
|
||||
} else {
|
||||
ui->gain->setEnabled(false);
|
||||
}
|
||||
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::sendSettings()
|
||||
{
|
||||
if(!m_updateTimer.isActive())
|
||||
m_updateTimer.start(100);
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_centerFrequency = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_sampleRate_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_devSampleRate = value;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_biasTee_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_biasTee = checked;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_bandwidth_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_bandwidth = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_interp_currentIndexChanged(int index)
|
||||
{
|
||||
if ((index <0) || (index > 6))
|
||||
return;
|
||||
m_settings.m_log2Interp = index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_gainMode_currentIndexChanged(int index)
|
||||
{
|
||||
const std::vector<BladeRF2Output::GainMode>& modes = m_sampleSink->getGainModes();
|
||||
unsigned int uindex = index < 0 ? 0 : (unsigned int) index;
|
||||
|
||||
if (uindex < modes.size())
|
||||
{
|
||||
BladeRF2Output::GainMode mode = modes[index];
|
||||
|
||||
if (m_settings.m_gainMode != mode.m_value)
|
||||
{
|
||||
if (mode.m_value == BLADERF_GAIN_MANUAL)
|
||||
{
|
||||
m_settings.m_globalGain = ui->gain->value();
|
||||
ui->gain->setEnabled(true);
|
||||
} else {
|
||||
ui->gain->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
m_settings.m_gainMode = mode.m_value;
|
||||
sendSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_gain_valueChanged(int value)
|
||||
{
|
||||
ui->gainText->setText(tr("%1 dB").arg(value));
|
||||
m_settings.m_globalGain = value;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::on_startStop_toggled(bool checked)
|
||||
{
|
||||
if (m_doApplySettings)
|
||||
{
|
||||
BladeRF2Output::MsgStartStop *message = BladeRF2Output::MsgStartStop::create(checked);
|
||||
m_sampleSink->getInputMessageQueue()->push(message);
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::updateHardware()
|
||||
{
|
||||
if (m_doApplySettings)
|
||||
{
|
||||
qDebug() << "BladeRF2OutputGui::updateHardware";
|
||||
BladeRF2Output::MsgConfigureBladeRF2* message = BladeRF2Output::MsgConfigureBladeRF2::create(m_settings, m_forceSettings);
|
||||
m_sampleSink->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void BladeRF2OutputGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSinkAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSinkEngine::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSinkEngine::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSinkEngine::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSinkEngine::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSinkAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
m_lastEngineState = state;
|
||||
}
|
||||
}
|
||||
|
90
plugins/samplesink/bladerf2output/bladerf2outputgui.h
Normal file
90
plugins/samplesink/bladerf2output/bladerf2outputgui.h
Normal file
@ -0,0 +1,90 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2018 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// 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 as version 3 of the License, or //
|
||||
// //
|
||||
// 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. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PLUGINS_SAMPLESINK_BLADERF2OUTPUT_BLADERF2OUTPUTGUI_H_
|
||||
#define PLUGINS_SAMPLESINK_BLADERF2OUTPUT_BLADERF2OUTPUTGUI_H_
|
||||
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
#include "plugin/plugininstancegui.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
#include "bladerf2output.h"
|
||||
|
||||
class DeviceSampleSink;
|
||||
class DeviceUISet;
|
||||
|
||||
namespace Ui {
|
||||
class BladeRF2OutputGui;
|
||||
}
|
||||
|
||||
class BladeRF2OutputGui : public QWidget, public PluginInstanceGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BladeRF2OutputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||
virtual ~BladeRF2OutputGui();
|
||||
virtual void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
QString getName() const;
|
||||
|
||||
void resetToDefaults();
|
||||
virtual qint64 getCenterFrequency() const;
|
||||
virtual void setCenterFrequency(qint64 centerFrequency);
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
private:
|
||||
Ui::BladeRF2OutputGui* ui;
|
||||
|
||||
DeviceUISet* m_deviceUISet;
|
||||
bool m_doApplySettings;
|
||||
bool m_forceSettings;
|
||||
BladeRF2OutputSettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
||||
BladeRF2Output* m_sampleSink;
|
||||
int m_sampleRate;
|
||||
quint64 m_deviceCenterFrequency; //!< Center frequency in device
|
||||
int m_lastEngineState;
|
||||
MessageQueue m_inputMessageQueue;
|
||||
|
||||
void blockApplySettings(bool block) { m_doApplySettings = !block; }
|
||||
void displaySettings();
|
||||
void sendSettings();
|
||||
void updateSampleRateAndFrequency();
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void on_centerFrequency_changed(quint64 value);
|
||||
void on_biasTee_toggled(bool checked);
|
||||
void on_sampleRate_changed(quint64 value);
|
||||
void on_bandwidth_changed(quint64 value);
|
||||
void on_interp_currentIndexChanged(int index);
|
||||
void on_gainMode_currentIndexChanged(int index);
|
||||
void on_gain_valueChanged(int value);
|
||||
void on_startStop_toggled(bool checked);
|
||||
void updateHardware();
|
||||
void updateStatus();
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* PLUGINS_SAMPLESINK_BLADERF2OUTPUT_BLADERF2OUTPUTGUI_H_ */
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Bladerf2OutputGui</class>
|
||||
<widget class="QWidget" name="Bladerf2OutputGui">
|
||||
<class>BladeRF2OutputGui</class>
|
||||
<widget class="QWidget" name="BladeRF2OutputGui">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -324,7 +324,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="decim">
|
||||
<widget class="QComboBox" name="interp">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "bladerf2outputgui.h"
|
||||
#endif
|
||||
|
||||
const PluginDescriptor Bladerf2OutputPlugin::m_pluginDescriptor = {
|
||||
const PluginDescriptor BladeRF2OutputPlugin::m_pluginDescriptor = {
|
||||
QString("BladeRF2 Output"),
|
||||
QString("4.2.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
@ -37,25 +37,25 @@ const PluginDescriptor Bladerf2OutputPlugin::m_pluginDescriptor = {
|
||||
QString("https://github.com/f4exb/sdrangel")
|
||||
};
|
||||
|
||||
const QString Bladerf2OutputPlugin::m_hardwareID = "BladeRF2";
|
||||
const QString Bladerf2OutputPlugin::m_deviceTypeID = BLADERF2OUTPUT_DEVICE_TYPE_ID;
|
||||
const QString BladeRF2OutputPlugin::m_hardwareID = "BladeRF2";
|
||||
const QString BladeRF2OutputPlugin::m_deviceTypeID = BLADERF2OUTPUT_DEVICE_TYPE_ID;
|
||||
|
||||
Bladerf2OutputPlugin::Bladerf1OutputPlugin(QObject* parent) :
|
||||
BladeRF2OutputPlugin::BladeRF2OutputPlugin(QObject* parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
const PluginDescriptor& Bladerf2OutputPlugin::getPluginDescriptor() const
|
||||
const PluginDescriptor& BladeRF2OutputPlugin::getPluginDescriptor() const
|
||||
{
|
||||
return m_pluginDescriptor;
|
||||
}
|
||||
|
||||
void Bladerf2OutputPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
void BladeRF2OutputPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
{
|
||||
pluginAPI->registerSampleSink(m_deviceTypeID, this);
|
||||
}
|
||||
|
||||
PluginInterface::SamplingDevices Bladerf2OutputPlugin::enumSampleSinks()
|
||||
PluginInterface::SamplingDevices BladeRF2OutputPlugin::enumSampleSinks()
|
||||
{
|
||||
SamplingDevices result;
|
||||
struct bladerf_devinfo *devinfo = 0;
|
||||
@ -113,7 +113,7 @@ PluginInterface::SamplingDevices Bladerf2OutputPlugin::enumSampleSinks()
|
||||
}
|
||||
|
||||
#ifdef SERVER_MODE
|
||||
PluginInstanceGUI* Bladerf2OutputPlugin::createSampleSinkPluginInstanceGUI(
|
||||
PluginInstanceGUI* BladeRF2OutputPlugin::createSampleSinkPluginInstanceGUI(
|
||||
const QString& sinkId __attribute__((unused)),
|
||||
QWidget **widget __attribute__((unused)),
|
||||
DeviceUISet *deviceUISet __attribute__((unused)))
|
||||
@ -121,14 +121,14 @@ PluginInstanceGUI* Bladerf2OutputPlugin::createSampleSinkPluginInstanceGUI(
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
PluginInstanceGUI* Bladerf2OutputPlugin::createSampleSinkPluginInstanceGUI(
|
||||
PluginInstanceGUI* BladeRF2OutputPlugin::createSampleSinkPluginInstanceGUI(
|
||||
const QString& sinkId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet)
|
||||
{
|
||||
if(sinkId == m_deviceTypeID)
|
||||
{
|
||||
Bladerf2OutputGui* gui = new Bladerf2OutputGui(deviceUISet);
|
||||
BladeRF2OutputGui* gui = new BladeRF2OutputGui(deviceUISet);
|
||||
*widget = gui;
|
||||
return gui;
|
||||
}
|
||||
@ -139,11 +139,11 @@ PluginInstanceGUI* Bladerf2OutputPlugin::createSampleSinkPluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSink* Bladerf2OutputPlugin::createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI)
|
||||
DeviceSampleSink* BladeRF2OutputPlugin::createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI)
|
||||
{
|
||||
if(sinkId == m_deviceTypeID)
|
||||
{
|
||||
Bladerf2Output* output = new Bladerf2Output(deviceAPI);
|
||||
BladeRF2Output* output = new BladeRF2Output(deviceAPI);
|
||||
return output;
|
||||
}
|
||||
else
|
||||
|
@ -24,13 +24,13 @@ class PluginAPI;
|
||||
|
||||
#define BLADERF2OUTPUT_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf2output"
|
||||
|
||||
class Bladerf2OutputPlugin : public QObject, public PluginInterface {
|
||||
class BladeRF2OutputPlugin : public QObject, public PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
Q_PLUGIN_METADATA(IID BLADERF2OUTPUT_DEVICE_TYPE_ID)
|
||||
|
||||
public:
|
||||
explicit Bladerf2OutputPlugin(QObject* parent = 0);
|
||||
explicit BladeRF2OutputPlugin(QObject* parent = 0);
|
||||
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
@ -62,8 +62,6 @@ bool BladeRF2OutputSettings::deserialize(const QByteArray& data)
|
||||
|
||||
if (d.getVersion() == 1)
|
||||
{
|
||||
int intval;
|
||||
|
||||
d.readS32(1, &m_devSampleRate);
|
||||
d.readS32(2, &m_bandwidth);
|
||||
d.readS32(3, &m_gainMode);
|
||||
|
@ -5,6 +5,7 @@ find_package(LibUSB)
|
||||
find_package(LibBLADERF)
|
||||
if(LIBUSB_FOUND AND LIBBLADERF_FOUND)
|
||||
add_subdirectory(bladerf1output)
|
||||
add_subdirectory(bladerf2output)
|
||||
endif(LIBUSB_FOUND AND LIBBLADERF_FOUND)
|
||||
|
||||
find_package(LibHACKRF)
|
||||
@ -29,6 +30,7 @@ endif(CM256CC_FOUND)
|
||||
|
||||
if (BUILD_DEBIAN)
|
||||
add_subdirectory(bladerf1output)
|
||||
add_subdirectory(bladerf2output)
|
||||
add_subdirectory(hackrfoutput)
|
||||
add_subdirectory(limesdroutput)
|
||||
add_subdirectory(plutosdroutput)
|
||||
|
68
pluginssrv/samplesink/bladerf2output/CMakeLists.txt
Normal file
68
pluginssrv/samplesink/bladerf2output/CMakeLists.txt
Normal file
@ -0,0 +1,68 @@
|
||||
project(bladerf2output)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(PLUGIN_PREFIX "../../../plugins/samplesink/bladerf2output")
|
||||
|
||||
set(bladerf2output_SOURCES
|
||||
${PLUGIN_PREFIX}/bladerf2output.cpp
|
||||
${PLUGIN_PREFIX}/bladerf2outputplugin.cpp
|
||||
${PLUGIN_PREFIX}/bladerf2outputsettings.cpp
|
||||
${PLUGIN_PREFIX}/bladerf2outputthread.cpp
|
||||
)
|
||||
|
||||
set(bladerf2output_HEADERS
|
||||
${PLUGIN_PREFIX}/bladerf2output.h
|
||||
${PLUGIN_PREFIX}/bladerf2outputplugin.h
|
||||
${PLUGIN_PREFIX}/bladerf2outputsettings.h
|
||||
${PLUGIN_PREFIX}/bladerf2outputthread.h
|
||||
)
|
||||
|
||||
if (BUILD_DEBIAN)
|
||||
include_directories(
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||
${CMAKE_SOURCE_DIR}/devices
|
||||
${LIBBLADERFLIBSRC}/include
|
||||
${LIBBLADERFLIBSRC}/src
|
||||
)
|
||||
else (BUILD_DEBIAN)
|
||||
include_directories(
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||
${CMAKE_SOURCE_DIR}/devices
|
||||
${LIBBLADERF_INCLUDE_DIR}
|
||||
)
|
||||
endif (BUILD_DEBIAN)
|
||||
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
add_definitions(-DQT_PLUGIN)
|
||||
add_definitions(-DQT_SHARED)
|
||||
|
||||
add_library(outputbladerf2srv SHARED
|
||||
${bladerf2output_SOURCES}
|
||||
${bladerf2output_HEADERS_MOC}
|
||||
)
|
||||
|
||||
if (BUILD_DEBIAN)
|
||||
target_link_libraries(outputbladerf2srv
|
||||
${QT_LIBRARIES}
|
||||
bladerf
|
||||
sdrbase
|
||||
swagger
|
||||
bladerf2device
|
||||
)
|
||||
else (BUILD_DEBIAN)
|
||||
target_link_libraries(outputbladerf2srv
|
||||
${QT_LIBRARIES}
|
||||
${LIBBLADERF_LIBRARIES}
|
||||
sdrbase
|
||||
swagger
|
||||
bladerf2device
|
||||
)
|
||||
endif (BUILD_DEBIAN)
|
||||
|
||||
target_link_libraries(outputbladerf2srv Qt5::Core)
|
||||
|
||||
install(TARGETS outputbladerf2srv DESTINATION lib/pluginssrv/samplesink)
|
Loading…
Reference in New Issue
Block a user