2011-02-25 21:43:58 +01:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file configservowidget.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @addtogroup GCSPlugins GCS Plugins
|
|
|
|
* @{
|
|
|
|
* @addtogroup ConfigPlugin Config Plugin
|
|
|
|
* @{
|
|
|
|
* @brief Servo input/output configuration panel for the config gadget
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2011-03-28 17:39:22 +02:00
|
|
|
#ifndef CONFIGOUTPUTWIDGET_H
|
|
|
|
#define CONFIGOUTPUTWIDGET_H
|
2011-02-25 21:43:58 +01:00
|
|
|
|
2011-03-28 17:39:22 +02:00
|
|
|
#include "ui_output.h"
|
2011-02-25 21:43:58 +01:00
|
|
|
#include "configtaskwidget.h"
|
|
|
|
#include "extensionsystem/pluginmanager.h"
|
|
|
|
#include "uavobjectmanager.h"
|
|
|
|
#include "uavobject.h"
|
2011-05-03 16:50:31 +02:00
|
|
|
#include "uavobjectutilmanager.h"
|
2011-02-25 21:43:58 +01:00
|
|
|
#include <QtGui/QWidget>
|
|
|
|
#include <QList>
|
|
|
|
|
2011-03-28 17:39:22 +02:00
|
|
|
class Ui_OutputWidget;
|
2011-11-09 19:35:53 +01:00
|
|
|
class OutputChannelForm;
|
2011-02-25 21:43:58 +01:00
|
|
|
|
2011-03-28 17:39:22 +02:00
|
|
|
class ConfigOutputWidget: public ConfigTaskWidget
|
2011-02-25 21:43:58 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2011-03-28 17:39:22 +02:00
|
|
|
ConfigOutputWidget(QWidget *parent = 0);
|
|
|
|
~ConfigOutputWidget();
|
2011-02-25 21:43:58 +01:00
|
|
|
|
|
|
|
private:
|
2011-03-28 17:39:22 +02:00
|
|
|
Ui_OutputWidget *m_config;
|
2011-02-25 21:43:58 +01:00
|
|
|
|
|
|
|
QList<QSlider> sliders;
|
|
|
|
|
2011-02-28 17:44:04 +01:00
|
|
|
void updateChannelInSlider(QSlider *slider, QLabel *min, QLabel *max, QCheckBox *rev, int value);
|
2011-02-25 21:43:58 +01:00
|
|
|
|
|
|
|
void assignChannel(UAVDataObject *obj, QString str);
|
|
|
|
void assignOutputChannel(UAVDataObject *obj, QString str);
|
2011-11-09 19:35:53 +01:00
|
|
|
OutputChannelForm* getOutputChannelForm(const int index) const;
|
2011-02-25 21:43:58 +01:00
|
|
|
|
|
|
|
int mccDataRate;
|
|
|
|
|
|
|
|
UAVObject::Metadata accInitialData;
|
|
|
|
|
|
|
|
bool firstUpdate;
|
|
|
|
|
2011-10-16 01:57:59 +02:00
|
|
|
bool wasItMe;
|
2011-02-25 21:43:58 +01:00
|
|
|
private slots:
|
2011-10-15 22:16:34 +02:00
|
|
|
void stopTests();
|
2011-10-16 01:57:59 +02:00
|
|
|
void disableIfNotMe(UAVObject *obj);
|
2011-08-02 18:06:17 +02:00
|
|
|
virtual void refreshWidgetsValues();
|
|
|
|
void updateObjectsFromWidgets();
|
2011-02-25 21:43:58 +01:00
|
|
|
void runChannelTests(bool state);
|
2011-11-09 19:35:53 +01:00
|
|
|
void sendChannelTest(int index, int value);
|
|
|
|
void setChOutRange();
|
|
|
|
void reverseChannel(bool state);
|
2011-05-03 07:41:06 +02:00
|
|
|
void setSpinningArmed(bool val);
|
2011-05-31 09:16:01 +02:00
|
|
|
void openHelp();
|
2011-02-25 21:43:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|