QGCMessageView.h 1.08 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#ifndef QGCMESSAGEVIEW_H
#define QGCMESSAGEVIEW_H

#include <QWidget>
#include <UASInterface.h>
#include <QVBoxLayout>
#include <QAction>
#include "QGCUnconnectedInfoWidget.h"

namespace Ui {
class QGCMessageView;
}

class QGCMessageView : public QWidget
{
    Q_OBJECT
    
public:
    explicit QGCMessageView(QWidget *parent = 0);
    ~QGCMessageView();

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);

    /**
     * @brief Hand context menu event
     * @param event
     */
    virtual void contextMenuEvent(QContextMenuEvent* event);

protected:
    UASInterface* activeUAS;
    QVBoxLayout* initialLayout;
    QGCUnconnectedInfoWidget *connectWidget;
    QAction* clearAction;
    
private:
    Ui::QGCMessageView *ui;
};

#endif // QGCMESSAGEVIEW_H