1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

Initial tuning page

This commit is contained in:
Fredrik Larson 2014-09-05 17:14:27 +10:00
parent 135853d5a1
commit b1a7f959b5
7 changed files with 111 additions and 69 deletions

View File

@ -25,17 +25,17 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "airframestabfixedwingpage.h"
#include "ui_airframestabfixedwingpage.h"
#include "airframeinitialtuningpage.h"
#include "ui_airframeinitialtuningpage.h"
AirframeStabFixedwingPage::AirframeStabFixedwingPage(SetupWizard *wizard, QWidget *parent) :
AirframeInitialTuningPage::AirframeInitialTuningPage(SetupWizard *wizard, QWidget *parent) :
AbstractWizardPage(wizard, parent),
ui(new Ui::AirframeStabFixedwingPage)
ui(new Ui::AirframeInitialTuningPage)
{
ui->setupUi(this);
}
AirframeStabFixedwingPage::~AirframeStabFixedwingPage()
AirframeInitialTuningPage::~AirframeInitialTuningPage()
{
delete ui;
}

View File

@ -25,24 +25,24 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef AIRFRAMESTABFIXEDWINGPAGE_H
#define AIRFRAMESTABFIXEDWINGPAGE_H
#ifndef AIRFRAMEINITIALTUNINGPAGE_H
#define AIRFRAMEINITIALTUNINGPAGE_H
#include "abstractwizardpage.h"
namespace Ui {
class AirframeStabFixedwingPage;
class AirframeInitialTuningPage;
}
class AirframeStabFixedwingPage : public AbstractWizardPage {
class AirframeInitialTuningPage : public AbstractWizardPage {
Q_OBJECT
public:
explicit AirframeStabFixedwingPage(SetupWizard *wizard, QWidget *parent = 0);
~AirframeStabFixedwingPage();
explicit AirframeInitialTuningPage(SetupWizard *wizard, QWidget *parent = 0);
~AirframeInitialTuningPage();
private:
Ui::AirframeStabFixedwingPage *ui;
Ui::AirframeInitialTuningPage *ui;
};
#endif // AIRFRAMESTABFIXEDWINGPAGE_H
#endif // AIRFRAMEINITIALTUNINGPAGE_H

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AirframeInitialTuningPage</class>
<widget class="QWizardPage" name="AirframeInitialTuningPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>WizardPage</string>
</property>
<widget class="QLabel" name="label_main">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>582</width>
<height>81</height>
</rect>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Initial Tuning&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2,sans-serif';&quot;&gt;This section of the OpenPilot Wizard allows you to select a set of initial tunning parameters for your airframe. Presented below is a list of common airframe types, select the one that matches your airframe the closest, if unsure select the generic variant.&lt;/span&gt; &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>581</width>
<height>291</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="2,3">
<item>
<widget class="QListWidget" name="listWidget">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="10,4">
<item>
<widget class="QGraphicsView" name="graphicsView"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Description</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<zorder>label_main</zorder>
<zorder>label_main</zorder>
<zorder>horizontalLayoutWidget</zorder>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AirframeStabFixedwingPage</class>
<widget class="QWizardPage" name="AirframeStabFixedwingPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>WizardPage</string>
</property>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>551</width>
<height>191</height>
</rect>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;TODO: This page handles PIDs, we get a choice of airframes, some generics as well as specifics like FPV Raptor and Funjet etc&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Explain these are a starting point and likely will need further tuning as no two airframes are completely identical &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -46,7 +46,7 @@
#include "pages/rebootpage.h"
#include "pages/outputcalibrationpage.h"
#include "pages/revocalibrationpage.h"
#include "pages/airframestabfixedwingpage.h"
#include "pages/airframeinitialtuningpage.h"
#include "extensionsystem/pluginmanager.h"
#include "vehicleconfigurationhelper.h"
#include "actuatorsettings.h"
@ -163,7 +163,7 @@ int SetupWizard::nextId() const
{
switch (getVehicleType()) {
case VEHICLE_FIXEDWING:
return PAGE_AIRFRAMESTAB_FIXEDWING;
return PAGE_AIRFRAME_INITIAL_TUNING;
// TODO: PID selection pages for multi and heli
case VEHICLE_MULTI:
@ -186,7 +186,7 @@ int SetupWizard::nextId() const
case PAGE_AIRSPEED:
return PAGE_SUMMARY;
case PAGE_AIRFRAMESTAB_FIXEDWING:
case PAGE_AIRFRAME_INITIAL_TUNING:
return PAGE_SAVE;
case PAGE_SUMMARY:
@ -440,7 +440,7 @@ void SetupWizard::createPages()
setPage(PAGE_SAVE, new SavePage(this));
setPage(PAGE_REBOOT, new RebootPage(this));
setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this));
setPage(PAGE_AIRFRAMESTAB_FIXEDWING, new AirframeStabFixedwingPage(this));
setPage(PAGE_AIRFRAME_INITIAL_TUNING, new AirframeInitialTuningPage(this));
setPage(PAGE_END, new OPEndPage(this));
setStartId(PAGE_START);

View File

@ -177,7 +177,7 @@ private:
enum { PAGE_START, PAGE_CONTROLLER, PAGE_VEHICLES, PAGE_MULTI, PAGE_FIXEDWING,
PAGE_AIRSPEED, PAGE_GPS, PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_ESC, PAGE_SERVO,
PAGE_BIAS_CALIBRATION, PAGE_REVO_CALIBRATION, PAGE_OUTPUT_CALIBRATION,
PAGE_SAVE, PAGE_SUMMARY, PAGE_NOTYETIMPLEMENTED, PAGE_AIRFRAMESTAB_FIXEDWING,
PAGE_SAVE, PAGE_SUMMARY, PAGE_NOTYETIMPLEMENTED, PAGE_AIRFRAME_INITIAL_TUNING,
PAGE_REBOOT, PAGE_END, PAGE_UPDATE };
void createPages();
bool saveHardwareSettings() const;

View File

@ -37,10 +37,10 @@ HEADERS += setupwizardplugin.h \
pages/revocalibrationpage.h \
biascalibrationutil.h \
pages/biascalibrationpage.h \
pages/airframestabfixedwingpage.h \
pages/escpage.h \
pages/servopage.h \
pages/selectionpage.h
pages/selectionpage.h \
pages/airframeinitialtuningpage.h
SOURCES += setupwizardplugin.cpp \
setupwizard.cpp \
@ -69,10 +69,10 @@ SOURCES += setupwizardplugin.cpp \
pages/revocalibrationpage.cpp \
biascalibrationutil.cpp \
pages/biascalibrationpage.cpp \
pages/airframestabfixedwingpage.cpp \
pages/escpage.cpp \
pages/servopage.cpp \
pages/selectionpage.cpp
pages/selectionpage.cpp \
pages/airframeinitialtuningpage.cpp
OTHER_FILES += SetupWizard.pluginspec
@ -93,10 +93,10 @@ FORMS += \
pages/autoupdatepage.ui \
pages/revocalibrationpage.ui \
pages/biascalibrationpage.ui \
pages/airframestabfixedwingpage.ui \
pages/escpage.ui \
pages/servopage.ui \
pages/selectionpage.ui
pages/selectionpage.ui \
pages/airframeinitialtuningpage.ui
RESOURCES += \
wizardResources.qrc