2 ******************************************************************************
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup ConfigPlugin Config Plugin
10 * @brief A MixerCurve Gadget used to update settings in the firmware
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #include <QTableWidget>
35 #include "ui_mixercurve.h"
36 #include "mixercurvewidget.h"
37 #include "dblspindelegate.h"
38 #include "uavobjectwidgetutils_global.h"
39 #include "uavobjectwidgetutils/popupwidget.h"
46 class MixerCurve
: public QFrame
{
50 explicit MixerCurve(QWidget
*parent
= 0);
54 /* Enumeration options for ThrottleCurves */
55 typedef enum { MIXERCURVE_THROTTLE
= 0, MIXERCURVE_PITCH
= 1 } MixerCurveType
;
57 void setMixerType(MixerCurveType curveType
);
58 void initCurve(const QList
<double> *points
);
59 QList
<double> getCurve();
60 void initLinearCurve(int numPoints
, double maxValue
= 1, double minValue
= 0);
61 void setCurve(const QList
<double> *points
);
62 void setMin(double value
);
64 void setMax(double value
);
68 double getCurveStep();
69 double setRange(double min
, double max
);
71 void setXAxisLabel(QString label
);
72 void setYAxisLabel(QString label
);
74 MixerCurveWidget
*getCurveWidget()
82 void showEvent(QShowEvent
*event
);
83 void resizeEvent(QResizeEvent
*event
);
89 void UpdateSettingsTable();
92 void SettingsTableChanged();
93 void CurveTypeChanged();
94 void CurveMinChanged(double value
);
95 void CurveMaxChanged(double value
);
99 Ui::MixerCurve
*m_mixerUI
;
100 MixerCurveWidget
*m_curve
;
101 QTableWidget
*m_settings
;
102 MixerCurveType m_curveType
;
103 DoubleSpinDelegate
*m_spinDelegate
;
106 #endif // MIXERCURVE_H