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:
@@ -12,36 +12,69 @@
|
||||
#include "dummy/AccelerometerSensorDummy.h"
|
||||
#include "android/AccelerometerSensorAndroid.h"
|
||||
|
||||
#include "GyroscopeSensor.h"
|
||||
#include "android/GyroscopeSensorAndroid.h"
|
||||
#include "dummy/GyroscopeSensorDummy.h"
|
||||
|
||||
#include "BarometerSensor.h"
|
||||
#include "android/BarometerSensorAndroid.h"
|
||||
#include "dummy/BarometerSensorDummy.h"
|
||||
|
||||
#include "StepSensor.h"
|
||||
#include "TurnSensor.h"
|
||||
|
||||
|
||||
|
||||
class SensorFactory {
|
||||
|
||||
private:
|
||||
|
||||
/** this one is a dirty hack, as static class member variables do not work header-only */
|
||||
static SensorFactory** getPtr() {
|
||||
static SensorFactory* ptr = nullptr;
|
||||
return &ptr;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/** set the to-be-used sensor-fatory */
|
||||
static void set(SensorFactory* fac) {
|
||||
Assert::isNull(*getPtr(), "set() was already called. currentely this is not intended");
|
||||
*getPtr() = fac;
|
||||
}
|
||||
|
||||
/** get the currently configured sensory factory */
|
||||
static SensorFactory& get() {
|
||||
Assert::isNotNull(*getPtr(), "call set() first to set an actual factory instance!");
|
||||
return **getPtr();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/** get the WiFi sensor */
|
||||
static WiFiSensor& getWiFi() {
|
||||
#ifdef ANDROID
|
||||
return WiFiSensorAndroid::get();
|
||||
#else
|
||||
return WiFiSensorDummy::get();
|
||||
#endif
|
||||
}
|
||||
virtual WiFiSensor& getWiFi() = 0;
|
||||
|
||||
/** get the Accelerometer sensor */
|
||||
static AccelerometerSensor& getAccelerometer() {
|
||||
#ifdef ANDROID
|
||||
return AccelerometerSensorAndroid::get();
|
||||
#else
|
||||
return AccelerometerSensorDummy::get();
|
||||
#endif
|
||||
}
|
||||
virtual AccelerometerSensor& getAccelerometer() = 0;
|
||||
|
||||
/** get the Gyroscope sensor */
|
||||
virtual GyroscopeSensor& getGyroscope() = 0;
|
||||
|
||||
/** get the Barometer sensor */
|
||||
virtual BarometerSensor& getBarometer() = 0;
|
||||
|
||||
/** get the Step sensor */
|
||||
static StepSensor& getSteps() {
|
||||
StepSensor& getSteps() {
|
||||
static StepSensor steps(getAccelerometer());
|
||||
return steps;
|
||||
}
|
||||
|
||||
/** get the Turn sensor */
|
||||
TurnSensor& getTurns() {
|
||||
static TurnSensor turns(getAccelerometer(), getGyroscope());
|
||||
return turns;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // SENSORFACTORY_H
|
||||
|
||||
Reference in New Issue
Block a user