Commit 44a11040 authored by Don Gagne's avatar Don Gagne

Remove unused code

parent bb3a268d
......@@ -717,7 +717,6 @@ INCLUDEPATH += \
FORMS += \
src/VehicleSetup/ParameterEditor.ui \
src/ui/QGCPX4VehicleConfig.ui \
src/VehicleSetup/SetupView.ui \
HEADERS+= \
......
#include "QGCConfigView.h"
#include "ui_QGCConfigView.h"
#include "UASManager.h"
#include "QGCPX4VehicleConfig.h"
#include "MainWindow.h"
QGCConfigView::QGCConfigView(QWidget *parent) :
QWidget(parent),
ui(new Ui::QGCConfigView),
config(NULL),
mav(NULL)
{
ui->setupUi(this);
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(activeUASChanged(UASInterface*)));
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
delete ui->waitingLabel;
ui->waitingLabel = NULL;
config = new QGCPX4VehicleConfig();
ui->gridLayout->addWidget(config);
}
QGCConfigView::~QGCConfigView()
{
delete ui;
}
void QGCConfigView::activeUASChanged(UASInterface* uas)
{
if (mav == uas)
return;
int type = -1;
if (mav)
type = mav->getAutopilotType();
mav = uas;
if (uas && type != uas->getAutopilotType()) {
if (ui->waitingLabel) {
ui->gridLayout->removeWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(false);
}
//remove all child widgets since they could contain stale data
//for example, when we switch from one PX4 UAS to another UAS
foreach (QObject* obj, ui->gridLayout->children()) {
QWidget* w = dynamic_cast<QWidget*>(obj);
if (w) {
if (obj != ui->waitingLabel) {
ui->gridLayout->removeWidget(w);
delete obj;
}
}
}
QGCPX4VehicleConfig* px4config = qobject_cast<QGCPX4VehicleConfig*>(config);
if (!px4config) {
if (config)
delete config;
config = new QGCPX4VehicleConfig();
ui->gridLayout->addWidget(config);
}
}
else {
if (ui->waitingLabel) {
//restore waiting label if we no longer have a connection
ui->gridLayout->addWidget(ui->waitingLabel);
ui->waitingLabel->setVisible(true);
}
}
}
#ifndef QGCCONFIGVIEW_H
#define QGCCONFIGVIEW_H
#include <QWidget>
#include <UASInterface.h>
namespace Ui {
class QGCConfigView;
}
class QGCConfigView : public QWidget
{
Q_OBJECT
public:
explicit QGCConfigView(QWidget *parent = 0);
~QGCConfigView();
public slots:
void activeUASChanged(UASInterface* uas);
private:
Ui::QGCConfigView *ui;
QWidget *config;
UASInterface* mav;
};
#endif // QGCCONFIGVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCConfigView</class>
<widget class="QWidget" name="QGCConfigView">
<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>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="waitingLabel">
<property name="text">
<string>Waiting for connection...</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
This diff is collapsed.
#ifndef QGCPX4VehicleConfig_H
#define QGCPX4VehicleConfig_H
#include <QWidget>
#include <QTimer>
#include <QList>
#include <QGroupBox>
#include <QPushButton>
#include <QStringList>
#include <QGraphicsScene>
#include "QGCToolWidget.h"
#include "UASInterface.h"
#include "px4_configuration/QGCPX4AirframeConfig.h"
class UASParameterCommsMgr;
class QGCPX4SensorCalibration;
class PX4RCCalibration;
namespace Ui {
class QGCPX4VehicleConfig;
}
class QGCPX4VehicleConfig : public QWidget
{
Q_OBJECT
public:
explicit QGCPX4VehicleConfig(QWidget *parent = 0);
~QGCPX4VehicleConfig();
enum RC_MODE {
RC_MODE_1 = 1,
RC_MODE_2 = 2,
RC_MODE_3 = 3,
RC_MODE_4 = 4,
RC_MODE_NONE = 5
};
public slots:
void rcMenuButtonClicked();
void sensorMenuButtonClicked();
void tuningMenuButtonClicked();
void flightModeMenuButtonClicked();
void safetyConfigMenuButtonClicked();
void advancedMenuButtonClicked();
void airframeMenuButtonClicked();
void firmwareMenuButtonClicked();
/** Set the MAV currently being calibrated */
void setActiveUAS(UASInterface* active);
protected slots:
void menuButtonClicked();
/** Parameter changed onboard */
void parameterChanged(int uas, int component, QString parameterName, QVariant value);
void updateStatus(const QString& str);
void updateError(const QString& str);
protected:
bool doneLoadingConfig;
UASInterface* mav; ///< The current MAV
QGCUASParamManagerInterface* paramMgr; ///< params mgr for the mav
QList<QGCToolWidget*> toolWidgets; ///< Configurable widgets
QMap<QString,QGCToolWidget*> toolWidgetsByName; ///<
QMap<QString,QGCToolWidget*> paramToWidgetMap; ///< Holds the current active MAV's parameter widgets.
QList<QWidget*> additionalTabs; ///< Stores additional tabs loaded for this vehicle/autopilot configuration. Used for cleaning up.
QMap<QString,QGCToolWidget*> libParamToWidgetMap; ///< Holds the library parameter widgets
QMap<QString,QMap<QString,QGCToolWidget*> > systemTypeToParamMap; ///< Holds all loaded MAV specific parameter widgets, for every MAV.
QMap<QGCToolWidget*,QGroupBox*> toolToBoxMap; ///< Easy method of figuring out which QGroupBox is tied to which ToolWidget.
QMap<QString,QString> paramTooltips; ///< Tooltips for the ? button next to a parameter.
QGCPX4AirframeConfig* px4AirframeConfig;
QPixmap planeBack;
QPixmap planeSide;
QGCPX4SensorCalibration* px4SensorCalibration;
PX4RCCalibration* px4RCCalibration;
QGraphicsScene scene;
QPushButton* skipActionButton;
private:
Ui::QGCPX4VehicleConfig *ui;
QMap<QPushButton*,QWidget*> buttonToWidgetMap;
signals:
void visibilityChanged(bool visible);
};
#endif // QGCPX4VehicleConfig_H
This diff is collapsed.
This diff is collapsed.
#ifndef QGCPX4SENSORCALIBRATION_H
#define QGCPX4SENSORCALIBRATION_H
#include <QWidget>
#include <UASInterface.h>
#include <QAction>
namespace Ui {
class QGCPX4SensorCalibration;
}
class QGCPX4SensorCalibration : public QWidget
{
Q_OBJECT
public:
explicit QGCPX4SensorCalibration(QWidget *parent = 0);
~QGCPX4SensorCalibration();
public slots:
/**
* @brief Set currently active UAS
* @param uas the current active UAS
*/
void setActiveUAS(UASInterface* uas);
/**
* @brief Handle text message from current active UAS
* @param uasid
* @param componentid
* @param severity
* @param text
*/
void handleTextMessage(int uasid, int componentid, int severity, QString text);
/**
* @brief Update system specs / properties
* @param id the UID of the aircraft
*/
void updateSystemSpecs(int id);
void gyroButtonClicked();
void magButtonClicked();
void accelButtonClicked();
void diffPressureButtonClicked();
/**
* @brief Hand context menu event
* @param event
*/
virtual void contextMenuEvent(QContextMenuEvent* event);
void setAutopilotOrientation(int index);
void setGpsOrientation(int index);
void parameterChanged(int uas, int component, QString parameterName, QVariant value);
protected slots:
void setInstructionImage(const QString &path);
void setAutopilotImage(const QString &path);
void setGpsImage(const int index);
void setAutopilotImage(const int index);
void setGpsImage(const QString &path);
protected:
UASInterface* activeUAS;
QAction* clearAction;
QPixmap instructionIcon;
QPixmap autopilotIcon;
QPixmap gpsIcon;
virtual void resizeEvent(QResizeEvent* event);
void setMagCalibrated(bool calibrated);
void setGyroCalibrated(bool calibrated);
void setAccelCalibrated(bool calibrated);
void setDiffPressureCalibrated(bool calibrated);
void updateIcons();
private:
void _requestAllSensorParameters(void);
Ui::QGCPX4SensorCalibration *ui;
};
#endif // QGCPX4SENSORCALIBRATION_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCPX4SensorCalibration</class>
<widget class="QWidget" name="QGCPX4SensorCalibration">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>659</width>
<height>636</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton#magButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #73D95D, stop: 1 #18A154);
border-radius: 8px;
min-height: 25px;
max-height: 30px;
min-width: 60px;
max-width: 140px;
margin: 5px;
border: 2px solid #465158;
}
QPushButton#gyroButton, QPushButton#accelButton, QPushButton#diffPressureButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D3795D, stop: 1 #A81154);
border-radius: 8px;
min-height: 25px;
max-height: 30px;
min-width: 60px;
max-width: 140px;
margin: 5px;
border: 2px solid #465158;
}</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="40,5,1,1,1,1,1,1" columnstretch="1,2,30,1,1,10">
<item row="0" column="4" rowspan="6" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,10,10">
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Autopilot Orientation</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="autopilotLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>250</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="autopilotComboBox"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Magnetometer Orientation</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="gpsLabel">
<property name="minimumSize">
<size>
<width>150</width>
<height>120</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="magComboBox"/>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="6" column="2" colspan="4">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>498</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="2" colspan="4">
<widget class="QLabel" name="iconLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="QPlainTextEdit" name="textView">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout_2" columnstretch="1,1,1,1">
<item row="0" column="2">
<widget class="QLabel" name="accelLabel">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="gyroLabel">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="gyroButton">
<property name="text">
<string>Gyroscope</string>
</property>
<property name="icon">
<iconset resource="../../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/calibration/arrows.png</normaloff>:/files/images/px4/calibration/arrows.png</iconset>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="magButton">
<property name="text">
<string>Magnetometer</string>
</property>
<property name="icon">
<iconset resource="../../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/calibration/arrows.png</normaloff>:/files/images/px4/calibration/arrows.png</iconset>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="accelButton">
<property name="text">
<string>Accelerometer</string>
</property>
<property name="icon">
<iconset resource="../../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/calibration/arrows.png</normaloff>:/files/images/px4/calibration/arrows.png</iconset>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="diffPressureButton">
<property name="text">
<string>Diff. pressure</string>
</property>
<property name="icon">
<iconset resource="../../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/calibration/arrows.png</normaloff>:/files/images/px4/calibration/arrows.png</iconset>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="diffPressureLabel">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="magLabel">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0" colspan="4">
<widget class="QLabel" name="instructionLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="logCheckBox">
<property name="text">
<string>Log</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources>
<include location="../../../qgroundcontrol.qrc"/>
</resources>
<connections/>
</ui>
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