Commit 897ee64f authored by Michael Carpenter's avatar Michael Carpenter

Changes for ArduPlane level to be shown when ArduPlane firmware is loaded

parent b22d4023
......@@ -39,6 +39,7 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
ui.frameTypeButton->setVisible(false);
ui.compassButton->setVisible(false);
ui.accelCalibrateButton->setVisible(false);
ui.arduPlaneLevelButton->setVisible(false);
ui.radioCalibrateButton->setVisible(false);
ui.optionalHardwareButton->setVisible(false);
//ui.radio3DRButton->setVisible(false);
......@@ -50,10 +51,6 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
ui.cameraGimbalButton->setVisible(false);
//ui.antennaTrackerButton->setVisible(false);
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.frameTypeButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.accelCalibrateButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.radio3DRButton,SLOT(setShown(bool)));
connect(ui.optionalHardwareButton,SIGNAL(toggled(bool)),ui.batteryMonitorButton,SLOT(setShown(bool)));
......@@ -87,6 +84,11 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
buttonToConfigWidgetMap[ui.accelCalibrateButton] = accelConfig;
connect(ui.accelCalibrateButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
planeLevel = new ApmPlaneLevel(this);
ui.stackedWidget->addWidget(planeLevel);
buttonToConfigWidgetMap[ui.arduPlaneLevelButton] = planeLevel;
connect(ui.arduPlaneLevelButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
radioConfig = new RadioCalibrationConfig(this);
ui.stackedWidget->addWidget(radioConfig);
buttonToConfigWidgetMap[ui.radioCalibrateButton] = radioConfig;
......@@ -159,6 +161,29 @@ void ApmHardwareConfig::activeUASSet(UASInterface *uas)
{
return;
}
if (uas->getSystemType() == MAV_TYPE_FIXED_WING)
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.arduPlaneLevelButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
}
else if (uas->getSystemType() == MAV_TYPE_QUADROTOR)
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.frameTypeButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.accelCalibrateButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
}
else if (uas->getSystemType() == MAV_TYPE_GROUND_ROVER)
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
}
else
{
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.compassButton,SLOT(setShown(bool)));
connect(ui.manditoryHardware,SIGNAL(toggled(bool)),ui.radioCalibrateButton,SLOT(setShown(bool)));
}
ui.firmwareButton->setVisible(true);
ui.manditoryHardware->setVisible(true);
ui.manditoryHardware->setChecked(false);
......
......@@ -48,6 +48,7 @@ This file is part of the QGROUNDCONTROL project
#include "OsdConfig.h"
#include "CameraGimbalConfig.h"
#include "AntennaTrackerConfig.h"
#include "ApmPlaneLevel.h"
class ApmHardwareConfig : public QWidget
{
......@@ -70,6 +71,7 @@ private:
OsdConfig *osdConfig;
CameraGimbalConfig *cameraGimbalConfig;
AntennaTrackerConfig *antennaTrackerConfig;
ApmPlaneLevel *planeLevel;
private slots:
void activeUASSet(UASInterface *uas);
void activateStackedWidget();
......
......@@ -43,7 +43,7 @@
<x>0</x>
<y>0</y>
<width>156</width>
<height>635</height>
<height>676</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
......@@ -129,6 +129,25 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="arduPlaneLevelButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="text">
<string> ArduPlane Level</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="radioCalibrateButton">
<property name="minimumSize">
......
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