sensorfw: sensors/contextplugin/stabilityfilter.h Source File

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
48using ContextProvider::Property;
49
50 class StabilityFilter : public QObject, public Filter<QPair<double, double>, StabilityFilter, QPair<double, double> >
51{
52 Q_OBJECT
53
54public:
55 StabilityFilter(Property* stableProperty, Property* unstableProperty,
56 double lowThreshold, double highThreshold, double hysteresis = 0.0);
57
58public Q_SLOTS:
59 void timeoutTriggered();
60
61private:
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
StabilityFilter
Filter for providing the Orientation.IsStable context property.
Definition stabilityfilter.h:51
StabilityFilter::StabilityFilter
StabilityFilter(Property *stableProperty, Property *unstableProperty, double lowThreshold, double highThreshold, double hysteresis=0.0)
StabilityFilter::timeoutTriggered
void timeoutTriggered()