Added a hidden command line option to activate MIMO functionality

pull/351/head
f4exb 2019-05-12 10:25:55 +02:00
rodzic a757595ce7
commit b2e35b2d31
6 zmienionych plików z 19 dodań i 1 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -34,14 +34,17 @@ public:
const QString& getServerAddress() const { return m_serverAddress; }
uint16_t getServerPort() const { return m_serverPort; }
bool getMIMOSupport() const { return m_mimoSupport; }
private:
QString m_serverAddress;
uint16_t m_serverPort;
bool m_mimoSupport;
QCommandLineParser m_parser;
QCommandLineOption m_serverAddressOption;
QCommandLineOption m_serverPortOption;
QCommandLineOption m_mimoOption;
};

Wyświetl plik

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

Wyświetl plik

@ -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->start();
m_dspEngine->setMIMOSupport(parser.getMIMOSupport());
qDebug() << "MainCore::MainCore: end";
}