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) :
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS()));
setActiveUAS(UASManager::instance()->getActiveUAS());
uncheckAll();
}
void QGCPX4AirframeConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
......@@ -194,14 +196,15 @@ void QGCPX4AirframeConfig::applyAndReboot()
paramMgr->setPendingParam(components.first(),"SYS_AUTOSTART", (qint32)selectedId);
//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
paramMgr->sendPendingParameters(true);
// Reboot
//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);
}
......
......@@ -14,7 +14,17 @@
<string>Form</string>
</property>
<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">
<property name="widgetResizable">
<bool>true</bool>
......@@ -23,7 +33,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-175</y>
<y>0</y>
<width>762</width>
<height>531</height>
</rect>
......@@ -335,6 +345,13 @@
</widget>
</widget>
</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">
<widget class="QLabel" name="statusLabel">
<property name="text">
......@@ -343,11 +360,17 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>Apply and Restart</string>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</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