LP-106 Setup Wizard refresh : Add dual servo setup (dual aileron or
[librepilot.git] / ground / gcs / src / plugins / setupwizard / pages / surfacepage.cpp
blob405f1a4c9ebacd3b4e85cfc38abb9766abd993c0
1 /**
2 ******************************************************************************
4 * @file surfacepage.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
6 * @addtogroup
7 * @{
8 * @addtogroup SurfacePage
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 "surfacepage.h"
29 #include "setupwizard.h"
31 SurfacePage::SurfacePage(SetupWizard *wizard, QWidget *parent) :
32 SelectionPage(wizard, QString(":/setupwizard/resources/ground-shapes-wizard-no-numbers.svg"), parent)
35 SurfacePage::~SurfacePage()
38 void SurfacePage::initializePage(VehicleConfigurationSource *settings)
40 Q_UNUSED(settings);
43 bool SurfacePage::validatePage(SelectionItem *selectedItem)
45 getWizard()->setVehicleSubType((SetupWizard::VEHICLE_SUB_TYPE)selectedItem->id());
46 return true;
49 void SurfacePage::setupSelection(Selection *selection)
51 selection->setTitle(tr("Ground Vehicle Configuration"));
52 selection->setText(tr("This part of the wizard will set up the flight controller for use with a ground "
53 "vehicle utilizing servos. The wizard supports the most common types of ground vehicle, "
54 "other variants can be configured by using custom configuration options in the "
55 "Configuration plugin in the GCS.\n\n"
56 "Please select the type of ground vehicle you want to create a configuration for below:"));
58 selection->addItem(tr("Car"),
59 tr("This setup expects a traditional car with a rear motor and a front streering servo"),
60 "car",
61 SetupWizard::GROUNDVEHICLE_CAR);
63 selection->addItem(tr("Tank"),
64 tr("This setup expects a traditional vehicle using only two motors and differential steering"),
65 "tank",
66 SetupWizard::GROUNDVEHICLE_DIFFERENTIAL);
68 selection->addItem(tr("Motorcycle"),
69 tr("This setup currently expects a motorcyle setup, using one motor and one servo for steering."),
70 "motorbike",
71 SetupWizard::GROUNDVEHICLE_MOTORCYCLE);