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

Massive UI revamping (v7): removed --mimo option and added --scrach option. Fixes #1201

This commit is contained in:
f4exb 2022-04-14 03:49:32 +02:00
parent 3604bf8091
commit ec7a10e662
4 changed files with 26 additions and 25 deletions

View File

@ -34,11 +34,13 @@ MainParser::MainParser() :
m_fftwfWisdomOption(QStringList() << "w" << "fftwf-wisdom",
"FFTW Wisdom file.",
"file",
"")
""),
m_scratchOption("scratch", "Start from scratch (no current config).")
{
m_serverAddress = ""; // Bind to any address
m_serverPort = 8091;
m_mimoSupport = false;
m_scratch = false;
m_fftwfWindowFileName = "";
m_parser.setApplicationDescription("Software Defined Radio application");
@ -48,6 +50,7 @@ MainParser::MainParser() :
m_parser.addOption(m_serverAddressOption);
m_parser.addOption(m_serverPortOption);
m_parser.addOption(m_fftwfWisdomOption);
m_parser.addOption(m_scratchOption);
}
MainParser::~MainParser()
@ -94,18 +97,7 @@ void MainParser::parse(const QCoreApplication& app)
m_fftwfWindowFileName = m_parser.value(m_fftwfWisdomOption);
// MIMO - from version
// Scratch mode
QStringList versionParts = app.applicationVersion().split(".");
if (versionParts.size() > 0)
{
bool ok;
int maj = versionParts.at(0).toInt(&ok);
m_mimoSupport = ok && (maj > 4);
}
else
{
m_mimoSupport = false;
}
m_scratch = m_parser.isSet(m_scratchOption);
}

View File

@ -34,19 +34,20 @@ public:
const QString& getServerAddress() const { return m_serverAddress; }
uint16_t getServerPort() const { return m_serverPort; }
bool getMIMOSupport() const { return m_mimoSupport; }
bool getScratch() const { return m_scratch; }
const QString& getFFTWFWisdomFileName() const { return m_fftwfWindowFileName; }
private:
QString m_serverAddress;
uint16_t m_serverPort;
QString m_fftwfWindowFileName;
bool m_mimoSupport; //!< obtained from major version
bool m_scratch;
QCommandLineParser m_parser;
QCommandLineOption m_serverAddressOption;
QCommandLineOption m_serverPortOption;
QCommandLineOption m_fftwfWisdomOption;
QCommandLineOption m_scratchOption;
};

View File

@ -261,13 +261,21 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
// m_deviceUIs.back()->m_deviceAPI->setBuddyLeader(true); // the first device is always the leader
tabChannelsIndexChanged(); // force channel selection list update
splash->showStatusMessage("load current configuration...", Qt::white);
qDebug() << "MainWindow::MainWindow: load current configuration...";
// loadDeviceSetPresetSettings(m_mainCore->m_settings.getWorkingPreset(), 0);
m_apiAdapter = new WebAPIAdapter();
// loadFeatureSetPresetSettings(m_mainCore->m_settings.getWorkingFeatureSetPreset(), 0);
loadConfiguration(m_mainCore->m_settings.getWorkingConfiguration());
if (!parser.getScratch())
{
splash->showStatusMessage("load current configuration...", Qt::white);
qDebug() << "MainWindow::MainWindow: load current configuration...";
// loadDeviceSetPresetSettings(m_mainCore->m_settings.getWorkingPreset(), 0);
// loadFeatureSetPresetSettings(m_mainCore->m_settings.getWorkingFeatureSetPreset(), 0);
loadConfiguration(m_mainCore->m_settings.getWorkingConfiguration());
}
else
{
qDebug() << "MainWindow::MainWindow: scratch mode: do not load current configuration";
}
// splash->showStatusMessage("update preset controls...", Qt::white);
// qDebug() << "MainWindow::MainWindow: update preset controls...";
@ -304,7 +312,7 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
m_commandKeyReceiver->setRelease(true);
this->installEventFilter(m_commandKeyReceiver);
m_dspEngine->setMIMOSupport(parser.getMIMOSupport());
m_dspEngine->setMIMOSupport(true);
// if (!parser.getMIMOSupport()) {
// ui->menu_Devices->removeAction(ui->action_sampleMIMOAdd);

View File

@ -76,7 +76,7 @@ MainServer::MainServer(qtwebapp::LoggerWithFile *logger, const MainParser& parse
m_apiServer = new WebAPIServer(parser.getServerAddress(), parser.getServerPort(), m_requestMapper);
m_apiServer->start();
m_dspEngine->setMIMOSupport(parser.getMIMOSupport());
m_dspEngine->setMIMOSupport(true);
qDebug() << "MainServer::MainServer: end";
}