sensorfw
|
00001 00025 #ifndef STABILITYFILTER_H 00026 #define STABILITYFILTER_H 00027 00028 #include "filter.h" 00029 00030 #include <ContextProvider> 00031 00032 #include <QPair> 00033 #include <QTimer> 00034 00048 using ContextProvider::Property; 00049 00050 class StabilityFilter : public QObject, public Filter<QPair<double, double>, StabilityFilter, QPair<double, double> > 00051 { 00052 Q_OBJECT 00053 00054 public: 00055 StabilityFilter(Property* stableProperty, Property* unstableProperty, 00056 double lowThreshold, double highThreshold, double hysteresis = 0.0); 00057 00058 public Q_SLOTS: 00059 void timeoutTriggered(); 00060 00061 private: 00062 double lowThreshold; 00063 double highThreshold; 00064 double hysteresis; 00065 Property* stableProperty; 00066 Property* unstableProperty; 00067 void interpret(unsigned, const QPair<double, double>* data); 00068 QTimer timer; 00069 00070 int timeout; 00071 static const int defaultTimeout; 00072 }; 00073 00074 #endif