kopia lustrzana https://github.com/f4exb/sdrangel
Massive UI revamping (v7): Make soapy SDR support optional. Fixes #718
rodzic
fcb2906fd4
commit
89196c40b2
|
@ -35,12 +35,14 @@ MainParser::MainParser() :
|
||||||
"FFTW Wisdom file.",
|
"FFTW Wisdom file.",
|
||||||
"file",
|
"file",
|
||||||
""),
|
""),
|
||||||
m_scratchOption("scratch", "Start from scratch (no current config).")
|
m_scratchOption("scratch", "Start from scratch (no current config)."),
|
||||||
|
m_soapyOption("soapy", "Activate Soapy SDR support.")
|
||||||
{
|
{
|
||||||
|
|
||||||
m_serverAddress = ""; // Bind to any address
|
m_serverAddress = ""; // Bind to any address
|
||||||
m_serverPort = 8091;
|
m_serverPort = 8091;
|
||||||
m_scratch = false;
|
m_scratch = false;
|
||||||
|
m_soapy = false;
|
||||||
m_fftwfWindowFileName = "";
|
m_fftwfWindowFileName = "";
|
||||||
|
|
||||||
m_parser.setApplicationDescription("Software Defined Radio application");
|
m_parser.setApplicationDescription("Software Defined Radio application");
|
||||||
|
@ -51,6 +53,7 @@ MainParser::MainParser() :
|
||||||
m_parser.addOption(m_serverPortOption);
|
m_parser.addOption(m_serverPortOption);
|
||||||
m_parser.addOption(m_fftwfWisdomOption);
|
m_parser.addOption(m_fftwfWisdomOption);
|
||||||
m_parser.addOption(m_scratchOption);
|
m_parser.addOption(m_scratchOption);
|
||||||
|
m_parser.addOption(m_soapyOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainParser::~MainParser()
|
MainParser::~MainParser()
|
||||||
|
@ -94,10 +97,11 @@ void MainParser::parse(const QCoreApplication& app)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FFTWF wisdom file
|
// FFTWF wisdom file
|
||||||
|
|
||||||
m_fftwfWindowFileName = m_parser.value(m_fftwfWisdomOption);
|
m_fftwfWindowFileName = m_parser.value(m_fftwfWisdomOption);
|
||||||
|
|
||||||
// Scratch mode
|
// Scratch mode
|
||||||
|
|
||||||
m_scratch = m_parser.isSet(m_scratchOption);
|
m_scratch = m_parser.isSet(m_scratchOption);
|
||||||
|
|
||||||
|
// Soapy SDR support
|
||||||
|
m_soapy = m_parser.isSet(m_soapyOption);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ public:
|
||||||
const QString& getServerAddress() const { return m_serverAddress; }
|
const QString& getServerAddress() const { return m_serverAddress; }
|
||||||
uint16_t getServerPort() const { return m_serverPort; }
|
uint16_t getServerPort() const { return m_serverPort; }
|
||||||
bool getScratch() const { return m_scratch; }
|
bool getScratch() const { return m_scratch; }
|
||||||
|
bool getSoapy() const { return m_soapy; }
|
||||||
const QString& getFFTWFWisdomFileName() const { return m_fftwfWindowFileName; }
|
const QString& getFFTWFWisdomFileName() const { return m_fftwfWindowFileName; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -42,12 +43,14 @@ private:
|
||||||
uint16_t m_serverPort;
|
uint16_t m_serverPort;
|
||||||
QString m_fftwfWindowFileName;
|
QString m_fftwfWindowFileName;
|
||||||
bool m_scratch;
|
bool m_scratch;
|
||||||
|
bool m_soapy;
|
||||||
|
|
||||||
QCommandLineParser m_parser;
|
QCommandLineParser m_parser;
|
||||||
QCommandLineOption m_serverAddressOption;
|
QCommandLineOption m_serverAddressOption;
|
||||||
QCommandLineOption m_serverPortOption;
|
QCommandLineOption m_serverPortOption;
|
||||||
QCommandLineOption m_fftwfWisdomOption;
|
QCommandLineOption m_fftwfWisdomOption;
|
||||||
QCommandLineOption m_scratchOption;
|
QCommandLineOption m_scratchOption;
|
||||||
|
QCommandLineOption m_soapyOption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,8 @@ const QString PluginManager::m_testMIMODeviceTypeID = "sdrangel.samplemimo.testm
|
||||||
|
|
||||||
PluginManager::PluginManager(QObject* parent) :
|
PluginManager::PluginManager(QObject* parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_pluginAPI(this)
|
m_pluginAPI(this),
|
||||||
|
m_enableSoapy(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,6 +217,12 @@ void PluginManager::loadPluginsDir(const QDir& dir)
|
||||||
{
|
{
|
||||||
if (QLibrary::isLibrary(fileName))
|
if (QLibrary::isLibrary(fileName))
|
||||||
{
|
{
|
||||||
|
if (!m_enableSoapy && (fileName.contains("libinputsoapysdr") || (fileName.contains("liboutputsoapysdr"))))
|
||||||
|
{
|
||||||
|
qInfo("PluginManager::loadPluginsDir: Soapy SDR disabled skipping %s", qPrintable(fileName));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
qDebug("PluginManager::loadPluginsDir: fileName: %s", qPrintable(fileName));
|
qDebug("PluginManager::loadPluginsDir: fileName: %s", qPrintable(fileName));
|
||||||
|
|
||||||
QPluginLoader* pluginLoader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
|
QPluginLoader* pluginLoader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
~PluginManager();
|
~PluginManager();
|
||||||
|
|
||||||
PluginAPI *getPluginAPI() { return &m_pluginAPI; }
|
PluginAPI *getPluginAPI() { return &m_pluginAPI; }
|
||||||
|
void setEnableSoapy(bool enableSoapy) { m_enableSoapy = enableSoapy; }
|
||||||
void loadPlugins(const QString& pluginsSubDir);
|
void loadPlugins(const QString& pluginsSubDir);
|
||||||
void loadPluginsPart(const QString& pluginsSubDir);
|
void loadPluginsPart(const QString& pluginsSubDir);
|
||||||
void loadPluginsFinal();
|
void loadPluginsFinal();
|
||||||
|
@ -124,6 +125,7 @@ private:
|
||||||
|
|
||||||
PluginAPI m_pluginAPI;
|
PluginAPI m_pluginAPI;
|
||||||
Plugins m_plugins;
|
Plugins m_plugins;
|
||||||
|
bool m_enableSoapy;
|
||||||
|
|
||||||
PluginAPI::ChannelRegistrations m_rxChannelRegistrations; //!< Channel plugins register here
|
PluginAPI::ChannelRegistrations m_rxChannelRegistrations; //!< Channel plugins register here
|
||||||
PluginAPI::ChannelRegistrations m_txChannelRegistrations; //!< Channel plugins register here
|
PluginAPI::ChannelRegistrations m_txChannelRegistrations; //!< Channel plugins register here
|
||||||
|
|
|
@ -185,6 +185,7 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
|
||||||
|
|
||||||
m_pluginManager = new PluginManager(this);
|
m_pluginManager = new PluginManager(this);
|
||||||
m_mainCore->m_pluginManager = m_pluginManager;
|
m_mainCore->m_pluginManager = m_pluginManager;
|
||||||
|
m_pluginManager->setEnableSoapy(parser.getSoapy());
|
||||||
m_pluginManager->loadPlugins(QString("plugins"));
|
m_pluginManager->loadPlugins(QString("plugins"));
|
||||||
m_pluginManager->loadPluginsNonDiscoverable(m_mainCore->m_settings.getDeviceUserArgs());
|
m_pluginManager->loadPluginsNonDiscoverable(m_mainCore->m_settings.getDeviceUserArgs());
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ MainServer::MainServer(qtwebapp::LoggerWithFile *logger, const MainParser& parse
|
||||||
|
|
||||||
qDebug() << "MainServer::MainServer: load plugins...";
|
qDebug() << "MainServer::MainServer: load plugins...";
|
||||||
m_mainCore->m_pluginManager = new PluginManager(this);
|
m_mainCore->m_pluginManager = new PluginManager(this);
|
||||||
|
m_mainCore->m_pluginManager->setEnableSoapy(parser.getSoapy());
|
||||||
m_mainCore->m_pluginManager->loadPlugins(QString("pluginssrv"));
|
m_mainCore->m_pluginManager->loadPlugins(QString("pluginssrv"));
|
||||||
|
|
||||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection);
|
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection);
|
||||||
|
|
Ładowanie…
Reference in New Issue