diff --git a/ground/openpilotgcs/src/plugins/config/images/fixedwing-shapes.svg b/ground/openpilotgcs/src/plugins/config/images/fixedwing-shapes.svg
index e99a33c65..26045315f 100644
--- a/ground/openpilotgcs/src/plugins/config/images/fixedwing-shapes.svg
+++ b/ground/openpilotgcs/src/plugins/config/images/fixedwing-shapes.svg
@@ -19,2771 +19,1531 @@
viewBox="0 0 792 2016"
enable-background="new 0 0 792 1008"
xml:space="preserve"
- inkscape:version="0.48.2 r9819"
+ inkscape:version="0.48.4 r9939"
sodipodi:docname="fixedwing-shapes.svg">image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ id="metadata4103">image/svg+xml
\ No newline at end of file
diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp
index 9dd9b9638..2911eb9f1 100644
--- a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp
+++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp
@@ -106,7 +106,7 @@ void FixedWingPage::updateImageAndDescription()
elementId = "aileron";
break;
case SetupWizard::FIXED_WING_VTAIL:
- elementId = "vtail";
+ elementId = "v-tail";
break;
default:
elementId = "";
diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp
index c469fa2cc..9bfdeba9c 100644
--- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp
+++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp
@@ -30,6 +30,9 @@
#include "systemalarms.h"
#include "uavobjectmanager.h"
+const QString OutputCalibrationPage::MULTI_SVG_FILE = QString(":/setupwizard/resources/multirotor-shapes.svg");
+const QString OutputCalibrationPage::FIXEDWING_SVG_FILE = QString(":/setupwizard/resources/fixedwing-shapes.svg");
+
OutputCalibrationPage::OutputCalibrationPage(SetupWizard *wizard, QWidget *parent) :
AbstractWizardPage(wizard, parent), ui(new Ui::OutputCalibrationPage), m_vehicleBoundsItem(0),
m_currentWizardIndex(-1), m_calibrationUtil(0)
@@ -54,6 +57,13 @@ OutputCalibrationPage::~OutputCalibrationPage()
delete ui;
}
+void OutputCalibrationPage::loadSVGFile(QString file)
+{
+ if (QFile::exists(file) && m_vehicleRenderer->load(file) && m_vehicleRenderer->isValid()) {
+ ui->vehicleView->setScene(m_vehicleScene);
+ }
+}
+
void OutputCalibrationPage::setupVehicle()
{
m_actuatorSettings = getWizard()->getActuatorSettings();
@@ -64,95 +74,78 @@ void OutputCalibrationPage::setupVehicle()
m_currentWizardIndex = 0;
m_vehicleScene->clear();
-// KF moved code from OutputCalibrationPage() here so it can be used to detect the current vehicle
-// needs to be slimmed down and not repeated.
-
switch (getWizard()->getVehicleSubType()) {
case SetupWizard::MULTI_ROTOR_TRI_Y:
- if (QFile::exists(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
+ // Loads the SVG file resourse and sets the scene
+ loadSVGFile(MULTI_SVG_FILE);
+ // The m_wizardIndexes array contains the index of the QStackedWidget
+ // in the page to use for each step.
m_wizardIndexes << 0 << 1 << 1 << 1 << 2 << 3 << 4;
+
+ // All element ids to load from the svg file and manage.
m_vehicleElementIds << "tri" << "tri-frame" << "tri-m1" << "tri-m2" << "tri-m3" << "tri-s1";
+
+ // The index of the elementId to highlight ( not dim ) for each step
+ // this is the index in the m_vehicleElementIds - 1.
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 4 << 4;
+
+ // The channel number to configure for each step.
m_channelIndex << 0 << 0 << 1 << 2 << 3 << 3 << 3;
+
+ // Default values for the actuator settings, extra important for
+ // servos since a value out of range can actually destroy the
+ // vehicle if unlucky.
+ // Motors are not that important. REMOVE propellers always!!
m_actuatorSettings[3].channelMin = 1500;
m_actuatorSettings[3].channelNeutral = 1500;
m_actuatorSettings[3].channelMax = 1500;
getWizard()->setActuatorSettings(m_actuatorSettings);
break;
case SetupWizard::MULTI_ROTOR_QUAD_X:
- if (QFile::exists(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
+ loadSVGFile(MULTI_SVG_FILE);
m_wizardIndexes << 0 << 1 << 1 << 1 << 1;
m_vehicleElementIds << "quad-x" << "quad-x-frame" << "quad-x-m1" << "quad-x-m2" << "quad-x-m3" << "quad-x-m4";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4;
m_channelIndex << 0 << 0 << 1 << 2 << 3;
break;
case SetupWizard::MULTI_ROTOR_QUAD_PLUS:
- if (QFile::exists(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
+ loadSVGFile(MULTI_SVG_FILE);
m_wizardIndexes << 0 << 1 << 1 << 1 << 1;
m_vehicleElementIds << "quad-p" << "quad-p-frame" << "quad-p-m1" << "quad-p-m2" << "quad-p-m3" << "quad-p-m4";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4;
m_channelIndex << 0 << 0 << 1 << 2 << 3;
break;
case SetupWizard::MULTI_ROTOR_HEXA:
- if (QFile::exists(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
+ loadSVGFile(MULTI_SVG_FILE);
m_wizardIndexes << 0 << 1 << 1 << 1 << 1 << 1 << 1;
m_vehicleElementIds << "hexa" << "hexa-frame" << "hexa-m1" << "hexa-m2" << "hexa-m3" << "hexa-m4" << "hexa-m5" << "hexa-m6";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5 << 6;
m_channelIndex << 0 << 0 << 1 << 2 << 3 << 4 << 5;
break;
case SetupWizard::MULTI_ROTOR_HEXA_COAX_Y:
- if (QFile::exists(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
+ loadSVGFile(MULTI_SVG_FILE);
m_wizardIndexes << 0 << 1 << 1 << 1 << 1 << 1 << 1;
m_vehicleElementIds << "hexa-y6" << "hexa-y6-frame" << "hexa-y6-m2" << "hexa-y6-m1" << "hexa-y6-m4" << "hexa-y6-m3" << "hexa-y6-m6" << "hexa-y6-m5";
m_vehicleHighlightElementIndexes << 0 << 2 << 1 << 4 << 3 << 6 << 5;
m_channelIndex << 0 << 0 << 1 << 2 << 3 << 4 << 5;
break;
case SetupWizard::MULTI_ROTOR_HEXA_H:
- if (QFile::exists(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/multirotor-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
+ loadSVGFile(MULTI_SVG_FILE);
m_wizardIndexes << 0 << 1 << 1 << 1 << 1 << 1 << 1;
m_vehicleElementIds << "hexa-h" << "hexa-h-frame" << "hexa-h-m1" << "hexa-h-m2" << "hexa-h-m3" << "hexa-h-m4" << "hexa-h-m5" << "hexa-h-m6";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5 << 6;
m_channelIndex << 0 << 0 << 1 << 2 << 3 << 4 << 5;
break;
-// KF hack
case SetupWizard::FIXED_WING_AILERON:
- if (QFile::exists(QString(":/setupwizard/resources/fixedwing-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/fixedwing-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
- qDebug() << "no clue what a wizard index is!";
- m_wizardIndexes << 0 << 1 << 3 << 3 << 3 << 3; // These come from OutputCalibrationPage::setWizardPage()
- m_vehicleElementIds << "fixed-aileron" << "aileron";
- m_vehicleHighlightElementIndexes << 0 << 1;
- m_channelIndex << 0 << 0 << 1 << 2 << 3 << 4;
+ loadSVGFile(FIXEDWING_SVG_FILE);
+ m_wizardIndexes << 0 << 1 << 2 << 3 << 4 << 2 << 3 << 4 << 2 << 3 << 4 << 2 << 3 << 4;
+ m_vehicleElementIds << "aileron" << "aileron-frame" << "aileron-motor" << "aileron-ail-left" << "aileron-ail-right" << "aileron-rudder" << "aileron-elevator";
+ m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 2 << 2 << 3 << 3 << 3 << 4 << 4 << 4 << 5 << 5 << 5;
+ m_channelIndex << 0 << 0 << 1 << 1 << 1 << 2 << 2 << 2 << 3 << 3 << 3 << 4 << 4 << 4;
- // see Servo city for an example. 1500 usec is center on MS85mg for example. - http://www.servocity.com/html/hs-85mg__mighty_micro.html
+ // see Servo city for an example. 1500 usec is center on MS85mg for example.
+ // - http://www.servocity.com/html/hs-85mg__mighty_micro.html
// make sure Aileron servo one does not go to an extreme value
m_actuatorSettings[1].channelMin = 1500;
m_actuatorSettings[1].channelNeutral = 1500;
@@ -173,16 +166,11 @@ void OutputCalibrationPage::setupVehicle()
getWizard()->setActuatorSettings(m_actuatorSettings);
break;
case SetupWizard::FIXED_WING_VTAIL:
- if (QFile::exists(QString(":/setupwizard/resources/fixedwing-shapes.svg")) &&
- m_vehicleRenderer->load(QString(":/setupwizard/resources/fixedwing-shapes.svg")) &&
- m_vehicleRenderer->isValid()) {
- ui->vehicleView->setScene(m_vehicleScene);
- }
- qDebug() << "no clue what a wizard index is!";
- m_wizardIndexes << 0 << 1 << 3 << 3; // These come from OutputCalibrationPage::setWizardPage()
- m_vehicleElementIds << "fixed-vtail" << "vtail";
- m_vehicleHighlightElementIndexes << 0 << 1;
- m_channelIndex << 0 << 0 << 1 << 2;
+ loadSVGFile(FIXEDWING_SVG_FILE);
+ m_wizardIndexes << 0 << 1 << 2 << 3 << 4 << 2 << 3 << 4;
+ m_vehicleElementIds << "v-tail" << "v-tail-frame" << "v-tail-motor" << "v-tail-elevon-left" << "v-tail-elevon-right";
+ m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 2 << 2 << 3 << 3 << 3;
+ m_channelIndex << 0 << 0 << 1 << 1 << 1 << 2 << 2 << 2;
// make sure elevon servo one does not go to an extreme value
m_actuatorSettings[1].channelMin = 1500;
@@ -282,7 +270,7 @@ void OutputCalibrationPage::setWizardPage()
ui->servoMaxAngleSlider->setValue(m_actuatorSettings[currentChannel].channelMax);
}
}
- // setupVehicleHighlightedPart(); // turn this off for now, need to fix fixedwing image elements
+ setupVehicleHighlightedPart();
}
void OutputCalibrationPage::initializePage()
diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h
index 50791517a..0ad5f428f 100644
--- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h
+++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h
@@ -52,6 +52,7 @@ public:
return m_currentWizardIndex >= m_wizardIndexes.size() - 1;
}
+ void loadSVGFile(QString file);
protected:
void showEvent(QShowEvent *event);
void resizeEvent(QResizeEvent *event);
@@ -100,6 +101,9 @@ private:
QList m_actuatorSettings;
OutputCalibrationUtil *m_calibrationUtil;
+
+ static const QString MULTI_SVG_FILE;
+ static const QString FIXEDWING_SVG_FILE;
};
#endif // OUTPUTCALIBRATIONPAGE_H
diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.ui
index 0f0dd1707..efff8d7d5 100644
--- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.ui
+++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.ui
@@ -65,6 +65,12 @@ p, li { white-space: pre-wrap; }
-
+
+
+ 300
+ 0
+
+
<html><head/><body><p>In this step we will set the neutral rate for the motor highlighted in the illustration to the right. <br/>Please pay attention to the details and in particular the motors position and its rotation direction. Ensure the motors are spinning in the correct direction as shown in the diagram. Swap any 2 motor wires to change the direction of a motor. </p><p>To find the neutral rate for this engine, press the Start button below and slide the slider to the right until the engine just starts to spin stable. <br/><br/>When done press button again to stop.</p></body></html>
diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/fixedwing-shapes.svg b/ground/openpilotgcs/src/plugins/setupwizard/resources/fixedwing-shapes.svg
index e99a33c65..b0f5b5aec 100644
--- a/ground/openpilotgcs/src/plugins/setupwizard/resources/fixedwing-shapes.svg
+++ b/ground/openpilotgcs/src/plugins/setupwizard/resources/fixedwing-shapes.svg
@@ -19,2771 +19,2537 @@
viewBox="0 0 792 2016"
enable-background="new 0 0 792 1008"
xml:space="preserve"
- inkscape:version="0.48.2 r9819"
+ inkscape:version="0.48.4 r9939"
sodipodi:docname="fixedwing-shapes.svg">image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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