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

84 lines
2.5 KiB
C
Raw Normal View History

/**
******************************************************************************
*
* @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 CONFIGAHRSWIDGET_H
#define CONFIGAHRSWIDGET_H
#include "ui_ahrs.h"
#include "configtaskwidget.h"
#include "extensionsystem/pluginmanager.h"
#include "uavobjects/uavobjectmanager.h"
#include "uavobjects/uavobject.h"
#include <QtGui/QWidget>
#include <QtSvg/QSvgRenderer>
#include <QtSvg/QGraphicsSvgItem>
#include <QList>
#include <QTimer>
class ConfigAHRSWidget: public ConfigTaskWidget
{
Q_OBJECT
public:
ConfigAHRSWidget(QWidget *parent = 0);
~ConfigAHRSWidget();
private:
void drawVariancesGraph();
Ui_AHRSWidget *m_ahrs;
QGraphicsSvgItem *ahrsbargraph;
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;
double maxBarHeight;
int phaseCounter;
int progressBarIndex;
QTimer progressBarTimer;
const static double maxVarValue;
private slots:
void launchAHRSCalibration();
void saveAHRSCalibration();
void calibPhase2();
void incrementProgress();
void ahrsSettingsRequest();
void ahrsSettingsSaveRAM();
void ahrsSettingsSaveSD();
protected:
void showEvent(QShowEvent *event);
};
#endif // ConfigAHRSWidget_H