29 #include "ui_multipage.h"
38 QSvgRenderer *renderer =
new QSvgRenderer();
39 renderer->load(QString(
":/configgadget/images/multirotor-shapes.svg"));
40 m_multiPic =
new QGraphicsSvgItem();
41 m_multiPic->setSharedRenderer(renderer);
42 QGraphicsScene *scene =
new QGraphicsScene(
this);
43 scene->addItem(m_multiPic);
44 ui->typeGraphicsView->setScene(scene);
46 setupMultiTypesCombo();
49 ui->typeCombo->setCurrentIndex(1);
50 connect(ui->typeCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
this,
51 &MultiPage::updateImageAndDescription);
52 ui->typeGraphicsView->setSceneRect(m_multiPic->boundingRect());
53 ui->typeGraphicsView->fitInView(m_multiPic, Qt::KeepAspectRatio);
63 updateAvailableTypes();
64 updateImageAndDescription();
81 ui->typeGraphicsView->setSceneRect(m_multiPic->boundingRect());
82 ui->typeGraphicsView->fitInView(m_multiPic, Qt::KeepAspectRatio);
86 void MultiPage::setupMultiTypesCombo()
90 "The Tricopter uses three motors and one servo. The servo is used to give yaw authority to "
92 "The front motors are rotating in opposite directions. The Tricopter is known for its "
93 "sweeping yaw movement and "
94 "it is very well suited for FPV since the front rotors are spread wide apart.");
98 "The X Quadcopter uses four motors and is the most common multi rotor configuration. Two "
99 "of the motors rotate clockwise "
100 "and two counter clockwise. The motors positioned diagonal to each other rotate in the "
102 "This setup is perfect for sport flying and is also commonly used for FPV platforms.");
105 m_descriptions << tr(
"The Plus(+) Quadcopter uses four motors and is similar to the X "
106 "Quadcopter but the forward direction is offset by 45 degrees. "
107 "The motors front and rear rotate in clockwise and the motors right and "
108 "left rotate counter-clockwise. "
109 "This setup was one of the first to be used and is still used for sport "
110 "flying. This configuration is not that well suited "
111 "for FPV since the fore rotor tend to be in the way of the camera.");
114 m_descriptions << tr(
"Hexacopter");
117 m_descriptions << tr(
"Hexacopter Coax (Y6)");
120 m_descriptions << tr(
"Hexacopter H");
138 void MultiPage::updateAvailableTypes()
154 void MultiPage::updateImageAndDescription()
159 QString elementId =
"";
160 QString description = m_descriptions.at(ui->typeCombo->currentIndex());
167 elementId =
"quad-x";
170 elementId =
"quad-plus";
173 elementId =
"quad-hexa";
176 elementId =
"hexa-coax";
179 elementId =
"quad-hexa-H";
182 elementId =
"quad-octo";
185 elementId =
"octo-coax-X";
188 elementId =
"octo-coax-P";
191 elementId =
"quad-octo-v";
197 m_multiPic->setElementId(elementId);
198 ui->typeGraphicsView->setSceneRect(m_multiPic->boundingRect());
199 ui->typeGraphicsView->fitInView(m_multiPic, Qt::KeepAspectRatio);
201 ui->typeDescription->setText(description);
The SetupWizard class is the main interface to the setup wizard. It provides selects the sequence of ...
void resizeEvent(QResizeEvent *event)
MultiPage(SetupWizard *wizard, QWidget *parent=nullptr)
SetupWizard * getWizard() const
void setVehicleSubType(SetupWizard::VEHICLE_SUB_TYPE type)