1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-14 20:31:53 -05:00

Added a hidden command line option to activate MIMO functionality

This commit is contained in:
f4exb 2019-05-12 10:25:55 +02:00
parent a757595ce7
commit b2e35b2d31
6 changed files with 19 additions and 1 deletions

View File

@ -31,6 +31,7 @@ DSPEngine::DSPEngine() :
m_audioOutputDeviceIndex(-1) // default device m_audioOutputDeviceIndex(-1) // default device
{ {
m_dvSerialSupport = false; m_dvSerialSupport = false;
m_mimoSupport = false;
m_masterTimer.start(50); m_masterTimer.start(50);
} }

View File

@ -75,6 +75,8 @@ public:
AudioFifo *audioFifo); AudioFifo *audioFifo);
const QTimer& getMasterTimer() const { return m_masterTimer; } const QTimer& getMasterTimer() const { return m_masterTimer; }
void setMIMOSupport(bool mimoSupport) { m_mimoSupport = mimoSupport; }
bool getMIMOSupport() const { return m_mimoSupport; }
private: private:
std::vector<DSPDeviceSourceEngine*> m_deviceSourceEngines; std::vector<DSPDeviceSourceEngine*> m_deviceSourceEngines;
@ -86,6 +88,7 @@ private:
int m_audioOutputDeviceIndex; int m_audioOutputDeviceIndex;
QTimer m_masterTimer; QTimer m_masterTimer;
bool m_dvSerialSupport; bool m_dvSerialSupport;
bool m_mimoSupport;
#ifdef DSD_USE_SERIALDV #ifdef DSD_USE_SERIALDV
DVSerialEngine m_dvSerialEngine; DVSerialEngine m_dvSerialEngine;
#endif #endif

View File

@ -30,10 +30,12 @@ MainParser::MainParser() :
m_serverPortOption(QStringList() << "p" << "api-port", m_serverPortOption(QStringList() << "p" << "api-port",
"Web API server port.", "Web API server port.",
"port", "port",
"8091") "8091"),
m_mimoOption("mimo", "Activate MIMO functionality")
{ {
m_serverAddress = "127.0.0.1"; m_serverAddress = "127.0.0.1";
m_serverPort = 8091; m_serverPort = 8091;
m_mimoOption.setFlags(QCommandLineOption::HiddenFromHelp);
m_parser.setApplicationDescription("Software Defined Radio application"); m_parser.setApplicationDescription("Software Defined Radio application");
m_parser.addHelpOption(); m_parser.addHelpOption();
@ -41,6 +43,7 @@ MainParser::MainParser() :
m_parser.addOption(m_serverAddressOption); m_parser.addOption(m_serverAddressOption);
m_parser.addOption(m_serverPortOption); m_parser.addOption(m_serverPortOption);
m_parser.addOption(m_mimoOption);
} }
MainParser::~MainParser() MainParser::~MainParser()
@ -80,4 +83,8 @@ void MainParser::parse(const QCoreApplication& app)
} else { } else {
qWarning() << "MainParser::parse: server port invalid. Defaulting to " << m_serverPort; qWarning() << "MainParser::parse: server port invalid. Defaulting to " << m_serverPort;
} }
// MIMO
m_mimoSupport = m_parser.isSet(m_mimoOption);
} }

View File

@ -34,14 +34,17 @@ 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 getMIMOSupport() const { return m_mimoSupport; }
private: private:
QString m_serverAddress; QString m_serverAddress;
uint16_t m_serverPort; uint16_t m_serverPort;
bool m_mimoSupport;
QCommandLineParser m_parser; QCommandLineParser m_parser;
QCommandLineOption m_serverAddressOption; QCommandLineOption m_serverAddressOption;
QCommandLineOption m_serverPortOption; QCommandLineOption m_serverPortOption;
QCommandLineOption m_mimoOption;
}; };

View File

@ -215,6 +215,8 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
m_commandKeyReceiver->setRelease(true); m_commandKeyReceiver->setRelease(true);
this->installEventFilter(m_commandKeyReceiver); this->installEventFilter(m_commandKeyReceiver);
m_dspEngine->setMIMOSupport(parser.getMIMOSupport());
qDebug() << "MainWindow::MainWindow: end"; qDebug() << "MainWindow::MainWindow: end";
} }

View File

@ -84,6 +84,8 @@ MainCore::MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, Q
m_apiServer = new WebAPIServer(parser.getServerAddress(), parser.getServerPort(), m_requestMapper); m_apiServer = new WebAPIServer(parser.getServerAddress(), parser.getServerPort(), m_requestMapper);
m_apiServer->start(); m_apiServer->start();
m_dspEngine->setMIMOSupport(parser.getMIMOSupport());
qDebug() << "MainCore::MainCore: end"; qDebug() << "MainCore::MainCore: end";
} }