Commit a89fd4d3 authored by Lorenz Meier's avatar Lorenz Meier

Minor visual style fixes

parent 76098ee1
......@@ -4,4 +4,8 @@
| BAT_N_CELLS | 1 | 100 | 3 | 1 | 1 | Number of SERIAL battery cells. Typically this ranges from 2S to 6S in small-scale UAVs |
| BAT_V_SCALING | 0.001 | 1.0 | 0.00838 | 1 | 1 | Conversion from ADC ticks to battery voltage. Depends on the connected board, calibrate with a multimeter. |
| MC_ATTRATE_P | 0.0 | 20.0 | 0.20 | 1 | 1 | Multirotor attitude rate control P gain. This gain controls how much of the motor thrust should be used to control angular velocity. A larger number will increase the control response, but will make the system also more twitchy. |
| FW_ROLLRATE_P | 0.0 | 20.0 | 0.30 | 1 | 1 | Fixed wing roll rate control P gain. This gain controls how strong the ailerons or rudder should be actuated in order to achieve a certain roll rate. A larger number will increase the control response, but will make the system also more twitchy. |
\ No newline at end of file
| MC_ATTRATE_D | 0.0 | 20.0 | 0.05 | 1 | 1 | Multirotor attitude rate control D gain. A large value will allow to damp oscillations due to a high P gain, but will make the system response suspectible to noise.|
| MC_ATT_P | 0.0 | 20.0 | 0.20 | 1 | 1 | Multirotor attitude control proportional (P) gain. This defines how strong the response of the system will be to an attitude error|
| MC_ATT_D | 0.0 | 20.0 | 0.05 | 1 | 1 | Multirotor attitude control D gain. A large value will allow to damp oscillations due to a high P gain, but will make the system response suspectible to noise.|
| FW_ROLLRATE_P | 0.0 | 20.0 | 0.30 | 1 | 1 | Fixed wing roll rate control P gain. This gain controls how strong the ailerons or rudder should be actuated in order to achieve a certain roll rate. A larger number will increase the control response, but will make the system also more twitchy. |
| FW_HEADING_P | 0.0 | 20.0 | 4.00 | 1 | 1 | Fixed wing heading error to bank angle gain |
\ No newline at end of file
......@@ -96,46 +96,39 @@ border: 1px solid #777777;
margin-top: 1ex; /* leave space at the top for the title */
}
QDockWidget {
border: 1px solid #32345E;
/* titlebar-close-icon: url(close.png);
titlebar-normal-icon: url(undock.png);*/
}
QDockWidget::title {
text-align: left; /* align the text to the left */
background: lightgray;
padding-left: 5px;
}
QDockWidget::close-button, QDockWidget::float-button {
border: 1px solid transparent;
background: darkgray;
padding: 0px;
}
QDockWidget::close-button, QDockWidget::float-button {
border: 1px solid transparent;
background: none;
padding: 0px;
}
QDockWidget::close-button:hover, QDockWidget::float-button:hover {
background: gray;
}
QDockWidget::close-button:hover, QDockWidget::float-button:hover {
background: none;
}
QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
QDockWidget::close-button:pressed, QDockWidget::float-button:pressed {
padding: 1px -1px -1px 1px;
}
background: none;
}
QDockWidget::close-button, QDockWidget::float-button {
background-color: #181820;
color: #EEEEEE;
QDockWidget {
border: 10px solid #66666B;
padding: 2px;
margin: 1px;
border-radius: 1px;
/*background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #59666f, stop: 1 #414B52);*/
/* titlebar-close-icon: url(close.png);
titlebar-normal-icon: url(undock.png);*/
}
QDockWidget::title {
text-align: left;
background: #121214;
color: #4A4A4F;
padding-left: 5px;
height: 10px;
border-bottom: 1px solid #555555;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #3F556A, stop: 1 #293645);
color: #EDEDED;
padding-left: 10px;
height: 14px;
border-bottom: 1px solid #1B1F22;
border-bottom: 2px solid #2C3A4A;
}
QSeparator {
......@@ -190,31 +183,36 @@ QPushButton {
min-height: 18px;
max-height: 18px;
min-width: 60px;*/
border: 2px solid #4A4A4F;
border-radius: 3px;
min-height: 20px;
/*min-width: 24px;*/
max-height: 20px;
border: 0px solid #59666f;
border-radius: 2px;
padding-left: 8px;
padding-right: 8px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #59666f, stop: 1 #414B52);
}
QPushButton:checked {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #404040, stop: 1 #808080);
border: 2px solid #379AC3;
border: 0px solid #379AC3;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0);
border: 2px solid #379AC3;
border: 0px solid #379AC3;
}
QToolButton {
font-weight: bold;
min-height: 18px;
min-width: 24px;
max-height: 18px;
border: 2px solid #4A4A4F;
border-radius: 3px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #232228, stop: 1 #020208);
min-height: 20px;
/*min-width: 24px;*/
max-height: 20px;
border: 0px solid #4A4A4F;
border-radius: 2px;
padding-left: 3px;
padding-right: 3px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #59666f, stop: 1 #414B52);
}
QToolButton:checked {
......@@ -228,8 +226,9 @@ QToolButton:pressed {
}
QToolTip {
background-color: #090909;
border: 1px solid #379AC3;
background-color: #3D5368;
border: 0px solid #379AC3;
margin: 3px;
border-radius: 3px;
color: #DDDDDF;
}
......@@ -400,11 +399,11 @@ QDialog {
/* Style the tab using the tab sub-control. Note that
it reads QTabBar _not_ QTabWidget */
QTabBar::tab {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #090909, stop: 1 #353535);
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #090909, stop: 1 #353535);
border: 2px solid #62676B;
border-radius: 4px;
min-width: 8ex;
padding: 2px;
border-radius: 4px;
min-width: 8ex;
padding: 2px;
}
QTabBar::tab:selected, QTabBar::tab:hover {
......
......@@ -108,8 +108,8 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
laserFix(0),
iruFix(0),
mavInitialized(false),
topMargin(12.0f),
bottomMargin(10.0f),
topMargin(18.0f),
bottomMargin(12.0f),
attControlKnown(false),
xyControlKnown(false),
zControlKnown(false),
......
......@@ -47,7 +47,7 @@
<number>10</number>
</property>
<widget class="QWidget" name="curveGroupBox" native="true">
<layout class="QGridLayout" name="gridLayout" rowstretch="50,1">
<layout class="QGridLayout" name="gridLayout" rowstretch="50,0">
<property name="leftMargin">
<number>6</number>
</property>
......@@ -103,8 +103,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>202</width>
<height>488</height>
<width>884</width>
<height>491</height>
</rect>
</property>
</widget>
......@@ -164,6 +164,28 @@
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="recolorButton">
<property name="toolTip">
......
......@@ -54,7 +54,7 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
// Add internal actions
// Add MAV widget
symbolButton = new QToolButton(this);
symbolButton->setStyleSheet("QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 12px; border: 0px solid #999999; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px 0px 0px 20px; background-color: none; }");
symbolButton->setStyleSheet("QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; }");
addWidget(symbolButton);
toolBarNameLabel = new QLabel("------", this);
......@@ -226,39 +226,6 @@ void QGCToolBar::logging(bool checked)
void QGCToolBar::addPerspectiveChangeAction(QAction* action)
{
insertAction(toggleLoggingAction, action);
// Set tab style
QWidget* widget = widgetForAction(action);
widget->setStyleSheet("\
* { font-weight: bold; min-height: 16px; min-width: 24px; \
border-top: 1px solid #BBBBBB; \
border-bottom: 0px; \
border-left: 1px solid #BBBBBB; \
border-right: 1px solid #BBBBBB; \
border-top-left-radius: 5px; \
border-top-right-radius: 5px; \
border-bottom-left-radius: 0px; \
border-bottom-right-radius: 0px; \
max-height: 22px; \
margin-top: 4px; \
margin-left: 2px; \
margin-bottom: 0px; \
margin-right: 2px; \
background-color: #222222; \
} \
*:checked { \
background-color: #000000; \
border-top: 2px solid #379AC3; \
border-bottom: 0px; \
border-left: 2px solid #379AC3; \
border-right: 2px solid #379AC3; \
} \
*:pressed { \
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bbbbbb, stop: 1 #b0b0b0); \
border-top: 2px solid #379AC3; \
border-bottom: 0px; \
border-left: 2px solid #379AC3; \
border-right: 2px solid #379AC3; }");
}
void QGCToolBar::setActiveUAS(UASInterface* active)
......@@ -322,6 +289,8 @@ void QGCToolBar::updateArmingState(bool armed)
{
systemArmed = armed;
changed = true;
/* important, immediately update */
updateView();
}
void QGCToolBar::updateView()
......@@ -377,6 +346,8 @@ void QGCToolBar::updateState(UASInterface* system, QString name, QString descrip
Q_UNUSED(description);
if (state != name) changed = true;
state = name;
/* important, immediately update */
updateView();
}
void QGCToolBar::updateMode(int system, QString name, QString description)
......@@ -385,11 +356,16 @@ void QGCToolBar::updateMode(int system, QString name, QString description)
Q_UNUSED(description);
if (mode != name) changed = true;
mode = name;
/* important, immediately update */
updateView();
}
void QGCToolBar::updateName(const QString& name)
{
if (systemName != name) changed = true;
if (systemName != name)
{
changed = true;
}
systemName = name;
}
......
......@@ -191,10 +191,10 @@ void QGCVehicleConfig::writeCalibrationRC()
for (unsigned int i = 0; i < chanMax; ++i)
{
mav->setParameter(0, minTpl.arg(i), rcMin[i]);
mav->setParameter(0, trimTpl.arg(i), rcTrim[i]);
mav->setParameter(0, maxTpl.arg(i), rcMax[i]);
mav->setParameter(0, revTpl.arg(i), (rcRev[i]) ? -1 : 1);
mav->setParameter(0, minTpl.arg(i+1), rcMin[i]);
mav->setParameter(0, trimTpl.arg(i+1), rcTrim[i]);
mav->setParameter(0, maxTpl.arg(i+1), rcMax[i]);
mav->setParameter(0, revTpl.arg(i+1), (rcRev[i]) ? -1 : 1);
}
// Write mappings
......@@ -222,13 +222,13 @@ void QGCVehicleConfig::requestCalibrationRC()
for (unsigned int i = 0; i < chanMax; ++i)
{
mav->requestParameter(0, minTpl.arg(i));
mav->requestParameter(0, minTpl.arg(i+1));
QGC::SLEEP::usleep(5000);
mav->requestParameter(0, trimTpl.arg(i));
mav->requestParameter(0, trimTpl.arg(i+1));
QGC::SLEEP::usleep(5000);
mav->requestParameter(0, maxTpl.arg(i));
mav->requestParameter(0, maxTpl.arg(i+1));
QGC::SLEEP::usleep(5000);
mav->requestParameter(0, revTpl.arg(i));
mav->requestParameter(0, revTpl.arg(i+1));
QGC::SLEEP::usleep(5000);
}
}
......@@ -379,7 +379,7 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (minTpl.exactMatch(parameterName)) {
bool ok;
unsigned int index = parameterName.mid(2, 1).toInt(&ok);
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && (index > 0) && (index < chanMax))
{
rcMin[index] = value.toInt();
......@@ -388,7 +388,7 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (maxTpl.exactMatch(parameterName)) {
bool ok;
unsigned int index = parameterName.mid(2, 1).toInt(&ok);
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && (index > 0) && (index < chanMax))
{
rcMax[index] = value.toInt();
......@@ -397,7 +397,7 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (trimTpl.exactMatch(parameterName)) {
bool ok;
unsigned int index = parameterName.mid(2, 1).toInt(&ok);
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && (index > 0) && (index < chanMax))
{
rcTrim[index] = value.toInt();
......@@ -406,7 +406,7 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (revTpl.exactMatch(parameterName)) {
bool ok;
unsigned int index = parameterName.mid(2, 1).toInt(&ok);
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && (index > 0) && (index < chanMax))
{
rcRev[index] = (value.toInt() == -1) ? true : false;
......
......@@ -40,13 +40,16 @@
<item row="0" column="0" colspan="2">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="rcTab">
<attribute name="title">
<string>RC Calibration</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5" columnstretch="1,1,10,1,1,10,1,1,1,1,1,1,1,1,10">
<property name="topMargin">
<number>20</number>
</property>
<item row="8" column="1" rowspan="3">
<widget class="QSlider" name="throttleSlider">
<property name="minimum">
......@@ -716,10 +719,26 @@
<string>Sensor Calibration</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6" columnstretch="70,30">
<property name="topMargin">
<number>20</number>
</property>
<item row="0" column="1">
<layout class="QVBoxLayout" name="sensorLayout"/>
</item>
<item row="0" column="0">
<item row="1" column="1">
<spacer name="verticalSpacer_8">
<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 row="0" column="0" rowspan="2">
<widget class="QTextBrowser" name="sensorTips">
<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;
......@@ -732,7 +751,7 @@ p, li { white-space: pre-wrap; }
&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;&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:16pt;&quot;&gt;Magnetometer Calibration&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:16pt;&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;&quot;&gt;Carefully follow the instructions. Click on MAG to start the calibration. Watch the communication console for further instructions (Available through Main Menu -&amp;gt; Tool Widgets -&amp;gt; Communication Console). Do not calibrate the vehicle in vincinity of metal, e.g. from a table or chair. Start the calibration, leave the system unmoved on the table. Wait for the double beep. Next move the system in a figure eight, roll and pitch it strongly and perform the figure eight also upside-down. The calibration is finished after the triple beep.&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-size:12pt;&quot;&gt;Carefully follow the instructions. Click on MAG to start the calibration. Watch the communication console for further instructions (Available through Main Menu -&amp;gt; Tool Widgets -&amp;gt; Communication Console). Do not calibrate the vehicle in vincinity of metal, e.g. from a table or chair. Start the calibration, leave the system unmoved on the table. Wait for the double beep. Next move the system in a figure eight, roll and pitch it strongly, rotate around all axes and perform the figure eight also upside-down. The calibration is finished after the triple beep.&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;&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:16pt;&quot;&gt;Accelerometer Calibration&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:16pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
......@@ -746,71 +765,106 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<widget class="QWidget" name="multirotorTab">
<attribute name="title">
<string>Multirotor Control</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QComboBox" name="multiRotorComboBox"/>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_3" columnstretch="80,0,0">
<property name="topMargin">
<number>20</number>
</property>
<item row="0" column="2">
<widget class="QPushButton" name="loadMultiRotorDefaultsButton">
<property name="text">
<string>Load Platform Defaults</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QWidget" name="multiRotorControlWidget" native="true">
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="1">
<widget class="QGroupBox" name="multiRotorControlPositionGroupBox">
<property name="title">
<string>Position</string>
<item row="0" column="0">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="multiRotorComboBox"/>
</item>
<item row="2" column="0" colspan="3">
<widget class="QGroupBox" name="multiRotorControlPositionGroupBox">
<property name="title">
<string>Position</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_2">
<property name="widgetResizable">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QVBoxLayout" name="multiRotorPositionLayout"/>
</item>
</layout>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>651</width>
<height>203</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="multiRotorPositionLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="multiRotorControlAttitudeGroupBox">
<property name="title">
<string>Attitude</string>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QGroupBox" name="multiRotorControlAttitudeGroupBox">
<property name="title">
<string>Attitude</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="margin">
<number>0</number>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>651</width>
<height>204</height>
</rect>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>541</width>
<height>417</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="multiRotorAttitudeLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="multiRotorAttitudeLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
......@@ -822,37 +876,103 @@ p, li { white-space: pre-wrap; }
<attribute name="title">
<string>Fixed Wing Control</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="fixedWingControlAttitudeGroupBox">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="65,30,19,1">
<property name="topMargin">
<number>20</number>
</property>
<item row="3" column="0" colspan="4">
<widget class="QGroupBox" name="fixedWingControlPositionGroupBox">
<property name="title">
<string>Attitude</string>
<string>Position</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="fixedWingAttitudeLayout"/>
<widget class="QScrollArea" name="scrollArea_3">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>651</width>
<height>203</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="fixedWingPositionLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<item row="0" column="1">
<widget class="QComboBox" name="fixedWingComboBox"/>
</item>
<item row="0" column="1">
<item row="0" column="2" colspan="2">
<widget class="QPushButton" name="loadFixedWingDefaultsButton">
<property name="text">
<string>Load Platform Defaults</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="fixedWingControlPositionGroupBox">
<item row="0" column="0">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="4">
<widget class="QGroupBox" name="fixedWingControlAttitudeGroupBox">
<property name="title">
<string>Position</string>
<string>Attitude</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="fixedWingPositionLayout"/>
<widget class="QScrollArea" name="scrollArea_4">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_4">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>651</width>
<height>204</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="fixedWingAttitudeLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
......
......@@ -2,6 +2,7 @@
#include <QContextMenuEvent>
#include <QSettings>
#include <QTimer>
#include <QToolTip>
#include "QGCParamSlider.h"
#include "ui_QGCParamSlider.h"
......@@ -53,7 +54,8 @@ QGCParamSlider::QGCParamSlider(QWidget *parent) :
connect(ui->readButton, SIGNAL(clicked()), this, SLOT(requestParameter()));
connect(ui->editRefreshParamsButton, SIGNAL(clicked()), this, SLOT(refreshParamList()));
connect(ui->editInfoCheckBox, SIGNAL(clicked(bool)), this, SLOT(showInfo(bool)));
// connect to self
connect(ui->infoLabel, SIGNAL(released()), this, SLOT(showTooltip()));
// Set the current UAS if present
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
}
......@@ -63,6 +65,17 @@ QGCParamSlider::~QGCParamSlider()
delete ui;
}
void QGCParamSlider::showTooltip()
{
QWidget* sender = dynamic_cast<QWidget*>(QObject::sender());
if (sender)
{
QPoint point = mapToGlobal(pos());
QToolTip::showText(point, sender->toolTip());
}
}
void QGCParamSlider::refreshParamList()
{
ui->editSelectParamComboBox->setEnabled(true);
......@@ -70,6 +83,7 @@ void QGCParamSlider::refreshParamList()
if (uas)
{
uas->getParamManager()->requestParameterList();
ui->editStatusLabel->setText(tr("Parameter list updating.."));
}
}
......@@ -89,7 +103,7 @@ void QGCParamSlider::setActiveUAS(UASInterface* activeUas)
requestParameter();
// Set param info
QString text = uas->getParamManager()->getParamInfo(parameterName);
ui->infoLabel->setText(text);
ui->infoLabel->setToolTip(text);
// Force-uncheck and hide label if no description is available
if (ui->editInfoCheckBox->isChecked())
{
......@@ -345,6 +359,11 @@ void QGCParamSlider::setParameterValue(int uas, int component, int paramCount, i
}
ui->valueSlider->setValue(floatToScaledInt(value.toDouble()));
}
if (paramIndex == paramCount - 1)
{
ui->editStatusLabel->setText(tr("Complete parameter list received."));
}
}
void QGCParamSlider::changeEvent(QEvent *e)
......
......@@ -41,6 +41,8 @@ public slots:
void setParamValue(int value);
/** @brief Show descriptive text next to slider */
void showInfo(bool enable);
/** @brief Show tool tip of calling element */
void showTooltip();
protected slots:
/** @brief Request the parameter of this widget from the MAV */
......
......@@ -13,7 +13,7 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="10,0,0,0,0,0,0,0,0,0">
<layout class="QGridLayout" name="gridLayout" columnstretch="10,0,0,0,0,0,0,0,0,0,0">
<property name="leftMargin">
<number>6</number>
</property>
......@@ -32,7 +32,7 @@
<property name="verticalSpacing">
<number>12</number>
</property>
<item row="2" column="5">
<item row="2" column="6">
<widget class="QSpinBox" name="intValueSpinBox">
<property name="minimum">
<number>-999999999</number>
......@@ -42,7 +42,7 @@
</property>
</widget>
</item>
<item row="3" column="5" colspan="3">
<item row="3" column="6" colspan="3">
<widget class="QComboBox" name="editSelectParamComboBox">
<property name="enabled">
<bool>false</bool>
......@@ -55,39 +55,68 @@
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="nameLabel">
<item row="0" column="0" colspan="11">
<widget class="Line" name="editLine1">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="7" colspan="2">
<widget class="QSlider" name="valueSlider">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Name</string>
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<property name="maximum">
<number>1000000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="7">
<widget class="QDoubleSpinBox" name="editMinSpinBox">
<property name="prefix">
<string>MIN: </string>
<item row="4" column="10">
<widget class="QPushButton" name="editDoneButton">
<property name="text">
<string>Done</string>
</property>
<property name="minimum">
<double>-999999999.000000000000000</double>
</widget>
</item>
<item row="6" column="0" colspan="11">
<widget class="Line" name="editLine2">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="2" colspan="5">
<widget class="QLineEdit" name="editNameLabel">
<item row="3" column="9">
<widget class="QCheckBox" name="editInfoCheckBox">
<property name="text">
<string>&lt;Parameter Name / Label&gt;</string>
<string>Show Info</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
......@@ -104,77 +133,49 @@
</property>
</spacer>
</item>
<item row="2" column="8">
<widget class="QPushButton" name="writeButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Transmit the current slider value to the system</string>
</property>
<property name="statusTip">
<string>Transmit the current slider value to the system</string>
<item row="3" column="10">
<widget class="QPushButton" name="editRefreshParamsButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>W</string>
<string>Refresh</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="10">
<widget class="Line" name="editLine2">
<property name="minimumSize">
<item row="5" column="2" colspan="9">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
<width>20</width>
<height>40</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</spacer>
</item>
<item row="2" column="6" colspan="2">
<widget class="QSlider" name="valueSlider">
<item row="2" column="10">
<widget class="QPushButton" name="readButton">
<property name="minimumSize">
<size>
<width>60</width>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="maximum">
<number>1000000</number>
<property name="toolTip">
<string>Read the current parameter value on the system</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<property name="statusTip">
<string>Read the current parameter value on the system</string>
</property>
</widget>
</item>
<item row="3" column="8">
<widget class="QCheckBox" name="editInfoCheckBox">
<property name="text">
<string>Show Info</string>
</property>
<property name="checked">
<bool>true</bool>
<string>R</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="3">
<item row="3" column="1" colspan="5">
<widget class="QComboBox" name="editSelectComponentComboBox">
<property name="enabled">
<bool>false</bool>
......@@ -187,36 +188,59 @@
</property>
</widget>
</item>
<item row="1" column="1" colspan="7">
<widget class="QLineEdit" name="editNameLabel">
<property name="text">
<string>&lt;Parameter Name / Label&gt;</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="8">
<widget class="QLabel" name="editStatusLabel">
<property name="text">
<string>Please click first on refresh to update selection menus..</string>
</property>
</widget>
</item>
<item row="2" column="9">
<widget class="QPushButton" name="readButton">
<widget class="QPushButton" name="writeButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Read the current parameter value on the system</string>
<string>Transmit the current slider value to the system</string>
</property>
<property name="statusTip">
<string>Read the current parameter value on the system</string>
<string>Transmit the current slider value to the system</string>
</property>
<property name="text">
<string>R</string>
<string>W</string>
</property>
</widget>
</item>
<item row="5" column="2" colspan="6">
<widget class="QLabel" name="editStatusLabel">
<property name="text">
<string>Please click first on refresh to update selection menus..</string>
<item row="2" column="4">
<widget class="QDoubleSpinBox" name="doubleValueSpinBox">
<property name="minimum">
<double>-999999999.000000000000000</double>
</property>
<property name="maximum">
<double>999999999.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="8" colspan="2">
<widget class="QDoubleSpinBox" name="editMaxSpinBox">
<item row="1" column="8">
<widget class="QDoubleSpinBox" name="editMinSpinBox">
<property name="prefix">
<string>MAX: </string>
<string>MIN: </string>
</property>
<property name="minimum">
<double>-999999999.000000000000000</double>
......@@ -226,8 +250,11 @@
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QDoubleSpinBox" name="doubleValueSpinBox">
<item row="1" column="9" colspan="2">
<widget class="QDoubleSpinBox" name="editMaxSpinBox">
<property name="prefix">
<string>MAX: </string>
</property>
<property name="minimum">
<double>-999999999.000000000000000</double>
</property>
......@@ -236,54 +263,37 @@
</property>
</widget>
</item>
<item row="1" column="1" rowspan="6">
<widget class="QTextBrowser" name="infoLabel"/>
</item>
<item row="0" column="0" colspan="10">
<widget class="Line" name="editLine1">
<item row="2" column="2">
<widget class="QLabel" name="nameLabel">
<property name="minimumSize">
<size>
<width>0</width>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="9">
<widget class="QPushButton" name="editRefreshParamsButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Refresh</string>
<string>Name</string>
</property>
</widget>
</item>
<item row="5" column="9">
<widget class="QPushButton" name="editDoneButton">
<property name="text">
<string>Done</string>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="2" colspan="8">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="2" column="3">
<widget class="QToolButton" name="infoLabel">
<property name="text">
<string/>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="icon">
<iconset resource="../../../qgroundcontrol.qrc">
<normaloff>:/files/images/status/dialog-information.svg</normaloff>:/files/images/status/dialog-information.svg</iconset>
</property>
</spacer>
</widget>
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../../qgroundcontrol.qrc"/>
</resources>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment