MNE-CPP  beta 1.0
realtimesamplearraywidget.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef REALTIMESAMPLEARRAYWIDGET_H
37 #define REALTIMESAMPLEARRAYWIDGET_H
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "xdisp_global.h"
46 #include "newmeasurementwidget.h"
47 #include "ui_realtimesamplearraywidget.h"
48 
49 
50 //*************************************************************************************************************
51 //=============================================================================================================
52 // QT INCLUDES
53 //=============================================================================================================
54 
55 #include <QSet>
56 #include <QList>
57 #include <QPainterPath>
58 #include <QMutex>
59 #include <QThread>
60 
61 
62 //*************************************************************************************************************
63 //=============================================================================================================
64 // FORWARD DECLARATIONS
65 //=============================================================================================================
66 
67 class QTime;
68 
69 namespace XMEASLIB
70 {
71 class NewRealTimeSampleArray;
72 }
73 
74 
75 //*************************************************************************************************************
76 //=============================================================================================================
77 // DEFINE NAMESPACE XDISPLIB
78 //=============================================================================================================
79 
80 namespace XDISPLIB
81 {
82 
83 //*************************************************************************************************************
84 //=============================================================================================================
85 // USED NAMESPACES
86 //=============================================================================================================
87 
88 using namespace XMEASLIB;
89 
90 
91 //=============================================================================================================
98 {
99  Q_OBJECT
100 public:
101  //=========================================================================================================
109  RealTimeSampleArrayWidget(QSharedPointer<NewRealTimeSampleArray> &pRTSA, QSharedPointer<QTime> &pTime, QWidget* parent = 0);
110 
111  //=========================================================================================================
116 
117  //=========================================================================================================
123  virtual void update(XMEASLIB::NewMeasurement::SPtr pMeasurement);
124 
125  //=========================================================================================================
129  virtual void init();
130 
131 protected:
132 
133  //=========================================================================================================
140  virtual void paintEvent( QPaintEvent* event );
141 
142  //=========================================================================================================
148  virtual void resizeEvent(QResizeEvent* event);
149 
150  //=========================================================================================================
157  virtual void mousePressEvent(QMouseEvent* mouseEvent);
158 
159  //=========================================================================================================
166  virtual void mouseMoveEvent(QMouseEvent* mouseEvent);
167 
168  //=========================================================================================================
175  virtual void mouseReleaseEvent(QMouseEvent* event);
176 
177  //=========================================================================================================
184  virtual void mouseDoubleClickEvent(QMouseEvent* event);
185 
186  //=========================================================================================================
193  virtual void wheelEvent(QWheelEvent* wheelEvent);
194 
195 private slots:
196  //=========================================================================================================
200  void stopAnnotation();
201 
202  //=========================================================================================================
207  void maxValueChanged(double maxValue);
208 
209  //=========================================================================================================
214  void minValueChanged(double);
215 
216 private:
217  void actualize();
219  QSharedPointer<NewRealTimeSampleArray> m_pRTSA;
220  QPainterPath m_qPainterPath;
221  QPainterPath m_qPainterPath_Freeze;
222  QMutex m_qMutex;
223  bool m_bMeasurement;
224  bool m_bPosition;
225  bool m_bFrozen;
226  bool m_bScaling;
227  bool m_bToolInUse;
228  QPoint m_qPointMouseStartPosition;
229  QPoint m_qPointMouseEndPosition;
230  float m_fScaleFactor;
231  double m_dMinValue_init;
232  double m_dMaxValue_init;
233  double m_dMiddle;
234  double m_dPosition;
235  double m_dSampleWidth;
236  double m_dPosX;
237  double m_dPosY;
238  bool m_bStartFlag;
239  std::vector<QString> m_vecTool;
240  unsigned char m_ucToolIndex;
241  QSharedPointer<QTimer> m_pTimerToolDisplay;
242  QSharedPointer<QTimer> m_pTimerUpdate;
243  QSharedPointer<QTime> m_pTime;
244  QSharedPointer<QTime> m_pTimeCurrentDisplay;
245  static QList<double> s_listSamplingRates;
247 };
248 
249 } // NAMESPACE
250 
251 #endif // REALTIMESAMPLEARRAYWIDGET_H
xDisp library export/import macros.
Declaration of the MeasurementWidget Class.
#define XDISPSHARED_EXPORT
Definition: xdisp_global.h:55
The NewRealTimeSampleArrayWidget class provides a real-time curve display.
QSharedPointer< NewMeasurement > SPtr
The MeasurementWidget class is the base class of all measurement widgets.