UASQuickView.h 2.77 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#ifndef UASQUICKVIEW_H
#define UASQUICKVIEW_H

#include <QWidget>
#include <QTimer>
#include <QLabel>
#include "uas/UASManager.h"
#include "uas/UASInterface.h"
#include "ui_UASQuickView.h"
#include "UASQuickViewItem.h"
11 12
#include "MAVLinkDecoder.h"
#include "UASQuickViewItemSelect.h"
13 14 15 16 17
class UASQuickView : public QWidget
{
    Q_OBJECT
public:
    UASQuickView(QWidget *parent = 0);
18
    void addSource(MAVLinkDecoder *decoder);
19
private:
20 21 22 23
    /**
     * Adds a default set of actions to the widget's menu.
     */
    void addDefaultActions();
24
    UASInterface *uas;
25 26

    /** List of enabled properties */
27
    QList<QString> uasEnabledPropertyList;
28 29

    /** Maps from the property name to the current value */
30
    QMap<QString,double> uasPropertyValueMap;
31 32

    /** Maps from property name to the display item */
33
    QMap<QString,UASQuickViewItem*> uasPropertyToLabelMap;
34 35

    /** Timer for updating the UI */
36
    QTimer *updateTimer;
37
    Ui::UASQuickView* m_ui;
38 39

    /** Selection dialog for selectin/deselecting gauge items */
40
    UASQuickViewItemSelect *quickViewSelectDialog;
41 42 43 44 45 46

    /** Saves gauge layout to settings file */
    void saveSettings();

    /** Loads gauge layout from settings file */
    void loadSettings();
47 48
protected:
signals:
49

50
public slots:
51 52 53 54 55 56 57 58 59
    void valueChanged(const int uasId, const QString& name, const QString& unit, const quint8 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const qint8 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const quint16 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const qint16 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const quint32 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const qint32 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const quint64 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const qint64 value, const quint64 msec);
    void valueChanged(const int uasId, const QString& name, const QString& unit, const double value, const quint64 msec);
60
    void valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant value, const quint64 msec);
61

62
    void actionTriggered(bool checked);
63
    void actionTriggered();
64 65 66 67
    void updateTimerTick();
    void addUAS(UASInterface* uas);
    void setActiveUAS(UASInterface* uas);
    void valChanged(double val,QString type);
68 69 70
    void selectDialogClosed();
    void valueEnabled(QString value);
    void valueDisabled(QString value);
71 72 73
};

#endif // UASQUICKVIEW_H