1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

OP-1222 Uncrustification.

This commit is contained in:
m_thread 2014-09-02 16:46:40 +02:00
parent af9dd99227
commit 4bf932d36b
5 changed files with 46 additions and 38 deletions

View File

@ -30,12 +30,10 @@
FixedWingPage::FixedWingPage(SetupWizard *wizard, QWidget *parent) :
SelectionPage(wizard, QString(":/setupwizard/resources/fixedwing-shapes-wizard-no-numbers.svg"), parent)
{
}
{}
FixedWingPage::~FixedWingPage()
{
}
{}
bool FixedWingPage::validatePage(SelectionItem *seletedItem)
{
@ -53,19 +51,19 @@ void FixedWingPage::setupSelection(Selection *selection)
"Please select the type of fixed-wing you want to create a configuration for below:"));
selection->addItem(tr("Aileron Dual Servos"),
tr("This setup expects a traditional airframe using two independent aileron servos "
"on their own channel (not connected by Y adapter) plus an elevator and a rudder."),
"on their own channel (not connected by Y adapter) plus an elevator and a rudder."),
"aileron",
SetupWizard::FIXED_WING_DUAL_AILERON);
selection->addItem(tr("Aileron Single Servo"),
tr("This setup expects a traditional airframe using a single alieron servo or two servos "
"connected by a Y adapter plus an elevator and a rudder."),
"connected by a Y adapter plus an elevator and a rudder."),
"aileron-single",
SetupWizard::FIXED_WING_AILERON);
SetupWizard::FIXED_WING_AILERON);
selection->addItem(tr("Elevon"),
tr("This setup currently expects a flying-wing setup, an elevon plus rudder setup is not yet "
"supported. Setup should include only two elevons, and should explicitly not include a rudder."),
"supported. Setup should include only two elevons, and should explicitly not include a rudder."),
"elevon",
SetupWizard::FIXED_WING_ELEVON);
}

View File

@ -38,7 +38,7 @@ public:
~FixedWingPage();
public:
bool validatePage(SelectionItem* seletedItem);
bool validatePage(SelectionItem *seletedItem);
void setupSelection(Selection *selection);
};

View File

@ -30,12 +30,10 @@
MultiPage::MultiPage(SetupWizard *wizard, QWidget *parent) :
SelectionPage(wizard, QString(":/configgadget/images/multirotor-shapes.svg"), parent)
{
}
{}
MultiPage::~MultiPage()
{
}
{}
bool MultiPage::validatePage(SelectionItem *selectedItem)
{
@ -47,31 +45,31 @@ void MultiPage::setupSelection(Selection *selection)
{
selection->setTitle(tr("OpenPilot Multirotor Configuration"));
selection->setText(tr("This part of the wizard will set up the OpenPilot controller for use with a flying platform utilizing multiple rotors. "
"The wizard supports the most common types of multirotors. Other variants of multirotors can be configured by using custom "
"configuration options in the Configuration plugin in the GCS.\n\n"
"Please select the type of multirotor you want to create a configuration for below:"));
"The wizard supports the most common types of multirotors. Other variants of multirotors can be configured by using custom "
"configuration options in the Configuration plugin in the GCS.\n\n"
"Please select the type of multirotor you want to create a configuration for below:"));
selection->addItem(tr("Tricopter"),
tr("The Tricopter uses three motors and one servo. The servo is used to give yaw authority to the rear motor. "
"The front motors are rotating in opposite directions. The Tricopter is known for its sweeping yaw movement and "
"it is very well suited for FPV since the front rotors are spread wide apart."),
"The front motors are rotating in opposite directions. The Tricopter is known for its sweeping yaw movement and "
"it is very well suited for FPV since the front rotors are spread wide apart."),
"tri",
SetupWizard::MULTI_ROTOR_TRI_Y);
selection->addItem(tr("Quadcopter X"),
tr("The X Quadcopter uses four motors and is the most common multi rotor configuration. Two of the motors rotate clockwise "
"and two counter clockwise. The motors positioned diagonal to each other rotate in the same direction. "
"This setup is perfect for sport flying and is also commonly used for FPV platforms."),
"and two counter clockwise. The motors positioned diagonal to each other rotate in the same direction. "
"This setup is perfect for sport flying and is also commonly used for FPV platforms."),
"quad-x",
SetupWizard::MULTI_ROTOR_QUAD_X);
selection->addItem(tr("Quadcopter +"),
tr("The Plus(+) Quadcopter uses four motors and is similar to the X Quadcopter but the forward direction is offset by 45 degrees. "
"The motors front and rear rotate in clockwise and the motors right and left rotate counter-clockwise. "
"This setup was one of the first to be used and is still used for sport flying. This configuration is not that well suited "
"for FPV since the fore rotor tend to be in the way of the camera."),
"quad-plus",
SetupWizard::MULTI_ROTOR_QUAD_PLUS);
tr("The Plus(+) Quadcopter uses four motors and is similar to the X Quadcopter but the forward direction is offset by 45 degrees. "
"The motors front and rear rotate in clockwise and the motors right and left rotate counter-clockwise. "
"This setup was one of the first to be used and is still used for sport flying. This configuration is not that well suited "
"for FPV since the fore rotor tend to be in the way of the camera."),
"quad-plus",
SetupWizard::MULTI_ROTOR_QUAD_PLUS);
selection->addItem(tr("Hexacopter"),
tr("A multirotor with six motors, one motor in front."),

View File

@ -56,10 +56,10 @@ SelectionPage::~SelectionPage()
void SelectionPage::initializePage()
{
//lazy init
// lazy init
if (m_selectionItems.isEmpty()) {
setupSelection(this);
foreach (SelectionItem * item, m_selectionItems) {
foreach(SelectionItem * item, m_selectionItems) {
ui->typeCombo->addItem(item->name());
}
@ -98,6 +98,7 @@ void SelectionPage::showEvent(QShowEvent *event)
void SelectionPage::selectionChanged(int index)
{
SelectionItem *item = m_selectionItems.at(index);
m_shape->setElementId(item->shapeId());
ui->typeDescription->setText(item->description());
fitImage();
@ -120,5 +121,4 @@ void SelectionPage::setText(QString text)
SelectionItem::SelectionItem(QString name, QString description, QString shapeId, int id) :
m_name(name), m_description(description), m_shapeId(shapeId), m_id(id)
{
}
{}

View File

@ -41,12 +41,24 @@ class SelectionPage;
class SelectionItem {
public:
SelectionItem(QString name, QString description, QString shapeId, int id);
// ~SelectionItem();
// ~SelectionItem();
QString name() { return m_name; }
QString description() { return m_description; }
QString shapeId() { return m_shapeId; }
int id() { return m_id; }
QString name()
{
return m_name;
}
QString description()
{
return m_description;
}
QString shapeId()
{
return m_shapeId;
}
int id()
{
return m_id;
}
private:
QString m_name;
@ -60,7 +72,7 @@ public:
Selection() {}
virtual void addItem(QString name, QString description, QString shapeId, int id) = 0;
virtual void setTitle(QString title) = 0;
virtual void setText(QString text) = 0;
virtual void setText(QString text) = 0;
};
class SelectionPage : public AbstractWizardPage, public Selection {
@ -81,12 +93,12 @@ public:
protected:
void resizeEvent(QResizeEvent *event);
void showEvent(QShowEvent * event);
void showEvent(QShowEvent *event);
private:
Ui::SelectionPage *ui;
QGraphicsSvgItem *m_shape;
QList<SelectionItem*> m_selectionItems;
QList<SelectionItem *> m_selectionItems;
private slots:
void selectionChanged(int index);