JoystickButton.h 892 Bytes
Newer Older
1 2 3 4 5
#ifndef JOYSTICKBUTTON_H
#define JOYSTICKBUTTON_H

#include <QWidget>

6 7
#include "UASInterface.h"

8 9 10 11 12 13 14 15
namespace Ui
{
class JoystickButton;
}

class JoystickButton : public QWidget
{
    Q_OBJECT
16

17 18 19
public:
    explicit JoystickButton(int id, QWidget *parent = 0);
    virtual ~JoystickButton();
20

21 22 23
public slots:
    /** @brief Specify the UAS that this axis should track for displaying throttle properly. */
    void setActiveUAS(UASInterface* uas);
24 25
    /** @brieft Specify which action this button should correspond to.
     * Values 0 and higher indicate a specific action, while -1 indicates no action. */
26
    void setAction(int index);
27 28 29 30 31

signals:
    /** @brief Signal a change in this buttons' action mapping */
    void actionChanged(int id, int index);

32 33 34
private:
    int id;
    Ui::JoystickButton *m_ui;
35 36 37

private slots:
    void actionComboBoxChanged(int index);
38 39
};
#endif // JOYSTICKBUTTON_H