LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / plugins / config / configrevowidget.h
blob9d826a1aeb1e3231a377840d5441e31fc9edc663
1 /**
2 ******************************************************************************
4 * @file configahrstwidget.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup ConfigPlugin Config Plugin
9 * @{
10 * @brief Telemetry configuration panel
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
21 * for more details.
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 CONFIGREVOWIDGET_H
28 #define CONFIGREVOWIDGET_H
30 #include "configtaskwidget.h"
31 #include "extensionsystem/pluginmanager.h"
32 #include "uavobjectmanager.h"
33 #include "uavobject.h"
35 #include "calibration/thermal/thermalcalibrationmodel.h"
36 #include "calibration/sixpointcalibrationmodel.h"
37 #include "calibration/levelcalibrationmodel.h"
38 #include "calibration/gyrobiascalibrationmodel.h"
40 class Ui_RevoSensorsWidget;
42 class QWidget;
44 class ConfigRevoWidget : public ConfigTaskWidget {
45 Q_OBJECT
47 public:
48 ConfigRevoWidget(QWidget *parent = 0);
49 ~ConfigRevoWidget();
51 private:
52 OpenPilot::SixPointCalibrationModel *m_accelCalibrationModel;
53 OpenPilot::SixPointCalibrationModel *m_magCalibrationModel;
54 OpenPilot::LevelCalibrationModel *m_levelCalibrationModel;
55 OpenPilot::GyroBiasCalibrationModel *m_gyroBiasCalibrationModel;
56 OpenPilot::ThermalCalibrationModel *m_thermalCalibrationModel;
58 Ui_RevoSensorsWidget *m_ui;
60 // Board rotation store/recall for FC and for aux mag
61 qint16 storedBoardRotation[3];
62 qint16 auxMagStoredBoardRotation[3];
63 bool isBoardRotationStored;
65 bool displayMagError;
67 float onboardMagFiltered[3];
68 float auxMagFiltered[3];
69 float magBe[3];
71 int magWarningCount;
72 int magErrorCount;
73 int auxMagWarningCount;
74 int auxMagErrorCount;
76 private slots:
77 void storeAndClearBoardRotation();
78 void recallBoardRotation();
79 void displayVisualHelp(QString elementID);
80 void clearInstructions();
81 void addInstructions(QString text, WizardModel::MessageType type = WizardModel::Info);
82 void displayTemperature(float tempareture);
83 void displayTemperatureGradient(float temparetureGradient);
84 void displayTemperatureRange(float temparetureRange);
86 // ! Overriden method from the configTaskWidget to update UI
87 virtual void refreshWidgetsValues(UAVObject *object = NULL);
88 virtual void updateObjectsFromWidgets();
90 // Slot for clearing home location
91 void clearHomeLocation();
93 void disableAllCalibrations();
94 void enableAllCalibrations();
96 void onBoardAuxMagError();
97 void updateMagStatus();
98 void updateMagBeVector();
99 void updateMagAlarm(float errorMag, float errorAuxMag);
101 float getMagError(float mag[3]);
103 void updateVisualHelp();
104 void openHelp();
106 protected:
107 void showEvent(QShowEvent *event);
108 void resizeEvent(QResizeEvent *event);
111 #endif // ConfigRevoWidget_H