UASQuickView.h 2.68 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
    ~UASQuickView();
19
    void addSource(MAVLinkDecoder *decoder);
20 21
private:
    UASInterface *uas;
22 23

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

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

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

    /** Timer for updating the UI */
33
    QTimer *updateTimer;
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 45 46 47
protected:
    Ui::Form ui;
signals:
    
public slots:
48 49 50 51 52 53 54 55 56 57
    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);

58
    void valueChanged(const int uasid, const QString& name, const QString& unit, const QVariant value,const quint64 msecs);
59
    void actionTriggered(bool checked);
60
    void actionTriggered();
61 62 63 64
    void updateTimerTick();
    void addUAS(UASInterface* uas);
    void setActiveUAS(UASInterface* uas);
    void valChanged(double val,QString type);
65 66 67
    void selectDialogClosed();
    void valueEnabled(QString value);
    void valueDisabled(QString value);
68 69 70
};

#endif // UASQUICKVIEW_H