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"
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  **/
42 class Bin;
43 template <class TYPE> class BufferReader;
44 class FilterBase;
45 
49 class MagCalibrationChain : public AbstractChain
50 {
51  Q_OBJECT
52 
53 public:
58  static AbstractChain *factoryMethod(const QString& id)
59  {
61  return sc;
62  }
63 
64 public Q_SLOTS:
65  bool start();
66  bool stop();
68 
69 protected:
70  MagCalibrationChain(const QString& id);
72 
73 private:
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
MagCalibrationChain.
MagCalibrationChain(const QString &id)
static AbstractChain * factoryMethod(const QString &id)
Factory method for MagCalibrationChain.
MagCoordinateAlignFilter.
Datatypes for different filters.
Datatype for unsigned values.