MNE-CPP  beta 0.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
newrealtimemultisamplearraywidget.h
1 //=============================================================================================================
36 #ifndef NEWREALTIMEMULTISAMPLEARRAYNEWWIDGET_H
37 #define NEWREALTIMEMULTISAMPLEARRAYNEWWIDGET_H
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "xdisp_global.h"
46 #include "newmeasurementwidget.h"
47 #include "ui_newrealtimemultisamplearraywidget.h"
48 
49 
50 //*************************************************************************************************************
51 //=============================================================================================================
52 // QT INCLUDES
53 //=============================================================================================================
54 
55 #include <QSharedPointer>
56 #include <QSet>
57 #include <QList>
58 #include <QVector>
59 #include <QPainterPath>
60 #include <QMutex>
61 #include <QThread>
62 #include <QTableView>
63 
64 
65 //*************************************************************************************************************
66 //=============================================================================================================
67 // FORWARD DECLARATIONS
68 //=============================================================================================================
69 
70 class QTime;
71 
72 namespace XMEASLIB
73 {
74 class NewRealTimeMultiSampleArray;
75 }
76 
77 
78 //*************************************************************************************************************
79 //=============================================================================================================
80 // DEFINE NAMESPACE XDISPLIB
81 //=============================================================================================================
82 
83 namespace XDISPLIB
84 {
85 
86 //*************************************************************************************************************
87 //=============================================================================================================
88 // FORWARD DECLARATIONS
89 //=============================================================================================================
90 
91 
92 //*************************************************************************************************************
93 //=============================================================================================================
94 // USED NAMESPACES
95 //=============================================================================================================
96 
97 using namespace XMEASLIB;
98 
99 
100 //*************************************************************************************************************
101 //=============================================================================================================
102 // ENUMERATIONS
103 //=============================================================================================================
104 
107 //* Tool enumeration.
108 //*/
109 //enum Tool
110 //{
111 // Freeze = 0, /**< Freezing tool. */
112 // Annotation = 1 /**< Annotation tool. */
113 //};
114 
115 
116 //=============================================================================================================
123 {
124  Q_OBJECT
125 
126 public:
127  //=========================================================================================================
135  NewRealTimeMultiSampleArrayWidget(QSharedPointer<NewRealTimeMultiSampleArray> pRTMSA_New, QSharedPointer<QTime> &pTime, QWidget* parent = 0);
136 
137  //=========================================================================================================
142 
143  //=========================================================================================================
149  virtual void update(XMEASLIB::NewMeasurement::SPtr pMeasurement);
150 
151  //=========================================================================================================
155  virtual void init();
156 
157 protected:
158  //=========================================================================================================
165  virtual void paintEvent( QPaintEvent* event );
166 
167  //=========================================================================================================
173  virtual void resizeEvent(QResizeEvent* event);
174 
175  //=========================================================================================================
182  virtual void keyPressEvent(QKeyEvent * keyEvent);
183 
184  //=========================================================================================================
191  virtual void mousePressEvent(QMouseEvent* mouseEvent);
192 
193  //=========================================================================================================
200  virtual void mouseMoveEvent(QMouseEvent* mouseEvent);
201 
202  //=========================================================================================================
209  virtual void mouseReleaseEvent(QMouseEvent* event);
210 
211  //=========================================================================================================
218  virtual void mouseDoubleClickEvent(QMouseEvent* event);
219 
220  //=========================================================================================================
227  virtual void wheelEvent(QWheelEvent* wheelEvent);
228 
229 private slots:
230 
231  //=========================================================================================================
235  void stopAnnotation();
236 
237  //=========================================================================================================
242  void maxValueChanged(double maxValue);
243 
244  //=========================================================================================================
249  void minValueChanged(double);
250 
251 private:
252  QSharedPointer<NewRealTimeMultiSampleArray> m_pRTMSA_New;
254  void actualize();
258  quint32 m_uiMaxNumChannels;
259  quint32 m_uiNumChannels;
260  quint32 m_uiFirstChannel;
261 
262  QPainterPath m_qPainterPath;
263  QPainterPath m_qPainterPathTest;
264  QVector<QPainterPath> m_qVecPainterPath;
265  QVector<QPolygonF> m_qVecPolygonF; //New
266 
267  QPainterPath m_qPainterPath_Freeze;
268  QPainterPath m_qPainterPath_FreezeTest;
269  QVector<QPainterPath> m_qVecPainterPath_Freeze;
270  QVector<QPolygonF> m_qVecPolygonF_Freeze; //New
271 
272  QMutex m_qMutex;
273  bool m_bMeasurement;
274  bool m_bPosition;
275  bool m_bFrozen;
276  bool m_bScaling;
277  bool m_bToolInUse;
278  QPoint m_qPointMouseStartPosition;
279  QPoint m_qPointMouseEndPosition;
280  float m_fScaleFactor;
281  double m_dMinValue_init;
282  double m_dMaxValue_init;
283  qint32 m_iSamples;
284  qint32 m_iSampleCount;
285  double m_dMiddle;
286  double m_dPosition;
287  double m_dSampleWidth;
288  double m_dPosX;
289  double m_dPosY;
290  bool m_bStartFlag;
291  std::vector<QString> m_vecTool;
292  unsigned char m_ucToolIndex;
293  QSharedPointer<QTimer> m_pTimerToolDisplay;
294  QSharedPointer<QTimer> m_pTimerUpdate;
295  QSharedPointer<QTime> m_pTime;
296  QSharedPointer<QTime> m_pTimeCurrentDisplay;
297  static QList<double> s_listSamplingRates;
298 };
299 
300 } // NAMESPACE
301 
302 #endif // NEWREALTIMEMULTISAMPLEARRAYNEWWIDGET_H
xDisp library export/import macros.
The RealTimeMultiSampleArrayNewWidget class provides a real-time curve display.
Declaration of the MeasurementWidget Class.
#define XDISPSHARED_EXPORT
Definition: xdisp_global.h:55
QSharedPointer< NewMeasurement > SPtr
The MeasurementWidget class is the base class of all measurement widgets.