sensorfw: filters/downsamplefilter/downsamplefilter.h Source File

sensorfw

downsamplefilter.h
Go to the documentation of this file.
1
26#ifndef DOWNSAMPLEFILTER_H
27#define DOWNSAMPLEFILTER_H
28
29#include <QList>
30#include <QObject>
31#include "datatypes/orientationdata.h"
32#include "filter.h"
33
41 class DownsampleFilter : public QObject, public Filter<TimedXyzData, DownsampleFilter, TimedXyzData>
42{
43 Q_OBJECT
44 Q_DISABLE_COPY(DownsampleFilter)
45 Q_PROPERTY(unsigned int bufferSize READ bufferSize WRITE setBufferSize)
46 Q_PROPERTY(int timeout READ timeout WRITE setTimeout)
47
48public:
49
55 static FilterBase* factoryMethod() { return new DownsampleFilter; }
56
62 unsigned int bufferSize() const;
63
69 void setBufferSize(unsigned int size);
70
76 int timeout() const;
77
84 void setTimeout(int ms);
85
86protected:
90 DownsampleFilter();
91
92private:
96 void filter(unsigned, const TimedXyzData*);
97
99 typedef QList<TimedXyzData> TimedXyzDownsampleBuffer;
100
101 unsigned int bufferSize_;
102 long timeout_;
103 TimedXyzDownsampleBuffer buffer_;
104};
105
106#endif // DOWNSAMPLEFILTER_H
DownsampleFilter
Downsample filter.
Definition downsamplefilter.h:42
DownsampleFilter::timeout
int timeout() const
Timeout in milliseconds for discarding too old samples from buffer.
DownsampleFilter::timeout
int timeout
Definition downsamplefilter.h:46
DownsampleFilter::setTimeout
void setTimeout(int ms)
Set timeout in milliseconds for discarding too old samples from buffer.
DownsampleFilter::bufferSize
unsigned int bufferSize() const
Buffer size for downsampling.
DownsampleFilter::setBufferSize
void setBufferSize(unsigned int size)
Set buffer size for downsampling.
DownsampleFilter::bufferSize
unsigned int bufferSize
Definition downsamplefilter.h:45
DownsampleFilter::factoryMethod
static FilterBase * factoryMethod()
Factory method.
Definition downsamplefilter.h:55
DownsampleFilter::DownsampleFilter
DownsampleFilter()
Constructor.
TimedXyzData
Class for vector type measurement data (timestamp, x, y, z).
Definition genericdata.h:53
orientationdata.h
Datatypes for different filters.