Commit c8e46217 authored by Lorenz Meier's avatar Lorenz Meier

Minor improvements in airframe config, param transfer / reboot are still not...

Minor improvements in airframe config, param transfer / reboot are still not quite doing what we want
parent d83f03f6
...@@ -58,6 +58,8 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) : ...@@ -58,6 +58,8 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) :
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS())); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS()));
setActiveUAS(UASManager::instance()->getActiveUAS()); setActiveUAS(UASManager::instance()->getActiveUAS());
uncheckAll();
} }
void QGCPX4AirframeConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value) void QGCPX4AirframeConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
...@@ -194,14 +196,15 @@ void QGCPX4AirframeConfig::applyAndReboot() ...@@ -194,14 +196,15 @@ void QGCPX4AirframeConfig::applyAndReboot()
paramMgr->setPendingParam(components.first(),"SYS_AUTOSTART", (qint32)selectedId); paramMgr->setPendingParam(components.first(),"SYS_AUTOSTART", (qint32)selectedId);
//need to set autoconfig in order for PX4 to pick up the selected airframe params //need to set autoconfig in order for PX4 to pick up the selected airframe params
setAutoConfig(true); if (ui->defaultGainsCheckBox->checkState() == Qt::Checked)
setAutoConfig(true);
// Send pending params and then write them to persistent storage when done // Send pending params and then write them to persistent storage when done
paramMgr->sendPendingParameters(true); paramMgr->sendPendingParameters(true);
// Reboot // Reboot
//TODO right now this relies upon the above send & persist finishing before the reboot command is received... //TODO right now this relies upon the above send & persist finishing before the reboot command is received...
QGC::SLEEP::msleep(3000); QGC::SLEEP::sleep(5);
mav->executeCommand(MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN, 1, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0); mav->executeCommand(MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN, 1, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
} }
......
...@@ -14,7 +14,17 @@ ...@@ -14,7 +14,17 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2"> <item row="1" column="2">
<widget class="QCheckBox" name="defaultGainsCheckBox">
<property name="text">
<string>Set default airframe settings</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<widget class="QScrollArea" name="scrollArea"> <widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
...@@ -23,7 +33,7 @@ ...@@ -23,7 +33,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-175</y> <y>0</y>
<width>762</width> <width>762</width>
<height>531</height> <height>531</height>
</rect> </rect>
...@@ -335,6 +345,13 @@ ...@@ -335,6 +345,13 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="1" column="3">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>Apply and Restart</string>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="statusLabel"> <widget class="QLabel" name="statusLabel">
<property name="text"> <property name="text">
...@@ -343,11 +360,17 @@ ...@@ -343,11 +360,17 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QPushButton" name="applyButton"> <spacer name="horizontalSpacer">
<property name="text"> <property name="orientation">
<string>Apply and Restart</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
......
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