1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-09 20:46:07 +01:00
LibrePilot/ground/openpilotgcs/src/plugins/config/configrevowidget.h

118 lines
3.4 KiB
C
Raw Normal View History

2011-12-24 20:57:10 +01:00
/**
******************************************************************************
*
* @file configahrstwidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
* @{
* @brief Telemetry 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 CONFIGREVOWIDGET_H
#define CONFIGREVOWIDGET_H
#include "ui_revosensors.h"
#include "configtaskwidget.h"
2012-02-05 19:16:38 +01:00
#include "../uavobjectwidgetutils/configtaskwidget.h"
2011-12-24 20:57:10 +01:00
#include "extensionsystem/pluginmanager.h"
#include "uavobjectmanager.h"
#include "uavobject.h"
#include <QtGui/QWidget>
#include <QtSvg/QSvgRenderer>
#include <QtSvg/QGraphicsSvgItem>
#include <QList>
#include <QTimer>
#include <QMutex>
class Ui_Widget;
2011-12-24 20:57:10 +01:00
class ConfigRevoWidget: public ConfigTaskWidget
{
Q_OBJECT
public:
ConfigRevoWidget(QWidget *parent = 0);
~ConfigRevoWidget();
private:
void drawVariancesGraph();
void displayPlane(QString elementID);
Ui_RevoSensorsWidget *m_ui;
QGraphicsSvgItem *paperplane;
QGraphicsSvgItem *sensorsBargraph;
2011-12-24 20:57:10 +01:00
QGraphicsSvgItem *accel_x;
QGraphicsSvgItem *accel_y;
QGraphicsSvgItem *accel_z;
QGraphicsSvgItem *gyro_x;
QGraphicsSvgItem *gyro_y;
QGraphicsSvgItem *gyro_z;
QGraphicsSvgItem *mag_x;
QGraphicsSvgItem *mag_y;
QGraphicsSvgItem *mag_z;
QMutex sensorsUpdateLock;
2011-12-24 20:57:10 +01:00
double maxBarHeight;
int phaseCounter;
int progressBarIndex;
QTimer progressBarTimer;
const static double maxVarValue;
const static int calibrationDelay = 10;
bool collectingData;
QList<double> gyro_accum_x;
QList<double> gyro_accum_y;
QList<double> gyro_accum_z;
QList<double> accel_accum_x;
QList<double> accel_accum_y;
QList<double> accel_accum_z;
QList<double> mag_accum_x;
QList<double> mag_accum_y;
QList<double> mag_accum_z;
double accel_data_x[6], accel_data_y[6], accel_data_z[6];
double mag_data_x[6], mag_data_y[6], mag_data_z[6];
2011-12-24 20:57:10 +01:00
UAVObject::Metadata initialAccelsMdata;
UAVObject::Metadata initialGyrosMdata;
UAVObject::Metadata initialMagMdata;
UAVObject::Metadata initialBaroMdata;
int position;
2011-12-24 20:57:10 +01:00
private slots:
void launchAccelBiasCalibration();
void incrementProgress();
virtual void refreshWidgetsValues(UAVObject * obj=NULL);
2011-12-24 20:57:10 +01:00
void savePositionData();
void computeScaleBias();
void sixPointCalibrationMode();
void sensorsUpdated(UAVObject * obj);
void doGetAccelBiasData(UAVObject*);
2011-12-24 20:57:10 +01:00
protected:
void showEvent(QShowEvent *event);
void resizeEvent(QResizeEvent *event);
};
#endif // ConfigRevoWidget_H