LP-454 Add boat to the Vehicle Wizard
[librepilot.git] / ground / gcs / src / plugins / setupwizard / pages / surfacepage.cpp
blobdc5ded76b7cc475a6440895f6a621863599458d7
1 /**
2 ******************************************************************************
4 * @file surfacepage.cpp
5 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
6 * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014.
7 * @addtogroup
8 * @{
9 * @addtogroup SurfacePage
10 * @{
11 * @brief
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "surfacepage.h"
30 #include "setupwizard.h"
32 SurfacePage::SurfacePage(SetupWizard *wizard, QWidget *parent) :
33 SelectionPage(wizard, QString(":/setupwizard/resources/ground-shapes-wizard-no-numbers.svg"), parent)
36 SurfacePage::~SurfacePage()
39 void SurfacePage::initializePage(VehicleConfigurationSource *settings)
41 Q_UNUSED(settings);
44 bool SurfacePage::validatePage(SelectionItem *selectedItem)
46 getWizard()->setVehicleSubType((SetupWizard::VEHICLE_SUB_TYPE)selectedItem->id());
47 return true;
50 void SurfacePage::setupSelection(Selection *selection)
52 selection->setTitle(tr("Ground Vehicle Configuration"));
53 selection->setText(tr("This part of the wizard will set up the flight controller for use with a ground "
54 "vehicle utilizing servos. The wizard supports the most common types of ground vehicle, "
55 "other variants can be configured by using custom configuration options in the "
56 "Configuration plugin in the GCS.\n\n"
57 "Please select the type of ground vehicle you want to create a configuration for below:"));
59 selection->addItem(tr("Car"),
60 tr("This setup expects a traditional car with a rear motor and a front steering servo."),
61 "car",
62 SetupWizard::GROUNDVEHICLE_CAR);
64 selection->addItem(tr("Tank"),
65 tr("This setup expects a traditional vehicle using only two motors and differential steering."),
66 "tank",
67 SetupWizard::GROUNDVEHICLE_DIFFERENTIAL);
69 selection->addItem(tr("Motorcycle"),
70 tr("This setup currently expects a motorcyle setup, using one motor and one servo for steering."),
71 "motorbike",
72 SetupWizard::GROUNDVEHICLE_MOTORCYCLE);
74 selection->addItem(tr("Boat"),
75 tr("This setup currently expects a boat setup, using one motor and one servo for rudder/helm."),
76 "boat",
77 SetupWizard::GROUNDVEHICLE_BOAT);
79 selection->addItem(tr("Boat differential"),
80 tr("This setup expects a boat using only two motors and differential steering."),
81 "boat_diff",
82 SetupWizard::GROUNDVEHICLE_DIFFERENTIAL_BOAT);