1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1088 Changes to the Vehicle configuration page. Changed combo box for tab bar and made the tab text translate-able.

This commit is contained in:
m_thread 2014-01-28 22:13:41 +01:00
parent 986f2e3e8e
commit 7d44e38daf
4 changed files with 737 additions and 785 deletions

View File

@ -14,375 +14,303 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>0</number>
</property>
<item> <item>
<widget class="QGroupBox" name="vehicleTypeGroupBox"> <widget class="QTabBar" name="aircraftType" native="true"/>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Vehicle type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="aircraftType">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Select aircraft type here</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>2</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item> </item>
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QFrame" name="vehicleTypeFrame">
<property name="currentIndex"> <property name="layoutDirection">
<number>0</number> <enum>Qt::LeftToRight</enum>
</property> </property>
<widget class="QWidget" name="mixerSettingsPage"> <property name="autoFillBackground">
<property name="autoFillBackground"> <bool>true</bool>
<bool>true</bool> </property>
</property> <property name="styleSheet">
<attribute name="title"> <string notr="true">#vehicleTypeFrame{
<string>Mixer Settings</string> color: rgb(180, 180, 180);
</attribute> margin-top: -1px;
<layout class="QVBoxLayout" name="verticalLayout_3"> }</string>
<property name="leftMargin"> </property>
<number>9</number> <property name="frameShape">
</property> <enum>QFrame::StyledPanel</enum>
<property name="topMargin"> </property>
<number>9</number> <property name="frameShadow">
</property> <enum>QFrame::Raised</enum>
<property name="rightMargin"> </property>
<number>9</number> <layout class="QVBoxLayout" name="verticalLayout_2">
</property> <item>
<property name="bottomMargin"> <widget class="QTabWidget" name="tabWidget">
<number>9</number> <property name="currentIndex">
</property> <number>0</number>
<item> </property>
<widget class="QScrollArea" name="airframesScrollArea"> <widget class="QWidget" name="mixerSettingsPage">
<property name="sizePolicy"> <property name="autoFillBackground">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents"> <attribute name="title">
<property name="geometry"> <string>Mixer Settings</string>
<rect> </attribute>
<x>0</x> <layout class="QVBoxLayout" name="verticalLayout_3">
<y>0</y> <property name="leftMargin">
<width>840</width> <number>9</number>
<height>439</height>
</rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <property name="topMargin">
<property name="leftMargin"> <number>9</number>
<number>0</number> </property>
</property> <property name="rightMargin">
<property name="topMargin"> <number>9</number>
<number>0</number> </property>
</property> <property name="bottomMargin">
<property name="rightMargin"> <number>9</number>
<number>0</number> </property>
</property> <item>
<property name="bottomMargin"> <widget class="QScrollArea" name="airframesScrollArea">
<number>0</number> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<item> <horstretch>0</horstretch>
<widget class="QStackedWidget" name="airframesWidget"> <verstretch>0</verstretch>
<property name="sizePolicy"> </sizepolicy>
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> </property>
<horstretch>0</horstretch> <property name="minimumSize">
<verstretch>0</verstretch> <size>
</sizepolicy> <width>0</width>
</property> <height>0</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="palette">
<height>16777215</height> <palette>
</size> <active>
</property> <colorrole role="Base">
<property name="frameShape"> <brush brushstyle="SolidPattern">
<enum>QFrame::NoFrame</enum> <color alpha="255">
</property> <red>255</red>
<property name="currentIndex"> <green>255</green>
<number>-1</number> <blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>820</width>
<height>478</height>
</rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QStackedWidget" name="airframesWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </widget>
</layout> </item>
</widget> </layout>
</widget> </widget>
</item> <widget class="QWidget" name="feedForwardPage">
</layout> <property name="autoFillBackground">
</widget>
<widget class="QWidget" name="feedForwardPage">
<property name="autoFillBackground">
<bool>true</bool>
</property>
<attribute name="title">
<string>Feed Forward</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_25">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_2">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents_2"> <attribute name="title">
<property name="geometry"> <string>Feed Forward</string>
<rect> </attribute>
<x>0</x> <layout class="QVBoxLayout" name="verticalLayout_25">
<y>0</y> <property name="spacing">
<width>275</width> <number>0</number>
<height>309</height>
</rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_18"> <property name="leftMargin">
<property name="leftMargin"> <number>0</number>
<number>12</number> </property>
</property> <property name="topMargin">
<property name="topMargin"> <number>0</number>
<number>12</number> </property>
</property> <property name="rightMargin">
<property name="rightMargin"> <number>0</number>
<number>12</number> </property>
</property> <property name="bottomMargin">
<property name="bottomMargin"> <number>0</number>
<number>12</number> </property>
</property> <item>
<item> <widget class="QScrollArea" name="scrollArea_2">
<widget class="QGroupBox" name="groupBox_12"> <property name="palette">
<property name="title"> <palette>
<string>Feed Forward Configuration</string> <active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>271</width>
<height>307</height>
</rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QVBoxLayout" name="verticalLayout_18">
<property name="leftMargin"> <property name="leftMargin">
<number>12</number> <number>12</number>
</property> </property>
@ -395,191 +323,386 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>12</number> <number>12</number>
</property> </property>
<item row="2" column="0" colspan="3"> <item>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <widget class="QGroupBox" name="groupBox_12">
<item> <property name="title">
<widget class="QLabel" name="label_22"> <string>Feed Forward Configuration</string>
<property name="text"> </property>
<string>Decel Time Constant</string> <layout class="QGridLayout" name="gridLayout_8">
</property> <property name="leftMargin">
</widget> <number>12</number>
</item> </property>
<item> <property name="topMargin">
<widget class="QDoubleSpinBox" name="decelTime"> <number>12</number>
<property name="enabled"> </property>
<bool>true</bool> <property name="rightMargin">
</property> <number>12</number>
<property name="focusPolicy"> </property>
<enum>Qt::StrongFocus</enum> <property name="bottomMargin">
</property> <number>12</number>
<property name="toolTip"> </property>
<string>When tuning: Slowly raise decel time from zero to just <item row="2" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_22">
<property name="text">
<string>Decel Time Constant</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="decelTime">
<property name="enabled">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>When tuning: Slowly raise decel time from zero to just
under the level where the motor starts to undershoot under the level where the motor starts to undershoot
its target speed when decelerating. its target speed when decelerating.
Do it after accel time is setup.</string> Do it after accel time is setup.</string>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>3</number> <number>3</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>100.000000000000000</double> <double>100.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.010000000000000</double> <double>0.010000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_12"> <spacer name="horizontalSpacer_12">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0" colspan="3"> <item row="1" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QLabel" name="label_21"> <widget class="QLabel" name="label_21">
<property name="text"> <property name="text">
<string>Accel Time Constant</string> <string>Accel Time Constant</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDoubleSpinBox" name="accelTime"> <widget class="QDoubleSpinBox" name="accelTime">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>In miliseconds. <string>In miliseconds.
When tuning: Slowly raise accel time from zero to just When tuning: Slowly raise accel time from zero to just
under the level where the motor starts to overshoot under the level where the motor starts to overshoot
its target speed.</string> its target speed.</string>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>3</number> <number>3</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>100.000000000000000</double> <double>100.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.010000000000000</double> <double>0.010000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_13"> <spacer name="horizontalSpacer_13">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLabel" name="maxAccelSliderValue"> <widget class="QLabel" name="maxAccelSliderValue">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>16</height> <height>16</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>1000</string> <string>1000</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QSlider" name="feedForwardSlider"> <widget class="QSlider" name="feedForwardSlider">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Overall level of feed forward (in percentage).</string> <string>Overall level of feed forward (in percentage).</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>1</number> <number>1</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="tickPosition"> <property name="tickPosition">
<enum>QSlider::NoTicks</enum> <enum>QSlider::NoTicks</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="3" column="2">
<widget class="QSlider" name="maxAccelSlider"> <widget class="QSlider" name="maxAccelSlider">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Limits how much the engines can accelerate or decelerate. <string>Limits how much the engines can accelerate or decelerate.
In 'units per second', a sound default is 1000.</string> In 'units per second', a sound default is 1000.</string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>500</number> <number>500</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>2000</number> <number>2000</number>
</property> </property>
<property name="value"> <property name="value">
<number>1000</number> <number>1000</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="invertedAppearance"> <property name="invertedAppearance">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="invertedControls"> <property name="invertedControls">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_37">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>MaxAccel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="feedForwardSliderValue">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_20">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>FeedForward </string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item>
<widget class="QLabel" name="label_37"> <spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox_13">
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>267</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="ffTestBox1">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<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:'Ubuntu'; font-size:11pt; 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-family:'Sans'; font-size:10pt;&quot;&gt;Beware! Check &lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt; font-weight:600;&quot;&gt;all three&lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt; checkboxes to test Feed Forward.&lt;/span&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:'Sans'; font-size:10pt;&quot;&gt;It will run only if your airframe armed.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ffTestBox2">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<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:'Ubuntu'; font-size:11pt; 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-family:'Sans'; font-size:10pt;&quot;&gt;Beware! Check &lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt; font-weight:600;&quot;&gt;all three&lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt; checkboxes to test Feed Forward.&lt;/span&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:'Sans'; font-size:10pt;&quot;&gt;It will run only if your airframe armed.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ffTestBox3">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<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:'Ubuntu'; font-size:11pt; 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-family:'Sans'; font-size:10pt;&quot;&gt;Beware! Check &lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt; font-weight:600;&quot;&gt;all three&lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt; checkboxes to test Feed Forward.&lt;/span&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:'Sans'; font-size:10pt;&quot;&gt;It will run only if your airframe armed.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enable FF tuning</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>267</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -587,190 +710,13 @@ In 'units per second', a sound default is 1000.</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>40</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="html">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>MaxAccel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="feedForwardSliderValue">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_20">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>FeedForward </string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox_13">
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>267</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="ffTestBox1">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<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; <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; &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; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; 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-family:'Sans'; font-size:10pt;&quot;&gt;Beware! Check &lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt; font-weight:600;&quot;&gt;all three&lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt; checkboxes to test Feed Forward.&lt;/span&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:'Sans'; font-size:10pt;&quot;&gt;It will run only if your airframe armed.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ffTestBox2">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<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:'Ubuntu'; font-size:11pt; 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-family:'Sans'; font-size:10pt;&quot;&gt;Beware! Check &lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt; font-weight:600;&quot;&gt;all three&lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt; checkboxes to test Feed Forward.&lt;/span&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:'Sans'; font-size:10pt;&quot;&gt;It will run only if your airframe armed.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ffTestBox3">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<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:'Ubuntu'; font-size:11pt; 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-family:'Sans'; font-size:10pt;&quot;&gt;Beware! Check &lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt; font-weight:600;&quot;&gt;all three&lt;/span&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt; checkboxes to test Feed Forward.&lt;/span&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:'Sans'; font-size:10pt;&quot;&gt;It will run only if your airframe armed.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enable FF tuning</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>267</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="html">
<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:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt; &lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt; &lt;tr&gt;
@ -781,17 +727,36 @@ p, li { white-space: pre-wrap; }
&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:'Ubuntu'; font-size:11pt;&quot;&gt;&lt;br /&gt;&lt;/span&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:'Ubuntu'; font-size:11pt;&quot;&gt;&lt;br /&gt;&lt;/span&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:'Lucida Grande'; font-size:13pt;&quot;&gt;Beware: Feed Forward Tuning will launch all engines around mid-throttle, you have been warned!&lt;/span&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:'Lucida Grande'; font-size:13pt;&quot;&gt;Beware: Feed Forward Tuning will launch all engines around mid-throttle, you have been warned!&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;Remove your props initially, and for fine-tuning, make sure your airframe is safely held in place. Wear glasses and protect your face and body.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;Remove your props initially, and for fine-tuning, make sure your airframe is safely held in place. Wear glasses and protect your face and body.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </widget>
</layout> </item>
</widget> </layout>
</widget> </widget>
</item> </widget>
</layout> </item>
</widget> </layout>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>9</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<layout class="QHBoxLayout" name="bottomLayout"> <layout class="QHBoxLayout" name="bottomLayout">
<property name="spacing"> <property name="spacing">
@ -869,6 +834,14 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QTabBar</class>
<extends>QWidget</extends>
<header>qtabbar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../coreplugin/core.qrc"/> <include location="../coreplugin/core.qrc"/>
</resources> </resources>

View File

@ -250,7 +250,7 @@ void ConfigGadgetWidget::tabAboutToChange(int i, bool *proceed)
} }
if (wid->isDirty()) { if (wid->isDirty()) {
int ans = QMessageBox::warning(this, tr("Unsaved changes"), tr("The tab you are leaving has unsaved changes," int ans = QMessageBox::warning(this, tr("Unsaved changes"), tr("The tab you are leaving has unsaved changes,"
"if you proceed they will be lost." "if you proceed they will be lost.\n"
"Do you still want to proceed?"), QMessageBox::Yes, QMessageBox::No); "Do you still want to proceed?"), QMessageBox::Yes, QMessageBox::No);
if (ans == QMessageBox::No) { if (ans == QMessageBox::No) {
*proceed = false; *proceed = false;

View File

@ -122,18 +122,18 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi
addUAVObject("MixerSettings"); addUAVObject("MixerSettings");
addUAVObject("ActuatorSettings"); addUAVObject("ActuatorSettings");
ffTuningInProgress = false; m_ffTuningInProgress = false;
ffTuningPhase = false; m_ffTuningPhase = false;
QStringList airframeTypes; // The order of the tabs is important since they correspond with the AirframCategory enum
airframeTypes << "Fixed Wing" << "Multirotor" << "Helicopter" << "Ground" << "Custom"; m_aircraft->aircraftType->addTab(tr("Multirotor"));
m_aircraft->aircraftType->addItems(airframeTypes); m_aircraft->aircraftType->addTab(tr("Fixed Wing"));
m_aircraft->aircraftType->addTab(tr("Helicopter"));
// Set default vehicle to MultiRotor m_aircraft->aircraftType->addTab(tr("Ground"));
// m_aircraft->aircraftType->setCurrentIndex(3); m_aircraft->aircraftType->addTab(tr("Custom"));
// Connect aircraft type selection dropbox to callback function // Connect aircraft type selection dropbox to callback function
connect(m_aircraft->aircraftType, SIGNAL(currentIndexChanged(int)), this, SLOT(switchAirframeType(int))); connect(m_aircraft->aircraftType, SIGNAL(currentChanged(int)), this, SLOT(switchAirframeType(int)));
// Connect the three feed forward test checkboxes // Connect the three feed forward test checkboxes
connect(m_aircraft->ffTestBox1, SIGNAL(clicked(bool)), this, SLOT(enableFFTest())); connect(m_aircraft->ffTestBox1, SIGNAL(clicked(bool)), this, SLOT(enableFFTest()));
@ -145,9 +145,6 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi
refreshWidgetsValues(); refreshWidgetsValues();
// register widgets for dirty state management
addWidget(m_aircraft->aircraftType);
// register FF widgets for dirty state management // register FF widgets for dirty state management
addWidget(m_aircraft->feedForwardSlider); addWidget(m_aircraft->feedForwardSlider);
addWidget(m_aircraft->accelTime); addWidget(m_aircraft->accelTime);
@ -171,10 +168,7 @@ ConfigVehicleTypeWidget::~ConfigVehicleTypeWidget()
void ConfigVehicleTypeWidget::switchAirframeType(int index) void ConfigVehicleTypeWidget::switchAirframeType(int index)
{ {
// TODO not safe w/r to translation!!! m_aircraft->airframesWidget->setCurrentWidget(getVehicleConfigWidget(index));
QString frameCategory = m_aircraft->aircraftType->currentText();
m_aircraft->airframesWidget->setCurrentWidget(getVehicleConfigWidget(frameCategory));
} }
/** /**
@ -202,10 +196,9 @@ void ConfigVehicleTypeWidget::refreshWidgetsValues(UAVObject *o)
// At this stage, we will need to have some hardcoded settings in this code, this // At this stage, we will need to have some hardcoded settings in this code, this
// is not ideal, but there you go. // is not ideal, but there you go.
QString frameType = field->getValue().toString(); QString frameType = field->getValue().toString();
qDebug() << "ConfigVehicleTypeWidget::refreshWidgetsValues - frame type:" << frameType;
QString category = frameCategory(frameType); int category = frameCategory(frameType);
setComboCurrentIndex(m_aircraft->aircraftType, m_aircraft->aircraftType->findText(category)); m_aircraft->aircraftType->setCurrentIndex(category);
VehicleConfig *vehicleConfig = getVehicleConfigWidget(category); VehicleConfig *vehicleConfig = getVehicleConfigWidget(category);
if (vehicleConfig) { if (vehicleConfig) {
@ -215,8 +208,6 @@ void ConfigVehicleTypeWidget::refreshWidgetsValues(UAVObject *o)
updateFeedForwardUI(); updateFeedForwardUI();
setDirty(dirty); setDirty(dirty);
qDebug() << "ConfigVehicleTypeWidget::refreshWidgetsValues - end";
} }
/** /**
@ -264,63 +255,61 @@ void ConfigVehicleTypeWidget::updateObjectsFromWidgets()
updateFeedForwardUI(); updateFeedForwardUI();
} }
QString ConfigVehicleTypeWidget::frameCategory(QString frameType) int ConfigVehicleTypeWidget::frameCategory(QString frameType)
{ {
QString category;
if (frameType == "FixedWing" || frameType == "Elevator aileron rudder" || frameType == "FixedWingElevon" if (frameType == "FixedWing" || frameType == "Elevator aileron rudder" || frameType == "FixedWingElevon"
|| frameType == "Elevon" || frameType == "FixedWingVtail" || frameType == "Vtail") { || frameType == "Elevon" || frameType == "FixedWingVtail" || frameType == "Vtail") {
category = "Fixed Wing"; return ConfigVehicleTypeWidget::FIXED_WING;
} else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X" } else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X"
|| frameType == "QuadP" || frameType == "Quad +" || frameType == "Hexa" || frameType == "Hexacopter" || frameType == "QuadP" || frameType == "Quad +" || frameType == "Hexa" || frameType == "Hexacopter"
|| frameType == "HexaX" || frameType == "Hexacopter X" || frameType == "HexaCoax" || frameType == "HexaX" || frameType == "Hexacopter X" || frameType == "HexaCoax"
|| frameType == "Hexacopter Y6" || frameType == "Octo" || frameType == "Octocopter" || frameType == "OctoV" || frameType == "Hexacopter Y6" || frameType == "Octo" || frameType == "Octocopter" || frameType == "OctoV"
|| frameType == "Octocopter V" || frameType == "OctoCoaxP" || frameType == "Octo Coax +" || frameType == "Octocopter V" || frameType == "OctoCoaxP" || frameType == "Octo Coax +"
|| frameType == "OctoCoaxX" || frameType == "Octo Coax X") { || frameType == "OctoCoaxX" || frameType == "Octo Coax X") {
category = "Multirotor"; return ConfigVehicleTypeWidget::MULTIROTOR;
} else if (frameType == "HeliCP") { } else if (frameType == "HeliCP") {
category = "Helicopter"; return ConfigVehicleTypeWidget::HELICOPTER;
} else if (frameType == "GroundVehicleCar" || frameType == "Turnable (car)" } else if (frameType == "GroundVehicleCar" || frameType == "Turnable (car)"
|| frameType == "GroundVehicleDifferential" || frameType == "Differential (tank)" || frameType == "GroundVehicleDifferential" || frameType == "Differential (tank)"
|| frameType == "GroundVehicleMotorcyle" || frameType == "Motorcycle") { || frameType == "GroundVehicleMotorcyle" || frameType == "Motorcycle") {
category = "Ground"; return ConfigVehicleTypeWidget::GROUND;
} else { } else {
category = "Custom"; return ConfigVehicleTypeWidget::CUSTOM;
} }
return category;
} }
VehicleConfig *ConfigVehicleTypeWidget::getVehicleConfigWidget(QString frameCategory) VehicleConfig *ConfigVehicleTypeWidget::getVehicleConfigWidget(int frameCategory)
{ {
VehicleConfig *vehiculeConfig; VehicleConfig *vehiculeConfig;
if (!vehicleIndexMap.contains(frameCategory)) { if (!m_vehicleIndexMap.contains(frameCategory)) {
// create config widget // create config widget
vehiculeConfig = createVehicleConfigWidget(frameCategory); vehiculeConfig = createVehicleConfigWidget(frameCategory);
// bind config widget "field" to this ConfigTaskWodget // bind config widget "field" to this ConfigTaskWodget
// this is necessary to get "dirty" state management // this is necessary to get "dirty" state management
vehiculeConfig->registerWidgets(*this); vehiculeConfig->registerWidgets(*this);
// add config widget to UI // add config widget to UI
int index = m_aircraft->airframesWidget->insertWidget(m_aircraft->airframesWidget->count(), vehiculeConfig); int index = m_aircraft->airframesWidget->insertWidget(m_aircraft->airframesWidget->count(), vehiculeConfig);
vehicleIndexMap[frameCategory] = index; m_vehicleIndexMap[frameCategory] = index;
updateEnableControls();
} }
int index = vehicleIndexMap.value(frameCategory); int index = m_vehicleIndexMap.value(frameCategory);
vehiculeConfig = (VehicleConfig *)m_aircraft->airframesWidget->widget(index); vehiculeConfig = (VehicleConfig *)m_aircraft->airframesWidget->widget(index);
return vehiculeConfig; return vehiculeConfig;
} }
VehicleConfig *ConfigVehicleTypeWidget::createVehicleConfigWidget(QString frameCategory) VehicleConfig *ConfigVehicleTypeWidget::createVehicleConfigWidget(int frameCategory)
{ {
qDebug() << "ConfigVehicleTypeWidget::createVehicleConfigWidget - creating" << frameCategory; if (frameCategory == ConfigVehicleTypeWidget::FIXED_WING) {
if (frameCategory == "Fixed Wing") {
return new ConfigFixedWingWidget(); return new ConfigFixedWingWidget();
} else if (frameCategory == "Multirotor") { } else if (frameCategory == ConfigVehicleTypeWidget::MULTIROTOR){
return new ConfigMultiRotorWidget(); return new ConfigMultiRotorWidget();
} else if (frameCategory == "Helicopter") { } else if (frameCategory == ConfigVehicleTypeWidget::HELICOPTER) {
return new ConfigCcpmWidget(); return new ConfigCcpmWidget();
} else if (frameCategory == "Ground") { } else if (frameCategory == ConfigVehicleTypeWidget::GROUND) {
return new ConfigGroundVehicleWidget(); return new ConfigGroundVehicleWidget();
} else if (frameCategory == "Custom") { } else if (frameCategory ==ConfigVehicleTypeWidget::CUSTOM) {
return new ConfigCustomWidget(); return new ConfigCustomWidget();
} }
return NULL; return NULL;
@ -337,17 +326,17 @@ void ConfigVehicleTypeWidget::enableFFTest()
// - Every other time event: send FF settings to flight FW // - Every other time event: send FF settings to flight FW
if (m_aircraft->ffTestBox1->isChecked() && m_aircraft->ffTestBox2->isChecked() if (m_aircraft->ffTestBox1->isChecked() && m_aircraft->ffTestBox2->isChecked()
&& m_aircraft->ffTestBox3->isChecked()) { && m_aircraft->ffTestBox3->isChecked()) {
if (!ffTuningInProgress) { if (!m_ffTuningInProgress) {
// Initiate tuning: // Initiate tuning:
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject( UAVDataObject *obj = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(
QString("ManualControlCommand"))); QString("ManualControlCommand")));
UAVObject::Metadata mdata = obj->getMetadata(); UAVObject::Metadata mdata = obj->getMetadata();
accInitialData = mdata; m_accInitialData = mdata;
UAVObject::SetFlightAccess(mdata, UAVObject::ACCESS_READONLY); UAVObject::SetFlightAccess(mdata, UAVObject::ACCESS_READONLY);
obj->setMetadata(mdata); obj->setMetadata(mdata);
} }
// Depending on phase, either move actuator or send FF settings: // Depending on phase, either move actuator or send FF settings:
if (ffTuningPhase) { if (m_ffTuningPhase) {
// Send FF settings to the board // Send FF settings to the board
UAVDataObject *mixer = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("MixerSettings"))); UAVDataObject *mixer = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("MixerSettings")));
Q_ASSERT(mixer); Q_ASSERT(mixer);
@ -369,18 +358,18 @@ void ConfigVehicleTypeWidget::enableFFTest()
obj->getField("Throttle")->setValue(target); obj->getField("Throttle")->setValue(target);
obj->updated(); obj->updated();
} }
ffTuningPhase = !ffTuningPhase; m_ffTuningPhase = !m_ffTuningPhase;
ffTuningInProgress = true; m_ffTuningInProgress = true;
QTimer::singleShot(1000, this, SLOT(enableFFTest())); QTimer::singleShot(1000, this, SLOT(enableFFTest()));
} else { } else {
// - If no: disarm timer, restore actuatorcommand metadata // - If no: disarm timer, restore actuatorcommand metadata
// Disarm! // Disarm!
if (ffTuningInProgress) { if (m_ffTuningInProgress) {
ffTuningInProgress = false; m_ffTuningInProgress = false;
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject( UAVDataObject *obj = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(
QString("ManualControlCommand"))); QString("ManualControlCommand")));
UAVObject::Metadata mdata = obj->getMetadata(); UAVObject::Metadata mdata = obj->getMetadata();
mdata = accInitialData; // Restore metadata mdata = m_accInitialData; // Restore metadata
obj->setMetadata(mdata); obj->setMetadata(mdata);
} }
} }
@ -413,15 +402,3 @@ void ConfigVehicleTypeWidget::openHelp()
{ {
QDesktopServices::openUrl(QUrl("http://wiki.openpilot.org/x/44Cf", QUrl::StrictMode)); QDesktopServices::openUrl(QUrl("http://wiki.openpilot.org/x/44Cf", QUrl::StrictMode));
} }
/**
Helper function:
Sets the current index on supplied combobox to index
if it is within bounds 0 <= index < combobox.count()
*/
void ConfigVehicleTypeWidget::setComboCurrentIndex(QComboBox *box, int index)
{
if (index >= 0 && index < box->count()) {
box->setCurrentIndex(index);
}
}

View File

@ -64,7 +64,6 @@ class ConfigVehicleTypeWidget : public ConfigTaskWidget {
public: public:
static QStringList getChannelDescriptions(); static QStringList getChannelDescriptions();
static void setComboCurrentIndex(QComboBox *box, int index);
ConfigVehicleTypeWidget(QWidget *parent = 0); ConfigVehicleTypeWidget(QWidget *parent = 0);
~ConfigVehicleTypeWidget(); ~ConfigVehicleTypeWidget();
@ -76,20 +75,23 @@ protected slots:
private: private:
Ui_AircraftWidget *m_aircraft; Ui_AircraftWidget *m_aircraft;
static enum { MULTIROTOR = 0, FIXED_WING, HELICOPTER, GROUND, CUSTOM } AirframeCategory;
// Maps a frame category to its index in the m_aircraft->airframesWidget QStackedWidget // Maps a frame category to its index in the m_aircraft->airframesWidget QStackedWidget
QMap<QString, int> vehicleIndexMap; QMap<int, int> m_vehicleIndexMap;
QString frameCategory(QString frameType);
VehicleConfig *getVehicleConfigWidget(QString frameCategory); int frameCategory(QString frameType);
VehicleConfig *createVehicleConfigWidget(QString frameCategory);
VehicleConfig *getVehicleConfigWidget(int frameCategory);
VehicleConfig *createVehicleConfigWidget(int frameCategory);
// Feed Forward // Feed Forward
void updateFeedForwardUI(); void updateFeedForwardUI();
bool ffTuningInProgress; bool m_ffTuningInProgress;
bool ffTuningPhase; bool m_ffTuningPhase;
UAVObject::Metadata accInitialData; UAVObject::Metadata m_accInitialData;
private slots: private slots:
void switchAirframeType(int index); void switchAirframeType(int index);