Commit 5a1ae275 authored by Lorenz Meier's avatar Lorenz Meier

Add additional config items (purposefully not compiling yet, consider following commit)

parent 1caf009e
......@@ -397,7 +397,8 @@ QPushButton, QToolButton {
}
QPushButton#advancedMenuButton, QPushButton#airframeMenuButton, QPushButton#firmwareMenuButton,
QPushButton#generalMenuButton, QPushButton#rcMenuButton, QPushButton#sensorMenuButton {
QPushButton#tuningMenuButton, QPushButton#rcMenuButton, QPushButton#sensorMenuButton,
QPushButton#flightModeMenuButton, QPushButton#safetyConfigButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #333, stop: 1 #111);
border-radius: 5px;
min-height: 64px;
......
......@@ -198,6 +198,7 @@
<file>files/images/px4/calibration/3dr_gps/gps_01.png</file>
<file>files/images/px4/calibration/3dr_gps/gps_24.png</file>
<file>files/images/px4/calibration/3dr_gps/gps_00.png</file>
<file>files/images/px4/menu/toggle_switch.png</file>
</qresource>
<qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file>
......
......@@ -91,11 +91,19 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
ui->airframeMenuButton->setEnabled(false);
ui->sensorMenuButton->setEnabled(false);
ui->rcMenuButton->setEnabled(false);
ui->generalMenuButton->hide();
px4AirframeConfig = new QGCPX4AirframeConfig(this);
ui->airframeLayout->addWidget(px4AirframeConfig);
px4SafetyConfig = new QGCPX4SafetyConfig(this);
ui->safetyConfigLayout->addWidget(px4SafetyConfig);
px4TuningConfig = new QGCPX4TuningConfig(this);
ui->tuningLayout->addWidget(px4TuningConfig);
px4FlightModeConfig = new QGCPX4FlightModeConfig(this);
ui->flightModeLayout->addWidget(px4FlightModeConfig);
px4SensorCalibration = new QGCPX4SensorCalibration(this);
ui->sensorLayout->addWidget(px4SensorCalibration);
......@@ -153,8 +161,12 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
this, SLOT(copyAttitudeTrim()));
connect(ui->sensorMenuButton,SIGNAL(clicked()),
this,SLOT(sensorMenuButtonClicked()));
connect(ui->generalMenuButton,SIGNAL(clicked()),
this,SLOT(generalMenuButtonClicked()));
connect(ui->flightModeMenuButton, SIGNAL(clicked()),
this, SLOT(flightModeMenuButtonClicked()));
connect(ui->safetyConfigButton, SIGNAL(clicked()),
this, SLOT(safetyConfigMenuButtonClicked()));
connect(ui->tuningMenuButton,SIGNAL(clicked()),
this,SLOT(tuningMenuButtonClicked()));
connect(ui->advancedMenuButton,SIGNAL(clicked()),
this,SLOT(advancedMenuButtonClicked()));
connect(ui->airframeMenuButton, SIGNAL(clicked()),
......@@ -279,38 +291,49 @@ QGCPX4VehicleConfig::~QGCPX4VehicleConfig()
void QGCPX4VehicleConfig::rcMenuButtonClicked()
{
//TODO eg ui->stackedWidget->findChild("rcConfig");
ui->stackedWidget->setCurrentIndex(WIDGET_INDEX_RC);
ui->stackedWidget->setCurrentWidget(ui->rcTab);
ui->tabTitleLabel->setText(tr("Radio Calibration"));
}
void QGCPX4VehicleConfig::sensorMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(WIDGET_INDEX_SENSOR_CAL);
ui->stackedWidget->setCurrentWidget(ui->sensorTab);
ui->tabTitleLabel->setText(tr("Sensor Calibration"));
}
void QGCPX4VehicleConfig::generalMenuButtonClicked()
void QGCPX4VehicleConfig::tuningMenuButtonClicked()
{
ui->stackedWidget->setCurrentWidget(ui->generalTab);
ui->tabTitleLabel->setText(tr("Controller Tuning"));
}
void QGCPX4VehicleConfig::flightModeMenuButtonClicked()
{
ui->stackedWidget->setCurrentWidget(ui->flightModeTab);
ui->tabTitleLabel->setText(tr("Flight Mode Configuration"));
}
void QGCPX4VehicleConfig::safetyConfigMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(WIDGET_INDEX_GENERAL_CONFIG);
ui->tabTitleLabel->setText(tr("General Configuration Options"));
ui->stackedWidget->setCurrentWidget(ui->safetyConfigTab);
ui->tabTitleLabel->setText(tr("Safety Feature Configuration"));
}
void QGCPX4VehicleConfig::advancedMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(WIDGET_INDEX_ADV_CONFIG);
ui->stackedWidget->setCurrentWidget(ui->advancedTab);
ui->tabTitleLabel->setText(tr("Advanced Configuration Options"));
}
void QGCPX4VehicleConfig::airframeMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(WIDGET_INDEX_AIRFRAME_CONFIG);
ui->stackedWidget->setCurrentWidget(ui->airframeTab);
ui->tabTitleLabel->setText(tr("Airframe Configuration"));
}
void QGCPX4VehicleConfig::firmwareMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(WIDGET_INDEX_FIRMWARE);
ui->stackedWidget->setCurrentWidget(ui->firmwareTab);
ui->tabTitleLabel->setText(tr("Firmware Upgrade"));
}
......
......@@ -40,7 +40,7 @@ public:
public slots:
void rcMenuButtonClicked();
void sensorMenuButtonClicked();
void generalMenuButtonClicked();
void tuningMenuButtonClicked();
void advancedMenuButtonClicked();
void airframeMenuButtonClicked();
void firmwareMenuButtonClicked();
......
......@@ -51,7 +51,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>1</number>
<number>4</number>
</property>
<widget class="QWidget" name="firmwareTab">
<layout class="QVBoxLayout" name="firmwareLayout"/>
......@@ -988,7 +988,7 @@
<widget class="QWidget" name="airframeTab">
<layout class="QHBoxLayout" name="airframeLayout"/>
</widget>
<widget class="QWidget" name="generalTab">
<widget class="QWidget" name="tuningTab">
<property name="font">
<font>
<pointsize>16</pointsize>
......@@ -996,7 +996,7 @@
<bold>true</bold>
</font>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<layout class="QVBoxLayout" name="tuningLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
......@@ -1027,8 +1027,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>21</width>
<height>16</height>
<width>516</width>
<height>1043</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
......@@ -1082,8 +1082,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>21</width>
<height>16</height>
<width>515</width>
<height>1043</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
......@@ -1151,8 +1151,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>16</width>
<height>16</height>
<width>600</width>
<height>1017</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
......@@ -1264,6 +1264,12 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="flightModeTab">
<layout class="QVBoxLayout" name="flightModeLayout"/>
</widget>
<widget class="QWidget" name="safetyConfigTab">
<layout class="QVBoxLayout" name="safetyConfigLayout"/>
</widget>
</widget>
</item>
</layout>
......@@ -1312,8 +1318,8 @@ Upgrade</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
......@@ -1330,8 +1336,8 @@ Config</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
......@@ -1354,8 +1360,8 @@ Calibration</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
......@@ -1384,14 +1390,38 @@ Calibration</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="flightModeMenuButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>Flight Mode
Config</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/toggle_switch.png</normaloff>:/files/images/px4/menu/toggle_switch.png</iconset>
</property>
<property name="iconSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="generalMenuButton">
<widget class="QPushButton" name="safetyConfigButton">
<property name="minimumSize">
<size>
<width>100</width>
......@@ -1399,7 +1429,7 @@ Calibration</string>
</size>
</property>
<property name="text">
<string>General
<string>Safety
Config</string>
</property>
<property name="icon">
......@@ -1408,8 +1438,32 @@ Config</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="tuningMenuButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>Controller
Tuning</string>
</property>
<property name="icon">
<iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/menu/cogwheels.png</normaloff>:/files/images/px4/menu/cogwheels.png</iconset>
</property>
<property name="iconSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
......@@ -1432,8 +1486,8 @@ Config</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
<width>60</width>
<height>60</height>
</size>
</property>
</widget>
......
......@@ -238,6 +238,7 @@ void QGCParamWidget::handleOnboardParameterListUpToDate()
{
//turn off updates while we refresh the entire list
tree->setUpdatesEnabled(false);
qDebug() << "WARN: LIST UPDATE";
//rewrite the component item tree after receiving the full list
QMap<int, QMap<QString, QVariant>*>::iterator i;
......
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