1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-12 11:26:11 -05:00

BladerRF2 input support (7). GUI and Plugin

This commit is contained in:
f4exb 2018-09-25 00:38:38 +02:00
parent cdeb6e6c42
commit b20feec1fd
10 changed files with 573 additions and 302 deletions

View File

@ -79,6 +79,15 @@ bool DeviceBladeRF2::open(const char *serial)
return true;
}
void DeviceBladeRF2::close()
{
if (m_dev)
{
bladerf_close(m_dev);
m_dev = 0;
}
}
struct bladerf *DeviceBladeRF2::open_bladerf_from_serial(const char *serial)
{
int status;

View File

@ -14,8 +14,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "bladerf1inputgui.h"
#include <QDebug>
#include <QMessageBox>
@ -26,9 +24,11 @@
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include <device/devicesourceapi.h>
#include "device/devicesourceapi.h"
#include "device/deviceuiset.h"
#include "bladerf1inputgui.h"
Bladerf1InputGui::Bladerf1InputGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::Bladerf1InputGui),

View File

@ -3,17 +3,17 @@ project(bladerf2input)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(bladerf2input_SOURCES
#bladerf2inputgui.cpp
bladerf2inputgui.cpp
bladerf2input.cpp
#bladerf2inputplugin.cpp
bladerf2inputplugin.cpp
bladerf2inputsettings.cpp
bladerf2inputthread.cpp
)
set(bladerf2input_HEADERS
#bladerf2inputgui.h
bladerf2inputgui.h
bladerf2input.h
#bladerf2inputplugin.h
bladerf2inputplugin.h
bladerf2inputsettings.h
bladerf2inputthread.h
)

View File

@ -417,6 +417,34 @@ void BladeRF2Input::setCenterFrequency(qint64 centerFrequency)
}
}
void BladeRF2Input::getFrequencyRange(uint64_t& min, uint64_t& max, int& step)
{
if (m_deviceShared.m_dev) {
m_deviceShared.m_dev->getFrequencyRangeRx(min, max, step);
}
}
void BladeRF2Input::getSampleRateRange(int& min, int& max, int& step)
{
if (m_deviceShared.m_dev) {
m_deviceShared.m_dev->getSampleRateRangeRx(min, max, step);
}
}
void BladeRF2Input::getBandwidthRange(int& min, int& max, int& step)
{
if (m_deviceShared.m_dev) {
m_deviceShared.m_dev->getBandwidthRangeRx(min, max, step);
}
}
void BladeRF2Input::getGlobalGainRange(int& min, int& max, int& step)
{
if (m_deviceShared.m_dev) {
m_deviceShared.m_dev->getGlobalGainRangeRx(min, max, step);
}
}
bool BladeRF2Input::handleMessage(const Message& message)
{
if (MsgConfigureBladeRF2::match(message))

View File

@ -110,6 +110,11 @@ public:
virtual quint64 getCenterFrequency() const;
virtual void setCenterFrequency(qint64 centerFrequency);
void getFrequencyRange(uint64_t& min, uint64_t& max, int& step);
void getSampleRateRange(int& min, int& max, int& step);
void getBandwidthRange(int& min, int& max, int& step);
void getGlobalGainRange(int& min, int& max, int& step);
virtual bool handleMessage(const Message& message);
virtual int webapiSettingsGet(

View File

@ -0,0 +1,333 @@
///////////////////////////////////////////////////////////////////////////////////
// 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_bladerf2inputgui.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "device/devicesourceapi.h"
#include "device/deviceuiset.h"
#include "bladerf2inputgui.h"
BladeRF2InputGui::BladeRF2InputGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::Bladerf2InputGui),
m_deviceUISet(deviceUISet),
m_forceSettings(true),
m_doApplySettings(true),
m_settings(),
m_sampleSource(0),
m_sampleRate(0),
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
{
m_sampleSource = (BladeRF2Input*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
int max, min, step;
uint64_t f_min, f_max;
ui->setupUi(this);
m_sampleSource->getFrequencyRange(f_min, f_max, step);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->centerFrequency->setValueRange(7, f_min/1000, f_max/1000);
m_sampleSource->getSampleRateRange(min, max, step);
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
ui->sampleRate->setValueRange(8, min, max);
m_sampleSource->getBandwidthRange(min, max, step);
ui->bandwidth->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
ui->bandwidth->setValueRange(6, min/1000, max/1000);
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_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue);
sendSettings();
}
BladeRF2InputGui::~BladeRF2InputGui()
{
delete ui;
}
void BladeRF2InputGui::destroy()
{
delete this;
}
void BladeRF2InputGui::setName(const QString& name)
{
setObjectName(name);
}
QString BladeRF2InputGui::getName() const
{
return objectName();
}
void BladeRF2InputGui::resetToDefaults()
{
m_settings.resetToDefaults();
displaySettings();
sendSettings();
}
qint64 BladeRF2InputGui::getCenterFrequency() const
{
return m_settings.m_centerFrequency;
}
void BladeRF2InputGui::setCenterFrequency(qint64 centerFrequency)
{
m_settings.m_centerFrequency = centerFrequency;
displaySettings();
sendSettings();
}
QByteArray BladeRF2InputGui::serialize() const
{
return m_settings.serialize();
}
bool BladeRF2InputGui::deserialize(const QByteArray& data)
{
if(m_settings.deserialize(data)) {
displaySettings();
m_forceSettings = true;
sendSettings();
return true;
} else {
resetToDefaults();
return false;
}
}
bool BladeRF2InputGui::handleMessage(const Message& message)
{
if (BladeRF2Input::MsgConfigureBladeRF2::match(message))
{
const BladeRF2Input::MsgConfigureBladeRF2& cfg = (BladeRF2Input::MsgConfigureBladeRF2&) message;
m_settings = cfg.getSettings();
blockApplySettings(true);
displaySettings();
blockApplySettings(false);
return true;
}
else if (BladeRF2Input::MsgStartStop::match(message))
{
BladeRF2Input::MsgStartStop& notif = (BladeRF2Input::MsgStartStop&) message;
blockApplySettings(true);
ui->startStop->setChecked(notif.getStartStop());
blockApplySettings(false);
return true;
}
else
{
return false;
}
}
void BladeRF2InputGui::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
qDebug("BladeRF2InputGui::handleInputMessages: message: %s", message->getIdentifier());
if (DSPSignalNotification::match(*message))
{
DSPSignalNotification* notif = (DSPSignalNotification*) message;
m_sampleRate = notif->getSampleRate();
m_deviceCenterFrequency = notif->getCenterFrequency();
qDebug("BladeRF2InputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
updateSampleRateAndFrequency();
delete message;
}
else
{
if (handleMessage(*message))
{
delete message;
}
}
}
}
void BladeRF2InputGui::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 BladeRF2InputGui::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->dcOffset->setChecked(m_settings.m_dcBlock);
ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
ui->decim->setCurrentIndex(m_settings.m_log2Decim);
ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
ui->gain->setValue(m_settings.m_globalGain);
blockApplySettings(false);
}
void BladeRF2InputGui::sendSettings()
{
if(!m_updateTimer.isActive())
m_updateTimer.start(100);
}
void BladeRF2InputGui::on_centerFrequency_changed(quint64 value)
{
m_settings.m_centerFrequency = value * 1000;
sendSettings();
}
void BladeRF2InputGui::on_sampleRate_changed(quint64 value)
{
m_settings.m_devSampleRate = value;
sendSettings();
}
void BladeRF2InputGui::on_dcOffset_toggled(bool checked)
{
m_settings.m_dcBlock = checked;
sendSettings();
}
void BladeRF2InputGui::on_iqImbalance_toggled(bool checked)
{
m_settings.m_iqCorrection = checked;
sendSettings();
}
void BladeRF2InputGui::on_bandwidth_changed(quint64 value)
{
m_settings.m_bandwidth = value * 1000;
sendSettings();
}
void BladeRF2InputGui::on_decim_currentIndexChanged(int index)
{
if ((index <0) || (index > 6))
return;
m_settings.m_log2Decim = index;
sendSettings();
}
void BladeRF2InputGui::on_fcPos_currentIndexChanged(int index)
{
if (index == 0) {
m_settings.m_fcPos = BladeRF2InputSettings::FC_POS_INFRA;
sendSettings();
} else if (index == 1) {
m_settings.m_fcPos = BladeRF2InputSettings::FC_POS_SUPRA;
sendSettings();
} else if (index == 2) {
m_settings.m_fcPos = BladeRF2InputSettings::FC_POS_CENTER;
sendSettings();
}
}
void BladeRF2InputGui::on_startStop_toggled(bool checked)
{
if (m_doApplySettings)
{
BladeRF2Input::MsgStartStop *message = BladeRF2Input::MsgStartStop::create(checked);
m_sampleSource->getInputMessageQueue()->push(message);
}
}
void BladeRF2InputGui::on_record_toggled(bool checked)
{
if (checked) {
ui->record->setStyleSheet("QToolButton { background-color : red; }");
} else {
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
}
BladeRF2Input::MsgFileRecord* message = BladeRF2Input::MsgFileRecord::create(checked);
m_sampleSource->getInputMessageQueue()->push(message);
}
void BladeRF2InputGui::updateHardware()
{
if (m_doApplySettings)
{
qDebug() << "BladeRF2InputGui::updateHardware";
BladeRF2Input::MsgConfigureBladeRF2* message = BladeRF2Input::MsgConfigureBladeRF2::create(m_settings, m_forceSettings);
m_sampleSource->getInputMessageQueue()->push(message);
m_forceSettings = false;
m_updateTimer.stop();
}
}
void BladeRF2InputGui::blockApplySettings(bool block)
{
m_doApplySettings = !block;
}
void BladeRF2InputGui::updateStatus()
{
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
switch(state)
{
case DSPDeviceSourceEngine::StNotStarted:
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
break;
case DSPDeviceSourceEngine::StIdle:
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
break;
case DSPDeviceSourceEngine::StRunning:
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;
}
m_lastEngineState = state;
}
}

View File

@ -0,0 +1,93 @@
///////////////////////////////////////////////////////////////////////////////////
// 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_SAMPLESOURCE_BLADERF2INPUT_BLADERF2INPUTGUI_H_
#define PLUGINS_SAMPLESOURCE_BLADERF2INPUT_BLADERF2INPUTGUI_H_
#include <plugin/plugininstancegui.h>
#include <QTimer>
#include <QWidget>
#include "util/messagequeue.h"
#include "bladerf2input.h"
class DeviceUISet;
namespace Ui {
class Bladerf2InputGui;
}
class BladeRF2InputGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit BladeRF2InputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~BladeRF2InputGui();
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::Bladerf2InputGui* ui;
DeviceUISet* m_deviceUISet;
bool m_forceSettings;
bool m_doApplySettings;
BladeRF2InputSettings m_settings;
QTimer m_updateTimer;
QTimer m_statusTimer;
std::vector<int> m_gains;
BladeRF2Input* m_sampleSource;
int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;
MessageQueue m_inputMessageQueue;
void displaySettings();
void sendSettings();
void updateSampleRateAndFrequency();
void blockApplySettings(bool block);
private slots:
void handleInputMessages();
void on_centerFrequency_changed(quint64 value);
void on_sampleRate_changed(quint64 value);
void on_dcOffset_toggled(bool checked);
void on_iqImbalance_toggled(bool checked);
void on_biasTee_toggled(bool checked);
void on_bandwidth_changed(quint64 value);
void on_decim_currentIndexChanged(int index);
void on_fcPos_currentIndexChanged(int index);
void on_gainMode_currentIndexChanged(int index);
void on_gain_valueChanged(int value);
void on_startStop_toggled(bool checked);
void on_record_toggled(bool checked);
void updateHardware();
void updateStatus();
};
#endif /* PLUGINS_SAMPLESOURCE_BLADERF2INPUT_BLADERF2INPUTGUI_H_ */

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>310</width>
<height>265</height>
<height>250</height>
</rect>
</property>
<property name="sizePolicy">
@ -222,67 +222,59 @@
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="xb200Label">
<item row="0" column="6">
<widget class="QLabel" name="bandwidthUnit">
<property name="text">
<string>xb200</string>
<string>kHz</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="bandwidthLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>BW </string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QComboBox" name="xb200">
<widget class="ValueDial" name="bandwidth" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Mono</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="ButtonSwitch" name="biasTee">
<property name="toolTip">
<string>XB200 board mode</string>
<string>Bias Tee</string>
</property>
<property name="currentText">
<string>None</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="maxVisibleItems">
<number>5</number>
</property>
<item>
<property name="text">
<string>None</string>
<string>BT</string>
</property>
</item>
<item>
<property name="text">
<string>Bypass</string>
</property>
</item>
<item>
<property name="text">
<string>Auto 1dB</string>
</property>
</item>
<item>
<property name="text">
<string>Auto 3dB</string>
</property>
</item>
<item>
<property name="text">
<string>Custom</string>
</property>
</item>
<item>
<property name="text">
<string>50M</string>
</property>
</item>
<item>
<property name="text">
<string>144M</string>
</property>
</item>
<item>
<property name="text">
<string>222M</string>
</property>
</item>
</widget>
</item>
</layout>
@ -360,6 +352,35 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_fcPos">
<property name="text">
<string>Fp</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fcPos">
<property name="toolTip">
<string>Relative position of device center frequency</string>
</property>
<item>
<property name="text">
<string>Inf</string>
</property>
</item>
<item>
<property name="text">
<string>Sup</string>
</property>
</item>
<item>
<property name="text">
<string>Cen</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_decim">
<property name="text">
@ -421,146 +442,43 @@
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_decim" columnstretch="0,0,0,0,0,0,0,0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout_decim" columnstretch="0,0,0,0,0,0">
<property name="spacing">
<number>3</number>
</property>
<item row="0" column="4">
<spacer name="fcPosRightSpacer">
<item row="0" column="2">
<widget class="QSlider" name="gain">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="5">
<widget class="QLabel" name="bandwidthLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>BW </string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_fcPos">
<item row="0" column="1">
<widget class="QComboBox" name="gainMode"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="gainLabel">
<property name="text">
<string>Fp</string>
<string>Gain</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QComboBox" name="fcPos">
<property name="toolTip">
<string>Relative position of device center frequency</string>
</property>
<item>
<property name="text">
<string>Inf</string>
</property>
</item>
<item>
<property name="text">
<string>Sup</string>
</property>
</item>
<item>
<property name="text">
<string>Cen</string>
</property>
</item>
</widget>
</item>
<item row="0" column="9">
<widget class="QLabel" name="lnaGainLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QLabel" name="gainText">
<property name="minimumSize">
<size>
<width>25</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>LNA </string>
<string>000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="QComboBox" name="lna">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>0</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
</widget>
</item>
<item row="0" column="11">
<widget class="QLabel" name="label">
<property name="text">
<string>dB</string>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="bandwidthUnit">
<property name="text">
<string>kHz</string>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QComboBox" name="bandwidth">
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>IF bandwidth in kHz</string>
</property>
</widget>
</item>
<item row="0" column="8">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
@ -570,117 +488,6 @@
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_vga1">
<property name="spacing">
<number>3</number>
</property>
<item row="0" column="1">
<widget class="QSlider" name="vga1">
<property name="toolTip">
<string>Amplifier before filtering gain (dB)</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>20</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="vga1Text">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>20</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="vga1Label">
<property name="text">
<string>VGA1</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_vga1">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_vga2" columnstretch="0,0,0">
<property name="spacing">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="vga2Label">
<property name="text">
<string>VGA2</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSlider" name="vga2">
<property name="toolTip">
<string>Amplifier before ADC gain (dB)</string>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="singleStep">
<number>3</number>
</property>
<property name="pageStep">
<number>3</number>
</property>
<property name="value">
<number>9</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="vga2Text">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>9</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="padLayout">
<item>
@ -698,13 +505,6 @@
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_vga2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>

View File

@ -87,7 +87,7 @@ PluginInterface::SamplingDevices Blderf2InputPlugin::enumSampleSources()
{
unsigned int nbRxChannels = bladerf_get_channel_count(dev, BLADERF_RX);
for (int j = 0; j < nbRxChannels; j++)
for (unsigned int j = 0; j < nbRxChannels; j++)
{
qDebug("Blderf2InputPlugin::enumSampleSources: device #%d (%s) channel %u", i, devinfo[i].serial, j);
QString displayedName(QString("BladeRF2[%1:%2] %3").arg(devinfo[i].instance).arg(j).arg(devinfo[i].serial));
@ -128,7 +128,7 @@ PluginInstanceGUI* Blderf2InputPlugin::createSampleSourcePluginInstanceGUI(
{
if(sourceId == m_deviceTypeID)
{
Bladerf2InputGui* gui = new Bladerf2InputGui(deviceUISet);
BladeRF2InputGui* gui = new BladeRF2InputGui(deviceUISet);
*widget = gui;
return gui;
}
@ -143,7 +143,7 @@ DeviceSampleSource *Blderf2InputPlugin::createSampleSourcePluginInstanceInput(co
{
if (sourceId == m_deviceTypeID)
{
Bladerf2Input *input = new Bladerf2Input(deviceAPI);
BladeRF2Input *input = new BladeRF2Input(deviceAPI);
return input;
}
else

View File

@ -1,6 +1,9 @@
# Nuand bladeRF
ATTR{idVendor}=="2cf0", ATTR{idProduct}=="5246", MODE="666", GROUP="plugdev"
# Nuand bladeRF2
ATTR{idVendor}=="2cf0", ATTR{idProduct}=="5250", MODE="666", GROUP="plugdev"
# Nuand bladeRF, legacy VID/PID
ATTR{idVendor}=="1d50", ATTR{idProduct}=="6066", MODE="666", GROUP="plugdev"