sensorfw
avgaccfilter.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (C) 2013 Jolla Ltd
4** Contact: lorn.potter@jollamobile.com
5
6 This file is part of Sensord.
7
8 Sensord is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License
10 version 2.1 as published by the Free Software Foundation.
11
12 Sensord is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef ROTATIONFILTER_H
22#define ROTATIONFILTER_H
23
24#include <QObject>
25
26#include "orientationdata.h"
27#include "filter.h"
28
29class AvgAccFilter : public QObject, public Filter<TimedXyzData, AvgAccFilter, TimedXyzData>
30{
31 Q_OBJECT
32
33public:
34 static FilterBase* factoryMethod()
35 {
36 return new AvgAccFilter();
37 }
38
39 void reset();
40 void setFactor(qreal);
41 qreal factor();
42
43private:
44
46
47 void interpret(unsigned, const TimedXyzData*);
48
49 typedef QList<TimedXyzData> XyzAvgAccBuffer;
50
51 TimedXyzData avgAccdata;
52 XyzAvgAccBuffer avgBuffer;
53 unsigned int avgBufferSize;
54 qreal filterFactor;
55
56 qreal averageX;
57 qreal averageY;
58 qreal averageZ;
59
60 QList<TimedXyzData> avgAccelBuffer;
61
62};
63
64#endif // ROTATIONFILTER_H
static FilterBase * factoryMethod()
Definition: avgaccfilter.h:34
qreal factor()
void setFactor(qreal)
Class for vector type measurement data (timestamp, x, y, z).
Definition: genericdata.h:53
Datatypes for different filters.