QGCPX4SensorCalibration.h 1.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#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);

35 36 37 38
    void gyroButtonClicked();
    void magButtonClicked();
    void accelButtonClicked();

39 40 41 42 43 44 45 46 47 48 49 50
    /**
     * @brief Hand context menu event
     * @param event
     */
    virtual void contextMenuEvent(QContextMenuEvent* event);

    void setInstructionImage(const QString &path);

protected:
    UASInterface* activeUAS;
    QAction* clearAction;
    QPixmap instructionIcon;
51 52 53 54 55
    bool accelStarted;
    bool accelDone[6];
    bool gyroStarted;
    bool magStarted;
    QStringList accelAxes;
56 57 58 59 60 61 62 63

    virtual void resizeEvent(QResizeEvent* event);
    
private:
    Ui::QGCPX4SensorCalibration *ui;
};

#endif // QGCPX4SENSORCALIBRATION_H