2010-08-20 23:18:20 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file configairframetwidget.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @addtogroup GCSPlugins GCS Plugins
|
|
|
|
* @{
|
|
|
|
* @addtogroup ConfigPlugin Config Plugin
|
|
|
|
* @{
|
|
|
|
* @brief Airframe configuration panel
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
#ifndef CONFIGAIRFRAMEWIDGET_H
|
|
|
|
#define CONFIGAIRFRAMEWIDGET_H
|
|
|
|
|
|
|
|
#include "ui_airframe.h"
|
|
|
|
#include "configtaskwidget.h"
|
|
|
|
#include "extensionsystem/pluginmanager.h"
|
|
|
|
#include "uavobjects/uavobjectmanager.h"
|
|
|
|
#include "uavobjects/uavobject.h"
|
|
|
|
#include <QtGui/QWidget>
|
|
|
|
#include <QList>
|
|
|
|
|
|
|
|
class Ui_Widget;
|
|
|
|
|
|
|
|
class ConfigAirframeWidget: public ConfigTaskWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
ConfigAirframeWidget(QWidget *parent = 0);
|
|
|
|
~ConfigAirframeWidget();
|
|
|
|
|
|
|
|
private:
|
2010-09-24 22:39:37 +02:00
|
|
|
Ui_AircraftWidget *m_aircraft;
|
|
|
|
bool setupFrameFixedWing();
|
2010-09-25 00:16:20 +02:00
|
|
|
bool setupFrameElevon();
|
2010-09-28 20:27:34 +02:00
|
|
|
bool setupFrameVtail();
|
|
|
|
bool setupQuad(bool pLayout);
|
2010-10-10 15:45:10 +02:00
|
|
|
bool setupHexa();
|
|
|
|
bool setupOcto();
|
2010-09-28 20:27:34 +02:00
|
|
|
|
2010-09-24 23:24:42 +02:00
|
|
|
void resetField(UAVObjectField * field);
|
2010-10-01 10:40:46 +02:00
|
|
|
void resetMixer (MixerCurveWidget *mixer, int numElements);
|
2010-09-25 00:16:20 +02:00
|
|
|
void resetActuators();
|
2010-09-28 20:27:34 +02:00
|
|
|
//void setMixerChannel(int channelNumber, bool channelIsMotor, QList<double> vector);
|
|
|
|
void setupQuadMotor(int channel, double roll, double pitch, double yaw);
|
|
|
|
|
2010-09-25 00:16:20 +02:00
|
|
|
QStringList mixerTypes;
|
|
|
|
QStringList mixerVectors;
|
2010-09-28 20:27:34 +02:00
|
|
|
QGraphicsSvgItem *quad;
|
2010-10-13 23:09:53 +02:00
|
|
|
bool ffTuningInProgress;
|
|
|
|
bool ffTuningPhase;
|
|
|
|
UAVObject::Metadata accInitialData;
|
2010-09-24 22:39:37 +02:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void requestAircraftUpdate();
|
|
|
|
void sendAircraftUpdate();
|
|
|
|
void saveAircraftUpdate();
|
|
|
|
void setupAirframeUI(QString type);
|
2010-09-24 23:24:42 +02:00
|
|
|
void toggleAileron2(int index);
|
|
|
|
void toggleElevator2(int index);
|
2010-10-01 09:18:11 +02:00
|
|
|
void switchAirframeType(int index);
|
2010-10-01 10:40:46 +02:00
|
|
|
void resetFwMixer();
|
|
|
|
void resetMrMixer();
|
|
|
|
void updateFwThrottleCurveValue(QList<double> list, double value);
|
|
|
|
void updateMrThrottleCurveValue(QList<double> list, double value);
|
2010-10-13 23:09:53 +02:00
|
|
|
void enableFFTest();
|
2010-08-20 23:18:20 +02:00
|
|
|
|
2010-09-28 20:27:34 +02:00
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *event);
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
|
|
|
2010-08-20 23:18:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONFIGAIRFRAMEWIDGET_H
|