OP-1900 have path_progress updated correctly for leg_remaining and error_below end...
[librepilot.git] / ground / openpilotgcs / src / plugins / uavobjectbrowser / uavobjectbrowserwidget.h
blob92cb4af3f620ca0bfc476f582408862143cc512a
1 /**
2 ******************************************************************************
4 * @file uavobjectbrowserwidget.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
9 * @{
10 * @brief The UAVObject Browser gadget plugin
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef UAVOBJECTBROWSERWIDGET_H_
29 #define UAVOBJECTBROWSERWIDGET_H_
31 #include <QWidget>
32 #include <QTreeView>
33 #include "objectpersistence.h"
34 #include "uavobjecttreemodel.h"
36 class QPushButton;
37 class ObjectTreeItem;
38 class Ui_UAVObjectBrowser;
39 class Ui_viewoptions;
41 class UAVObjectBrowserWidget : public QWidget {
42 Q_OBJECT
44 public:
45 UAVObjectBrowserWidget(QWidget *parent = 0);
46 ~UAVObjectBrowserWidget();
48 void setUnknownObjectColor(QColor color)
50 m_unknownObjectColor = color;
51 m_model->setUnknowObjectColor(color);
53 void setRecentlyUpdatedColor(QColor color)
55 m_recentlyUpdatedColor = color;
56 m_model->setRecentlyUpdatedColor(color);
58 void setManuallyChangedColor(QColor color)
60 m_manuallyChangedColor = color;
61 m_model->setManuallyChangedColor(color);
63 void setRecentlyUpdatedTimeout(int timeout)
65 m_recentlyUpdatedTimeout = timeout;
66 m_model->setRecentlyUpdatedTimeout(timeout);
68 void setOnlyHilightChangedValues(bool hilight)
70 m_onlyHilightChangedValues = hilight;
71 m_model->setOnlyHilightChangedValues(hilight);
73 void setViewOptions(bool categorized, bool scientific, bool metadata, bool description);
74 void setSplitterState(QByteArray state);
75 public slots:
76 void showMetaData(bool show);
77 void showDescription(bool show);
78 void categorize(bool categorize);
79 void useScientificNotation(bool scientific);
81 private slots:
82 void sendUpdate();
83 void requestUpdate();
84 void saveObject();
85 void loadObject();
86 void eraseObject();
87 void currentChanged(const QModelIndex &current, const QModelIndex &previous);
88 void viewSlot();
89 void viewOptionsChangedSlot();
90 void splitterMoved();
91 QString createObjectDescription(UAVObject *object);
92 signals:
93 void viewOptionsChanged(bool categorized, bool scientific, bool metadata, bool description);
94 void splitterChanged(QByteArray state);
95 private:
96 QPushButton *m_requestUpdate;
97 QPushButton *m_sendUpdate;
98 Ui_UAVObjectBrowser *m_browser;
99 Ui_viewoptions *m_viewoptions;
100 QDialog *m_viewoptionsDialog;
101 UAVObjectTreeModel *m_model;
103 int m_recentlyUpdatedTimeout;
104 QColor m_unknownObjectColor;
105 QColor m_recentlyUpdatedColor;
106 QColor m_manuallyChangedColor;
107 bool m_onlyHilightChangedValues;
108 QString m_mustacheTemplate;
110 void updateObjectPersistance(ObjectPersistence::OperationOptions op, UAVObject *obj);
111 void enableSendRequest(bool enable);
112 void updateDescription();
113 ObjectTreeItem *findCurrentObjectTreeItem();
114 QString loadFileIntoString(QString fileName);
117 #endif /* UAVOBJECTBROWSERWIDGET_H_ */