|
|
|
@ -81,6 +81,7 @@ class UASMessageHandler : public QGCSingleton
@@ -81,6 +81,7 @@ class UASMessageHandler : public QGCSingleton
|
|
|
|
|
{ |
|
|
|
|
Q_OBJECT |
|
|
|
|
DECLARE_QGC_SINGLETON(UASMessageHandler, UASMessageHandler) |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
explicit UASMessageHandler(QObject *parent = 0); |
|
|
|
|
~UASMessageHandler(); |
|
|
|
@ -120,6 +121,10 @@ public:
@@ -120,6 +121,10 @@ public:
|
|
|
|
|
* @brief Get latest error message |
|
|
|
|
*/ |
|
|
|
|
QString getLatestError() { return _latestError; } |
|
|
|
|
|
|
|
|
|
/// Begin to show message which are errors in the toolbar
|
|
|
|
|
void showErrorsInToolbar(void) { _showErrorsInToolbar = true; } |
|
|
|
|
|
|
|
|
|
public slots: |
|
|
|
|
/**
|
|
|
|
|
* @brief Set currently active UAS |
|
|
|
@ -134,6 +139,7 @@ public slots:
@@ -134,6 +139,7 @@ public slots:
|
|
|
|
|
* @param text Message Text |
|
|
|
|
*/ |
|
|
|
|
void handleTextMessage(int uasid, int componentid, int severity, QString text); |
|
|
|
|
|
|
|
|
|
signals: |
|
|
|
|
/**
|
|
|
|
|
* @brief Sent out when new message arrives |
|
|
|
@ -145,16 +151,18 @@ signals:
@@ -145,16 +151,18 @@ signals:
|
|
|
|
|
* @param count The new message count |
|
|
|
|
*/ |
|
|
|
|
void textMessageCountChanged(int count); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
// Stores the UAS that we're currently receiving messages from.
|
|
|
|
|
UASInterface* _activeUAS; |
|
|
|
|
QVector<UASMessage*> _messages; |
|
|
|
|
QMutex _mutex; |
|
|
|
|
int _errorCount; |
|
|
|
|
int _errorCountTotal; |
|
|
|
|
int _warningCount; |
|
|
|
|
int _normalCount; |
|
|
|
|
QMutex _mutex; |
|
|
|
|
int _errorCount; |
|
|
|
|
int _errorCountTotal; |
|
|
|
|
int _warningCount; |
|
|
|
|
int _normalCount; |
|
|
|
|
QString _latestError; |
|
|
|
|
bool _showErrorsInToolbar; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#endif // QGCMESSAGEHANDLER_H
|
|
|
|
|