refactoring to add nav mesh

This commit is contained in:
k-a-z-u
2018-07-11 19:04:42 +02:00
parent bb974d3871
commit b4a1a3d969
27 changed files with 1581 additions and 712 deletions

View File

@@ -6,6 +6,7 @@
#include <Indoor/sensors/radio/VAPGrouper.h>
#include <QFile>
#include <QDir>
namespace Settings {
@@ -80,11 +81,22 @@ namespace Settings {
// qDebug(folder.c_str());
// return folder;
//return "/storage/sdcard1/YASMIN/";
const std::string f1 = "/storage/sdcard1/YASMIN/";
const std::string f2 = "/sdcard/YASMIN/";
if (QFile(f1.c_str()).exists()) {return f1;}
if (QFile(f2.c_str()).exists()) {return f2;}
throw Exception("data folder missing. one of those:\n" + f1 + "\n" + f2);
//const std::string f1 = "/storage/sdcard1/YASMIN/";
//const std::string f2 = "/sdcard/YASMIN/";
//if (QFile(f1.c_str()).exists()) {return f1;}
//if (QFile(f2.c_str()).exists()) {return f2;}
std::string tried;
QDir dStorage("/storage");
QStringList lst = dStorage.entryList();
lst.append("/sdcard/YASMIN/");
// try each potential folder
for (const QString subfolder : lst) {
QString path = dStorage.path() + "/" + subfolder + "/YASMIN/";
if (QFile(path).exists()) {return path.toStdString();}
tried += path.toStdString() + "\n";
}
throw Exception("data folder missing. tried:\n" + tried);
#else
//return "/home/toni/Documents/programme/localization/YASMIN/YASMIN_DATA/";
return "/apps/android/workspace/YASMIN_DATA/";