QGCPX4SensorCalibration.h 1.89 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
    void gyroButtonClicked();
    void magButtonClicked();
    void accelButtonClicked();
38
    void diffPressureButtonClicked();
39

40 41 42 43 44 45
    /**
     * @brief Hand context menu event
     * @param event
     */
    virtual void contextMenuEvent(QContextMenuEvent* event);

46 47 48 49 50 51
    void setAutopilotOrientation(int index);
    void setGpsOrientation(int index);
    void parameterChanged(int uas, int component, QString parameterName, QVariant value);

protected slots:

52 53
    void setInstructionImage(const QString &path);

54 55 56 57 58 59 60 61
    void setAutopilotImage(const QString &path);

    void setGpsImage(const int index);

    void setAutopilotImage(const int index);

    void setGpsImage(const QString &path);

62 63 64 65
protected:
    UASInterface* activeUAS;
    QAction* clearAction;
    QPixmap instructionIcon;
66 67
    QPixmap autopilotIcon;
    QPixmap gpsIcon;
68 69

    virtual void resizeEvent(QResizeEvent* event);
70 71 72 73

    void setMagCalibrated(bool calibrated);
    void setGyroCalibrated(bool calibrated);
    void setAccelCalibrated(bool calibrated);
74
    void setDiffPressureCalibrated(bool calibrated);
Lorenz Meier's avatar
Lorenz Meier committed
75 76

    void updateIcons();
77 78 79
    
private:
    Ui::QGCPX4SensorCalibration *ui;
Lorenz Meier's avatar
Lorenz Meier committed
80

81 82 83
};

#endif // QGCPX4SENSORCALIBRATION_H