QGCPX4VehicleConfig.h 2.89 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>
Lorenz Meier's avatar
Lorenz Meier committed
10
#include <QGraphicsScene>
11 12 13

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

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

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

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

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

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

    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.

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

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

#endif // QGCPX4VehicleConfig_H