LP-106 Setup Wizard refresh : Add dual servo setup (dual aileron or
[librepilot.git] / ground / gcs / src / plugins / setupwizard / pages / airspeedpage.cpp
blob74ae4ef703ef43e99e9234345cabc4dc9db67908
1 /**
2 ******************************************************************************
4 * @file fixedwingpage.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup
7 * @{
8 * @addtogroup FixedWingPage
9 * @{
10 * @brief
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
28 #include "airspeedpage.h"
29 #include "setupwizard.h"
31 AirSpeedPage::AirSpeedPage(SetupWizard *wizard, QWidget *parent) :
32 SelectionPage(wizard, QString(":/setupwizard/resources/sensor-shapes.svg"), parent)
35 AirSpeedPage::~AirSpeedPage()
38 void AirSpeedPage::initializePage(VehicleConfigurationSource *settings)
40 // Enable all
41 setItemDisabled(-1, false);
42 if (settings->getInputType() == VehicleConfigurationSource::INPUT_SBUS ||
43 settings->getInputType() == VehicleConfigurationSource::INPUT_DSM) {
44 // Disable non estimated sensors if ports are taken by receivers
45 setItemDisabled(VehicleConfigurationSource::AIRSPEED_EAGLETREE, true);
46 setItemDisabled(VehicleConfigurationSource::AIRSPEED_MS4525, true);
47 if (getSelectedItem()->id() == VehicleConfigurationSource::AIRSPEED_EAGLETREE ||
48 getSelectedItem()->id() == VehicleConfigurationSource::AIRSPEED_MS4525) {
49 // If previously selected invalid sensor, reset to estimated
50 setSelectedItem(VehicleConfigurationSource::AIRSPEED_ESTIMATE);
55 bool AirSpeedPage::validatePage(SelectionItem *selectedItem)
57 getWizard()->setAirspeedType((SetupWizard::AIRSPEED_TYPE)selectedItem->id());
58 return true;
61 void AirSpeedPage::setupSelection(Selection *selection)
63 selection->setTitle(tr("Airspeed Sensor Selection"));
64 selection->setText(tr("This part of the wizard will help you select and configure a way to obtain "
65 "airspeed data. Current firmware supports three methods to achieve this, one is a "
66 "software estimation technique and the other two utilize hardware sensors.\n\n"
67 "Note: if previously selected input combinations use the Flexi-port for input, "
68 "only estimated airspeed will be available.\n\n"));
69 selection->addItem(tr("Estimated"),
70 tr("This option uses an intelligent estimation algorithm which utilizes the INS/GPS "
71 "to estimate wind speed and subtract it from ground speed obtained from the GPS.\n\n"
72 "This solution is highly accurate in normal level flight with the drawback of being less "
73 "accurate in rapid altitude changes.\n\n"),
74 "estimated-airspeed-sensor",
75 SetupWizard::AIRSPEED_ESTIMATE);
77 selection->addItem(tr("EagleTree"),
78 tr("Select this option to use the Airspeed MicroSensor V3 from EagleTree, this is an accurate "
79 "airspeed sensor that includes on-board Temperature Compensation.\n\n"
80 "Selecting this option will set your board's Flexi-Port in to I2C mode."),
81 "eagletree-speed-sensor",
82 SetupWizard::AIRSPEED_EAGLETREE);
84 selection->addItem(tr("MS4525 Based"),
85 tr("Select this option to use an airspeed sensor based on the MS4525DO pressure transducer "
86 "from Measurement Specialties. This includes the PixHawk sensor and their clones.\n\n"
87 "Selecting this option will set your board's Flexi-Port in to I2C mode."),
88 "ms4525-speed-sensor",
89 SetupWizard::AIRSPEED_MS4525);