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

sensors/orientationsensor/orientationsensor.h

Go to the documentation of this file.
00001 
00026 #ifndef ORIENTATION_SENSOR_CHANNEL_H
00027 #define ORIENTATION_SENSOR_CHANNEL_H
00028 
00029 #include "abstractsensor.h"
00030 #include "abstractchain.h"
00031 #include "orientationsensor_a.h"
00032 #include "dataemitter.h"
00033 #include "datatypes/orientationdata.h"
00034 #include "datatypes/posedata.h"
00035 #include "datatypes/unsigned.h"
00036 
00037 class Bin;
00038 template <class TYPE> class BufferReader;
00039 class FilterBase;
00040 
00048 class OrientationSensorChannel :
00049         public AbstractSensorChannel,
00050         public DataEmitter<PoseData>
00051 {
00052     Q_OBJECT;
00053     Q_PROPERTY(Unsigned orientation READ orientation);
00054 
00055 public:
00056 
00061     static AbstractSensorChannel* factoryMethod(const QString& id)
00062     {
00063         OrientationSensorChannel* sc = new OrientationSensorChannel(id);
00064         new OrientationSensorChannelAdaptor(sc);
00065 
00066         return sc;
00067     }
00068 
00073     Unsigned orientation() const
00074     {
00075         TimedUnsigned o = orientationChain_->property("orientation").value<TimedUnsigned>();
00076         return Unsigned(o);
00077     }
00078 
00079 public Q_SLOTS:
00080     bool start();
00081     bool stop();
00082 
00083 signals:
00088     void orientationChanged(const int& orientation);
00089 
00090 protected:
00091     OrientationSensorChannel(const QString& id);
00092     virtual ~OrientationSensorChannel();
00093 
00094 private:
00095     PoseData                         prevOrientation;
00096     Bin*                             filterBin_;
00097     Bin*                             marshallingBin_;
00098 
00099     AbstractChain*                   orientationChain_;
00100 
00101     BufferReader<PoseData>*   orientationReader_;
00102 
00103     RingBuffer<PoseData>*            outputBuffer_;
00104 
00109     void emitData(const PoseData& value);
00110 };
00111 
00112 #endif // ORIENTATION_SENSOR_CHANNEL_H

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