QGCPX4SensorCalibration.h 2.03 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
#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);
26

27 28 29 30 31 32 33 34 35
    /**
     * @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);

36 37 38 39 40 41
    /**
     * @brief Update system specs / properties
     * @param id the UID of the aircraft
     */
    void updateSystemSpecs(int id);

42 43 44
    void gyroButtonClicked();
    void magButtonClicked();
    void accelButtonClicked();
45
    void diffPressureButtonClicked();
46

47 48 49 50 51 52
    /**
     * @brief Hand context menu event
     * @param event
     */
    virtual void contextMenuEvent(QContextMenuEvent* event);

53 54 55 56 57 58
    void setAutopilotOrientation(int index);
    void setGpsOrientation(int index);
    void parameterChanged(int uas, int component, QString parameterName, QVariant value);

protected slots:

59 60
    void setInstructionImage(const QString &path);

61 62 63 64 65 66 67 68
    void setAutopilotImage(const QString &path);

    void setGpsImage(const int index);

    void setAutopilotImage(const int index);

    void setGpsImage(const QString &path);

69 70 71 72
protected:
    UASInterface* activeUAS;
    QAction* clearAction;
    QPixmap instructionIcon;
73 74
    QPixmap autopilotIcon;
    QPixmap gpsIcon;
75 76

    virtual void resizeEvent(QResizeEvent* event);
77 78 79 80

    void setMagCalibrated(bool calibrated);
    void setGyroCalibrated(bool calibrated);
    void setAccelCalibrated(bool calibrated);
81
    void setDiffPressureCalibrated(bool calibrated);
Lorenz Meier's avatar
Lorenz Meier committed
82 83

    void updateIcons();
84 85 86
    
private:
    Ui::QGCPX4SensorCalibration *ui;
Lorenz Meier's avatar
Lorenz Meier committed
87

88 89 90
};

#endif // QGCPX4SENSORCALIBRATION_H