mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-23 20:58:42 -04:00
Massive UI revamping (v7): Make soapy SDR support optional. Fixes #718
This commit is contained in:
parent
fcb2906fd4
commit
89196c40b2
@ -35,12 +35,14 @@ MainParser::MainParser() :
|
||||
"FFTW Wisdom 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_serverPort = 8091;
|
||||
m_scratch = false;
|
||||
m_soapy = false;
|
||||
m_fftwfWindowFileName = "";
|
||||
|
||||
m_parser.setApplicationDescription("Software Defined Radio application");
|
||||
@ -51,6 +53,7 @@ MainParser::MainParser() :
|
||||
m_parser.addOption(m_serverPortOption);
|
||||
m_parser.addOption(m_fftwfWisdomOption);
|
||||
m_parser.addOption(m_scratchOption);
|
||||
m_parser.addOption(m_soapyOption);
|
||||
}
|
||||
|
||||
MainParser::~MainParser()
|
||||
@ -94,10 +97,11 @@ void MainParser::parse(const QCoreApplication& app)
|
||||
}
|
||||
|
||||
// FFTWF wisdom file
|
||||
|
||||
m_fftwfWindowFileName = m_parser.value(m_fftwfWisdomOption);
|
||||
|
||||
// Scratch mode
|
||||
|
||||
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; }
|
||||
uint16_t getServerPort() const { return m_serverPort; }
|
||||
bool getScratch() const { return m_scratch; }
|
||||
bool getSoapy() const { return m_soapy; }
|
||||
const QString& getFFTWFWisdomFileName() const { return m_fftwfWindowFileName; }
|
||||
|
||||
private:
|
||||
@ -42,12 +43,14 @@ private:
|
||||
uint16_t m_serverPort;
|
||||
QString m_fftwfWindowFileName;
|
||||
bool m_scratch;
|
||||
bool m_soapy;
|
||||
|
||||
QCommandLineParser m_parser;
|
||||
QCommandLineOption m_serverAddressOption;
|
||||
QCommandLineOption m_serverPortOption;
|
||||
QCommandLineOption m_fftwfWisdomOption;
|
||||
QCommandLineOption m_scratchOption;
|
||||
QCommandLineOption m_soapyOption;
|
||||
};
|
||||
|
||||
|
||||
|
@ -53,7 +53,8 @@ const QString PluginManager::m_testMIMODeviceTypeID = "sdrangel.samplemimo.testm
|
||||
|
||||
PluginManager::PluginManager(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 (!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));
|
||||
|
||||
QPluginLoader* pluginLoader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
~PluginManager();
|
||||
|
||||
PluginAPI *getPluginAPI() { return &m_pluginAPI; }
|
||||
void setEnableSoapy(bool enableSoapy) { m_enableSoapy = enableSoapy; }
|
||||
void loadPlugins(const QString& pluginsSubDir);
|
||||
void loadPluginsPart(const QString& pluginsSubDir);
|
||||
void loadPluginsFinal();
|
||||
@ -124,6 +125,7 @@ private:
|
||||
|
||||
PluginAPI m_pluginAPI;
|
||||
Plugins m_plugins;
|
||||
bool m_enableSoapy;
|
||||
|
||||
PluginAPI::ChannelRegistrations m_rxChannelRegistrations; //!< 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_mainCore->m_pluginManager = m_pluginManager;
|
||||
m_pluginManager->setEnableSoapy(parser.getSoapy());
|
||||
m_pluginManager->loadPlugins(QString("plugins"));
|
||||
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...";
|
||||
m_mainCore->m_pluginManager = new PluginManager(this);
|
||||
m_mainCore->m_pluginManager->setEnableSoapy(parser.getSoapy());
|
||||
m_mainCore->m_pluginManager->loadPlugins(QString("pluginssrv"));
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection);
|
||||
|
Loading…
Reference in New Issue
Block a user