Commit 771d74b7 authored by Michael Carpenter's avatar Michael Carpenter

UI for a bunch of software configuration pages

parent a3f043af
......@@ -250,7 +250,13 @@ FORMS += src/ui/MainWindow.ui \
src/ui/configuration/OpticalFlowConfig.ui \
src/ui/configuration/OsdConfig.ui \
src/ui/configuration/AntennaTrackerConfig.ui \
src/ui/configuration/CameraGimbalConfig.ui
src/ui/configuration/CameraGimbalConfig.ui \
src/ui/configuration/BasicPidConfig.ui \
src/ui/configuration/StandardParamConfig.ui \
src/ui/configuration/GeoFenceConfig.ui \
src/ui/configuration/FailSafeConfig.ui \
src/ui/configuration/AdvancedParamConfig.ui \
src/ui/configuration/ArduCopterPidConfig.ui
INCLUDEPATH += src \
src/ui \
src/ui/linechart \
......@@ -425,7 +431,13 @@ HEADERS += src/MG.h \
src/ui/configuration/OsdConfig.h \
src/ui/configuration/AntennaTrackerConfig.h \
src/ui/configuration/CameraGimbalConfig.h \
src/ui/configuration/AP2ConfigWidget.h
src/ui/configuration/AP2ConfigWidget.h \
src/ui/configuration/BasicPidConfig.h \
src/ui/configuration/StandardParamConfig.h \
src/ui/configuration/GeoFenceConfig.h \
src/ui/configuration/FailSafeConfig.h \
src/ui/configuration/AdvancedParamConfig.h \
src/ui/configuration/ArduCopterPidConfig.h
# Google Earth is only supported on Mac OS and Windows with Visual Studio Compiler
macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010|win32-msvc2012::HEADERS += src/ui/map3D/QGCGoogleEarthView.h
......@@ -618,7 +630,13 @@ SOURCES += src/main.cc \
src/ui/configuration/OsdConfig.cc \
src/ui/configuration/AntennaTrackerConfig.cc \
src/ui/configuration/CameraGimbalConfig.cc \
src/ui/configuration/AP2ConfigWidget.cc
src/ui/configuration/AP2ConfigWidget.cc \
src/ui/configuration/BasicPidConfig.cc \
src/ui/configuration/StandardParamConfig.cc \
src/ui/configuration/GeoFenceConfig.cc \
src/ui/configuration/FailSafeConfig.cc \
src/ui/configuration/AdvancedParamConfig.cc \
src/ui/configuration/ArduCopterPidConfig.cc
# Enable Google Earth only on Mac OS and Windows with Visual Studio compiler
macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010|win32-msvc2012::SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
......
#include "AdvancedParamConfig.h"
AdvancedParamConfig::AdvancedParamConfig(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
}
AdvancedParamConfig::~AdvancedParamConfig()
{
}
#ifndef ADVANCEDPARAMCONFIG_H
#define ADVANCEDPARAMCONFIG_H
#include <QWidget>
#include "ui_AdvancedParamConfig.h"
class AdvancedParamConfig : public QWidget
{
Q_OBJECT
public:
explicit AdvancedParamConfig(QWidget *parent = 0);
~AdvancedParamConfig();
private:
Ui::AdvancedParamConfig ui;
};
#endif // ADVANCEDPARAMCONFIG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AdvancedParamConfig</class>
<widget class="QWidget" name="AdvancedParamConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>181</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;h2&gt;Advanced Params&lt;/h2&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
......@@ -40,7 +40,6 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
ui.compassButton->setVisible(false);
ui.accelCalibrateButton->setVisible(false);
ui.radioCalibrateButton->setVisible(false);
ui.flightModesButton->setVisible(false);
ui.optionalHardwareButton->setVisible(false);
//ui.radio3DRButton->setVisible(false);
ui.batteryMonitorButton->setVisible(false);
......@@ -55,7 +54,6 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
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.manditoryHardware,SIGNAL(toggled(bool)),ui.flightModesButton,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)));
......@@ -94,10 +92,6 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
buttonToConfigWidgetMap[ui.radioCalibrateButton] = radioConfig;
connect(ui.radioCalibrateButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
flightConfig = new FlightModeConfig(this);
ui.stackedWidget->addWidget(flightConfig);
buttonToConfigWidgetMap[ui.flightModesButton] = flightConfig;
connect(ui.flightModesButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
radio3drConfig = new Radio3DRConfig(this);
ui.stackedWidget->addWidget(radio3drConfig);
......
......@@ -40,7 +40,6 @@ This file is part of the QGROUNDCONTROL project
#include "CompassConfig.h"
#include "AccelCalibrationConfig.h"
#include "RadioCalibrationConfig.h"
#include "FlightModeConfig.h"
#include "Radio3DRConfig.h"
#include "BatteryMonitorConfig.h"
#include "SonarConfig.h"
......@@ -62,7 +61,6 @@ private:
CompassConfig *compassConfig;
AccelCalibrationConfig *accelConfig;
RadioCalibrationConfig *radioConfig;
FlightModeConfig *flightConfig;
Radio3DRConfig *radio3drConfig;
BatteryMonitorConfig *batteryConfig;
......
......@@ -43,7 +43,7 @@
<x>0</x>
<y>0</y>
<width>156</width>
<height>676</height>
<height>635</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
......@@ -154,22 +154,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="flightModesButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string> Flight Modes</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="optionalHardwareButton">
<property name="minimumSize">
......
......@@ -4,8 +4,82 @@
ApmSoftwareConfig::ApmSoftwareConfig(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
ui.basicPidsButton->setVisible(false);
ui.flightModesButton->setVisible(false);
ui.standardParamButton->setVisible(false);
ui.geoFenceButton->setVisible(false);
ui.failSafeButton->setVisible(false);
ui.advancedParamButton->setVisible(false);
ui.advParamListButton->setVisible(false);
ui.arduCoperPidButton->setVisible(false);
basicPidConfig = new BasicPidConfig(this);
ui.stackedWidget->addWidget(basicPidConfig);
buttonToConfigWidgetMap[ui.basicPidsButton] = basicPidConfig;
connect(ui.basicPidsButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
flightConfig = new FlightModeConfig(this);
ui.stackedWidget->addWidget(flightConfig);
buttonToConfigWidgetMap[ui.flightModesButton] = flightConfig;
connect(ui.flightModesButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
standardParamConfig = new StandardParamConfig(this);
ui.stackedWidget->addWidget(standardParamConfig);
buttonToConfigWidgetMap[ui.standardParamButton] = standardParamConfig;
connect(ui.standardParamButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
geoFenceConfig = new GeoFenceConfig(this);
ui.stackedWidget->addWidget(geoFenceConfig);
buttonToConfigWidgetMap[ui.geoFenceButton] = geoFenceConfig;
connect(ui.geoFenceButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
failSafeConfig = new FailSafeConfig(this);
ui.stackedWidget->addWidget(failSafeConfig);
buttonToConfigWidgetMap[ui.failSafeButton] = failSafeConfig;
connect(ui.failSafeButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
advancedParamConfig = new AdvancedParamConfig(this);
ui.stackedWidget->addWidget(advancedParamConfig);
buttonToConfigWidgetMap[ui.advancedParamButton] = advancedParamConfig;
connect(ui.advancedParamButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
arduCoperPidConfig = new ArduCopterPidConfig(this);
ui.stackedWidget->addWidget(arduCoperPidConfig);
buttonToConfigWidgetMap[ui.arduCoperPidButton] = arduCoperPidConfig;
connect(ui.arduCoperPidButton,SIGNAL(clicked()),this,SLOT(activateStackedWidget()));
connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
if (UASManager::instance()->getActiveUAS())
{
activeUASSet(UASManager::instance()->getActiveUAS());
}
}
ApmSoftwareConfig::~ApmSoftwareConfig()
{
}
void ApmSoftwareConfig::activateStackedWidget()
{
if (buttonToConfigWidgetMap.contains(sender()))
{
ui.stackedWidget->setCurrentWidget(buttonToConfigWidgetMap[sender()]);
}
}
void ApmSoftwareConfig::activeUASSet(UASInterface *uas)
{
if (!uas)
{
return;
}
ui.basicPidsButton->setVisible(true);
ui.flightModesButton->setVisible(true);
ui.standardParamButton->setVisible(true);
ui.geoFenceButton->setVisible(true);
ui.failSafeButton->setVisible(true);
ui.advancedParamButton->setVisible(true);
ui.advParamListButton->setVisible(true);
ui.arduCoperPidButton->setVisible(true);
}
......@@ -3,6 +3,16 @@
#include <QWidget>
#include "ui_ApmSoftwareConfig.h"
#include "FlightModeConfig.h"
#include "BasicPidConfig.h"
#include "StandardParamConfig.h"
#include "GeoFenceConfig.h"
#include "FailSafeConfig.h"
#include "AdvancedParamConfig.h"
#include "ArduCopterPidConfig.h"
#include "UASInterface.h"
#include "UASManager.h"
class ApmSoftwareConfig : public QWidget
{
......@@ -11,9 +21,19 @@ class ApmSoftwareConfig : public QWidget
public:
explicit ApmSoftwareConfig(QWidget *parent = 0);
~ApmSoftwareConfig();
private slots:
void activateStackedWidget();
void activeUASSet(UASInterface *uas);
private:
Ui::ApmSoftwareConfig ui;
BasicPidConfig *basicPidConfig;
FlightModeConfig *flightConfig;
StandardParamConfig *standardParamConfig;
GeoFenceConfig *geoFenceConfig;
FailSafeConfig *failSafeConfig;
AdvancedParamConfig *advancedParamConfig;
ArduCopterPidConfig *arduCoperPidConfig;
QMap<QObject*,QWidget*> buttonToConfigWidgetMap;
};
#endif // APMSOFTWARECONFIG_H
......@@ -65,6 +65,134 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="basicPidsButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>Basic Pids</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="flightModesButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>Flight Modes</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="standardParamButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>Standard Params</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="geoFenceButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>GeoFence</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="failSafeButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>FailSafe</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="advancedParamButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>Advanced Params</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="advParamListButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>Adv Parameter List</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="arduCoperPidButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>ArduCoper Pids</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
......
#include "ArduCopterPidConfig.h"
#include "ui_ArduCopterPidConfig.h"
ArduCopterPidConfig::ArduCopterPidConfig(QWidget *parent) :
QWidget(parent),
ui(new Ui::ArduCopterPidConfig)
{
ui->setupUi(this);
}
ArduCopterPidConfig::~ArduCopterPidConfig()
{
delete ui;
}
#ifndef ARDUCOPTERPIDCONFIG_H
#define ARDUCOPTERPIDCONFIG_H
#include <QWidget>
namespace Ui {
class ArduCopterPidConfig;
}
class ArduCopterPidConfig : public QWidget
{
Q_OBJECT
public:
explicit ArduCopterPidConfig(QWidget *parent = 0);
~ArduCopterPidConfig();
private:
Ui::ArduCopterPidConfig *ui;
};
#endif // ARDUCOPTERPIDCONFIG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ArduCopterPidConfig</class>
<widget class="QWidget" name="ArduCopterPidConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>181</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>&lt;h2&gt;ArduCopter Pids&lt;/h2&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
#include "BasicPidConfig.h"
BasicPidConfig::BasicPidConfig(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
}
BasicPidConfig::~BasicPidConfig()
{
}
#ifndef BASICPIDCONFIG_H
#define BASICPIDCONFIG_H
#include <QWidget>
#include "ui_BasicPidConfig.h"
class BasicPidConfig : public QWidget
{
Q_OBJECT
public:
explicit BasicPidConfig(QWidget *parent = 0);
~BasicPidConfig();
private:
Ui::BasicPidConfig ui;
};
#endif // BASICPIDCONFIG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BasicPidConfig</class>
<widget class="QWidget" name="BasicPidConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>30</x>
<y>20</y>
<width>141</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;h2&gt; Basic Pids&lt;/h2&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
#include "FailSafeConfig.h"
FailSafeConfig::FailSafeConfig(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
}
FailSafeConfig::~FailSafeConfig()
{
}
#ifndef FAILSAFECONFIG_H
#define FAILSAFECONFIG_H
#include <QWidget>
#include "ui_FailSafeConfig.h"
class FailSafeConfig : public QWidget
{
Q_OBJECT
public:
explicit FailSafeConfig(QWidget *parent = 0);
~FailSafeConfig();
private:
Ui::FailSafeConfig ui;
};
#endif // FAILSAFECONFIG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FailSafeConfig</class>
<widget class="QWidget" name="FailSafeConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>141</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;h2&gt;Fail Safe&lt;/h2&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
#include "GeoFenceConfig.h"
GeoFenceConfig::GeoFenceConfig(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
}
GeoFenceConfig::~GeoFenceConfig()
{
}
#ifndef GEOFENCECONFIG_H
#define GEOFENCECONFIG_H
#include <QWidget>
#include "ui_GeoFenceConfig.h"
class GeoFenceConfig : public QWidget
{
Q_OBJECT
public:
explicit GeoFenceConfig(QWidget *parent = 0);
~GeoFenceConfig();
private:
Ui::GeoFenceConfig ui;
};
#endif // GEOFENCECONFIG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GeoFenceConfig</class>
<widget class="QWidget" name="GeoFenceConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>141</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>&lt;h2&gt;Geo Fence&lt;/h2&gt;</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
#include "StandardParamConfig.h"
StandardParamConfig::StandardParamConfig(QWidget *parent) : QWidget(parent)
{
ui.setupUi