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** 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
22#ifndef MAGCALIBRATIONCHAIN_H
23#define MAGCALIBRATIONCHAIN_H
24
25#include "abstractsensor.h"
26#include "abstractchain.h"
27#include "magcoordinatealignfilter.h"
28#include "deviceadaptor.h"
29#include "bufferreader.h"
30#include "filter.h"
31#include "bin.h"
32
33#include "orientationdata.h"
34#include "timedunsigned.h"
35
36/*
37 * // property
38 *
39 * //// MagCalibrationChain
40 * calibratedmagnetometerdata
41 * resetCalibration
42 **/
43class Bin;
44template <class TYPE> class BufferReader;
45class FilterBase;
46
50 class MagCalibrationChain : public AbstractChain
51{
52 Q_OBJECT
53
54public:
59 static AbstractChain *factoryMethod(const QString& id)
60 {
61 MagCalibrationChain *sc = new MagCalibrationChain(id);
62 return sc;
63 }
64
65public Q_SLOTS:
66 bool start();
67 bool stop();
68 void resetCalibration();
69
70protected:
71 MagCalibrationChain(const QString& id);
72 ~MagCalibrationChain();
73
74private:
75 bool setMatrixFromString(const QString& str);
76 double aconv_[3][3];
77
78 Bin* filterBin;
79 DeviceAdaptor *magAdaptor;
80
81 BufferReader<CalibratedMagneticFieldData> *magReader; //pusher/producer
82
83 FilterBase *magCalFilter;
84 FilterBase *magScaleFilter;
85
86 FilterBase *magCoordinateAlignFilter_;
87 RingBuffer<CalibratedMagneticFieldData> *calibratedMagnetometerData; //consumer
88 bool needsCalibration;
89};
90
91#endif // MAGCALIBRATIONCHAIN_H
BufferReader
Definition: accelerometersensor.h:38
MagCalibrationChain
MagCalibrationChain.
Definition: magcalibrationchain.h:51
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:59
MagCalibrationChain::start
bool start()
magcoordinatealignfilter.h
MagCoordinateAlignFilter.
orientationdata.h
Datatypes for different filters.
timedunsigned.h
Datatype for unsigned values.