1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Server: added PlutoSDR input plugin

This commit is contained in:
f4exb 2018-05-29 20:27:36 +02:00
parent 362e8a629d
commit 3e31a8b23b
6 changed files with 91 additions and 4 deletions

View File

@ -24,6 +24,7 @@
#include <dsp/devicesamplesource.h>
#include "util/message.h"
#include "plutosdr/deviceplutosdrshared.h"
#include "plutosdr/deviceplutosdrbox.h"
#include "plutosdrinputsettings.h"
class DeviceSourceAPI;

View File

@ -17,13 +17,14 @@
#ifndef PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTGUI_H_
#define PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTGUI_H_
#include <plugin/plugininstancegui.h>
#include <QObject>
#include <QWidget>
#include <QTimer>
#include "util/messagequeue.h"
#include "plugin/plugininstancegui.h"
#include "plutosdrinput.h"
#include "plutosdrinputsettings.h"
class DeviceSampleSource;

View File

@ -15,20 +15,22 @@
///////////////////////////////////////////////////////////////////////////////////
#include <QtPlugin>
#include <QAction>
#include "plugin/pluginapi.h"
#include "plutosdr/deviceplutosdr.h"
#include "plutosdrinputgui.h"
#ifdef SERVER_MODE
#include "plutosdrinput.h"
#else
#include "plutosdrinputgui.h"
#endif
#include "plutosdrinputplugin.h"
class DeviceSourceAPI;
const PluginDescriptor PlutoSDRInputPlugin::m_pluginDescriptor = {
QString("PlutoSDR Input"),
QString("3.14.6"),
QString("4.0.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
@ -85,6 +87,15 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
return result;
}
#ifdef SERVER_MODE
PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{
return 0;
}
#else
PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
@ -101,6 +112,7 @@ PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
return 0;
}
}
#endif
DeviceSampleSource *PlutoSDRInputPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
{

View File

@ -53,6 +53,11 @@ if(LIBUSB_FOUND AND RX_SAMPLE_24BIT AND LIBPERSEUS_FOUND)
add_subdirectory(perseus)
endif(LIBUSB_FOUND AND RX_SAMPLE_24BIT AND LIBPERSEUS_FOUND)
find_package(LibIIO)
if(LIBUSB_FOUND AND LIBIIO_FOUND)
add_subdirectory(plutosdrinput)
endif(LIBUSB_FOUND AND LIBIIO_FOUND)
find_package(LibRTLSDR)
if(LIBUSB_FOUND AND LIBRTLSDR_FOUND)
add_subdirectory(rtlsdr)
@ -64,6 +69,7 @@ if (BUILD_DEBIAN)
add_subdirectory(hackrfinput)
add_subdirectory(limesdrinput)
add_subdirectory(perseus)
add_subdirectory(plutosdrinput)
add_subdirectory(rtlsdr)
endif (BUILD_DEBIAN)

View File

@ -0,0 +1,66 @@
project(plutosdrinput)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/samplesource/plutosdrinput")
set(plutosdrinput_SOURCES
${PLUGIN_PREFIX}/plutosdrinput.cpp
${PLUGIN_PREFIX}/plutosdrinputplugin.cpp
${PLUGIN_PREFIX}/plutosdrinputsettings.cpp
${PLUGIN_PREFIX}/plutosdrinputthread.cpp
)
set(plutosdrinput_HEADERS
${PLUGIN_PREFIX}/plutosdrinput.h
${PLUGIN_PREFIX}/plutosdrinputplugin.h
${PLUGIN_PREFIX}/plutosdrinputsettings.h
${PLUGIN_PREFIX}/plutosdrinputthread.h
)
if (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBIIOSRC}
)
else (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBIIO_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(inputplutosdrsrv SHARED
${plutosdrinput_SOURCES}
${plutosdrinput_HEADERS_MOC}
)
if (BUILD_DEBIAN)
target_link_libraries(inputplutosdrsrv
${QT_LIBRARIES}
iio
sdrbase
swagger
plutosdrdevice
)
else (BUILD_DEBIAN)
target_link_libraries(inputplutosdrsrv
${QT_LIBRARIES}
${LIBIIO_LIBRARIES}
sdrbase
swagger
plutosdrdevice
)
endif (BUILD_DEBIAN)
qt5_use_modules(inputplutosdrsrv Core)
install(TARGETS inputplutosdrsrv DESTINATION lib/plugins/samplesource)

View File

@ -186,6 +186,7 @@ def setupDevice(deviceset_url, options):
settings['plutoSdrInputSettings']['fcPos'] = options.fc_pos
settings['plutoSdrInputSettings']['dcBlock'] = options.fc_pos == 2
settings['plutoSdrInputSettings']['iqImbalance'] = options.fc_pos == 2
settings['plutoSdrInputSettings']['LOppmTenths'] = int(options.lo_ppm * 10) # in tenths of PPM
elif options.device_hwid == "RTLSDR":
settings['rtlSdrSettings']['devSampleRate'] = options.sample_rate*1000
settings['rtlSdrSettings']['centerFrequency'] = options.device_freq*1000