sensorfw: filters/avgaccfilter/avgaccfilter.h Source File

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
29 class 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
45 AvgAccFilter();
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
AvgAccFilter
Definition: avgaccfilter.h:30
AvgAccFilter::factoryMethod
static FilterBase * factoryMethod()
Definition: avgaccfilter.h:34
AvgAccFilter::factor
qreal factor()
AvgAccFilter::reset
void reset()
AvgAccFilter::setFactor
void setFactor(qreal)
TimedXyzData
Class for vector type measurement data (timestamp, x, y, z).
Definition: genericdata.h:53
orientationdata.h
Datatypes for different filters.