sensorfw: chains/magcalibrationchain/magcalibrationchain.h Source File

sensorfw

magcalibrationchain.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (C) 2013 Jolla Ltd
4
5 This file is part of Sensord.
6
7 Sensord is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License
9 version 2.1 as published by the Free Software Foundation.
10
11 Sensord is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with Sensord. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21#ifndef MAGCALIBRATIONCHAIN_H
22#define MAGCALIBRATIONCHAIN_H
23
24#include "abstractsensor.h"
25#include "abstractchain.h"
26#include "magcoordinatealignfilter.h"
27#include "deviceadaptor.h"
28#include "bufferreader.h"
29#include "filter.h"
30#include "bin.h"
31
32#include "orientationdata.h"
33#include "timedunsigned.h"
34
35/*
36 * // property
37 *
38 * //// MagCalibrationChain
39 * calibratedmagnetometerdata
40 * resetCalibration
41 **/
42class Bin;
43template <class TYPE> class BufferReader;
44class FilterBase;
45
49 class MagCalibrationChain : public AbstractChain
50{
51 Q_OBJECT
52
53public:
58 static AbstractChain *factoryMethod(const QString& id)
59 {
60 MagCalibrationChain *sc = new MagCalibrationChain(id);
61 return sc;
62 }
63
64public Q_SLOTS:
65 bool start();
66 bool stop();
67 void resetCalibration();
68
69protected:
70 MagCalibrationChain(const QString& id);
71 ~MagCalibrationChain();
72
73private:
74 bool setMatrixFromString(const QString& str);
75 double aconv_[3][3];
76
77 Bin* filterBin;
78 DeviceAdaptor *magAdaptor;
79
80 BufferReader<CalibratedMagneticFieldData> *magReader; //pusher/producer
81
82 FilterBase *magCalFilter;
83 FilterBase *magScaleFilter;
84
85 FilterBase *magCoordinateAlignFilter_;
86 RingBuffer<CalibratedMagneticFieldData> *calibratedMagnetometerData; //consumer
87 bool needsCalibration;
88};
89
90#endif // MAGCALIBRATIONCHAIN_H
BufferReader
Definition accelerometersensor.h:38
MagCalibrationChain
MagCalibrationChain.
Definition magcalibrationchain.h:50
MagCalibrationChain::resetCalibration
void resetCalibration()
MagCalibrationChain::MagCalibrationChain
MagCalibrationChain(const QString &id)
MagCalibrationChain::stop
bool stop()
MagCalibrationChain::~MagCalibrationChain
~MagCalibrationChain()
MagCalibrationChain::factoryMethod
static AbstractChain * factoryMethod(const QString &id)
Factory method for MagCalibrationChain.
Definition magcalibrationchain.h:58
MagCalibrationChain::start
bool start()
magcoordinatealignfilter.h
MagCoordinateAlignFilter.
orientationdata.h
Datatypes for different filters.
timedunsigned.h
Datatype for unsigned values.