2 ******************************************************************************
4 * @file configoutputwidget.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup ConfigPlugin Config Plugin
10 * @brief Servo output configuration panel for the config gadget
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
27 #ifndef CONFIGOUTPUTWIDGET_H
28 #define CONFIGOUTPUTWIDGET_H
30 #include "cfg_vehicletypes/vehicleconfig.h"
32 #include "../uavobjectwidgetutils/configtaskwidget.h"
33 #include "extensionsystem/pluginmanager.h"
34 #include "uavobjectmanager.h"
35 #include "uavobject.h"
36 #include "uavobjectutilmanager.h"
38 #include "systemalarms.h"
43 class Ui_OutputWidget
;
44 class OutputChannelForm
;
51 class OutputBankControls
{
53 OutputBankControls(MixerSettings
*mixer
, QLabel
*label
, QColor color
, QComboBox
*rateCombo
, QComboBox
*modeCombo
);
54 virtual ~OutputBankControls();
64 QComboBox
*rateCombo() const
68 QComboBox
*modeCombo() const
74 MixerSettings
*m_mixer
;
77 QComboBox
*m_rateCombo
;
78 QComboBox
*m_modeCombo
;
81 class ConfigOutputWidget
: public ConfigTaskWidget
{
85 ConfigOutputWidget(QWidget
*parent
= 0);
86 ~ConfigOutputWidget();
89 void enableControls(bool enable
);
90 void setWarning(QString message
);
92 virtual void refreshWidgetsValuesImpl(UAVObject
*obj
);
93 virtual void updateObjectsFromWidgetsImpl();
96 Ui_OutputWidget
*m_ui
;
97 QList
<QSlider
> m_sliders
;
99 UAVObject::Metadata m_accInitialData
;
100 QList
<OutputBankControls
> m_banks
;
101 QString bank_mode_servo_warning
;
103 OutputChannelForm
*getOutputChannelForm(const int index
) const;
104 void updateChannelInSlider(QSlider
*slider
, QLabel
*min
, QLabel
*max
, QCheckBox
*rev
, int value
);
105 void assignOutputChannel(UAVDataObject
*obj
, QString
&str
);
106 void setColor(QWidget
*widget
, const QColor color
);
107 void sendAllChannelTests();
108 void setChannelLimits(OutputChannelForm
*channelForm
, OutputBankControls
*bankControls
);
111 void updateWarnings(UAVObject
*);
112 void updateSpinStabilizeCheckComboBoxes();
113 void updateAlwaysStabilizeStatus();
115 void runChannelTests(bool state
);
116 void sendChannelTest(int index
, int value
);
117 void onBankTypeChange();
120 #endif // CONFIGOUTPUTWIDGET_H