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
30 #include "mixercurvewidget.h"
31 #include "dblspindelegate.h"
32 #include "uavobjectwidgetutils_global.h"
33 #include "uavobjectwidgetutils/popupwidget.h"
45 class MixerCurve
: public QFrame
{
49 explicit MixerCurve(QWidget
*parent
= 0);
53 /* Enumeration options for ThrottleCurves */
54 typedef enum { MIXERCURVE_THROTTLE
= 0, MIXERCURVE_PITCH
= 1 } MixerCurveType
;
56 void setMixerType(MixerCurveType curveType
);
57 void initCurve(const QList
<double> *points
);
58 QList
<double> getCurve();
59 void initLinearCurve(int numPoints
, double maxValue
= 1, double minValue
= 0);
60 void setCurve(const QList
<double> *points
);
61 void setMin(double value
);
63 void setMax(double value
);
67 double getCurveStep();
68 double setRange(double min
, double max
);
70 void setXAxisLabel(QString label
);
71 void setYAxisLabel(QString label
);
73 MixerCurveWidget
*getCurveWidget()
81 void showEvent(QShowEvent
*event
);
82 void resizeEvent(QResizeEvent
*event
);
88 void UpdateSettingsTable();
91 void SettingsTableChanged();
92 void CurveTypeChanged();
93 void CurveMinChanged(double value
);
94 void CurveMaxChanged(double value
);
98 Ui::MixerCurve
*m_mixerUI
;
99 MixerCurveWidget
*m_curve
;
100 QTableWidget
*m_settings
;
101 MixerCurveType m_curveType
;
102 DoubleSpinDelegate
*m_spinDelegate
;
105 #endif // MIXERCURVE_H