2012-08-01 00:21:15 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
2013-04-29 15:11:24 +02:00
|
|
|
* @file biascalibrationpage.h
|
2012-08-01 00:21:15 +02:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
|
|
|
* @addtogroup
|
|
|
|
* @{
|
2013-04-29 15:11:24 +02:00
|
|
|
* @addtogroup BiasCalibrationPage
|
2012-08-01 00:21:15 +02:00
|
|
|
* @{
|
|
|
|
* @brief
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2013-04-29 15:11:24 +02:00
|
|
|
#ifndef BIASCALIBRATIONPAGE_H
|
|
|
|
#define BIASCALIBRATIONPAGE_H
|
2012-08-01 00:21:15 +02:00
|
|
|
|
|
|
|
#include "abstractwizardpage.h"
|
2013-04-29 15:11:24 +02:00
|
|
|
#include "biascalibrationutil.h"
|
2012-08-01 00:21:15 +02:00
|
|
|
|
|
|
|
namespace Ui {
|
2013-04-29 15:11:24 +02:00
|
|
|
class BiasCalibrationPage;
|
2012-08-01 00:21:15 +02:00
|
|
|
}
|
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
class BiasCalibrationPage : public AbstractWizardPage {
|
2012-08-01 00:21:15 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-04-29 15:11:24 +02:00
|
|
|
explicit BiasCalibrationPage(SetupWizard *wizard, QWidget *parent = 0);
|
|
|
|
~BiasCalibrationPage();
|
2012-08-01 00:21:15 +02:00
|
|
|
bool validatePage();
|
2012-08-03 18:31:47 +02:00
|
|
|
bool isComplete() const;
|
2012-08-02 13:44:14 +02:00
|
|
|
|
|
|
|
private slots:
|
2013-04-16 19:41:13 +02:00
|
|
|
void performCalibration();
|
|
|
|
void calibrationProgress(long current, long total);
|
|
|
|
void calibrationDone(accelGyroBias bias);
|
|
|
|
void calibrationTimeout(QString message);
|
2012-08-01 00:21:15 +02:00
|
|
|
|
|
|
|
private:
|
2012-08-30 22:13:44 +02:00
|
|
|
static const int BIAS_CYCLES = 200;
|
2013-05-19 17:37:30 +03:00
|
|
|
static const int BIAS_RATE = 50;
|
2012-08-02 13:44:14 +02:00
|
|
|
|
2013-04-29 15:11:24 +02:00
|
|
|
Ui::BiasCalibrationPage *ui;
|
|
|
|
BiasCalibrationUtil *m_calibrationUtil;
|
2012-08-02 13:44:14 +02:00
|
|
|
|
2013-04-16 19:41:13 +02:00
|
|
|
void stopCalibration();
|
2012-09-07 07:35:43 +02:00
|
|
|
void enableButtons(bool enable);
|
2012-08-01 00:21:15 +02:00
|
|
|
};
|
|
|
|
|
2013-04-29 15:11:24 +02:00
|
|
|
#endif // BIASCALIBRATIONPAGE_H
|