QGCPX4AirframeConfig.h 1.88 KB
Newer Older
Lorenz Meier's avatar
Lorenz Meier committed
1 2 3 4
#ifndef QGCPX4AIRFRAMECONFIG_H
#define QGCPX4AIRFRAMECONFIG_H

#include <QWidget>
5
#include <UASInterface.h>
Lorenz Meier's avatar
Lorenz Meier committed
6 7 8 9 10 11 12 13 14 15 16 17

namespace Ui {
class QGCPX4AirframeConfig;
}

class QGCPX4AirframeConfig : public QWidget
{
    Q_OBJECT
    
public:
    explicit QGCPX4AirframeConfig(QWidget *parent = 0);
    ~QGCPX4AirframeConfig();
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

public slots:

    /**
     * @brief Set the system currently operated on by this widget
     * @param uas The currently active / configured system
     */
    void setActiveUAS(UASInterface* uas);

    /**
     * @brief Quadrotor in X configuration has been selected
     */
    void quadXSelected();

    /**
     * @brief Quadrotor in X configuration has been selected with sub-type
     * @param index The autostart index which maps to a particular sub-type
     */
    void quadXSelected(int index);

    void flyingWingSelected();
    void flyingWingSelected(int index);
    void planeSelected();
    void planeSelected(int index);

    void quadPlusSelected();
    void quadPlusSelected(int index);
    void hexaXSelected();
    void hexaXSelected(int index);
    void hexaPlusSelected();
    void hexaPlusSelected(int index);
    void octoXSelected();
    void octoXSelected(int index);
    void octoPlusSelected();
    void octoPlusSelected(int index);
    void hSelected();
    void hSelected(int index);

    /**
     * @brief Apply changes and reboot system
     */
    void applyAndReboot();

protected:

    /**
     * @brief Set the ID of the current airframe
     * @param id the ID as defined by the PX4 SYS_AUTOSTART enum
     */
    void setAirframeID(int id);

    /**
     * @brief Enable automatic configuration
     * @param enabled If true, the system sets the default gains for this platform on the next boot
     */
    void setAutoConfig(bool enabled);

Lorenz Meier's avatar
Lorenz Meier committed
75 76
    
private:
77
    UASInterface* mav;
78
    int selectedId;
Lorenz Meier's avatar
Lorenz Meier committed
79 80 81 82
    Ui::QGCPX4AirframeConfig *ui;
};

#endif // QGCPX4AIRFRAMECONFIG_H