• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

sensors/gyroscopesensor/gyroscopesensor.h

Go to the documentation of this file.
00001 
00027 #ifndef GYROSCOPE_SENSOR_CHANNEL_H
00028 #define GYROSCOPE_SENSOR_CHANNEL_H
00029 
00030 #include "abstractsensor.h"
00031 #include "deviceadaptor.h"
00032 
00033 #include "gyroscopesensor_a.h"
00034 #include "dataemitter.h"
00035 
00036 #include "datatypes/orientationdata.h"
00037 #include "datatypes/xyz.h"
00038 
00039 class Bin;
00040 template <class TYPE> class BufferReader;
00041 class FilterBase;
00042 
00043 class GyroscopeSensorChannel :
00044         public AbstractSensorChannel,
00045         public DataEmitter<AngularVelocityData>
00046 {
00047     Q_OBJECT;
00048     Q_PROPERTY(XYZ value READ get);
00049 
00050 public:
00055     static AbstractSensorChannel* factoryMethod(const QString& id)
00056     {
00057         GyroscopeSensorChannel* sc = new GyroscopeSensorChannel(id);
00058         new GyroscopeSensorChannelAdaptor(sc);
00059 
00060         return sc;
00061     }
00062 
00063     XYZ get() const { return previousSample_; }
00064 
00065 public Q_SLOTS:
00066     bool start();
00067     bool stop();
00068 
00069 signals:
00070     void dataAvailable(const AngularVelocityData& data);
00071 
00072 protected:
00073     GyroscopeSensorChannel(const QString& id);
00074     ~GyroscopeSensorChannel();
00075 
00076 private:
00077     Bin*                         filterBin_;
00078     Bin*                         marshallingBin_;
00079 
00080     DeviceAdaptor*                     gyroscopeAdaptor_;
00081     BufferReader<AngularVelocityData>* gyroscopeReader_;
00082     RingBuffer<AngularVelocityData>*   outputBuffer_;
00083 
00084     AngularVelocityData                previousSample_;
00085 
00086     void emitData(const AngularVelocityData& value);
00087 };
00088 
00089 #endif // GYROSCOPE_SENSOR_CHANNEL_H

Generated on Mon Jun 27 2011 14:38:47 for sensorfw by  doxygen 1.7.1