UASQuickView.h 2.99 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 48 49 50 51 52 53

    /** Column Count */
    int m_columnCount;

    QList<QVBoxLayout*> m_verticalLayoutList;
    void sortItems(int columncount);
    QList<int> m_verticalLayoutItemCount;
    int m_currentColumn;
    QMap<QString,int> m_PropertyToLayoutIndexMap;

    //FlowLayout *layout;
54 55 56 57 58
protected:
    Ui::Form ui;
signals:
    
public slots:
59 60 61 62 63 64 65 66 67 68
    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);

69
    void valueChanged(const int uasid, const QString& name, const QString& unit, const QVariant value,const quint64 msecs);
70
    void actionTriggered(bool checked);
71
    void actionTriggered();
72 73 74 75
    void updateTimerTick();
    void addUAS(UASInterface* uas);
    void setActiveUAS(UASInterface* uas);
    void valChanged(double val,QString type);
76 77 78
    void selectDialogClosed();
    void valueEnabled(QString value);
    void valueDisabled(QString value);
79
    void columnActionTriggered();
80 81 82
};

#endif // UASQUICKVIEW_H