updated sensors and filter to current code version
removed KLib stuff added new activity filter is uncommand! at the moment, the app is not able to load new maps and breaks using old maps
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
#ifndef BAROMETERACTIVITYSENSOR_H
|
||||
#define BAROMETERACTIVITYSENSOR_H
|
||||
|
||||
#include <Indoor/sensors/pressure/ActivityButterPressure.h>
|
||||
#include <Indoor/sensors/activity/ActivityDetector.h>
|
||||
#include <Indoor/misc/Debug.h>
|
||||
#include "BarometerSensor.h"
|
||||
#include "AccelerometerSensor.h"
|
||||
#include <iostream>
|
||||
|
||||
struct ActivityData {
|
||||
ActivityButterPressure::Activity curActivity;
|
||||
ActivityData(const ActivityButterPressure::Activity act) : curActivity(act) {;}
|
||||
ActivityData() : curActivity(ActivityButterPressure::Activity::STAY) {;}
|
||||
Activity curActivity;
|
||||
ActivityData(const Activity act) : curActivity(act) {;}
|
||||
ActivityData() : curActivity(Activity::STANDING) {;}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ class ActivitySensor :
|
||||
|
||||
private:
|
||||
|
||||
ActivityButterPressure act;
|
||||
ActivityDetector act;
|
||||
ActivityData data;
|
||||
|
||||
BarometerSensor& baro;
|
||||
@@ -60,16 +60,16 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
this->data.curActivity = act.add(ts, data);
|
||||
informListeners(ts, this->data);
|
||||
act.add(ts, data);
|
||||
this->data.curActivity = act.get();
|
||||
|
||||
informListeners(ts, this->data);
|
||||
}
|
||||
|
||||
virtual void onSensorData(Sensor<AccelerometerData>* sensor, const Timestamp ts, const AccelerometerData& data) override {
|
||||
(void) sensor;
|
||||
(void) ts;
|
||||
(void) data;
|
||||
// TODO!
|
||||
|
||||
act.add(ts, data);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "StepSensor.h"
|
||||
#include "TurnSensor.h"
|
||||
//#include "ActivitySensor.h"
|
||||
#include "ActivitySensor.h"
|
||||
|
||||
|
||||
class SensorFactory {
|
||||
@@ -90,11 +90,11 @@ public:
|
||||
return turns;
|
||||
}
|
||||
|
||||
// /** get the Activity sensor */
|
||||
// ActivitySensor& getActivity() {
|
||||
// static ActivitySensor activity(getBarometer(), getAccelerometer());
|
||||
// return activity;
|
||||
// }
|
||||
/** get the Activity sensor */
|
||||
ActivitySensor& getActivity() {
|
||||
static ActivitySensor activity(getBarometer(), getAccelerometer());
|
||||
return activity;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user