QGCPX4VehicleConfig.h 2.94 KB
Newer Older
1 2 3 4 5 6 7 8
#ifndef QGCPX4VehicleConfig_H
#define QGCPX4VehicleConfig_H

#include <QWidget>
#include <QTimer>
#include <QList>
#include <QGroupBox>
#include <QPushButton>
9
#include <QStringList>
10
#include <QMessageBox>
Lorenz Meier's avatar
Lorenz Meier committed
11
#include <QGraphicsScene>
12 13 14

#include "QGCToolWidget.h"
#include "UASInterface.h"
15
#include "px4_configuration/QGCPX4AirframeConfig.h"
16

17
class UASParameterCommsMgr;
18
class QGCPX4SensorCalibration;
19
class PX4RCCalibration;
20

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
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();
44
    void tuningMenuButtonClicked();
Lorenz Meier's avatar
Lorenz Meier committed
45 46
    void flightModeMenuButtonClicked();
    void safetyConfigMenuButtonClicked();
47
    void advancedMenuButtonClicked();
48
    void airframeMenuButtonClicked();
49 50
    void firmwareMenuButtonClicked();

51 52
    /** Set the MAV currently being calibrated */
    void setActiveUAS(UASInterface* active);
53

54 55 56 57 58 59 60 61
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:
62

63 64
    bool doneLoadingConfig;
    UASInterface* mav;                  ///< The current MAV
65
    QGCUASParamManagerInterface* paramMgr;       ///< params mgr for the mav
66
    QList<QGCToolWidget*> toolWidgets;  ///< Configurable widgets
67
    QMap<QString,QGCToolWidget*> toolWidgetsByName; ///<
68 69 70 71 72 73 74 75

    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.

76
    QGCPX4AirframeConfig* px4AirframeConfig;
Lorenz Meier's avatar
Lorenz Meier committed
77 78
    QPixmap planeBack;
    QPixmap planeSide;
79
    QGCPX4SensorCalibration* px4SensorCalibration;
80
    PX4RCCalibration* px4RCCalibration;
81
    QMessageBox msgBox;
Lorenz Meier's avatar
Lorenz Meier committed
82
    QGraphicsScene scene;
83
    QPushButton* skipActionButton;
84

85 86 87 88 89 90 91 92
private:
    Ui::QGCPX4VehicleConfig *ui;
    QMap<QPushButton*,QWidget*> buttonToWidgetMap;
signals:
    void visibilityChanged(bool visible);
};

#endif // QGCPX4VehicleConfig_H