mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-25 05:25:27 -04:00
LimeSDR support (11) compiles
This commit is contained in:
parent
6ed2fbee10
commit
561baf975d
@ -50,6 +50,11 @@ else(LIBUSB_FOUND AND LIBMIRISDR_FOUND)
|
|||||||
message(STATUS "LibMiriSDR NOT found")
|
message(STATUS "LibMiriSDR NOT found")
|
||||||
endif(LIBUSB_FOUND AND LIBMIRISDR_FOUND)
|
endif(LIBUSB_FOUND AND LIBMIRISDR_FOUND)
|
||||||
|
|
||||||
|
find_package(LimeSuite)
|
||||||
|
if(LIBUSB_FOUND AND LIMESUITE_FOUND)
|
||||||
|
add_subdirectory(limesdrinput)
|
||||||
|
endif(LIBUSB_FOUND AND LIMESUITE_FOUND)
|
||||||
|
|
||||||
find_package(LZ4)
|
find_package(LZ4)
|
||||||
find_package(LibNANOMSG)
|
find_package(LibNANOMSG)
|
||||||
if(LIBNANOMSG_FOUND AND LIBLZ4_FOUND)
|
if(LIBNANOMSG_FOUND AND LIBLZ4_FOUND)
|
||||||
@ -70,6 +75,7 @@ if (BUILD_DEBIAN)
|
|||||||
add_subdirectory(rtlsdr)
|
add_subdirectory(rtlsdr)
|
||||||
add_subdirectory(bladerfinput)
|
add_subdirectory(bladerfinput)
|
||||||
add_subdirectory(sdrplay)
|
add_subdirectory(sdrplay)
|
||||||
|
add_subdirectory(limesdrinput)
|
||||||
endif (BUILD_DEBIAN)
|
endif (BUILD_DEBIAN)
|
||||||
|
|
||||||
add_subdirectory(filesource)
|
add_subdirectory(filesource)
|
||||||
|
72
plugins/samplesource/limesdrinput/CMakeLists.txt
Normal file
72
plugins/samplesource/limesdrinput/CMakeLists.txt
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
project(limesdrinput)
|
||||||
|
|
||||||
|
set(limesdrinput_SOURCES
|
||||||
|
limesdrinputgui.cpp
|
||||||
|
limesdrinput.cpp
|
||||||
|
limesdrinputplugin.cpp
|
||||||
|
limesdrinputsettings.cpp
|
||||||
|
limesdrinputthread.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(limesdrinput_HEADERS
|
||||||
|
limesdrinputgui.h
|
||||||
|
limesdrinput.h
|
||||||
|
limesdrinputplugin.h
|
||||||
|
limesdrinputsettings.h
|
||||||
|
limesdrinputthread.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(limesdrinput_FORMS
|
||||||
|
limesdrinputgui.ui
|
||||||
|
)
|
||||||
|
|
||||||
|
if (BUILD_DEBIAN)
|
||||||
|
include_directories(
|
||||||
|
.
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/devices
|
||||||
|
${LIBBLADERFLIBSRC}/include
|
||||||
|
${LIBBLADERFLIBSRC}/src
|
||||||
|
)
|
||||||
|
else (BUILD_DEBIAN)
|
||||||
|
include_directories(
|
||||||
|
.
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/devices
|
||||||
|
${LIMESUITE_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
endif (BUILD_DEBIAN)
|
||||||
|
|
||||||
|
#include(${QT_USE_FILE})
|
||||||
|
add_definitions(${QT_DEFINITIONS})
|
||||||
|
add_definitions(-DQT_PLUGIN)
|
||||||
|
add_definitions(-DQT_SHARED)
|
||||||
|
|
||||||
|
#qt4_wrap_cpp(limesdrinput_HEADERS_MOC ${limesdrinput_HEADERS})
|
||||||
|
qt5_wrap_ui(limesdrinput_FORMS_HEADERS ${limesdrinput_FORMS})
|
||||||
|
|
||||||
|
add_library(inputlimesdr SHARED
|
||||||
|
${limesdrinput_SOURCES}
|
||||||
|
${limesdrinput_HEADERS_MOC}
|
||||||
|
${limesdrinput_FORMS_HEADERS}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (BUILD_DEBIAN)
|
||||||
|
target_link_libraries(inputlimesdr
|
||||||
|
${QT_LIBRARIES}
|
||||||
|
limesdr
|
||||||
|
sdrbase
|
||||||
|
limesdrdevice
|
||||||
|
)
|
||||||
|
else (BUILD_DEBIAN)
|
||||||
|
target_link_libraries(inputlimesdr
|
||||||
|
${QT_LIBRARIES}
|
||||||
|
${LIMESUITE_LIBRARY}
|
||||||
|
sdrbase
|
||||||
|
limesdrdevice
|
||||||
|
)
|
||||||
|
endif (BUILD_DEBIAN)
|
||||||
|
|
||||||
|
qt5_use_modules(inputlimesdr Core Widgets)
|
||||||
|
|
||||||
|
install(TARGETS inputlimesdr DESTINATION lib/plugins/samplesource)
|
@ -19,7 +19,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "lime/LimeSuite.h"
|
#include "lime/LimeSuite.h"
|
||||||
|
|
||||||
|
#include "device/devicesourceapi.h"
|
||||||
|
#include "device/devicesinkapi.h"
|
||||||
#include "limesdrinput.h"
|
#include "limesdrinput.h"
|
||||||
|
#include "limesdrinputthread.h"
|
||||||
#include "limesdr/devicelimesdrparam.h"
|
#include "limesdr/devicelimesdrparam.h"
|
||||||
|
|
||||||
|
|
||||||
@ -45,8 +48,8 @@ bool LimeSDRInput::openDevice()
|
|||||||
// if there is a channel left take the first available
|
// if there is a channel left take the first available
|
||||||
if (m_deviceAPI->getSourceBuddies().size() > 0) // look source sibling first
|
if (m_deviceAPI->getSourceBuddies().size() > 0) // look source sibling first
|
||||||
{
|
{
|
||||||
DeviceSinkAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
DeviceSourceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
|
||||||
m_deviceShared = *(sourceBuddy->getBuddySharedPtr()); // copy shared data
|
m_deviceShared = *((DeviceLimeSDRShared *) sourceBuddy->getBuddySharedPtr()); // copy shared data
|
||||||
DeviceLimeSDRParams *deviceParams = m_deviceShared.m_deviceParams; // get device parameters
|
DeviceLimeSDRParams *deviceParams = m_deviceShared.m_deviceParams; // get device parameters
|
||||||
|
|
||||||
if (deviceParams == 0)
|
if (deviceParams == 0)
|
||||||
@ -65,8 +68,8 @@ bool LimeSDRInput::openDevice()
|
|||||||
|
|
||||||
for (int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++)
|
for (int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++)
|
||||||
{
|
{
|
||||||
DeviceSinkAPI *buddy = m_deviceAPI->getSourceBuddies()[i];
|
DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[i];
|
||||||
DeviceLimeSDRShared *buddyShared = buddy->getBuddySharedPtr();
|
DeviceLimeSDRShared *buddyShared = (DeviceLimeSDRShared *) buddy->getBuddySharedPtr();
|
||||||
busyChannels[buddyShared->m_channel] = 1;
|
busyChannels[buddyShared->m_channel] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +90,7 @@ bool LimeSDRInput::openDevice()
|
|||||||
else if (m_deviceAPI->getSinkBuddies().size() > 0) // then sink
|
else if (m_deviceAPI->getSinkBuddies().size() > 0) // then sink
|
||||||
{
|
{
|
||||||
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
DeviceSinkAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
|
||||||
m_deviceShared = *(sinkBuddy->getBuddySharedPtr()); // copy parameters
|
m_deviceShared = *((DeviceLimeSDRShared *) sinkBuddy->getBuddySharedPtr()); // copy parameters
|
||||||
|
|
||||||
if (m_deviceShared.m_deviceParams == 0)
|
if (m_deviceShared.m_deviceParams == 0)
|
||||||
{
|
{
|
||||||
@ -103,7 +106,9 @@ bool LimeSDRInput::openDevice()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceShared.m_deviceParams = new DeviceLimeSDRParams();
|
m_deviceShared.m_deviceParams = new DeviceLimeSDRParams();
|
||||||
m_deviceShared.m_deviceParams->open((lms_info_str_t) qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
char serial[256];
|
||||||
|
strcpy(serial, qPrintable(m_deviceAPI->getSampleSourceSerial()));
|
||||||
|
m_deviceShared.m_deviceParams->open(serial);
|
||||||
m_deviceShared.m_channel = 0; // take first channel
|
m_deviceShared.m_channel = 0; // take first channel
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +118,7 @@ bool LimeSDRInput::openDevice()
|
|||||||
|
|
||||||
if (LMS_EnableChannel(m_deviceShared.m_deviceParams->getDevice(), LMS_CH_RX, m_deviceShared.m_channel, true) != 0)
|
if (LMS_EnableChannel(m_deviceShared.m_deviceParams->getDevice(), LMS_CH_RX, m_deviceShared.m_channel, true) != 0)
|
||||||
{
|
{
|
||||||
qCritical("LimeSDRInput::openDevice: cannot enable Rx channel %u", m_deviceShared.m_channel);
|
qCritical("LimeSDRInput::openDevice: cannot enable Rx channel %lu", m_deviceShared.m_channel);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +131,7 @@ void LimeSDRInput::closeDevice()
|
|||||||
|
|
||||||
if (LMS_EnableChannel(m_deviceShared.m_deviceParams->getDevice(), LMS_CH_RX, m_deviceShared.m_channel, false) != 0)
|
if (LMS_EnableChannel(m_deviceShared.m_deviceParams->getDevice(), LMS_CH_RX, m_deviceShared.m_channel, false) != 0)
|
||||||
{
|
{
|
||||||
qWarning("LimeSDRInput::closeDevice: cannot disable Rx channel %u", m_deviceShared.m_channel);
|
qWarning("LimeSDRInput::closeDevice: cannot disable Rx channel %lu", m_deviceShared.m_channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_deviceShared.m_channel = -1;
|
m_deviceShared.m_channel = -1;
|
||||||
@ -159,7 +164,7 @@ bool LimeSDRInput::start()
|
|||||||
|
|
||||||
if (LMS_SetupStream(m_deviceShared.m_deviceParams->getDevice(), &m_streamId) != 0)
|
if (LMS_SetupStream(m_deviceShared.m_deviceParams->getDevice(), &m_streamId) != 0)
|
||||||
{
|
{
|
||||||
qCritical("LimeSDRInput::start: cannot setup the stream on Rx channel %u", m_deviceShared.m_channel);
|
qCritical("LimeSDRInput::start: cannot setup the stream on Rx channel %lu", m_deviceShared.m_channel);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +203,11 @@ void LimeSDRInput::stop()
|
|||||||
m_running = false;
|
m_running = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::size_t LimeSDRInput::getChannelIndex()
|
||||||
|
{
|
||||||
|
return m_deviceShared.m_channel;
|
||||||
|
}
|
||||||
|
|
||||||
void LimeSDRInput::getLORange(float& minF, float& maxF, float& stepF) const
|
void LimeSDRInput::getLORange(float& minF, float& maxF, float& stepF) const
|
||||||
{
|
{
|
||||||
lms_range_t range = m_deviceShared.m_deviceParams->m_loRangeRx;
|
lms_range_t range = m_deviceShared.m_deviceParams->m_loRangeRx;
|
||||||
@ -222,4 +232,14 @@ void LimeSDRInput::getLPRange(float& minF, float& maxF, float& stepF) const
|
|||||||
stepF = range.step;
|
stepF = range.step;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LimeSDRInput::getLPIndex(float lpfBW) const
|
||||||
|
{
|
||||||
|
lms_range_t range = m_deviceShared.m_deviceParams->m_lpfRangeRx;
|
||||||
|
return (int) ((lpfBW - range.min) / range.step);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t LimeSDRInput::getHWLog2Decim() const
|
||||||
|
{
|
||||||
|
return m_deviceShared.m_deviceParams->m_log2OvSRRx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUT_H_
|
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUT_H_
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "dsp/devicesamplesource.h"
|
#include "dsp/devicesamplesource.h"
|
||||||
#include "limesdr/devicelimesdrshared.h"
|
#include "limesdr/devicelimesdrshared.h"
|
||||||
#include "limesdrinputsettings.h"
|
#include "limesdrinputsettings.h"
|
||||||
@ -29,6 +31,26 @@ struct DeviceLimeSDRParams;
|
|||||||
class LimeSDRInput : public DeviceSampleSource
|
class LimeSDRInput : public DeviceSampleSource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
class MsgConfigureLimeSDR : public Message {
|
||||||
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
|
public:
|
||||||
|
const LimeSDRInputSettings& getSettings() const { return m_settings; }
|
||||||
|
|
||||||
|
static MsgConfigureLimeSDR* create(const LimeSDRInputSettings& settings)
|
||||||
|
{
|
||||||
|
return new MsgConfigureLimeSDR(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
LimeSDRInputSettings m_settings;
|
||||||
|
|
||||||
|
MsgConfigureLimeSDR(const LimeSDRInputSettings& settings) :
|
||||||
|
Message(),
|
||||||
|
m_settings(settings)
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
LimeSDRInput(DeviceSourceAPI *deviceAPI);
|
LimeSDRInput(DeviceSourceAPI *deviceAPI);
|
||||||
virtual ~LimeSDRInput();
|
virtual ~LimeSDRInput();
|
||||||
|
|
||||||
@ -41,9 +63,12 @@ public:
|
|||||||
|
|
||||||
virtual bool handleMessage(const Message& message);
|
virtual bool handleMessage(const Message& message);
|
||||||
|
|
||||||
|
std::size_t getChannelIndex();
|
||||||
void getLORange(float& minF, float& maxF, float& stepF) const;
|
void getLORange(float& minF, float& maxF, float& stepF) const;
|
||||||
void getSRRange(float& minF, float& maxF, float& stepF) const;
|
void getSRRange(float& minF, float& maxF, float& stepF) const;
|
||||||
void getLPRange(float& minF, float& maxF, float& stepF) const;
|
void getLPRange(float& minF, float& maxF, float& stepF) const;
|
||||||
|
int getLPIndex(float lpfBW) const;
|
||||||
|
uint32_t getHWLog2Decim() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DeviceSourceAPI *m_deviceAPI;
|
DeviceSourceAPI *m_deviceAPI;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::BladerfInputGui),
|
ui(new Ui::LimeSDRInputGUI),
|
||||||
m_deviceAPI(deviceAPI),
|
m_deviceAPI(deviceAPI),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_sampleSource(0),
|
m_sampleSource(0),
|
||||||
@ -59,6 +59,8 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
|||||||
ui->lpf->setMinimum(minLP);
|
ui->lpf->setMinimum(minLP);
|
||||||
ui->lpf->setMaximum(maxLP);
|
ui->lpf->setMaximum(maxLP);
|
||||||
|
|
||||||
|
ui->channelNumberText->setText(tr("#%1").arg(m_limeSDRInput->getChannelIndex()));
|
||||||
|
|
||||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||||
m_statusTimer.start(500);
|
m_statusTimer.start(500);
|
||||||
@ -70,7 +72,7 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
|||||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||||
m_deviceAPI->addSink(m_fileSink);
|
m_deviceAPI->addSink(m_fileSink);
|
||||||
|
|
||||||
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);
|
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleMessagesToUI()), Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
LimeSDRInputGUI::~LimeSDRInputGUI()
|
LimeSDRInputGUI::~LimeSDRInputGUI()
|
||||||
@ -81,5 +83,148 @@ LimeSDRInputGUI::~LimeSDRInputGUI()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::destroy()
|
||||||
|
{
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::setName(const QString& name)
|
||||||
|
{
|
||||||
|
setObjectName(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LimeSDRInputGUI::getName() const
|
||||||
|
{
|
||||||
|
return objectName();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::resetToDefaults()
|
||||||
|
{
|
||||||
|
m_settings.resetToDefaults();
|
||||||
|
displaySettings();
|
||||||
|
sendSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
qint64 LimeSDRInputGUI::getCenterFrequency() const
|
||||||
|
{
|
||||||
|
return m_settings.m_centerFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::setCenterFrequency(qint64 centerFrequency)
|
||||||
|
{
|
||||||
|
m_settings.m_centerFrequency = centerFrequency;
|
||||||
|
displaySettings();
|
||||||
|
sendSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray LimeSDRInputGUI::serialize() const
|
||||||
|
{
|
||||||
|
return m_settings.serialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LimeSDRInputGUI::deserialize(const QByteArray& data)
|
||||||
|
{
|
||||||
|
if(m_settings.deserialize(data)) {
|
||||||
|
displaySettings();
|
||||||
|
sendSettings();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
resetToDefaults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::handleMessagesToUI()
|
||||||
|
{
|
||||||
|
Message* message;
|
||||||
|
|
||||||
|
while ((message = m_deviceAPI->getDeviceOutputMessageQueue()->pop()) != 0)
|
||||||
|
{
|
||||||
|
qDebug("LimeSDRInputGUI::handleDSPMessages: message: %s", message->getIdentifier());
|
||||||
|
|
||||||
|
if (DSPSignalNotification::match(*message))
|
||||||
|
{
|
||||||
|
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
||||||
|
m_sampleRate = notif->getSampleRate();
|
||||||
|
m_deviceCenterFrequency = notif->getCenterFrequency();
|
||||||
|
qDebug("BladerfGui::handleDSPMessages: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency());
|
||||||
|
updateSampleRateAndFrequency();
|
||||||
|
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||||
|
|
||||||
|
delete message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::updateSampleRateAndFrequency()
|
||||||
|
{
|
||||||
|
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
||||||
|
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||||
|
ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::displaySettings()
|
||||||
|
{
|
||||||
|
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||||
|
ui->sampleRate->setValue(m_settings.m_devSampleRate);
|
||||||
|
|
||||||
|
ui->dcOffset->setChecked(m_settings.m_dcBlock);
|
||||||
|
ui->iqImbalance->setChecked(m_settings.m_iqCorrection);
|
||||||
|
|
||||||
|
ui->hwDecim->setCurrentIndex(m_settings.m_log2HardDecim);
|
||||||
|
ui->swDecim->setCurrentIndex(m_settings.m_log2SoftDecim);
|
||||||
|
ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
|
||||||
|
|
||||||
|
ui->lpf->setValue(m_limeSDRInput->getLPIndex(m_settings.m_lpfFIRBW));
|
||||||
|
ui->lpfText->setText(tr("%1k").arg(QString::number(m_settings.m_lpfFIRBW / 1000.0f, 'f', 0)));
|
||||||
|
|
||||||
|
ui->lpFIREnable->setChecked(m_settings.m_lpfFIREnable);
|
||||||
|
ui->sampleRate->setValue(m_settings.m_lpfFIRBW);
|
||||||
|
|
||||||
|
ui->gain->setValue(m_settings.m_gain);
|
||||||
|
ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain));
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::sendSettings()
|
||||||
|
{
|
||||||
|
if(!m_updateTimer.isActive())
|
||||||
|
m_updateTimer.start(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::updateHardware()
|
||||||
|
{
|
||||||
|
qDebug() << "BladerfGui::updateHardware";
|
||||||
|
LimeSDRInput::MsgConfigureLimeSDR* message = LimeSDRInput::MsgConfigureLimeSDR::create( m_settings);
|
||||||
|
m_sampleSource->getInputMessageQueue()->push(message);
|
||||||
|
m_updateTimer.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LimeSDRInputGUI::updateStatus()
|
||||||
|
{
|
||||||
|
int state = m_deviceAPI->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_deviceAPI->errorMessage());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_lastEngineState = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -18,15 +18,15 @@
|
|||||||
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTGUI_H_
|
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTGUI_H_
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "plugin/plugingui.h"
|
|
||||||
|
|
||||||
|
#include "plugin/plugingui.h"
|
||||||
#include "limesdrinput.h"
|
#include "limesdrinput.h"
|
||||||
|
|
||||||
class DeviceSourceAPI;
|
class DeviceSourceAPI;
|
||||||
class FileRecord;
|
class FileRecord;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class LimeSDRInputGui;
|
class LimeSDRInputGUI;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LimeSDRInputGUI : public QWidget, public PluginGUI {
|
class LimeSDRInputGUI : public QWidget, public PluginGUI {
|
||||||
@ -48,7 +48,7 @@ public:
|
|||||||
virtual bool handleMessage(const Message& message);
|
virtual bool handleMessage(const Message& message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::LimeSDRInputGui* ui;
|
Ui::LimeSDRInputGUI* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
DeviceSourceAPI* m_deviceAPI;
|
||||||
LimeSDRInput* m_limeSDRInput; //!< Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively
|
LimeSDRInput* m_limeSDRInput; //!< Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively
|
||||||
@ -66,7 +66,7 @@ private:
|
|||||||
void updateSampleRateAndFrequency();
|
void updateSampleRateAndFrequency();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleDSPMessages();
|
void handleMessagesToUI();
|
||||||
|
|
||||||
void on_startStop_toggled(bool checked);
|
void on_startStop_toggled(bool checked);
|
||||||
void on_record_toggled(bool checked);
|
void on_record_toggled(bool checked);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>LimeSDRInputGui</class>
|
<class>LimeSDRInputGUI</class>
|
||||||
<widget class="QWidget" name="LimeSDRInputGui">
|
<widget class="QWidget" name="LimeSDRInputGUI">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@ -168,6 +168,25 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="channelNumberText">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Channel number</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>#0</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -95,7 +95,7 @@ PluginGUI* LimeSDRInputPlugin::createSampleSourcePluginGUI(const QString& source
|
|||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
LimeSDRInputGui* gui = new LimeSDRInputGui(deviceAPI);
|
LimeSDRInputGUI* gui = new LimeSDRInputGUI(deviceAPI);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "util/simpleserializer.h"
|
||||||
#include "limesdrinputsettings.h"
|
#include "limesdrinputsettings.h"
|
||||||
|
|
||||||
LimeSDRInputSettings::LimeSDRInputSettings()
|
LimeSDRInputSettings::LimeSDRInputSettings()
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#ifndef PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTSETTINGS_H_
|
#ifndef PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTSETTINGS_H_
|
||||||
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTSETTINGS_H_
|
#define PLUGINS_SAMPLESOURCE_LIMESDRINPUT_LIMESDRINPUTSETTINGS_H_
|
||||||
|
|
||||||
|
#include <QByteArray>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,8 +33,8 @@ struct LimeSDRInputSettings
|
|||||||
} fcPos_t;
|
} fcPos_t;
|
||||||
|
|
||||||
// global settings to be saved
|
// global settings to be saved
|
||||||
quint64 m_centerFrequency;
|
uint64_t m_centerFrequency;
|
||||||
qint32 m_devSampleRate;
|
int m_devSampleRate;
|
||||||
uint32_t m_log2HardDecim;
|
uint32_t m_log2HardDecim;
|
||||||
// channel settings
|
// channel settings
|
||||||
bool m_dcBlock;
|
bool m_dcBlock;
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "limesdrinputthread.h"
|
#include "limesdrinputthread.h"
|
||||||
|
|
||||||
LimeSDRInputThread::LimeSDRInputThread(lms_stream_t* stream, SampleSinkFifo* sampleFifo, QObject* parent) :
|
LimeSDRInputThread::LimeSDRInputThread(lms_stream_t* stream, SampleSinkFifo* sampleFifo, QObject* parent) :
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QWaitCondition>
|
#include <QWaitCondition>
|
||||||
|
|
||||||
|
#include "lime/LimeSuite.h"
|
||||||
|
|
||||||
#include "dsp/samplesinkfifo.h"
|
#include "dsp/samplesinkfifo.h"
|
||||||
#include "dsp/decimators.h"
|
#include "dsp/decimators.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user