dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
expocurve.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef EXPOCURVE_H
29 #define EXPOCURVE_H
30 
31 #include <QWidget>
32 #ifndef QWT_DLL
33 #define QWT_DLL
34 #endif
35 #include "qwt/src/qwt.h"
36 #include "qwt/src/qwt_plot.h"
37 #include "qwt/src/qwt_plot_curve.h"
38 #include "qwt/src/qwt_scale_draw.h"
39 #include "qwt/src/qwt_scale_widget.h"
40 #include "qwt/src/qwt_plot_grid.h"
41 #include "qwt/src/qwt_legend.h"
42 #include "qwt/src/qwt_legend_label.h"
43 #include "qwt/src/qwt_plot_marker.h"
44 #include "qwt/src/qwt_symbol.h"
45 
46 class ExpoCurve : public QwtPlot
47 {
48  Q_OBJECT
49 public:
50  explicit ExpoCurve(QWidget *parent = nullptr);
51 
52  typedef struct ExpoPlotElements
53  {
54  QwtPlotCurve Curve;
56 
57  void init();
58 
60  void plotData(int value, int max, int exponent, ExpoPlotElements_t &plot_elements);
61 
62 public slots:
63 
65  void plotDataRoll(int value, int max, int exponent);
66 
68  void plotDataPitch(int value, int max, int exponent);
69 
71  void plotDataYaw(int value, int max, int exponent);
72 
74  void showCurve(const QVariant &itemInfo, bool on, int index);
75 
76 signals:
77 
78 private:
79  int steps;
80  int curve_cnt;
81  double *x_data;
82  double *y_data;
83 
84  ExpoPlotElements_t roll_elements;
85  ExpoPlotElements_t pitch_elements;
86  ExpoPlotElements_t yaw_elements;
87 };
88 
89 #endif // EXPOCURVE_H
void showCurve(const QVariant &itemInfo, bool on, int index)
Show/Hide a expo curve and markers.
Definition: expocurve.cpp:196
void plotData(int value, int max, int exponent, ExpoPlotElements_t &plot_elements)
Show expo data for one of the stick channels.
Definition: expocurve.cpp:139
void plotDataYaw(int value, int max, int exponent)
Show expo data for yaw.
Definition: expocurve.cpp:183
void plotDataPitch(int value, int max, int exponent)
Show expo data for pitch.
Definition: expocurve.cpp:173
void init()
ExpoCurve(QWidget *parent=nullptr)
Definition: expocurve.cpp:31
struct ExpoCurve::ExpoPlotElements ExpoPlotElements_t
void plotDataRoll(int value, int max, int exponent)
Show expo data for roll.
Definition: expocurve.cpp:163