a lot!!! of changes
added main menu added debug display many debug widgets for plotting live data worked on android live sensors added offline-data sensor feeding some dummy data sensors worked on the map display added ui debug for grid-points, particles and weights added a cool dude to display the estimation added real filtering based on the Indoor components c++11 fixes for android compilation online and offline filtering support new resampling technique for testing map loading via dialog
This commit is contained in:
73
ui/dialog/LoadSetupDialog.cpp
Normal file
73
ui/dialog/LoadSetupDialog.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#include "LoadSetupDialog.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QListView>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QStringListModel>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <Indoor/Assertions.h>
|
||||
|
||||
#include "../Config.h"
|
||||
|
||||
LoadSetupDialog::LoadSetupDialog() {
|
||||
|
||||
// the folder all map-setups reside within
|
||||
const std::string base = Config::getMapDir();
|
||||
QDir mapFolder(QString(base.c_str()));
|
||||
|
||||
// sanity check. folder must exist
|
||||
Assert::isTrue(mapFolder.exists(), "folder not found: " + base);
|
||||
|
||||
// get all subfolders (each subfolder descibres one setup), skip the first two folders: "." and ".."
|
||||
QStringList subfolders = mapFolder.entryList(QDir::Dirs);
|
||||
subfolders.removeFirst();
|
||||
subfolders.removeFirst();
|
||||
// for (int i = 2; i < subfolders.size(); ++i) {
|
||||
// const QString subfolder = subfolders[i];
|
||||
// std::cout << subfolder.toStdString() << std::endl;
|
||||
// }
|
||||
|
||||
int w = 350;
|
||||
int h = 350;
|
||||
|
||||
const QFont font("Arial", 20);
|
||||
|
||||
QListView* lst = new QListView(this);
|
||||
lst->setGeometry(5,5,w-5-5,h-5-5);
|
||||
lst->setFont(font);
|
||||
|
||||
QStringListModel* mdl = new QStringListModel(subfolders);
|
||||
lst->setModel(mdl);
|
||||
|
||||
// list item selected
|
||||
connect(lst, &QListView::clicked, [this, base, subfolders] (const QModelIndex& idx) {
|
||||
const int i = idx.row();
|
||||
selDir = base + subfolders[i].toStdString();
|
||||
this->close();
|
||||
});
|
||||
|
||||
// QPushButton* btnOK = new QPushButton(this);
|
||||
// btnOK->setText("OK");
|
||||
// btnOK->setGeometry(5,h-32-5,w-5-5,32);
|
||||
|
||||
// // OK button clicked
|
||||
// btnOK->connect(btnOK, &QPushButton::clicked, [&] () {
|
||||
// this->close();
|
||||
// });
|
||||
|
||||
this->resize(w,h);
|
||||
|
||||
}
|
||||
|
||||
QDir LoadSetupDialog::pickSetupFolder() {
|
||||
|
||||
|
||||
LoadSetupDialog dlg;
|
||||
dlg.exec();
|
||||
return QDir(QString(dlg.selDir.c_str()));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user