Newer
Older
Michael Carpenter
committed
#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"
#include "MAVLinkDecoder.h"
#include "UASQuickViewItemSelect.h"
Michael Carpenter
committed
class UASQuickView : public QWidget
{
Q_OBJECT
public:
UASQuickView(QWidget *parent = 0);
Michael Carpenter
committed
~UASQuickView();
void addSource(MAVLinkDecoder *decoder);
Michael Carpenter
committed
private:
UASInterface *uas;
/** List of enabled properties */
QList<QString> uasEnabledPropertyList;
/** Maps from the property name to the current value */
Michael Carpenter
committed
QMap<QString,double> uasPropertyValueMap;
/** Maps from property name to the display item */
Michael Carpenter
committed
QMap<QString,UASQuickViewItem*> uasPropertyToLabelMap;
/** Timer for updating the UI */
Michael Carpenter
committed
QTimer *updateTimer;
/** Selection dialog for selectin/deselecting gauge items */
UASQuickViewItemSelect *quickViewSelectDialog;
/** Saves gauge layout to settings file */
void saveSettings();
/** Loads gauge layout from settings file */
void loadSettings();
Michael Carpenter
committed
void recalculateItemTextSizing();
/** 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;
Michael Carpenter
committed
protected:
Ui::Form ui;
Michael Carpenter
committed
void resizeEvent(QResizeEvent *evt);
Michael Carpenter
committed
signals:
public slots:
void valueChanged(const int uasid, const QString& name, const QString& unit, const QVariant& value,const quint64 msecs);
Michael Carpenter
committed
void actionTriggered(bool checked);
void actionTriggered();
Michael Carpenter
committed
void updateTimerTick();
void addUAS(UASInterface* uas);
void setActiveUAS(UASInterface* uas);
void selectDialogClosed();
void valueEnabled(QString value);
void valueDisabled(QString value);
void columnActionTriggered();
Michael Carpenter
committed
};
#endif // UASQUICKVIEW_H