2 ******************************************************************************
4 * @file uavobjectbrowserwidget.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
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
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_
33 #include "objectpersistence.h"
34 #include "uavobjecttreemodel.h"
38 class Ui_UAVObjectBrowser
;
41 class UAVObjectBrowserWidget
: public QWidget
{
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
);
76 void showMetaData(bool show
);
77 void showDescription(bool show
);
78 void categorize(bool categorize
);
79 void useScientificNotation(bool scientific
);
87 void currentChanged(const QModelIndex
¤t
, const QModelIndex
&previous
);
89 void viewOptionsChangedSlot();
91 QString
createObjectDescription(UAVObject
*object
);
93 void viewOptionsChanged(bool categorized
, bool scientific
, bool metadata
, bool description
);
94 void splitterChanged(QByteArray state
);
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_ */