Changeset 15 in flair-src for trunk/tools/FlairGCS/src/Scope.h
- Timestamp:
- 04/08/16 15:40:57 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/Scope.h
r10 r15 14 14 class QMouseEvent; 15 15 16 class Scope : public QwtPlot {17 16 class Scope : public QwtPlot { 17 Q_OBJECT 18 18 19 public: 20 Scope(QString title,float ymin, float ymax,float view_size_s=20,unsigned int refresh_rate_ms=40,unsigned int history_size=20000); 21 ~Scope(); 22 int addCurve(QPen pen,QString legend); 23 void resetXView(void); 24 void resetYView(void); 19 public: 20 Scope(QString title, float ymin, float ymax, float view_size_s = 20, 21 unsigned int refresh_rate_ms = 40, unsigned int history_size = 20000); 22 ~Scope(); 23 int addCurve(QPen pen, QString legend); 24 void resetXView(void); 25 void resetYView(void); 25 26 26 27 28 QwtPlotCurve*plot;29 double*data_x;30 double*data_y;31 32 33 34 35 QList<Curve*> curves;36 27 protected: 28 struct Curve { 29 QwtPlotCurve *plot; 30 double *data_x; 31 double *data_y; 32 unsigned int index; 33 unsigned int min_index; 34 unsigned int max_index; 35 }; 36 QList<Curve *> curves; 37 float elapsed_time_s; 37 38 38 void updateCurve(Curve*curve);39 39 void updateCurve(Curve *curve); 40 bool eventFilter(QObject *, QEvent *); 40 41 41 42 float ymin,ymax;43 float view_size_s,orig_view_size_s;44 45 ScrollBar*scrollbar;46 47 float min_scroll,max_scroll;42 private: 43 float ymin, ymax; 44 float view_size_s, orig_view_size_s; 45 unsigned int history_size; 46 ScrollBar *scrollbar; 47 bool scrolling; 48 float min_scroll, max_scroll; 48 49 49 50 51 void computeMinIndex(Curve* curve,float displayed_min_time);52 void computeMaxIndex(Curve* curve,float displayed_max_time);53 50 void alignScales(void); 51 void showCurve(QwtPlotItem *item, bool on); 52 void computeMinIndex(Curve *curve, float displayed_min_time); 53 void computeMaxIndex(Curve *curve, float displayed_max_time); 54 void changeViewSize(float new_view_size_s); 54 55 55 56 void legendChecked(const QVariant &itemInfo, bool on);57 56 private slots: 57 void legendChecked(const QVariant &itemInfo, bool on); 58 void scrollBarMoved(Qt::Orientation o, float min, float max); 58 59 }; 59 60 60 61 61 #endif // SCOPE_H_INCLUDED
Note:
See TracChangeset
for help on using the changeset viewer.