sensorfw
adaptors/magnetometeradaptor/magnetometeradaptor.h
Go to the documentation of this file.
00001 
00028 #ifndef MAGNETOMETERADAPTOR_H
00029 #define MAGNETOMETERADAPTOR_H
00030 
00031 #include "sysfsadaptor.h"
00032 #include "deviceadaptorringbuffer.h"
00033 #include "datatypes/genericdata.h"
00034 #include <QString>
00035 
00042 class MagnetometerAdaptor : public SysfsAdaptor
00043 {
00044     Q_OBJECT;
00045 public:
00046 
00047     Q_PROPERTY(int overflowLimit READ overflowLimit WRITE setOverflowLimit);
00048 
00053     static DeviceAdaptor* factoryMethod(const QString& id)
00054     {
00055         return new MagnetometerAdaptor(id);
00056     }
00057 
00058 protected:
00063     MagnetometerAdaptor(const QString& id);
00064     ~MagnetometerAdaptor();
00065 
00066     bool setInterval(const unsigned int value, const int sessionId);
00067 
00068 private:
00069 
00077     void processSample(int pathId, int fd);
00078 
00084     void setOverflowLimit(int limit);
00085 
00091     int overflowLimit() const;
00092 
00093     DeviceAdaptorRingBuffer<TimedXyzData>* magnetometerBuffer_;
00094     int intervalCompensation_;
00095     int overflowLimit_;
00096 };
00097 
00098 #endif