diff --git a/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp index 720103151..b2ad4f710 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp +++ b/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -2,7 +2,8 @@ ****************************************************************************** * * @file EscCalibrationPage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014. + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016. + * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014. * @addtogroup * @{ * @addtogroup EscCalibrationPage @@ -61,6 +62,11 @@ EscCalibrationPage::~EscCalibrationPage() delete ui; } +void EscCalibrationPage::initializePage() +{ + resetAllSecurityCheckboxes(); +} + bool EscCalibrationPage::validatePage() { return true; @@ -180,9 +186,3 @@ void EscCalibrationPage::securityCheckBoxesToggled() ui->securityCheckBox2->isChecked() && ui->securityCheckBox3->isChecked()); } - - -void EscCalibrationPage::initializePage() -{ - resetAllSecurityCheckboxes(); -} diff --git a/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.h b/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.h index 0d9d9a94a..2dea37163 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.h +++ b/ground/gcs/src/plugins/setupwizard/pages/esccalibrationpage.h @@ -2,7 +2,8 @@ ****************************************************************************** * * @file biascalibrationpage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016. + * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ * @addtogroup BiasCalibrationPage @@ -42,8 +43,8 @@ class EscCalibrationPage : public AbstractWizardPage { public: explicit EscCalibrationPage(SetupWizard *wizard, QWidget *parent = 0); ~EscCalibrationPage(); - bool validatePage(); void initializePage(); + bool validatePage(); private slots: void startButtonClicked(); diff --git a/ground/gcs/src/plugins/setupwizard/pages/escpage.cpp b/ground/gcs/src/plugins/setupwizard/pages/escpage.cpp index 0a9b4b1cf..2bd35b1dd 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/escpage.cpp +++ b/ground/gcs/src/plugins/setupwizard/pages/escpage.cpp @@ -43,6 +43,17 @@ EscPage::~EscPage() delete ui; } +void EscPage::initializePage() +{ + bool enabled = isSynchOrOneShotAvailable(); + + ui->oneshotESCButton->setEnabled(enabled); + if (ui->oneshotESCButton->isChecked() && !enabled) { + ui->oneshotESCButton->setChecked(false); + ui->rapidESCButton->setChecked(true); + } +} + bool EscPage::validatePage() { if (ui->oneshotESCButton->isChecked()) { @@ -60,18 +71,6 @@ bool EscPage::validatePage() return true; } - -void EscPage::initializePage() -{ - bool enabled = isSynchOrOneShotAvailable(); - - ui->oneshotESCButton->setEnabled(enabled); - if (ui->oneshotESCButton->isChecked() && !enabled) { - ui->oneshotESCButton->setChecked(false); - ui->rapidESCButton->setChecked(true); - } -} - bool EscPage::isSynchOrOneShotAvailable() { bool available = true; diff --git a/ground/gcs/src/plugins/setupwizard/pages/escpage.h b/ground/gcs/src/plugins/setupwizard/pages/escpage.h index 093457860..a0e4ec0fb 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/escpage.h +++ b/ground/gcs/src/plugins/setupwizard/pages/escpage.h @@ -40,8 +40,8 @@ class EscPage : public AbstractWizardPage { public: explicit EscPage(SetupWizard *wizard, QWidget *parent = 0); ~EscPage(); - bool validatePage(); void initializePage(); + bool validatePage(); private: Ui::EscPage *ui; diff --git a/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp b/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp index d2117f740..04622de32 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp +++ b/ground/gcs/src/plugins/setupwizard/pages/inputpage.cpp @@ -46,6 +46,17 @@ InputPage::~InputPage() delete ui; } +void InputPage::initializePage() +{ + bool isSparky2 = (getWizard()->getControllerType() == SetupWizard::CONTROLLER_SPARKY2); + + ui->pwmButton->setEnabled(!isSparky2); + if (ui->pwmButton->isChecked() && isSparky2) { + ui->pwmButton->setChecked(false); + ui->ppmButton->setChecked(true); + } +} + bool InputPage::validatePage() { if (ui->pwmButton->isChecked()) { @@ -70,17 +81,6 @@ bool InputPage::validatePage() return true; } -void InputPage::initializePage() -{ - bool isSparky2 = (getWizard()->getControllerType() == SetupWizard::CONTROLLER_SPARKY2); - - ui->pwmButton->setEnabled(!isSparky2); - if (ui->pwmButton->isChecked() && isSparky2) { - ui->pwmButton->setChecked(false); - ui->ppmButton->setChecked(true); - } -} - bool InputPage::restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedType) { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); diff --git a/ground/gcs/src/plugins/setupwizard/pages/inputpage.h b/ground/gcs/src/plugins/setupwizard/pages/inputpage.h index a06bb14f6..2c227e942 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/inputpage.h +++ b/ground/gcs/src/plugins/setupwizard/pages/inputpage.h @@ -40,8 +40,8 @@ class InputPage : public AbstractWizardPage { public: explicit InputPage(SetupWizard *wizard, QWidget *parent = 0); ~InputPage(); - bool validatePage(); void initializePage(); + bool validatePage(); private: bool restartNeeded(VehicleConfigurationSource::INPUT_TYPE selectedType); diff --git a/ground/gcs/src/plugins/setupwizard/pages/summarypage.h b/ground/gcs/src/plugins/setupwizard/pages/summarypage.h index daf5402b1..a27510df7 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/summarypage.h +++ b/ground/gcs/src/plugins/setupwizard/pages/summarypage.h @@ -2,7 +2,8 @@ ****************************************************************************** * * @file summarypage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016. + * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ * @addtogroup SummaryPage @@ -40,8 +41,8 @@ class SummaryPage : public AbstractWizardPage { public: explicit SummaryPage(SetupWizard *wizard, QWidget *parent = 0); ~SummaryPage(); - bool validatePage(); void initializePage(); + bool validatePage(); private: Ui::SummaryPage *ui; diff --git a/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.cpp b/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.cpp index 9a0ba54b2..6ce99f262 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.cpp +++ b/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.cpp @@ -2,7 +2,7 @@ ****************************************************************************** * * @file vehiclepage.cpp - * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015. + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016. * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ @@ -58,10 +58,3 @@ bool VehiclePage::validatePage() } return true; } - -void VehiclePage::initializePage() -{ - // ui->fixedwingButton->setEnabled(getWizard()->getControllerType() == SetupWizard::CONTROLLER_REVO || - // getWizard()->getControllerType() == SetupWizard::CONTROLLER_NANO || - // getWizard()->getControllerType() == SetupWizard::CONTROLLER_SPARKY2); -} diff --git a/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.h b/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.h index 659ac74cd..5235387c9 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.h +++ b/ground/gcs/src/plugins/setupwizard/pages/vehiclepage.h @@ -2,7 +2,8 @@ ****************************************************************************** * * @file vehiclepage.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016. + * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ * @addtogroup VehiclePage @@ -41,7 +42,6 @@ public: explicit VehiclePage(SetupWizard *wizard, QWidget *parent = 0); ~VehiclePage(); bool validatePage(); - void initializePage(); private: Ui::VehiclePage *ui;