we are now able to record bluetooth fingerprints

for this, we use the same ui interface and fingerprint positions as wifi. if wifi has done 30 scans, also the ble
scans will be stopped. this is just a quick and dirte solution, as changing the gui completely for this two options
was to time consuming
This commit is contained in:
mail@toni-fetzer.de
2019-06-06 17:42:11 +02:00
parent 8a1f8430fb
commit ef6066ae14
9 changed files with 420 additions and 293 deletions

View File

@@ -15,8 +15,10 @@
#include "nav/grid/State.h"
#include "nav/mesh/State.h"
#include "../tools/calibration/BLECalibrationDataModel.h"
namespace Floorplan {
class IndoorMap;
class IndoorMap;
}
template <typename T> class Grid;
@@ -30,7 +32,7 @@ class Path2D;
template <typename T> class DijkstraPath;
namespace SMC {
template <typename T> class Particle;
template <typename T> class Particle;
}
class MyState;
@@ -39,73 +41,73 @@ class WiFiCalibrationDataModel;
class MapView2D : public QWidget {
Q_OBJECT
Q_OBJECT
private:
std::vector<Renderable2D*> elementsA;
std::vector<Renderable2D*> elementsB;
std::vector<Renderable2D*> elementsA;
std::vector<Renderable2D*> elementsB;
ColorPoints2D* colorPoints = nullptr;
Path2D* pathToDest = nullptr;
Path2D* pathWalked = nullptr;
WiFiCalibTool* wifiCalib = nullptr;
ColorPoints2D* colorPoints = nullptr;
Path2D* pathToDest = nullptr;
Path2D* pathWalked = nullptr;
WiFiCalibTool* wifiCalib = nullptr;
Scaler2D scaler;
RenderParams2D renderParams;
float layerHeight_m = 0;
Scaler2D scaler;
RenderParams2D renderParams;
float layerHeight_m = 0;
struct Move {
Point2 startCenter_px;
Point2 startMouse_px;
} move;
struct Move {
Point2 startCenter_px;
Point2 startMouse_px;
} move;
QWidget* menu = nullptr;
QSlider* sldLayer = nullptr;
QPushButton* btnColorPoints = nullptr;
QPushButton* btnLayerPlus = nullptr;
QPushButton* btnLayerMinus = nullptr;
QWidget* menu = nullptr;
QSlider* sldLayer = nullptr;
QPushButton* btnColorPoints = nullptr;
QPushButton* btnLayerPlus = nullptr;
QPushButton* btnLayerMinus = nullptr;
public:
explicit MapView2D(QWidget *parent = 0);
explicit MapView2D(QWidget *parent = 0);
/** set the to-be-shown map */
void setMap(WiFiCalibrationDataModel* mdl, Floorplan::IndoorMap* map);
/** set the to-be-shown map */
void setMap(WiFiCalibrationDataModel* wifiMdl, BLECalibrationDataModel* bleMdl, Floorplan::IndoorMap* map);
/** show importance factors for the grid */
void showGridImportance(Grid<MyGridNode>* grid);
/** show importance factors for the grid */
void showGridImportance(Grid<MyGridNode>* grid);
/** set the height-slice to be visible */
void setRenderHeight(const float height_m);
/** set the height-slice to be visible */
void setRenderHeight(const float height_m);
/** set the path to the destination MUST BE CALLED FROM THE MAIN THREAD */
void setPathToDestination(const std::vector<Point3>& path);
/** set the path to the destination MUST BE CALLED FROM THE MAIN THREAD */
void setPathToDestination(const std::vector<Point3>& path);
/** set the path to disply. MUST BE CALLED FROM THE MAIN THREAD */
template <typename Node> void setPathToDestination(const DijkstraPath<Node>* path) {this->pathToDest->set(*path);}
/** set the path to disply. MUST BE CALLED FROM THE MAIN THREAD */
template <typename Node> void setPathToDestination(const DijkstraPath<Node>* path) {this->pathToDest->set(*path);}
/** set the path to disply. MUST BE CALLED FROM THE MAIN THREAD*/
Q_INVOKABLE void setPathToDestination(const void* path) { setPathToDestination( (const DijkstraPath<MyGridNode>*) path); }
/** set the path to disply. MUST BE CALLED FROM THE MAIN THREAD*/
Q_INVOKABLE void setPathToDestination(const void* path) { setPathToDestination( (const DijkstraPath<MyGridNode>*) path); }
/** set the walked path. MUST BE CALLED FROM THE MAIN THREAD */
void setPathWalked(const std::vector<Point3>& path) {this->pathWalked->set(path);}
/** set the walked path. MUST BE CALLED FROM THE MAIN THREAD */
void setPathWalked(const std::vector<Point3>& path) {this->pathWalked->set(path);}
/** set the walked path. MUST BE CALLED FROM THE MAIN THREAD */
Q_INVOKABLE void setPathWalked(const void* path) { this->pathWalked->set( *((const std::vector<Point3>*) path)); }
/** set the walked path. MUST BE CALLED FROM THE MAIN THREAD */
Q_INVOKABLE void setPathWalked(const void* path) { this->pathWalked->set( *((const std::vector<Point3>*) path)); }
/** NOTE: must be called from Qt's main thread! */
Q_INVOKABLE void showParticles(const void* particles) {
/** NOTE: must be called from Qt's main thread! */
Q_INVOKABLE void showParticles(const void* particles) {
showParticles((const std::vector<SMC::Particle<MeshBased::MyState>>*) particles);
}
}
/** NOTE: must be called from Qt's main thread! */
/** NOTE: must be called from Qt's main thread! */
void showParticles(const std::vector<SMC::Particle<GridBased::MyState>>* particles);
@@ -113,31 +115,31 @@ public:
void showParticles(const std::vector<SMC::Particle<MeshBased::MyState>>* particles);
/** set the currently estimated position */
void setCurrentEstimation(const Point3 pos, const Point3 dir);
/** set the currently estimated position */
void setCurrentEstimation(const Point3 pos, const Point3 dir);
signals:
protected slots:
void onLayerSelect();
void onLayerPlus();
void onLayerMinus();
void onLayerSelect();
void onLayerPlus();
void onLayerMinus();
public slots:
void resizeEvent(QResizeEvent*);
void resizeEvent(QResizeEvent*);
void paintEvent(QPaintEvent*);
void paintEvent(QPaintEvent*);
void mousePressEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
void wheelEvent(QWheelEvent*);
void mousePressEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
void wheelEvent(QWheelEvent*);
bool event(QEvent*);
bool gestureEvent(QGestureEvent *event);
bool event(QEvent*);
bool gestureEvent(QGestureEvent *event);
};