sensorfw: filters/declinationfilter/declinationfilter.h Source File

sensorfw

declinationfilter.h
Go to the documentation of this file.
1
27#ifndef DECLINATIONFILTER_H
28#define DECLINATIONFILTER_H
29
30#include <QObject>
31#include <QAtomicInt>
32#include "datatypes/orientationdata.h"
33#include "filter.h"
34
38 class DeclinationFilter : public QObject, public Filter<CompassData, DeclinationFilter, CompassData>
39{
40 Q_OBJECT;
41 Q_PROPERTY(int declinationCorrection READ declinationCorrection);
42
43public:
48 static FilterBase* factoryMethod()
49 {
50 return new DeclinationFilter();
51 }
52
57 int declinationCorrection();
58
59private:
60 DeclinationFilter();
61
62 void correct(unsigned, const CompassData*);
63
64 void loadSettings();
65
66 CompassData orientation_;
67 QAtomicInt declinationCorrection_;
68 quint64 lastUpdate_;
69 quint64 updateInterval_;
70
71 static const char* declinationKey;
72};
73
74#endif // DECLINATIONFILTER_H
CompassData
Datatype for compass measurements.
Definition: orientationdata.h:112
DeclinationFilter
Filter for calculating declination correction for Compass data.
Definition: declinationfilter.h:39
DeclinationFilter::declinationCorrection
int declinationCorrection
Definition: declinationfilter.h:40
DeclinationFilter::factoryMethod
static FilterBase * factoryMethod()
Factory method.
Definition: declinationfilter.h:48
DeclinationFilter::declinationCorrection
int declinationCorrection()
Holds the declination correction amount applied in the calculation.
orientationdata.h
Datatypes for different filters.