MNE-CPP  beta 1.0
cluststcworker.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef CLUSTSTCWORKER_H
37 #define CLUSTSTCWORKER_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // QT INCLUDES
42 //=============================================================================================================
43 
44 #include <QObject>
45 #include <QList>
46 #include <QThread>
47 #include <QSharedPointer>
48 #include <QMutex>
49 
50 
51 //*************************************************************************************************************
52 //=============================================================================================================
53 // Eigen INCLUDES
54 //=============================================================================================================
55 
56 #include <Eigen/Core>
57 
58 
59 //*************************************************************************************************************
60 //=============================================================================================================
61 // DEFINE NAMESPACE DISP3DLIB
62 //=============================================================================================================
63 
64 namespace DISP3DLIB
65 {
66 
67 //*************************************************************************************************************
68 //=============================================================================================================
69 // USED NAMESPACES
70 //=============================================================================================================
71 
72 using namespace Eigen;
73 
74 //=============================================================================================================
80 class ClustStcWorker : public QThread
81 {
82  Q_OBJECT
83 public:
84  typedef QSharedPointer<ClustStcWorker> SPtr;
85  typedef QSharedPointer<const ClustStcWorker> ConstSPtr;
87  ClustStcWorker(QObject *parent = 0);
88 
89  ~ClustStcWorker();
90 
91 // void setIntervall(int intervall);
92 
93  void addData(QList<VectorXd> &data);
94 
95  void clear();
96 
97  void setAverage(qint32 samples);
98 
99  void setInterval(int usec);
100 
101  void setLoop(bool looping);
102 
103  void stop();
104 
105 signals:
106  void stcSample(Eigen::VectorXd sample);
107 
108 protected:
109  virtual void run();
110 
111 private:
112  QMutex m_qMutex;
113  QList<VectorXd> m_data;
115  bool m_bIsRunning;
116  bool m_bIsLooping;
117 
118  qint32 m_iAverageSamples;
119  qint32 m_iCurrentSample;
120  qint32 m_iUSecIntervall;
121 };
122 
123 } // NAMESPACE
124 
125 #endif // CLUSTSTCWORKER_H
QSharedPointer< ClustStcWorker > SPtr
QSharedPointer< const ClustStcWorker > ConstSPtr