Changeset 15 in flair-src for trunk/tools/FlairGCS/src/Scope.h


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (5 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/Scope.h

    r10 r15  
    1414class QMouseEvent;
    1515
    16 class Scope: public QwtPlot {
    17     Q_OBJECT
     16class Scope : public QwtPlot {
     17  Q_OBJECT
    1818
    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);
     19public:
     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);
    2526
    26     protected:
    27         struct Curve {
    28             QwtPlotCurve* plot;
    29             double* data_x;
    30             double* data_y;
    31             unsigned int index;
    32             unsigned int min_index;
    33             unsigned int max_index;
    34         };
    35         QList<Curve*> curves;
    36         float elapsed_time_s;
     27protected:
     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;
    3738
    38         void updateCurve(Curve* curve);
    39         bool eventFilter(QObject *, QEvent *);
     39  void updateCurve(Curve *curve);
     40  bool eventFilter(QObject *, QEvent *);
    4041
    41     private:
    42         float ymin,ymax;
    43         float view_size_s,orig_view_size_s;
    44         unsigned int history_size;
    45         ScrollBar* scrollbar;
    46         bool scrolling;
    47         float min_scroll,max_scroll;
     42private:
     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;
    4849
    49         void alignScales(void);
    50         void showCurve(QwtPlotItem *item, bool on);
    51         void computeMinIndex(Curve* curve,float displayed_min_time);
    52         void computeMaxIndex(Curve* curve,float displayed_max_time);
    53         void changeViewSize(float new_view_size_s);
     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);
    5455
    55     private slots:
    56         void legendChecked(const QVariant &itemInfo, bool on );
    57         void scrollBarMoved(Qt::Orientation o, float min, float max);
     56private slots:
     57  void legendChecked(const QVariant &itemInfo, bool on);
     58  void scrollBarMoved(Qt::Orientation o, float min, float max);
    5859};
    5960
    60 
    6161#endif // SCOPE_H_INCLUDED
Note: See TracChangeset for help on using the changeset viewer.