diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 52c380a88..52d2f598e 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -636,7 +636,7 @@ void ConfigInputWidget::wizardSetUpStep(enum wizardSteps step) case wizardChooseMode: { wizardUi->wzBack->setEnabled(true); - QRadioButton* modeButtons[] = { + QRadioButton *modeButtons[] = { wizardUi->mode1Button, wizardUi->mode2Button, wizardUi->mode3Button, @@ -755,20 +755,20 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step) } break; case wizardChooseMode: - { - QRadioButton* modeButtons[] = { - wizardUi->mode1Button, - wizardUi->mode2Button, - wizardUi->mode3Button, - wizardUi->mode4Button - }; - for (int i = mode1; i <= mode4; ++i) { - if (modeButtons[i]->isChecked()) { - transmitterMode = static_cast(i); - } + { + QRadioButton *modeButtons[] = { + wizardUi->mode1Button, + wizardUi->mode2Button, + wizardUi->mode3Button, + wizardUi->mode4Button + }; + for (int i = mode1; i <= mode4; ++i) { + if (modeButtons[i]->isChecked()) { + transmitterMode = static_cast(i); } } - break; + } + break; case wizardIdentifySticks: disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(identifyControls())); wizardUi->wzNext->setEnabled(true); @@ -861,7 +861,7 @@ void ConfigInputWidget::setChannel(int newChan) wizardUi->identifyStickInstructions->setText(QString(tr("Please disable throttle hold mode.\n\nMove the Throttle stick."))); } else { wizardUi->identifyStickInstructions->setText(QString(tr("Please move each control one at a time according to the instructions and picture below.\n\n" - "Move the %1 stick.")).arg(manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan))); + "Move the %1 stick.")).arg(manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan))); } if (manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan).contains("Accessory")) { diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.cpp index 1197d279d..6151772b2 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.cpp @@ -46,9 +46,9 @@ bool EscPage::validatePage() { if (ui->oneshotESCButton->isChecked()) { getWizard()->setEscType(SetupWizard::ESC_ONESHOT); - }else if (ui->rapidESCButton->isChecked()) { + } else if (ui->rapidESCButton->isChecked()) { getWizard()->setEscType(SetupWizard::ESC_RAPID); - } else if (ui->defaultESCButton->isChecked()){ + } else if (ui->defaultESCButton->isChecked()) { getWizard()->setEscType(SetupWizard::ESC_STANDARD); } @@ -59,7 +59,8 @@ bool EscPage::validatePage() void EscPage::initializePage() { bool enabled = true; - switch(getWizard()->getControllerType()) { + + switch (getWizard()->getControllerType()) { case SetupWizard::CONTROLLER_CC: case SetupWizard::CONTROLLER_CC3D: switch (getWizard()->getVehicleType()) { diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.h index 017c3f27d..f313835bb 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/escpage.h @@ -45,7 +45,6 @@ public: private: Ui::EscPage *ui; - }; #endif // ESCPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index a61dd6a39..57ea9148e 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -373,13 +373,13 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() switch (m_configSource->getEscType()) { case VehicleConfigurationSource::ESC_STANDARD: escFrequence = LEGACY_ESC_FREQUENCY; - bankMode = ActuatorSettings::BANKMODE_PWM; + bankMode = ActuatorSettings::BANKMODE_PWM; break; case VehicleConfigurationSource::ESC_RAPID: escFrequence = RAPID_ESC_FREQUENCY; if ((m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC || m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) && - m_configSource->getInputType() == VehicleConfigurationSource::INPUT_PWM) { + m_configSource->getInputType() == VehicleConfigurationSource::INPUT_PWM) { bankMode = ActuatorSettings::BANKMODE_PWM; } else { bankMode = ActuatorSettings::BANKMODE_PWMSYNC; @@ -387,7 +387,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() break; case VehicleConfigurationSource::ESC_ONESHOT: escFrequence = RAPID_ESC_FREQUENCY; - bankMode = ActuatorSettings::BANKMODE_ONESHOT125; + bankMode = ActuatorSettings::BANKMODE_ONESHOT125; break; default: break; @@ -423,39 +423,39 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) { data.BankUpdateFreq[i] = LEGACY_ESC_FREQUENCY; - data.BankMode[i] = ActuatorSettings::BANKMODE_PWM; + data.BankMode[i] = ActuatorSettings::BANKMODE_PWM; } switch (m_configSource->getVehicleSubType()) { case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y: // Servo always on channel 4 data.BankUpdateFreq[0] = escFrequence; - data.BankMode[0] = bankMode; + data.BankMode[0] = bankMode; if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC || m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) { data.BankUpdateFreq[1] = servoFrequence; - data.BankMode[1] = bankMode; + data.BankMode[1] = bankMode; } else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) { data.BankUpdateFreq[1] = escFrequence; - data.BankMode[1] = bankMode; + data.BankMode[1] = bankMode; data.BankUpdateFreq[2] = servoFrequence; } else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) { data.BankUpdateFreq[1] = escFrequence; - data.BankMode[1] = bankMode; + data.BankMode[1] = bankMode; data.BankUpdateFreq[2] = escFrequence; - data.BankMode[2] = bankMode; + data.BankMode[2] = bankMode; data.BankUpdateFreq[3] = servoFrequence; } break; case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X: case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS: data.BankUpdateFreq[0] = escFrequence; - data.BankMode[0] = bankMode; + data.BankMode[0] = bankMode; data.BankUpdateFreq[1] = escFrequence; - data.BankMode[1] = bankMode; + data.BankMode[1] = bankMode; if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) { data.BankUpdateFreq[2] = escFrequence; - data.BankMode[2] = bankMode; + data.BankMode[2] = bankMode; } break; case VehicleConfigurationSource::MULTI_ROTOR_HEXA: @@ -468,13 +468,13 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS: case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V: data.BankUpdateFreq[0] = escFrequence; - data.BankMode[0] = bankMode; + data.BankMode[0] = bankMode; data.BankUpdateFreq[1] = escFrequence; - data.BankMode[1] = bankMode; + data.BankMode[1] = bankMode; data.BankUpdateFreq[2] = escFrequence; - data.BankMode[2] = bankMode; + data.BankMode[2] = bankMode; data.BankUpdateFreq[3] = escFrequence; - data.BankMode[3] = bankMode; + data.BankMode[3] = bankMode; break; default: break; @@ -499,7 +499,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) { data.BankUpdateFreq[i] = servoFrequence; - data.BankMode[i] = ActuatorSettings::BANKMODE_PWM; + data.BankMode[i] = ActuatorSettings::BANKMODE_PWM; if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) { if (i == 1) { data.BankUpdateFreq[i] = escFrequence;