UASQuickView.h 2.67 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 20
private:
    UASInterface *uas;
21 22

    /** List of enabled properties */
23
    QList<QString> uasEnabledPropertyList;
24 25

    /** Maps from the property name to the current value */
26
    QMap<QString,double> uasPropertyValueMap;
27 28

    /** Maps from property name to the display item */
29
    QMap<QString,UASQuickViewItem*> uasPropertyToLabelMap;
30 31

    /** Timer for updating the UI */
32
    QTimer *updateTimer;
33
    Ui::UASQuickView* m_ui;
34 35

    /** Selection dialog for selectin/deselecting gauge items */
36
    UASQuickViewItemSelect *quickViewSelectDialog;
37 38 39 40 41 42

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

    /** Loads gauge layout from settings file */
    void loadSettings();
43 44
protected:
signals:
45

46
public slots:
47 48 49 50 51 52 53 54 55
    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);
56
    void valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant value, const quint64 msec);
57

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

#endif // UASQUICKVIEW_H