sensorfw
stabilityfilter.h
Go to the documentation of this file.
1 
25 #ifndef STABILITYFILTER_H
26 #define STABILITYFILTER_H
27 
28 #include "filter.h"
29 
30 #include <ContextProvider>
31 
32 #include <QPair>
33 #include <QTimer>
34 
48 using ContextProvider::Property;
49 
50 class StabilityFilter : public QObject, public Filter<QPair<double, double>, StabilityFilter, QPair<double, double> >
51 {
52  Q_OBJECT
53 
54 public:
55  StabilityFilter(Property* stableProperty, Property* unstableProperty,
56  double lowThreshold, double highThreshold, double hysteresis = 0.0);
57 
58 public Q_SLOTS:
60 
61 private:
62  double lowThreshold;
63  double highThreshold;
64  double hysteresis;
65  Property* stableProperty;
66  Property* unstableProperty;
67  void interpret(unsigned, const QPair<double, double>* data);
68  QTimer timer;
69 
70  int timeout;
71  static const int defaultTimeout;
72 };
73 
74 #endif
Filter for providing the Orientation.IsStable context property.
StabilityFilter(Property *stableProperty, Property *unstableProperty, double lowThreshold, double highThreshold, double hysteresis=0.0)
void timeoutTriggered()